Commit graph

33659 commits

Author SHA1 Message Date
Hannu Nyman
987214c9f8 mediatek: remove erroneous pipe action from BE7200 recipe
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
Remove the errorneous pipe action from the BE7200 device package list.

It causes visible errors into config:

 perus@ub2510:/OpenWrt/aarch64$ make defconfig
 ...
 tmp/.config-target.in:55023:warning: ignoring unsupported character '|'
 tmp/.config-target.in:191877:warning: ignoring unsupported character '|'
 tmp/.config-target.in:191878:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285812:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285815:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285819:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285820:warning: ignoring unsupported character '|'
 #
 # configuration written to .config
 #

 File tmp/.config-target.in:

  55020         select DEFAULT_urandom-seed
  55021         select DEFAULT_urngd
  55022         select DEFAULT_wpad-basic-mbedtls
  55023         select DEFAULT_|
  55024         help
  55025           Build firmware images for Routerich BE7200

Fixes: ff5e66a920 ("mediatek: add support for Routerich BE7200")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/21376
(cherry picked from commit 93e9e67ee9)
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21383
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:53:07 +01:00
Mikhail Zhilkin
d1ff5681b4 mediatek: add support for Routerich BE7200
This PR adds support for Routerich BE7200 router.

Specification
-------------
- SoC       : MediaTek MT7987A Quad-core ARM Cortex-A53 2.0 GHz
- RAM       : 1024 MiB DDR4
- Flash     : SPI-NAND 512 MiB (Giga Device)
- WLAN      : MediaTek MT7992E, WiFi 7
  - 2.4 GHz : b/g/n/ax, MIMO 4x4
  - 5 GHz   : a/n/ac/ax, MIMO 4x4
- Ethernet  : 10/100/1000 Mbps x3 (LAN, Airoha AN8855AE)
              10/100/1000/2500 Mbps x1 (WAN, SoC internal phy)
- USB       : 3.0 x1
- Buttons   : Mesh, Reset
- LEDs      : 1x Status (blue), gpio-controlled
              1x WiFi (blue), gpio-controlled
              1x mesh (blue), gpio-controlled
              3x LAN activity (blue), gpio-controlled
              1x WAN activity (blue), gpio-controlled
              1x WAN no-link (red), gpio-controlled
- Power     : 12 VDC, 1.5 A

Installation
------------
1. Update stock firmware via the web interface (don't keep settings).

Update U-Boot (optional)
------------------------
After installing OpenWrt, you may want to install opensource U-Boot.
1. Install kmod-mtd-rw:
   apk update && apk add kmod-mtd-rw
2. Unlock bootloader:
   insmod mtd-rw i_want_a_brick=1
   mtd unlock BL2
   mtd unlock FIP
3. Download and write open-source BL2 and FIP:
   cd /tmp
   wget https://.../openwrt-mediatek-filogic-routerich_be7200-preloader.bin
   wget https://.../openwrt-mediatek-filogic-routerich_be7200-bl31-uboot.fip
   mtd write /tmp/openwrt-mediatek-filogic-routerich_be7200-preloader.bin BL2
   mtd write /tmp/openwrt-mediatek-filogic-routerich_be7200-bl31-uboot.fip FIP
4. Reboot the router.

Return to stock
---------------
1. Update OpenWrt wirh the vendor's firmware (don't keep settings).

Recovery (original U-Boot)
-----------------------------
1. Press Reset button and power on the router. After ~10 sec release
   the button;
2. Upload and flash squashfs-sysupgrade.itb image via the web interface.

Recovery (open-source U-Boot)
-----------------------------
1. Place OpenWrt
   'openwrt-mediatek-filogic-routerich_be7200-initramfs-recovery.itb'
   image on the tftp server (IP: 192.168.1.254)
2. Press Reset button and power on the router. After ~10 sec release
   the button.
3. Use OpenWrt initramfs system for recovery

Recovery (full disaster)
------------------------
Use UART and mtk_uartboot tool.
Link: https://github.com/981213/mtk_uartboot

USB power control
-----------------
Disable: echo disabled > /sys/devices/platform/usb-power/state
Enable: echo enabled > /sys/devices/platform/usb-power/state

UART
----
UART pins are silkscreened on the PCB. Don't connect Vcc.
Serial connection parameters: 115200, 8n1, 3.3V

MAC addresses
-------------
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 24:0f:5e:xx:xx:30 | label     |
| LAN     | 24:0f:5e:xx:xx:31 | label+1   |
| WLAN 2g | 24:0f:5e:xx:xx:32 | label+2   |
| WLAN 5g | 24:0f:5e:xx:xx:33 | label+3   |
+---------+-------------------+-----------+
The WLAN 2g MAC was found in 'Factory', 0x4

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21235
(cherry picked from commit ff5e66a920)
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21383
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:53:01 +01:00
Robert Senderek
a1bb2cbb9d mvebu: Add support for WD MyCloud EX2 Ultra
Hardware
--------
Marvell Armada 385 (MV88F6820)
1GB RAM
256MB NAND
1x 1Gbit
2x USB 3.0
2x SATA-III
UART: 115200 8N1 3.3V
RTC
Weltrend MCU WT6703F connected via UART1 for Power LED / PWM Fan / hw reset / WoL

Installation
------------
Connect UART 3.3V adapter to JP2  pins: 1-RX / 2-GND / 5-TX

Use USB2.0 FAT32 pendrive with openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin
 1. stop boot by pressing 1
 2. usb start
 3. fatload usb 0:1  0x02000000 openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin;bootm 0x02000000 -
 4. do backup mtd1 mtd3
 5. use sysupgrade

Or tftp
 1. stop boot by pressing 1
 2. setenv ethact egiga2;setenv serverip 192.168.11.114;setenv ipaddr 192.168.11.113
 3. tftpboot 0x02000000 openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin; bootm 0x02000000 -
 4. do backup mtd1 mtd3
 5. use sysupgrade

or Evgeny Kolesnikov <evgenyz@gmail.com> method from his failed PR 2040

- Using original firmware's network settings obtain SSH access to the device.
- Put *-image-cfs-factory.bin and *-uImage-factory.bin images into device's /tmp directory.
- Write kernel (uImage) image 'flash_eraseall /dev/mtd1 && nandwrite --markbad -p /dev/mtd1 /tmp/*-uImage-factory.bin'.
- Write rootfs (image-cfs) image 'ubiformat /dev/mtd3 -f /tmp/*-image.cfs-factory.bin -y'.
- Reboot the device.

Installation (upgrade):

Use *-sysupgrade.bin in a usual way.
Weltrend MCU control is done via uart1 19200
install coreutils-stty
stty -F /dev/ttyS1 raw speed 19200
stty -F /dev/ttyS1 raw speed 19200

PWM Fan Control
off: 00
echo -n -e '\xfa\x02\x00\x00\x00\x00\xfb' > /dev/ttyS1
slow: 5F
echo -n -e '\xfa\x02\x00\x5f\x00\x00\xfb' > /dev/ttyS1
max: FF
echo -n -e '\xfa\x02\x00\xff\x00\x00\xfb' > /dev/ttyS1

Power LED Control
Blue
echo -n -e '\xfa\x26\x00\x11\x00\x01\xfb' > /dev/ttyS1
Red
echo -n -e '\xfa\x26\x00\x14\x00\x01\xfb' > /dev/ttyS1
Orange
echo -n -e '\xfa\x26\x00\x12\x00\x01\xfb' > /dev/ttyS1

more here: https://github.com/c-MM/mcm-daemon/blob/master/mcm.h

Signed-off-by: Robert Senderek <robert.senderek@10g.pl>
Link: https://github.com/openwrt/openwrt/pull/17779
(cherry picked from commit 96ad29a0f3)
Link: https://github.com/openwrt/openwrt/pull/21364
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:26:25 +01:00
Hauke Mehrtens
a78f0078c4 kernel: QCOM SPI NAND: backport multiple fixes
These patches fix bugs in a patch we backported.

These patch were cherry picked from upstream Linux because it references
a patch we backported in the fixes tag.

The patches were reordered to match the ordering in the upstream Linux kernel.

Fixes: 93173aee96 ("qualcommbe: ipq95xx: Add initial support for new target")
Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit 5230157a16)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:23:01 +01:00
Hauke Mehrtens
236149c306 kernel: phylink: disable autoneg for interfaces that have no inband
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

The first two patches are providing function needed by the last patch.

Fixes: 813ecda1f3 ("generic: backport phylink patches for PCS/PHY caps OPs")
Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit 69d76e3a14)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:23:01 +01:00
Hauke Mehrtens
a725b439e9 kernel: RTL8211FVD: restore disabling of PHY-mode EEE
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 48c9e55094 ("kernel: backport upstream Realtek PHY patches")
Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit 2c7241b209)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:23:01 +01:00
Hauke Mehrtens
fafe124d8e kernel: mv88e6xxx: backport fixes
These patches fix bugs in a patch we backported.

These patch were cherry picked from upstream Linux because it references
a patch we backported in the fixes tag.

Fixes: c990f6e156 ("linux: generic: net: dsa: mv88e6xxx LED support")
Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit 9c4b7fbaad)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:23:00 +01:00
Hauke Mehrtens
f575392914 kernel: reserved_mem: add missing IORESOURCE_MEM flag on resources
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 9d3009f426 ("airoha: major backport of Airoha Ethernet driver feature support")
Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit b3cc77eead)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:23:00 +01:00
Hauke Mehrtens
22d30efdc8 kernel: as21xxx: backport patch improve PHY HW reset
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

The function phy_id_compare_vendor() is needed by the fix.
Refresh 782-05-v6.16-net-phy-Add-support-for-Aeonsemi-AS21xxx-PHYs.patch with the upstream code.

Fixes: 08a616b216 ("generic: backport support for Aeonsemi AS21xxx PHY")
Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit b3318fe819)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:23:00 +01:00
Hauke Mehrtens
15eb5f05ef kernel: pcs-mtk-lynxi: backport fix for in-band status capabilities
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 813ecda1f3 ("generic: backport phylink patches for PCS/PHY caps OPs")
Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit 7390e63374)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:23:00 +01:00
Hauke Mehrtens
301515ab7d kernel: PHY: backport led fixes commit
This patch fixes a bug in some patches we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit 63b45a10c0)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:23:00 +01:00
Hauke Mehrtens
952ec239af kernel: r8169: backport upstream fix
This fixes a bug introduced in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 91ce7f606a ("generic: backport upstream v6.16 r8169 patches")
Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit 6ac5e28902)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:23:00 +01:00
Hauke Mehrtens
946541c8cb kernel: move patches to backported
These formally pending patches were merged into upstream Linux some time
ago. Move them to the backports folder and add the kernel version they
were added to the file name.

Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit 3c821c19a8)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:22:59 +01:00
Hauke Mehrtens
f5f4071479 kernel: refresh upstreamed patches
Replace pending patches which are already integrated in upstream Linux
with their upstream versions.

These patches were exported with:
git format-patch -1 -k

Link: https://github.com/openwrt/openwrt/pull/21366
(cherry picked from commit 7130053695)
Link: https://github.com/openwrt/openwrt/pull/21390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 00:22:59 +01:00
George Moussalem
8f0d7ae61b qualcommax: ipq50xx: add support for Linksys MX6200
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Linksys MX6200 is a triband Wi-Fi 6E wireless router.

Speficiations:
* SoC: Qualcomm IPQ5018 (64-bit dual-core ARM Cortex-A53 @ 1.0Ghz)
* Memory: Nanya NT5CC256M16ER-EK (512 MiB DDR3-933)
* Serial Port: 3v3 TTL 115200n8
* Wi-Fi: IPQ5018 (2x2 2.4 Ghz 802.11b/g/n/ax)
	 QCN6102 (2x2:2 5 Ghz 802.11an/ac/ax)
	 QCN6122 (2x2:2 6 Ghz 802.11an/ac/ax)
* Ethernet: IPQ5018 integrated virtual switch connected to:
	    - LAN Port: Internal IPQ5018 GE PHY
	    - WAN Port: Maxlinear Ethernet GPY115C PHY
* Flash: Macronix MX35UF2GE4AD (256 MiB)
* LEDs: 1x multi-color PWM LED
* Buttons: 1x WPS (GPIO 27 Active Low)
           1x Reset (GPIO 28 Acive Low)
* FCC ID: 2AYRA-08436

Flash instructions:
************************************************************************
NOTE: serial access is required! Although the web UI allows you to
install the Openwrt image, secure boot is enabled which will prevent
booting an unsigned image. The boot sequence must be adjusted in U-boot
to allow booting unsigned images.
************************************************************************

1. On OEM firmware, login to the web UI (typically @ http://192.168.1.1)
and click 'CA' in the bottom right corner.
Then click -> Connectivity -> Manual Upgrade.
Alternatively, browse to
http://<router IP>/fwupdate.html.
Upload openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-factory.ubi.
Continue with step 5.
2. Installation on alternate partition using serial connection from OEM
firmware (default login: root, password: admin):
flash_erase /dev/mtd19 0 0
nandwrite -p /dev/mtd19 openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-factory.ubi
reboot
Continue with step 5.
3. Installation using serial connection from initramfs
setup tftp server listening on IP in 192.168.1.0/24 (other than the
router IP 192.168.1.1). In U-boot, load the initramfs image to memory:
tftp $loadaddr <your IP>:openwrt-qualcommax-ipq50xx-linksys_mx6200-initramfs-uImage.itb
boot the image using command:
bootm $loadaddr
when fully booted, scp the sysupgrade image to your router IP (default:
192.168.1.1):
scp -O <path>/openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-sysypgrade.bin root@192.168.1.1:/tmp/
use sysupgrade to flash the image to nand:
sysupgrade -n -v /tmp/openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-sysupgrade.bin
Continue with step 5.
4. Optionally install on alternate partition. From Openwrt:
mtd -r -e rootfs_1 -n write openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-factory.ubi rootfs_1
Continue with step 5.
5. Setup U-boot for ability to dual boot signed (stock) and non-signed
(Openwrt) images with auto-detection.
From U-boot, run (be aware: copy line by line):
setenv setnandbootargs 'setenv bootargs init=/sbin/init ubi.mtd=rootfs rootfstype=squashfs rootwait'
setenv nandinitcmd 'setenv mtdids nand0=nand0; run setrootfscmd; ubi part rootfs 2048'
setenv setrootfscmd 'if test $boot_part = 1; then setenv mtdparts mtdparts=nand0:0x${imgsize}@0x${prikern}(rootfs); else setenv mtdparts mtdparts=nand0:0x${imgsize}@0x${altkern}(rootfs); fi'
setenv readhdr1cmd 'ubi read $loadaddr kernel 0x40; setexpr IMGOFF $loadaddr + 0x10; setexpr CODEOFF $loadaddr + 0x14; setexpr SIGOFF $loadaddr + 0x1c; setexpr CERTOFF $loadaddr + 0x24'
setenv readhdr2cmd 'setexpr.l HDR *$loadaddr; setexpr.l IMGSZ *$IMGOFF; setexpr.l CODESZ *$CODEOFF; setexpr.l SIGSZ *$SIGOFF; setexpr.l CERTSZ *$CERTOFF; setexpr TSIZE $CODESZ + $SIGSZ; setexpr TSIZE $TSIZE + $CERTSZ'
setenv testmbncmd 'if test $HDR -ne edfe0dd0 -a $IMGSZ -eq $TSIZE; then bootipq; else ubi read $loadaddr kernel $kernsize; run setnandbootargs; bootm $loadaddr; fi'
setenv bootcmd2 'if test $auto_recovery = no; then bootipq; else run nandinitcmd; run readhdr1cmd; run readhdr2cmd; run testmbncmd; fi'
setenv bootcmd 'run bootcmd2'
saveenv
6. Back to the OEM firmware.
Download firmware from OEM website:
MX6200: https://support.linksys.com/kb/article/408-en/
From serial/SSH, in Openwrt, flash OEM firmware to alternate partition:
mtd -r -e rootfs_1 -n write FW_MX6200_1.0.11.216041_prod.signed.img rootfs_1

Switching active partition:
1. From U-boot, executive the following to switch to partition 1:
setenv boot_part 1
for partition 2:
setenv boot_part 2
2. From Openwrt:
fw_printenv boot_part
In case it's 1:
fw_setenv boot_part 2
. /lib/upgrade/platform.sh
linksys_bootconfig_set_primaryboot "0:bootconfig" 1
linksys_bootconfig_set_primaryboot "0:bootconfig1" 1
In case it's 2:
fw_setenv boot_part 1
. /lib/upgrade/platform.sh
linksys_bootconfig_set_primaryboot "0:bootconfig" 0
linksys_bootconfig_set_primaryboot "0:bootconfig1" 0
and
reboot

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Link: https://github.com/openwrt/openwrt/pull/21273
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:07:39 +01:00
George Moussalem
c936a98ed3 qualcommax: ipq50xx: upgrade SMEM dualboot Linksys devices
Add support for upgrades on dual firmware Linksys devices with the
partition table stored in SMEM and that store both the kernel and rootfs
in a single partition. Switching the active boot partition requires
updating the partition info table in SMEM in addition to setting
the active boot partition in a U-boot variable as U-boot will keep them
in sync upon reboot if they're not.

U-boot always sets the name of the active partition to rootfs and that
of the inactive partition to rootfs_1 in SMEM. when Linux loads the
partition table from SMEM it will load the right partition based on the
offset set in the SMEM partition table. For upgrades, flashing to the
alternate partition will always be to rootfs_1, while flashing the
current partition will be on rootfs.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Link: https://github.com/openwrt/openwrt/pull/21273
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:07:39 +01:00
George Moussalem
46e8c1b502 qualcommax: ipq50xx: functions for bootconfig partition
The BOOTCONFIG partition is used by Qualcomm's boot chain to store
metadata about the device's startup configuration. It contains info such
as versioning, configuration flags, primary boot partition, and more.

Newer devices with dual boot partitions not only store the active boot
partition in a U-boot variable but also in partition info in the
BOOTCONFIG partition. As such, add library functions to set and toggle
the active boot partition.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Link: https://github.com/openwrt/openwrt/pull/21273
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:07:39 +01:00
George Moussalem
898b1668c0 qualcommax: ipq50xx: move bootargs to Linksys board files
Move setting kernel bootargs from the base template down to the
respective Linksys board files. This allows for having devices which
require different bootargs use the base template device tree file.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Link: https://github.com/openwrt/openwrt/pull/21273
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:07:39 +01:00
George Moussalem
facaa3d904 qualcommax: ipq50xx: load Linksys partition tables from SMEM
The partition table on Linksys devices with a Qualcomm AX IPQ SoC is
stored in SMEM. As such, load partition table from SMEM rather than
statically defining them in their respective device trees. This helps
generalize the base template and requires less maintenance.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Link: https://github.com/openwrt/openwrt/pull/21273
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:07:39 +01:00
Linus Walleij
ed2d3b143c ixp4xx: fix bug in Actiontec DTS file
This misassigned ethernet port bug was merged in the upstream
kernel.

Link: https://github.com/openwrt/openwrt/pull/21367
Signed-off-by: Linus Walleij <linusw@kernel.org>
(cherry picked from commit b73fd273b3)
2026-01-04 18:20:34 +01:00
Fil Dunsky
8004708f2d mediatek: add ubootmod layout for Cudy WBR3000UAX v1
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
This allows us to use the full size of nand,
which extends ubi size from 64Mb to 122.25Mb.

If you are at factory firmware, please refer
to [PR](https://github.com/openwrt/openwrt/pull/21141)
to boot into OpenWrt first.

1. Log in to the device and backup all the partitions,
especially unique `Factory` and `bdata` partitions
from System -> Backup / Flash Firmware -> Save mtdblock contents.
2. Install kmod-mtd-rw to unlock mtd partitions for writing:
```bash
apk update && apk add kmod-mtd-rw && insmod mtd-rw i_want_a_brick=1
```
3. Write new OpenWrt (U-Boot Layout) `BL2` and `FIP`:
```bash
mtd write openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-preloader.bin BL2
mtd write openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-bl31-uboot.fip FIP
```
4. Set static IP on your PC: `192.168.1.254`, gateway `192.168.1.1`
5. Serve openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-initramfs-recovery.itb
using TFTP server.
6. Connect Router LAN with PC LAN.
7. Cut off the power and re-engage, wait for TFTP recovery to complete.
8. After OpenWrt initramfs recovery has booted,
clean `/dev/mtd5` ubi partition to utilize maximum of free space & create ubootenvs:
```bash
ubidetach -p /dev/mtd5; ubiformat /dev/mtd5 -y; ubiattach -p /dev/mtd5
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
```
4. Perform sysupgrade.

Tested-by: 4pda users
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21225
(cherry picked from commit 15df98f3b5)
Link: https://github.com/openwrt/openwrt/pull/21342
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 19:45:43 +01:00
Fil Dunsky
2a78fc851c mediatek: add support for Cudy WBR3000UAX v1
Another OEM variation of a Cudy WR3000 series device made for Russian market.

Hardware:
 - SoC: MediaTek MT7981B
 - CPU: 2x 1.3 GHz Cortex-A53
 - Flash: 128 MiB GigaDevice SPI NAND. Flash Model: F50L1G41LB, ID: C801
 - RAM: DDR3, 512 MiB
 - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax)
 - 1x WAN MT7531 (JXD 2531Z) 10/100/1000 Mbps
 - 4x LAN 2x MT7530 (JXD 2529S) 10/100/1000 Mbps
 - USB 3.0 port
 - Buttons: Reset, WPS
 - 8x LEDs: 2x Red, 6x Blue
 - Serial console: no need to solder, just open the case and unskrew the radiator, TX-RX, RX-TX, GND-GND, VCC do not connect, 115200 8n1
 - Power: 12 VDC, 1.5 A

+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 80:AF:CA:xx:xx:x1 | label+1   |
| LAN     | 80:AF:CA:xx:xx:x0 | label     |
| WLAN 2g | 80:AF:CA:xx:xx:x0 | label     |
| WLAN 5g | 82:AF:CA:xx:xx:x1 | label+1   |
+---------+-------------------+-----------+

Based on a factory layout with only 64mb partition for easier transition from factory to OpenWrt for users if the "intermediate" RSA signed firmware will be provided by Cudy.

**Installation**
The installation must be done via UART & TFTP by disassembling the router. On other occasions Cudy has distributed intermediate firmware and dts to make installation easier, but since this router is OEM special WB order for local RU market there is a possibility they will not provide it.

**Install using UART & TFTP**
1. Connect to UART.
2. Since the factory BL is locked and the boot process can not be stopped, you have to use mtkuartboot, hold reset, engage the power, boot into your payloaded bl2 & fip.
3. Connect to LAN and set your IP to 192.168.1.254.
4. Configure a TFTP server to serve openwrt-mediatek-filogic-cudy_wbr3000uax-v1-initramfs-kernel.bin file.
5. Run these steps in u-boot using the name of your file:

```
setenv bootfile openwrt-mediatek-filogic-cudy_wbr3000uax-v1-initramfs-kernel.bin
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.254
tftpboot
bootm
```

6. Router will boot into OpenWrt initramfs recovery, just open your browser `192.168.1.1` and sysupgrade with the `Keep settings` option turned off.

Tested-by: many 4pda users
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21225
(cherry picked from commit d7d6faf26f)
Link: https://github.com/openwrt/openwrt/pull/21342
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 19:45:43 +01:00
Fil Dunsky
ea9cf72722 arm-trusted-firmware-mediatek: add Cudy DDR3 target
Since there are many similar devices from Cudy (TR3000 / WR3000E / WR3000P / WR3000S / WBR3000UAX) this will allow to create OpenWrt U-Boot layout for all of them using same DDR3 target.

Tested-by: 4pda users
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21225
(cherry picked from commit f4c9ab6591)
Link: https://github.com/openwrt/openwrt/pull/21342
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 19:45:43 +01:00
Jacob Potter
482d5e5c41 realtek: rtl838x: fix lan9 and lan10 on Netgear GS110TUP
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
The GS110TUP's lan9 port is connected via a QSGMII PHY to SERDES 2, and
therefore should use the SWITCH_PORT_SDS macro instead of SWITCH_PORT. This
was missed in e956adfe because the GS110TUP is not particularly well
documented and the old code was confusing.

lan10 is an SFP and doesn't have an onboard PHY, so also remove its
associated PHY references and update it to match other devices' SFP ports.

Fixes: https://github.com/openwrt/openwrt/issues/21324
Signed-off-by: Jacob Potter <jacob@j4cbo.com>
Link: https://github.com/openwrt/openwrt/pull/21346
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b2c0182f26)
2026-01-02 18:12:56 +01:00
Daniel Golle
5d017aeeeb mediatek: filogic: asus,rt-ax57m: remove unused pinctrl groups
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Remove unused pinctrl groups defined in the device tree, probably as a
result of importing the vendor device tree which is based on the
reference board from MediaTek's SDK.

114b5c2063 ("mediatek: filogic: Add support ASUS RT-AX57M")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 96205c99d01cf7f5e69f03ccdea790d0eb9ddb36)
Signed-off-by: Garrett Mesmer <garrettmesm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21237
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 14:42:36 +01:00
Garrett Mesmer
fafb36f865 mediatek: filogic: Add support ASUS RT-AX57M
ASUS RT-AX57M, RT-AX54HP V2, RT-AX1800HP V2, RT-AX1800S V2, and RT-AX3000S all use the same firmware and have identical hardware

Hardware
--------
SOC: MediaTek MT7981b
RAM: 256MB DDR3L (Winbond W632GU6NB-09)
FLASH: 128MB SPI-NAND (Winbond W25N01KVZEIR)
WIFI: Mediatek MT7981b + Mediatek MT7976DAN 802.11ax 2.4/5 GHz
ETH: MediaTek MT7531AE Switch
UART: 3V3 115200 8N1 (Pinout silkscreened / Do not connect VCC)

MAC addresses
-------------
LAN	Label MAC (stored in mtd ubi Factory partition at offset 0x4)
WAN	LAN
2.4G	LAN + 2 in first octet
5G	LAN

Installation
-----------------------------------------------------------
Vendor-UI Method
-----------------------------------------------------------
1. Download the OpenWrt initramfs.trx image.

2. Connect the PC via LAN to one of the yellow router ports and wait
   until your PC to get a DHCP lease.

3. Browse to http://192.168.1.1 (or whatever your router IP is configured as)

4. If your router is brand new, finish the setup process and log into
   the Web-UI.

5. Navigate to Administration -> Firmware Upgrade and upload the
   downloaded OpenWrt initramfs.trx image.

6. Wait for OpenWrt to boot. Open the default OpenWrt IP in a web browser and perform a system upgrade using the sysupgrade image as instructed in the top banner.

---------------------------------------------------------------------------
Revert to stock firmware:
1: Install package facinstall -> https://forum.openwrt.org/t/facinstall-package-for-easy-installation-factory-images/177587
2. Install Asus stock trx image via OpenWRT LuCI interface.

Signed-off-by: Garrett Mesmer <garrettmesm@gmail.com>
Co-Authored-By: Oleg S <remittor@gmail.com>
Signed-off-by: Oleg S <remittor@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20491
(cherry picked from commit d09e2b1926a6009299eb034928df2c6b6b04dfa8)
Link: https://github.com/openwrt/openwrt/pull/21237
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 14:39:54 +01:00
John Audia
8db96adeb1 kernel: bump 6.12 to 6.12.63
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.63

Manually rebased:
  qualcommax/patches-6.12/0113-remoteproc-qcom-Add-secure-PIL-support.patch
  qualcommax/patches-6.12/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch

Removed upstreamed:
  airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.63&id=7be679104357439ff6eab076975f5f74368acd69

Build system: x86/64
Build-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc
Run-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc

Co-authored-by: Goetz Goerisch <ggoerisch@gmail.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21329
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit b638d886f0)
Link: https://github.com/openwrt/openwrt/pull/21356
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 14:32:36 +01:00
John Audia
8b464ef4ce generic: add missing symbol
Set SND_SOC_NAU8325 to no

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21329
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit b3d1da9115)
Link: https://github.com/openwrt/openwrt/pull/21356
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 14:32:36 +01:00
Eric Fahlgren
0d3e93e7ba mediatek: filogic: fix supported_devices list for gl-mt2500
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
The SUPPORTED_DEVICES sets for both Maxlinear (v1) and Airoha (v2)
devices were identical, so sysupgrade was unable to detect when an
incorrect image was being installed.  This caused "soft bricking" of
devices when a v1 image was installed on a v2 device, and vice versa.

Fix this by making the supported_devices distinct for each device
version, by renaming the devices with a version-specific name.
This is reflected in the file name and the image metadata.

Fixes: https://github.com/openwrt/openwrt/issues/20566
Fixes: https://github.com/openwrt/asu/issues/1525
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20632
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b71f4665cd)
2025-12-30 23:03:26 +01:00
Mikhail Kshevetskiy
d819a05a8e airoha: spi: update airoha-snfi patches and en7523 dts
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Changes:
* use upstream patches for airoha-snfi driver
* update in kernel en7523 dts to add spinand support

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/21299
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit d9b1c74780)
2025-12-28 12:48:49 +01:00
Qingfang Deng
ffd0e5c9f0 mvebu: enable tickless idle
Switch to NO_HZ_IDLE for energy saving. Also enable Menu cpuidle
governor for tickless systems.

Run-tested: Linksys WRT1900AC v2

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21136
(cherry picked from commit c13f299918)
Link: https://github.com/openwrt/openwrt/pull/21305
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-28 12:46:23 +01:00
Florian Maurer
a9bc5059c2 ath79: cf-ew71-v2: set label-mac-device to eth1
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The EW71v2 has the WAN port configured at eth1.
The printed label-mac is configured on this iface in openwrt.

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
(cherry picked from commit 7f3537ee2c)
2025-12-27 18:29:22 +01:00
Markus Stockhausen
380e5ea1f2 realtek: fix Linksys LGS328C dts memory definition
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
RTL930x devices have highmem starting address at 0x20000000.
The Linksys LGS328C highmem definition is wrongly shared with
the larger LGS352C RTL931x model and starts at 0x90000000.
Fix it by splitting the definition.

Fixes: 853d73f ("realtek: add support for Linksys LGS328C")

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21262
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 5d7470d4ca)
2025-12-27 14:19:46 +01:00
Dmitry Mostovoy
d23f614451 mediatek: add kmod-usb3 to default package set of WR3000P
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
Include XHCI USB drivers on the Cudy WR3000P v1 router, the drivers are
required to be able to use the USB port for USD devices.

Closes: https://github.com/openwrt/openwrt/issues/21231
Fixes: 04e9d154f2 ("mediatek: filogic: add support for Cudy WR3000P v1")
Signed-off-by: Dmitry Mostovoy <dmitry.mostovoy@ceifx.com>
Link: https://github.com/openwrt/openwrt/pull/21281
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 9da57e2f82)
2025-12-26 13:57:41 +01:00
Nick French
e7d89ac0ea ath79: Fix syntax error in 10_fix_wifi_mac
This typo makes the script fail with:
-ash: /etc/hotplug.d/ieee80211/10_fix_wifi_mac: line 66: syntax error: unexpected word (expecting ")")

which ultimately prevents the mac address for certain devices wireless cards being set correctly

Signed-off-by: Nick French <nickfrench@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21287
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit cb94962ac4)
2025-12-26 13:48:16 +01:00
Robert Senderek
400c1c5ea8 qualcommax: ipq50xx: remove cpufreq scaling
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
ipq5018 do not support freq scaling and therefore stuck on 800Mhz
This patch allows CPU to run with 1.008 Ghz as designed

Signed-off-by: Robert Senderek <robert.senderek@10g.pl>
Link: https://github.com/openwrt/openwrt/pull/21185
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit c1290fa48c)
2025-12-26 12:24:53 +01:00
George Moussalem
2da39423ed qualcommax: ipq50xx: fix reo2host-status interrupt vector
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
Interrupt vector for reo2host-status is wrongly assigned.
Status interrupts weren't received and a workaround was applied to
mac80211 to periodically poll the reo status ring. Therefore, the
workaround can be removed with the proper hardware interrupt line
assigned.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21272
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 13:07:01 +01:00
Robert Marko
a4a2638590
microchipsw: sync with DTS sent upstream
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Sync the DTS with the version sent upstream, clock bindings also.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
(cherry picked from commit bce8432bbd)
2025-12-24 11:04:32 +01:00
Radek Dostál
c3cf33f98b ath79: fix build of big images for TP RE355v1, RE450v1 & v2
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
After merge of https://github.com/openwrt/openwrt/pull/20709 I noticed,
that https://mirror-03.infra.openwrt.org/snapshots/targets/ath79/tiny/
still does not contain the build for RE450.

I analyzed the problem and noticed, that only builds which fits into
original size can be build and if the image is larger, it fails with
the following error: "WARNING: Image file .../openwrt/build_dir/
target-mips_24kc_musl/linux-ath79_tiny/tmp/
openwrt-ath79-tiny-tplink_re450-v1-squashfs-sysupgrade.bin is too big:
  > 7864320".

This error is quite misleading as the image is smaller than 7864320. The
reason for this error is that default tplink-safeloader has hardcoded
factory partition structure and fails to generate any file.

Rather then fixing tplink-safeloader I followed approach from commit
ebd5e5fb53 ("ramips: switched TP-Link RE305 v1 to new partition layout")
and switched away from "tplink-safeloader sysupgrade".

I did not include "IMAGES := sysupgrade.bin", because with tiny target it
is still possible to locally build even factory image.

Fixes commit e768731dc8 ("ath79: switch TP-Link RE355 v1, RE450 v1 and
RE450 v2 to mtd-concat").

Signed-off-by: Radek Dostál <rd@radekdostal.com>
Link: https://github.com/openwrt/openwrt/pull/21158
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit bdbb4bdfa0)
2025-12-22 18:51:03 +01:00
Mikhail Kshevetskiy
623e329a52 mediatek: fix pwn fan settings for sinovoip bpi-r3 (v3)
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Popular cheap PWM fans for this machine, like the ones coming in
heatsink+fan combos will not work properly at the currently defined
medium speed. Trying different pwm setting using a command

  echo $value > /sys/devices/platform/pwm-fan/hwmon/hwmon1/pwm1

I found:

  pwm1 value     fan rotation speed   cpu temperature     notes
  -----------------------------------------------------------------
    0            maximal              31.5 Celsius        too noisy
   40            optimal              35.2 Celsius        no noise hearable
   95            minimal
   above 95      does not rotate      55.5 Celsius
  -----------------------------------------------------------------

Current cooling levels are:

	cooling-levels = <255 96 0>;

Thus only cpu-active-high and cpu-active-low modes are usable.
This patch fixes cpu-active-medium settings for bpi-r3 board.

This patch may not be enough. Users may wants to tweak their thermal_zone0
trip points, thus tuning fan rotation speed depending on cpu temperature.
That can be done on the base of the following example:

  === example =========
  # cpu temperature below 25 Celsius degrees, no rotation
  echo 25000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp
  # cpu temperature in [25..32] Celsius degrees, normal rotation speed
  echo 32000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp
  # cpu temperature above 50 Celsius degrees, max rotation speed
  echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp
  =====================

Changes v2:
* put patch to a proper directory
* updated patch description
* tested with latest openwrt based on linux-6.6

Changes v3:
* use upstream linux patch
* update patch description

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17130
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 095151b235)
2025-12-22 10:34:23 +01:00
Hauke Mehrtens
fe1b06f725 kernel: Fix boot of realtek rtl838x
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Revert two patches from upstream Linux:
135178e90a
63a93d1cd6

This fixes a boot hang on realtek rtl838x switches.
This is the last printed message:
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)

Thread on mips mailing list:
https://lore.kernel.org/linux-mips/b35fe4b3-8f42-49f4-a6bf-9f0e56d4050c@hauke-m.de/T/#u

Link: https://github.com/openwrt/openwrt/pull/21166
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21126
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0bfc66e7b5)
2025-12-17 00:32:25 +01:00
John Audia
0669972095 kernel: bump 6.12 to 6.12.62
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.62

Manually rebased:
  bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch

Removed upstreamed:
  backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch[1]

All other patches automatically rebased.

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

Build system: x86/64
Build-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc
Run-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21126
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 97e9d7038e)
2025-12-17 00:32:23 +01:00
Jonas Jelonek
88ab3205fe realtek: mdio-serdes: use correct device table identifier
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Use the correct identifier 'rtsds_of_match' instead of
'rtsds_mdio_of_match' because the latter doesn't exist.

This doesn't cause an error for 6.12. However, with 6.18 the
implementation of MODULE_DEVICE_TABLE has changed to use 'static' and
'used' [1] instead of 'extern' and 'unused' [2].

[1] 7d0a66e4bb/include/linux/module.h (L260)
[2] adc218676e/include/linux/module.h (L249)

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21182
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit d519a3ee86)
2025-12-16 14:03:11 +01:00
Jonas Jelonek
c870f16350 realtek: pcs: move polarity into SerDes struct
As a first real usage of the new SerDes struct, move the polarity
configuration there. It was previously located in the global rtpcs_ctrl
struct as an array, indexed by SerDes id. Because this is per-SerDes
information, the new SerDes struct is the correct place to live in.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 56a71f3c82)
2025-12-16 13:38:14 +01:00
Jonas Jelonek
4d86ac6401 realtek: pcs: drop unneeded SerDes number range checks
By using references to pre-initiated SerDes instances instead of plain
SerDes number, there is no need to check for the range anymore in
various places. During driver/pcs init it is ensured that only valid
SerDes will reach the configuration functions.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 18eea05483)
2025-12-16 13:38:14 +01:00
Jonas Jelonek
d2a34744fe realtek: pcs: make use of SerDes struct in set_autoneg
Also switch set_autoneg (and related helper rtpcs_sds_modify) to the
SerDes struct instead of the plain SerDes id by using just the reference
to the SerDes instance instead of (ctrl, sds_id) tuple. This completes
the transition.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit d8dd8bd88f)
2025-12-16 13:38:14 +01:00
Jonas Jelonek
cf03520c71 realtek: pcs: make use of SerDes struct in SerDes setup
Make use of the previously added SerDes struct in SerDes setup and all
functions in its call path by removing (ctrl, sds_num) being passed to
every function call and instead just pass the reference to the
corresponding SerDes instance.

Various SerDes calculations for even, odd and neighbor are unified by
switching to previously introduced helpers.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 1fccb0eb16)
2025-12-16 13:38:13 +01:00
Jonas Jelonek
0fe7f97896 realtek: pcs: switch to id from SerDes struct
Drop usage of the to-be-phased-out SerDes id stored in rtpcs_link and
use the reference to the SerDes instance to use the embedded id in
rtpcs_serdes instead.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 4d9400f86b)
2025-12-16 13:38:13 +01:00
Jonas Jelonek
6f98353eec realtek: pcs: assign SerDes reference upon PCS creation
Upon creation of a phylink_pcs instance by calling rtpcs_create, assign
a reference to the corresponding SerDes to the link structure. In the
next step, this should be used everywhere instead of the plain SerDes
number.

Rename the field used to hold the SerDes number from 'sds' to 'sds_num'
and name the new field 'sds' to make clear what is what.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 69bbcc685b)
2025-12-16 13:38:13 +01:00
Jonas Jelonek
01cfdb1610 realtek: pcs: add helpers for even, odd, neighbor SerDes
Add dedicated helpers to get references to even, odd and neigbor SerDes
if needed. This should replace the various calculations scattered
throughout the code, providing a unified way to work with adjacent
SerDes.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 232c1fb14a)
2025-12-16 13:38:13 +01:00