0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git/ synced 2025-10-05 23:42:55 +02:00

32995 Commits

Author SHA1 Message Date
Markus Stockhausen
c18476d0c5 realtek: RTL931x: disable USXGMII SerDes setup
The first RTL931x devices make their way into OpenWrt. Their copper
ports are driven by different interfaces modes like 10G_QXGMII or
Realtek proprietary XSGMII. The DSA driver has no proper handling
for theses modes implemented yet. So a lot is auto-mapped to USXGMII
internally. As soon as the SerDes setup activates this (wrong) mode
the PHY connectivity breaks.

Disable this mode for now and rely on the proper U-Boot setup.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/20292
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-05 12:15:03 +02:00
Markus Stockhausen
8916b26a66 realtek: drop source-only from NAND targets
Now the NAND targets have real devices that need to be built.
Remove the source-only flag to make the images available.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/20255
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-05 12:14:05 +02:00
Markus Stockhausen
f88135b7cd realtek: add support for Linksys LGS352C
Hardware specification
----------------------

* RTL9311 SoC, 2 MIPS Interaptiv cores @ 1000MHz
* 512MB DRAM
* 2MB NOR Flash
* 128MB NAND Flash
* 48 x 10/100/1000BASE-T ports
* 4 x 10G SFP+ ports
* LM63 controlled fan
* Power LED, Fault LED
* Reset button on front panel
* UART (115200 8N1) via RJ45

Installation using serial interface
-----------------------------------

1. Press "a" "c" "p" during message "Enter correct key to stop autoboot"
2. Start network "rtk network on"
3. Load image "tftpboot <TFTP IP>:openwrt-realtek-rtl931x_nand-linksys_lgs352c-initramfs-kernel.bin"
4. Boot image "bootm"
5. Switch to first bootpartition "fw_setsys bootpartition 0"
5. Download sysupgrade "scp <IP>:openwrt-realtek-rtl931x_nand-linksys_lgs352c-squashfs-sysupgrade.bin /tmp/."
6. Install sysupgrade "sysupgrade /tmp/openwrt-realtek-rtl931x_nand-linksys_lgs352c-squashfs-sysupgrade.bin"

Installation using OEM webinterface
-----------------------------------

This is not possible because the OpenWrt NAND Flash layout is different
from the vendor layout. To be precise. Vendor uses:

- 64 MB vendor UBI root_data
- 32 MB vendor kernel+root 1 (~19 MB used)
- 32 MB vendor kernel+root 2 (~19 MB used)

OpenWrt uses:

- 64 MB vendor UBI (not touched)
- 10 MB OpenWrt kernel
- 22 MB Openwrt mtd-concat UBI
- 23 MB vendor kernel 2 (space reduced, vendor data unchanged)
- 09 MB OpenWrt mtd-concat UBI

Dual-boot with stock firmware using writable u-boot-env
-------------------------------------------------------

From stock to OpenWrt / primary image 1 (CLI as admin):
   - > boot system image1
   - > reboot

From OpenWrt to stock / boot image 2: (shell as root)
   - # fw_setsys bootpartition 1
   - # reboot

Debrick using serial interface
------------------------------

1. Press "a" "c" "p" during message "Enter correct key to stop autoboot"
2. Load vendor image with "upgrade runtime <TFTP IP>:LGS352xxxxx.imag"
3. switch to primary partition "setsys bootpartition 0"
4. safe config "savesys"

Further documentation
---------------------
See https://openwrt.org/toh/linksys/lgs352c

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/20255
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-05 12:14:05 +02:00
Markus Stockhausen
853d73f9d1 realtek: add support for Linksys LGS328C
Hardware specification
----------------------

* RTL9301 SoC, 1 MIPS 34KEc core @ 800MHz
* 512MB DRAM
* 2MB NOR Flash
* 128MB NAND Flash
* 24 x 10/100/1000BASE-T ports
* 4 x 10G SFP+ ports
* Power LED, Fault LED
* Reset button on front panel
* UART (115200 8N1) via RJ45

Installation using serial interface
-----------------------------------

1. Press "a" "c" "p" during message "Enter correct key to stop autoboot"
2. Start network "rtk network on"
3. Load image "tftpboot <TFTP IP>:openwrt-realtek-rtl930x_nand-linksys_lgs328c-initramfs-kernel.bin"
4. Boot image "bootm"
5. Switch to first bootpartition "fw_setsys bootpartition 0"
5. Download sysupgrade "scp <IP>:openwrt-realtek-rtl930x_nand-linksys_lgs328c-squashfs-sysupgrade.bin /tmp/."
6. Install sysupgrade "sysupgrade /tmp/openwrt-realtek-rtl930x_nand-linksys_lgs328c-squashfs-sysupgrade.bin"

Installation using OEM webinterface
-----------------------------------

This is not possible because the OpenWrt NAND Flash layout is different
from the vendor layout. To be precise. Vendor uses:

- 64 MB vendor UBI root_data
- 32 MB vendor kernel+root 1 (~19 MB used)
- 32 MB vendor kernel+root 2 (~19 MB used)

OpenWrt uses:

- 64 MB vendor UBI (not touched)
- 10 MB OpenWrt kernel
- 22 MB Openwrt mtd-concat UBI
- 23 MB vendor kernel 2 (space reduced, vendor data unchanged)
- 09 MB OpenWrt mtd-concat UBI

Dual-boot with stock firmware using writable u-boot-env
-------------------------------------------------------

From stock to OpenWrt / primary image 1 (CLI as admin):
   - > boot system image1
   - > reboot

From OpenWrt to stock / boot image 2: (shell as root)
   - # fw_setsys bootpartition 1
   - # reboot

Debrick using serial interface
------------------------------

1. Press "a" "c" "p" during message "Enter correct key to stop autoboot"
2. Load vendor image with "upgrade runtime <TFTP IP>:LGS328xxxxx.imag"
3. switch to primary partition "setsys bootpartition 0"
4. safe config "savesys"

Further documentation
---------------------
See https://openwrt.org/toh/linksys/lgs352c

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/20255
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-05 12:14:05 +02:00
Markus Stockhausen
af7a74bad1 realtek: Enhance MTD/ECC kernel configuration for NAND targets
The Realtek NAND kernel configuration has some shortcomings.
Fix this as follows:

- MTD_NAND_ECC_REALTEK selects MTD_NAND_ECC and this selects
  MTD_NAND_CORE. For consistency add both config options.

- The partition layout of the Linksys switches requires some tricky
  concatenation to keep dual boot active. Add CONFIG_MTD_VIRT_CONCAT

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/20255
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-05 12:14:05 +02:00
Andrea Pesaresi
18bdeda011 kernel: ksmbd: revert upstream limit repeated connection
The upstream commit https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/fs/smb?h=linux-6.6.y&id=fa1c47af4ff641cf9197ecdb1f8240cbb30389c1
and the extended for ipv6 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/fs/smb?h=linux-6.6.y&id=d9e157fcfebc126cd19b2333a6417a840c24e529
cause a regression if you try to get a connection on nautilus by a double click on share name.
When you do a double click on share name Nautilus try to connect two times, and ksmbd refusing it.
An issue is opened here https://github.com/namjaejeon/ksmbd/issues/512, at the moment, until we don't have a fix upstream I suggest to revert these two commits.

Signed-off-by: Andrea Pesaresi <andreapesaresi82@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20192
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-05 00:17:02 +02:00
Andrii Kuiukoff
ebd45615d9 mediatek: CreatLentem clt-r30b1: Add Livinet Li228 as alt vendor model
Add Livinet Li228 as ALT2.
Fix typo in ALT1_MODEL: DXG21 -> DGX21

Signed-off-by: Andrii Kuiukoff <andros.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20262
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 20:51:35 +02:00
Rosen Penev
5263c4b993 ath79: asus: convert to nvmem for calibration
Userspace handling is deprecated.

Also handle 2.4ghz LED in ath9k instead of generic.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20269
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 20:46:19 +02:00
Sven Eckelmann (Plasma Cloud)
c7c54f3134 ramips: add support for Plasma Cloud PAX1800-Lite
Plasma Cloud PAX1800-Lite is a dual-band Wi-Fi 6 router, based on MediaTek
MT7621A + MT79x5D platform.

Specifications:

- SOC:      MT7621AT (880 MHz)
- DRAM:     DDR3 448 MiB (Nanya NT5CC256M16DP-DI)
- Flash:    2 MiB SPI NOR (S25FL016K) + 128 MB SPI NAND (W25N02KVZEIR)
- Ethernet: 1x 10/100/1000 Mbps (SOC's built-in switch, with PoE+)
- Wi-Fi:    2x2:2 2.4/5 GHz (MT7905DAN + MT7975DN)
            (MT7905DAN doesn't support background DFS scan/BT)
- LED:      tri-color LED for status (red, blue, green)
- Buttons:  1x (reset)
- Antenna:  4x internal, non-detachable omnidirectional
- UART:     1x 4-pin (2.54 mm pitch, marked as "3V3 G/RX GND W/TX")
- Power:    12 V DC/2 A (DC jack)

MAC addresses:

WAN:     54:9C:27:xx:xx:00 (factory 0x3fff4, device label)
2.4 GHz: 54:9C:27:xx:xx:02 (factory 0x4, device label +2)
5 GHz:   54:9C:27:xx:xx:08 (factory 0xa, device label +8)

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console (115200 8N1) must be used to access the u-boot shell
during bootup. It can then be used to first boot up the initramfs image
from a TFTP server (here with the IP 192.168.1.21):

    setenv serverip 192.168.1.21
    setenv ipaddr 192.168.1.1
    tftpboot 0x83001000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

    scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

    sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann (Plasma Cloud) <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20152
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 20:30:36 +02:00
Coia Prant
c907c7c9b3 ramips: Fix Hongdian H7920 v40 mac address
After extracting the EEPROMs of different devices, only the 0x4 address is unique.

Use the 0x4 address as the LAN address, and the LAN+1 address as the WAN address.

Signed-off-by: Coia Prant <coiaprant@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20256
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 19:36:44 +02:00
Coia Prant
44c79d094f ramips: Fix Hongdian H7920 v40 pinctrl default state
According to the MT7628 hardware datasheet:
- GPIO/4 was originally used for I2C, but is now used as the Modem Power.
- GPIO/5 was originally used for I2C, but is now used as the SIM card select. (n/a for this device)
- GPIO/6 was originally used for SPI CS1, but is now used as the Serial mode switch.
- GPIO/36 was originally used for PERST, but is now used as the GPS OE. (n/a for this device)
- GPIO/38 was originally used for WDT, but is now used as the Modem2 Power. (n/a for this device)
- GPIO/44 was used for WLED_AN, but is now controlled by `gpio-leds`.

Corrected pinctrl to ensure it works properly in the future.

Signed-off-by: Coia Prant <coiaprant@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20256
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 19:36:44 +02:00
Goetz Goerisch
bb1779cdc5 kernel: bump 6.6 to 6.6.109
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.109

All patches autorefreshed.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20277
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 16:20:12 +02:00
John Audia
dbd3cffa67 kernel: bump 6.12 to 6.12.50
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.50

Dropped upstreamed:
	backport-6.12/787-v6.17-net-sfp-add-quirk-for-FLYPRO-copper-SFP-module.patch[1]

All patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.50&id=d2be6c429d8cc952ff42fdf31b6a7cffb5e233b0

Build system: x86/64
Build-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64-glibc
Run-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64-glibc

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/20280
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 16:18:49 +02:00
Sven Eckelmann
4231a731dd realtek: drop source-only from rtl931x target
Now the rtl931x target has real devices that need to be built. Remove the
source-only flag to make the images available.

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20172
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 16:16:22 +02:00
Harshal Gohel
ce8ea739eb realtek: rtl931x: Add support for Plasma Cloud ESX28 Switch
The Plasma Cloud ESX28 Switch is a 24 + 4 port multi-GBit switch with
24x 10/100/1000/2500BaseT Ethernet ports and 4x SFP+ module slot.

Hardware:

- RTL9312C SoC
- Macronix MX25L25645G (32MB flash)
- 512MB DDR3 SDRAM
- RTL8231 GPIO extender to control the port LEDs
- 6x RTL8224 4x 10m/100m/1/2.5 Gigabit PHY
- SFP+ 4x 10GBit slot

The switch is powered directly via AC.

The external RS232 serial connector (RJ45, Cisco pinout) can be used to
access the terminal. Serial connection is via 115200 baud, 8N1.

A reset button is accessible through a hole in the front panel.

Installation
------------

* The device can be flashed by using sysupgrade command. Either from the
  original vendor firmware or using an initramfs (see "Debug")
* Connect serial on front panel. Connection parameters: 115200 8N1
* The image must be copied using scp to /tmp of the device

      scp openwrt-realtek-rtl931x-plasmacloud_esx28-squashfs-sysupgrade.bin root@[IP address of the device]:/tmp/

* start sysupgrade without saving the original vendor configuration

      sysupgrade -n /tmp/openwrt-realtek-rtl931x-plasmacloud_esx28-squashfs-sysupgrade.bin

Installation via u-boot
-----------------------

If you have an TFTP server connected to the switch, it is possible to
directly install the device using the factory image from u-boot

    # setup networking and IP of TFP server
    rtk network on
    setenv ipaddr 10.100.100.99
    setenv serverip 10.100.100.20

    # get factory image
    tftp 0x84000000 factory.bin

    # erase firmware partitions
    sf probe 0
    sf erase 0x5e0000 0x1a20000

    # write firmware to both partitions
    sf write ${fileaddr} 0x5e0000 ${filesize}
    sf write ${fileaddr} 0x12f0000 ${filesize}

    # adjust the boot commands
    setenv bootargs "mtdparts=spi0.0:768k(u-boot),64k(u-boot-env),64k(u-boot-env2),5120k(reserved),13376k(inactive),13376k(firmware2)"
    setenv bootcmd "rtk init; bootm 0xb52f0000"

    # restart
    reset

Debug
-----

* Connect serial on front panel. Connection parameters: 115200 8N1.
* A tftp server is required, tftpd-hpa works well.
* Power the device, at U-Boot start rapidly hit Esc key to stop autoboot
* Enter passwords: "1234" or "plasmapsx"
* Enable network:

      rtk network on

* Change ip address of device:

      setenv ipaddr 192.168.1.6

* Download initramfs from TFTP server:

      tftpboot 0x84000000 192.168.1.111:openwrt-realtek-rtl931x-plasmacloud_esx28-initramfs-kernel.bin

* Boot loaded file:

      bootm 0x84000000

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20172
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 16:16:22 +02:00
Harshal Gohel
2b5555c195 realtek: rtl931x: Add support for Plasma Cloud PSX28 Switch
The Plasma Cloud PSX28 Switch is a 24 + 4 port multi-GBit switch with
24x 10/100/1000/2500BaseT Ethernet ports and 4x SFP+ module slot.

Hardware:

- RTL9312C SoC
- Macronix MX25L25645G (32MB flash)
- 512MB DDR3 SDRAM
- RTL8231 GPIO extender to control the port LEDs
- 6x RTL8224 4x 10m/100m/1/2.5 Gigabit PHY
- SFP+ 4x 10GBit slot
- RTL8239 POE++ PSE controller with frontend MCU

The switch is powered directly via AC.

The external RS232 serial connector (RJ45, Cisco pinout) can be used to
access the terminal. Serial connection is via 115200 baud, 8N1.

A reset button is accessible through a hole in the front panel.

Installation
------------

* The device can be flashed by using sysupgrade command. Either from the
  original vendor firmware or using an initramfs (see "Debug")
* Connect serial on front panel. Connection parameters: 115200 8N1
* The image must be copied using scp to /tmp of the device

      scp openwrt-realtek-rtl931x-plasmacloud_psx28-squashfs-sysupgrade.bin root@[IP address of the device]:/tmp/

* start sysupgrade without saving the original vendor configuration

      sysupgrade -n /tmp/openwrt-realtek-rtl931x-plasmacloud_psx28-squashfs-sysupgrade.bin

Installation via u-boot
-----------------------

If you have an TFTP server connected to the switch, it is possible to
directly install the device using the factory image from u-boot

    # setup networking and IP of TFP server
    rtk network on
    setenv ipaddr 10.100.100.99
    setenv serverip 10.100.100.20

    # get factory image
    tftp 0x84000000 factory.bin

    # erase firmware partitions
    sf probe 0
    sf erase 0x5e0000 0x1a20000

    # write firmware to both partitions
    sf write ${fileaddr} 0x5e0000 ${filesize}
    sf write ${fileaddr} 0x12f0000 ${filesize}

    # adjust the boot commands
    setenv bootargs "mtdparts=spi0.0:768k(u-boot),64k(u-boot-env),64k(u-boot-env2),5120k(reserved),13376k(inactive),13376k(firmware2)"
    setenv bootcmd "rtk init; bootm 0xb52f0000"

    # restart
    reset

Debug
-----

* Connect serial on front panel. Connection parameters: 115200 8N1.
* A tftp server is required, tftpd-hpa works well.
* Power the device, at U-Boot start rapidly hit Esc key to stop autoboot
* Enter passwords: "1234" or "plasmapsx"
* Enable network:

      rtk network on

* Change ip address of device:

      setenv ipaddr 192.168.1.6

* Download initramfs from TFTP server:

      tftpboot 0x84000000 192.168.1.111:openwrt-realtek-rtl931x-plasmacloud_psx28-initramfs-kernel.bin

* Boot loaded file:

      bootm 0x84000000

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20172
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 16:16:22 +02:00
Sven Eckelmann
746ccc5be6 realtek: rtl931x: Enable parsing of u-boot nvmem layouts
To be able to read out the ethaddr from the u-boot environment for MAC
address configuration, it is required to also enable the NVMEM layout
parsing code for the U-Boot env layout.

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20172
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 16:16:22 +02:00
Tianling Shen
b81b576556 rockchip: make use of OpenWrt compiled dtbs
OpenWrt buildroot will compile all dtbs defined in target to
$(KDIR)/image-$(DEVICE_DTS).dtb, so make use of it to allow us
debug and use external dtbs easier without patching kernel Makefile.

This also fixes commit 5c724939c3 which forgot to update DTS_DIR
in KERNEL variable.

Fixes: 5c724939c3 ("rockchip: add DEVICE_DTS_DIR definition")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20286
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 15:01:50 +02:00
Issam Hamdi
0d6b7fb56e realtek: rtl93xx: Ignore STP for per port TX
If transmissions are done outside of the DSA switch (directly from the CPU
port), the STP state must not block the transmission. Otherwise, STP frames
are not correctly submitted and the STP frames cannot correctly detect
loops before switching a port in the forwarding state.

The same applies for the LLDP frames. These must be submitted independent
of the STP state to identify neighbors or configure POE limits.

It is not necessary to filter specific destination mac addresses because
the transmission was done outside the bridge/switch in the first place. The
transmission is therefore forced.

Signed-off-by: Issam Hamdi <ih@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20184
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-03 19:26:18 +02:00
Sharadanand Karanjkar
be84bb3a78 realtek: rtl93xx: dsa: Add support for port based mirroring
The RTL930X and RTL931X SoCs support port-based, flow-based, and
RSPAN-based mirroring. Like for other SoCs from the realtek target, only
the port based port mirroring can be exposed using Linux's tc subsystem.

The port_mirror_add() implementation was updated with the following
considerations for RTL93xx SoCs:

* mirrored packets must pass through the TX pipeline of the mirroring
  port, so they are subject to configuration such as VLAN tagging,
  remarking, and EVC
* when a packet hits both source ports (SPM) and destination port (DPM) of
  a mirror group, the egress port traffic will be mirrored

The port_mirror_del() function doesn't require any modifications.

Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20264
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-03 19:25:26 +02:00
Sven Eckelmann
8e2284857d realtek: dsa: Keep HW specific mirror code in SoC helper
Instead of using a lot of if-else blocks in the port mirror code, provide
SoC specific function which calculates the SoC specific portions. The
generic part of the port mirroring code can then simply operate on the
calculated register addresses and values.

Suggested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20264
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-03 19:25:26 +02:00
Hauke Mehrtens
0160ae8635 realtek: Refresh kernel patches
I just ran: make target/{clean,refresh} V=99

Fixes: 272a392fe1 ("realtek: rtl93xx: replace pending I2C patches with upstreamed patches")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-03 14:17:14 +02:00
Tianling Shen
17b7af8cba rockchip: add Radxa ROCK 4D support
Hardware
--------
RockChip RK3576 ARM64 (8 cores)
2/4/8/16GB LPDDR5 RAM
1x 1000 Base-T (with optional PoE support)
2x LEDs (POWER / USER)
eMMC/UFS connector
Micro-SD Slot
HDMI OUT
PCIe FPC connector
2x USB 2.0 Port
2x USB 3.0 Port
USB Type-C PD Power

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20041
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-02 22:42:35 +02:00
Tianling Shen
3a35a2cff1 rockchip: backport dts updates for rk3576
Backport core dts updates for rk3576.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20041
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-02 22:42:35 +02:00
Tianling Shen
0a6ed6db26 rockchip: backport driver updates for rk3576
Backport clk/phy/rng/ufs/usb driver updates for rk3576.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20041
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-02 22:42:34 +02:00
Tianling Shen
cf4365e767 rockchip: use per-SoC defined kernel loadaddr
The FIT loadaddr on RK3308/RK3566/RK3568/RK358x is 0x02000000
instead of 0x02080000, while on RK3576 it's 0x42000000, which is
quite different from the former SoCs and incompatible with current
kernel loadaddr value.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20041
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-02 22:42:34 +02:00
Tianling Shen
5c724939c3 rockchip: add DEVICE_DTS_DIR definition
Avoid duplicating `rockchip/` prefix when specifying dts path.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20041
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-02 22:42:34 +02:00
Jonas Jelonek
272a392fe1 realtek: rtl93xx: replace pending I2C patches with upstreamed patches
Replace the pending I2C backport patches for RTL93XX added in
44655c97bb with the upstreamed variants. The patches have been accepted
upstream in the meantime and are included in v6.17 or v6.18.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20273
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-02 13:52:24 +02:00
Sven Eckelmann
3adb820779 realtek: rtl931x: Add SPI_CTRL0 as pinmux
The RTL931x has next to its SPI flash controller a SPI master interface. It
is connected to

* SPI_CS#[1,0]: AH22 , AK22 (aka: GPIO 12, 11)
* SPI_CLK:      AL23 (aka: GPIO 8)
* SPI_MISO:     AM23 (aka: GPIO 9)
* SPI_MOSI:     AL22 (aka: GPIO 10)

It is not the same as the SPI flash controller which uses pins:

* SPI_CS#[1,0]: B24, A24
* SPI_SCLK:     A23
* SPI_SDI/SIO0: B21
* SPO_SDO_SIO1: B21
* SPI_SIO2:     A22
* SPI_SIO3:     B22
* SPI_RSTN:     B23

As shown above, the SPI master controller shares its pin with GPIO 8, 9,
10, 11, 12. In some upcoming devices (like the Plasma Cloud PSX28/ESX28),
they will be used for SFP cage signaling. These pins must therefore be
switched manually to the GPIO mode.

The SPI_CTRL0 register provides all necessary configuration to enforce the
GPIO mode of the pins. And until more requirements (and a correct driver)
for the SPI master controller arise, it is therefore possible to use
pinctrl-single to configure it using the devicetree.

Previously the ethernet driver did configure the SPI master controller for
31.25 MHz. It is unknown for which kind of device this was originally made
and what was actually connected there. But this manual write to the
register conflicts potentially with the write of the pinctrl driver to the
same register. Luckily, we don't need this SPI speed configuration in the
ethernet driver. Still, to allow this device an easy migration, the
`spi0-31mhz` configuration was already prepared.

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20263
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-02 10:30:16 +02:00
Felix Fietkau
50c51504fd mediatek: fix polarity of user button on openwrt-one
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-02 09:54:32 +02:00
Sven Eckelmann
263721dd0a realtek: rtl930x: Fix Plasma Cloud PSX8/PSX10 copper phy-mode
The RTL8224 used by Plasma Cloud PSX8/PSX10 is not using USXGMII but
USXGMII 10G-QXGMII mode. The correct phy-mode string for this is
"10g-qxgmii".

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20239
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-30 20:12:27 +02:00
Sven Eckelmann
4481e0c91d realtek: Work around missing 10g-qxgmii PHY mode
The current SerDes implementation for RTL931x handles 10G-QXGMII via the
"usxgmii" PHY mode. This is not 100% correct because it is not a single
port with 10G (max) but 4 ports with 2.5G each.

To allow setting of the "10g-qxgmii" phy mode, just change the code for now
to use the same codepaths as USXGMII. This has to be cleaned up further
during the SerDes driver rewrites.

Suggested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20239
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-30 20:12:27 +02:00
Sven Eckelmann
657b61be2e realtek: rtl931x: Enable REALTEK_PHY for RTL8224 support
The Plasma Cloud PSX28 and ESX28 are using RTL8224 as ethernet PHY. This
phy works perfectly fine on PSX8/PSX10 (RTL930x) but failed to establish a link
on rtl931x because the upstream realtek phy driver was not enabled.

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20239
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-30 20:12:27 +02:00
Rosen Penev
6157a2aeb9 ath79: replace various mtd_get_mac_text
Deprecated. Replaced with nvmem.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20176
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-30 11:21:18 +02:00
Rosen Penev
cbdc2b851e ath79: dir-8x5: use nvmem
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20176
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-30 11:21:18 +02:00
Rosen Penev
bd2e17c180 ath79: dir-505: use nvmem
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20176
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-30 11:21:18 +02:00
Rosen Penev
6c20daed13 ath79: tew-673gru: use nvmem
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20176
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-30 11:21:18 +02:00
Markus Stockhausen
b49f9d9804 realtek: backport ECC driver
Upstream will get support for the Realtek ECC engine with 6.18.
To make use of this in Openwrt

- backport upstream patches
- change config so that ECC will be built for nand subtargets
- define ECC engine in RTL93xx DTS.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19746
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-30 11:15:26 +02:00
Issam Hamdi
36d8d19993 realtek: rtl931x: set hash_msb based on VLAN ID when adding a new L2 entry
During testing, we discovered that when adding a new offload FDB rule
on certain VLANs and then delete it, does not work as expected.

Steps to Reproduce:

* Create VLAN 4094 on the port lan1:

      bridge vlan add vid 4094 dev lan1 pvid

* Add a new FDB entry on port lan1 for VLAN 4094:

      bridge fdb add 00:01:02:22:33:44 dev lan1 vlan 4094 master permanent

* Delete the new FDB entry on port lan1 for VLAN4094

      bridge fdb del 00:01:02:22:33:44 dev lan1 vlan 4094 master permanent

Root Cause:

The failure occurs because the hash_msb flag is not set correctly
based on the VLAN ID when adding a new L2 entry.

Signed-off-by: Issam Hamdi <ih@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20183
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-29 20:55:22 +02:00
Sven Eckelmann
8c82e2dc93 realtek: Switch booleans in rtl838x_l2_entry to single bits
In upstream kernel, it is not well received to use a lot of simple booleans
in structs. It is preferred to use 1-bit bitfields [1] and consolidate the
booleans together.

[1] https://www.kernel.org/doc/html/v6.16/process/coding-style.html#using-bool

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20183
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-29 20:55:22 +02:00
Bjørn Mork
d22b57e1e4 realtek: add phy-handle for Zyxel GS1900-10HP SFP slots
Align GS1900-10HP dts with other realtek devices to reduce the risk of device
specific regressions with the upcoming driver cleanup/rewrite.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/20228
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-29 20:54:19 +02:00
Bjørn Mork
e2dad927a8 realtek: fix Zyxel GS1900-10HP SFP slots
Parse the pcs-handle property regardless of phy-handle

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/20228
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-09-29 20:54:19 +02:00
Daniel Golle
318f07c231 ath79: mikrotik: check RouterBOOT version matching sysupgrade image
Check if the uploaded image matches the version of RouterBOOT before
proceeding with sysupgrade on MikroTik devices with NOR flash.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-09-29 17:34:51 +01:00
John Thomson
502e6253a1 ath79: mikrotik: generate a RouterBOOT v7 NOR compatible sysupgrade
RouterBOOT v7 for NOR devices does not support the historic yaffs
"kernel" ELF boot method.
Generate a compatible kernel

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
2025-09-29 17:34:51 +01:00
John Thomson
7276e28e47 ramips: mikrotik: generate a RouterBOOT v7 NOR compatible sysupgrade
RouterBOOT v7 for NOR devices does not support the historic yaffs
"kernel" ELF boot method.
Generate a compatible kernel

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
2025-09-29 17:34:51 +01:00
John Thomson
99cfba0721 ipq40xx: mikrotik: generate a RouterBOOT v7 NOR compatible sysupgrade
RouterBOOT v7 for NOR devices does not support the historic yaffs
"kernel" ELF boot method.
Generate a compatible kernel

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
2025-09-29 17:34:51 +01:00
Aleksander Jan Bajkowski
a30daf8a0b airoha: fix scuclk node for an7581
Add missing syscon compatible for scuclk node.
Fix the unit-address of the scuclk node.
This fixes the pcs driver error:

airoha-pcs 1fa08000.pcs: probe with driver airoha-pcs failed with error -22
airoha-pcs 1fa09000.pcs: probe with driver airoha-pcs failed with error -22

Fixes: c3d70b1 ("airoha: en7581: Add support for external PHY")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/20190
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-09-29 12:05:10 +02:00
Chukun Pan
dae30d83ea airoha: an7581: refresh kernel config
Enable MEDIATEK_GE_SOC_PHY driver and disable NET_DSA_MT7530_MDIO.
Refresh kernel configs with 'make kernel_oldconfig CONFIG_TARGET=subtarget'.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/20190
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-09-29 12:05:10 +02:00
Chukun Pan
646ccf6076 airoha: fix pinctrl driver function bug
The pinctrl driver for airoha was expecting a function name that was
not a string, but was passed one. Removing #string fixed this issue.

Fixes: c5b12fc ("airoha: Introduce support for Airoha AN7583 SoC")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/20190
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-09-29 12:05:09 +02:00
Chukun Pan
b125cf42dc airoha: remove duplicate AN7581 PHY patch
This patch already exists in generic/backport-6.12.

Fixes: 122135b ("airoha: an7581: add support for kernel 6.12")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/20190
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-09-29 12:05:09 +02:00