From lede-commits at lists.infradead.org  Mon Dec  1 00:13:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 01 Dec 2025 03:13:20 -0500
Subject: [openwrt/openwrt]  generic: 6.12: backport bcm63xx-spi CS deassertion
 fix
In-Reply-To: <176457680054.2856548.8952237192476461113@git-01.infra.openwrt.org>
References: <176457680054.2856548.8952237192476461113@git-01.infra.openwrt.org>
Message-ID: <mailman.32011.1764576806.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d7f777b41c99fb0a26014037cf6f4d1838704816

commit d7f777b41c99fb0a26014037cf6f4d1838704816
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Sun Nov 30 17:09:46 2025 +0100

    generic: 6.12: backport bcm63xx-spi CS deassertion fix
    
    Backport fix for premature SPI CS deassertion on RX-only transactions from
    linux v6.18, which is needed for bmips (bcm63xx).
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 ...re-CS-deassertion-on-RX-only-transactions.patch | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/target/linux/generic/backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch b/target/linux/generic/backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch
new file mode 100644
index 0000000000..6a8889ee3c
--- /dev/null
+++ b/target/linux/generic/backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch
@@ -0,0 +1,59 @@
+From fd9862f726aedbc2f29a29916cabed7bcf5cadb6 Mon Sep 17 00:00:00 2001
+From: Hang Zhou <929513338 at qq.com>
+Date: Mon, 17 Nov 2025 01:08:35 +1100
+Subject: [PATCH] spi: bcm63xx: fix premature CS deassertion on RX-only
+ transactions
+
+On BCM6358 (and also observed on BCM6368) the controller appears to
+only generate as many SPI clocks as bytes that have been written into
+the TX FIFO. For RX-only transfers the driver programs the transfer
+length in SPI_MSG_CTL but does not write anything into the FIFO, so
+chip select is deasserted early and the RX transfer segment is never
+fully clocked in.
+
+A concrete failing case is a three-transfer MAC address read from
+SPI-NOR:
+  - TX 0x03 (read command)
+  - TX 3-byte address
+  - RX 6 bytes (MAC)
+
+In contrast, a two-transfer JEDEC-ID read (0x9f + 6-byte RX) works
+because the driver uses prepend_len and writes dummy bytes into the
+TX FIFO for the RX part.
+
+Fix this by writing 0xff dummy bytes into the TX FIFO for RX-only
+segments so that the number of bytes written to the FIFO matches the
+total message length seen by the controller.
+
+Fixes: b17de076062a ("spi/bcm63xx: work around inability to keep CS up")
+
+Signed-off-by: Hang Zhou <929513338 at qq.com>
+Link: https://patch.msgid.link/tencent_7AC88FCB3076489A4A7E6C2163DF1ACF8D06 at qq.com
+Signed-off-by: Mark Brown <broonie at kernel.org>
+---
+ drivers/spi/spi-bcm63xx.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+--- a/drivers/spi/spi-bcm63xx.c
++++ b/drivers/spi/spi-bcm63xx.c
+@@ -247,6 +247,20 @@ static int bcm63xx_txrx_bufs(struct spi_
+ 
+ 		if (t->rx_buf) {
+ 			do_rx = true;
++
++			/*
++			 * In certain hardware implementations, there appears to be a
++			 * hidden accumulator that tracks the number of bytes written into
++			 * the hardware FIFO, and this accumulator overrides the length in
++			 * the SPI_MSG_CTL register.
++			 *
++			 * Therefore, for read-only transfers, we need to write some dummy
++			 * value into the FIFO to keep the accumulator tracking the correct
++			 * length.
++			 */
++			if (!t->tx_buf)
++				memset_io(bs->tx_io + len, 0xFF, t->len);
++
+ 			/* prepend is half-duplex write only */
+ 			if (t == first)
+ 				prepend_len = 0;



From lede-commits at lists.infradead.org  Mon Dec  1 02:57:03 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 01 Dec 2025 05:57:03 -0500
Subject: [openwrt/openwrt]  ath79: add back mistakenly removed label
In-Reply-To: <176458662337.3864269.8039351168615386512@git-01.infra.openwrt.org>
References: <176458662337.3864269.8039351168615386512@git-01.infra.openwrt.org>
Message-ID: <mailman.32101.1764586628.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/bda163eb7c0c8e3f97302c222f32ea3062075b31

commit bda163eb7c0c8e3f97302c222f32ea3062075b31
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Mon Dec 1 02:28:04 2025 -0800

    ath79: add back mistakenly removed label
    
    Fixes target builds.
    
    Fixes: 592d4e6 ("ath79: mr600-v1: use led-sources for ath9k")
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21008
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi
index c88719d4d8..5a20543202 100644
--- a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi
+++ b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi
@@ -138,7 +138,7 @@
 &pcie {
 	status = "okay";
 
-	wifi at 0,0 {
+	ath9k: wifi at 0,0 {
 		compatible = "pci168c,0030";
 		reg = <0x0000 0 0 0 0>;
 		nvmem-cells = <&macaddr_art_0 8>, <&calibration_art_5000>;



From lede-commits at lists.infradead.org  Mon Dec  1 05:30:31 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 01 Dec 2025 08:30:31 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq807x: add support for Zyxel
 NWA210AX
In-Reply-To: <176459583159.598999.11901719367694436580@git-01.infra.openwrt.org>
References: <176459583159.598999.11901719367694436580@git-01.infra.openwrt.org>
Message-ID: <mailman.32192.1764595837.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/401c0a03f13de816e1a5998e69bff82057b489d6

commit 401c0a03f13de816e1a5998e69bff82057b489d6
Author: Eric Sch?fer <eric at es86.de>
AuthorDate: Tue Aug 12 18:47:28 2025 +0000

    qualcommax: ipq807x: add support for Zyxel NWA210AX
    
    The Zyxel NWA210AX is a wall- and ceiling-mountable access point (AP).
    
    Hardware specifications:
    - SoC: Qualcomm IPQ8071A
    - RAM: 1 GB (Samsung K4A8G165WC-BCTD)
    - Flash: 8 MB (Winbond W25Q64DW), 256 MB (Winbond W29N02GZ)
    - Ethernet: 1x 2.5 Gbps RJ45 port (QCA8081), 1x 1 Gbps RJ45 port (AR8033)
    - WiFi: 2.4 GHz 802.11ax/b/g/n (QCN5024), 5 GHz 802.11 ac/ax/n (QCN5054)
    - Power: DC 12V/PoE 802.3at
    - Button: Reset
    - LEDs: Multicolour red/green/blue/white via LP5562
    
    Installation/flashing instructions:
    1. In OEM web interface navigate to gear icon ? System ? SSH and enable SSH.
    2. Log in via SSH (username/password are the same as for the web interface).
    3. Run "debug dual-image show".
    4. Verify that output is "Current Image num: 1".
    5. If this is not the case (i.e. if the output is "Current Image num: 0"):
       a. Either flash a fresh version of factory firmware, or
       b. run "debug dual-image set boot-image image1" and then run "reboot".
    6. Log in via SSH again and verify that output is "Current Image num: 1".
    7. Rename "openwrt-qualcommax-ipq807x-zyxel_nwa210ax-squashfs-factory.bin" to
       "openwrt.bin" to avoid upload errors in the OEM web interface.
    8. Reopen OEM web interface, navigate to wrench icon ? File Manager ?
       Firmware Package and upload the bin file. Once the upgrade process is
       finished and OpenWrt has booted, the LED will light up green.
    
    Switching between OpenWrt and OEM firmware:
    - OpenWrt ? Zyxel via ssh command "zyxel-bootconfig-ipq807x set image1".
    - Zyxel ? OpenWrt via ssh command "debug dual-image set boot-image image0".
    
    This commit is based on the work of Pascal Beleiu  <pascal at beleiu.de>:
    93ca21f3 (qualcommax: ipq807x: add support for Zyxel NWA210AX, 2025-03-17)
    
    Signed-off-by: Eric Sch?fer <eric at es86.de>
    Link: https://github.com/openwrt/openwrt/pull/19828
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../uboot-envtools/files/qualcommax_ipq807x        |   3 +-
 package/firmware/ipq-wifi/Makefile                 |   4 +-
 package/utils/zyxel-bootconfig-ipq807x/Makefile    |  44 +++
 .../files/95_apply_bootconfig                      |  12 +
 .../files/zyxel-bootconfig-ipq807x                 | 145 +++++++
 target/linux/qualcommax/config-6.12                |   2 +
 .../arch/arm64/boot/dts/qcom/ipq8071-nwa210ax.dts  | 437 +++++++++++++++++++++
 target/linux/qualcommax/image/ipq807x.mk           |  23 ++
 .../ipq807x/base-files/etc/board.d/02_network      |   7 +
 .../etc/hotplug.d/firmware/11-ath11k-caldata       |   7 +
 .../ipq807x/base-files/lib/upgrade/platform.sh     |   3 +-
 11 files changed, 684 insertions(+), 3 deletions(-)

diff --git a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
index 3b4ae59fc6..c022531a06 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
+++ b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
@@ -11,7 +11,8 @@ case "$board" in
 aliyun,ap8220|\
 compex,wpq873|\
 edgecore,eap102|\
-zyxel,nbg7815)
+zyxel,nbg7815|\
+zyxel,nwa210ax)
 	ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x10000"
 	;;
 dynalink,dl-wrx36|\
diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 8268970c4f..47b2f8788b 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -102,7 +102,8 @@ ALLWIFIBOARDS:= \
 	zte_mf286c \
 	zte_mf287 \
 	zte_mf287plus \
-	zyxel_nbg7815
+	zyxel_nbg7815 \
+	zyxel_nwa210ax
 
 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
 
@@ -281,5 +282,6 @@ $(eval $(call generate-ipq-wifi-package,zte_mf286c,ZTE MF286C))
 $(eval $(call generate-ipq-wifi-package,zte_mf287,ZTE MF287))
 $(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus))
 $(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815))
+$(eval $(call generate-ipq-wifi-package,zyxel_nwa210ax,Zyxel NWA210AX))
 
 $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))
diff --git a/package/utils/zyxel-bootconfig-ipq807x/Makefile b/package/utils/zyxel-bootconfig-ipq807x/Makefile
new file mode 100644
index 0000000000..b624a13b09
--- /dev/null
+++ b/package/utils/zyxel-bootconfig-ipq807x/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2025 Pascal Beleiu <pascal at beleiu.de>
+# Copyright (c) 2025 Eric Sch?fer <eric at es86.de>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=zyxel-bootconfig-ipq807x
+PKG_RELEASE:=1
+PKG_FLAGS:=nonshared
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/zyxel-bootconfig-ipq807x
+	SECTION:=utils
+	CATEGORY:=Base system
+	TITLE:=Utility for handling Zyxel bootconfig settings on ipq807x devices
+	MAINTAINER:=Pascal Beleiu <pascal at beleiu.de>
+	DEPENDS:=@TARGET_qualcommax_ipq807x
+endef
+
+define Package/zyxel-bootconfig-ipq807x/description
+	This package contains an utility for handling Zyxel bootconfig settings on ipq807x devices.
+endef
+
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/zyxel-bootconfig-ipq807x/install
+	$(INSTALL_DIR) $(1)/usr/bin $(1)/lib/preinit
+	$(INSTALL_BIN) ./files/zyxel-bootconfig-ipq807x $(1)/usr/bin/
+	$(CP) ./files/95_apply_bootconfig $(1)/lib/preinit/95_apply_bootconfig
+endef
+
+$(eval $(call BuildPackage,zyxel-bootconfig-ipq807x))
diff --git a/package/utils/zyxel-bootconfig-ipq807x/files/95_apply_bootconfig b/package/utils/zyxel-bootconfig-ipq807x/files/95_apply_bootconfig
new file mode 100644
index 0000000000..03c833b951
--- /dev/null
+++ b/package/utils/zyxel-bootconfig-ipq807x/files/95_apply_bootconfig
@@ -0,0 +1,12 @@
+apply_bootconfig() {
+	. /lib/functions.sh
+
+	case $(board_name) in
+	zyxel,nwa210ax)
+		status="$(zyxel-bootconfig-ipq807x show | awk '/image0:/ {print $2}')"
+		[ "$status" != "selected" ] && zyxel-bootconfig-ipq807x --force set image0
+		;;
+	esac
+}
+
+[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main apply_bootconfig
diff --git a/package/utils/zyxel-bootconfig-ipq807x/files/zyxel-bootconfig-ipq807x b/package/utils/zyxel-bootconfig-ipq807x/files/zyxel-bootconfig-ipq807x
new file mode 100755
index 0000000000..2e23a1a312
--- /dev/null
+++ b/package/utils/zyxel-bootconfig-ipq807x/files/zyxel-bootconfig-ipq807x
@@ -0,0 +1,145 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+BOOTCONFIG_MTD="$(find_mtd_part 0:bootconfig || true)"
+BOOTCONFIG1_MTD="$(find_mtd_part 0:bootconfig1 || true)"
+OFFSET=4
+
+FORCE=0
+
+usage() {
+	cat <<-EOF
+	Usage: $0 [--force] {show | set image0 | set image1}
+
+	Options:
+	  --force   Skip all confirmation prompts (non-interactive mode)
+
+	Commands:
+	  show           Display current and next boot image status
+	  set image0     Set image0 as active for next boot
+	  set image1     Set image1 as active for next boot
+	EOF
+	exit 1
+}
+
+if [ "${1:-}" = "--force" ]; then
+	FORCE=1
+	shift
+fi
+
+require_mtd() {
+	if [ -z "$BOOTCONFIG_MTD" ] || [ -z "$BOOTCONFIG1_MTD" ]; then
+		printf "ERROR: bootconfig MTD partitions not found.\n" >&2
+		exit 1
+	fi
+}
+
+read_status() {
+	local dev="$1"
+	hexdump -v -e '1/1 "%01x"' -n 1 -s "$OFFSET" "$dev" 2>/dev/null
+}
+
+write_status() {
+	local dev="$1" val="$2"
+	printf "\\x$val" | dd of="$dev" bs=1 seek=$OFFSET count=1 conv=notrunc 2>/dev/null
+}
+
+status_string() {
+	case "$1" in
+		0) printf "none" ;;
+		1) printf "backup" ;;
+		2) printf "selected" ;;
+		*) printf "unknown" ;;
+	esac
+}
+
+show_status() {
+	printf "Currently booted:\n  image%s\n" \
+		"$(awk -F 'bootImage=' '{print $2}' /proc/cmdline | awk '{print $1}')"
+
+	STATUS0="$(read_status "$BOOTCONFIG_MTD")"
+	STATUS1="$(read_status "$BOOTCONFIG1_MTD")"
+
+	printf "At next reboot:\n"
+	printf "  image0: %s\n" "$(status_string "$STATUS0")"
+	printf "  image1: %s\n" "$(status_string "$STATUS1")"
+}
+
+check_selected() {
+	local old="$1"
+	local img="$2"
+
+	if [ "$old" = "0" ]; then
+		printf "\nWARNING: image%s is currently 'none'. Booting might fail.\n" "$img" >&2
+		if [ "$FORCE" -ne 1 ]; then
+			read -rp "Proceed anyway? (yes/no) " confirm >&2
+			[ "$confirm" != "yes" ] && return 1
+		fi
+	fi
+	printf "02"
+}
+
+check_backup() {
+	local old="$1"
+	local img="$2"
+
+	if [ "$old" = "0" ]; then
+		printf "\nINFO: Kept image%s as 'none'.\n" "$img" >&2
+		printf "00"
+	else
+		printf "01"
+	fi
+}
+
+set_image() {
+	local img="$1"
+	local new0 new1
+
+	printf "OLD CONFIGURATION\n"
+	show_status
+
+	if [ "$STATUS0" = "1" ] && [ "$STATUS1" = "1" ] && [ "$FORCE" -ne 1 ]; then
+		printf "WARNING: Both images are marked as selected!\n" >&2
+		read -rp "Proceed anyway? (yes/no) " confirm >&2
+		[ "$confirm" != "yes" ] && exit 1
+	fi
+
+	case "$img" in
+		0)
+			new0="$(check_selected "$STATUS0" "0")" || exit 1
+			new1="$(check_backup "$STATUS1" "1")"
+			;;
+		1)
+			new0="$(check_backup "$STATUS0" "0")"
+			new1="$(check_selected "$STATUS1" "1")" || exit 1
+			;;
+		*)
+			printf "ERROR: Invalid image selection.\n" >&2
+			exit 1
+			;;
+	esac
+	
+	printf "\nUpdating image selection...\n"
+	write_status "$BOOTCONFIG_MTD" "$new0"
+	write_status "$BOOTCONFIG1_MTD" "$new1"
+	printf "Done.\n"
+
+	printf "\nNEW CONFIGURATION\n"
+	show_status
+}
+
+require_mtd
+
+case "${1:-}" in
+	show)
+		show_status
+		;;
+	set)
+		[ -z "${2:-}" ] && usage
+		set_image "${2#image}"
+		;;
+	*)
+		usage
+		;;
+esac
diff --git a/target/linux/qualcommax/config-6.12 b/target/linux/qualcommax/config-6.12
index cc9079707b..d0dd32a0aa 100644
--- a/target/linux/qualcommax/config-6.12
+++ b/target/linux/qualcommax/config-6.12
@@ -191,6 +191,8 @@ CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GLOB=y
 CONFIG_GPIOLIB_IRQCHIP=y
 CONFIG_GPIO_CDEV=y
+CONFIG_GPIO_WATCHDOG=y
+# CONFIG_GPIO_WATCHDOG_ARCH_INITCALL is not set
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-nwa210ax.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-nwa210ax.dts
new file mode 100644
index 0000000000..fb440d1e96
--- /dev/null
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-nwa210ax.dts
@@ -0,0 +1,437 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright (c) 2025 Pascal Beleiu <pascal at beleiu.de>
+ * Copyright (c) 2025 Eric Sch?fer <eric at es86.de>
+ */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-ac-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "Zyxel NWA210AX";
+	compatible = "zyxel,nwa210ax", "qcom,ipq8074";
+
+	aliases {
+		led-boot = &lp5562_blue;
+		led-failsafe = &lp5562_white;
+		led-running = &lp5562_green;
+		led-upgrade = &lp5562_red;
+		serial0 = &blsp1_uart5;
+		ethernet0 = &dp5;
+		ethernet1 = &dp1;
+		label-mac-device = &dp5;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&tlmm 31 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		gpio_green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+		};
+
+		gpio_red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	watchdog {
+		compatible = "linux,wdt-gpio";
+		gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>;
+		hw_algo = "toggle";
+		hw_margin_ms = <10000>;
+		always-running;
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&edma {
+	status = "okay";
+};
+
+&tlmm {
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+
+	mdio_gpio_pins: mdio-gpio-pins {
+		pins = "gpio37", "gpio44";
+		function = "gpio";
+		bias-pull-up;
+	};
+
+	button_pins: button-pins {
+		pins = "gpio30";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-pull-up;
+	};
+
+	i2c_6_pins: i2c-6-state {
+		pins = "gpio0", "gpio2";
+		drive-strength = <8>;
+		function = "blsp5_i2c";
+		bias-disable;
+	};
+};
+
+&switch {
+	status = "okay";
+
+	switch_lan_bmp = <(ESS_PORT1 | ESS_PORT5)>;
+	switch_mac_mode = <MAC_MODE_SGMII_CHANNEL0>;
+	switch_mac_mode1 = <MAC_MODE_SGMII_PLUS>;
+
+	qcom,port_phyinfo {
+		port at 1 {
+			port_id = <1>;
+			phy_address = <1>;
+		};
+
+		port at 5 {
+			port_id = <5>;
+			phy_address = <16>;
+			port_mac_sel = "QGMAC_PORT";
+		};
+	};
+};
+
+&mdio {
+	status = "okay";
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+
+	ar8033: ethernet-phy at 1 {
+		compatible = "ethernet-phy-id004d.074";
+		reg = <1>;
+	};
+
+	qca8081: ethernet-phy at 16 {
+		compatible = "ethernet-phy-id004d.d101";
+		reg = <16>;
+		reset-deassert-us = <10000>;
+		reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&dp1 {
+	status = "okay";
+	phy-handle = <&ar8033>;
+	phy-mode = "sgmii";
+	label = "lan1";
+	nvmem-cell-names = "mac-address";
+	nvmem-cells = <&label_mac 1>;
+};
+
+&dp5 {
+	status = "okay";
+	phy-handle = <&qca8081>;
+	phy-mode = "sgmii";
+	label = "uplink";
+	nvmem-cell-names = "mac-address";
+	nvmem-cells = <&label_mac 0>;
+};
+
+&blsp1_spi1 {
+	pinctrl-0 = <&spi_0_pins>;
+	pinctrl-names = "default";
+	cs-select = <0>;
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0>;
+		linux,modalias = "m25p80", "n25q128a11";
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "0:sbl1";
+				reg = <0x0 0x50000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				label = "0:mibib";
+				reg = <0x50000 0x10000>;
+				read-only;
+			};
+
+			partition at 60000 {
+				label = "0:bootconfig";
+				reg = <0x60000 0x20000>;
+			};
+
+			partition at 80000 {
+				label = "0:bootconfig1";
+				reg = <0x80000 0x20000>;
+			};
+
+			partition at a0000 {
+				label = "0:qsee";
+				reg = <0xa0000 0x180000>;
+				read-only;
+			};
+
+			partition at 220000 {
+				label = "0:qsee_1";
+				reg = <0x220000 0x180000>;
+				read-only;
+			};
+
+			partition at 3a0000 {
+				label = "0:devcfg";
+				reg = <0x3a0000 0x10000>;
+				read-only;
+			};
+
+			partition at 3b0000 {
+				label = "0:devcfg_1";
+				reg = <0x3b0000 0x10000>;
+				read-only;
+			};
+
+			partition at 3c0000 {
+				label = "0:apdp";
+				reg = <0x3c0000 0x10000>;
+				read-only;
+			};
+
+			partition at 3d0000 {
+				label = "0:apdp_1";
+				reg = <0x3d0000 0x10000>;
+				read-only;
+			};
+
+			partition at 3e0000 {
+				label = "0:rpm";
+				reg = <0x3e0000 0x40000>;
+				read-only;
+			};
+
+			partition at 420000 {
+				label = "0:rpm_1";
+				reg = <0x420000 0x40000>;
+				read-only;
+			};
+
+			partition at 460000 {
+				label = "0:cdt";
+				reg = <0x460000 0x10000>;
+				read-only;
+			};
+
+			partition at 470000 {
+				label = "0:cdt_1";
+				reg = <0x470000 0x10000>;
+				read-only;
+			};
+
+			partition at 480000 {
+				label = "0:appsblenv";
+				reg = <0x480000 0x10000>;
+				read-only;
+			};
+
+			partition at 490000 {
+				label = "0:appsbl";
+				reg = <0x490000 0xa0000>;
+				read-only;
+			};
+
+			partition at 530000 {
+				label = "0:appsbl_1";
+				reg = <0x530000 0xa0000>;
+				read-only;
+			};
+
+			partition at 5d0000 {
+				label = "0:art";
+				reg = <0x5d0000 0x40000>;
+				read-only;
+			};
+
+			partition at 610000 {
+				label = "mrd";
+				reg = <0x610000 0x10000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					label_mac: macaddr at fff8 {
+						compatible = "mac-base";
+						reg = <0xfff8 0x6>;
+						#nvmem-cell-cells = <1>;
+					};
+				};
+			};
+
+			partition at 620000 {
+				label = "mrd_1";
+				reg = <0x620000 0x10000>;
+				read-only;
+			};
+
+			partition at 630000 {
+				label = "conf";
+				reg = <0x630000 0x1d0000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand at 0 {
+		reg = <0>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+		nand-ecc-strength = <4>;
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			reg = <0x00 0x3c00000>;
+			label = "rootfs";
+		};
+
+		partition at 3c00000 {
+			reg = <0x3c00000 0x800000>;
+			label = "0:wififw";
+			read-only;
+		};
+
+		partition at 4400000 {
+			reg = <0x4400000 0x3c00000>;
+			label = "rootfs_1";
+		};
+
+		partition at 8000000 {
+			reg = <0x8000000 0x800000>;
+			label = "0:wififw_1";
+			read-only;
+		};
+
+		partition at 8800000 {
+			reg = <0x8800000 0x7800000>;
+			label = "logs";
+		};
+	};
+};
+
+&wifi {
+	status = "okay";
+	qcom,ath11k-calibration-variant = "Zyxel-NWA210AX";
+};
+
+&blsp1_i2c6 {
+	pinctrl-0 = <&i2c_6_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+
+	lp5562 at 30 {
+		compatible = "ti,lp5562";
+		reg = <0x30>;
+		clock-mode = [02];
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		lp5562_red: led at 0 {
+			chan-name = "lp5562_red";
+			led-cur = [20];
+			max-cur = [60];
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			reg = <0>;
+		};
+
+		lp5562_green: led at 1 {
+			chan-name = "lp5562_green";
+			led-cur = [20];
+			max-cur = [60];
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			reg = <1>;
+		};
+
+		lp5562_blue: led at 2 {
+			chan-name = "lp5562_blue";
+			led-cur = [20];
+			max-cur = [60];
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+			reg = <2>;
+		};
+
+		lp5562_white: led at 3 {
+			chan-name = "lp5562_white";
+			led-cur = [20];
+			max-cur = [60];
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_STATUS;
+			reg = <3>;
+		};
+	};
+};
diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk
index 1a356b0261..f356bbbca5 100644
--- a/target/linux/qualcommax/image/ipq807x.mk
+++ b/target/linux/qualcommax/image/ipq807x.mk
@@ -33,6 +33,13 @@ define Build/wax6xx-netgear-tar
 	rm -rf $@.tmp
 endef
 
+define Build/zyxel-nwa210ax-fit
+	$(TOPDIR)/scripts/mkits-zyxel-fit-filogic.sh \
+		$@.its $@ "5c e1 ff ff ff ff ff ff ff ff"
+	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+	@mv $@.new $@
+endef
+
 define Device/aliyun_ap8220
 	$(call Device/FitImage)
 	$(call Device/UbiFit)
@@ -541,3 +548,19 @@ define Device/zyxel_nbg7815
 		kmod-hci-uart kmod-hwmon-tmp103
 endef
 TARGET_DEVICES += zyxel_nbg7815
+
+define Device/zyxel_nwa210ax
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := ZYXEL
+	DEVICE_MODEL := NWA210AX
+	DEVICE_DTS_CONFIG := config at ac02
+	SOC := ipq8071
+	DEVICE_PACKAGES := ipq-wifi-zyxel_nwa210ax zyxel-bootconfig-ipq807x kmod-leds-lp5562
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	IMAGE_SIZE := 61440k
+	IMAGES += factory.bin
+	IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) | zyxel-nwa210ax-fit
+endef
+TARGET_DEVICES += zyxel_nwa210ax
diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
index 70f8a3134b..3c0e123141 100644
--- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
@@ -71,6 +71,9 @@ ipq807x_setup_interfaces()
 	zyxel,nbg7815)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 10g" "wan"
 		;;
+	zyxel,nwa210ax)
+		ucidef_set_interface_lan "uplink lan1" "dhcp"
+		;;
 	*)
 		echo "Unsupported hardware. Network interfaces not initialized"
 		;;
@@ -100,6 +103,10 @@ ipq807x_setup_macs()
 		label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
 		lan_mac=$label_mac
 		;;
+	zyxel,nwa210ax)
+		label_mac=$(get_mac_label_dt)
+		lan_mac=$label_mac
+		;;
 	esac
 
 	[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
index 6a9d5afb98..df4907c517 100644
--- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
@@ -126,6 +126,13 @@ case "$FIRMWARE" in
 		ath11k_patch_mac $(macaddr_add $label_mac 4) 2
 		ath11k_set_macflag
 		;;
+	zyxel,nwa210ax)
+		caldata_extract "0:art" 0x1000 0x20000
+		label_mac=$(get_mac_label)
+		ath11k_patch_mac $(macaddr_add $label_mac 3) 0
+		ath11k_patch_mac $(macaddr_add $label_mac 2) 1
+		ath11k_set_macflag
+		;;
 	esac
 	;;
 "ath11k/QCN9074/hw1.0/cal-pci-0000:01:00.0.bin"|\
diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
index 0a38cfa8d8..1ddc73f09e 100644
--- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
@@ -184,7 +184,8 @@ platform_do_upgrade() {
 	netgear,sxs80|\
 	netgear,wax218|\
 	netgear,wax620|\
-	netgear,wax630)
+	netgear,wax630|\
+	zyxel,nwa210ax)
 		nand_do_upgrade "$1"
 		;;
 	asus,rt-ax89x)



From lede-commits at lists.infradead.org  Mon Dec  1 06:05:58 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 01 Dec 2025 09:05:58 -0500
Subject: [openwrt/openwrt]  qualcommax: fix CPR of_property_present conversion
In-Reply-To: <176459795893.683888.18134247717156815638@git-01.infra.openwrt.org>
References: <176459795893.683888.18134247717156815638@git-01.infra.openwrt.org>
Message-ID: <mailman.32195.1764597967.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5bdf1b8d9c6354228655b6ced0d78c238e943d27

commit 5bdf1b8d9c6354228655b6ced0d78c238e943d27
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Mon Dec 1 15:02:04 2025 +0100

    qualcommax: fix CPR of_property_present conversion
    
    CPR conversion to of_property_present is broken in multiple places, either
    by leaving the comma after now the last argument or by attempting to replace
    an instance that actually uses the returned length.
    
    So, lets fix these in order for qualcommax to compile again.
    
    Fixes: c9e7f32c4c09 ("treewide: use of_property_present")
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../0901-regulator-add-Qualcomm-CPR-regulators.patch   | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch b/target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch
index 4484016a7d..a6c5c4b167 100644
--- a/target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch
+++ b/target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch
@@ -7102,7 +7102,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 +#endif /* __REGULATOR_CPR_REGULATOR_H__ */
 --- /dev/null
 +++ b/drivers/regulator/cpr3-util.c
-@@ -0,0 +1,2760 @@
+@@ -0,0 +1,2758 @@
 +/*
 + * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
 + *
@@ -8009,8 +8009,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 +		}
 +		vreg->aging_corner -= CPR3_CORNER_OFFSET;
 +
-+		if (of_property_present(vreg->of_node, "qcom,cpr-aging-derate",
-+					)) {
++		if (of_property_present(vreg->of_node, "qcom,cpr-aging-derate")) {
 +			rc = cpr3_parse_corner_array_property(vreg,
 +				"qcom,cpr-aging-derate", 1, temp);
 +			if (rc)
@@ -8152,8 +8151,8 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 +	int i, cpu;
 +	int len = 0;
 +
-+	if (!of_property_present(ctrl->dev->of_node, "qcom,cpr-interrupt-affinity",
-+				&len)) {
++	if (!of_find_property(ctrl->dev->of_node, "qcom,cpr-interrupt-affinity",
++			      &len)) {
 +		/* No IRQ affinity required */
 +		return 0;
 +	}
@@ -8660,7 +8659,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 +	const char prop_name_v2[] = "qcom,cpr-parts-voltage-v2";
 +
 +	soc_version_major = read_ipq_soc_version_major();
-+        BUG_ON(soc_version_major <= 0);
++	BUG_ON(soc_version_major <= 0);
 +
 +	if (of_property_read_u32(vreg->of_node, "qcom,cpr-part-types",
 +				  &vreg->part_type_supported))
@@ -8835,10 +8834,10 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 +
 +	if (!of_property_present(vreg->of_node, prop_str)) {
 +		/* No adjustment required. */
-+                cpr3_err(vreg, "Missing %s required for %s\n",
++		cpr3_err(vreg, "Missing %s required for %s\n",
 +			prop_str, req_prop_str);
 +		return -EINVAL;
-+        }
++	}
 +
 +	rc = of_property_read_u32(vreg->of_node, prop_str, &temp);
 +	if (rc) {
@@ -9357,8 +9356,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 +
 +	if (of_property_present(node, use_corner_band ?
 +			     "qcom,corner-band-allow-core-count-adjustment"
-+			     : "qcom,corner-allow-core-count-adjustment",
-+			     )) {
++			     : "qcom,corner-allow-core-count-adjustment")) {
 +		rc = of_property_read_u32(node, "qcom,max-core-count",
 +				&vreg->max_core_count);
 +		if (rc) {



From lede-commits at lists.infradead.org  Mon Dec  1 10:20:27 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 01 Dec 2025 13:20:27 -0500
Subject: [openwrt/openwrt]  openssl: fix AES-GCM-SIV and AES-SIV with
 zero-length messages
In-Reply-To: <176461322728.1802106.2974977180770475414@git-01.infra.openwrt.org>
References: <176461322728.1802106.2974977180770475414@git-01.infra.openwrt.org>
Message-ID: <mailman.32287.1764613232.2093109.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2bc79783233c5d8612bfa5831cd334cab62b3e5e

commit 2bc79783233c5d8612bfa5831cd334cab62b3e5e
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Dec 1 18:13:52 2025 +0000

    openssl: fix AES-GCM-SIV and AES-SIV with zero-length messages
    
    Fix the cipher implementation to avoid treating empty input as finalizer.
    This issue is fixed in the openssl 3.6 branch, but the fix approach from
    that branch is not suitable for 3.5, since the code is completely different.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../patches/010-fix-aes-gcm-siv-cipher.patch       | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/package/libs/openssl/patches/010-fix-aes-gcm-siv-cipher.patch b/package/libs/openssl/patches/010-fix-aes-gcm-siv-cipher.patch
new file mode 100644
index 0000000000..3baec89a1b
--- /dev/null
+++ b/package/libs/openssl/patches/010-fix-aes-gcm-siv-cipher.patch
@@ -0,0 +1,62 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Mon, 1 Dec 2025 16:22:17 +0000
+Subject: [PATCH] providers/implementations/ciphers: fix AES-GCM-SIV and
+ AES-SIV with zero-length messages
+
+When ossl_aes_gcm_siv_cipher() or siv_cipher() is called with in=NULL
+for zero-length input, the hw->cipher function interprets this as a
+finalization request and calls the finish function instead of
+encrypt/decrypt. This causes the authentication tag to never be computed
+for zero-length messages, resulting in decryption verification failures.
+
+Fix this by substituting a static empty byte address when in is NULL,
+ensuring hw->cipher always receives a non-NULL pointer from Update calls
+and correctly routes to the encrypt/decrypt path.
+
+For AES-GCM-SIV, this is a different fix than upstream commit
+f1a4f0368b73 ("make aes-gcm-siv work with zero-length messages") which
+removed early-return and length checks that don't exist in 3.5.x.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+
+---
+--- a/providers/implementations/ciphers/cipher_aes_gcm_siv.c
++++ b/providers/implementations/ciphers/cipher_aes_gcm_siv.c
+@@ -140,6 +140,7 @@ static int ossl_aes_gcm_siv_cipher(void
+ {
+     PROV_AES_GCM_SIV_CTX *ctx = (PROV_AES_GCM_SIV_CTX *)vctx;
+     int error = 0;
++    static const unsigned char empty;
+ 
+     if (!ossl_prov_is_running())
+         return 0;
+@@ -149,6 +150,9 @@ static int ossl_aes_gcm_siv_cipher(void
+         return 0;
+     }
+ 
++    if (in == NULL)
++        in = &empty;
++
+     error |= !ctx->hw->cipher(ctx, out, in, inl);
+ 
+     if (outl != NULL && !error)
+--- a/providers/implementations/ciphers/cipher_aes_siv.c
++++ b/providers/implementations/ciphers/cipher_aes_siv.c
+@@ -114,6 +114,7 @@ static int siv_cipher(void *vctx, unsign
+                       size_t outsize, const unsigned char *in, size_t inl)
+ {
+     PROV_AES_SIV_CTX *ctx = (PROV_AES_SIV_CTX *)vctx;
++    static const unsigned char empty;
+ 
+     if (!ossl_prov_is_running())
+         return 0;
+@@ -123,6 +124,9 @@ static int siv_cipher(void *vctx, unsign
+         return 0;
+     }
+ 
++    if (in == NULL)
++        in = &empty;
++
+     if (ctx->hw->cipher(ctx, out, in, inl) <= 0)
+         return 0;
+ 



From lede-commits at lists.infradead.org  Tue Dec  2 01:42:28 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 02 Dec 2025 04:42:28 -0500
Subject: [openwrt/openwrt]  realtek: dsa: rtl930x: Fix flow control with
 ingress shaping
In-Reply-To: <176466854813.1469522.14833754793128992450@git-01.infra.openwrt.org>
References: <176466854813.1469522.14833754793128992450@git-01.infra.openwrt.org>
Message-ID: <mailman.32450.1764668557.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/141ac0b2bd1e7cbad1a75fe17a7b47a3778d16ca

commit 141ac0b2bd1e7cbad1a75fe17a7b47a3778d16ca
Author: Sven Eckelmann <se at simonwunderlich.de>
AuthorDate: Mon Dec 1 13:58:40 2025 +0100

    realtek: dsa: rtl930x: Fix flow control with ingress shaping
    
    Tests with ingress shaping and enabled flow control showed really high
    packet loss. It seems like the MAC pause frames are not created correctly
    when both burst high off is set to the same value as burst high on.
    
    By default, RTL930x has set the burst high values to:
    
    * on: 64K
    * off: 32K
    
    Using the same 1:2 ratio seems to solve the high packet loss rate during
    UDP tests.
    
    Fixes: 2e74eb6d93a7 ("realtek: dsa: rtl93xx: Support per port throttling")
    Signed-off-by: Sven Eckelmann <se at simonwunderlich.de>
    Link: https://github.com/openwrt/openwrt/pull/21011
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c
index fb25b9cf0b..bb41acaf64 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c
@@ -208,9 +208,13 @@ static int rtldsa_930x_port_rate_police_add(struct dsa_switch *ds, int port,
 	if (ingress) {
 		burst = min_t(u32, act->police.burst, RTL930X_BANDWIDTH_CTRL_INGRESS_BURST_MAX);
 
-		/* set burst high on/off the same to avoid TCP oscillation */
+		/* the linux kernel only provides a single burst value. But the
+		 * realtek HW needs two. And to get flow control correctly
+		 * working, the realtek default ratio of 1:2 seems to work
+		 * reasonable well
+		 */
 		sw_w32(burst, RTL930X_BANDWIDTH_CTRL_INGRESS_BURST_HIGH_ON(port));
-		sw_w32(burst, RTL930X_BANDWIDTH_CTRL_INGRESS_BURST_HIGH_OFF(port));
+		sw_w32(burst / 2, RTL930X_BANDWIDTH_CTRL_INGRESS_BURST_HIGH_OFF(port));
 
 		/* Enable ingress bandwidth flow control to improve TCP throughput and avoid
 		 * the drops behavior of the RTL930x ingress rate limiter which seem to not



From lede-commits at lists.infradead.org  Tue Dec  2 13:52:57 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 02 Dec 2025 16:52:57 -0500
Subject: [openwrt/openwrt]  kernel: bump 6.12 to 6.12.60
In-Reply-To: <176471237740.1483277.8509872267234354535@git-01.infra.openwrt.org>
References: <176471237740.1483277.8509872267234354535@git-01.infra.openwrt.org>
Message-ID: <mailman.32623.1764712383.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d0fcbddaadbfde60cc91bd3f44b3b9de36c3cc89

commit d0fcbddaadbfde60cc91bd3f44b3b9de36c3cc89
Author: gongzi miao <miaogongzi0227 at gmail.com>
AuthorDate: Mon Dec 1 19:30:51 2025 +0800

    kernel: bump 6.12 to 6.12.60
    
    changelog:
    https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.60
    
    Signed-off-by: gongzi miao <miaogongzi0227 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21010
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/bcm53xx/patches-6.12/905-BCM53573-minor-hacks.patch | 4 ++--
 target/linux/generic/hack-6.12/810-bcma-ssb-fallback-sprom.patch | 2 +-
 target/linux/generic/kernel-6.12                                 | 4 ++--
 target/linux/x86/patches-6.12/103-pcengines_apu6_platform.patch  | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/bcm53xx/patches-6.12/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-6.12/905-BCM53573-minor-hacks.patch
index e2cab2042c..74fc90ced8 100644
--- a/target/linux/bcm53xx/patches-6.12/905-BCM53573-minor-hacks.patch
+++ b/target/linux/bcm53xx/patches-6.12/905-BCM53573-minor-hacks.patch
@@ -21,7 +21,7 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
  	clocks {
 --- a/drivers/bcma/main.c
 +++ b/drivers/bcma/main.c
-@@ -331,14 +331,6 @@ static int bcma_register_devices(struct
+@@ -337,14 +337,6 @@ static int bcma_register_devices(struct
  	}
  #endif
  
@@ -36,7 +36,7 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
  #ifdef CONFIG_BCMA_NFLASH
  	if (bus->drv_cc.nflash.present) {
  		err = platform_device_register(&bcma_nflash_dev);
-@@ -418,6 +410,14 @@ int bcma_bus_register(struct bcma_bus *b
+@@ -424,6 +416,14 @@ int bcma_bus_register(struct bcma_bus *b
  			bcma_register_core(bus, core);
  	}
  
diff --git a/target/linux/generic/hack-6.12/810-bcma-ssb-fallback-sprom.patch b/target/linux/generic/hack-6.12/810-bcma-ssb-fallback-sprom.patch
index 08085d957a..392c873b0e 100644
--- a/target/linux/generic/hack-6.12/810-bcma-ssb-fallback-sprom.patch
+++ b/target/linux/generic/hack-6.12/810-bcma-ssb-fallback-sprom.patch
@@ -51,7 +51,7 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom  Fallback SP
  	dev_err((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
 --- a/drivers/bcma/main.c
 +++ b/drivers/bcma/main.c
-@@ -671,6 +671,14 @@ static int __init bcma_modinit(void)
+@@ -677,6 +677,14 @@ static int __init bcma_modinit(void)
  {
  	int err;
  
diff --git a/target/linux/generic/kernel-6.12 b/target/linux/generic/kernel-6.12
index 780cf8d6e8..73c2f33a10 100644
--- a/target/linux/generic/kernel-6.12
+++ b/target/linux/generic/kernel-6.12
@@ -1,2 +1,2 @@
-LINUX_VERSION-6.12 = .59
-LINUX_KERNEL_HASH-6.12.59 = a1d2cd7327f10eec022615c1bb12c06439bd110d2020164be97f698f43ca58be
+LINUX_VERSION-6.12 = .60
+LINUX_KERNEL_HASH-6.12.60 = a63096b2147411d683cecbf87622bb2ff4885bac2b3641d3d4f10250c89cdcf8
diff --git a/target/linux/x86/patches-6.12/103-pcengines_apu6_platform.patch b/target/linux/x86/patches-6.12/103-pcengines_apu6_platform.patch
index 4e1761b567..52c1825bf7 100644
--- a/target/linux/x86/patches-6.12/103-pcengines_apu6_platform.patch
+++ b/target/linux/x86/patches-6.12/103-pcengines_apu6_platform.patch
@@ -63,7 +63,7 @@ Sighed-off-by: Philip Prindeville <philipp at redfish-solutions.com>
  
 --- a/drivers/platform/x86/Kconfig
 +++ b/drivers/platform/x86/Kconfig
-@@ -753,7 +753,7 @@ config XO1_RFKILL
+@@ -754,7 +754,7 @@ config XO1_RFKILL
  	  laptop.
  
  config PCENGINES_APU2
@@ -72,7 +72,7 @@ Sighed-off-by: Philip Prindeville <philipp at redfish-solutions.com>
  	depends on INPUT && INPUT_KEYBOARD && GPIOLIB
  	depends on LEDS_CLASS
  	select GPIO_AMD_FCH
-@@ -761,7 +761,7 @@ config PCENGINES_APU2
+@@ -762,7 +762,7 @@ config PCENGINES_APU2
  	select LEDS_GPIO
  	help
  	  This driver provides support for the front button and LEDs on



From lede-commits at lists.infradead.org  Tue Dec  2 14:04:26 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 02 Dec 2025 17:04:26 -0500
Subject: [openwrt/openwrt]  ath79: ews511ap: use nvmem
In-Reply-To: <176471306641.1571163.16488982035948484857@git-01.infra.openwrt.org>
References: <176471306641.1571163.16488982035948484857@git-01.infra.openwrt.org>
Message-ID: <mailman.32631.1764713072.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/55b5e44673d1e3e624602e462d855d1b8fde9a51

commit 55b5e44673d1e3e624602e462d855d1b8fde9a51
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Jun 22 10:46:07 2024 -0700

    ath79: ews511ap: use nvmem
    
    Userspace handling is deprecated.
    
    This is a weird one. It should be using u-boot,env, but the variable
    name is unknown. Keep it as is.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20520
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../linux/ath79/dts/qca9531_engenius_ews511ap.dts  | 24 ++++++++++++++++++++--
 .../generic/base-files/etc/board.d/02_network      |  6 ------
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |  4 ----
 3 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
index f84f8b084b..ba51982156 100644
--- a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
+++ b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
@@ -82,8 +82,8 @@
 	wifi at 0,0 {
 		compatible = "qcom,ath10k";
 		reg = <0x0000 0 0 0 0>;
-		nvmem-cells = <&cal_art_5000>;
-		nvmem-cell-names = "calibration";
+		nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_e9 1>;
+		nvmem-cell-names = "calibration", "mac-address";
 	};
 };
 
@@ -109,6 +109,18 @@
 			ubootenv: partition at 40000 {
 				label = "u-boot-env";
 				reg = <0x040000 0x010000>;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					macaddr_uboot_e9: macaddr at e9 {
+						compatible = "mac-base";
+						reg = <0xe9 0x11>;
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 
 			partition at 50000 {
@@ -144,6 +156,14 @@
 	status = "okay";
 
 	phy-handle = <&swphy4>;
+
+	nvmem-cells = <&macaddr_uboot_e9 0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&eth1 {
+	nvmem-cells = <&macaddr_uboot_e9 1>;
+	nvmem-cell-names = "mac-address";
 };
 
 &wmac {
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index fef96060a8..fa158b839c 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -739,12 +739,6 @@ ath79_setup_macs()
 	engenius,esr900)
 		wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
 		;;
-	engenius,ews511ap)
-		lan_mac=$(mtd_get_mac_text "u-boot-env" 0xe9)
-		eth1_mac=$(macaddr_add "$lan_mac" 1)
-		ucidef_set_interface "eth0" ifname "eth0" protocol "none" macaddr "$lan_mac"
-		ucidef_set_interface "eth1" ifname "eth1" protocol "none" macaddr "$eth1_mac"
-		;;
 	hak5,lan-turtle|\
 	hak5,packet-squirrel)
 		label_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 291241b6ee..6153599907 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -52,10 +52,6 @@ case "$board" in
 		[ "$PHYNBR" -eq 0 ] && \
 			mtd_get_mac_ascii u-boot-env athaddr > /sys${DEVPATH}/macaddress
 		;;
-	engenius,ews511ap)
-		[ "$PHYNBR" -eq 0 ] && \
-		macaddr_add $(cat /sys/class/net/eth0/address) 1 > /sys${DEVPATH}/macaddress
-		;;
 	enterasys,ws-ap3705i)
 		[ "$PHYNBR" -eq 0 ] && \
 			mtd_get_mac_ascii u-boot-env0 RADIOADDR1 > /sys${DEVPATH}/macaddress



From lede-commits at lists.infradead.org  Tue Dec  2 14:33:42 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 02 Dec 2025 17:33:42 -0500
Subject: [openwrt/openwrt]  gpio-button-hotplug: use devm_kmemdup_array
In-Reply-To: <176471482079.1784368.14104483603114559474@git-01.infra.openwrt.org>
References: <176471482079.1784368.14104483603114559474@git-01.infra.openwrt.org>
Message-ID: <mailman.32640.1764714824.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/616b0cebe758972f5db8f71d66c257fe1d0ff246

commit 616b0cebe758972f5db8f71d66c257fe1d0ff246
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Nov 28 15:31:24 2025 -0800

    gpio-button-hotplug: use devm_kmemdup_array
    
    Eliminates a manual memcpy.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/19932
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index 5b40e34950..d0e35bedee 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -463,13 +463,12 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
 		return -EINVAL;
 	}
 
-	buttons = devm_kzalloc(dev, pdata->nbuttons * sizeof(struct gpio_keys_button),
+	buttons = devm_kmemdup_array(dev, pdata->buttons, pdata->nbuttons, sizeof(struct gpio_keys_button),
 		       GFP_KERNEL);
 	if (!buttons) {
 		dev_err(dev, "no memory for button data\n");
 		return -ENOMEM;
 	}
-	memcpy(buttons, pdata->buttons, pdata->nbuttons * sizeof(struct gpio_keys_button));
 
 	bdev = devm_kzalloc(dev, sizeof(struct gpio_keys_button_dev) +
 		       pdata->nbuttons * sizeof(struct gpio_keys_button_data),



From lede-commits at lists.infradead.org  Tue Dec  2 14:33:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 02 Dec 2025 17:33:41 -0500
Subject: [openwrt/openwrt]  treewide: add const to static arrays
In-Reply-To: <176471482079.1784368.14104483603114559474@git-01.infra.openwrt.org>
References: <176471482079.1784368.14104483603114559474@git-01.infra.openwrt.org>
Message-ID: <mailman.32641.1764714824.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5b263f3360bfc1c74a17d3ce1710d5c528084156

commit 5b263f3360bfc1c74a17d3ce1710d5c528084156
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sun Aug 31 14:01:55 2025 -0700

    treewide: add const to static arrays
    
    Allows more compiler optimization.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/19932
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/button-hotplug/src/button-hotplug.c     |  2 +-
 .../gpio-button-hotplug/src/gpio-button-hotplug.c      |  2 +-
 .../lantiq/ltq-atm/src/ifxmips_atm_fw_amazon_se.h      |  4 ++--
 package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9.h |  4 ++--
 .../lantiq/ltq-atm/src/ifxmips_atm_fw_ar9_retx.h       |  4 ++--
 .../kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube.h  |  4 ++--
 .../lantiq/ltq-atm/src/ifxmips_atm_fw_danube_retx.h    |  4 ++--
 package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_vr9.h |  4 ++--
 package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c  |  2 +-
 package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c  |  2 +-
 package/kernel/lantiq/ltq-deu/src/ifxmips_tcrypt.h     | 18 +++++++++---------
 .../lantiq/ltq-ptm/src/ifxmips_ptm_fw_amazon_se.h      |  4 ++--
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_ar9.h |  4 ++--
 .../kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_danube.h  |  4 ++--
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_vr9.h |  4 ++--
 ...-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch |  2 +-
 16 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/package/kernel/button-hotplug/src/button-hotplug.c b/package/kernel/button-hotplug/src/button-hotplug.c
index 1b77cd7922..2819d29b94 100644
--- a/package/kernel/button-hotplug/src/button-hotplug.c
+++ b/package/kernel/button-hotplug/src/button-hotplug.c
@@ -72,7 +72,7 @@ extern u64 uevent_next_seqnum(void);
 		.name = (_name),	\
 	}
 
-static struct bh_map button_map[] = {
+static const struct bh_map button_map[] = {
 	BH_MAP(BTN_0,		"BTN_0"),
 	BH_MAP(BTN_1,		"BTN_1"),
 	BH_MAP(BTN_2,		"BTN_2"),
diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index 0c16f34b0d..5b40e34950 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -72,7 +72,7 @@ extern u64 uevent_next_seqnum(void);
 		.name = (_name),	\
 	}
 
-static struct bh_map button_map[] = {
+static const struct bh_map button_map[] = {
 	BH_MAP(BTN_0,			"BTN_0"),
 	BH_MAP(BTN_1,			"BTN_1"),
 	BH_MAP(BTN_2,			"BTN_2"),
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_amazon_se.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_amazon_se.h
index b0a9c91bc4..0ce80945f5 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_amazon_se.h
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_amazon_se.h
@@ -34,7 +34,7 @@
 #define ATM_FW_VER_MINOR        16
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
  0x800004b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
  0xc1000002, 0xd90c00f8, 0xc2000002, 0xda0800f9, 0x80004cc8, 0xc2000000, 0xda0800f9, 0x80004330,
@@ -450,7 +450,7 @@ static unsigned int firmware_binary_code[] = {
  0x9d000000, 0xcd4000f8, 0x00000000, 0x00000000, 0x9d000000, 0x4158a000, 0xcd4000f8, 0x00000000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9.h
index 5ee6d23bb1..d0164df7a8 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9.h
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9.h
@@ -32,7 +32,7 @@
 #define ATM_FW_VER_MINOR        16
 
 
-static unsigned int ar9_fw_bin[] = {
+static const unsigned int ar9_fw_bin[] = {
  0x800004b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
  0xc1000002, 0xd90c00f8, 0xc2000002, 0xda0800f9, 0x80004980, 0xc2000000, 0xda0800f9, 0x80003fe8,
@@ -432,7 +432,7 @@ static unsigned int ar9_fw_bin[] = {
  0xcd4000f8, 0x00000000,
 };
 
-static unsigned int ar9_fw_data[] = {
+static const unsigned int ar9_fw_data[] = {
 };
 
 
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9_retx.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9_retx.h
index 51e4f9c6c9..3cc62e696d 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9_retx.h
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9_retx.h
@@ -32,7 +32,7 @@
 #define ATM_FW_VER_MINOR        15
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004B8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000FFE0, 0x00000000, 0x00000000, 0x00000000,
     0xC1000002, 0xD90C00F8, 0xC2000002, 0xDA0800F9, 0xC0001B50, 0x8C100000, 0x00000000, 0x00000000,
@@ -604,7 +604,7 @@ static unsigned int firmware_binary_code[] = {
     0xCDC000F8, 0xC1C00000, 0xC0004734, 0x9CC00000, 0xCDC000F8, 0xC0004732, 0xCD8000F8,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube.h
index 57b7586bd0..60de8d1d70 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube.h
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube.h
@@ -35,7 +35,7 @@
 //  add multiple queue per PVC feature
 
 
-static unsigned int danube_fw_bin[] = {
+static const unsigned int danube_fw_bin[] = {
     0x800004A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000FFC8, 0x00000000, 0x00000000, 0x00000000,
     0xC1000002, 0xD90C0000, 0xC2000002, 0xDA080001, 0x80004968, 0xC2000000, 0xDA080001, 0x80003FD0,
@@ -435,7 +435,7 @@ static unsigned int danube_fw_bin[] = {
     0xCD400000, 0x00000000,
 };
 
-static unsigned int danube_fw_data[] = {
+static const unsigned int danube_fw_data[] = {
 };
 
 
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube_retx.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube_retx.h
index 1c915dbba1..bf31753ed3 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube_retx.h
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube_retx.h
@@ -33,7 +33,7 @@
 #define ATM_FW_VER_MINOR        15
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000FFC8, 0x00000000, 0x00000000, 0x00000000,
     0xC1000002, 0xD90C0000, 0xC2000002, 0xDA080001, 0xC0001B50, 0x8C100000, 0x00000000, 0x00000000,
@@ -605,7 +605,7 @@ static unsigned int firmware_binary_code[] = {
     0xCDC00000, 0xC1C00000, 0xC0004734, 0x9CC00000, 0xCDC00000, 0xC0004732, 0xCD800000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_vr9.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_vr9.h
index 42a26ec539..8b73c07147 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_vr9.h
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_vr9.h
@@ -32,7 +32,7 @@
 #define ATM_FW_VER_MINOR        24
 
 
-static u32 vr9_fw_bin[] = {
+static const u32 vr9_fw_bin[] = {
     0x800004B8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000FFE0, 0x00000000, 0x00000000, 0x00000000,
     0xC1000002, 0xD90C00F8, 0xC2000002, 0xDA0800F9, 0x80004390, 0xC2000000, 0xDA0800F9, 0x80003A10,
@@ -419,7 +419,7 @@ static u32 vr9_fw_bin[] = {
     0xCE0000F8, 0xC000697E, 0xCE4000F8, 0x9D000000, 0x4158A000, 0xCD4000F8, 0x00000000,
 };
 
-static u32 vr9_fw_data[] = {
+static const u32 vr9_fw_data[] = {
 };
 
 
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
index cdf9a89a1a..09354b9fdd 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
@@ -956,7 +956,7 @@ struct lq_aes_alg {
 };
 
 /* AES supported algo array */
-static struct lq_aes_alg aes_drivers_alg[] = {
+static const struct lq_aes_alg aes_drivers_alg[] = {
      {
          .alg = {
            .cra_name 	    = "aes",
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c
index e96379f1d4..3eb9f86997 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c
@@ -754,7 +754,7 @@ struct lq_des_alg {
 };
 
 /* DES Supported algo array */
-static struct lq_des_alg des_drivers_alg [] = {
+static const struct lq_des_alg des_drivers_alg [] = {
     {
         .alg = {
             .cra_name        = "des",
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_tcrypt.h b/package/kernel/lantiq/ltq-deu/src/ifxmips_tcrypt.h
index 1e7047b593..5c301bdd46 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_tcrypt.h
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_tcrypt.h
@@ -38,7 +38,7 @@ static int alg_speed_test(const char *alg, const char *driver,
 			  struct cipher_speed_template *t,
 			  unsigned int tcount, u8 *keysize);
 
-static struct cipher_speed_template des3_speed_template[] = {
+static const struct cipher_speed_template des3_speed_template[] = {
 	{
 		.key	= "\x01\x23\x45\x67\x89\xab\xcd\xef"
 			  "\x55\x55\x55\x55\x55\x55\x55\x55"
@@ -50,18 +50,18 @@ static struct cipher_speed_template des3_speed_template[] = {
 /*
  * Cipher speed tests
  */
-static u8 speed_template_8[] = {8, 0};
-static u8 speed_template_24[] = {24, 0};
-static u8 speed_template_8_32[] = {8, 32, 0};
-static u8 speed_template_16_32[] = {16, 32, 0};
-static u8 speed_template_16_24_32[] = {16, 24, 32, 0};
-static u8 speed_template_32_40_48[] = {32, 40, 48, 0};
-static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
+static const u8 speed_template_8[] = {8, 0};
+static const u8 speed_template_24[] = {24, 0};
+static const u8 speed_template_8_32[] = {8, 32, 0};
+static const u8 speed_template_16_32[] = {16, 32, 0};
+static const u8 speed_template_16_24_32[] = {16, 24, 32, 0};
+static const u8 speed_template_32_40_48[] = {32, 40, 48, 0};
+static const u8 speed_template_32_48_64[] = {32, 48, 64, 0};
 
 /*
  * Digest speed tests
  */
-static struct hash_speed generic_hash_speed_template[] = {
+static const struct hash_speed generic_hash_speed_template[] = {
 	{ .blen = 16,	.plen = 16, },
 	{ .blen = 64,	.plen = 16, },
 	{ .blen = 64,	.plen = 64, },
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_amazon_se.h b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_amazon_se.h
index ae33bcc66a..663a8b7af6 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_amazon_se.h
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_amazon_se.h
@@ -32,7 +32,7 @@
 #define PTM_FW_VER_MINOR        17
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
     0xc1000002, 0xd90c00f8, 0xc2000002, 0xda0800f9, 0x800055e0, 0xc2000000, 0xda0800f9, 0x80005580,
@@ -486,7 +486,7 @@ static unsigned int firmware_binary_code[] = {
     0xcd4000f8, 0x00000000, 0x00000000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_ar9.h b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_ar9.h
index a61d313852..bb370e1558 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_ar9.h
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_ar9.h
@@ -30,7 +30,7 @@
 #define PTM_FW_VER_MINOR        17
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
     0xc1000002, 0xd90c00f8, 0xc2000002, 0xda0800f9, 0x80005270, 0xc2000000, 0xda0800f9, 0x80005210,
@@ -466,7 +466,7 @@ static unsigned int firmware_binary_code[] = {
     0x4194a000, 0x5d940040, 0x88000012, 0xc59400f8, 0x9d000000, 0xcd4000f8, 0x00000000, 0x00000000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_danube.h b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_danube.h
index 3451682fb2..4484eb2667 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_danube.h
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_danube.h
@@ -31,7 +31,7 @@
 #define PTM_FW_VER_MINOR        17
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004a0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffc8, 0x00000000, 0x00000000, 0x00000000,
     0xc1000002, 0xd90c0000, 0xc2000002, 0xda080001, 0x80005618, 0xc2000000, 0xda080001, 0x800055b8,
@@ -482,7 +482,7 @@ static unsigned int firmware_binary_code[] = {
     0x4194a000, 0x5d940040, 0x8800fffa, 0xc5940000, 0x9d000000, 0xcd400000, 0x00000000, 0x00000000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_vr9.h b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_vr9.h
index 3aa9f1851f..599d5099c7 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_vr9.h
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_vr9.h
@@ -28,7 +28,7 @@
 ** 01/08/2014    Lantiq PPE FW Team        VR9 E1 PPE Firmware Binary
 *******************************************************************************/
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
  0x80000980, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
  0x94000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -471,7 +471,7 @@ static unsigned int firmware_binary_code[] = {
  0x84009b42, 0x6f9d0010, 0x739da000, 0x6f9e0010, 0x735da000, 0x6f9f0010, 0x735da000, 0xc1c0001e,
  0x775da000, 0xc000e440, 0xcf4000f8, 0x80009ae8, 0x00000000, 0x00000000, 0x00000000,};
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
diff --git a/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch b/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch
index 6f99497c36..e697a64066 100644
--- a/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch
+++ b/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch
@@ -820,7 +820,7 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +static IEI_WT61P803_PUZZLE_ATTR_RW(power_loss_recovery, IEI_WT61P803_PUZZLE_POWER_LOSS_RECOVERY, 0);
 +static IEI_WT61P803_PUZZLE_ATTR_RO(power_status, IEI_WT61P803_PUZZLE_POWER_STATUS, 0);
 +
-+static struct attribute *iei_wt61p803_puzzle_attrs[] = {
++static const struct attribute *iei_wt61p803_puzzle_attrs[] = {
 +	&dev_attr_version.dev_attr.attr,
 +	&dev_attr_build_info.dev_attr.attr,
 +	&dev_attr_bootloader_mode.dev_attr.attr,



From lede-commits at lists.infradead.org  Tue Dec  2 14:33:40 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 02 Dec 2025 17:33:40 -0500
Subject: [openwrt/openwrt]  treewide: fix coccinelle checks
In-Reply-To: <176471482079.1784368.14104483603114559474@git-01.infra.openwrt.org>
References: <176471482079.1784368.14104483603114559474@git-01.infra.openwrt.org>
Message-ID: <mailman.32644.1764714826.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4ffd5aa239c1b54822830a0772eefcd3718e0076

commit 4ffd5aa239c1b54822830a0772eefcd3718e0076
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sun Nov 3 14:11:30 2024 -0800

    treewide: fix coccinelle checks
    
    Unneeded semicolon
    
    WARNING comparing pointer to 0
    
    WARNING: NULL check before some freeing functions is not needed.
    
    WARNING: casting value returned by memory allocation function to (u32 *)
    
    ERROR: allocation function on line 378 returns NULL not ERR_PTR on failure
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/19932
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c   |  3 +--
 .../lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h    |  2 +-
 .../kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c  |  4 ++--
 package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c    |  4 ++--
 package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c |  4 ++--
 package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c    |  4 ++--
 package/kernel/lantiq/ltq-atm/src/ltq_atm.c            | 18 ++++++------------
 package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c        |  4 ++--
 package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c  |  9 +++------
 package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c  | 10 ++++------
 package/kernel/lantiq/ltq-deu/src/ifxmips_des.c        |  4 ++--
 package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h    |  8 ++++----
 package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h |  8 ++++----
 package/kernel/lantiq/ltq-deu/src/ifxmips_deu_vr9.h    |  8 ++++----
 package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c        |  2 +-
 package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c   |  6 +++---
 package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c       |  2 +-
 package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c  |  6 +++---
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c   | 11 +++--------
 .../kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c  |  4 ++--
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c    |  4 ++--
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c |  4 ++--
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c    |  4 ++--
 package/kernel/rtc-rv5c386a/src/rtc.c                  |  6 +++---
 target/linux/at91/image/dfboot/src/com.c               |  2 +-
 target/linux/at91/image/dfboot/src/dataflash.c         |  2 +-
 .../ath79/files/drivers/mtd/nand/raw/ar934x_nand.c     |  4 +---
 .../linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c   |  3 +--
 target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c  |  3 +--
 .../generic/files/drivers/mtd/nand/mtk_bmt_nmbm.c      |  4 ++--
 .../generic/files/drivers/net/phy/b53/b53_common.c     | 10 ++++++----
 target/linux/generic/files/drivers/net/phy/rtl8367b.c  |  3 +--
 .../files/drivers/platform/mikrotik/rb_hardconfig.c    |  2 +-
 .../mediatek/files/drivers/net/phy/rtk/rtl8367c/i2c.c  | 16 ++++------------
 .../net/phy/rtk/rtl8367c/rtl8367c_asicdrv_qos.c        |  4 ++--
 .../files/drivers/net/ethernet/ralink/esw_rt3050.c     |  8 ++++++--
 .../files/drivers/net/ethernet/ralink/gsw_mt7620.c     | 11 +++++++----
 .../ramips/files/drivers/net/ethernet/ralink/mdio.c    |  2 +-
 .../files/drivers/net/ethernet/ralink/mtk_eth_soc.c    |  4 +---
 .../files-6.12/drivers/clk/realtek/clk-rtl83xx.c       |  3 ++-
 .../files-6.12/drivers/net/dsa/rtl83xx/common.c        |  1 +
 .../files-6.12/drivers/net/ethernet/rtl838x_eth.c      |  6 ++----
 42 files changed, 102 insertions(+), 125 deletions(-)

diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c
index c0fb66c5e3..024d45d62c 100644
--- a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c
+++ b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c
@@ -1286,8 +1286,7 @@ IFX_MEI_RunAdslModem (DSL_DEV_Device_t *pDev)
 //	DSL_DEV_WinHost_Message_t m;
 
 	if (mei_arc_swap_buff == NULL) {
-		mei_arc_swap_buff =
-			(u32 *) kmalloc (MAXSWAPSIZE * 4, GFP_KERNEL);
+		mei_arc_swap_buff = kmalloc (MAXSWAPSIZE * 4, GFP_KERNEL);
 		if (mei_arc_swap_buff == NULL) {
 			IFX_MEI_EMSG (">>> malloc fail for codeswap buff!!! <<<\n");
 			return DSL_DEV_MEI_ERR_FAILURE;
diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h b/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h
index ec4c4429ba..f77e0d49b5 100644
--- a/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h
+++ b/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h
@@ -418,7 +418,7 @@ typedef struct _arc_img_hdr {
 	u32 size;		//      Size of binary image in bytes
 	u32 checksum;		//      Checksum for image
 	u32 count;		//      Count of swp pages in image
-	ARC_SWP_PAGE_HDR page[1];	//      Should be "count" pages - '1' to make compiler happy
+	ARC_SWP_PAGE_HDR page[];	//      Should be "count" pages - '1' to make compiler happy
 } ARC_IMG_HDR;
 
 typedef struct smmu_mem_info {
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c
index c51f34dda3..734fe29961 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c
@@ -224,8 +224,8 @@ static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len,
 {
     volatile u32 *dest;
 
-    if ( code_src == 0 || ((unsigned long)code_src & 0x03) != 0
-        || data_src == 0 || ((unsigned long)data_src & 0x03) != 0 )
+    if (!code_src || ((unsigned long)code_src & 0x03) != 0
+        || !data_src || ((unsigned long)data_src & 0x03) != 0 )
         return -1;
 
     if ( code_dword_len <= CDM_CODE_MEMORYn_DWLEN(0) )
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c
index b1e911915e..28ac8f6c7a 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c
@@ -163,8 +163,8 @@ static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len,
 {
     volatile u32 *dest;
 
-    if ( code_src == 0 || ((unsigned long)code_src & 0x03) != 0
-        || data_src == 0 || ((unsigned long)data_src & 0x03) != 0 )
+    if (!code_src || ((unsigned long)code_src & 0x03) != 0
+        || !data_src || ((unsigned long)data_src & 0x03) != 0 )
         return -1;
 
     if ( code_dword_len <= CDM_CODE_MEMORYn_DWLEN(0) )
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c
index d32e888272..57a50e322d 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c
@@ -110,8 +110,8 @@ static inline int danube_pp32_download_code(u32 *code_src, unsigned int code_dwo
 {
 	volatile u32 *dest;
 
-	if ( code_src == 0 || ((unsigned long)code_src & 0x03) != 0
-			|| data_src == 0 || ((unsigned long)data_src & 0x03) != 0 )
+	if (!code_src || ((unsigned long)code_src & 0x03) != 0
+			|| !data_src || ((unsigned long)data_src & 0x03) != 0 )
 		return -1;
 
 	if ( code_dword_len <= CDM_CODE_MEMORYn_DWLEN(0) )
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c
index c6bb772e4c..ffe079f3df 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c
@@ -96,8 +96,8 @@ static inline int vr9_pp32_download_code(int pp32, u32 *code_src, unsigned int c
 	unsigned int clr, set;
 	volatile u32 *dest;
 
-	if ( code_src == 0 || ((unsigned long)code_src & 0x03) != 0
-			|| data_src == 0 || ((unsigned long)data_src & 0x03) != 0 )
+	if (!code_src || ((unsigned long)code_src & 0x03) != 0
+			|| !data_src || ((unsigned long)data_src & 0x03) != 0 )
 		return -1;
 
 	clr = pp32 ? 0xF0 : 0x0F;
diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
index 5a02346e42..d97dadba68 100644
--- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
+++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
@@ -1503,17 +1503,10 @@ static inline void clear_priv_data(void)
 		}
 	}
 
-	if ( g_atm_priv_data.tx_skb_base != NULL )
-		kfree(g_atm_priv_data.tx_skb_base);
-
-	if ( g_atm_priv_data.tx_desc_base != NULL )
-		kfree(g_atm_priv_data.tx_desc_base);
-
-	if ( g_atm_priv_data.oam_buf_base != NULL )
-		kfree(g_atm_priv_data.oam_buf_base);
-
-	if ( g_atm_priv_data.oam_desc_base != NULL )
-		kfree(g_atm_priv_data.oam_desc_base);
+	kfree(g_atm_priv_data.tx_skb_base);
+	kfree(g_atm_priv_data.tx_desc_base);
+	kfree(g_atm_priv_data.oam_buf_base);
+	kfree(g_atm_priv_data.oam_desc_base);
 
 	if ( g_atm_priv_data.aal_desc_base != NULL ) {
 		for ( i = 0; i < dma_rx_descriptor_length; i++ ) {
@@ -1522,8 +1515,9 @@ static inline void clear_priv_data(void)
 				dev_kfree_skb_any(skb);
 			}
 		}
-		kfree(g_atm_priv_data.aal_desc_base);
 	}
+
+	kfree(g_atm_priv_data.aal_desc_base);
 }
 
 static inline void init_rx_tables(void)
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c
index fdd172750d..4139b343da 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c
@@ -276,7 +276,7 @@ void ifx_deu_aes (void *ctx_arg, u8 *out_arg, const u8 *in_arg,
         aes->IV2R = DEU_ENDIAN_SWAP(*((u32 *) iv_arg + 1));
         aes->IV1R = DEU_ENDIAN_SWAP(*((u32 *) iv_arg + 2));
         aes->IV0R = DEU_ENDIAN_SWAP(*((u32 *) iv_arg + 3));
-    };
+    }
 
 
     i = 0;
@@ -1529,7 +1529,7 @@ static int aes_cbcmac_init_tfm(struct crypto_tfm *tfm)
 {
     struct aes_ctx *mctx = crypto_tfm_ctx(tfm);
     mctx->temp = kzalloc(AES_BLOCK_SIZE * AES_CBCMAC_DBN_TEMP_SIZE, GFP_KERNEL);
-    if (IS_ERR(mctx->temp)) return PTR_ERR(mctx->temp);
+    if (!mctx->temp) return -ENOMEM;
 
     return 0;
 }
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
index e05faa4f3a..cdf9a89a1a 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
@@ -234,7 +234,7 @@ static int lq_deu_aes_core (void *ctx_arg, u8 *out_arg, const u8 *in_arg,
         aes->IV2R = DEU_ENDIAN_SWAP(*((u32 *) iv_arg + 1));
         aes->IV1R = DEU_ENDIAN_SWAP(*((u32 *) iv_arg + 2));
         aes->IV0R = DEU_ENDIAN_SWAP(*((u32 *) iv_arg + 3));
-    };
+    }
 
 
     /* Prepare Rx buf length used in dma psuedo interrupt */
@@ -251,7 +251,7 @@ static int lq_deu_aes_core (void *ctx_arg, u8 *out_arg, const u8 *in_arg,
 
     while (aes->controlr.BUS) {
          // wait for AES to be ready
-    };
+    }
 
     deu_priv->outcopy = (u32 *) DEU_DWORD_REORDERING(out_arg, aes_buff_out, BUFFER_OUT, nbytes);
     deu_priv->event_src = AES_ASYNC_EVENT;
@@ -576,10 +576,7 @@ static int lq_aes_queue_mgr(struct aes_ctx *ctx, struct ablkcipher_request *areq
     u32 remain, inc, nbytes = areq->nbytes;
     u32 chunk_bytes = src->length;
 
-
-    aes_con = (struct aes_container *)kmalloc(sizeof(struct aes_container),
-    	                                       GFP_KERNEL);
-
+    aes_con = kmalloc(sizeof(struct aes_container), GFP_KERNEL);
     if (!(aes_con)) {
         printk("Cannot allocate memory for AES container, fn %s, ln %d\n",
 		__func__, __LINE__);
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c
index 4a1988dd3f..e96379f1d4 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c
@@ -254,7 +254,7 @@ static int lq_deu_des_core (void *ctx_arg, u8 *out_arg, const u8 *in_arg,
         if (mode > 0) {
                 des->IVHR = DEU_ENDIAN_SWAP(*(u32 *) iv_arg);
                 des->IVLR = DEU_ENDIAN_SWAP(*((u32 *) iv_arg + 1));
-        };
+        }
 
     /* memory alignment issue */
     dword_mem_aligned_in = (u32 *) DEU_DWORD_REORDERING(in_arg, des_buff_in, BUFFER_IN, nbytes);
@@ -268,7 +268,7 @@ static int lq_deu_des_core (void *ctx_arg, u8 *out_arg, const u8 *in_arg,
     dma->controlr.EN = 1;
 
     while (des->controlr.BUS) {
-    };
+    }
 
     wlen = dma_device_write (dma_device, (u8 *) dword_mem_aligned_in, nbytes, NULL);
     if (wlen != nbytes) {
@@ -287,7 +287,7 @@ static int lq_deu_des_core (void *ctx_arg, u8 *out_arg, const u8 *in_arg,
     if (mode > 0) {
         *(u32 *) iv_arg = DEU_ENDIAN_SWAP(des->IVHR);
         *((u32 *) iv_arg + 1) = DEU_ENDIAN_SWAP(des->IVLR);
-    };
+    }
 
     CRTCL_SECT_END;
 
@@ -578,9 +578,7 @@ static int lq_queue_mgr(struct des_ctx *ctx, struct ablkcipher_request *areq,
     u32 remain, inc, nbytes = areq->nbytes;
     u32 chunk_bytes = src->length;
 
-    des_con = (struct des_container *)kmalloc(sizeof(struct des_container),
-                                       GFP_KERNEL);
-
+    des_con = kmalloc(sizeof(struct des_container), GFP_KERNEL);
     if (!(des_con)) {
         printk("Cannot allocate memory for AES container, fn %s, ln %d\n",
                 __func__, __LINE__);
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c
index 3e4db76399..862419f7f7 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c
@@ -229,7 +229,7 @@ void ifx_deu_des (void *ctx_arg, u8 *out_arg, const u8 *in_arg,
         if (mode > 0) {
                 des->IVHR = DEU_ENDIAN_SWAP(*(u32 *) iv_arg);
                 des->IVLR = DEU_ENDIAN_SWAP(*((u32 *) iv_arg + 1));
-        };
+        }
 
         nblocks = nbytes / 4;
 
@@ -260,7 +260,7 @@ void ifx_deu_des (void *ctx_arg, u8 *out_arg, const u8 *in_arg,
     if (mode > 0) {
         *(u32 *) iv_arg = DEU_ENDIAN_SWAP(des->IVHR);
         *((u32 *) iv_arg + 1) = DEU_ENDIAN_SWAP(des->IVLR);
-    };
+    }
 
     CRTCL_SECT_END;
 }
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h
index 00fbf40f47..cf9745fc86 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h
@@ -87,8 +87,8 @@
         volatile struct aes_t *aes = (volatile struct aes_t *) AES_START; \
         for (i = 0; i < 10; i++)      \
 	    udelay(DELAY_PERIOD);     \
-        while (dma->controlr.BSY) {}; \
-        while (aes->controlr.BUS) {}; \
+        while (dma->controlr.BSY) {}  \
+        while (aes->controlr.BUS) {}  \
     } while (0)
 
 #define WAIT_DES_DMA_READY()          \
@@ -98,8 +98,8 @@
         volatile struct des_t *des = (struct des_t *) DES_3DES_START; \
         for (i = 0; i < 10; i++)      \
             udelay(DELAY_PERIOD);     \
-        while (dma->controlr.BSY) {}; \
-        while (des->controlr.BUS) {}; \
+        while (dma->controlr.BSY) {}  \
+        while (des->controlr.BUS) {}  \
     } while (0)
 
 #define AES_DMA_MISC_CONFIG()        \
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h
index 9daef9d2d7..1a572073f9 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h
@@ -81,8 +81,8 @@
         volatile struct aes_t *aes = (volatile struct aes_t *) AES_START; \
         for (i = 0; i < 10; i++)      \
             udelay(DELAY_PERIOD);     \
-        while (dma->controlr.BSY) {}; \
-        while (aes->controlr.BUS) {}; \
+        while (dma->controlr.BSY) {}  \
+        while (aes->controlr.BUS) {}  \
     } while (0)
 
 #define WAIT_DES_DMA_READY()          \
@@ -92,8 +92,8 @@
         volatile struct des_t *des = (struct des_t *) DES_3DES_START; \
         for (i = 0; i < 10; i++)      \
             udelay(DELAY_PERIOD);     \
-        while (dma->controlr.BSY) {}; \
-        while (des->controlr.BUS) {}; \
+        while (dma->controlr.BSY) {}  \
+        while (des->controlr.BUS) {}  \
     } while (0)
 
 #define SHA_HASH_INIT                  \
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_vr9.h b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_vr9.h
index 1107df96de..06f0e8b823 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_vr9.h
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_vr9.h
@@ -102,8 +102,8 @@
         volatile struct aes_t *aes = (volatile struct aes_t *) AES_START; \
         for (i = 0; i < 10; i++)      \
             udelay(DELAY_PERIOD);     \
-        while (dma->controlr.BSY) {}; \
-        while (aes->controlr.BUS) {}; \
+        while (dma->controlr.BSY) {}  \
+        while (aes->controlr.BUS) {}  \
     } while (0)
 
 #define WAIT_DES_DMA_READY()          \
@@ -113,8 +113,8 @@
         volatile struct des_t *des = (struct des_t *) DES_3DES_START; \
         for (i = 0; i < 10; i++)      \
             udelay(DELAY_PERIOD);     \
-        while (dma->controlr.BSY) {}; \
-        while (des->controlr.BUS) {}; \
+        while (dma->controlr.BSY) {}  \
+        while (des->controlr.BUS) {}  \
     } while (0)
 
 #define AES_DMA_MISC_CONFIG()        \
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c
index 80ff41a738..dc2a502bd8 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c
@@ -107,7 +107,7 @@ static void md5_transform(struct md5_ctx *mctx, u32 *hash, u32 const *in)
     for (i = 0; i < 16; i++) {
         hashs->MR = in[i];
 //      printk("in[%d]: %08x\n", i, in[i]);
-    };
+    }
 
     //wait for processing
     while (hashs->controlr.BSY) {
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c
index 51a623b73d..12088023ba 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c
@@ -308,7 +308,7 @@ static int md5_hmac_final_impl(struct shash_desc *desc, u8 *out, bool hash_final
     {
         for (i = 0; i < 16; i++) {
             hashs->MR = in[i];
-        };
+        }
 
         hashs->controlr.GO = 1;
         asm("sync");
@@ -355,9 +355,9 @@ static int md5_hmac_init_tfm(struct crypto_tfm *tfm)
 {
     struct md5_hmac_ctx *mctx = crypto_tfm_ctx(tfm);
     mctx->temp = kzalloc(4 * MD5_HMAC_DBN_TEMP_SIZE, GFP_KERNEL);
-    if (IS_ERR(mctx->temp)) return PTR_ERR(mctx->temp);
+    if (!mctx->temp) return -ENOMEM;
     mctx->desc = kzalloc(sizeof(struct shash_desc), GFP_KERNEL);
-    if (IS_ERR(mctx->desc)) return PTR_ERR(mctx->desc);
+    if (!mctx->desc) return -ENOMEM;
 
     return 0;
 }
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c
index f67f45531f..f095d41830 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c
@@ -119,7 +119,7 @@ static void sha1_transform1 (struct sha1_ctx *sctx, u32 *state, const u32 *in)
 
     for (i = 0; i < 16; i++) {
         hashs->MR = in[i];
-    };
+    }
 
     //wait for processing
     while (hashs->controlr.BSY) {
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c
index e18fe2b0e8..3ab3966e57 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c
@@ -325,7 +325,7 @@ static int sha1_hmac_final_impl(struct shash_desc *desc, u8 *out, bool hash_fina
     {
         for (i = 0; i < 16; i++) {
             hashs->MR = in[i];
-        };
+        }
 
         hashs->controlr.GO = 1;
         asm("sync");
@@ -376,9 +376,9 @@ static int sha1_hmac_init_tfm(struct crypto_tfm *tfm)
 {
     struct sha1_hmac_ctx *sctx = crypto_tfm_ctx(tfm);
     sctx->temp = kzalloc(4 * SHA1_HMAC_DBN_TEMP_SIZE, GFP_KERNEL);
-    if (IS_ERR(sctx->temp)) return PTR_ERR(sctx->temp);
+    if (!sctx->temp) return -ENOMEM;
     sctx->desc = kzalloc(sizeof(struct shash_desc), GFP_KERNEL);
-    if (IS_ERR(sctx->desc)) return PTR_ERR(sctx->desc);
+    if (!sctx->desc) return -ENOMEM;
 
     return 0;
 }
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
index 48bc7b04a9..527066f54f 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
@@ -1360,14 +1360,9 @@ static INLINE void clear_priv_data(void)
         }
     }
 
-    if ( g_ptm_priv_data.rx_desc_base != NULL )
-        kfree(g_ptm_priv_data.rx_desc_base);
-
-    if ( g_ptm_priv_data.tx_desc_base != NULL )
-        kfree(g_ptm_priv_data.tx_desc_base);
-
-    if ( g_ptm_priv_data.tx_skb_base != NULL )
-        kfree(g_ptm_priv_data.tx_skb_base);
+    kfree(g_ptm_priv_data.rx_desc_base);
+    kfree(g_ptm_priv_data.tx_desc_base);
+    kfree(g_ptm_priv_data.tx_skb_base);
 }
 
 static INLINE void init_tables(void)
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c
index 81ed7f7805..7548c6d357 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c
@@ -223,8 +223,8 @@ static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len,
 {
     volatile u32 *dest;
 
-    if ( code_src == 0 || ((unsigned long)code_src & 0x03) != 0
-        || data_src == 0 || ((unsigned long)data_src & 0x03) != 0 )
+    if (!code_src || ((unsigned long)code_src & 0x03) != 0
+        || !data_src || ((unsigned long)data_src & 0x03) != 0 )
         return -1;
 
     if ( code_dword_len <= CDM_CODE_MEMORYn_DWLEN(0) )
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c
index 2f108286e2..e83268ee36 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c
@@ -246,8 +246,8 @@ static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len,
 {
     volatile u32 *dest;
 
-    if ( code_src == 0 || ((unsigned long)code_src & 0x03) != 0
-        || data_src == 0 || ((unsigned long)data_src & 0x03) != 0 )
+    if (!code_src || ((unsigned long)code_src & 0x03) != 0
+        || !data_src || ((unsigned long)data_src & 0x03) != 0 )
         return -1;
 
     if ( code_dword_len <= CDM_CODE_MEMORYn_DWLEN(0) )
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c
index 47ee4110a3..ef20e9cb45 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c
@@ -218,8 +218,8 @@ static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len,
 {
     volatile u32 *dest;
 
-    if ( code_src == 0 || ((unsigned long)code_src & 0x03) != 0
-        || data_src == 0 || ((unsigned long)data_src & 0x03) != 0 )
+    if (!code_src || ((unsigned long)code_src & 0x03) != 0
+        || !data_src || ((unsigned long)data_src & 0x03) != 0 )
         return -1;
 
     if ( code_dword_len <= CDM_CODE_MEMORYn_DWLEN(0) )
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c
index c0d16fe34f..10e71cb1d9 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c
@@ -207,8 +207,8 @@ static inline int pp32_download_code(int pp32, u32 *code_src, unsigned int code_
     unsigned int clr, set;
     volatile u32 *dest;
 
-    if ( code_src == 0 || ((unsigned long)code_src & 0x03) != 0
-        || data_src == 0 || ((unsigned long)data_src & 0x03) != 0 )
+    if (!code_src || ((unsigned long)code_src & 0x03) != 0
+        || !data_src || ((unsigned long)data_src & 0x03) != 0 )
         return -1;
 
     clr = pp32 ? 0xF0 : 0x0F;
diff --git a/package/kernel/rtc-rv5c386a/src/rtc.c b/package/kernel/rtc-rv5c386a/src/rtc.c
index 0c00c41f96..8123773e36 100644
--- a/package/kernel/rtc-rv5c386a/src/rtc.c
+++ b/package/kernel/rtc-rv5c386a/src/rtc.c
@@ -174,13 +174,13 @@ static int i2c_outb(int c)
 		if (sclhi() < 0) { /* timed out */
 			sdahi(); /* we don't want to block the net */
 			return -ETIMEDOUT;
-		};
+		}
 		scllo();
 	}
 	sdahi();
 	if (sclhi() < 0) {
 		return -ETIMEDOUT;
-	};
+	}
 	/* read ack: SDA should be pulled down by slave */
 	ack = getsda() == 0;	/* ack: sda is pulled low ->success.	 */
 	scllo();
@@ -204,7 +204,7 @@ static int i2c_inb(int ack)
 	for (i = 0; i < 8; i++) {
 		if (sclhi() < 0) {
 			return -ETIMEDOUT;
-		};
+		}
 		indata *= 2;
 		if (getsda())
 			indata |= 0x01;
diff --git a/target/linux/at91/image/dfboot/src/com.c b/target/linux/at91/image/dfboot/src/com.c
index 081d86fb65..d44f873cc9 100644
--- a/target/linux/at91/image/dfboot/src/com.c
+++ b/target/linux/at91/image/dfboot/src/com.c
@@ -273,7 +273,7 @@ static int number(int num, int base, int size,
     putc(tmp[i]);
 
   while (size-- > 0)
-    putc(' ');;
+    putc(' ');
 
   return 1;
 }
diff --git a/target/linux/at91/image/dfboot/src/dataflash.c b/target/linux/at91/image/dfboot/src/dataflash.c
index 62644485a8..c95e21a02b 100644
--- a/target/linux/at91/image/dfboot/src/dataflash.c
+++ b/target/linux/at91/image/dfboot/src/dataflash.c
@@ -166,7 +166,7 @@ int read_dataflash(unsigned long addr, unsigned long size, char *result)
 	AT91PS_DataFlash pFlash = &DataFlashInst;
 
 	pFlash = AT91F_DataflashSelect (pFlash, &AddrToRead);
-	if (pFlash == 0)
+	if (!pFlash)
 		return -1;
 
 	return (AT91F_DataFlashRead(pFlash, AddrToRead, size, result));
diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c
index c1670b61a5..9b40706cdd 100644
--- a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c
+++ b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c
@@ -1379,10 +1379,8 @@ static int ar934x_nfc_probe(struct platform_device *pdev)
 	}
 
 	nfc->irq = platform_get_irq(pdev, 0);
-	if (nfc->irq < 0) {
-		dev_err(&pdev->dev, "no IRQ resource specified\n");
+	if (nfc->irq < 0)
 		return -EINVAL;
-	}
 
 	init_waitqueue_head(&nfc->irq_waitq);
 	ret = devm_request_irq(&pdev->dev, nfc->irq, ar934x_nfc_irq_handler,
diff --git a/target/linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c b/target/linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c
index 900c7e7b49..a4aeda5f1f 100644
--- a/target/linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c
+++ b/target/linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c
@@ -185,7 +185,6 @@ int RangeDecoderReverseBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder
 {
   int mi = 1;
   int i;
-  int symbol = 0;
   #ifdef _LZMA_LOC_OPT
   RC_INIT_VAR
   #endif
@@ -203,7 +202,7 @@ int RangeDecoderReverseBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder
   #ifdef _LZMA_LOC_OPT
   RC_FLUSH_VAR
   #endif
-  return symbol;
+  return 0;
 }
 
 Byte LzmaLiteralDecode(CProb *probs, CRangeDecoder *rd)
diff --git a/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c b/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c
index 063adb50fb..66a82dd2d0 100644
--- a/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c
+++ b/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c
@@ -385,8 +385,7 @@ void mtk_bmt_detach(struct mtd_info *mtd)
 	if (bmtd.mtd != mtd)
 		return;
 
-	if (bmtd.debugfs_dir)
-		debugfs_remove_recursive(bmtd.debugfs_dir);
+	debugfs_remove_recursive(bmtd.debugfs_dir);
 	bmtd.debugfs_dir = NULL;
 
 	kfree(bmtd.bbt_buf);
diff --git a/target/linux/generic/files/drivers/mtd/nand/mtk_bmt_nmbm.c b/target/linux/generic/files/drivers/mtd/nand/mtk_bmt_nmbm.c
index a896e49ec0..d5827880b2 100644
--- a/target/linux/generic/files/drivers/mtd/nand/mtk_bmt_nmbm.c
+++ b/target/linux/generic/files/drivers/mtd/nand/mtk_bmt_nmbm.c
@@ -810,7 +810,7 @@ static bool nmbm_write_signature(struct nmbm_instance *ni, uint32_t limit,
 
 	next_block:
 		ba--;
-	};
+	}
 
 	return false;
 }
@@ -2069,7 +2069,7 @@ static bool nmbm_find_signature(struct nmbm_instance *ni,
 				return true;
 			}
 		}
-	};
+	}
 
 	return false;
 }
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index ac37ef93b5..320fcbb694 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -551,9 +551,11 @@ static int b53_configure_ports_of(struct b53_device *dev)
 				    mode == PHY_INTERFACE_MODE_REVMII) {
 					b53_read8(dev, B53_CTRL_PAGE,
 						  B53_PORT_OVERRIDE_CTRL, &po);
-					if (!(po & PORT_OVERRIDE_RV_MII_25))
-					pr_err("Failed to enable reverse MII mode\n");
-					return -EINVAL;
+					if (!(po & PORT_OVERRIDE_RV_MII_25)) {
+						pr_err("Failed to enable reverse MII mode\n");
+						of_node_put(dn);
+						return -EINVAL;
+					}
 				}
 			} else {
 				po |= GMII_PO_EN;
@@ -845,7 +847,7 @@ static int b53_vlan_set_ports(struct switch_dev *dev, struct switch_val *val)
 		if (!(port->flags & BIT(SWITCH_PORT_FLAG_TAGGED))) {
 			vlan->untag |= BIT(port->id);
 			priv->ports[port->id].pvid = val->port_vlan;
-		};
+		}
 	}
 
 	/* ignore disabled ports */
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367b.c b/target/linux/generic/files/drivers/net/phy/rtl8367b.c
index 5adcf00f0c..7bd1d94252 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8367b.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8367b.c
@@ -1594,8 +1594,7 @@ static int  rtl8367b_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, NULL);
 	rtl8366_smi_cleanup(smi);
  err_free_smi:
-	if (smi->emu_vlanmc)
-		kfree(smi->emu_vlanmc);
+	kfree(smi->emu_vlanmc);
 	kfree(smi);
 	return err;
 }
diff --git a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
index 4c1edad081..3c5fa6f5b9 100644
--- a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
+++ b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
@@ -549,7 +549,7 @@ static int hc_wlan_data_unpack_lzor_lz77(const u16 tag_id, const u8 *inbuf, size
 			ret = -ENODATA;
 			goto fail;
 		}
-	};
+	}
 	templen -= (u8 *)needle - tempbuf;
 
 	/* Past magic. Look for tag node */
diff --git a/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/i2c.c b/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/i2c.c
index 17a5f3785b..ac0852ab0c 100644
--- a/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/i2c.c
+++ b/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/i2c.c
@@ -215,7 +215,7 @@ rtk_api_ret_t rtk_i2c_data_read(rtk_uint8 deviceAddr, rtk_uint32 slaveRegAddr, r
 {
      rtk_uint32 retVal, counter=0;
      rtk_uint8 controlByte_W, controlByte_R;
-     rtk_uint8 slaveRegAddr_L, slaveRegAddr_H = 0x0, temp;
+     rtk_uint8 slaveRegAddr_L, slaveRegAddr_H = 0x0;
      rtk_uint8 regData_L, regData_H;
 
    /* control byte :deviceAddress + W,  deviceAddress + R   */
@@ -226,11 +226,7 @@ rtk_api_ret_t rtk_i2c_data_read(rtk_uint8 deviceAddr, rtk_uint32 slaveRegAddr, r
     slaveRegAddr_H = (rtk_uint8) (slaveRegAddr >>8) ;
 
     if( rtk_i2c_mode == I2C_70B_LSB_16BIT_MODE)
-    {
-        temp = slaveRegAddr_L ;
-        slaveRegAddr_L = slaveRegAddr_H;
-        slaveRegAddr_H = temp;
-    }
+	swap(slaveRegAddr_L, slaveRegAddr_H);
 
 
   /*check bus state: idle*/
@@ -339,7 +335,7 @@ rtk_api_ret_t rtk_i2c_data_write(rtk_uint8 deviceAddr, rtk_uint32 slaveRegAddr,
 {
      rtk_uint32 retVal,counter;
      rtk_uint8 controlByte_W;
-     rtk_uint8 slaveRegAddr_L, slaveRegAddr_H = 0x0, temp;
+     rtk_uint8 slaveRegAddr_L, slaveRegAddr_H = 0x0;
      rtk_uint8 regData_L, regData_H;
 
   /* control byte :deviceAddress + W    */
@@ -352,11 +348,7 @@ rtk_api_ret_t rtk_i2c_data_write(rtk_uint8 deviceAddr, rtk_uint32 slaveRegAddr,
     regData_L   = (rtk_uint8) (regData & 0x00FF);
 
     if( rtk_i2c_mode == I2C_70B_LSB_16BIT_MODE)
-    {
-        temp = slaveRegAddr_L ;
-        slaveRegAddr_L = slaveRegAddr_H;
-        slaveRegAddr_H = temp;
-    }
+        swap(slaveRegAddr_L, slaveRegAddr_H);
 
 
   /*check bus state: idle*/
diff --git a/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_qos.c b/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_qos.c
index 69081049e3..4034f51090 100644
--- a/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_qos.c
+++ b/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_qos.c
@@ -233,7 +233,7 @@ ret_t rtl8367c_setAsicPriorityDecision(rtk_uint32 index, rtk_uint32 prisrc, rtk_
             break;
         default:
             break;
-    };
+    }
 
     return RT_ERR_OK;
 
@@ -278,7 +278,7 @@ ret_t rtl8367c_getAsicPriorityDecision(rtk_uint32 index, rtk_uint32 prisrc, rtk_
             break;
         default:
             break;
-    };
+    }
 
     return RT_ERR_OK;
 
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
index 0d77db511b..5b3f21c92f 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
@@ -1458,7 +1458,7 @@ MODULE_DEVICE_TABLE(of, ralink_esw_match);
 int rt3050_esw_init(struct fe_priv *priv)
 {
 	struct device_node *np = priv->switch_np;
-	struct platform_device *pdev = of_find_device_by_node(np);
+	struct platform_device *pdev;
 	struct switch_dev *swdev;
 	struct rt305x_esw *esw;
 	const __be32 *rgmii;
@@ -1470,9 +1470,12 @@ int rt3050_esw_init(struct fe_priv *priv)
 	if (!of_device_is_compatible(np, ralink_esw_match->compatible))
 		return -EINVAL;
 
+	pdev = of_find_device_by_node(np);
 	esw = platform_get_drvdata(pdev);
-	if (!esw)
+	if (!esw) {
+		put_device(&pdev->dev);
 		return -EPROBE_DEFER;
+	}
 
 	priv->soc->swpriv = esw;
 	esw->priv = priv;
@@ -1488,6 +1491,7 @@ int rt3050_esw_init(struct fe_priv *priv)
 		dev_err(&pdev->dev, "RGMII mode, not exporting switch device.\n");
 		unregister_switch(&esw->swdev);
 		platform_set_drvdata(pdev, NULL);
+		put_device(&pdev->dev);
 		return -ENODEV;
 	}
 
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index 750fd94d3f..f45c874eee 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -206,18 +206,19 @@ int mtk_gsw_init(struct fe_priv *priv)
 	struct device_node *eth_node = priv->dev->of_node;
 	struct device_node *phy_node, *mdiobus_node;
 	struct device_node *np = priv->switch_np;
-	struct platform_device *pdev = of_find_device_by_node(np);
+	struct platform_device *pdev;
 	struct mt7620_gsw *gsw;
 	const __be32 *id;
 	int ret;
 	u8 val;
 
-	if (!pdev)
-		return -ENODEV;
-
 	if (!of_device_is_compatible(np, mediatek_gsw_match->compatible))
 		return -EINVAL;
 
+	pdev = of_find_device_by_node(np);
+	if (!pdev)
+		return -ENODEV;
+
 	gsw = platform_get_drvdata(pdev);
 	priv->soc->swpriv = gsw;
 
@@ -249,12 +250,14 @@ int mtk_gsw_init(struct fe_priv *priv)
 		ret = devm_request_irq(&pdev->dev, gsw->irq, gsw_interrupt_mt7620, 0,
 				  "gsw", priv);
 		if (ret) {
+			put_device(&pdev->dev);
 			dev_err(&pdev->dev, "Failed to request irq");
 			return ret;
 		}
 		mtk_switch_w32(gsw, ~PORT_IRQ_ST_CHG, GSW_REG_IMR);
 	}
 
+	put_device(&pdev->dev);
 	return 0;
 }
 
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
index 7e896644f8..1774de4b0f 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
@@ -268,6 +268,6 @@ void fe_mdio_cleanup(struct fe_priv *priv)
 		return;
 
 	mdiobus_unregister(priv->mii_bus);
-	of_node_put(priv->mii_bus->dev.of_node);
+	put_device(&priv->mii_bus->dev);
 	kfree(priv->mii_bus);
 }
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
index 8e1e6f5560..8ed4d0e8a4 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
@@ -1555,10 +1555,8 @@ static int fe_probe(struct platform_device *pdev)
 	netdev->base_addr = (unsigned long)fe_base;
 
 	netdev->irq = platform_get_irq(pdev, 0);
-	if (netdev->irq < 0) {
-		dev_err(&pdev->dev, "no IRQ resource found\n");
+	if (netdev->irq < 0)
 		return -ENXIO;
-	}
 
 	priv = netdev_priv(netdev);
 	spin_lock_init(&priv->page_lock);
diff --git a/target/linux/realtek/files-6.12/drivers/clk/realtek/clk-rtl83xx.c b/target/linux/realtek/files-6.12/drivers/clk/realtek/clk-rtl83xx.c
index 290de5ae6e..dc59988430 100644
--- a/target/linux/realtek/files-6.12/drivers/clk/realtek/clk-rtl83xx.c
+++ b/target/linux/realtek/files-6.12/drivers/clk/realtek/clk-rtl83xx.c
@@ -492,7 +492,7 @@ static int rtcl_ccu_create(struct device_node *np)
 		return -ENXIO;
 
 	rtcl_ccu = kzalloc(sizeof(*rtcl_ccu), GFP_KERNEL);
-	if (IS_ERR(rtcl_ccu))
+	if (!rtcl_ccu)
 		return -ENOMEM;
 
 	rtcl_ccu->np = np;
@@ -657,6 +657,7 @@ static int rtcl_init_sram(void)
 	rtcl_ccu->sram.pmark = (int *)((void *)sram_pbase + (dram_size - 4));
 	rtcl_ccu->sram.vbase = sram_vbase;
 
+	put_device(&pdev->dev);
 	return 0;
 
 err_put_device:
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
index 66889b3214..6115c48f30 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
@@ -356,6 +356,7 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
 			sprintf(led_set_str, "led_set%d", led_set);
 			priv->ports[pn].leds_on_this_port = of_property_count_u32_elems(led_node, led_set_str);
 			if (priv->ports[pn].leds_on_this_port > 4) {
+				of_node_put(dn);
 				dev_err(priv->dev, "led_set %d for port %d configuration is invalid\n", led_set, pn);
 				return -ENODEV;
 			}
diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index 550a129105..59ae4fbb24 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -1753,10 +1753,8 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 
 	/* Obtain device IRQ number */
 	dev->irq = platform_get_irq(pdev, 0);
-	if (dev->irq < 0) {
-		dev_err(&pdev->dev, "cannot obtain network-device IRQ\n");
-		return err;
-	}
+	if (dev->irq < 0)
+		return -ENODEV;
 
 	err = devm_request_irq(&pdev->dev, dev->irq, priv->r->net_irq,
 			       IRQF_SHARED, dev->name, dev);



From lede-commits at lists.infradead.org  Tue Dec  2 15:02:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 02 Dec 2025 18:02:20 -0500
Subject: [openwrt/openwrt]  ath79: ecb1xxx: use nvmem
In-Reply-To: <176471654009.1967619.5720412716922676461@git-01.infra.openwrt.org>
References: <176471654009.1967619.5720412716922676461@git-01.infra.openwrt.org>
Message-ID: <mailman.32649.1764716544.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e5b86c2320f0fb7160b924191088d10c54abdd81

commit e5b86c2320f0fb7160b924191088d10c54abdd81
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Jun 14 11:50:06 2024 -0700

    ath79: ecb1xxx: use nvmem
    
    Userspace handling is deprecated.
    
    Also switch LED to led-sources for simplicity.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20529
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi  | 30 +++++++++++++++++-----
 .../generic/base-files/etc/board.d/02_network      |  4 +--
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  5 ----
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |  3 +--
 4 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi b/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi
index 2a00985ba7..ef7bd19e00 100644
--- a/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi
+++ b/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi
@@ -8,6 +8,7 @@
 
 / {
 	aliases {
+		label-mac-device = &eth0;
 		led-boot = &led_power;
 		led-failsafe = &led_power;
 		led-running = &led_power;
@@ -35,12 +36,6 @@
 			default-state = "on";
 		};
 
-		wifi2g {
-			label = "blue:wifi2g";
-			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy1tpt";
-		};
-
 		wifi5g {
 			label = "blue:wifi5g";
 			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
@@ -71,6 +66,14 @@
 			partition at 40000 {
 				label = "u-boot-env";
 				reg = <0x040000 0x010000>;
+
+				nvmem-layout {
+					compatible = "u-boot,env";
+
+					macaddr_uboot_ethaddr: ethaddr {
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 
 			partition at 50000 {
@@ -95,6 +98,10 @@
 					#address-cells = <1>;
 					#size-cells = <1>;
 
+					cal_art_1000: calibration at 1000 {
+						reg = <0x1000 0x440>;
+					};
+
 					cal_art_5000: calibration at 5000 {
 						reg = <0x5000 0x844>;
 					};
@@ -120,6 +127,9 @@
 	phy-handle = <&phy5>;
 	phy-mode = "rgmii-id";
 
+	nvmem-cells = <&macaddr_uboot_ethaddr 0>;
+	nvmem-cell-names = "mac-address";
+
 	pll-data = <0x82000000 0x80000101 0x80001313>;
 
 	gmac-config {
@@ -142,5 +152,11 @@
 &wmac {
 	status = "okay";
 
-	qca,no-eeprom;
+	nvmem-cells = <&cal_art_1000>;
+	nvmem-cell-names = "calibration";
+
+	led {
+		led-sources = <13>;
+		led-active-low;
+	};
 };
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index fa158b839c..fcb56bd777 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -722,9 +722,7 @@ ath79_setup_macs()
 		;;
 	elecom,wab-i1750-ps|\
 	elecom,wab-s1167-ps|\
-	elecom,wab-s600-ps|\
-	engenius,ecb1200|\
-	engenius,ecb1750)
+	elecom,wab-s600-ps)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
 		label_mac=$lan_mac
 		;;
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 798f2da136..b3181372be 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -15,11 +15,6 @@ case "$FIRMWARE" in
 	avm,fritzdvbc)
 		caldata_extract_reverse "urlader" 0x1541 0x440
 		;;
-	engenius,ecb1200|\
-	engenius,ecb1750)
-		caldata_extract "art" 0x1000 0x440
-		ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
-		;;
 	sitecom,wlr-7100|\
 	sitecom,wlr-8100)
 		caldata_extract "art" 0x1000 0x440
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 6153599907..c71ba436b4 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -49,8 +49,7 @@ case "$board" in
 		;;
 	engenius,ecb1200|\
 	engenius,ecb1750)
-		[ "$PHYNBR" -eq 0 ] && \
-			mtd_get_mac_ascii u-boot-env athaddr > /sys${DEVPATH}/macaddress
+		macaddr_add "$(mtd_get_mac_ascii u-boot-env athaddr)" ${PHYNBR} > /sys${DEVPATH}/macaddress
 		;;
 	enterasys,ws-ap3705i)
 		[ "$PHYNBR" -eq 0 ] && \



From lede-commits at lists.infradead.org  Tue Dec  2 15:54:15 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 02 Dec 2025 18:54:15 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: add support for Widelantech
 WAP430X
In-Reply-To: <176471965549.2141232.11816078627533492422@git-01.infra.openwrt.org>
References: <176471965549.2141232.11816078627533492422@git-01.infra.openwrt.org>
Message-ID: <mailman.32654.1764719660.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/ff1419f895247a79e59a0fa63fe47f1583727674

commit ff1419f895247a79e59a0fa63fe47f1583727674
Author: Rani Hod <rani.hod at gmail.com>
AuthorDate: Tue Oct 7 17:54:55 2025 +0300

    mediatek: filogic: add support for Widelantech WAP430X
    
    This AX3000 flying saucer-shaped device is sold under a few names:
    - Widelantech WAP430X
      http://www.widelantech.com/?m=home&c=View&a=index&aid=131
    - Felicomm
    - UeeVii UAP200 (sold on amazon.com)
    True name, as marked on the PCB and as appears in the DTS, is WAP430X.
    
    Hardware:
    - SoC: Mediatek MT7981B
    - RAM: 256MiB DDR3
    - ROM: 16MiB NOR flash (Winbond 25Q128JVSQ)
    - Wired: one GbE RJ45 port
    - Wireless: Mediatek MT7976CN DBDC
    - Antennas: Internal (two 2.4 GHz 4.5 dBi, three 5 GHz 6 dBi)
    - GPIO: two blue LEDs (status, WLAN), one button (reset)
    - Power: DC5521 (12V) or 802.3af PoE (48V 0.3A)
    - UART: J500 on PCB [3v3] (Rx) (Tx) (Gnd), 115200n
    
    Original firmware is GECOOS 8.0_2024081000, a fork of OpenWrt 21.02
    created by Widelantech. All ports are closed except 443 (web management
    interface) and 80 (redirects to 443). UART is locked down, but U-Boot
    bootloader is friendly.
    
    Installation is done via UART (see note below).
    
    Method 1: press any key during boot to enter MTK U-Boot bootloader,
    then choose option 2 (Upgrade firmware) and upload sysupgrade binary
    via TFTP (or via Xmodem).
    
    Method 2: put sysupgrade binary on a webserver (http, not https); after
    GECOOS loads, choose option 4 (?????? = online firmware upgrade)
    in the menu and enter the URL to the sysupgrade binary.
    
    Note: GECOOS has a slick web management, and firmware can be uploaded
    at https://6.6.6.6/#/system/sysupgrade but it's still not clear how to
    convert the sysupgrade binary to a factory binary accepted by the web
    interface (WIP).
    
    Signed-off-by: Rani Hod <rani.hod at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20402
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../mediatek/dts/mt7981b-widelantech-wap430x.dts   | 169 +++++++++++++++++++++
 .../filogic/base-files/etc/board.d/02_network      |   1 +
 .../filogic/base-files/lib/upgrade/platform.sh     |   5 +-
 target/linux/mediatek/image/filogic.mk             |  15 ++
 4 files changed, 188 insertions(+), 2 deletions(-)

diff --git a/target/linux/mediatek/dts/mt7981b-widelantech-wap430x.dts b/target/linux/mediatek/dts/mt7981b-widelantech-wap430x.dts
new file mode 100644
index 0000000000..9faaf24123
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-widelantech-wap430x.dts
@@ -0,0 +1,169 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include <dt-bindings/leds/common.h>
+#include "mt7981b.dtsi"
+
+/ {
+	compatible = "widelantech,wap430x", "mediatek,mt7981b";
+	model = "Widelantech WAP430X";
+
+	aliases {
+		label-mac-device = &gmac1;
+		led-boot = &led_system;
+		led-failsafe = &led_system;
+		led-running = &led_system;
+		led-upgrade = &led_system;
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		btn-0 {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_system: led-0 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
+		};
+
+		led-1 {
+			function = LED_FUNCTION_WLAN;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 35 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+	};
+
+	memory at 40000000 {
+		device_type = "memory";
+		reg = <0 0x40000000 0 0x10000000>;
+	};
+};
+
+&eth {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mdio_pins>;
+
+	status = "okay";
+
+	gmac1: mac at 1 {
+		compatible = "mediatek,eth-mac";
+		reg = <1>;
+		phy-mode = "gmii";
+		phy-handle = <&int_gbe_phy>;
+
+		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&macaddr_factory_24>;
+	};
+};
+
+&pio {
+	spi2_flash_pins: spi2-pins {
+		mux {
+			function = "spi";
+			groups = "spi2", "spi2_wp_hold";
+		};
+	};
+};
+
+&spi2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi2_flash_pins>;
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "BL2";
+				reg = <0x00000 0x40000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "u-boot-env";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				label = "Factory";
+				reg = <0x50000 0xb0000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory: eeprom at 0 {
+						reg = <0x0 0x1000>;
+					};
+
+					// LAN MAC address
+					macaddr_factory_24: macaddr at 24 {
+						reg = <0x24 0x6>;
+					};
+
+					// WAN MAC address (not used)
+					/* macaddr at 2a {
+						reg = <0x2a 0x6>;
+					}; */
+				};
+			};
+
+			partition at 100000 {
+				label = "FIP";
+				reg = <0x100000 0x80000>;
+				read-only;
+			};
+
+			partition at 180000 {
+				compatible = "denx,fit";
+				label = "firmware";
+				reg = <0x180000 0xe70000>;
+			};
+
+			partition at ff0000 {
+				label = "opt";
+				reg = <0xff0000 0x10000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&wifi {
+	status = "okay";
+	nvmem-cells = <&eeprom_factory 0>;
+	nvmem-cell-names = "eeprom";
+};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index dd0a20e39c..8a30fc0b1f 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -112,6 +112,7 @@ mediatek_setup_interfaces()
 	openfi,6c|\
 	ubnt,unifi-6-plus|\
 	wavlink,wl-wn573hx3|\
+	widelantech,wap430x|\
 	zyxel,nwa50ax-pro)
 		ucidef_set_interface_lan "eth0"
 		;;
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index 1b3f930bc8..e4c60ce0d4 100755
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -157,9 +157,10 @@ platform_do_upgrade() {
 		;;
 	cudy,re3000-v1|\
 	cudy,wr3000-v1|\
-	yuncore,ax835|\
+	totolink,x6000r|\
 	wavlink,wl-wn573hx3|\
-	totolink,x6000r)
+	widelantech,wap430x|\
+	yuncore,ax835)
 		default_do_upgrade "$1"
 		;;
 	dlink,aquila-pro-ai-m30-a1|\
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 9f3c3c4294..5987872e01 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -2626,6 +2626,21 @@ define Device/wavlink_wl-wn573hx3
 endef
 TARGET_DEVICES += wavlink_wl-wn573hx3
 
+define Device/widelantech_wap430x
+  DEVICE_VENDOR := Widelantech
+  DEVICE_MODEL := WAP430X
+  DEVICE_ALT1_VENDOR := Widelantech
+  DEVICE_ALT1_MODEL := AX3000AM
+  DEVICE_ALT1_VENDOR := UeeVii
+  DEVICE_ALT1_MODEL := UAP200
+  DEVICE_DTS := mt7981b-widelantech-wap430x
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+  IMAGE_SIZE := 14784k
+  SUPPORTED_DEVICES += UAP200 AX3000AM # allow upgrade via GECOOS UART menu
+endef
+TARGET_DEVICES += widelantech_wap430x
+
 define Device/xiaomi_mi-router-ax3000t
   DEVICE_VENDOR := Xiaomi
   DEVICE_MODEL := Mi Router AX3000T



From lede-commits at lists.infradead.org  Tue Dec  2 15:56:04 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 02 Dec 2025 18:56:04 -0500
Subject: [openwrt/openwrt]  ath79: sitecom,wlrx100: use nvmem
In-Reply-To: <176471976444.2149148.10205833412375798314@git-01.infra.openwrt.org>
References: <176471976444.2149148.10205833412375798314@git-01.infra.openwrt.org>
Message-ID: <mailman.32655.1764719769.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5e3a602def72475398e84c55eefec642921e236c

commit 5e3a602def72475398e84c55eefec642921e236c
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Jun 15 15:13:07 2024 -0700

    ath79: sitecom,wlrx100: use nvmem
    
    Userspace handling is deprecated.
    
    Also use led-sources for simplicity.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20508
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts | 34 +++++++++++++++------
 .../linux/ath79/dts/qca9558_sitecom_wlr-8100.dts   | 35 ++++++++++++++++------
 .../generic/base-files/etc/board.d/02_network      |  2 --
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  5 ----
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |  5 ----
 5 files changed, 51 insertions(+), 30 deletions(-)

diff --git a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts
index 67d954dd14..7903f3d73f 100644
--- a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts
+++ b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts
@@ -11,6 +11,7 @@
 	compatible = "sitecom,wlr-7100", "qca,ar9344";
 
 	aliases {
+		label-mac-device = &eth0;
 		led-boot = &led_power;
 		led-failsafe = &led_power;
 		led-running = &led_power;
@@ -47,12 +48,6 @@
 			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
 			default-state = "on";
 		};
-
-		wlan2g {
-			label = "blue:wlan2g";
-			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy1tpt";
-		};
 	};
 };
 
@@ -64,6 +59,9 @@
 	phy-mode = "rgmii";
 	phy-handle = <&phy0>;
 
+	nvmem-cells = <&macaddr_uboot_ethaddr 0>;
+	nvmem-cell-names = "mac-address";
+
 	gmac-config {
 		device = <&gmac>;
 		rgmii-gmac0 = <1>;
@@ -95,8 +93,8 @@
 	wifi at 0,0 {
 		compatible = "qcom,ath10k";
 		reg = <0x0000 0 0 0 0>;
-		nvmem-cells = <&cal_art_5000>;
-		nvmem-cell-names = "calibration";
+		nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>;
+		nvmem-cell-names = "calibration", "mac-address";
 	};
 };
 
@@ -127,6 +125,14 @@
 				label = "u-boot-env";
 				reg = <0x030000 0x010000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "u-boot,env";
+
+					macaddr_uboot_ethaddr: ethaddr {
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 
 			partition at 40000 {
@@ -157,6 +163,10 @@
 					#address-cells = <1>;
 					#size-cells = <1>;
 
+					cal_art_1000: calibration at 1000 {
+						reg = <0x1000 0x440>;
+					};
+
 					cal_art_5000: calibration at 5000 {
 						reg = <0x5000 0x844>;
 					};
@@ -177,5 +187,11 @@
 &wmac {
 	status = "okay";
 
-	qca,no-eeprom;
+	nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>;
+	nvmem-cell-names = "calibration", "mac-address";
+
+	led {
+		led-sources = <14>;
+		led-active-low;
+	};
 };
diff --git a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts
index 1c8d88c20d..9978a3d7d1 100644
--- a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts
+++ b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts
@@ -11,6 +11,7 @@
 	compatible = "sitecom,wlr-8100", "qca,qca9558";
 
 	aliases {
+		label-mac-device = &eth0;
 		led-boot = &led_status_amber;
 		led-failsafe = &led_status_amber;
 		led-running = &led_status_amber;
@@ -48,12 +49,6 @@
 			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
 		};
 
-		wifi2g {
-			label = "blue:wifi2g";
-			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy1tpt";
-		};
-
 		wifi5g {
 			label = "blue:wifi5g";
 			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
@@ -85,6 +80,14 @@
 				label = "u-boot-env";
 				reg = <0x030000 0x010000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "u-boot,env";
+
+					macaddr_uboot_ethaddr: ethaddr {
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 
 			partition at 40000 {
@@ -121,6 +124,10 @@
 					#address-cells = <1>;
 					#size-cells = <1>;
 
+					cal_art_1000: calibration at 1000 {
+						reg = <0x1000 0x440>;
+					};
+
 					cal_art_5000: calibration at 5000 {
 						reg = <0x5000 0x844>;
 					};
@@ -140,8 +147,8 @@
 	wifi at 0,0 {
 		compatible = "qcom,ath10k";
 		reg = <0 0 0 0 0>;
-		nvmem-cells = <&cal_art_5000>;
-		nvmem-cell-names = "calibration";
+		nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>;
+		nvmem-cell-names = "calibration", "mac-address";
 	};
 };
 
@@ -175,6 +182,9 @@
 	phy-handle = <&phy0>;
 	pll-data = <0xa6000000 0x00000101 0x00001616>;
 
+	nvmem-cells = <&macaddr_uboot_ethaddr 0>;
+	nvmem-cell-names = "mac-address";
+
 	gmac-config {
 		device = <&gmac>;
 		rgmii-enabled = <1>;
@@ -183,5 +193,12 @@
 
 &wmac {
 	status = "okay";
-	qca,no-eeprom;
+
+	nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>;
+	nvmem-cell-names = "calibration", "mac-address";
+
+	led {
+		led-sources = <19>;
+		led-active-low;
+	};
 };
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index fcb56bd777..1d5ddc605c 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -808,9 +808,7 @@ ath79_setup_macs()
 		;;
 	sitecom,wlr-7100|\
 	sitecom,wlr-8100)
-		lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
 		wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
-		label_mac=$lan_mac
 		;;
 	tplink,archer-a7-v5|\
 	tplink,archer-a9-v6|\
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index b3181372be..ed2b846433 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -15,11 +15,6 @@ case "$FIRMWARE" in
 	avm,fritzdvbc)
 		caldata_extract_reverse "urlader" 0x1541 0x440
 		;;
-	sitecom,wlr-7100|\
-	sitecom,wlr-8100)
-		caldata_extract "art" 0x1000 0x440
-		ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
-		;;
 	moxa,awk-1137c)
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index c71ba436b4..e3336174d5 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -80,11 +80,6 @@ case "$board" in
 		# which would allow to patch the macaddress
 		macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" $PHYNBR > /sys${DEVPATH}/macaddress
 		;;
-	sitecom,wlr-7100|\
-	sitecom,wlr-8100)
-		[ "$PHYNBR" -eq 0 ] && \
-			macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
-		;;
 	dlink,dir-842-c1|\
 	dlink,dir-842-c2|\
 	dlink,dir-842-c3|\



From lede-commits at lists.infradead.org  Wed Dec  3 03:21:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 03 Dec 2025 06:21:41 -0500
Subject: [openwrt/openwrt]  microchipsw: lan969x: add Microchip EV23X71A
In-Reply-To: <176476090046.1278720.4735032385209991923@git-01.infra.openwrt.org>
References: <176476090046.1278720.4735032385209991923@git-01.infra.openwrt.org>
Message-ID: <mailman.32787.1764760905.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5205c0c426073aed5912d2bf35f3a3b56670911e

commit 5205c0c426073aed5912d2bf35f3a3b56670911e
Author: Robert Marko <robert.marko at sartura.hr>
AuthorDate: Thu Sep 25 22:44:10 2025 +0200

    microchipsw: lan969x: add Microchip EV23X71A
    
    Microchip EV23X71A is a LAN9696 based EVB.
    
    Specifications:
    * CPU: Microchip LAN9696 switch SoC
    * DRAM: 1GB DDR4
    * Storage:
            * 2MB QSPI NOR
            * 4GB eMMC
    * Networking:
            * 24 x 10/100/1000 RJ45 via LAN8814 Quad PHY-s over QSGMII
            * 4 x 100/1000/2500/5000/10000 SFP+ ports
            * 1 x 10/100/1000 management RJ45 via LAN8840 PHY over RGMII (U-Boot too)
    * USB: 1 x USB2.0 Type-A
    * Management via USB-C (MCP2200):
            * UART @ 115200 baud
            * GPIO-s for bootstrap, reset and clock selection
    * DIP switch for boostrap configuration
    * LED-s:
            * 2 per networking port (Green and Yellow)
            * Green status LED
            * Yellow reset LED
    * Hard reset button
    * Power:
            * 12V DC barrel jack
            * 48/56V DC screw terminal
            * Selectable via toggle switch
    * PTP support:
            * Sync-E DPLL ZL30732B to generate the board required clocks
            * Two SMAs for PTP and two for Station clock inputs and outputs
            * Two ITU-T G.8275-compliant RS-422 interfaces for PTP applications
    * External PoE:
            * Option for PoE add-on, like EV14Y36A (IEEE 802.3af/at/bt Type 4
            standard com-pliant)
    * Option for external CPU control via SPI and PCIe
    
    Installation instructions:
    
    1. Connect to UART via the USB-C port
    2. Connect the management port
    3. Boot and interrupt U-Boot
    4. TFTP the OpenWrt initramfs image and boot it
    5. SCP the OpenWrt eMMC GPT image to a running OpenWrt initramfs to /tmp
    openwrt-microchipsw-lan969x-microchip_ev23x71a-squashfs-emmc-gpt.img.gz
    
    And decompress it via:
    gzip -d /tmp/openwrt-microchipsw-lan969x-microchip_ev23x71a-squashfs-emmc-gpt.img.gz
    
    6. Wipe eMMC with:
    dd if=/dev/zero of=/dev/mmcblk0 bs=1M
    
    7. Flash OpenWrt eMMC image with:
    dd if=/tmp/openwrt-microchipsw-lan969x-microchip_ev23x71a-squashfs-emmc-gpt.img
    of=/dev/mmcblk0
    
    After a restart OpenWrt will boot, and then regular sysupgrade can be used
    for upgrades.
    
    Signed-off-by: Robert Marko <robert.marko at sartura.hr>
---
 config/Config-images.in                            |   2 +-
 .../boot/arm-trusted-firmware-microchipsw/Makefile |  78 ++
 package/boot/uboot-microchipsw/Makefile            |  37 +
 .../patches/200-cmd-add-imsz-and-imszb.patch       | 139 ++++
 .../src/board/microchip/lan969x/lan969x.env        |  10 +
 target/linux/microchipsw/dts/lan9696-ev23x71a.dts  | 787 +++++++++++++++++++++
 target/linux/microchipsw/image/Makefile            |   2 +
 target/linux/microchipsw/image/lan969x.mk          |  41 ++
 .../lan969x/base-files/etc/board.d/01_leds         |  23 +
 .../lan969x/base-files/etc/board.d/02_network      |  25 +
 .../lan969x/base-files/lib/upgrade/platform.sh     |  31 +
 target/linux/microchipsw/lan969x/config-default    |   1 +
 target/linux/microchipsw/lan969x/target.mk         |   5 +-
 13 files changed, 1179 insertions(+), 2 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 9b04ddbeec..fcc5fa52cb 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -336,7 +336,7 @@ menu "Target Images"
 		int "Root filesystem partition size (in MiB)"
 		depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS
 		default 232 if TARGET_loongarch64
-		default 448 if TARGET_mediatek
+		default 448 if TARGET_mediatek || TARGET_microchipsw
 		default 104
 		help
 		  Select the root filesystem partition size.
diff --git a/package/boot/arm-trusted-firmware-microchipsw/Makefile b/package/boot/arm-trusted-firmware-microchipsw/Makefile
new file mode 100644
index 0000000000..fae462aa0b
--- /dev/null
+++ b/package/boot/arm-trusted-firmware-microchipsw/Makefile
@@ -0,0 +1,78 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=arm-trusted-firmware-microchipsw
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/microchip-ung/arm-trusted-firmware.git
+PKG_SOURCE_DATE:=2024-08-13
+PKG_SOURCE_VERSION:=67fcfcab71f78ac7d4af834c37b29f8c98dd5ff1
+PKG_MIRROR_HASH:=777c68273e84028de77750f3fe8a1219b02f01d43ce35948893ac642d8eb10d7
+
+PKG_MAINTAINER:=Robert Marko <robert.marko at sartura.hr>
+
+include $(INCLUDE_DIR)/kernel.mk
+include $(INCLUDE_DIR)/trusted-firmware-a.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Trusted-Firmware-A/Default
+  BUILD_TARGET:=microchipsw
+  TFA_IMAGE:=fip.bin fwu_fip.bin fwu.html
+endef
+
+define Trusted-Firmware-A/ev23x71a
+  NAME:=Microchip EV23X71A
+  BUILD_SUBTARGET:=lan969x
+  BUILD_DEVICES:=microchip_ev23x71a
+  PLAT:=lan969x_a0
+  DEPENDS:=+u-boot-ev23x71a
+endef
+
+TFA_TARGETS:= ev23x71a
+
+MBEDTLS_NAME:=mbedtls
+MBEDTLS_RELEASE:=2.28.10
+MBEDTLS_SOURCE:=$(MBEDTLS_NAME)-$(MBEDTLS_RELEASE).tar.zst
+
+define Download/mbedtls
+  FILE:=$(MBEDTLS_SOURCE)
+  PROTO:=git
+  URL:=https://github.com/Mbed-TLS/mbedtls.git
+  SOURCE_VERSION:=2fc8413bfcb51354c8e679141b17b3f1a5942561
+  MIRROR_HASH:=40b94a76572ad1ca89738929ab81d6024f678f22691eb3bd633c076ac18a334a
+  SUBDIR:=$(MBEDTLS_NAME)
+endef
+
+define Build/Prepare
+	# Download mbedtls
+	$(eval $(call Download,mbedtls))
+
+	$(call Build/Prepare/Default,)
+
+	$(TAR) -C $(PKG_BUILD_DIR) -xf $(DL_DIR)/$(MBEDTLS_SOURCE)
+endef
+
+# We must not pass OPENSSL_DIR as locally built mbedtls is used
+define Build/Compile
+	+unset CC; \
+	$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+		CROSS_COMPILE=$(TARGET_CROSS) \
+		$(if $(DTC),DTC="$(DTC)") \
+		PLAT=$(PLAT) \
+		BUILD_STRING="OpenWrt $(PKG_VERSION_PREFIX)$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
+		$(TFA_MAKE_FLAGS)
+endef
+
+TFA_MAKE_FLAGS += \
+	MBEDTLS_DIR=$(PKG_BUILD_DIR)/$(MBEDTLS_NAME) \
+	BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.bin \
+	KEY_ALG=ecdsa GENERATE_COT=1 TRUSTED_BOARD_BOOT=1 \
+	all fip fwu_fip
+
+define Package/trusted-firmware-a/install
+	$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-fip.bin
+	$(CP) $(patsubst %,$(PKG_BUILD_DIR)/build/$(PLAT)/release/%,$(TFA_IMAGE)) $(1)/
+endef
+
+$(eval $(call BuildPackage/Trusted-Firmware-A))
diff --git a/package/boot/uboot-microchipsw/Makefile b/package/boot/uboot-microchipsw/Makefile
new file mode 100644
index 0000000000..f727739276
--- /dev/null
+++ b/package/boot/uboot-microchipsw/Makefile
@@ -0,0 +1,37 @@
+include $(TOPDIR)/rules.mk
+
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/microchip-ung/u-boot.git
+PKG_SOURCE_DATE:=2025-09-22
+PKG_SOURCE_VERSION:=c1abab62a00a6b8f43f663a0a30dd0a7fd6a4e95
+PKG_MIRROR_HASH:=6405c426afd8bacbb4cc985da4ca1bd04b54a0d2aa3bb3ba8f7571dbe5913055
+
+PKG_MAINTAINER:=Robert Marko <robert.marko at sartura.hr>
+
+include $(INCLUDE_DIR)/u-boot.mk
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+define U-Boot/Default
+  BUILD_TARGET:=microchipsw
+  HIDDEN:=1
+  UBOOT_IMAGE:=u-boot.bin
+endef
+
+define U-Boot/ev23x71a
+  NAME:=Microchip EV23X71A
+  BUILD_DEVICES:=microchip_ev23x71a
+  BUILD_SUBTARGET:=lan969x
+  UBOOT_CONFIG:=mchp_lan969x
+endef
+
+UBOOT_TARGETS:= ev23x71a
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
+	$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE)
+endef
+
+$(eval $(call BuildPackage/U-Boot))
diff --git a/package/boot/uboot-microchipsw/patches/200-cmd-add-imsz-and-imszb.patch b/package/boot/uboot-microchipsw/patches/200-cmd-add-imsz-and-imszb.patch
new file mode 100644
index 0000000000..9872ccbf26
--- /dev/null
+++ b/package/boot/uboot-microchipsw/patches/200-cmd-add-imsz-and-imszb.patch
@@ -0,0 +1,139 @@
+--- a/cmd/bootm.c
++++ b/cmd/bootm.c
+@@ -260,6 +260,76 @@ U_BOOT_CMD(
+ /* iminfo - print header info for a requested image */
+ /*******************************************************************/
+ #if defined(CONFIG_CMD_IMI)
++#define SECTOR_SHIFT 9
++static int image_totalsize(struct cmd_tbl *cmdtp, int flag, int argc,
++			   char *const argv[], short int in_blocks)
++{
++	ulong addr;
++	void *hdr;
++	uint32_t bsize, tsize = 0;
++	char buf[16];
++
++	if (argc >= 2)
++		addr = simple_strtoul(argv[1], NULL, 16);
++	else
++		addr = image_load_addr;
++
++	hdr = (void *)map_sysmem(addr, 0);
++
++	switch (genimg_get_format(hdr)) {
++	case IMAGE_FORMAT_LEGACY:
++		if(CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT))
++			tsize = image_get_image_size(hdr);
++		break;
++	case IMAGE_FORMAT_FIT:
++		if(CONFIG_IS_ENABLED(FIT))
++			tsize = fit_get_totalsize(hdr);
++		break;
++	}
++
++	unmap_sysmem(hdr);
++	if (tsize == 0)
++		return 1;
++
++	bsize = (tsize >> SECTOR_SHIFT) + ((tsize & ((1 << SECTOR_SHIFT) - 1))?1:0);
++
++	if (!in_blocks)
++		snprintf(buf, sizeof(buf), "%x", tsize);
++	else
++		snprintf(buf, sizeof(buf), "%x", bsize);
++
++	if (argc >= 3)
++		return env_set(argv[2], buf);
++	else
++		printf("%s\n", buf);
++
++	return 0;
++}
++
++static int do_imsz(struct cmd_tbl *cmdtp, int flag, int argc,
++		     char *const argv[])
++{
++	return image_totalsize(cmdtp, flag, argc, argv, 0);
++}
++
++static int do_imszb(struct cmd_tbl *cmdtp, int flag, int argc,
++		     char *const argv[])
++{
++	return image_totalsize(cmdtp, flag, argc, argv, 1);
++}
++
++U_BOOT_CMD(
++	imsz,	CONFIG_SYS_MAXARGS,	1,	do_imsz,
++	"get image total size (in bytes)",
++	"addr [maxhdrlen] [varname]\n"
++);
++
++U_BOOT_CMD(
++	imszb,	CONFIG_SYS_MAXARGS,	1,	do_imszb,
++	"get image total size (in blocks)",
++	"addr [maxhdrlen] [varname]\n"
++);
++
+ static int do_iminfo(struct cmd_tbl *cmdtp, int flag, int argc,
+ 		     char *const argv[])
+ {
+--- a/boot/image-fit.c
++++ b/boot/image-fit.c
+@@ -2054,6 +2054,47 @@ static const char *fit_get_image_type_pr
+ 	return "unknown";
+ }
+ 
++size_t fit_get_totalsize(const void *fit)
++{
++	int ret, ndepth, noffset, images_noffset;
++	size_t data_size, hdrsize, img_total, max_size = 0;
++	const void *data;
++
++	ret = fdt_check_header(fit);
++	if (ret) {
++		debug("Wrong FIT format: not a flattened device tree (err=%d)\n",
++			  ret);
++		return 0;
++	}
++
++	hdrsize = fdt_totalsize(fit);
++
++	/* take care of simple FIT with internal images */
++	max_size = hdrsize;
++
++	images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
++	if (images_noffset < 0)
++		goto out;
++
++	for (ndepth = 0,
++	     noffset = fdt_next_node(fit, images_noffset, &ndepth);
++	     (noffset >= 0) && (ndepth > 0);
++	     noffset = fdt_next_node(fit, noffset, &ndepth)) {
++		if (ndepth == 1) {
++			ret = fit_image_get_data(fit, noffset, &data, &data_size);
++			if (ret)
++				goto out;
++
++			img_total = data_size + (data - fit);
++
++			max_size = (max_size > img_total) ? max_size : img_total;
++		}
++	}
++
++out:
++	return max_size;
++}
++
+ int fit_image_load(struct bootm_headers *images, ulong addr,
+ 		   const char **fit_unamep, const char **fit_uname_configp,
+ 		   int arch, int ph_type, int bootstage_id,
+--- a/include/image.h
++++ b/include/image.h
+@@ -1113,6 +1113,7 @@ int fit_parse_subimage(const char *spec,
+ 		ulong *addr, const char **image_name);
+ 
+ int fit_get_subimage_count(const void *fit, int images_noffset);
++size_t fit_get_totalsize(const void *fit);
+ void fit_print_contents(const void *fit);
+ void fit_image_print(const void *fit, int noffset, const char *p);
+ 
diff --git a/package/boot/uboot-microchipsw/src/board/microchip/lan969x/lan969x.env b/package/boot/uboot-microchipsw/src/board/microchip/lan969x/lan969x.env
new file mode 100644
index 0000000000..4ea48bca0c
--- /dev/null
+++ b/package/boot/uboot-microchipsw/src/board/microchip/lan969x/lan969x.env
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+fdt_high=0xffffffff
+baudrate=115200
+bootdelay=3
+loadaddr=0x64000000
+bootargs=console=ttyAT0,115200 root=PARTLABEL=rootfs rootwait
+mmc_read_kernel=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr $part_addr $image_size
+boot_system=part start mmc 0 kernel part_addr && part size mmc 0 kernel part_size && run mmc_read_kernel && bootm
+bootcmd=run boot_system
diff --git a/target/linux/microchipsw/dts/lan9696-ev23x71a.dts b/target/linux/microchipsw/dts/lan9696-ev23x71a.dts
new file mode 100644
index 0000000000..2ccc0345ac
--- /dev/null
+++ b/target/linux/microchipsw/dts/lan9696-ev23x71a.dts
@@ -0,0 +1,787 @@
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+#include "lan969x.dtsi"
+
+/ {
+	model = "Microchip EV23X71A";
+	compatible = "microchip,ev23x71a", "microchip,lan969x";
+
+	aliases {
+		serial0 = &usart0;
+		led-boot = &led_status;
+		led-failsafe = &led_status;
+		led-running = &led_status;
+		led-upgrade = &led_status;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	gpio-restart {
+		compatible = "gpio-restart";
+		gpios = <&gpio 60 GPIO_ACTIVE_LOW>;
+		open-source;
+		priority = <200>;
+	};
+
+	i2c-mux {
+		compatible = "i2c-mux-gpio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		i2c-parent = <&i2c3>;
+
+		mux-gpios = <&sgpio_out 0 1 GPIO_ACTIVE_HIGH
+			     &sgpio_out 0 2 GPIO_ACTIVE_HIGH
+			     &sgpio_out 0 3 GPIO_ACTIVE_HIGH>;
+		idle-state = <0x8>;
+
+		i2c_sfp0: i2c at 0 {
+			reg = <0x0>;
+		};
+
+		i2c_sfp1: i2c at 1 {
+			reg = <0x1>;
+		};
+
+		i2c_sfp2: i2c at 2 {
+			reg = <0x2>;
+		};
+
+		i2c_sfp3: i2c at 3 {
+			reg = <0x3>;
+		};
+
+		i2c_poe: i2c at 7 {
+			reg = <0x7>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_status: led-status {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			gpios = <&gpio 61 GPIO_ACTIVE_LOW>;
+		};
+
+		led-sfp1-green {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <0>;
+			gpios = <&sgpio_out 6 0 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-sfp1-yellow {
+			color = <LED_COLOR_ID_YELLOW>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <0>;
+			gpios = <&sgpio_out 6 1 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-sfp2-green {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <1>;
+			gpios = <&sgpio_out 7 0 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-sfp2-yellow {
+			color = <LED_COLOR_ID_YELLOW>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <1>;
+			gpios = <&sgpio_out 7 1 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-sfp3-green {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <2>;
+			gpios = <&sgpio_out 8 0 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-sfp3-yellow {
+			color = <LED_COLOR_ID_YELLOW>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <2>;
+			gpios = <&sgpio_out 8 1 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-sfp4-green {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <3>;
+			gpios = <&sgpio_out 9 0 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-sfp4-yellow {
+			color = <LED_COLOR_ID_YELLOW>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <3>;
+			gpios = <&sgpio_out 9 1 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+	};
+
+	mux-controller {
+		compatible = "gpio-mux";
+		#mux-control-cells = <0>;
+
+		mux-gpios = <&sgpio_out 1 2 GPIO_ACTIVE_LOW>,
+			    <&sgpio_out 1 3 GPIO_ACTIVE_LOW>;
+	};
+
+	sfp0: sfp0 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c_sfp0>;
+		tx-disable-gpios = <&sgpio_out 6 2 GPIO_ACTIVE_HIGH>;
+		los-gpios = <&sgpio_in 6 0 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpios = <&sgpio_in 6 1 GPIO_ACTIVE_LOW>;
+		tx-fault-gpios = <&sgpio_in 6 2 GPIO_ACTIVE_HIGH>;
+	};
+
+	sfp1: sfp1 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c_sfp1>;
+		tx-disable-gpios = <&sgpio_out 7 2 GPIO_ACTIVE_HIGH>;
+		los-gpios = <&sgpio_in 7 0 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpios = <&sgpio_in 7 1 GPIO_ACTIVE_LOW>;
+		tx-fault-gpios = <&sgpio_in 7 2 GPIO_ACTIVE_HIGH>;
+	};
+
+	sfp2: sfp2 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c_sfp2>;
+		tx-disable-gpios = <&sgpio_out 8 2 GPIO_ACTIVE_HIGH>;
+		los-gpios = <&sgpio_in 8 0 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpios = <&sgpio_in 8 1 GPIO_ACTIVE_LOW>;
+		tx-fault-gpios = <&sgpio_in 8 2 GPIO_ACTIVE_HIGH>;
+	};
+
+	sfp3: sfp3 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c_sfp3>;
+		tx-disable-gpios = <&sgpio_out 9 2 GPIO_ACTIVE_HIGH>;
+		los-gpios = <&sgpio_in 9 0 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpios = <&sgpio_in 9 1 GPIO_ACTIVE_LOW>;
+		tx-fault-gpios = <&sgpio_in 9 2 GPIO_ACTIVE_HIGH>;
+	};
+};
+
+&flx0 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
+	status = "okay";
+};
+
+&usart0 {
+	pinctrl-0 = <&fc0_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&flx2 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
+	status = "okay";
+};
+
+&spi2 {
+	pinctrl-0 = <&fc2_pins>;
+	pinctrl-names = "default";
+	cs-gpios = <&gpio 63 GPIO_ACTIVE_LOW>;
+	status = "okay";
+};
+
+&flx3 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
+	status = "okay";
+};
+
+&i2c3 {
+	pinctrl-0 = <&fc3_pins>;
+	pinctrl-names = "default";
+	i2c-analog-filter;
+	i2c-digital-filter;
+	i2c-digital-filter-width-ns = <35>;
+	i2c-sda-hold-time-ns = <1500>;
+	status = "okay";
+};
+
+&gpio {
+	emmc_sd_pins: emmc-sd-pins {
+		/* eMMC_SD - CMD, CLK, D0, D1, D2, D3, D4, D5, D6, D7, RSTN */
+		pins = "GPIO_14", "GPIO_15", "GPIO_16", "GPIO_17",
+		       "GPIO_18", "GPIO_19", "GPIO_20", "GPIO_21",
+		       "GPIO_22", "GPIO_23", "GPIO_24";
+		function = "emmc_sd";
+	};
+
+	fan_pins: fan-pins {
+		pins = "GPIO_25", "GPIO_26";
+		function = "fan";
+	};
+
+	fc0_pins: fc0-pins {
+		pins = "GPIO_3", "GPIO_4";
+		function = "fc";
+	};
+
+	fc2_pins: fc2-pins {
+		pins = "GPIO_64", "GPIO_65", "GPIO_66";
+		function = "fc";
+	};
+
+	fc3_pins: fc3-pins {
+		pins = "GPIO_55", "GPIO_56";
+		function = "fc";
+	};
+
+	mdio_pins: mdio-pins {
+		pins = "GPIO_9", "GPIO_10";
+		function = "miim";
+	};
+
+	mdio_irq_pins: mdio-irq-pins {
+		pins = "GPIO_11";
+		function = "miim_irq";
+	};
+
+	sgpio_pins: sgpio-pins {
+		/* SCK, D0, D1, LD */
+		pins = "GPIO_5", "GPIO_6", "GPIO_7", "GPIO_8";
+		function = "sgpio_a";
+	};
+
+	usb_ulpi_pins: usb-ulpi-pins {
+		pins = "GPIO_30", "GPIO_31", "GPIO_32", "GPIO_33",
+		"GPIO_34", "GPIO_35", "GPIO_36", "GPIO_37",
+		"GPIO_38", "GPIO_39", "GPIO_40", "GPIO_41";
+		function = "usb_ulpi";
+	};
+
+	usb_rst_pins: usb-rst-pins {
+		pins = "GPIO_12";
+		function = "usb2phy_rst";
+	};
+
+	usb_over_pins: usb-over-pins {
+		pins = "GPIO_13";
+		function = "usb_over_detect";
+	};
+
+	usb_power_pins: usb-power-pins {
+		pins = "GPIO_1";
+		function = "usb_power";
+	};
+
+	ptp_out_pins: ptp-out-pins {
+		pins = "GPIO_58";
+		function = "ptpsync_4";
+	};
+
+	ptp_ext_pins: ptp-ext-pins {
+		pins = "GPIO_59";
+		function = "ptpsync_5";
+	};
+};
+
+&qspi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <100000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		spi-tx-bus-width = <1>;
+		spi-rx-bus-width = <4>;
+		m25p,fast-read;
+	};
+};
+
+&sdmmc0 {
+	pinctrl-0 = <&emmc_sd_pins>;
+	pinctrl-names = "default";
+	max-frequency = <100000000>;
+	bus-width = <8>;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	non-removable;
+	disable-wp;
+	status = "okay";
+};
+
+&tmon {
+	pinctrl-0 = <&fan_pins>;
+	pinctrl-names = "default";
+};
+
+&mdio0 {
+	pinctrl-0 = <&mdio_pins>, <&mdio_irq_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&gpio 62 GPIO_ACTIVE_LOW>;
+	status = "okay";
+
+	phy3: phy at 3 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <3>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy4: phy at 4 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <4>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy5: phy at 5 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <5>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy6: phy at 6 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <6>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy7: phy at 7 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <7>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy8: phy at 8 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <8>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy9: phy at 9 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <9>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy10: phy at 10 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <10>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy11: phy at 11 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <11>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy12: phy at 12 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <12>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy13: phy at 13 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <13>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy14: phy at 14 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <14>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy15: phy at 15 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <15>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy16: phy at 16 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <16>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy17: phy at 17 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <17>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy18: phy at 18 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <18>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy19: phy at 19 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <19>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy20: phy at 20 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <20>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy21: phy at 21 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <21>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy22: phy at 22 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <22>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy23: phy at 23 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <23>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy24: phy at 24 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <24>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy25: phy at 25 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <25>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy26: phy at 26 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <26>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+
+	phy27: phy at 27 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <27>;
+		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpio>;
+	};
+};
+
+&serdes {
+	status = "okay";
+};
+
+&sgpio {
+	pinctrl-0 = <&sgpio_pins>;
+	pinctrl-names = "default";
+
+	microchip,sgpio-port-ranges = <0 1>, <6 9>;
+	status = "okay";
+
+	gpio at 0 {
+		ngpios = <128>;
+	};
+	gpio at 1 {
+		ngpios = <128>;
+	};
+};
+
+&switch {
+	pinctrl-0 = <&ptp_out_pins>, <&ptp_ext_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	ethernet-ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port0: port at 0 {
+			reg = <0>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy4>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 0>;
+		};
+
+		port1: port at 1 {
+			reg = <1>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy5>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 0>;
+		};
+
+		port2: port at 2 {
+			reg = <2>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy6>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 0>;
+		};
+
+		port3: port at 3 {
+			reg = <3>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy7>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 0>;
+		};
+
+		port4: port at 4 {
+			reg = <4>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy8>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 1>;
+		};
+
+		port5: port at 5 {
+			reg = <5>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy9>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 1>;
+		};
+
+		port6: port at 6 {
+			reg = <6>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy10>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 1>;
+		};
+
+		port7: port at 7 {
+			reg = <7>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy11>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 1>;
+		};
+
+		port8: port at 8 {
+			reg = <8>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy12>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 2>;
+		};
+
+		port9: port at 9 {
+			reg = <9>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy13>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 2>;
+		};
+
+		port10: port at 10 {
+			reg = <10>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy14>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 2>;
+		};
+
+		port11: port at 11 {
+			reg = <11>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy15>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 2>;
+		};
+
+		port12: port at 12 {
+			reg = <12>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy16>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 3>;
+		};
+
+		port13: port at 13 {
+			reg = <13>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy17>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 3>;
+		};
+
+		port14: port at 14 {
+			reg = <14>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy18>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 3>;
+		};
+
+		port15: port at 15 {
+			reg = <15>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy19>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 3>;
+		};
+
+		port16: port at 16 {
+			reg = <16>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy20>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 4>;
+		};
+
+		port17: port at 17 {
+			reg = <17>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy21>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 4>;
+		};
+
+		port18: port at 18 {
+			reg = <18>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy22>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 4>;
+		};
+
+		port19: port at 19 {
+			reg = <19>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy23>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 4>;
+		};
+
+		port20: port at 20 {
+			reg = <20>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy24>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 5>;
+		};
+
+		port21: port at 21 {
+			reg = <21>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy25>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 5>;
+		};
+
+		port22: port at 22 {
+			reg = <22>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy26>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 5>;
+		};
+
+		port23: port at 23 {
+			reg = <23>;
+			microchip,bandwidth = <1000>;
+			phy-handle = <&phy27>;
+			phy-mode = "qsgmii";
+			phys = <&serdes 5>;
+		};
+
+		port24: port at 24 {
+			reg = <24>;
+			microchip,bandwidth = <10000>;
+			phys = <&serdes 6>;
+			phy-mode = "10gbase-r";
+			sfp = <&sfp0>;
+			microchip,sd-sgpio = <24>;
+			managed = "in-band-status";
+		};
+
+		port25: port at 25 {
+			reg = <25>;
+			microchip,bandwidth = <10000>;
+			phys = <&serdes 7>;
+			phy-mode = "10gbase-r";
+			sfp = <&sfp1>;
+			microchip,sd-sgpio = <28>;
+			managed = "in-band-status";
+		};
+
+		port26: port at 26 {
+			reg = <26>;
+			microchip,bandwidth = <10000>;
+			phys = <&serdes 8>;
+			phy-mode = "10gbase-r";
+			sfp = <&sfp2>;
+			microchip,sd-sgpio = <32>;
+			managed = "in-band-status";
+		};
+
+		port27: port at 27 {
+			reg = <27>;
+			microchip,bandwidth = <10000>;
+			phys = <&serdes 9>;
+			phy-mode = "10gbase-r";
+			sfp = <&sfp3>;
+			microchip,sd-sgpio = <36>;
+			managed = "in-band-status";
+		};
+
+		port29: port at 29 {
+			reg = <29>;
+			microchip,bandwidth = <1000>;
+			phys = <&serdes 11>;
+			phy-handle = <&phy3>;
+			phy-mode = "rgmii";
+			rx-internal-delay-ps = <1000>;
+			tx-internal-delay-ps = <1000>;
+		};
+	};
+};
+
+&usb {
+	status = "okay";
+	pinctrl-0 = <&usb_ulpi_pins>, <&usb_rst_pins>, <&usb_over_pins>, <&usb_power_pins>;
+	pinctrl-names = "default";
+};
diff --git a/target/linux/microchipsw/image/Makefile b/target/linux/microchipsw/image/Makefile
index 4bee818578..2922c366c0 100644
--- a/target/linux/microchipsw/image/Makefile
+++ b/target/linux/microchipsw/image/Makefile
@@ -18,4 +18,6 @@ define Device/FitImage
 	KERNEL_NAME := Image
 endef
 
+include $(SUBTARGET).mk
+
 $(eval $(call BuildImage))
diff --git a/target/linux/microchipsw/image/lan969x.mk b/target/linux/microchipsw/image/lan969x.mk
new file mode 100644
index 0000000000..04b681b017
--- /dev/null
+++ b/target/linux/microchipsw/image/lan969x.mk
@@ -0,0 +1,41 @@
+define Build/lan969x-fip
+	cat $(STAGING_DIR_IMAGE)/$1-fip.bin >> $@
+endef
+
+define Build/lan969x-gpt-emmc
+	cp $@ $@.tmp 2>/dev/null || true
+	ptgen -g -o $@.tmp -a 1 -l 1024 \
+			-t 0x83	-N fip		-r	-p 8M at 1M \
+			-t 0x83	-N fip.bak	-r	-p 8M at 9M \
+			-t 0x83	-N Env		-r	-p 2M at 17M \
+		$(if $(findstring flash,$1), \
+			-t 0x2e -N kernel		-p $(CONFIG_TARGET_KERNEL_PARTSIZE)M at 19M \
+			-t 0x2e -N rootfs		-p $(CONFIG_TARGET_ROOTFS_PARTSIZE)M
+		)
+	cat $@.tmp >> $@
+	rm $@.tmp
+endef
+
+define Build/append-kernel-part
+	dd if=$(IMAGE_KERNEL) bs=$(CONFIG_TARGET_KERNEL_PARTSIZE)M conv=sync >> $@
+endef
+
+define Device/microchip_ev23x71a
+	$(call Device/FitImage)
+	DEVICE_VENDOR := Microchip
+	DEVICE_MODEL := EV23X71A
+	SOC := lan9696
+	DEVICE_PACKAGES := kmod-i2c-mux-gpio
+	IMAGES += emmc-atf-gpt.gz emmc-gpt.img.gz
+	IMAGE/emmc-atf-gpt.gz := lan969x-gpt-emmc |\
+		pad-to 1M | lan969x-fip ev23x71a |\
+		pad-to 9M | lan969x-fip ev23x71a |\
+		gzip
+	IMAGE/emmc-gpt.img.gz := lan969x-gpt-emmc flash |\
+		pad-to 1M | lan969x-fip ev23x71a |\
+		pad-to 9M | lan969x-fip ev23x71a |\
+		pad-to 19M | append-kernel-part |\
+		append-rootfs |\
+		gzip
+endef
+TARGET_DEVICES += microchip_ev23x71a
diff --git a/target/linux/microchipsw/lan969x/base-files/etc/board.d/01_leds b/target/linux/microchipsw/lan969x/base-files/etc/board.d/01_leds
new file mode 100644
index 0000000000..6e3da9e0ec
--- /dev/null
+++ b/target/linux/microchipsw/lan969x/base-files/etc/board.d/01_leds
@@ -0,0 +1,23 @@
+
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+board=$(board_name)
+
+case "$board" in
+microchip,ev23x71a)
+	ucidef_set_led_netdev "sfp1-link" "SFP1-LINK" "green:lan-0" "eth24" "link"
+	ucidef_set_led_netdev "sfp1-traffic" "SFP1-TRAFFIC" "yellow:lan-0" "eth24" "tx rx"
+	ucidef_set_led_netdev "sfp2-link" "SFP2-LINK" "green:lan-1" "eth25" "link"
+	ucidef_set_led_netdev "sfp2-traffic" "SFP2-TRAFFIC" "yellow:lan-1" "eth25" "tx rx"
+	ucidef_set_led_netdev "sfp3-link" "SFP3-LINK" "green:lan-2" "eth26" "link"
+	ucidef_set_led_netdev "sfp3-traffic" "SFP3-TRAFFIC" "yellow:lan-2" "eth26" "tx rx"
+	ucidef_set_led_netdev "sfp4-link" "SFP4-LINK" "green:lan-3" "eth27" "link"
+	ucidef_set_led_netdev "sfp4-traffic" "SFP4-TRAFFIC" "yellow:lan-3" "eth27" "tx rx"
+	;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/microchipsw/lan969x/base-files/etc/board.d/02_network b/target/linux/microchipsw/lan969x/base-files/etc/board.d/02_network
new file mode 100644
index 0000000000..be28e56192
--- /dev/null
+++ b/target/linux/microchipsw/lan969x/base-files/etc/board.d/02_network
@@ -0,0 +1,25 @@
+
+. /lib/functions/uci-defaults.sh
+. /lib/functions/system.sh
+
+lan969x_setup_interfaces()
+{
+	local board="$1"
+
+	case "$board" in
+	microchip,ev23x71a)
+		lan_list=$(ls -1 -v -d /sys/class/net/eth* | xargs -n1 basename | xargs)
+		ucidef_set_interface_lan "$lan_list"
+		;;
+	*)
+		echo "Unsupported hardware. Network interfaces not initialized"
+		;;
+	esac
+}
+
+board_config_update
+board=$(board_name)
+lan969x_setup_interfaces $board
+board_config_flush
+
+exit 0
diff --git a/target/linux/microchipsw/lan969x/base-files/lib/upgrade/platform.sh b/target/linux/microchipsw/lan969x/base-files/lib/upgrade/platform.sh
new file mode 100644
index 0000000000..a3d4b488f0
--- /dev/null
+++ b/target/linux/microchipsw/lan969x/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,31 @@
+PART_NAME=firmware
+REQUIRE_IMAGE_METADATA=1
+
+RAMFS_COPY_BIN='fw_printenv fw_setenv'
+RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
+
+platform_check_image() {
+	return 0;
+}
+
+platform_do_upgrade() {
+	case "$(board_name)" in
+	microchip,ev23x71a)
+		CI_KERNPART="kernel"
+		CI_ROOTPART="rootfs"
+		emmc_do_upgrade "$1"
+		;;
+	*)
+		default_do_upgrade "$1"
+		;;
+	esac
+}
+
+platform_copy_config() {
+	case "$(board_name)" in
+	microchip,ev23x71a)
+		emmc_copy_config
+		;;
+	esac
+	return 0;
+}
diff --git a/target/linux/microchipsw/lan969x/config-default b/target/linux/microchipsw/lan969x/config-default
index fd4b7424e8..620c2e61ce 100644
--- a/target/linux/microchipsw/lan969x/config-default
+++ b/target/linux/microchipsw/lan969x/config-default
@@ -44,6 +44,7 @@ CONFIG_ARM_GIC_V3_ITS=y
 CONFIG_ARM_PSCI_FW=y
 CONFIG_AT_XDMAC=y
 CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
+CONFIG_BLK_DEV_LOOP=y
 CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y
 CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
 CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
diff --git a/target/linux/microchipsw/lan969x/target.mk b/target/linux/microchipsw/lan969x/target.mk
index dce697a82d..bc77e62a5b 100644
--- a/target/linux/microchipsw/lan969x/target.mk
+++ b/target/linux/microchipsw/lan969x/target.mk
@@ -1,7 +1,10 @@
 SUBTARGET:=lan969x
 BOARDNAME:=Microchip LAN969x switches
+FEATURES+= boot-part rootfs-part
 
-DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3
+DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3 \
+	e2fsprogs kmod-fs-ext4 losetup \
+	kmod-fs-f2fs f2fs-tools
 
 define Target/Description
 	Build firmware images for Microchip LAN969x switch based boards.



From lede-commits at lists.infradead.org  Wed Dec  3 09:13:17 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 03 Dec 2025 12:13:17 -0500
Subject: [openwrt/openwrt]  ppp: add reqprefix norelease ac_mac
In-Reply-To: <176478199781.2995048.1775567712139799960@git-01.infra.openwrt.org>
References: <176478199781.2995048.1775567712139799960@git-01.infra.openwrt.org>
Message-ID: <mailman.32877.1764782008.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/13226471ef02e622cb42ab36d0fb1322c3b93449

commit 13226471ef02e622cb42ab36d0fb1322c3b93449
Author: Andy Chiang <AndyChiang_git at outlook.com>
AuthorDate: Tue Sep 9 07:37:09 2025 +0700

    ppp: add reqprefix norelease ac_mac
    
    Use ppp and enable autoipv6, odhcp6c supports reqprefix and norelease to minimize the chance of IPv6 PD changes.[1]
    PPPoE supports connecting to a specific AC/BRAS by using the pppoe-mac parameter.[2]
    
    1. https://github.com/openwrt/openwrt/blob/master/package/network/ipv6/odhcp6c/files/dhcpv6.sh#L67
       https://github.com/openwrt/openwrt/blob/master/package/network/ipv6/odhcp6c/files/dhcpv6.sh#L77
    2. https://github.com/ppp-project/ppp/blob/master/pppd/plugins/pppoe/plugin.c#L93
    
    Signed-off-by: Andy Chiang <AndyChiang_git at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/19978
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 7079e456ade5aad41e265c55cee49e4692807ecf)
    Link: https://github.com/openwrt/openwrt/pull/20824
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/network/services/ppp/files/lib/netifd/ppp6-up |  2 ++
 package/network/services/ppp/files/ppp.sh             | 15 ++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/package/network/services/ppp/files/lib/netifd/ppp6-up b/package/network/services/ppp/files/lib/netifd/ppp6-up
index 51339ad3ec..913e50015f 100755
--- a/package/network/services/ppp/files/lib/netifd/ppp6-up
+++ b/package/network/services/ppp/files/lib/netifd/ppp6-up
@@ -26,9 +26,11 @@ if [ -n "$AUTOIPV6" ]; then
 	[ -n "$ZONE" ] && json_add_string zone "$ZONE"
 	[ -n "$EXTENDPREFIX" ] && json_add_string extendprefix 1
 	[ -n "$IP6TABLE" ] && json_add_string ip6table $IP6TABLE
+	[ -n "$REQPREFIX" ] && json_add_string reqprefix $REQPREFIX
 	[ -n "$PEERDNS" ] && json_add_boolean peerdns $PEERDNS
 	[ "$NOSOURCEFILTER" = "1" ] && json_add_boolean sourcefilter "0"
 	[ "$DELEGATE" = "0" ] && json_add_boolean delegate "0"
+	[ -n "$NORELEASE" ] && json_add_boolean norelease "1"
 	json_close_object
 	ubus call network add_dynamic "$(json_dump)"
 fi
diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh
index d7c0cdb1ae..79fc61fcaa 100755
--- a/package/network/services/ppp/files/ppp.sh
+++ b/package/network/services/ppp/files/ppp.sh
@@ -79,18 +79,20 @@ ppp_generic_init_config() {
 	proto_config_add_int mtu
 	proto_config_add_string pppname
 	proto_config_add_string unnumbered
+	proto_config_add_string reqprefix
 	proto_config_add_boolean persist
 	proto_config_add_int maxfail
 	proto_config_add_int holdoff
 	proto_config_add_boolean sourcefilter
 	proto_config_add_boolean delegate
+	proto_config_add_boolean norelease
 }
 
 ppp_generic_setup() {
 	local config="$1"; shift
 	local localip
 
-	json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns sourcefilter delegate
+	json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered reqprefix persist maxfail holdoff peerdns sourcefilter delegate norelease
 
 	[ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6
 
@@ -101,6 +103,11 @@ ppp_generic_setup() {
 		autoipv6=1
 	fi
 
+	if [ "$autoipv6" != 1 ]; then
+		reqprefix=""
+		norelease=""
+	fi
+
 	if [ "${demand:-0}" -gt 0 ]; then
 		demand="precompiled-active-filter /etc/ppp/filter demand idle $demand"
 	else
@@ -137,6 +144,7 @@ ppp_generic_setup() {
 	[ -n "$disconnect" ] || json_get_var disconnect disconnect
 	[ "$sourcefilter" = "0" ] || sourcefilter=""
 	[ "$delegate" != "0" ] && delegate=""
+	[ "$norelease" = "1" ] || norelease=""
 
 	proto_run_command "$config" /usr/sbin/pppd \
 		nodetach ipparam "$config" \
@@ -145,6 +153,8 @@ ppp_generic_setup() {
 		${lcp_failure:+lcp-echo-interval $lcp_interval lcp-echo-failure $lcp_failure $lcp_adaptive} \
 		${ipv6:++ipv6} \
 		${autoipv6:+set AUTOIPV6=1} \
+		${reqprefix:+set REQPREFIX=$reqprefix} \
+		${norelease:+set NORELEASE=1} \
 		${ip6table:+set IP6TABLE=$ip6table} \
 		${peerdns:+set PEERDNS=$peerdns} \
 		${sourcefilter:+set NOSOURCEFILTER=1} \
@@ -215,6 +225,7 @@ proto_pppoe_init_config() {
 	ppp_generic_init_config
 	proto_config_add_string "ac"
 	proto_config_add_string "service"
+	proto_config_add_string "ac_mac"
 	proto_config_add_string "host_uniq"
 	proto_config_add_int "padi_attempts"
 	proto_config_add_int "padi_timeout"
@@ -233,6 +244,7 @@ proto_pppoe_setup() {
 
 	json_get_var ac ac
 	json_get_var service service
+	json_get_var ac_mac ac_mac
 	json_get_var host_uniq host_uniq
 	json_get_var padi_attempts padi_attempts
 	json_get_var padi_timeout padi_timeout
@@ -241,6 +253,7 @@ proto_pppoe_setup() {
 		plugin pppoe.so \
 		${ac:+rp_pppoe_ac "$ac"} \
 		${service:+rp_pppoe_service "$service"} \
+		${ac_mac:+pppoe-mac "$ac_mac"} \
 		${host_uniq:+host-uniq "$host_uniq"} \
 		${padi_attempts:+pppoe-padi-attempts $padi_attempts} \
 		${padi_timeout:+pppoe-padi-timeout $padi_timeout} \



From lede-commits at lists.infradead.org  Wed Dec  3 09:46:53 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 03 Dec 2025 12:46:53 -0500
Subject: [openwrt/openwrt]  tools: gnulib: install .m4 file with gl_ prefix
In-Reply-To: <176478401313.3274486.5639969849653525610@git-01.infra.openwrt.org>
References: <176478401313.3274486.5639969849653525610@git-01.infra.openwrt.org>
Message-ID: <mailman.32892.1764784031.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c820f097e0bede3ec09c62ca9608d915da21e62d

commit c820f097e0bede3ec09c62ca9608d915da21e62d
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed Dec 3 18:39:52 2025 +0100

    tools: gnulib: install .m4 file with gl_ prefix
    
    It was found that there is currently a conflict for the cond.m4 that
    is also shipped by automake, making the gnulib one having priority causing
    problem with finding AM_CONDITIONAL macro.
    
    To handle this, install gnulib .m4 file with a gl_ prefix to the
    filename.
    
    This make sure gnulib .m4 file won't have name conflict with automake
    .m4 default files permitting correct autoreconf run of any affected
    package by this.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 tools/gnulib/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/gnulib/Makefile b/tools/gnulib/Makefile
index 1237fad46e..018ff5db14 100644
--- a/tools/gnulib/Makefile
+++ b/tools/gnulib/Makefile
@@ -13,10 +13,15 @@ include $(INCLUDE_DIR)/host-build.mk
 define Host/Configure
 endef
 
+# On installing the .m4 files, we add a gl_ prefix to prevent any conflict with
+# automake. It was found that there is currently a conflict for the cond.m4 that
+# is also shipped by automake, making the gnulib one having priority causing
+# problem with finding AM_CONDITIONAL macro.
 define Host/Install
 	$(call Host/Uninstall)
 	$(INSTALL_DIR) $(1)/share/aclocal
-	$(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/*.m4 $(1)/share/aclocal/
+	$(foreach m4,$(notdir $(wildcard $(HOST_BUILD_DIR)/m4/*.m4)),
+		$(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/$(m4) $(1)/share/aclocal/gl_$(m4))
 	$(CP) $(HOST_BUILD_DIR)/ $(1)/share/gnulib/
 	ln -sf ../share/gnulib/gnulib-tool $(STAGING_DIR_HOST)/bin/gnulib-tool
 endef



From lede-commits at lists.infradead.org  Wed Dec  3 11:00:36 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 03 Dec 2025 14:00:36 -0500
Subject: [openwrt/openwrt]  autoconf-archive: backport patch for C++23 support
In-Reply-To: <176478843610.3623087.17809540995126405057@git-01.infra.openwrt.org>
References: <176478843610.3623087.17809540995126405057@git-01.infra.openwrt.org>
Message-ID: <mailman.32907.1764788453.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8ad5f35a9013ca7c65e86e7aef92617903afeab0

commit 8ad5f35a9013ca7c65e86e7aef92617903afeab0
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed Dec 3 19:58:00 2025 +0100

    autoconf-archive: backport patch for C++23 support
    
    Backport upstream patch for C++23 support on ax_cxx_compile_stdcxx.m4.
    
    This is needed by Asterisk package to correctly configure.
    
    It's currently not possible to bump to a more recent autoconf-archive
    release 2024.10.16 as it's currently affected by multiple BUGs ([1])
    
    [1] https://github.com/openwrt/openwrt/commit/e1acc7a67b92fa964710afe0a3ae2dad5c1f00c7
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...01-AX_CXX_COMPILE_STDCXX-Add-C-23-support.patch | 90 ++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/tools/autoconf-archive/patches/001-AX_CXX_COMPILE_STDCXX-Add-C-23-support.patch b/tools/autoconf-archive/patches/001-AX_CXX_COMPILE_STDCXX-Add-C-23-support.patch
new file mode 100644
index 0000000000..c44409cc15
--- /dev/null
+++ b/tools/autoconf-archive/patches/001-AX_CXX_COMPILE_STDCXX-Add-C-23-support.patch
@@ -0,0 +1,90 @@
+From 833c9c2e5b65383c8c1353b6beb88f52dede640f Mon Sep 17 00:00:00 2001
+From: Olly Betts <olly at survex.com>
+Date: Wed, 29 May 2024 07:54:24 +1200
+Subject: [PATCH] AX_CXX_COMPILE_STDCXX: Add C++23 support
+
+---
+ m4/ax_cxx_compile_stdcxx.m4 | 47 ++++++++++++++++++++++++++++++++++---
+ 1 file changed, 44 insertions(+), 3 deletions(-)
+
+--- a/m4/ax_cxx_compile_stdcxx.m4
++++ b/m4/ax_cxx_compile_stdcxx.m4
+@@ -10,8 +10,8 @@
+ #
+ #   Check for baseline language coverage in the compiler for the specified
+ #   version of the C++ standard.  If necessary, add switches to CXX and
+-#   CXXCPP to enable support.  VERSION may be '11', '14', '17', or '20' for
+-#   the respective C++ standard version.
++#   CXXCPP to enable support.  VERSION may be '11', '14', '17', '20', or
++#   '23' for the respective C++ standard version.
+ #
+ #   The second argument, if specified, indicates whether you insist on an
+ #   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
+@@ -43,7 +43,7 @@
+ #   and this notice are preserved.  This file is offered as-is, without any
+ #   warranty.
+ 
+-#serial 18
++#serial 19
+ 
+ dnl  This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
+ dnl  (serial version number 13).
+@@ -53,6 +53,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
+         [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
+         [$1], [17], [ax_cxx_compile_alternatives="17 1z"],
+         [$1], [20], [ax_cxx_compile_alternatives="20"],
++        [$1], [23], [ax_cxx_compile_alternatives="23"],
+         [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
+   m4_if([$2], [], [],
+         [$2], [ext], [],
+@@ -186,6 +187,16 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbo
+   _AX_CXX_COMPILE_STDCXX_testbody_new_in_20
+ )
+ 
++dnl  Test body for checking C++23 support
++
++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_23],
++  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
++  _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
++  _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
++  _AX_CXX_COMPILE_STDCXX_testbody_new_in_20
++  _AX_CXX_COMPILE_STDCXX_testbody_new_in_23
++)
++
+ 
+ dnl  Tests for new features in C++11
+ 
+@@ -1016,3 +1027,33 @@ namespace cxx20
+ #endif  // __cplusplus < 202002L && !defined _MSC_VER
+ 
+ ]])
++
++
++dnl  Tests for new features in C++23
++
++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_23], [[
++
++#ifndef __cplusplus
++
++#error "This is not a C++ compiler"
++
++#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L
++
++#error "This is not a C++23 compiler"
++
++#else
++
++#include <version>
++
++namespace cxx23
++{
++
++// As C++23 supports feature test macros in the standard, there is no
++// immediate need to actually test for feature availability on the
++// Autoconf side.
++
++}  // namespace cxx23
++
++#endif  // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L
++
++]])



From lede-commits at lists.infradead.org  Wed Dec  3 12:29:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 03 Dec 2025 15:29:29 -0500
Subject: [openwrt/openwrt]  kernel: bump 6.6 to 6.6.118
In-Reply-To: <176479376969.37836.1863697157403944489@git-01.infra.openwrt.org>
References: <176479376969.37836.1863697157403944489@git-01.infra.openwrt.org>
Message-ID: <mailman.32921.1764793792.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/b1528735da529677519b13961aee783a718f313c

commit b1528735da529677519b13961aee783a718f313c
Author: Goetz Goerisch <ggoerisch at gmail.com>
AuthorDate: Tue Dec 2 17:10:46 2025 +0100

    kernel: bump 6.6 to 6.6.118
    
    Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.118
    
    All patches auto-refreshed.
    
    Signed-off-by: Goetz Goerisch <ggoerisch at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21022
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/kernel-6.6                                                    | 4 ++--
 target/linux/bcm53xx/patches-6.6/905-BCM53573-minor-hacks.patch       | 4 ++--
 .../301-v6.9-kernel.h-removed-REPEAT_BYTE-from-kernel.h.patch         | 2 +-
 ...02-v6.9-kernel.h-Move-upper_-_bits-and-lower_-_bits-to-wordp.patch | 4 ++--
 target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch       | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/kernel-6.6 b/include/kernel-6.6
index 3a848b96e5..e5c3c5c302 100644
--- a/include/kernel-6.6
+++ b/include/kernel-6.6
@@ -1,2 +1,2 @@
-LINUX_VERSION-6.6 = .117
-LINUX_KERNEL_HASH-6.6.117 = 643b31079222fdbda70cfdd0b68c514f05a3926104be4762a4685f62818b43d1
+LINUX_VERSION-6.6 = .118
+LINUX_KERNEL_HASH-6.6.118 = 4bdddce35474afc8d26f74ebfbcd0e1045ecd15f69e60f53529dba143374b17d
diff --git a/target/linux/bcm53xx/patches-6.6/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-6.6/905-BCM53573-minor-hacks.patch
index 44573cb46a..afb0a1b8a3 100644
--- a/target/linux/bcm53xx/patches-6.6/905-BCM53573-minor-hacks.patch
+++ b/target/linux/bcm53xx/patches-6.6/905-BCM53573-minor-hacks.patch
@@ -21,7 +21,7 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
  	clocks {
 --- a/drivers/bcma/main.c
 +++ b/drivers/bcma/main.c
-@@ -331,14 +331,6 @@ static int bcma_register_devices(struct
+@@ -337,14 +337,6 @@ static int bcma_register_devices(struct
  	}
  #endif
  
@@ -36,7 +36,7 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
  #ifdef CONFIG_BCMA_NFLASH
  	if (bus->drv_cc.nflash.present) {
  		err = platform_device_register(&bcma_nflash_dev);
-@@ -418,6 +410,14 @@ int bcma_bus_register(struct bcma_bus *b
+@@ -424,6 +416,14 @@ int bcma_bus_register(struct bcma_bus *b
  			bcma_register_core(bus, core);
  	}
  
diff --git a/target/linux/generic/backport-6.6/301-v6.9-kernel.h-removed-REPEAT_BYTE-from-kernel.h.patch b/target/linux/generic/backport-6.6/301-v6.9-kernel.h-removed-REPEAT_BYTE-from-kernel.h.patch
index adc924c09a..d76c562940 100644
--- a/target/linux/generic/backport-6.6/301-v6.9-kernel.h-removed-REPEAT_BYTE-from-kernel.h.patch
+++ b/target/linux/generic/backport-6.6/301-v6.9-kernel.h-removed-REPEAT_BYTE-from-kernel.h.patch
@@ -128,7 +128,7 @@ Signed-off-by: Kees Cook <keescook at chromium.org>
  #ifdef __BIG_ENDIAN
 --- a/include/linux/kernel.h
 +++ b/include/linux/kernel.h
-@@ -38,14 +38,6 @@
+@@ -39,14 +39,6 @@
  
  #define STACK_MAGIC	0xdeadbeef
  
diff --git a/target/linux/generic/backport-6.6/302-v6.9-kernel.h-Move-upper_-_bits-and-lower_-_bits-to-wordp.patch b/target/linux/generic/backport-6.6/302-v6.9-kernel.h-Move-upper_-_bits-and-lower_-_bits-to-wordp.patch
index b9c40e6206..48c58c1ca2 100644
--- a/target/linux/generic/backport-6.6/302-v6.9-kernel.h-Move-upper_-_bits-and-lower_-_bits-to-wordp.patch
+++ b/target/linux/generic/backport-6.6/302-v6.9-kernel.h-Move-upper_-_bits-and-lower_-_bits-to-wordp.patch
@@ -23,7 +23,7 @@ Signed-off-by: Kees Cook <keescook at chromium.org>
 
 --- a/include/linux/kernel.h
 +++ b/include/linux/kernel.h
-@@ -32,6 +32,8 @@
+@@ -33,6 +33,8 @@
  #include <linux/sprintf.h>
  #include <linux/static_call_types.h>
  #include <linux/instruction_pointer.h>
@@ -32,7 +32,7 @@ Signed-off-by: Kees Cook <keescook at chromium.org>
  #include <asm/byteorder.h>
  
  #include <uapi/linux/kernel.h>
-@@ -57,34 +59,6 @@
+@@ -52,34 +54,6 @@
  }					\
  )
  
diff --git a/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch b/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch
index a011cf8ffa..73e25f45cd 100644
--- a/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch
+++ b/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch
@@ -54,7 +54,7 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom  Fallback SP
  
 --- a/drivers/bcma/main.c
 +++ b/drivers/bcma/main.c
-@@ -671,6 +671,14 @@ static int __init bcma_modinit(void)
+@@ -677,6 +677,14 @@ static int __init bcma_modinit(void)
  {
  	int err;
  



From lede-commits at lists.infradead.org  Wed Dec  3 12:32:05 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 03 Dec 2025 15:32:05 -0500
Subject: [openwrt/openwrt]  kernel: add support for Fudan Micro FM25S01BI3
 SPI-NAND
In-Reply-To: <176479392447.58944.16748500844240365037@git-01.infra.openwrt.org>
References: <176479392447.58944.16748500844240365037@git-01.infra.openwrt.org>
Message-ID: <mailman.32922.1764793943.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/96a67d2f2eef8d1f0760bf826ab187fb6e75671b

commit 96a67d2f2eef8d1f0760bf826ab187fb6e75671b
Author: Mikhail Zhilkin <csharper2005 at gmail.com>
AuthorDate: Sat Nov 22 19:18:36 2025 +0300

    kernel: add support for Fudan Micro FM25S01BI3 SPI-NAND
    
    Add support for Fudan Micro FM25S01BI3 SPI NAND.
    Link: https://www.fmsh.com/nvm/FM25S01BI3_ds_eng.pdf
    
    Signed-off-by: Mikhail Zhilkin <csharper2005 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20872
    (cherry picked from commit 05cddcd12a9d401631f59953f78919c7e58d7b98)
    [Update patch path]
    Signed-off-by: Mikhail Zhilkin <csharper2005 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20974
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...and-add-support-for-FudanMicro-FM25S01BI3.patch | 117 +++++++++++++++++++++
 1 file changed, 117 insertions(+)

diff --git a/target/linux/generic/pending-6.6/403-mtd-spinand-add-support-for-FudanMicro-FM25S01BI3.patch b/target/linux/generic/pending-6.6/403-mtd-spinand-add-support-for-FudanMicro-FM25S01BI3.patch
new file mode 100644
index 0000000000..f35344233f
--- /dev/null
+++ b/target/linux/generic/pending-6.6/403-mtd-spinand-add-support-for-FudanMicro-FM25S01BI3.patch
@@ -0,0 +1,117 @@
+To: Miquel Raynal <miquel.raynal at bootlin.com>,
+ Richard Weinberger <richard at nod.at>, Vignesh Raghavendra <vigneshr at ti.com>,
+ Tudor Ambarus <tudor.ambarus at linaro.org>, Mark Brown <broonie at kernel.org>
+Cc: linux-kernel at vger.kernel.org, linux-mtd at lists.infradead.org
+From: Mikhail Zhilkin <csharper2005 at gmail.com>
+Subject: [PATCH] mtd: spinand: add support for FudanMicro FM25S01BI3
+
+Add support for FudanMicro FM25S01BI3 SPI NAND.
+
+Link: https://www.fmsh.com/nvm/FM25S01BI3_ds_eng.pdf
+
+Signed-off-by: Mikhail Zhilkin <csharper2005 at gmail.com>
+Link: https://lore.kernel.org/linux-mtd/130e0f3f-93e4-47cf-82f0-93ba58a3a670 at gmail.com
+---
+ drivers/mtd/nand/spi/fmsh.c | 72 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 72 insertions(+)
+
+--- a/drivers/mtd/nand/spi/fmsh.c
++++ b/drivers/mtd/nand/spi/fmsh.c
+@@ -9,6 +9,13 @@
+ #include <linux/kernel.h>
+ #include <linux/mtd/spinand.h>
+ 
++#define FM25S01BI3_STATUS_ECC_MASK		(7 << 4)
++	#define FM25S01BI3_STATUS_ECC_NO_BITFLIPS	(0 << 4)
++	#define FM25S01BI3_STATUS_ECC_1_3_BITFLIPS	(1 << 4)
++	#define FM25S01BI3_STATUS_ECC_UNCOR_ERROR	(2 << 4)
++	#define FM25S01BI3_STATUS_ECC_4_6_BITFLIPS	(3 << 4)
++	#define FM25S01BI3_STATUS_ECC_7_8_BITFLIPS	(5 << 4)
++
+ #define SPINAND_MFR_FMSH		0xA1
+ 
+ static SPINAND_OP_VARIANTS(read_cache_variants,
+@@ -45,11 +52,66 @@ static int fm25s01a_ooblayout_free(struc
+ 	return 0;
+ }
+ 
++static int fm25s01bi3_ecc_get_status(struct spinand_device *spinand,
++				     u8 status)
++{
++	switch (status & FM25S01BI3_STATUS_ECC_MASK) {
++	case FM25S01BI3_STATUS_ECC_NO_BITFLIPS:
++		return 0;
++
++	case FM25S01BI3_STATUS_ECC_UNCOR_ERROR:
++		return -EBADMSG;
++
++	case FM25S01BI3_STATUS_ECC_1_3_BITFLIPS:
++		return 3;
++
++	case FM25S01BI3_STATUS_ECC_4_6_BITFLIPS:
++		return 6;
++
++	case FM25S01BI3_STATUS_ECC_7_8_BITFLIPS:
++		return 8;
++
++	default:
++		break;
++	}
++
++	return -EINVAL;
++}
++
++static int fm25s01bi3_ooblayout_ecc(struct mtd_info *mtd, int section,
++				    struct mtd_oob_region *region)
++{
++	if (section)
++		return -ERANGE;
++
++	region->offset = 64;
++	region->length = 64;
++
++	return 0;
++}
++
++static int fm25s01bi3_ooblayout_free(struct mtd_info *mtd, int section,
++				     struct mtd_oob_region *region)
++{
++	if (section > 3)
++		return -ERANGE;
++
++	region->offset = (16 * section) + 4;
++	region->length = 12;
++
++	return 0;
++}
++
+ static const struct mtd_ooblayout_ops fm25s01a_ooblayout = {
+ 	.ecc = fm25s01a_ooblayout_ecc,
+ 	.free = fm25s01a_ooblayout_free,
+ };
+ 
++static const struct mtd_ooblayout_ops fm25s01bi3_ooblayout = {
++	.ecc = fm25s01bi3_ooblayout_ecc,
++	.free = fm25s01bi3_ooblayout_free,
++};
++
+ static const struct spinand_info fmsh_spinand_table[] = {
+ 	SPINAND_INFO("FM25S01A",
+ 		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xE4),
+@@ -60,6 +122,16 @@ static const struct spinand_info fmsh_sp
+ 					      &update_cache_variants),
+ 		     0,
+ 		     SPINAND_ECCINFO(&fm25s01a_ooblayout, NULL)),
++	SPINAND_INFO("FM25S01BI3",
++		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xd4),
++		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
++		     NAND_ECCREQ(8, 512),
++		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
++					      &write_cache_variants,
++					      &update_cache_variants),
++		     SPINAND_HAS_QE_BIT,
++		     SPINAND_ECCINFO(&fm25s01bi3_ooblayout,
++				      fm25s01bi3_ecc_get_status)),
+ };
+ 
+ static const struct spinand_manufacturer_ops fmsh_spinand_manuf_ops = {



From lede-commits at lists.infradead.org  Wed Dec  3 12:32:04 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 03 Dec 2025 15:32:04 -0500
Subject: [openwrt/openwrt]  kernel: fix QE bit for Fudan Micro FM25S01A
 SPI-NAND
In-Reply-To: <176479392447.58944.16748500844240365037@git-01.infra.openwrt.org>
References: <176479392447.58944.16748500844240365037@git-01.infra.openwrt.org>
Message-ID: <mailman.32923.1764793944.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/15601a545e1147f25ab53ecb971f4bcb08a4327d

commit 15601a545e1147f25ab53ecb971f4bcb08a4327d
Author: Mikhail Zhilkin <csharper2005 at gmail.com>
AuthorDate: Sat Nov 22 19:05:52 2025 +0300

    kernel: fix QE bit for Fudan Micro FM25S01A SPI-NAND
    
    According to datasheet (http://eng.fmsh.com/nvm/FM25S01A_ds_eng.pdf)
    there is no QE (Quad Enable) bit for FM25S01A flash, so remove it.
    
    Signed-off-by: Mikhail Zhilkin <csharper2005 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20872
    (cherry picked from commit 40fc91be6e9e0aa0038c0624ad39e3e70d264e53)
    [Update patch path and number]
    Signed-off-by: Mikhail Zhilkin <csharper2005 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20974
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...and-fmsh-remove-QE-bit-for-FM25S01A-flash.patch | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/target/linux/generic/backport-6.6/420-v6.19-mtd-spinand-fmsh-remove-QE-bit-for-FM25S01A-flash.patch b/target/linux/generic/backport-6.6/420-v6.19-mtd-spinand-fmsh-remove-QE-bit-for-FM25S01A-flash.patch
new file mode 100644
index 0000000000..7f9ec6aca4
--- /dev/null
+++ b/target/linux/generic/backport-6.6/420-v6.19-mtd-spinand-fmsh-remove-QE-bit-for-FM25S01A-flash.patch
@@ -0,0 +1,28 @@
+From a1d3bc606bf5c3b3ea811cc2019df6285d75b00f Mon Sep 17 00:00:00 2001
+From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Date: Mon, 3 Nov 2025 04:01:48 +0300
+Subject: [PATCH] mtd: spinand: fmsh: remove QE bit for FM25S01A flash
+
+According to datasheet (http://eng.fmsh.com/nvm/FM25S01A_ds_eng.pdf)
+there is no QE (Quad Enable) bit for FM25S01A flash, so remove it.
+
+Fixes: 5f284dc15ca86 ("mtd: spinand: add support for FudanMicro FM25S01A")
+Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Tested-by: Tianling Shen <cnsztl at gmail.com>
+Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
+Link: Link: https://lore.kernel.org/linux-mtd/176216634975.908445.2776312239779833518.b4-ty at bootlin.com
+---
+ drivers/mtd/nand/spi/fmsh.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mtd/nand/spi/fmsh.c
++++ b/drivers/mtd/nand/spi/fmsh.c
+@@ -58,7 +58,7 @@ static const struct spinand_info fmsh_sp
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+ 					      &write_cache_variants,
+ 					      &update_cache_variants),
+-		     SPINAND_HAS_QE_BIT,
++		     0,
+ 		     SPINAND_ECCINFO(&fm25s01a_ooblayout, NULL)),
+ };
+ 



From lede-commits at lists.infradead.org  Wed Dec  3 13:46:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 03 Dec 2025 16:46:43 -0500
Subject: [openwrt/openwrt]  mvebu: gl-mv1000: add devicetree patch for sdhci1
In-Reply-To: <176479840318.443417.11809199959796055501@git-01.infra.openwrt.org>
References: <176479840318.443417.11809199959796055501@git-01.infra.openwrt.org>
Message-ID: <mailman.32940.1764798407.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6f2325b23d2cfa28099c26c299ae774625f1872b

commit 6f2325b23d2cfa28099c26c299ae774625f1872b
Author: Mikhail Zadorozhnyi <zador.blood.stained+git at protonmail.com>
AuthorDate: Sun Oct 12 17:52:35 2025 +0300

    mvebu: gl-mv1000: add devicetree patch for sdhci1
    
    GL-MV1000 external SD controller was broken by a recent kernel update
    due to a mistake in Device Tree: "regulator-gpio" was defined without
    required "gpios" property.
    
    Removing this regulator definition from the device tree fixes this issue
    without any side effects so far.
    
    "main" branch uses upstream devicetree for this device, so add a kernel
    patch for the "mvebu" kernel family.
    
    Relevant discussions:
    https://github.com/openwrt/openwrt/issues/20309
    https://github.com/openwrt/openwrt/pull/20378
    
    Signed-off-by: Mikhail Zadorozhnyi <zador.blood.stained+git at protonmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20390
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 ...rm64-dts-marvell-glinet-mv1000-fix-sdhci1.patch | 53 ++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/target/linux/mvebu/patches-6.12/326-arm64-dts-marvell-glinet-mv1000-fix-sdhci1.patch b/target/linux/mvebu/patches-6.12/326-arm64-dts-marvell-glinet-mv1000-fix-sdhci1.patch
new file mode 100644
index 0000000000..78fe52dcd4
--- /dev/null
+++ b/target/linux/mvebu/patches-6.12/326-arm64-dts-marvell-glinet-mv1000-fix-sdhci1.patch
@@ -0,0 +1,53 @@
+From 5f20749c2dbbbc0f4f3c5bd1c4067388ab760960 Mon Sep 17 00:00:00 2001
+From: Mikhail Zadorozhnyi <zador.blood.stained+git at protonmail.com>
+Date: Sat, 11 Oct 2025 20:22:07 +0300
+Subject: [PATCH] arm64: dts: marvell: fix sdhci1 controller for gl-mv1000
+
+GL-MV1000 external SD controller was broken by a recent kernel update
+due to a mistake in Device Tree: "regulator-gpio" was defined without
+required "gpios" property.
+
+Since "no-1-8-v" property is also defined for this controller
+a switchable vqmmc-supply regulator performs no function - a fixed 3.3V
+IO voltage will always be used.
+
+This regulator definition was probably added by mistake from a Device
+Tree from another device.
+
+Remove incomplete vcc_sd_reg1 regulator definition to fix this issue.
+
+Signed-off-by: Mikhail Zadorozhnyi <zador.blood.stained+git at protonmail.com>
+---
+ .../boot/dts/marvell/armada-3720-gl-mv1000.dts     | 14 --------------
+ 1 file changed, 14 deletions(-)
+
+--- a/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
++++ b/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
+@@ -26,19 +26,6 @@
+ 		reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
+ 	};
+ 
+-	vcc_sd_reg1: regulator {
+-		compatible = "regulator-gpio";
+-		regulator-name = "vcc_sd1";
+-		regulator-min-microvolt = <1800000>;
+-		regulator-max-microvolt = <3300000>;
+-		regulator-boot-on;
+-
+-		gpios-states = <0>;
+-		states = <1800000 0x1
+-			3300000 0x0>;
+-		enable-active-high;
+-	};
+-
+ 	keys {
+ 		compatible = "gpio-keys";
+ 
+@@ -135,7 +122,6 @@
+ 	cd-gpios = <&gpionb 17 GPIO_ACTIVE_LOW>;
+ 	marvell,pad-type = "sd";
+ 	no-1-8-v;
+-	vqmmc-supply = <&vcc_sd_reg1>;
+ 	status = "okay";
+ };
+ 



From lede-commits at lists.infradead.org  Wed Dec  3 14:31:54 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 03 Dec 2025 17:31:54 -0500
Subject: [openwrt/openwrt]  treewide: Fix const compile errors
In-Reply-To: <176480111419.563528.9194258259498669201@git-01.infra.openwrt.org>
References: <176480111419.563528.9194258259498669201@git-01.infra.openwrt.org>
Message-ID: <mailman.32943.1764801153.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cd9229d06126e40226c01a7f354072bdf777f697

commit cd9229d06126e40226c01a7f354072bdf777f697
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Wed Dec 3 22:46:44 2025 +0100

    treewide: Fix const compile errors
    
    Fixes compile errors caused by static const arrays;
    
    The lantiq firmware is const now.
    
    ATTRIBUTE_GROUPS() does not take const.
    
    Fixes: 5b263f3360b ("treewide: add const to static arrays")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c               | 2 +-
 package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c                     | 2 +-
 package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c                  | 2 +-
 package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c                     | 2 +-
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c               | 2 +-
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c                     | 2 +-
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c                  | 2 +-
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c                     | 2 +-
 .../902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch      | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c
index 734fe29961..db40bbcaa6 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c
@@ -220,7 +220,7 @@ static inline void clear_share_buffer(void)
  *    int       --- 0:    Success
  *                  else:           Error Code
  */
-static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
+static inline int pp32_download_code(const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
 {
     volatile u32 *dest;
 
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c
index 28ac8f6c7a..e9949d6af3 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c
@@ -159,7 +159,7 @@ static inline void clear_share_buffer(void)
         IFX_REG_W32(0, p++);
 }
 
-static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
+static inline int pp32_download_code(const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
 {
     volatile u32 *dest;
 
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c
index 57a50e322d..81df6386fb 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c
@@ -106,7 +106,7 @@ static inline void reset_ppe(struct platform_device *pdev)
  *    int       --- 0:    Success
  *                  else:           Error Code
  */
-static inline int danube_pp32_download_code(u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
+static inline int danube_pp32_download_code(const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
 {
 	volatile u32 *dest;
 
diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c
index ffe079f3df..f6602db921 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c
@@ -91,7 +91,7 @@ static inline int vr9_reset_ppe(struct platform_device *pdev)
 	return 0;
 }
 
-static inline int vr9_pp32_download_code(int pp32, u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
+static inline int vr9_pp32_download_code(int pp32, const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
 {
 	unsigned int clr, set;
 	volatile u32 *dest;
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c
index 7548c6d357..541e3dc094 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c
@@ -219,7 +219,7 @@ static inline void clear_share_buffer(void)
  *    int       --- 0:    Success
  *                  else:           Error Code
  */
-static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
+static inline int pp32_download_code(const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
 {
     volatile u32 *dest;
 
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c
index e83268ee36..65a7140284 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c
@@ -242,7 +242,7 @@ static inline void clear_share_buffer(void)
  *    int       --- 0:    Success
  *                  else:           Error Code
  */
-static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
+static inline int pp32_download_code(const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
 {
     volatile u32 *dest;
 
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c
index ef20e9cb45..8ddf6f8274 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c
@@ -214,7 +214,7 @@ static inline void clear_share_buffer(void)
  *    int       --- 0:    Success
  *                  else:           Error Code
  */
-static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
+static inline int pp32_download_code(const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
 {
     volatile u32 *dest;
 
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c
index 10e71cb1d9..41a0bbbd9f 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c
@@ -202,7 +202,7 @@ static inline void clear_share_buffer(void)
  *    int       --- 0:    Success
  *                  else:           Error Code
  */
-static inline int pp32_download_code(int pp32, u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
+static inline int pp32_download_code(int pp32, const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
 {
     unsigned int clr, set;
     volatile u32 *dest;
diff --git a/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch b/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch
index e697a64066..6f99497c36 100644
--- a/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch
+++ b/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch
@@ -820,7 +820,7 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +static IEI_WT61P803_PUZZLE_ATTR_RW(power_loss_recovery, IEI_WT61P803_PUZZLE_POWER_LOSS_RECOVERY, 0);
 +static IEI_WT61P803_PUZZLE_ATTR_RO(power_status, IEI_WT61P803_PUZZLE_POWER_STATUS, 0);
 +
-+static const struct attribute *iei_wt61p803_puzzle_attrs[] = {
++static struct attribute *iei_wt61p803_puzzle_attrs[] = {
 +	&dev_attr_version.dev_attr.attr,
 +	&dev_attr_build_info.dev_attr.attr,
 +	&dev_attr_bootloader_mode.dev_attr.attr,



From lede-commits at lists.infradead.org  Wed Dec  3 23:47:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 02:47:24 -0500
Subject: [openwrt/openwrt]  odhcpd: update to Git HEAD (2025-12-01)
In-Reply-To: <176483444411.3083540.8403096565668698416@git-01.infra.openwrt.org>
References: <176483444411.3083540.8403096565668698416@git-01.infra.openwrt.org>
Message-ID: <mailman.33027.1764834453.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/316a85ed91aac42d3ca6e47c15b0affee3e6e637

commit 316a85ed91aac42d3ca6e47c15b0affee3e6e637
Author: Goetz Goerisch <ggoerisch at gmail.com>
AuthorDate: Mon Dec 1 11:33:11 2025 +0100

    odhcpd: update to Git HEAD (2025-12-01)
    
    338ca8abb950 dhcpv4: support IPv6-only preferred (RFC8925)
    7336992e6866 dhcpv6-ia: fix a crash when static lease isn't configured
    a170d63874f2 src: fix shadowed local variables
    90f503fc7ca6 ubus: fix shadow local variable
    ef8de928da7f build: enable DHCPV4_SUPPORT and UBUS
    def8adea9e6c statefiles: remove hosts entries from statefile
    e568bde96e9f odhcpd: remove OAF_BROKEN_HOSTNAME
    1fe60e14e468 odhcpd: remove OAF_STATIC
    9ae348c07ce0 dhcpv6: remove OAF_TENTATIVE
    d0e6bc4d1cc2 odhcpd: remove OAF_BOUND
    7fddd3916664 statefiles: change ipv4 MAC statefile syntax
    bb2da6dcb58d build: fix BUILD_ARGS
    94ef124f726e dhcpv6-ia: fix crash in dhcpv6_free_lease()
    6fbd70c08342 build: disable static libraries
    
    https://github.com/openwrt/odhcpd/compare/d21e504b38ab...6fbd70c08342
    
    Signed-off-by: Goetz Goerisch <ggoerisch at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21009
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/services/odhcpd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 74266b21c8..2a0e421f3b 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=1b9d5324c377f99e2cec3a92a71e9e979a1e4cf16023fea59b5799bcbdbb36d5
-PKG_SOURCE_DATE:=2025-11-27
-PKG_SOURCE_VERSION:=d21e504b38ab4c880c43b7f1649104bb2f0d2d8b
+PKG_MIRROR_HASH:=cddf1a82865e1a064ff7aaf7b86e6ba076387f8717c95a0a0f0e49cebdd60dfd
+PKG_SOURCE_DATE:=2025-12-01
+PKG_SOURCE_VERSION:=6fbd70c0834279f5836585a90d7c957fbb23a7e5
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Thu Dec  4 02:06:51 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 05:06:51 -0500
Subject: [openwrt/openwrt]  rpcd: update to Git HEAD (2025-12-03)
In-Reply-To: <176484281146.3540823.15052845558469319364@git-01.infra.openwrt.org>
References: <176484281146.3540823.15052845558469319364@git-01.infra.openwrt.org>
Message-ID: <mailman.33073.1764842817.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/af853d3d38f7d7bd498de976ed6b04e6875ec320

commit af853d3d38f7d7bd498de976ed6b04e6875ec320
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Thu Dec 4 11:05:43 2025 +0100

    rpcd: update to Git HEAD (2025-12-03)
    
    a284e7751fa7 file: bump sz_size to 64 bits
    ffb9961c1f8b file: provide user name and group name lookups for stat listings
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/system/rpcd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile
index 22e73f21fc..593eb3a84a 100644
--- a/package/system/rpcd/Makefile
+++ b/package/system/rpcd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
-PKG_MIRROR_HASH:=b7b813e0b76f586bfe3432ef94883bd1b079c48003666a2128fbf028109a1a65
-PKG_SOURCE_DATE:=2025-11-10
-PKG_SOURCE_VERSION:=483263c7b0cd3922b93be2cf9dad5eeccbb9fedb
+PKG_MIRROR_HASH:=1a701b15746f34eb19532f195d738611364a18acaf45c0197626c31ab59976ce
+PKG_SOURCE_DATE:=2025-12-03
+PKG_SOURCE_VERSION:=ffb9961c1f8bc50830fdd4e144570f11062c2601
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 
 PKG_LICENSE:=ISC



From lede-commits at lists.infradead.org  Thu Dec  4 03:09:01 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 06:09:01 -0500
Subject: [openwrt/openwrt]  qca-nss-dp: update to Git HEAD (2025-11-24)
In-Reply-To: <176484654173.3862849.16000107713519003294@git-01.infra.openwrt.org>
References: <176484654173.3862849.16000107713519003294@git-01.infra.openwrt.org>
Message-ID: <mailman.33087.1764846547.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1db4155aa96d6f9ab372d4675f5db6be6a4e726f

commit 1db4155aa96d6f9ab372d4675f5db6be6a4e726f
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Thu Dec 4 11:31:01 2025 +0100

    qca-nss-dp: update to Git HEAD (2025-11-24)
    
    cdedfd891bdf nss-dp: fix hardware STP state sync with the kernel
    19c51af0c5be nss-dp: switchdev: improve FDB cleanup for roaming
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/kernel/qca-nss-dp/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/kernel/qca-nss-dp/Makefile b/package/kernel/qca-nss-dp/Makefile
index eee9c767ce..4d90281731 100644
--- a/package/kernel/qca-nss-dp/Makefile
+++ b/package/kernel/qca-nss-dp/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=https://github.com/openwrt/qca-nss-dp.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2025-05-12
-PKG_SOURCE_VERSION:=07b87bf513ffe58ce8dd00eb2edf68b5b9bde518
-PKG_MIRROR_HASH:=795ffccf1f4d61b6a5e0a6964ce21efa7b7b3c73b31b93140c56af7d970293b9
+PKG_SOURCE_DATE:=2025-11-24
+PKG_SOURCE_VERSION:=19c51af0c5be0afcbd57a9e0e50928759d7d08da
+PKG_MIRROR_HASH:=96aafb7c8f09ecde036ed706535111368874b06cd412a7b9df950415e5b4b334
 
 PKG_BUILD_PARALLEL:=1
 PKG_FLAGS:=nonshared



From lede-commits at lists.infradead.org  Thu Dec  4 03:16:02 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 06:16:02 -0500
Subject: [openwrt/openwrt]  busybox: fix regression for long long type dump
 support
In-Reply-To: <176484696275.3896244.11710585075916166040@git-01.infra.openwrt.org>
References: <176484696275.3896244.11710585075916166040@git-01.infra.openwrt.org>
Message-ID: <mailman.33090.1764846997.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9c6dbb0e3d6c165c4924dd4ab10b27778a8c520c

commit 9c6dbb0e3d6c165c4924dd4ab10b27778a8c520c
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Tue Dec 2 00:06:45 2025 +0800

    busybox: fix regression for long long type dump support
    
    Fix wrong output using '%d' format when byte count parameter is not
    given.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21013
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/utils/busybox/Makefile                     |  2 +-
 ...fix-dumping-of-signed-values-without-expl.patch | 68 ++++++++++++++++++++++
 2 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 63c1dceee3..e5b7c2c780 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.37.0
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/package/utils/busybox/patches/100-libbb-dump-fix-dumping-of-signed-values-without-expl.patch b/package/utils/busybox/patches/100-libbb-dump-fix-dumping-of-signed-values-without-expl.patch
new file mode 100644
index 0000000000..665dc6042c
--- /dev/null
+++ b/package/utils/busybox/patches/100-libbb-dump-fix-dumping-of-signed-values-without-expl.patch
@@ -0,0 +1,68 @@
+From: Sven Wegener <sven.wegener at stealer.net>
+Subject: [PATCH] libbb/dump: fix dumping of signed values without explicit
+ size specifier
+
+Message-ID: <05d87e73-d0e0-d9ef-561a-8a9180888627 at stealer.net>
+
+Commit e2287f99fe6f21fd6435ad04340170ad4ba5f6b3 added support for the 64
+bit signed format %lld, accidentally changing the default size of the %d
+format to eight bytes and producing the following:
+
+root at openwrt:~# for i in $(seq 0 7); do hexdump -s $i -n 1 -e '"%d\n"' /dev/mtdblock0; done
+0
+0
+0
+0
+0
+0
+0
+0
+root at openwrt:~# for i in $(seq 0 7); do hexdump -s $i -n 1 -e '/4 "%d\n"' /dev/mtdblock0; done
+255
+0
+0
+16
+0
+0
+0
+0
+
+With -n 1 the input is zero-padded. On big-endian, when the input is copied
+into the 64 bit variable, the input byte ends up in the highest byte. As the %d
+format only interprets the lower 32 bits, the input byte is lost during
+printing.
+
+Depending on how the architecture passes 64 bit parameters, the same
+happens on little-endian as well. x86 (little-endian) works correctly,
+but MIPS experiences the same behavior on big-endian and little-endian.
+
+Fixes: e2287f99fe6f21fd6435ad04340170ad4ba5f6b3
+See: https://github.com/openwrt/openwrt/issues/18808
+Signed-off-by: Sven Wegener <sven.wegener at stealer.net>
+---
+ libbb/dump.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/libbb/dump.c
++++ b/libbb/dump.c
+@@ -192,16 +192,17 @@ static NOINLINE void rewrite(priv_dumper
+ 				if (*p1 == 'l') { /* %lld etc */
+ 					++p2;
+ 					++p1;
+-				}
++					byte_count_str = "\010\004\002\001";
++				} else {
+  DO_INT_CONV:
++					byte_count_str = "\004\002\001";
++				}
+ 				e = strchr(int_convs, *p1); /* "diouxX"? */
+ 				if (!e)
+ 					goto DO_BAD_CONV_CHAR;
+ 				pr->flags = F_INT;
+-				byte_count_str = "\010\004\002\001";
+ 				if (e > int_convs + 1) { /* not d or i? */
+ 					pr->flags = F_UINT;
+-					byte_count_str++;
+ 				}
+ 				goto DO_BYTE_COUNT;
+ 			} else



From lede-commits at lists.infradead.org  Thu Dec  4 07:36:07 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 10:36:07 -0500
Subject: [openwrt/openwrt]  tools: gnulib: fix broken install of .m4 files
In-Reply-To: <176486256707.970042.3318887231869525765@git-01.infra.openwrt.org>
References: <176486256707.970042.3318887231869525765@git-01.infra.openwrt.org>
Message-ID: <mailman.33142.1764862571.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/78a8cfb57772138ff5b925b9d69928e5878931bf

commit 78a8cfb57772138ff5b925b9d69928e5878931bf
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 4 16:32:03 2025 +0100

    tools: gnulib: fix broken install of .m4 files
    
    Makefile foreach works only on parsing the Makefile and in this specific
    case only works if the package is already extracted and file actually
    exist.
    
    On scenario where the package still has to be built, foreach doesn't
    find any file causing Host/Install to not install any .m4 file.
    
    To handle this, use a shell for loop that scan files in the
    Host/install.
    
    Fixes: c820f097e0be ("tools: gnulib: install .m4 file with gl_ prefix")
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 tools/gnulib/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/gnulib/Makefile b/tools/gnulib/Makefile
index 018ff5db14..0b28d73d13 100644
--- a/tools/gnulib/Makefile
+++ b/tools/gnulib/Makefile
@@ -20,8 +20,10 @@ endef
 define Host/Install
 	$(call Host/Uninstall)
 	$(INSTALL_DIR) $(1)/share/aclocal
-	$(foreach m4,$(notdir $(wildcard $(HOST_BUILD_DIR)/m4/*.m4)),
-		$(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/$(m4) $(1)/share/aclocal/gl_$(m4))
+	for m4 in $(HOST_BUILD_DIR)/m4/*.m4; do \
+		$(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/$$$$(basename $$$$m4) \
+				$(1)/share/aclocal/gl_$$$$(basename $$$$m4); \
+	done
 	$(CP) $(HOST_BUILD_DIR)/ $(1)/share/gnulib/
 	ln -sf ../share/gnulib/gnulib-tool $(STAGING_DIR_HOST)/bin/gnulib-tool
 endef



From lede-commits at lists.infradead.org  Thu Dec  4 10:23:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 13:23:38 -0500
Subject: [openwrt/openwrt]  sdk: use GIT_COMMIT for buildbot SDK
In-Reply-To: <176487261675.1508814.409031708751725781@git-01.infra.openwrt.org>
References: <176487261675.1508814.409031708751725781@git-01.infra.openwrt.org>
Message-ID: <mailman.33194.1764872621.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6c94b53f110da02e2972a8023ad8622931373b04

commit 6c94b53f110da02e2972a8023ad8622931373b04
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 4 19:20:55 2025 +0100

    sdk: use GIT_COMMIT for buildbot SDK
    
    Instead of using tag name, directly use git commit for the base feed
    string if we detect we are generating an SDK from a buildbot (using
    CONFIG_BUILDBOT)
    
    This improve security and generates consistent feed.conf.default files
    following the pattern used by feeds repository.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/sdk/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index 537e56382c..4da9a5dbe9 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -44,10 +44,10 @@ GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null)
 GIT_BRANCH:=$(filter-out master main HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
 GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }')
 
-BASE_FEED:=$(if $(GIT_URL),src-git --root=package base $(GIT_URL)$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH))))
+BASE_FEED:=$(if $(GIT_URL),src-git --root=package base $(GIT_URL)$(if $(CONFIG_BUILDBOT),^$(GIT_COMMIT),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH)))))
 BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn --root=package base /p'))
 BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn --root=package base /p'))
-BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git --root=package base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH))))
+BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git --root=package base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(CONFIG_BUILDBOT),^$(GIT_COMMIT),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH)))))
 
 KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR))
 KDIR_ARCHES = $(LINUX_KARCH)



From lede-commits at lists.infradead.org  Thu Dec  4 10:23:36 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 13:23:36 -0500
Subject: [openwrt/openwrt]  sdk: filter out main on GIT_BRANCH parsing
In-Reply-To: <176487261675.1508814.409031708751725781@git-01.infra.openwrt.org>
References: <176487261675.1508814.409031708751725781@git-01.infra.openwrt.org>
Message-ID: <mailman.33197.1764872622.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0338dd44d5755fdd9bd38ce18e823cc024979240

commit 0338dd44d5755fdd9bd38ce18e823cc024979240
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 4 19:08:08 2025 +0100

    sdk: filter out main on GIT_BRANCH parsing
    
    Branch named main was never filter out on parsing the GIT_BRANCH define.
    
    Add main to the name of branch that should be filtered.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/sdk/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index d2daa06902..0e91778238 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -41,7 +41,7 @@ SDK_DIRS = \
 GIT_URL:=$(shell git config --get remote.origin.url 2>/dev/null)
 GIT_URL:=$(if $(CONFIG_BUILDBOT),$(filter git://% http://% https://%,$(GIT_URL)),$(GIT_URL))
 GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null)
-GIT_BRANCH:=$(filter-out master HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
+GIT_BRANCH:=$(filter-out master main HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
 GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }')
 
 BASE_FEED:=$(if $(GIT_URL),src-git --root=package base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))



From lede-commits at lists.infradead.org  Thu Dec  4 10:23:37 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 13:23:37 -0500
Subject: [openwrt/openwrt]  sdk: invert logic for GIT_BRANCH and GIT_TAGNAME
In-Reply-To: <176487261675.1508814.409031708751725781@git-01.infra.openwrt.org>
References: <176487261675.1508814.409031708751725781@git-01.infra.openwrt.org>
Message-ID: <mailman.33198.1764872624.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/289172b00e7193df8a2afa1eee54b43148470698

commit 289172b00e7193df8a2afa1eee54b43148470698
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 4 19:11:17 2025 +0100

    sdk: invert logic for GIT_BRANCH and GIT_TAGNAME
    
    There is currently a logic error with generating the base feed string.
    
    In the scenario where the commit of a Tag match the latest commit of a
    stable branch, the stable branch have priority over the tag name.
    
    This results in generating SDK that actually target the branch instead
    of the specific tag.
    
    To fix this invert the logic and give priority to the tag name.
    
    Fixes: #18583
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/sdk/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index 0e91778238..537e56382c 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -44,10 +44,10 @@ GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null)
 GIT_BRANCH:=$(filter-out master main HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
 GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }')
 
-BASE_FEED:=$(if $(GIT_URL),src-git --root=package base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
+BASE_FEED:=$(if $(GIT_URL),src-git --root=package base $(GIT_URL)$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH))))
 BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn --root=package base /p'))
 BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn --root=package base /p'))
-BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git --root=package base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
+BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git --root=package base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH))))
 
 KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR))
 KDIR_ARCHES = $(LINUX_KARCH)



From lede-commits at lists.infradead.org  Thu Dec  4 10:26:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 13:26:20 -0500
Subject: [openwrt/openwrt]  sdk: invert logic for GIT_BRANCH and GIT_TAGNAME
In-Reply-To: <176487277988.1526465.13071825605265875230@git-01.infra.openwrt.org>
References: <176487277988.1526465.13071825605265875230@git-01.infra.openwrt.org>
Message-ID: <mailman.33199.1764872784.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/d0c2c30e5072cc917599a2d8b328a5c6560326c7

commit d0c2c30e5072cc917599a2d8b328a5c6560326c7
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 4 19:11:17 2025 +0100

    sdk: invert logic for GIT_BRANCH and GIT_TAGNAME
    
    There is currently a logic error with generating the base feed string.
    
    In the scenario where the commit of a Tag match the latest commit of a
    stable branch, the stable branch have priority over the tag name.
    
    This results in generating SDK that actually target the branch instead
    of the specific tag.
    
    To fix this invert the logic and give priority to the tag name.
    
    Fixes: #18583
    (cherry picked from commit 289172b00e7193df8a2afa1eee54b43148470698)
    [ fix conflict error ]
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/sdk/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index da1fb949ef..48b8833ffe 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -44,10 +44,10 @@ GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null)
 GIT_BRANCH:=$(filter-out master main HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
 GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }')
 
-BASE_FEED:=$(if $(GIT_URL),src-git-full base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
+BASE_FEED:=$(if $(GIT_URL),src-git-full base $(GIT_URL)$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH))))
 BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn base /p'))
 BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn base /p'))
-BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git-full base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
+BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git-full base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH))))
 
 KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR))
 KDIR_ARCHES = $(LINUX_KARCH)



From lede-commits at lists.infradead.org  Thu Dec  4 10:26:19 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 13:26:19 -0500
Subject: [openwrt/openwrt]  sdk: filter out main on GIT_BRANCH parsing
In-Reply-To: <176487277988.1526465.13071825605265875230@git-01.infra.openwrt.org>
References: <176487277988.1526465.13071825605265875230@git-01.infra.openwrt.org>
Message-ID: <mailman.33200.1764872789.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/9c23ecf31cf5edd413916edb5c133de1e2b6d04b

commit 9c23ecf31cf5edd413916edb5c133de1e2b6d04b
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 4 19:08:08 2025 +0100

    sdk: filter out main on GIT_BRANCH parsing
    
    Branch named main was never filter out on parsing the GIT_BRANCH define.
    
    Add main to the name of branch that should be filtered.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
    (cherry picked from commit 0338dd44d5755fdd9bd38ce18e823cc024979240)
---
 target/sdk/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index a2eb35c1d4..da1fb949ef 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -41,7 +41,7 @@ SDK_DIRS = \
 GIT_URL:=$(shell git config --get remote.origin.url 2>/dev/null)
 GIT_URL:=$(if $(CONFIG_BUILDBOT),$(filter git://% http://% https://%,$(GIT_URL)),$(GIT_URL))
 GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null)
-GIT_BRANCH:=$(filter-out master HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
+GIT_BRANCH:=$(filter-out master main HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
 GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }')
 
 BASE_FEED:=$(if $(GIT_URL),src-git-full base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))



From lede-commits at lists.infradead.org  Thu Dec  4 10:30:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 13:30:29 -0500
Subject: [openwrt/openwrt]  generic: 6.12: backport b53 fixes for BCM5325
In-Reply-To: <176487302941.1552004.10076151925901108405@git-01.infra.openwrt.org>
References: <176487302941.1552004.10076151925901108405@git-01.infra.openwrt.org>
Message-ID: <mailman.33201.1764873034.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4814636b9b3942c9dd5f9e90e8d65735d9e3f965

commit 4814636b9b3942c9dd5f9e90e8d65735d9e3f965
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Tue Dec 2 09:18:48 2025 +0100

    generic: 6.12: backport b53 fixes for BCM5325
    
    Replace pending b53 fixes patches with the accepted ones from net-next for
    linux v6.19.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 ...cm531x5-fix-cpu-rgmii-mode-interpretation.patch |   4 +-
 ...ix-VLAN_ID_IDX-write-size-for-BCM5325-65.patch} |  11 +-
 ...extracting-VID-from-entry-for-BCM5325-65.patch} |  11 +-
 ...-ARL-search-result-offset-for-BCM5325-65.patch} |  11 +-
 ...-port-unicast-ARL-entries-for-BCM5325-65.patch} |  11 +-
 ...CM5325-65-ARL-entry-multicast-port-masks.patch} |  11 +-
 ...et-dsa-b53-fix-BCM5325-65-ARL-entry-VIDs.patch} |   9 +-
 ...19-net-dsa-b53-allow-VID-0-for-BCM5325-65.patch |  44 ++++++
 ...07-net-dsa-b53-allow-VID-0-for-BCM5325-65.patch | 175 ---------------------
 9 files changed, 93 insertions(+), 194 deletions(-)

diff --git a/target/linux/bmips/patches-6.12/110-net-dsa-b53-bcm531x5-fix-cpu-rgmii-mode-interpretation.patch b/target/linux/bmips/patches-6.12/110-net-dsa-b53-bcm531x5-fix-cpu-rgmii-mode-interpretation.patch
index abf19408a2..b1614eba44 100644
--- a/target/linux/bmips/patches-6.12/110-net-dsa-b53-bcm531x5-fix-cpu-rgmii-mode-interpretation.patch
+++ b/target/linux/bmips/patches-6.12/110-net-dsa-b53-bcm531x5-fix-cpu-rgmii-mode-interpretation.patch
@@ -58,7 +58,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
 +	  the phy interface, but actually requires internal delays enabled.
 --- a/drivers/net/dsa/b53/b53_common.c
 +++ b/drivers/net/dsa/b53/b53_common.c
-@@ -1434,6 +1434,16 @@ static void b53_adjust_531x5_rgmii(struc
+@@ -1444,6 +1444,16 @@ static void b53_adjust_531x5_rgmii(struc
  	else
  		off = B53_RGMII_CTRL_P(port);
  
@@ -75,7 +75,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
  	/* Configure the port RGMII clock delay by DLL disabled and
  	 * tx_clk aligned timing (restoring to reset defaults)
  	 */
-@@ -1445,19 +1455,24 @@ static void b53_adjust_531x5_rgmii(struc
+@@ -1455,19 +1465,24 @@ static void b53_adjust_531x5_rgmii(struc
  	 * account for this internal delay that is inserted, otherwise
  	 * the switch won't be able to receive correctly.
  	 *
diff --git a/target/linux/generic/pending-6.12/750-01-net-dsa-b53-fix-VLAN_ID_IDX-write-size-for-BCM5325-65.patch b/target/linux/generic/backport-6.12/613-01-v6.19-net-dsa-b53-fix-VLAN_ID_IDX-write-size-for-BCM5325-65.patch
similarity index 71%
rename from target/linux/generic/pending-6.12/750-01-net-dsa-b53-fix-VLAN_ID_IDX-write-size-for-BCM5325-65.patch
rename to target/linux/generic/backport-6.12/613-01-v6.19-net-dsa-b53-fix-VLAN_ID_IDX-write-size-for-BCM5325-65.patch
index 6d5131d4b5..d953ea7545 100644
--- a/target/linux/generic/pending-6.12/750-01-net-dsa-b53-fix-VLAN_ID_IDX-write-size-for-BCM5325-65.patch
+++ b/target/linux/generic/backport-6.12/613-01-v6.19-net-dsa-b53-fix-VLAN_ID_IDX-write-size-for-BCM5325-65.patch
@@ -1,13 +1,20 @@
-From 36ee43df98b0ac16bb73e62fa8cffcdf710c37e4 Mon Sep 17 00:00:00 2001
+From 6f268e275c74dae0536e0b61982a8db25bcf4f16 Mon Sep 17 00:00:00 2001
 From: Jonas Gorski <jonas.gorski at gmail.com>
-Date: Tue, 25 Nov 2025 08:51:44 +0100
+Date: Fri, 28 Nov 2025 09:06:19 +0100
 Subject: [PATCH] net: dsa: b53: fix VLAN_ID_IDX write size for BCM5325/65
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
 Since BCM5325 and BCM5365 only support up to 256 VLANs, the VLAN_ID_IDX
 register is only 8 bit wide, not 16 bit, so use an appropriate accessor.
 
 Fixes: c45655386e53 ("net: dsa: b53: add support for FDB operations on 5325/5365")
+Reviewed-by: Florian Fainelli <florian.fainelli at broadcom.com>
+Tested-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
 Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+Link: https://patch.msgid.link/20251128080625.27181-2-jonas.gorski at gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 ---
  drivers/net/dsa/b53/b53_common.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/target/linux/generic/pending-6.12/750-02-net-dsa-b53-fix-extracting-VID-from-entry-for-BCM5325-65.patch b/target/linux/generic/backport-6.12/613-02-v6.19-net-dsa-b53-fix-extracting-VID-from-entry-for-BCM5325-65.patch
similarity index 69%
rename from target/linux/generic/pending-6.12/750-02-net-dsa-b53-fix-extracting-VID-from-entry-for-BCM5325-65.patch
rename to target/linux/generic/backport-6.12/613-02-v6.19-net-dsa-b53-fix-extracting-VID-from-entry-for-BCM5325-65.patch
index 54db56df21..72f81d020f 100644
--- a/target/linux/generic/pending-6.12/750-02-net-dsa-b53-fix-extracting-VID-from-entry-for-BCM5325-65.patch
+++ b/target/linux/generic/backport-6.12/613-02-v6.19-net-dsa-b53-fix-extracting-VID-from-entry-for-BCM5325-65.patch
@@ -1,7 +1,10 @@
-From 2bed2d0932c37d6cae9a745613c2e8f83649ed39 Mon Sep 17 00:00:00 2001
+From 9316012dd01952f75e37035360138ccc786ef727 Mon Sep 17 00:00:00 2001
 From: Jonas Gorski <jonas.gorski at gmail.com>
-Date: Tue, 25 Nov 2025 08:51:45 +0100
+Date: Fri, 28 Nov 2025 09:06:20 +0100
 Subject: [PATCH] net: dsa: b53: fix extracting VID from entry for BCM5325/65
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
 BCM5325/65's Entry register uses the highest three bits for
 VALID/STATIC/AGE, so shifting by 53 only will add these to
@@ -10,7 +13,11 @@ b53_arl_entry::vid.
 So make sure to mask the vid value as well, to not get invalid VIDs.
 
 Fixes: c45655386e53 ("net: dsa: b53: add support for FDB operations on 5325/5365")
+Reviewed-by: Florian Fainelli <florian.fainelli at broadcom.com>
+Tested-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
 Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+Link: https://patch.msgid.link/20251128080625.27181-3-jonas.gorski at gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 ---
  drivers/net/dsa/b53/b53_priv.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/linux/generic/pending-6.12/750-03-net-dsa-b53-use-same-ARL-search-result-offset-for-BCM5325-65.patch b/target/linux/generic/backport-6.12/613-03-v6.19-net-dsa-b53-use-same-ARL-search-result-offset-for-BCM5325-65.patch
similarity index 84%
rename from target/linux/generic/pending-6.12/750-03-net-dsa-b53-use-same-ARL-search-result-offset-for-BCM5325-65.patch
rename to target/linux/generic/backport-6.12/613-03-v6.19-net-dsa-b53-use-same-ARL-search-result-offset-for-BCM5325-65.patch
index 8c4bb03cf0..4852df50be 100644
--- a/target/linux/generic/pending-6.12/750-03-net-dsa-b53-use-same-ARL-search-result-offset-for-BCM5325-65.patch
+++ b/target/linux/generic/backport-6.12/613-03-v6.19-net-dsa-b53-use-same-ARL-search-result-offset-for-BCM5325-65.patch
@@ -1,14 +1,21 @@
-From 8d2f3f0e87fe526686f7a2744bf965ce4e99ae41 Mon Sep 17 00:00:00 2001
+From 8e46aacea4264bcb8d4265fb07577afff58ae78d Mon Sep 17 00:00:00 2001
 From: Jonas Gorski <jonas.gorski at gmail.com>
-Date: Tue, 25 Nov 2025 08:51:46 +0100
+Date: Fri, 28 Nov 2025 09:06:21 +0100
 Subject: [PATCH] net: dsa: b53: use same ARL search result offset for BCM5325/65
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
 BCM5365's search result is at the same offset as BCM5325's search
 result, and they (mostly) share the same format, so switch BCM5365 to
 BCM5325's arl ops.
 
 Fixes: c45655386e53 ("net: dsa: b53: add support for FDB operations on 5325/5365")
+Reviewed-by: Florian Fainelli <florian.fainelli at broadcom.com>
+Tested-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
 Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+Link: https://patch.msgid.link/20251128080625.27181-4-jonas.gorski at gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 ---
  drivers/net/dsa/b53/b53_common.c | 18 +-----------------
  drivers/net/dsa/b53/b53_regs.h   |  4 +---
diff --git a/target/linux/generic/pending-6.12/750-04-net-dsa-b53-fix-CPU-port-unicast-ARL-entries-for-BCM5325-65.patch b/target/linux/generic/backport-6.12/613-04-v6.19-net-dsa-b53-fix-CPU-port-unicast-ARL-entries-for-BCM5325-65.patch
similarity index 80%
rename from target/linux/generic/pending-6.12/750-04-net-dsa-b53-fix-CPU-port-unicast-ARL-entries-for-BCM5325-65.patch
rename to target/linux/generic/backport-6.12/613-04-v6.19-net-dsa-b53-fix-CPU-port-unicast-ARL-entries-for-BCM5325-65.patch
index 47cfb01cc2..3748892ca8 100644
--- a/target/linux/generic/pending-6.12/750-04-net-dsa-b53-fix-CPU-port-unicast-ARL-entries-for-BCM5325-65.patch
+++ b/target/linux/generic/backport-6.12/613-04-v6.19-net-dsa-b53-fix-CPU-port-unicast-ARL-entries-for-BCM5325-65.patch
@@ -1,6 +1,6 @@
-From d0d7daf6e051f8795e4e1b759ff5055c80a85832 Mon Sep 17 00:00:00 2001
+From 85132103f700b1340fc17df8a981509d17bf4872 Mon Sep 17 00:00:00 2001
 From: Jonas Gorski <jonas.gorski at gmail.com>
-Date: Tue, 25 Nov 2025 08:51:47 +0100
+Date: Fri, 28 Nov 2025 09:06:22 +0100
 Subject: [PATCH] net: dsa: b53: fix CPU port unicast ARL entries for BCM5325/65
 
 On BCM5325 and BCM5365, unicast ARL entries use 8 as the value for the
@@ -9,6 +9,9 @@ at most other places.
 
 Fixes: c45655386e53 ("net: dsa: b53: add support for FDB operations on 5325/5365")
 Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+Reviewed-by: Florian Fainelli <florian.fainelli at broadcom.com>
+Link: https://patch.msgid.link/20251128080625.27181-5-jonas.gorski at gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 ---
  drivers/net/dsa/b53/b53_priv.h | 13 +++++++++----
  1 file changed, 9 insertions(+), 4 deletions(-)
@@ -27,7 +30,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
  	u64_to_ether_addr(mac_vid, ent->mac);
 +	ent->port = (mac_vid >> ARLTBL_DATA_PORT_ID_S_25) &
 +		     ARLTBL_DATA_PORT_ID_MASK_25;
-+	if (!is_multicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT)
++	if (is_unicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT)
 +		ent->port = B53_CPU_PORT_25;
  	ent->vid = (mac_vid >> ARLTBL_VID_S_65) & ARLTBL_VID_MASK_25;
  }
@@ -38,7 +41,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
  	*mac_vid = ether_addr_to_u64(ent->mac);
 -	*mac_vid |= (u64)(ent->port & ARLTBL_DATA_PORT_ID_MASK_25) <<
 -			  ARLTBL_DATA_PORT_ID_S_25;
-+	if (!is_multicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT_25)
++	if (is_unicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT_25)
 +		*mac_vid |= (u64)B53_CPU_PORT << ARLTBL_DATA_PORT_ID_S_25;
 +	else
 +		*mac_vid |= (u64)(ent->port & ARLTBL_DATA_PORT_ID_MASK_25) <<
diff --git a/target/linux/generic/pending-6.12/750-05-net-dsa-b53-fix-BCM5325-65-ARL-entry-multicast-port-masks.patch b/target/linux/generic/backport-6.12/613-05-v6.19-net-dsa-b53-fix-BCM5325-65-ARL-entry-multicast-port-masks.patch
similarity index 91%
rename from target/linux/generic/pending-6.12/750-05-net-dsa-b53-fix-BCM5325-65-ARL-entry-multicast-port-masks.patch
rename to target/linux/generic/backport-6.12/613-05-v6.19-net-dsa-b53-fix-BCM5325-65-ARL-entry-multicast-port-masks.patch
index 59016c13f4..c0f5b5d600 100644
--- a/target/linux/generic/pending-6.12/750-05-net-dsa-b53-fix-BCM5325-65-ARL-entry-multicast-port-masks.patch
+++ b/target/linux/generic/backport-6.12/613-05-v6.19-net-dsa-b53-fix-BCM5325-65-ARL-entry-multicast-port-masks.patch
@@ -1,6 +1,6 @@
-From 0a215e4d8da0c5e36ee29304879a111daff5b461 Mon Sep 17 00:00:00 2001
+From 3b08863469aa6028ac7c3120966f4e2f6051cf6b Mon Sep 17 00:00:00 2001
 From: Jonas Gorski <jonas.gorski at gmail.com>
-Date: Tue, 25 Nov 2025 08:51:48 +0100
+Date: Fri, 28 Nov 2025 09:06:23 +0100
 Subject: [PATCH] net: dsa: b53: fix BCM5325/65 ARL entry multicast port masks
 
 We currently use the mask 0xf for writing and reading b53_entry::port,
@@ -20,7 +20,10 @@ contained in the Search Result Extension register. So create a separate
 search result parse function that properly handles this.
 
 Fixes: c45655386e53 ("net: dsa: b53: add support for FDB operations on 5325/5365")
+Reviewed-by: Florian Fainelli <florian.fainelli at broadcom.com>
 Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+Link: https://patch.msgid.link/20251128080625.27181-6-jonas.gorski at gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 ---
  drivers/net/dsa/b53/b53_common.c |  4 +++-
  drivers/net/dsa/b53/b53_priv.h   | 25 +++++++++++++++++++++----
@@ -53,11 +56,11 @@ Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
 -		     ARLTBL_DATA_PORT_ID_MASK_25;
 +	ent->port = (mac_vid & ARLTBL_DATA_PORT_ID_MASK_25) >>
 +		     ARLTBL_DATA_PORT_ID_S_25;
- 	if (!is_multicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT)
+ 	if (is_unicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT)
  		ent->port = B53_CPU_PORT_25;
  	ent->vid = (mac_vid >> ARLTBL_VID_S_65) & ARLTBL_VID_MASK_25;
 @@ -388,8 +388,8 @@ static inline void b53_arl_from_entry_25
- 	if (!is_multicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT_25)
+ 	if (is_unicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT_25)
  		*mac_vid |= (u64)B53_CPU_PORT << ARLTBL_DATA_PORT_ID_S_25;
  	else
 -		*mac_vid |= (u64)(ent->port & ARLTBL_DATA_PORT_ID_MASK_25) <<
diff --git a/target/linux/generic/pending-6.12/750-06-net-dsa-b53-fix-BCM5325-65-ARL-entry-VIDs.patch b/target/linux/generic/backport-6.12/613-06-v6.19-net-dsa-b53-fix-BCM5325-65-ARL-entry-VIDs.patch
similarity index 93%
rename from target/linux/generic/pending-6.12/750-06-net-dsa-b53-fix-BCM5325-65-ARL-entry-VIDs.patch
rename to target/linux/generic/backport-6.12/613-06-v6.19-net-dsa-b53-fix-BCM5325-65-ARL-entry-VIDs.patch
index 8e579afda7..a2025f980c 100644
--- a/target/linux/generic/pending-6.12/750-06-net-dsa-b53-fix-BCM5325-65-ARL-entry-VIDs.patch
+++ b/target/linux/generic/backport-6.12/613-06-v6.19-net-dsa-b53-fix-BCM5325-65-ARL-entry-VIDs.patch
@@ -1,6 +1,6 @@
-From d41f2d5f1c9c6d492ccd3ffdd09e064e70ebc934 Mon Sep 17 00:00:00 2001
+From d39514e6a2d14f57830d649e2bf03b49612c2f73 Mon Sep 17 00:00:00 2001
 From: Jonas Gorski <jonas.gorski at gmail.com>
-Date: Tue, 25 Nov 2025 08:51:49 +0100
+Date: Fri, 28 Nov 2025 09:06:24 +0100
 Subject: [PATCH] net: dsa: b53: fix BCM5325/65 ARL entry VIDs
 
 BCM5325/65's ARL entry registers do not contain the VID, only the search
@@ -12,6 +12,9 @@ move the VLAN ID field definition to the search register definition.
 
 Fixes: c45655386e53 ("net: dsa: b53: add support for FDB operations on 5325/5365")
 Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+Reviewed-by: Florian Fainelli <florian.fainelli at broadcom.com>
+Link: https://patch.msgid.link/20251128080625.27181-7-jonas.gorski at gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 ---
  drivers/net/dsa/b53/b53_common.c |  9 +++++++--
  drivers/net/dsa/b53/b53_priv.h   | 12 ++++++------
@@ -60,7 +63,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
  	ent->is_valid = !!(mac_vid & ARLTBL_VALID_25);
 @@ -352,7 +352,7 @@ static inline void b53_arl_to_entry_25(s
  		     ARLTBL_DATA_PORT_ID_S_25;
- 	if (!is_multicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT)
+ 	if (is_unicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT)
  		ent->port = B53_CPU_PORT_25;
 -	ent->vid = (mac_vid >> ARLTBL_VID_S_65) & ARLTBL_VID_MASK_25;
 +	ent->vid = vid_entry;
diff --git a/target/linux/generic/backport-6.12/613-07-v6.19-net-dsa-b53-allow-VID-0-for-BCM5325-65.patch b/target/linux/generic/backport-6.12/613-07-v6.19-net-dsa-b53-allow-VID-0-for-BCM5325-65.patch
new file mode 100644
index 0000000000..7c6a63fc91
--- /dev/null
+++ b/target/linux/generic/backport-6.12/613-07-v6.19-net-dsa-b53-allow-VID-0-for-BCM5325-65.patch
@@ -0,0 +1,44 @@
+From 0b2b27058692d437b12d3f2a3bf0fa699af7376e Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski at gmail.com>
+Date: Fri, 28 Nov 2025 09:06:25 +0100
+Subject: [PATCH] net: dsa: b53: allow VID 0 for BCM5325/65
+
+Now that writing ARL entries works properly, we can actually use VID 0
+as the default untagged VLAN for BCM5325 and BCM5365 as well.
+
+So use 0 as default PVID for all chips and do not reject VLAN 0 anymore,
+which we ignored since commit 45e9d59d3950 ("net: dsa: b53: do not allow
+to configure VLAN 0") anyway.
+
+Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+Reviewed-by: Florian Fainelli <florian.fainelli at broadcom.com>
+Link: https://patch.msgid.link/20251128080625.27181-8-jonas.gorski at gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ drivers/net/dsa/b53/b53_common.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+--- a/drivers/net/dsa/b53/b53_common.c
++++ b/drivers/net/dsa/b53/b53_common.c
+@@ -852,10 +852,7 @@ static void b53_enable_stp(struct b53_de
+ 
+ static u16 b53_default_pvid(struct b53_device *dev)
+ {
+-	if (is5325(dev) || is5365(dev))
+-		return 1;
+-	else
+-		return 0;
++	return 0;
+ }
+ 
+ static bool b53_vlan_port_needs_forced_tagged(struct dsa_switch *ds, int port)
+@@ -1679,9 +1676,6 @@ static int b53_vlan_prepare(struct dsa_s
+ {
+ 	struct b53_device *dev = ds->priv;
+ 
+-	if ((is5325(dev) || is5365(dev)) && vlan->vid == 0)
+-		return -EOPNOTSUPP;
+-
+ 	/* Port 7 on 7278 connects to the ASP's UniMAC which is not capable of
+ 	 * receiving VLAN tagged frames at all, we can still allow the port to
+ 	 * be configured for egress untagged.
diff --git a/target/linux/generic/pending-6.12/750-07-net-dsa-b53-allow-VID-0-for-BCM5325-65.patch b/target/linux/generic/pending-6.12/750-07-net-dsa-b53-allow-VID-0-for-BCM5325-65.patch
deleted file mode 100644
index 9b255cc39f..0000000000
--- a/target/linux/generic/pending-6.12/750-07-net-dsa-b53-allow-VID-0-for-BCM5325-65.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-From b5a97c36457e4299afdb420603d39d1e30da843e Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski at gmail.com>
-Date: Tue, 25 Nov 2025 08:51:50 +0100
-Subject: [PATCH] net: dsa: b53: allow VID 0 for BCM5325/65
-
-Now that writing ARL entries works properly, we can actually use VID 0
-as the default untagged VLAN for BCM5325 and BCM5365 as well, so use 0
-as default PVID always.
-
-Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
----
- drivers/net/dsa/b53/b53_common.c | 49 +++++++++++---------------------
- 1 file changed, 17 insertions(+), 32 deletions(-)
-
---- a/drivers/net/dsa/b53/b53_common.c
-+++ b/drivers/net/dsa/b53/b53_common.c
-@@ -850,14 +850,6 @@ static void b53_enable_stp(struct b53_de
- 	b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, gc);
- }
- 
--static u16 b53_default_pvid(struct b53_device *dev)
--{
--	if (is5325(dev) || is5365(dev))
--		return 1;
--	else
--		return 0;
--}
--
- static bool b53_vlan_port_needs_forced_tagged(struct dsa_switch *ds, int port)
- {
- 	struct b53_device *dev = ds->priv;
-@@ -886,14 +878,12 @@ int b53_configure_vlan(struct dsa_switch
- 	struct b53_device *dev = ds->priv;
- 	struct b53_vlan vl = { 0 };
- 	struct b53_vlan *v;
--	int i, def_vid;
- 	u16 vid;
--
--	def_vid = b53_default_pvid(dev);
-+	int i;
- 
- 	/* clear all vlan entries */
- 	if (is5325(dev) || is5365(dev)) {
--		for (i = def_vid; i < dev->num_vlans; i++)
-+		for (i = 0; i < dev->num_vlans; i++)
- 			b53_set_vlan_entry(dev, i, &vl);
- 	} else {
- 		b53_do_vlan_op(dev, VTA_CMD_CLEAR);
-@@ -907,7 +897,7 @@ int b53_configure_vlan(struct dsa_switch
- 	 * entry. Do this only when the tagging protocol is not
- 	 * DSA_TAG_PROTO_NONE
- 	 */
--	v = &dev->vlans[def_vid];
-+	v = &dev->vlans[0];
- 	b53_for_each_port(dev, i) {
- 		if (!b53_vlan_port_may_join_untagged(ds, i))
- 			continue;
-@@ -915,16 +905,15 @@ int b53_configure_vlan(struct dsa_switch
- 		vl.members |= BIT(i);
- 		if (!b53_vlan_port_needs_forced_tagged(ds, i))
- 			vl.untag = vl.members;
--		b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(i),
--			    def_vid);
-+		b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(i), 0);
- 	}
--	b53_set_vlan_entry(dev, def_vid, &vl);
-+	b53_set_vlan_entry(dev, 0, &vl);
- 
- 	if (dev->vlan_filtering) {
- 		/* Upon initial call we have not set-up any VLANs, but upon
- 		 * system resume, we need to restore all VLAN entries.
- 		 */
--		for (vid = def_vid + 1; vid < dev->num_vlans; vid++) {
-+		for (vid = 1; vid < dev->num_vlans; vid++) {
- 			v = &dev->vlans[vid];
- 
- 			if (!v->members)
-@@ -1260,7 +1249,6 @@ static int b53_setup(struct dsa_switch *
- 	struct b53_device *dev = ds->priv;
- 	struct b53_vlan *vl;
- 	unsigned int port;
--	u16 pvid;
- 	int ret;
- 
- 	/* Request bridge PVID untagged when DSA_TAG_PROTO_NONE is set
-@@ -1290,8 +1278,7 @@ static int b53_setup(struct dsa_switch *
- 	}
- 
- 	/* setup default vlan for filtering mode */
--	pvid = b53_default_pvid(dev);
--	vl = &dev->vlans[pvid];
-+	vl = &dev->vlans[0];
- 	b53_for_each_port(dev, port) {
- 		vl->members |= BIT(port);
- 		if (!b53_vlan_port_needs_forced_tagged(ds, port))
-@@ -1720,7 +1707,7 @@ int b53_vlan_add(struct dsa_switch *ds,
- 	if (pvid)
- 		new_pvid = vlan->vid;
- 	else if (!pvid && vlan->vid == old_pvid)
--		new_pvid = b53_default_pvid(dev);
-+		new_pvid = 0;
- 	else
- 		new_pvid = old_pvid;
- 	dev->ports[port].pvid = new_pvid;
-@@ -1770,7 +1757,7 @@ int b53_vlan_del(struct dsa_switch *ds,
- 	vl->members &= ~BIT(port);
- 
- 	if (pvid == vlan->vid)
--		pvid = b53_default_pvid(dev);
-+		pvid = 0;
- 	dev->ports[port].pvid = pvid;
- 
- 	if (untagged && !b53_vlan_port_needs_forced_tagged(ds, port))
-@@ -2249,7 +2236,7 @@ int b53_br_join(struct dsa_switch *ds, i
- 	struct b53_device *dev = ds->priv;
- 	struct b53_vlan *vl;
- 	s8 cpu_port = dsa_to_port(ds, port)->cpu_dp->index;
--	u16 pvlan, reg, pvid;
-+	u16 pvlan, reg;
- 	unsigned int i;
- 
- 	/* On 7278, port 7 which connects to the ASP should only receive
-@@ -2258,8 +2245,7 @@ int b53_br_join(struct dsa_switch *ds, i
- 	if (dev->chip_id == BCM7278_DEVICE_ID && port == 7)
- 		return -EINVAL;
- 
--	pvid = b53_default_pvid(dev);
--	vl = &dev->vlans[pvid];
-+	vl = &dev->vlans[0];
- 
- 	if (dev->vlan_filtering) {
- 		/* Make this port leave the all VLANs join since we will have
-@@ -2275,9 +2261,9 @@ int b53_br_join(struct dsa_switch *ds, i
- 				    reg);
- 		}
- 
--		b53_get_vlan_entry(dev, pvid, vl);
-+		b53_get_vlan_entry(dev, 0, vl);
- 		vl->members &= ~BIT(port);
--		b53_set_vlan_entry(dev, pvid, vl);
-+		b53_set_vlan_entry(dev, 0, vl);
- 	}
- 
- 	b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), &pvlan);
-@@ -2316,7 +2302,7 @@ void b53_br_leave(struct dsa_switch *ds,
- 	struct b53_vlan *vl;
- 	s8 cpu_port = dsa_to_port(ds, port)->cpu_dp->index;
- 	unsigned int i;
--	u16 pvlan, reg, pvid;
-+	u16 pvlan, reg;
- 
- 	b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), &pvlan);
- 
-@@ -2341,8 +2327,7 @@ void b53_br_leave(struct dsa_switch *ds,
- 	b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan);
- 	dev->ports[port].vlan_ctl_mask = pvlan;
- 
--	pvid = b53_default_pvid(dev);
--	vl = &dev->vlans[pvid];
-+	vl = &dev->vlans[0];
- 
- 	if (dev->vlan_filtering) {
- 		/* Make this port join all VLANs without VLAN entries */
-@@ -2354,9 +2339,9 @@ void b53_br_leave(struct dsa_switch *ds,
- 			b53_write16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, reg);
- 		}
- 
--		b53_get_vlan_entry(dev, pvid, vl);
-+		b53_get_vlan_entry(dev, 0, vl);
- 		vl->members |= BIT(port);
--		b53_set_vlan_entry(dev, pvid, vl);
-+		b53_set_vlan_entry(dev, 0, vl);
- 	}
- }
- EXPORT_SYMBOL(b53_br_leave);



From lede-commits at lists.infradead.org  Thu Dec  4 12:42:56 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 15:42:56 -0500
Subject: [openwrt/openwrt]  bcm47xx: Fix lzma-loader compilation
In-Reply-To: <176488097518.2326904.13808304471435954892@git-01.infra.openwrt.org>
References: <176488097518.2326904.13808304471435954892@git-01.infra.openwrt.org>
Message-ID: <mailman.33214.1764880985.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5aeaddc0c80eea00872eb17a170d6b0c8d7e9c23

commit 5aeaddc0c80eea00872eb17a170d6b0c8d7e9c23
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Thu Dec 4 21:33:13 2025 +0100

    bcm47xx: Fix lzma-loader compilation
    
    Fixes:
    ```
    LzmaDecode.c: In function 'RangeDecoderReverseBitTreeDecode':
    LzmaDecode.c:199:5: error: 'symbol' undeclared (first use in this function)
      199 |     symbol |= (bit << i);
          |     ^~~~~~
    LzmaDecode.c:199:5: note: each undeclared identifier is reported only once for each function it appears in
    ```
    
    Fixes: 4ffd5aa239c1 ("treewide: fix coccinelle checks")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c b/target/linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c
index a4aeda5f1f..900c7e7b49 100644
--- a/target/linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c
+++ b/target/linux/bcm47xx/image/lzma-loader/src/LzmaDecode.c
@@ -185,6 +185,7 @@ int RangeDecoderReverseBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder
 {
   int mi = 1;
   int i;
+  int symbol = 0;
   #ifdef _LZMA_LOC_OPT
   RC_INIT_VAR
   #endif
@@ -202,7 +203,7 @@ int RangeDecoderReverseBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder
   #ifdef _LZMA_LOC_OPT
   RC_FLUSH_VAR
   #endif
-  return 0;
+  return symbol;
 }
 
 Byte LzmaLiteralDecode(CProb *probs, CRangeDecoder *rd)



From lede-commits at lists.infradead.org  Thu Dec  4 12:42:55 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 15:42:55 -0500
Subject: [openwrt/openwrt]  ramips: Fix cmpilation
In-Reply-To: <176488097518.2326904.13808304471435954892@git-01.infra.openwrt.org>
References: <176488097518.2326904.13808304471435954892@git-01.infra.openwrt.org>
Message-ID: <mailman.33215.1764880986.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/27e5d7ddd974dbf1843df10ca6a0c6bc2b7e1134

commit 27e5d7ddd974dbf1843df10ca6a0c6bc2b7e1134
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Thu Dec 4 21:12:24 2025 +0100

    ramips: Fix cmpilation
    
    Fixes this compile problem:
    ```
    drivers/net/ethernet/ralink/esw_rt3050.c: In function 'rt3050_esw_init':
    drivers/net/ethernet/ralink/esw_rt3050.c:1467:12: error: 'pdev' is used uninitialized [-Werror=uninitialized]
     1467 |         if (!pdev)
          |            ^
    drivers/net/ethernet/ralink/esw_rt3050.c:1461:33: note: 'pdev' was declared here
     1461 |         struct platform_device *pdev;
          |                                 ^~~~
    cc1: all warnings being treated as errors
    ```
    
    Fixes: 4ffd5aa239c1 ("treewide: fix coccinelle checks")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
index 5b3f21c92f..3bf2c2e83c 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
@@ -1464,13 +1464,13 @@ int rt3050_esw_init(struct fe_priv *priv)
 	const __be32 *rgmii;
 	int ret;
 
-	if (!pdev)
-		return -ENODEV;
-
 	if (!of_device_is_compatible(np, ralink_esw_match->compatible))
 		return -EINVAL;
 
 	pdev = of_find_device_by_node(np);
+	if (!pdev)
+		return -ENODEV;
+
 	esw = platform_get_drvdata(pdev);
 	if (!esw) {
 		put_device(&pdev->dev);



From lede-commits at lists.infradead.org  Thu Dec  4 13:30:32 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 16:30:32 -0500
Subject: [openwrt/openwrt]  rockchip: backport MMC CQE fixes
In-Reply-To: <176488383256.2508793.14057370000627485865@git-01.infra.openwrt.org>
References: <176488383256.2508793.14057370000627485865@git-01.infra.openwrt.org>
Message-ID: <mailman.33224.1764883837.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4582d25a660dee3ada921ae307fefb119faa7be1

commit 4582d25a660dee3ada921ae307fefb119faa7be1
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Wed Dec 3 14:36:32 2025 +0800

    rockchip: backport MMC CQE fixes
    
    Added missing platform data struct for RK3576 to fix boot issues,
    fixed general stability issues and also improved random write
    performance.
    
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
    Link: https://github.com/openwrt/openwrt/pull/21028
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...mshc-Fix-command-queue-support-for-RK3576.patch | 55 ++++++++++++++++++++++
 ...mshc-Disable-internal-clock-auto-gate-for.patch | 42 +++++++++++++++++
 ...dwcmshc-reduce-CIT-for-better-performance.patch | 44 +++++++++++++++++
 3 files changed, 141 insertions(+)

diff --git a/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch b/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch
new file mode 100644
index 0000000000..c4d9689507
--- /dev/null
+++ b/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch
@@ -0,0 +1,55 @@
+From 69cc9d4075855661268327c38c9b0e71ac37eb1c Mon Sep 17 00:00:00 2001
+From: Sebastian Reichel <sebastian.reichel at collabora.com>
+Date: Fri, 21 Nov 2025 17:26:59 +0100
+Subject: [PATCH] mmc: sdhci-of-dwcmshc: Fix command queue support for RK3576
+
+When I added command queue engine (CQE) support for the Rockchip eMMC
+controller, I missed that RK3576 has a separate platform data struct.
+While things are working fine on RK3588 (I tested the ROCK 5B) and
+the suspend issue is fixed on the RK3576 (I tested the Sige5), this
+results in stability issues. By also adding the necessary hooks for
+the RK3576 platform the following problems can be avoided:
+
+[   15.606895] mmc0: running CQE recovery
+[   15.616189] mmc0: running CQE recovery
+[...]
+[   25.911484] mmc0: running CQE recovery
+[   25.926305] mmc0: running CQE recovery
+[   25.927468] mmc0: running CQE recovery
+[...]
+[   26.255719] mmc0: running CQE recovery
+[   26.257162] ------------[ cut here ]------------
+[   26.257581] mmc0: cqhci: spurious TCN for tag 31
+[   26.258034] WARNING: CPU: 0 PID: 0 at drivers/mmc/host/cqhci-core.c:796 cqhci_irq+0x440/0x68c
+[   26.263786] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.18.0-rc6-gd984ebbf0d15 #1 PREEMPT
+[   26.264561] Hardware name: ArmSoM Sige5 (DT)
+[...]
+[   26.272748] Call trace:
+[   26.272964]  cqhci_irq+0x440/0x68c (P)
+[   26.273296]  dwcmshc_cqe_irq_handler+0x54/0x88
+[   26.273689]  sdhci_irq+0xbc/0x1200
+[   26.273991]  __handle_irq_event_percpu+0x54/0x1d0
+[...]
+
+Note that the above problems do not necessarily happen with every boot.
+
+Reported-by: Adrian Hunter <adrian.hunter at intel.com>
+Closes: https://lore.kernel.org/linux-rockchip/01949bc9-4873-498b-ac7d-f008393ccc4c at intel.com/
+Fixes: fda1e0af7c28f ("mmc: sdhci-of-dwcmshc: Add command queue support for rockchip SOCs")
+Signed-off-by: Sebastian Reichel <sebastian.reichel at collabora.com>
+Reviewed-by: Shawn Lin <shawn.lin at rock-chips.com>
+Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
+---
+ drivers/mmc/host/sdhci-of-dwcmshc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
++++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
+@@ -1333,6 +1333,7 @@ static const struct dwcmshc_pltfm_data s
+ 		.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
+ 			   SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
+ 	},
++	.cqhci_host_ops = &rk35xx_cqhci_ops,
+ 	.init = dwcmshc_rk35xx_init,
+ 	.postinit = dwcmshc_rk3576_postinit,
+ };
diff --git a/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch b/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch
new file mode 100644
index 0000000000..d8a0ed8d14
--- /dev/null
+++ b/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch
@@ -0,0 +1,42 @@
+From c7ce6453b769c45006ed4983762f81e130878171 Mon Sep 17 00:00:00 2001
+From: Shawn Lin <shawn.lin at rock-chips.com>
+Date: Wed, 26 Nov 2025 07:26:39 +0800
+Subject: [PATCH] mmc: sdhci-of-dwcmshc: Disable internal clock auto gate for
+ Rockchip SOCs
+
+Enabling CMDQ support can lead to random occurrences of the error log when
+there are RPMB access and data flush executed:
+
+"mmc2: Timeout waiting for hardware interrupt."
+
+Enabling CMDQ and then issuing a DCMD as the final command before disabling
+it causes the eMMC controller to auto-gate its internal clock. Chip simulation
+shows this results in a state machine mismatch after CMDQ mode exit, triggering
+data-timeout errors for all subsequent read and write operations.
+
+Therefore, the auto-clock-gate function must be disabled whenever CMDQ is
+enabled.
+
+Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
+Acked-by: Adrian Hunter <adrian.hunter at intel.com>
+Fixes: fda1e0af7c28 ("mmc: sdhci-of-dwcmshc: Add command queue support for rockchip SOCs")
+Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
+---
+ drivers/mmc/host/sdhci-of-dwcmshc.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
++++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
+@@ -696,10 +696,11 @@ static void dwcmshc_rk3568_set_clock(str
+ 
+ 	sdhci_set_clock(host, clock);
+ 
+-	/* Disable cmd conflict check */
++	/* Disable cmd conflict check and internal clock gate */
+ 	reg = dwc_priv->vendor_specific_area1 + DWCMSHC_HOST_CTRL3;
+ 	extra = sdhci_readl(host, reg);
+ 	extra &= ~BIT(0);
++	extra |= BIT(4);
+ 	sdhci_writel(host, extra, reg);
+ 
+ 	if (clock <= 52000000) {
diff --git a/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch b/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch
new file mode 100644
index 0000000000..90647d96c3
--- /dev/null
+++ b/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch
@@ -0,0 +1,44 @@
+From 79cf71c0b177c0e23d411e2469435e2c2f83f563 Mon Sep 17 00:00:00 2001
+From: Shawn Lin <shawn.lin at rock-chips.com>
+Date: Wed, 26 Nov 2025 07:26:40 +0800
+Subject: [PATCH] mmc: sdhci-of-dwcmshc: reduce CIT for better performance
+
+CQHCI_SSC1.CIT indicates to the CQE the polling period to use for
+periodic SEND_QUEUE_STATUS (CMD13) polling. Some eMMCs have only one
+hardware queue, and CMD13 can only query one slot at a time for data
+transmission, which cannot be processed in parallel. Modifying the
+CMD13 query interval can increase the query frequency and improve
+random write performance.
+
+Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
+Acked-by: Adrian Hunter <adrian.hunter at intel.com>
+Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
+---
+ drivers/mmc/host/cqhci.h            | 1 +
+ drivers/mmc/host/sdhci-of-dwcmshc.c | 5 +++++
+ 2 files changed, 6 insertions(+)
+
+--- a/drivers/mmc/host/cqhci.h
++++ b/drivers/mmc/host/cqhci.h
+@@ -93,6 +93,7 @@
+ /* send status config 1 */
+ #define CQHCI_SSC1			0x40
+ #define CQHCI_SSC1_CBC_MASK		GENMASK(19, 16)
++#define CQHCI_SSC1_CIT_MASK		GENMASK(15, 0)
+ 
+ /* send status config 2 */
+ #define CQHCI_SSC2			0x44
+--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
++++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
+@@ -614,6 +614,11 @@ static void rk35xx_sdhci_cqe_pre_enable(
+ 	struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
+ 	u32 reg;
+ 
++	/* Set Send Status Command Idle Timer to 10.66us (256 * 1 / 24) */
++	reg = sdhci_readl(host, dwc_priv->vendor_specific_area2 + CQHCI_SSC1);
++	reg = (reg & ~CQHCI_SSC1_CIT_MASK) | 0x0100;
++	sdhci_writel(host, reg, dwc_priv->vendor_specific_area2 + CQHCI_SSC1);
++
+ 	reg = sdhci_readl(host, dwc_priv->vendor_specific_area2 + CQHCI_CFG);
+ 	reg |= CQHCI_ENABLE;
+ 	sdhci_writel(host, reg, dwc_priv->vendor_specific_area2 + CQHCI_CFG);



From lede-commits at lists.infradead.org  Thu Dec  4 13:58:58 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 16:58:58 -0500
Subject: [openwrt/openwrt]  econet: standardize partitions in DTS files
In-Reply-To: <176488553856.2587243.4025977636072263259@git-01.infra.openwrt.org>
References: <176488553856.2587243.4025977636072263259@git-01.infra.openwrt.org>
Message-ID: <mailman.33227.1764885544.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/dac466452be99b29e6fca6f28ca63a8b06c8d69d

commit dac466452be99b29e6fca6f28ca63a8b06c8d69d
Author: Caleb James DeLisle <cjd at cjdns.fr>
AuthorDate: Fri Nov 7 16:59:10 2025 +0000

    econet: standardize partitions in DTS files
    
    In preparation for the introduction of ethernet, this patch normalizes the
    partitions in the devices in DT so that the partition to upgrade will
    always be called tclinux, no matter what it is called from the factory.
    Also fix a math error in Nokia G240G-E partition table and remove leading
    zeros from paritition offsets.
    
    Finally, add NVMEM mac-address entries where they are left by the
    factory. In preparation for the introduction of Ethernet and Wifi
    support.
    
    Signed-off-by: Caleb James DeLisle <cjd at cjdns.fr>
    Link: https://github.com/openwrt/openwrt/pull/20685
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/econet/dts/en751221_nokia_g240g-e.dts | 60 +++++++++++-----------
 .../econet/dts/en751221_smartfiber_xp8421-b.dts    | 32 ++++++++++--
 .../dts/en751221_tplink_archer-vr1200v-v2.dts      | 49 ++++++++++++++----
 target/linux/econet/en751221/config-6.12           |  5 +-
 4 files changed, 102 insertions(+), 44 deletions(-)

diff --git a/target/linux/econet/dts/en751221_nokia_g240g-e.dts b/target/linux/econet/dts/en751221_nokia_g240g-e.dts
index 7d82b566cc..bea569cdbc 100644
--- a/target/linux/econet/dts/en751221_nokia_g240g-e.dts
+++ b/target/linux/econet/dts/en751221_nokia_g240g-e.dts
@@ -29,95 +29,97 @@
 
 		partition at 0 {
 			label = "bootloader";
-			reg = <0x00000000 0x00040000>;
+			reg = <0x0 0x40000>;
 			read-only;
 		};
 
 		partition at 40000 {
-			// Unused
 			label = "romfile";
-			reg = <0x00040000 0x00040000>;
+			reg = <0x40000 0x40000>;
 		};
 
 		partition at 80000 {
-			// trx - OpenWRT kernel is 4MB, factory is 3MB
-			label = "kernel";
-			reg = <0x00080000 0x00400000>;
+			label = "tclinux";
+			reg = <0x80000 0x2200000>;
+			econet,enable-remap;
 		};
 
-		partition at 380000 {
-			// squashfs
+		partition at 480000 {
 			label = "rootfs";
-			reg = <0x00480000 0x01F00000>;
+			reg = <0x480000 0x1e00000>;
 			linux,rootfs;
 		};
 
 		partition at 2280000 {
-			// trx
 			label = "kernel_slave";
-			reg = <0x02280000 0x00300000>;
+			reg = <0x2280000 0x300000>;
 		};
 
 		partition at 2580000 {
-			// squashfs
 			label = "rootfs_slave";
-			reg = <0x02580000 0x01F00000>;
+			reg = <0x2580000 0x1f00000>;
 		};
 
 		partition at 4480000 {
-			// trx
 			label = "kernel_oflt";
-			reg = <0x04480000 0x00300000>;
+			reg = <0x4480000 0x300000>;
 		};
 
 		partition at 4780000 {
-			// squashfs
 			label = "rootfs_oflt";
-			reg = <0x04780000 0x00C00000>;
+			reg = <0x4780000 0xc00000>;
 		};
 
 		partition at 5380000 {
-			// UBI
 			label = "config";
-			reg = <0x05380000 0x00800000>;
+			reg = <0x5380000 0x800000>;
 		};
 
 		partition at 5b80000 {
-			// UBI
 			label = "log";
-			reg = <0x05b80000 0x00C00000>;
+			reg = <0x5b80000 0xc00000>;
 		};
 
 		partition at 6780000 {
-			// UBI / unused
 			label = "extfs";
-			reg = <0x06780000 0x00600000>;
+			reg = <0x6780000 0x600000>;
 		};
 
 		partition at 6d80000 {
-			// binary
 			label = "bosa";
-			reg = <0x06d80000 0x00040000>;
+			reg = <0x6d80000 0x40000>;
 		};
 
 		partition at 6dc0000 {
 			label = "flag";
-			reg = <0x06dc0000 0x00040000>;
+			reg = <0x6dc0000 0x40000>;
 		};
 
 		partition at 6e00000 {
 			label = "flagback";
-			reg = <0x06e00000 0x00040000>;
+			reg = <0x6e00000 0x40000>;
 		};
 
 		partition at 6e40000 {
 			label = "ri";
-			reg = <0x06e40000 0x00040000>;
+			reg = <0x6e40000 0x40000>;
+
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_ri_3e: macaddr at 3e {
+					compatible = "mac-base";
+					reg = <0x3e 0x6>;
+					#nvmem-cell-cells = <1>;
+				};
+			};
 		};
 
 		partition at 6e80000 {
 			label = "riback";
-			reg = <0x06e80000 0x00040000>;
+			reg = <0x6e80000 0x40000>;
 		};
 	};
 };
diff --git a/target/linux/econet/dts/en751221_smartfiber_xp8421-b.dts b/target/linux/econet/dts/en751221_smartfiber_xp8421-b.dts
index 45654492a8..314c98fc5e 100644
--- a/target/linux/econet/dts/en751221_smartfiber_xp8421-b.dts
+++ b/target/linux/econet/dts/en751221_smartfiber_xp8421-b.dts
@@ -31,27 +31,35 @@
 			label = "bootloader";
 			reg = <0x0 0x40000>;
 			read-only;
+
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_bootloader_ff48: macaddr at ff48 {
+					compatible = "mac-base";
+					reg = <0xff48 0x6>;
+					#nvmem-cell-cells = <1>;
+				};
+			};
 		};
 
 		partition at 40000 {
 			label = "romfile";
 			reg = <0x40000 0x40000>;
-			read-only;
 		};
 
 		partition at 80000 {
 			label = "tclinux";
 			reg = <0x80000 0x1400000>;
-			read-only;
 			econet,enable-remap;
 		};
 
-		/* Nested inside of tclinux */
 		partition at 480000 {
 			label = "rootfs";
 			reg = <0x480000 0xf80000>;
 			linux,rootfs;
-			read-only;
 		};
 
 		partition at 1480000 {
@@ -77,6 +85,22 @@
 		partition at de40000 {
 			label = "reservearea";
 			reg = <0xde40000 0x1c0000>;
+
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				eeprom_reserve_140000: eeprom at 140000 {
+					/* MT7592 */
+					reg = <0x140000 0x200>;
+				};
+
+				eeprom_reserve_180040: eeprom at 180040 {
+					/* MT7612E */
+					reg = <0x180040 0x600>;
+				};
+			};
 		};
 	};
 };
diff --git a/target/linux/econet/dts/en751221_tplink_archer-vr1200v-v2.dts b/target/linux/econet/dts/en751221_tplink_archer-vr1200v-v2.dts
index 1866b446fd..56dec97c27 100644
--- a/target/linux/econet/dts/en751221_tplink_archer-vr1200v-v2.dts
+++ b/target/linux/econet/dts/en751221_tplink_archer-vr1200v-v2.dts
@@ -29,34 +29,63 @@
 
 		partition at 0 {
 			label = "bootloader";
-			reg = <0x0 0x00080000>;
+			reg = <0x0 0x80000>;
 			read-only;
 		};
+
 		partition at 80000 {
 			label = "misc";
-			reg = <0x00080000 0x140000>;
+			reg = <0x80000 0x140000>;
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				eeprom_misc_80000: eeprom at 80000 {
+					/* MT7592 */
+					reg = <0x80000 0x200>;
+				};
+
+				eeprom_misc_a0000: eeprom at a0000 {
+					/* MT7613BE */
+					reg = <0xa0000 0x600>;
+				};
+
+				macaddr_misc_8f100: macaddr at 8f100 {
+					compatible = "mac-base";
+					reg = <0x4f100 0x6>;
+					#nvmem-cell-cells = <1>;
+				};
+			};
 		};
-		partition at 1c0200 {
-			label = "kernel";
-			reg = <0x001c0000 0x400000>;
+
+		partition at 1c0000 {
+			label = "tclinux";
+			reg = <0x1c0000 0x1e40000>;
+			econet,enable-remap;
 		};
+
 		partition at 5c0000 {
 			label = "rootfs";
-			reg = <0x005c0000 0x1a40000>;
+			reg = <0x5c0000 0x1a40000>;
 			linux,rootfs;
 		};
-		partition at 1c0000 {
-			label = "firmware";
-			reg = <0x001c0000 0x1e40000>;
-		};
+
 		partition at 2000000 {
 			label = "firmware_factory";
 			reg = <0x2000000 0x1e40000>;
 		};
+
+		partition at 3e40000 {
+			label = "unused";
+			reg = <0x3e40000 0x1a0000>;
+		};
+
 		partition at 3fe0000 {
 			label = "reserve";
 			reg = <0x3fe0000 0x20000>;
 		};
+
 		partition at 4000000 {
 			label = "openwrt_ubi";
 			/* From the factory this is unallocated space, so it's ours for the taking.
diff --git a/target/linux/econet/en751221/config-6.12 b/target/linux/econet/en751221/config-6.12
index 653019f9c5..86991c3963 100644
--- a/target/linux/econet/en751221/config-6.12
+++ b/target/linux/econet/en751221/config-6.12
@@ -120,6 +120,9 @@ CONFIG_NET_INGRESS=y
 CONFIG_NET_XGRESS=y
 CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
 CONFIG_NR_CPUS=2
+CONFIG_NVMEM=y
+CONFIG_NVMEM_LAYOUTS=y
+CONFIG_NVMEM_SYSFS=y
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
 CONFIG_OF_EARLY_FLATTREE=y
@@ -141,6 +144,7 @@ CONFIG_RANDSTRUCT_NONE=y
 CONFIG_RATIONAL=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
+CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y
 CONFIG_SERIAL_MCTRL_GPIO=y
 CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_SGL_ALLOC=y
@@ -152,7 +156,6 @@ CONFIG_SPI=y
 CONFIG_SPI_AIROHA_EN7523=y
 CONFIG_SPI_MASTER=y
 CONFIG_SPI_MEM=y
-CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
 CONFIG_SYSCTL_EXCEPTION_TRACE=y
 CONFIG_SYS_HAS_CPU_MIPS32_R1=y
 CONFIG_SYS_HAS_CPU_MIPS32_R2=y



From lede-commits at lists.infradead.org  Thu Dec  4 13:58:59 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 16:58:59 -0500
Subject: [openwrt/openwrt]  econet: basic Ethernet support
In-Reply-To: <176488553856.2587243.4025977636072263259@git-01.infra.openwrt.org>
References: <176488553856.2587243.4025977636072263259@git-01.infra.openwrt.org>
Message-ID: <mailman.33230.1764885544.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d6b4b6385074c56a81159e6963459289b6e774a8

commit d6b4b6385074c56a81159e6963459289b6e774a8
Author: Caleb James DeLisle <cjd at cjdns.fr>
AuthorDate: Fri Nov 7 17:45:01 2025 +0000

    econet: basic Ethernet support
    
    This is about as simple as it gets, it's able to start up and put
    the onboard switch into dumb switch mode and then send untagged
    frames which become available on every switch port.
    
    It is out-of-tree to allow for rapid development and it is being
    proposed now because even in this state it brings a lot of value
    to the EcoNet platform and it is a fairly complex ethernet system
    so it will take some time before the driver is in a state that
    may be considered for upstreaming.
    
    Signed-off-by: Caleb James DeLisle <cjd at cjdns.fr>
    Link: https://github.com/openwrt/openwrt/pull/20685
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/econet-eth/Makefile                 | 35 +++++++++
 target/linux/econet/dts/en751221.dtsi              | 87 ++++++++++++++++++++++
 target/linux/econet/dts/en751221_generic.dts       |  4 +
 target/linux/econet/dts/en751221_nokia_g240g-e.dts |  6 ++
 .../econet/dts/en751221_smartfiber_xp8421-b.dts    |  6 ++
 .../dts/en751221_tplink_archer-vr1200v-v2.dts      |  6 ++
 6 files changed, 144 insertions(+)

diff --git a/package/kernel/econet-eth/Makefile b/package/kernel/econet-eth/Makefile
new file mode 100644
index 0000000000..1de42b52f3
--- /dev/null
+++ b/package/kernel/econet-eth/Makefile
@@ -0,0 +1,35 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=econet-eth
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/cjdelisle/econet_eth.git
+PKG_MIRROR_HASH:=764e18fe2f87cb0c742711c18ed995a2270b02f0072e7a0938906d0246287111
+PKG_SOURCE_DATE:=2025-11-07
+PKG_SOURCE_VERSION:=40aac736a46fec0d96beadd7513c53d1f0459737
+
+include $(INCLUDE_DIR)/kernel.mk
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/econet-eth
+  SUBMENU:=Network Devices
+  TITLE:=EcoNet EN751221 Ethernet Driver
+  DEPENDS:=@TARGET_econet
+  FILES:=$(PKG_BUILD_DIR)/econet-eth.ko
+  AUTOLOAD:=$(call AutoLoad,90,econet-eth)
+endef
+
+define KernelPackage/econet-eth/description
+  Out-of-tree ethernet driver for EcoNet EN751221 devices.
+endef
+
+define Build/Prepare
+	$(call Build/Prepare/Default)
+endef
+
+define Build/Compile
+	$(KERNEL_MAKE) M=$(PKG_BUILD_DIR) modules
+endef
+
+$(eval $(call KernelPackage,econet-eth))
diff --git a/target/linux/econet/dts/en751221.dtsi b/target/linux/econet/dts/en751221.dtsi
index d512d0425a..0a2448cd1c 100644
--- a/target/linux/econet/dts/en751221.dtsi
+++ b/target/linux/econet/dts/en751221.dtsi
@@ -56,6 +56,93 @@
 		econet,shadow-interrupts = <7 2>, <8 3>, <13 12>, <30 29>;
 	};
 
+	ethernet: ethernet at 1fb50000 {
+		compatible = "econet,en751221-eth";
+		reg = <0x1fb50000 0x10000>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		interrupt-parent = <&intc>;
+		interrupts = <21>, <22>;
+
+		gmac0: mac at 0 {
+			compatible = "econet,eth-mac";
+			reg = <0>;
+			phy-mode = "trgmii";
+			status = "disabled";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+				pause;
+			};
+		};
+
+		gmac1: mac at 1 {
+			compatible = "econet,eth-mac";
+			reg = <1>;
+			status = "disabled";
+			phy-mode = "rgmii-rxid";
+		};
+
+		 mdio: mdio-bus {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			switch0: switch at 1f {
+				compatible = "mediatek,mt7530";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0x1f>;
+				mediatek,mcm;
+				reset-names = "mcm";
+
+				ports {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0>;
+
+					port at 0 {
+						status = "disabled";
+						reg = <0>;
+						label = "lan0";
+					};
+
+					port at 1 {
+						status = "disabled";
+						reg = <1>;
+						label = "lan1";
+					};
+
+					port at 2 {
+						status = "disabled";
+						reg = <2>;
+						label = "lan2";
+					};
+
+					port at 3 {
+						status = "disabled";
+						reg = <3>;
+						label = "lan3";
+					};
+
+					port at 6 {
+						reg = <6>;
+						label = "cpu";
+						ethernet = <&gmac0>;
+						phy-mode = "trgmii";
+
+						fixed-link {
+							speed = <1000>;
+							full-duplex;
+						};
+					};
+				};
+			};
+		};
+	};
+
     usb: usb at 1fb90000 {
             compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci";
             reg = <0x1fb90000 0x4000>,
diff --git a/target/linux/econet/dts/en751221_generic.dts b/target/linux/econet/dts/en751221_generic.dts
index 375b9ebd3a..026f3e3739 100644
--- a/target/linux/econet/dts/en751221_generic.dts
+++ b/target/linux/econet/dts/en751221_generic.dts
@@ -50,3 +50,7 @@
 		};
 	};
 };
+
+&gmac0 {
+	status = "okay";
+};
diff --git a/target/linux/econet/dts/en751221_nokia_g240g-e.dts b/target/linux/econet/dts/en751221_nokia_g240g-e.dts
index bea569cdbc..68c314dbd9 100644
--- a/target/linux/econet/dts/en751221_nokia_g240g-e.dts
+++ b/target/linux/econet/dts/en751221_nokia_g240g-e.dts
@@ -123,3 +123,9 @@
 		};
 	};
 };
+
+&gmac0 {
+	status = "okay";
+	nvmem-cells = <&macaddr_ri_3e 0>;
+	nvmem-cell-names = "mac-address";
+};
diff --git a/target/linux/econet/dts/en751221_smartfiber_xp8421-b.dts b/target/linux/econet/dts/en751221_smartfiber_xp8421-b.dts
index 314c98fc5e..4599d34053 100644
--- a/target/linux/econet/dts/en751221_smartfiber_xp8421-b.dts
+++ b/target/linux/econet/dts/en751221_smartfiber_xp8421-b.dts
@@ -104,3 +104,9 @@
 		};
 	};
 };
+
+&gmac0 {
+	status = "okay";
+	nvmem-cells = <&macaddr_bootloader_ff48 0>;
+	nvmem-cell-names = "mac-address";
+};
diff --git a/target/linux/econet/dts/en751221_tplink_archer-vr1200v-v2.dts b/target/linux/econet/dts/en751221_tplink_archer-vr1200v-v2.dts
index 56dec97c27..2bc44d11cd 100644
--- a/target/linux/econet/dts/en751221_tplink_archer-vr1200v-v2.dts
+++ b/target/linux/econet/dts/en751221_tplink_archer-vr1200v-v2.dts
@@ -96,3 +96,9 @@
 		};
 	};
 };
+
+&gmac0 {
+	status = "okay";
+	nvmem-cells = <&macaddr_misc_8f100 0>;
+	nvmem-cell-names = "mac-address";
+};



From lede-commits at lists.infradead.org  Thu Dec  4 14:16:31 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 17:16:31 -0500
Subject: [openwrt/openwrt]  airoha: enable I2S sound driver and add nodes for
 eMMC RFB board
In-Reply-To: <176488659093.2635668.3795330629969104162@git-01.infra.openwrt.org>
References: <176488659093.2635668.3795330629969104162@git-01.infra.openwrt.org>
Message-ID: <mailman.33231.1764886595.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7b55651e61334f9a7f347519842df44058e79e59

commit 7b55651e61334f9a7f347519842df44058e79e59
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 4 23:14:30 2025 +0100

    airoha: enable I2S sound driver and add nodes for eMMC RFB board
    
    Enable I2S sound driver and add nodes for eMMC RFB board since it's the
    one that always have the I2C codec and can use the sound card.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/airoha/an7581/config-6.12      |  5 +++++
 target/linux/airoha/dts/an7581-evb-emmc.dts | 18 ++++++++++++++++++
 target/linux/airoha/dts/an7581.dtsi         | 17 +++++++++++++++++
 3 files changed, 40 insertions(+)

diff --git a/target/linux/airoha/an7581/config-6.12 b/target/linux/airoha/an7581/config-6.12
index 77bd649276..da40adadaf 100644
--- a/target/linux/airoha/an7581/config-6.12
+++ b/target/linux/airoha/an7581/config-6.12
@@ -357,9 +357,14 @@ CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_SGL_ALLOC=y
 CONFIG_SKB_EXTENSIONS=y
 CONFIG_SMP=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_AN7581=y
+CONFIG_SND_SOC_AN7581_WM8960=y
 CONFIG_SOCK_RX_QUEUE_MAPPING=y
 CONFIG_SOC_BUS=y
 CONFIG_SOFTIRQ_ON_OWN_STACK=y
+CONFIG_SOUND=y
 CONFIG_SPARSEMEM=y
 CONFIG_SPARSEMEM_EXTREME=y
 CONFIG_SPARSEMEM_VMEMMAP=y
diff --git a/target/linux/airoha/dts/an7581-evb-emmc.dts b/target/linux/airoha/dts/an7581-evb-emmc.dts
index 25d9b87af0..ee800b6131 100644
--- a/target/linux/airoha/dts/an7581-evb-emmc.dts
+++ b/target/linux/airoha/dts/an7581-evb-emmc.dts
@@ -28,6 +28,19 @@
 	};
 };
 
+&sound {
+	audio-routing = "Headphone", "HP_L",
+			"Headphone", "HP_R",
+			"LINPUT1", "AMIC",
+			"RINPUT1", "AMIC";
+
+	status = "okay";
+
+	codec {
+		sound-dai = <&wm8960>;
+	};
+};
+
 &en7581_pinctrl {
 	gpio-ranges = <&en7581_pinctrl 0 13 47>;
 
@@ -160,6 +173,11 @@
 
 &i2c0 {
 	status = "okay";
+
+	wm8960: codec at 1a {
+		compatible = "wlf,wm8960";
+		reg = <0x1a>;
+	};
 };
 
 &pcie0 {
diff --git a/target/linux/airoha/dts/an7581.dtsi b/target/linux/airoha/dts/an7581.dtsi
index e50048ac94..786044f254 100644
--- a/target/linux/airoha/dts/an7581.dtsi
+++ b/target/linux/airoha/dts/an7581.dtsi
@@ -360,6 +360,16 @@
 		regulator-always-on;
 	};
 
+	sound: sound {
+		compatible = "airoha,an7581-wm8960-sound";
+
+		status = "disabled";
+
+		platform {
+			sound-dai = <&afe>;
+		};
+	};
+
 	soc {
 		compatible = "simple-bus";
 		#address-cells = <2>;
@@ -419,6 +429,13 @@
 			status = "disabled";
 		};
 
+		afe: afe at 1fbe2200 {
+			compatible = "airoha,an7581-afe";
+			reg = <0x0 0x1fbe2200 0x0 0x9000>;
+
+			interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+		};
+
 		uart4: serial at 1fbf0600 {
 			compatible = "airoha,en7523-uart";
 			reg = <0x0 0x1fbf0600 0x0 0x30>;



From lede-commits at lists.infradead.org  Thu Dec  4 14:16:30 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 17:16:30 -0500
Subject: [openwrt/openwrt]  airoha: replace I2S patch with upstream pending
 version
In-Reply-To: <176488659093.2635668.3795330629969104162@git-01.infra.openwrt.org>
References: <176488659093.2635668.3795330629969104162@git-01.infra.openwrt.org>
Message-ID: <mailman.33232.1764886596.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8f1914053b24f56c101057390a0a83707864cf71

commit 8f1914053b24f56c101057390a0a83707864cf71
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 4 23:13:12 2025 +0100

    airoha: replace I2S patch with upstream pending version
    
    Replace I2S sound patch with upstream pending version. This adds ETDM
    support and fix various bug in the downstream implementation.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...diatek-move-some-header-to-global-include.patch | 410 ----------
 ...-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch | 893 +++++++++++++++++----
 2 files changed, 738 insertions(+), 565 deletions(-)

diff --git a/target/linux/airoha/patches-6.12/123-01-ASoC-mediatek-move-some-header-to-global-include.patch b/target/linux/airoha/patches-6.12/123-01-ASoC-mediatek-move-some-header-to-global-include.patch
deleted file mode 100644
index c9cdb9a326..0000000000
--- a/target/linux/airoha/patches-6.12/123-01-ASoC-mediatek-move-some-header-to-global-include.patch
+++ /dev/null
@@ -1,410 +0,0 @@
-From 527123b53739a2f73ca924b9c6e2f63dc66739a5 Mon Sep 17 00:00:00 2001
-From: Christian Marangi <ansuelsmth at gmail.com>
-Date: Fri, 1 Aug 2025 11:06:56 +0200
-Subject: [PATCH 1/3] ASoC: mediatek: move some header to global include
-
-In preparation for support of Airoha SoC sound system based on Mediatek
-AFE, move some header to global include to prevent having to use complex
-redirection for inclusion.
-
-Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
----
- .../common => include/sound/mediatek}/mtk-afe-fe-dai.h        | 0
- .../sound/mediatek}/mtk-afe-platform-driver.h                 | 0
- sound/soc/mediatek/common/mtk-afe-fe-dai.c                    | 4 ++--
- sound/soc/mediatek/common/mtk-afe-platform-driver.c           | 2 +-
- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c                    | 4 ++--
- sound/soc/mediatek/mt6797/mt6797-afe-pcm.c                    | 4 ++--
- sound/soc/mediatek/mt7986/mt7986-afe-pcm.c                    | 4 ++--
- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c                    | 4 ++--
- sound/soc/mediatek/mt8183/mt8183-afe-pcm.c                    | 4 ++--
- sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c            | 2 +-
- sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c    | 2 +-
- sound/soc/mediatek/mt8186/mt8186-afe-pcm.c                    | 4 ++--
- sound/soc/mediatek/mt8186/mt8186-misc-control.c               | 4 ++--
- sound/soc/mediatek/mt8186/mt8186-mt6366-common.c              | 2 +-
- sound/soc/mediatek/mt8186/mt8186-mt6366.c                     | 2 +-
- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c                    | 4 ++--
- sound/soc/mediatek/mt8188/mt8188-mt6359.c                     | 2 +-
- sound/soc/mediatek/mt8192/mt8192-afe-pcm.c                    | 4 ++--
- sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c       | 2 +-
- sound/soc/mediatek/mt8195/mt8195-afe-pcm.c                    | 4 ++--
- sound/soc/mediatek/mt8195/mt8195-mt6359.c                     | 2 +-
- sound/soc/mediatek/mt8365/mt8365-afe-pcm.c                    | 4 ++--
- 22 files changed, 32 insertions(+), 32 deletions(-)
- rename {sound/soc/mediatek/common => include/sound/mediatek}/mtk-afe-fe-dai.h (100%)
- rename {sound/soc/mediatek/common => include/sound/mediatek}/mtk-afe-platform-driver.h (100%)
-
---- a/sound/soc/mediatek/common/mtk-afe-fe-dai.c
-+++ b/sound/soc/mediatek/common/mtk-afe-fe-dai.c
-@@ -11,9 +11,9 @@
- #include <linux/pm_runtime.h>
- #include <linux/regmap.h>
- #include <sound/soc.h>
--#include "mtk-afe-platform-driver.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
- #include <sound/pcm_params.h>
--#include "mtk-afe-fe-dai.h"
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
- #include "mtk-base-afe.h"
- 
- #define AFE_BASE_END_OFFSET 8
---- a/sound/soc/mediatek/common/mtk-afe-platform-driver.c
-+++ b/sound/soc/mediatek/common/mtk-afe-platform-driver.c
-@@ -10,7 +10,7 @@
- #include <linux/dma-mapping.h>
- #include <sound/soc.h>
- 
--#include "mtk-afe-platform-driver.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
- #include "mtk-base-afe.h"
- 
- int mtk_afe_combine_sub_dai(struct mtk_base_afe *afe)
---- a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
-+++ b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
-@@ -16,8 +16,8 @@
- 
- #include "mt2701-afe-common.h"
- #include "mt2701-afe-clock-ctrl.h"
--#include "../common/mtk-afe-platform-driver.h"
--#include "../common/mtk-afe-fe-dai.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
- 
- static const struct snd_pcm_hardware mt2701_afe_hardware = {
- 	.info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED
---- a/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c
-+++ b/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c
-@@ -16,8 +16,8 @@
- #include "mt6797-afe-clk.h"
- #include "mt6797-interconnection.h"
- #include "mt6797-reg.h"
--#include "../common/mtk-afe-platform-driver.h"
--#include "../common/mtk-afe-fe-dai.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
- 
- enum {
- 	MTK_AFE_RATE_8K = 0,
---- a/sound/soc/mediatek/mt7986/mt7986-afe-pcm.c
-+++ b/sound/soc/mediatek/mt7986/mt7986-afe-pcm.c
-@@ -16,8 +16,8 @@
- 
- #include "mt7986-afe-common.h"
- #include "mt7986-reg.h"
--#include "../common/mtk-afe-platform-driver.h"
--#include "../common/mtk-afe-fe-dai.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
- 
- enum {
- 	MTK_AFE_RATE_8K = 0,
---- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
-+++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
-@@ -19,8 +19,8 @@
- #include <sound/soc.h>
- #include "mt8173-afe-common.h"
- #include "../common/mtk-base-afe.h"
--#include "../common/mtk-afe-platform-driver.h"
--#include "../common/mtk-afe-fe-dai.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
- 
- /*****************************************************************************
-  *                  R E G I S T E R       D E F I N I T I O N
---- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
-+++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
-@@ -18,8 +18,8 @@
- #include "mt8183-afe-clk.h"
- #include "mt8183-interconnection.h"
- #include "mt8183-reg.h"
--#include "../common/mtk-afe-platform-driver.h"
--#include "../common/mtk-afe-fe-dai.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
- 
- enum {
- 	MTK_AFE_RATE_8K = 0,
---- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
-+++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
-@@ -16,7 +16,7 @@
- 
- #include "../../codecs/da7219.h"
- #include "../../codecs/rt1015.h"
--#include "../common/mtk-afe-platform-driver.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
- #include "mt8183-afe-common.h"
- 
- #define DA7219_CODEC_DAI "da7219-hifi"
---- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
-+++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
-@@ -15,7 +15,7 @@
- 
- #include "../../codecs/rt1015.h"
- #include "../../codecs/ts3a227e.h"
--#include "../common/mtk-afe-platform-driver.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
- #include "mt8183-afe-common.h"
- 
- #define RT1015_CODEC_DAI "rt1015-aif"
---- a/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
-+++ b/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
-@@ -15,8 +15,8 @@
- #include <linux/reset.h>
- #include <sound/soc.h>
- 
--#include "../common/mtk-afe-platform-driver.h"
--#include "../common/mtk-afe-fe-dai.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
- 
- #include "mt8186-afe-common.h"
- #include "mt8186-afe-clk.h"
---- a/sound/soc/mediatek/mt8186/mt8186-misc-control.c
-+++ b/sound/soc/mediatek/mt8186/mt8186-misc-control.c
-@@ -11,8 +11,8 @@
- #include <linux/regmap.h>
- #include <sound/soc.h>
- 
--#include "../common/mtk-afe-fe-dai.h"
--#include "../common/mtk-afe-platform-driver.h"
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
- #include "mt8186-afe-common.h"
- 
- static const char * const mt8186_sgen_mode_str[] = {
---- a/sound/soc/mediatek/mt8186/mt8186-mt6366-common.c
-+++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-common.c
-@@ -9,7 +9,7 @@
- #include <sound/soc.h>
- 
- #include "../../codecs/mt6358.h"
--#include "../common/mtk-afe-platform-driver.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
- #include "mt8186-afe-common.h"
- #include "mt8186-mt6366-common.h"
- 
---- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
-+++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
-@@ -24,8 +24,8 @@
- #include "mt8188-afe-common.h"
- #include "mt8188-afe-clk.h"
- #include "mt8188-reg.h"
--#include "../common/mtk-afe-platform-driver.h"
--#include "../common/mtk-afe-fe-dai.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
- 
- #define MT8188_MEMIF_BUFFER_BYTES_ALIGN  (0x40)
- #define MT8188_MEMIF_DL7_MAX_PERIOD_SIZE (0x3fff)
---- a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
-+++ b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
-@@ -17,8 +17,8 @@
- #include <linux/reset.h>
- #include <sound/soc.h>
- 
--#include "../common/mtk-afe-fe-dai.h"
--#include "../common/mtk-afe-platform-driver.h"
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
- 
- #include "mt8192-afe-common.h"
- #include "mt8192-afe-clk.h"
---- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
-+++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
-@@ -20,8 +20,8 @@
- #include "mt8195-afe-common.h"
- #include "mt8195-afe-clk.h"
- #include "mt8195-reg.h"
--#include "../common/mtk-afe-platform-driver.h"
--#include "../common/mtk-afe-fe-dai.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
- 
- #define MT8195_MEMIF_BUFFER_BYTES_ALIGN  (0x40)
- #define MT8195_MEMIF_DL7_MAX_PERIOD_SIZE (0x3fff)
---- a/sound/soc/mediatek/mt8195/mt8195-mt6359.c
-+++ b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
-@@ -19,7 +19,7 @@
- #include "../../codecs/mt6359.h"
- #include "../../codecs/rt1011.h"
- #include "../../codecs/rt5682.h"
--#include "../common/mtk-afe-platform-driver.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
- #include "../common/mtk-dsp-sof-common.h"
- #include "../common/mtk-soc-card.h"
- #include "../common/mtk-soundcard-driver.h"
---- /dev/null
-+++ b/include/sound/mediatek/mtk-afe-fe-dai.h
-@@ -0,0 +1,53 @@
-+/* SPDX-License-Identifier: GPL-2.0 */
-+/*
-+ * mtk-afe-fe-dais.h  --  Mediatek afe fe dai operator definition
-+ *
-+ * Copyright (c) 2016 MediaTek Inc.
-+ * Author: Garlic Tseng <garlic.tseng at mediatek.com>
-+ */
-+
-+#ifndef _MTK_AFE_FE_DAI_H_
-+#define _MTK_AFE_FE_DAI_H_
-+
-+struct snd_soc_dai_ops;
-+struct mtk_base_afe;
-+struct mtk_base_afe_memif;
-+
-+int mtk_afe_fe_startup(struct snd_pcm_substream *substream,
-+		       struct snd_soc_dai *dai);
-+void mtk_afe_fe_shutdown(struct snd_pcm_substream *substream,
-+			 struct snd_soc_dai *dai);
-+int mtk_afe_fe_hw_params(struct snd_pcm_substream *substream,
-+			 struct snd_pcm_hw_params *params,
-+			 struct snd_soc_dai *dai);
-+int mtk_afe_fe_hw_free(struct snd_pcm_substream *substream,
-+		       struct snd_soc_dai *dai);
-+int mtk_afe_fe_prepare(struct snd_pcm_substream *substream,
-+		       struct snd_soc_dai *dai);
-+int mtk_afe_fe_trigger(struct snd_pcm_substream *substream, int cmd,
-+		       struct snd_soc_dai *dai);
-+
-+extern const struct snd_soc_dai_ops mtk_afe_fe_ops;
-+
-+int mtk_dynamic_irq_acquire(struct mtk_base_afe *afe);
-+int mtk_dynamic_irq_release(struct mtk_base_afe *afe, int irq_id);
-+int mtk_afe_suspend(struct snd_soc_component *component);
-+int mtk_afe_resume(struct snd_soc_component *component);
-+
-+int mtk_memif_set_enable(struct mtk_base_afe *afe, int id);
-+int mtk_memif_set_disable(struct mtk_base_afe *afe, int id);
-+int mtk_memif_set_addr(struct mtk_base_afe *afe, int id,
-+		       unsigned char *dma_area,
-+		       dma_addr_t dma_addr,
-+		       size_t dma_bytes);
-+int mtk_memif_set_channel(struct mtk_base_afe *afe,
-+			  int id, unsigned int channel);
-+int mtk_memif_set_rate(struct mtk_base_afe *afe,
-+		       int id, unsigned int rate);
-+int mtk_memif_set_rate_substream(struct snd_pcm_substream *substream,
-+				 int id, unsigned int rate);
-+int mtk_memif_set_format(struct mtk_base_afe *afe,
-+			 int id, snd_pcm_format_t format);
-+int mtk_memif_set_pbuf_size(struct mtk_base_afe *afe,
-+			    int id, int pbuf_size);
-+#endif
---- /dev/null
-+++ b/include/sound/mediatek/mtk-afe-platform-driver.h
-@@ -0,0 +1,28 @@
-+/* SPDX-License-Identifier: GPL-2.0 */
-+/*
-+ * mtk-afe-platform-driver.h  --  Mediatek afe platform driver definition
-+ *
-+ * Copyright (c) 2016 MediaTek Inc.
-+ * Author: Garlic Tseng <garlic.tseng at mediatek.com>
-+ */
-+
-+#ifndef _MTK_AFE_PLATFORM_DRIVER_H_
-+#define _MTK_AFE_PLATFORM_DRIVER_H_
-+
-+#define AFE_PCM_NAME "mtk-afe-pcm"
-+extern const struct snd_soc_component_driver mtk_afe_pcm_platform;
-+
-+struct mtk_base_afe;
-+struct snd_pcm;
-+struct snd_soc_component;
-+struct snd_soc_pcm_runtime;
-+
-+snd_pcm_uframes_t mtk_afe_pcm_pointer(struct snd_soc_component *component,
-+				      struct snd_pcm_substream *substream);
-+int mtk_afe_pcm_new(struct snd_soc_component *component,
-+		    struct snd_soc_pcm_runtime *rtd);
-+
-+int mtk_afe_combine_sub_dai(struct mtk_base_afe *afe);
-+int mtk_afe_add_sub_dai_control(struct snd_soc_component *component);
-+#endif
-+
---- a/sound/soc/mediatek/common/mtk-afe-fe-dai.h
-+++ /dev/null
-@@ -1,53 +0,0 @@
--/* SPDX-License-Identifier: GPL-2.0 */
--/*
-- * mtk-afe-fe-dais.h  --  Mediatek afe fe dai operator definition
-- *
-- * Copyright (c) 2016 MediaTek Inc.
-- * Author: Garlic Tseng <garlic.tseng at mediatek.com>
-- */
--
--#ifndef _MTK_AFE_FE_DAI_H_
--#define _MTK_AFE_FE_DAI_H_
--
--struct snd_soc_dai_ops;
--struct mtk_base_afe;
--struct mtk_base_afe_memif;
--
--int mtk_afe_fe_startup(struct snd_pcm_substream *substream,
--		       struct snd_soc_dai *dai);
--void mtk_afe_fe_shutdown(struct snd_pcm_substream *substream,
--			 struct snd_soc_dai *dai);
--int mtk_afe_fe_hw_params(struct snd_pcm_substream *substream,
--			 struct snd_pcm_hw_params *params,
--			 struct snd_soc_dai *dai);
--int mtk_afe_fe_hw_free(struct snd_pcm_substream *substream,
--		       struct snd_soc_dai *dai);
--int mtk_afe_fe_prepare(struct snd_pcm_substream *substream,
--		       struct snd_soc_dai *dai);
--int mtk_afe_fe_trigger(struct snd_pcm_substream *substream, int cmd,
--		       struct snd_soc_dai *dai);
--
--extern const struct snd_soc_dai_ops mtk_afe_fe_ops;
--
--int mtk_dynamic_irq_acquire(struct mtk_base_afe *afe);
--int mtk_dynamic_irq_release(struct mtk_base_afe *afe, int irq_id);
--int mtk_afe_suspend(struct snd_soc_component *component);
--int mtk_afe_resume(struct snd_soc_component *component);
--
--int mtk_memif_set_enable(struct mtk_base_afe *afe, int id);
--int mtk_memif_set_disable(struct mtk_base_afe *afe, int id);
--int mtk_memif_set_addr(struct mtk_base_afe *afe, int id,
--		       unsigned char *dma_area,
--		       dma_addr_t dma_addr,
--		       size_t dma_bytes);
--int mtk_memif_set_channel(struct mtk_base_afe *afe,
--			  int id, unsigned int channel);
--int mtk_memif_set_rate(struct mtk_base_afe *afe,
--		       int id, unsigned int rate);
--int mtk_memif_set_rate_substream(struct snd_pcm_substream *substream,
--				 int id, unsigned int rate);
--int mtk_memif_set_format(struct mtk_base_afe *afe,
--			 int id, snd_pcm_format_t format);
--int mtk_memif_set_pbuf_size(struct mtk_base_afe *afe,
--			    int id, int pbuf_size);
--#endif
---- a/sound/soc/mediatek/common/mtk-afe-platform-driver.h
-+++ /dev/null
-@@ -1,28 +0,0 @@
--/* SPDX-License-Identifier: GPL-2.0 */
--/*
-- * mtk-afe-platform-driver.h  --  Mediatek afe platform driver definition
-- *
-- * Copyright (c) 2016 MediaTek Inc.
-- * Author: Garlic Tseng <garlic.tseng at mediatek.com>
-- */
--
--#ifndef _MTK_AFE_PLATFORM_DRIVER_H_
--#define _MTK_AFE_PLATFORM_DRIVER_H_
--
--#define AFE_PCM_NAME "mtk-afe-pcm"
--extern const struct snd_soc_component_driver mtk_afe_pcm_platform;
--
--struct mtk_base_afe;
--struct snd_pcm;
--struct snd_soc_component;
--struct snd_soc_pcm_runtime;
--
--snd_pcm_uframes_t mtk_afe_pcm_pointer(struct snd_soc_component *component,
--				      struct snd_pcm_substream *substream);
--int mtk_afe_pcm_new(struct snd_soc_component *component,
--		    struct snd_soc_pcm_runtime *rtd);
--
--int mtk_afe_combine_sub_dai(struct mtk_base_afe *afe);
--int mtk_afe_add_sub_dai_control(struct snd_soc_component *component);
--#endif
--
diff --git a/target/linux/airoha/patches-6.12/123-02-ASoC-airoha-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch b/target/linux/airoha/patches-6.12/123-02-ASoC-airoha-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch
index 00578601c4..123d7181cd 100644
--- a/target/linux/airoha/patches-6.12/123-02-ASoC-airoha-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch
+++ b/target/linux/airoha/patches-6.12/123-02-ASoC-airoha-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch
@@ -1,94 +1,102 @@
-From 9989af6ed0dba86f57ac4aa1574f9ce9b1e640af Mon Sep 17 00:00:00 2001
+From 131f599fd0464f8e685610d9e24dadd8fbb4ba76 Mon Sep 17 00:00:00 2001
 From: Christian Marangi <ansuelsmth at gmail.com>
 Date: Thu, 31 Jul 2025 15:32:32 +0200
-Subject: [PATCH 2/3] ASoC: airoha: Add AFE and I2S driver for Airoha AN7581
+Subject: [PATCH] ASoC: airoha: Add AFE and machine driver for Airoha AN7581
 
 Add support for the Sound system present on Airoha AN7581 SoC. This is
 based on the mediatek AFE drivers.
 
-Also add the I2S driver to create an actual sound card for the AFE.
+Also add the machine driver to create an actual sound card for the AFE.
 
 Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 ---
- sound/soc/Kconfig                           |   1 +
- sound/soc/Makefile                          |   1 +
- sound/soc/airoha/Kconfig                    |  19 +
- sound/soc/airoha/Makefile                   |   2 +
- sound/soc/airoha/an7581/Makefile            |   8 +
- sound/soc/airoha/an7581/an7581-afe-common.h |  35 ++
- sound/soc/airoha/an7581/an7581-afe-pcm.c    | 455 ++++++++++++++++++++
- sound/soc/airoha/an7581/an7581-i2s.c        | 110 +++++
- sound/soc/airoha/an7581/an7581-reg.h        |  29 ++
- 9 files changed, 660 insertions(+)
- create mode 100644 sound/soc/airoha/Kconfig
- create mode 100644 sound/soc/airoha/Makefile
- create mode 100644 sound/soc/airoha/an7581/Makefile
- create mode 100644 sound/soc/airoha/an7581/an7581-afe-common.h
- create mode 100644 sound/soc/airoha/an7581/an7581-afe-pcm.c
- create mode 100644 sound/soc/airoha/an7581/an7581-i2s.c
- create mode 100644 sound/soc/airoha/an7581/an7581-reg.h
+ MAINTAINERS                                   |   8 +
+ sound/soc/mediatek/Kconfig                    |  20 +
+ sound/soc/mediatek/Makefile                   |   1 +
+ sound/soc/mediatek/an7581/Makefile            |   9 +
+ sound/soc/mediatek/an7581/an7581-afe-common.h |  39 ++
+ sound/soc/mediatek/an7581/an7581-afe-pcm.c    | 497 ++++++++++++++++++
+ sound/soc/mediatek/an7581/an7581-dai-etdm.c   | 407 ++++++++++++++
+ sound/soc/mediatek/an7581/an7581-reg.h        |  88 ++++
+ sound/soc/mediatek/an7581/an7581-wm8960.c     | 170 ++++++
+ 9 files changed, 1239 insertions(+)
+ create mode 100644 sound/soc/mediatek/an7581/Makefile
+ create mode 100644 sound/soc/mediatek/an7581/an7581-afe-common.h
+ create mode 100644 sound/soc/mediatek/an7581/an7581-afe-pcm.c
+ create mode 100644 sound/soc/mediatek/an7581/an7581-dai-etdm.c
+ create mode 100644 sound/soc/mediatek/an7581/an7581-reg.h
+ create mode 100644 sound/soc/mediatek/an7581/an7581-wm8960.c
 
---- a/sound/soc/Kconfig
-+++ b/sound/soc/Kconfig
-@@ -86,6 +86,7 @@ config SND_SOC_ACPI
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -728,6 +728,14 @@ F:	Documentation/devicetree/bindings/phy
+ F:	drivers/phy/phy-airoha-pcie-regs.h
+ F:	drivers/phy/phy-airoha-pcie.c
+ 
++AIROHA SOUND DRIVER
++M:	Christian Marangi <ansuelsmth at gmail.com>
++L:	linux-sound at vger.kernel.org
++S:	Maintained
++F:	Documentation/devicetree/bindings/sound/airoha,an7581-afe.yaml
++F:	Documentation/devicetree/bindings/sound/airoha,an7581-wm8960.yaml
++F:	sound/soc/mediatek/an7581/*
++
+ AIROHA SPI SNFI DRIVER
+ M:	Lorenzo Bianconi <lorenzo at kernel.org>
+ M:	Ray Liu <ray.liu at airoha.com>
+--- a/sound/soc/mediatek/Kconfig
++++ b/sound/soc/mediatek/Kconfig
+@@ -3,6 +3,26 @@ config SND_SOC_MEDIATEK
+ 	tristate
+ 	select REGMAP_MMIO
  
- # All the supported SoCs
- source "sound/soc/adi/Kconfig"
-+source "sound/soc/airoha/Kconfig"
- source "sound/soc/amd/Kconfig"
- source "sound/soc/apple/Kconfig"
- source "sound/soc/atmel/Kconfig"
---- a/sound/soc/Makefile
-+++ b/sound/soc/Makefile
-@@ -40,6 +40,7 @@ obj-$(CONFIG_SND_SOC)	+= codecs/
- obj-$(CONFIG_SND_SOC)	+= generic/
- obj-$(CONFIG_SND_SOC)	+= apple/
- obj-$(CONFIG_SND_SOC)	+= adi/
-+obj-$(CONFIG_SND_SOC)	+= airoha/
- obj-$(CONFIG_SND_SOC)	+= amd/
- obj-$(CONFIG_SND_SOC)	+= atmel/
- obj-$(CONFIG_SND_SOC)	+= au1x/
---- /dev/null
-+++ b/sound/soc/airoha/Kconfig
-@@ -0,0 +1,19 @@
-+# SPDX-License-Identifier: GPL-2.0-only
 +config SND_SOC_AN7581
 +	tristate "ASoC support for Airoha AN7581 chip"
 +	depends on ARCH_AIROHA || COMPILE_TEST
 +	select SND_SOC_MEDIATEK
 +	help
-+	  This adds ASoC driver for Airoha AN7581 boards
++	  This adds ASoC platform driver support for Airoha AN7581 chip
 +	  that can be used with other codecs.
 +	  Select Y if you have such device.
 +	  If unsure select "N".
 +
-+config SND_SOC_AN7581_I2S
-+	tristate "I2S support for Airoha AN7581 chip"
-+	depends on SND_SOC_AN7581
++config SND_SOC_AN7581_WM8960
++	tristate "ASoc Audio driver for Airoha AN7581 with WM8960 codec"
++	depends on SND_SOC_AN7581 && I2C
++	select SND_SOC_WM8960
 +	help
-+	  This adds I2S driver for Airoha AN7581 boards
-+	  that can be used with other codecs.
++	  This adds support for ASoC machine driver for Airoha AN7581
++	  boards with the WM8960 codecs.
 +	  Select Y if you have such device.
 +	  If unsure select "N".
---- /dev/null
-+++ b/sound/soc/airoha/Makefile
-@@ -0,0 +1,2 @@
-+# SPDX-License-Identifier: GPL-2.0
++
+ config SND_SOC_MT2701
+ 	tristate "ASoC support for Mediatek MT2701 chip"
+ 	depends on ARCH_MEDIATEK
+--- a/sound/soc/mediatek/Makefile
++++ b/sound/soc/mediatek/Makefile
+@@ -1,5 +1,6 @@
+ # SPDX-License-Identifier: GPL-2.0
+ obj-$(CONFIG_SND_SOC_MEDIATEK) += common/
 +obj-$(CONFIG_SND_SOC_AN7581) += an7581/
+ obj-$(CONFIG_SND_SOC_MT2701) += mt2701/
+ obj-$(CONFIG_SND_SOC_MT6797) += mt6797/
+ obj-$(CONFIG_SND_SOC_MT7986) += mt7986/
 --- /dev/null
-+++ b/sound/soc/airoha/an7581/Makefile
-@@ -0,0 +1,8 @@
++++ b/sound/soc/mediatek/an7581/Makefile
+@@ -0,0 +1,9 @@
 +# SPDX-License-Identifier: GPL-2.0
 +
 +# platform driver
 +snd-soc-an7581-afe-y := \
-+	an7581-afe-pcm.o
++	an7581-afe-pcm.o \
++	an7581-dai-etdm.o
 +
 +obj-$(CONFIG_SND_SOC_AN7581) += snd-soc-an7581-afe.o
-+obj-$(CONFIG_SND_SOC_AN7581_I2S) += an7581-i2s.o
++obj-$(CONFIG_SND_SOC_AN7581_WM8960) += an7581-wm8960.o
 --- /dev/null
-+++ b/sound/soc/airoha/an7581/an7581-afe-common.h
-@@ -0,0 +1,35 @@
++++ b/sound/soc/mediatek/an7581/an7581-afe-common.h
+@@ -0,0 +1,39 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * an7581-afe-common.h  --  Airoha AN7581 audio driver definitions
@@ -106,7 +114,8 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +	AN7581_MEMIF_DL1,
 +	AN7581_MEMIF_UL1,
 +	AN7581_MEMIF_NUM,
-+	AN7581_DAI_NUM = AN7581_MEMIF_NUM,
++	AN7581_DAI_ETDM = AN7581_MEMIF_NUM,
++	AN7581_DAI_NUM,
 +};
 +
 +enum {
@@ -123,10 +132,13 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +unsigned int an7581_afe_rate_transform(struct device *dev,
 +				       unsigned int rate);
 +
++/* dai register */
++int an7581_dai_etdm_register(struct mtk_base_afe *afe);
++
 +#endif
 --- /dev/null
-+++ b/sound/soc/airoha/an7581/an7581-afe-pcm.c
-@@ -0,0 +1,455 @@
++++ b/sound/soc/mediatek/an7581/an7581-afe-pcm.c
+@@ -0,0 +1,497 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Airoha ALSA SoC AFE platform driver for AN7581
@@ -139,31 +151,32 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +#include <linux/of.h>
 +#include <linux/of_address.h>
 +#include <linux/pm_runtime.h>
++#include <linux/reset.h>
 +
 +#include "an7581-afe-common.h"
 +#include "an7581-reg.h"
-+#include <sound/mediatek/mtk-afe-platform-driver.h>
-+#include <sound/mediatek/mtk-afe-fe-dai.h>
++#include "../common/mtk-afe-platform-driver.h"
++#include "../common/mtk-afe-fe-dai.h"
 +
 +enum {
-+	ARH_AFE_RATE_7K = 16,
 +	ARH_AFE_RATE_8K = 0,
-+	ARH_AFE_RATE_11K = 17,
 +	ARH_AFE_RATE_12K = 1,
-+	ARH_AFE_RATE_14K = 18,
 +	ARH_AFE_RATE_16K = 2,
-+	ARH_AFE_RATE_22K = 19,
 +	ARH_AFE_RATE_24K = 3,
-+	ARH_AFE_RATE_29K = 20,
 +	ARH_AFE_RATE_32K = 4,
-+	ARH_AFE_RATE_44K = 21,
 +	ARH_AFE_RATE_48K = 5,
-+	ARH_AFE_RATE_88K = 22,
 +	ARH_AFE_RATE_96K = 6,
-+	ARH_AFE_RATE_176K = 23,
 +	ARH_AFE_RATE_192K = 7,
-+	ARH_AFE_RATE_352K = 24,
 +	ARH_AFE_RATE_384K = 8,
++	ARH_AFE_RATE_7K = 16,
++	ARH_AFE_RATE_11K = 17,
++	ARH_AFE_RATE_14K = 18,
++	ARH_AFE_RATE_22K = 19,
++	ARH_AFE_RATE_29K = 20,
++	ARH_AFE_RATE_44K = 21,
++	ARH_AFE_RATE_88K = 22,
++	ARH_AFE_RATE_176K = 23,
++	ARH_AFE_RATE_352K = 24,
 +};
 +
 +unsigned int an7581_afe_rate_transform(struct device *dev, unsigned int rate)
@@ -275,7 +288,7 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +		.capture = {
 +			.stream_name = "UL1",
 +			.channels_min = 1,
-+			.channels_max = 2,
++			.channels_max = 8,
 +			.rates = SNDRV_PCM_RATE_8000_192000,
 +			.formats = ARH_PCM_FORMATS,
 +		},
@@ -283,6 +296,25 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +	},
 +};
 +
++static const struct snd_soc_dapm_widget an7581_memif_widgets[] = {
++	/* DL */
++	SND_SOC_DAPM_MIXER("I032", SND_SOC_NOPM, 0, 0, NULL, 0),
++	SND_SOC_DAPM_MIXER("I033", SND_SOC_NOPM, 0, 0, NULL, 0),
++
++	/* UL */
++	SND_SOC_DAPM_MIXER("O018", SND_SOC_NOPM, 0, 0, NULL, 0),
++	SND_SOC_DAPM_MIXER("O019", SND_SOC_NOPM, 0, 0, NULL, 0),
++};
++
++static const struct snd_soc_dapm_route an7581_memif_routes[] = {
++	{"I032", NULL, "DL1"},
++	{"I033", NULL, "DL1"},
++	{"UL1", NULL, "O018"},
++	{"UL1", NULL, "O019"},
++	{"O018", NULL, "I150"},
++	{"O019", NULL, "I151"},
++};
++
 +static const struct snd_soc_component_driver an7581_afe_pcm_dai_component = {
 +	.name = "an7581-afe-pcm-dai",
 +};
@@ -299,14 +331,20 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +		.fs_maskbit = -1,
 +		.mono_reg = -1,
 +		.mono_shift = -1,
-+		.hd_reg = -1,
-+		.hd_shift = -1,
++		.hd_reg = AFE_DL1_CON0,
++		.hd_shift = AFE_HD_SHIFT,
 +		.enable_reg = AFE_DAC_CON0,
-+		.enable_shift = 17,
++		.enable_shift = AFE_DL1_ENABLE_SHIFT,
 +		.msb_reg = -1,
 +		.msb_shift = -1,
 +		.agent_disable_reg = -1,
 +		.agent_disable_shift = -1,
++		.pbuf_reg = AFE_DL1_CON0,
++		.pbuf_mask = AFE_PBUF_SIZE_MASK,
++		.pbuf_shift = AFE_PBUF_SIZE_SHIFT,
++		.minlen_reg = AFE_DL1_CON0,
++		.minlen_mask = AFE_MINLEN_MASK,
++		.minlen_shift = AFE_MINLEN_SHIFT,
 +	},
 +	[AN7581_MEMIF_UL1] = {
 +		.name = "UL1",
@@ -319,12 +357,12 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +		.fs_maskbit = -1,
 +		.mono_reg = -1,
 +		.mono_shift = -1,
-+		.hd_reg = -1,
-+		.hd_shift = -1,
++		.hd_reg = AFE_UL1_CON0,
++		.hd_shift = AFE_HD_SHIFT,
 +		.enable_reg = AFE_DAC_CON0,
-+		.enable_shift = 1,
-+		.msb_reg = -1,
-+		.msb_shift = -1,
++		.enable_shift = AFE_UL1_ENABLE_SHIFT,
++		.msb_reg = AFE_UL1_CON0,
++		.msb_shift = AFE_MSB_SHIFT,
 +		.agent_disable_reg = -1,
 +		.agent_disable_shift = -1,
 +	},
@@ -333,29 +371,29 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +static const struct mtk_base_irq_data irq_data[AN7581_IRQ_NUM] = {
 +	[AN7581_IRQ_0] = {
 +		.id = AN7581_IRQ_0,
-+		.irq_cnt_reg = -1,
-+		.irq_cnt_shift = -1,
-+		.irq_cnt_maskbit = -1,
-+		.irq_en_reg = AFE_IRQ1_CON0,
-+		.irq_en_shift = 4,
++		.irq_cnt_reg = AFE_IRQ_CNT,
++		.irq_cnt_shift = AFE_IRQ_CNT_SHIFT,
++		.irq_cnt_maskbit = AFE_IRQ_CNT_MASK,
++		.irq_en_reg = AFE_IRQ_CON0,
++		.irq_en_shift = AFE_IRQ_ON_SHIFT,
 +		.irq_fs_reg = -1,
 +		.irq_fs_shift = -1,
 +		.irq_fs_maskbit = -1,
-+		.irq_clr_reg = AFE_IRQ1_CON0,
-+		.irq_clr_shift = 0,
++		.irq_clr_reg = AFE_IRQ_CON0,
++		.irq_clr_shift = AFE_IRQ_CLR_SHIFT,
 +	},
 +	[AN7581_IRQ_1] = {
 +		.id = AN7581_IRQ_1,
-+		.irq_cnt_reg = -1,
-+		.irq_cnt_shift = -1,
-+		.irq_cnt_maskbit = -1,
-+		.irq_en_reg = AFE_IRQ0_CON0,
-+		.irq_en_shift = 4,
++		.irq_cnt_reg = AFE_IRQ1_CNT,
++		.irq_cnt_shift = AFE_IRQ_CNT_SHIFT,
++		.irq_cnt_maskbit = AFE_IRQ_CNT_MASK,
++		.irq_en_reg = AFE_IRQ1_CON0,
++		.irq_en_shift = AFE_IRQ_ON_SHIFT,
 +		.irq_fs_reg = -1,
 +		.irq_fs_shift = -1,
 +		.irq_fs_maskbit = -1,
-+		.irq_clr_reg = AFE_IRQ0_CON0,
-+		.irq_clr_shift = 1,
++		.irq_clr_reg = AFE_IRQ1_CON0,
++		.irq_clr_shift = AFE_IRQ_CLR_SHIFT,
 +	},
 +};
 +
@@ -378,9 +416,9 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +	regmap_read(afe->regmap, AFE_IRQ_STS, &status);
 +
 +	if (status & AFE_IRQ_STS_RECORD)
-+		reg = AFE_IRQ0_CON0;
-+	else
 +		reg = AFE_IRQ1_CON0;
++	else
++		reg = AFE_IRQ_CON0;
 +
 +	regmap_set_bits(afe->regmap, reg, BIT(2));
 +	regmap_clear_bits(afe->regmap, reg, BIT(2));
@@ -429,18 +467,25 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +	dai->dai_drivers = an7581_memif_dai_driver;
 +	dai->num_dai_drivers = ARRAY_SIZE(an7581_memif_dai_driver);
 +
++	dai->dapm_widgets = an7581_memif_widgets;
++	dai->num_dapm_widgets = ARRAY_SIZE(an7581_memif_widgets);
++	dai->dapm_routes = an7581_memif_routes;
++	dai->num_dapm_routes = ARRAY_SIZE(an7581_memif_routes);
++
 +	return 0;
 +}
 +
 +typedef int (*dai_register_cb)(struct mtk_base_afe *);
 +static const dai_register_cb dai_register_cbs[] = {
++	an7581_dai_etdm_register,
 +	an7581_dai_memif_register,
 +};
 +
 +static int an7581_afe_pcm_dev_probe(struct platform_device *pdev)
 +{
-+	struct mtk_base_afe *afe;
 +	struct an7581_afe_private *afe_priv;
++	struct reset_control *reset;
++	struct mtk_base_afe *afe;
 +	struct device *dev;
 +	int i, irq_id, ret;
 +
@@ -454,6 +499,15 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +	if (!afe->platform_priv)
 +		return -ENOMEM;
 +
++	reset = devm_reset_control_get_exclusive(dev, NULL);
++	if (IS_ERR(reset))
++		return PTR_ERR(reset);
++
++	/* Global reset I2S */
++	reset_control_assert(reset);
++	usleep_range(10, 20);
++	reset_control_deassert(reset);
++
 +	afe_priv = afe->platform_priv;
 +	afe->dev = &pdev->dev;
 +	dev = afe->dev;
@@ -576,15 +630,516 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +		   .pm = pm_ptr(&an7581_afe_pm_ops),
 +	},
 +	.probe = an7581_afe_pcm_dev_probe,
-+	.remove_new = an7581_afe_pcm_dev_remove,
++	.remove = an7581_afe_pcm_dev_remove,
 +};
 +module_platform_driver(an7581_afe_pcm_driver);
 +
 +MODULE_DESCRIPTION("Airoha SoC AFE platform driver for ALSA AN7581");
 +MODULE_LICENSE("GPL");
 --- /dev/null
-+++ b/sound/soc/airoha/an7581/an7581-i2s.c
-@@ -0,0 +1,110 @@
++++ b/sound/soc/mediatek/an7581/an7581-dai-etdm.c
+@@ -0,0 +1,407 @@
++// SPDX-License-Identifier: GPL-2.0
++/*
++ * Airoha ALSA SoC Audio DAI eTDM Control
++ *
++ */
++
++#include <linux/bitfield.h>
++#include <linux/bitops.h>
++#include <linux/regmap.h>
++#include <sound/pcm_params.h>
++#include "an7581-afe-common.h"
++#include "an7581-reg.h"
++
++#define HOPPING_CLK  0
++#define APLL_CLK     1
++#define MTK_DAI_ETDM_FORMAT_I2S   0
++#define MTK_DAI_ETDM_FORMAT_DSPA  4
++#define MTK_DAI_ETDM_FORMAT_DSPB  5
++
++enum {
++	MTK_ETDM_RATE_8K = 0,
++	MTK_ETDM_RATE_12K = 1,
++	MTK_ETDM_RATE_16K = 2,
++	MTK_ETDM_RATE_24K = 3,
++	MTK_ETDM_RATE_32K = 4,
++	MTK_ETDM_RATE_48K = 5,
++	MTK_ETDM_RATE_96K = 6,
++	MTK_ETDM_RATE_192K = 7,
++	MTK_ETDM_RATE_384K = 8,
++	MTK_ETDM_RATE_7K = 16,
++	MTK_ETDM_RATE_11K = 17,
++	MTK_ETDM_RATE_14K = 18,
++	MTK_ETDM_RATE_22K = 19,
++	MTK_ETDM_RATE_29K = 20,
++	MTK_ETDM_RATE_44K = 21,
++	MTK_ETDM_RATE_88K = 22,
++	MTK_ETDM_RATE_176K = 23,
++	MTK_ETDM_RATE_352K = 24,
++};
++
++struct mtk_dai_etdm_priv {
++	bool bck_inv;
++	bool lrck_inv;
++	bool slave_mode;
++	unsigned int format;
++};
++
++static unsigned int an7581_etdm_rate_transform(struct device *dev, unsigned int rate)
++{
++	switch (rate) {
++	case 7350:
++		return MTK_ETDM_RATE_7K;
++	case 8000:
++		return MTK_ETDM_RATE_8K;
++	case 11025:
++		return MTK_ETDM_RATE_11K;
++	case 12000:
++		return MTK_ETDM_RATE_12K;
++	case 14700:
++		return MTK_ETDM_RATE_14K;
++	case 16000:
++		return MTK_ETDM_RATE_16K;
++	case 22050:
++		return MTK_ETDM_RATE_22K;
++	case 24000:
++		return MTK_ETDM_RATE_24K;
++	case 29400:
++		return MTK_ETDM_RATE_29K;
++	case 32000:
++		return MTK_ETDM_RATE_32K;
++	case 44100:
++		return MTK_ETDM_RATE_44K;
++	case 48000:
++		return MTK_ETDM_RATE_48K;
++	case 88200:
++		return MTK_ETDM_RATE_88K;
++	case 96000:
++		return MTK_ETDM_RATE_96K;
++	case 176400:
++		return MTK_ETDM_RATE_176K;
++	case 192000:
++		return MTK_ETDM_RATE_192K;
++	case 352800:
++		return MTK_ETDM_RATE_352K;
++	case 384000:
++		return MTK_ETDM_RATE_384K;
++	default:
++		dev_warn(dev, "%s(), rate %u invalid, using %d!!!\n",
++			 __func__, rate, MTK_ETDM_RATE_48K);
++		return MTK_ETDM_RATE_48K;
++	}
++}
++
++static int get_etdm_wlen(unsigned int bitwidth)
++{
++	return bitwidth <= 16 ? 16 : 32;
++}
++
++static const struct snd_soc_dapm_widget mtk_dai_etdm_widgets[] = {
++	/* DL */
++	SND_SOC_DAPM_MIXER("I150", SND_SOC_NOPM, 0, 0, NULL, 0),
++	SND_SOC_DAPM_MIXER("I151", SND_SOC_NOPM, 0, 0, NULL, 0),
++
++	/* UL */
++	SND_SOC_DAPM_MIXER("O124", SND_SOC_NOPM, 0, 0, NULL, 0),
++	SND_SOC_DAPM_MIXER("O125", SND_SOC_NOPM, 0, 0, NULL, 0),
++};
++
++static const struct snd_soc_dapm_route mtk_dai_etdm_routes[] = {
++	{"I150", NULL, "ETDM Capture"},
++	{"I151", NULL, "ETDM Capture"},
++	{"ETDM Playback", NULL, "O124"},
++	{"ETDM Playback", NULL, "O125"},
++	{"O124", NULL, "I032"},
++	{"O125", NULL, "I033"},
++};
++
++/* dai ops */
++static int mtk_dai_etdm_startup(struct snd_pcm_substream *substream,
++				struct snd_soc_dai *dai)
++{
++	return 0;
++}
++
++static void mtk_dai_etdm_shutdown(struct snd_pcm_substream *substream,
++				  struct snd_soc_dai *dai)
++{
++}
++
++static unsigned int get_etdm_ch_fixup(unsigned int channels)
++{
++	if (channels > 16)
++		return 24;
++	else if (channels > 8)
++		return 16;
++	else if (channels > 4)
++		return 8;
++	else if (channels > 2)
++		return 4;
++	else
++		return 2;
++}
++
++static int mtk_dai_etdm_config(struct mtk_base_afe *afe,
++			       struct snd_pcm_hw_params *params,
++			       struct snd_soc_dai *dai,
++			       int stream)
++{
++	struct an7581_afe_private *afe_priv = afe->platform_priv;
++	struct mtk_dai_etdm_priv *etdm_data = afe_priv->dai_priv[dai->id];
++	unsigned int rate = params_rate(params);
++	unsigned int etdm_rate = an7581_etdm_rate_transform(afe->dev, rate);
++	unsigned int channels = params_channels(params);
++	unsigned int bit_width = params_width(params);
++	unsigned int wlen = get_etdm_wlen(bit_width);
++	unsigned int val = 0;
++	unsigned int mask = 0;
++
++	dev_dbg(afe->dev, "%s(), stream %d, rate %u, bitwidth %u\n",
++		__func__, stream, rate, bit_width);
++
++	/* CON0 */
++	mask |= ETDM_BIT_LEN;
++	val |= FIELD_PREP(ETDM_BIT_LEN, bit_width - 1);
++	mask |= ETDM_WRD_LEN;
++	val |= FIELD_PREP(ETDM_WRD_LEN, wlen - 1);
++	mask |= ETDM_FMT;
++	val |= FIELD_PREP(ETDM_FMT, etdm_data->format);
++	mask |= ETDM_CH_NUM;
++	val |= FIELD_PREP(ETDM_CH_NUM, get_etdm_ch_fixup(channels) - 1);
++	mask |= ETDM_MODE;
++	val |= ETDM_MODE;
++
++	switch (stream) {
++	case SNDRV_PCM_STREAM_PLAYBACK:
++		/* set ETDM_OUT1_CON0 */
++		regmap_update_bits(afe->regmap, ETDM_OUT1_CON0, mask, val);
++
++		/* set ETDM_OUT1_CON1 */
++		regmap_update_bits(afe->regmap, ETDM_OUT1_CON1,
++				   EDTM_DIRECT_INPUT_MASTER_BCK |
++				   EDTM_LRCK_AUTO_MODE |
++				   EDTM_CKEN_SEL | EDTM_LRCK_AUTO_OFF |
++				   EDTM_INITIAL_POINT | EDTM_INITIAL_COUNT,
++				   EDTM_DIRECT_INPUT_MASTER_BCK |
++				   EDTM_LRCK_AUTO_MODE |
++				   EDTM_CKEN_SEL | EDTM_LRCK_AUTO_OFF |
++				   FIELD_PREP(EDTM_INITIAL_POINT, 14) |
++				   FIELD_PREP(EDTM_INITIAL_COUNT, 14));
++
++		/* set ETDM_OUT1_CON4 */
++		regmap_update_bits(afe->regmap, ETDM_OUT1_CON4, OUT_SEL_FS,
++				   FIELD_PREP(OUT_SEL_FS, etdm_rate));
++		break;
++	case SNDRV_PCM_STREAM_CAPTURE:
++		/* set ETDM_IN1_CON0 */
++		regmap_update_bits(afe->regmap, ETDM_IN1_CON0, mask, val);
++		regmap_set_bits(afe->regmap, ETDM_IN1_CON0, ETDM_SYNC);
++
++		/* set ETDM_IN1_CON1 */
++		regmap_update_bits(afe->regmap, ETDM_IN1_CON1,
++				   EDTM_LRCK_AUTO_MODE |
++				   EDTM_CKEN_SEL | EDTM_LRCK_AUTO_OFF |
++				   EDTM_INITIAL_POINT | EDTM_INITIAL_COUNT,
++				   EDTM_LRCK_AUTO_MODE |
++				   EDTM_CKEN_SEL | EDTM_LRCK_AUTO_OFF |
++				   FIELD_PREP(EDTM_INITIAL_POINT, 14) |
++				   FIELD_PREP(EDTM_INITIAL_COUNT, 14));
++
++		/* set ETDM_IN1_CON3 */
++		regmap_update_bits(afe->regmap, ETDM_IN1_CON3, IN_SEL_FS,
++				   FIELD_PREP(IN_SEL_FS, etdm_rate));
++		break;
++	default:
++		break;
++	}
++
++	return 0;
++}
++
++static int mtk_dai_etdm_hw_params(struct snd_pcm_substream *substream,
++				  struct snd_pcm_hw_params *params,
++				  struct snd_soc_dai *dai)
++{
++	unsigned int rate = params_rate(params);
++	struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
++
++	regmap_update_bits(afe->regmap, ETDM_COWORK_CON0,
++			   EDTM_IN1_SLAVE_SEL, FIELD_PREP(EDTM_IN1_SLAVE_SEL, 1));
++	regmap_update_bits(afe->regmap, ETDM_COWORK_CON0,
++			   EDTM_OUT1_SLAVE_SEL, FIELD_PREP(EDTM_OUT1_SLAVE_SEL, 1));
++	regmap_update_bits(afe->regmap, ETDM_COWORK_CON1,
++			   EDTM_IN1_SDATA0_SEL, FIELD_PREP(EDTM_IN1_SDATA0_SEL, 0));
++
++	switch (rate) {
++	case 8000:
++	case 12000:
++	case 16000:
++	case 24000:
++	case 32000:
++	case 48000:
++	case 96000:
++	case 192000:
++		mtk_dai_etdm_config(afe, params, dai, substream->stream);
++		return 0;
++	default:
++		dev_err(afe->dev,
++			"Sample rate %d invalid. Supported rates: 8/12/16/24/32/48/96/192 kHz\n",
++			rate);
++		return -EINVAL;
++	}
++}
++
++static int mtk_dai_etdm_trigger(struct snd_pcm_substream *substream, int cmd,
++				struct snd_soc_dai *dai)
++{
++	struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
++
++	dev_dbg(afe->dev, "%s(), cmd %d, dai id %d\n", __func__, cmd, dai->id);
++	switch (cmd) {
++	case SNDRV_PCM_TRIGGER_START:
++	case SNDRV_PCM_TRIGGER_RESUME:
++		regmap_set_bits(afe->regmap, ETDM_IN1_CON0, ETDM_EN);
++		regmap_set_bits(afe->regmap, ETDM_OUT1_CON0, ETDM_EN);
++		break;
++	case SNDRV_PCM_TRIGGER_STOP:
++	case SNDRV_PCM_TRIGGER_SUSPEND:
++		regmap_clear_bits(afe->regmap, ETDM_IN1_CON0, ETDM_EN);
++		regmap_clear_bits(afe->regmap, ETDM_OUT1_CON0, ETDM_EN);
++		break;
++	default:
++		break;
++	}
++
++	return 0;
++}
++
++static int mtk_dai_etdm_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
++{
++	struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
++	struct an7581_afe_private *afe_priv = afe->platform_priv;
++	struct mtk_dai_etdm_priv *etdm_data;
++	void *priv_data;
++
++	switch (dai->id) {
++	case AN7581_DAI_ETDM:
++		break;
++	default:
++		dev_warn(afe->dev, "%s(), id %d not support\n",
++			 __func__, dai->id);
++		return -EINVAL;
++	}
++
++	priv_data = devm_kzalloc(afe->dev, sizeof(struct mtk_dai_etdm_priv),
++				 GFP_KERNEL);
++	if (!priv_data)
++		return -ENOMEM;
++
++	afe_priv->dai_priv[dai->id] = priv_data;
++	etdm_data = afe_priv->dai_priv[dai->id];
++
++	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
++	case SND_SOC_DAIFMT_I2S:
++		etdm_data->format = MTK_DAI_ETDM_FORMAT_I2S;
++		break;
++	case SND_SOC_DAIFMT_DSP_A:
++		etdm_data->format = MTK_DAI_ETDM_FORMAT_DSPA;
++		break;
++	case SND_SOC_DAIFMT_DSP_B:
++		etdm_data->format = MTK_DAI_ETDM_FORMAT_DSPB;
++		break;
++	default:
++		return -EINVAL;
++	}
++
++	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
++	case SND_SOC_DAIFMT_NB_NF:
++		etdm_data->bck_inv = false;
++		etdm_data->lrck_inv = false;
++		break;
++	case SND_SOC_DAIFMT_NB_IF:
++		etdm_data->bck_inv = false;
++		etdm_data->lrck_inv = true;
++		break;
++	case SND_SOC_DAIFMT_IB_NF:
++		etdm_data->bck_inv = true;
++		etdm_data->lrck_inv = false;
++		break;
++	case SND_SOC_DAIFMT_IB_IF:
++		etdm_data->bck_inv = true;
++		etdm_data->lrck_inv = true;
++		break;
++	default:
++		return -EINVAL;
++	}
++
++	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
++	case SND_SOC_DAIFMT_CBP_CFP:
++		etdm_data->slave_mode = true;
++		break;
++	case SND_SOC_DAIFMT_CBC_CFC:
++		etdm_data->slave_mode = false;
++		break;
++	default:
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static const struct snd_soc_dai_ops mtk_dai_etdm_ops = {
++	.startup = mtk_dai_etdm_startup,
++	.shutdown = mtk_dai_etdm_shutdown,
++	.hw_params = mtk_dai_etdm_hw_params,
++	.trigger = mtk_dai_etdm_trigger,
++	.set_fmt = mtk_dai_etdm_set_fmt,
++};
++
++/* dai driver */
++#define MTK_ETDM_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
++			  SNDRV_PCM_FMTBIT_S24_LE |\
++			  SNDRV_PCM_FMTBIT_S32_LE)
++
++static struct snd_soc_dai_driver mtk_dai_etdm_driver[] = {
++	{
++		.name = "ETDM",
++		.id = AN7581_DAI_ETDM,
++		.capture = {
++			.stream_name = "ETDM Capture",
++			.channels_min = 1,
++			.channels_max = 2,
++			.rates = SNDRV_PCM_RATE_8000_192000,
++			.formats = MTK_ETDM_FORMATS,
++		},
++		.playback = {
++			.stream_name = "ETDM Playback",
++			.channels_min = 1,
++			.channels_max = 2,
++			.rates = SNDRV_PCM_RATE_8000_192000,
++			.formats = MTK_ETDM_FORMATS,
++		},
++		.ops = &mtk_dai_etdm_ops,
++		.symmetric_rate = 1,
++		.symmetric_sample_bits = 1,
++	},
++};
++
++int an7581_dai_etdm_register(struct mtk_base_afe *afe)
++{
++	struct mtk_base_afe_dai *dai;
++
++	dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL);
++	if (!dai)
++		return -ENOMEM;
++
++	list_add(&dai->list, &afe->sub_dais);
++
++	dai->dai_drivers = mtk_dai_etdm_driver;
++	dai->num_dai_drivers = ARRAY_SIZE(mtk_dai_etdm_driver);
++
++	dai->dapm_widgets = mtk_dai_etdm_widgets;
++	dai->num_dapm_widgets = ARRAY_SIZE(mtk_dai_etdm_widgets);
++	dai->dapm_routes = mtk_dai_etdm_routes;
++	dai->num_dapm_routes = ARRAY_SIZE(mtk_dai_etdm_routes);
++
++	return 0;
++}
+--- /dev/null
++++ b/sound/soc/mediatek/an7581/an7581-reg.h
+@@ -0,0 +1,88 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++/*
++ * an7581-reg.h  --  Airoha AN7581 audio driver reg definition
++ */
++
++#ifndef _AN7581_REG_H_
++#define _AN7581_REG_H_
++
++#define AFE_DAC_CON0			0x0
++#define   AFE_DL1_ENABLE_SHIFT		17
++#define   AFE_UL1_ENABLE_SHIFT		1
++
++#define ETDM_COWORK_CON0		0x4c
++#define   EDTM_IN1_SLAVE_SEL		GENMASK(27, 24)
++#define   EDTM_OUT1_SLAVE_SEL		GENMASK(11, 8)
++#define ETDM_COWORK_CON1		0x50
++#define   EDTM_IN1_SDATA0_SEL		GENMASK(3, 0)
++#define ETDM_IN1_CON0			0x5c
++#define   EDTM_LRCK_AUTO_MODE		BIT(29)
++#define   ETDM_CH_NUM			GENMASK(27, 23)
++#define   ETDM_WRD_LEN			GENMASK(20, 16)
++#define   ETDM_BIT_LEN			GENMASK(15, 11)
++#define   ETDM_FMT			GENMASK(8, 6)
++#define   ETDM_MODE			BIT(5)
++#define   ETDM_SYNC			BIT(1)
++#define   ETDM_EN			BIT(0)
++#define ETDM_IN1_CON1			0x60
++#define ETDM_IN1_CON2			0x64
++#define   IN_CLK_SRC			GENMASK(12, 10)
++#define ETDM_IN1_CON3			0x68
++#define   IN_SEL_FS			GENMASK(30, 26)
++#define ETDM_IN1_CON4			0x6c
++#define   IN_RELATCH			GENMASK(24, 20)
++#define   IN_CLK_INV			BIT(18)
++#define ETDM_IN1_CON5			0x70
++#define ETDM_IN1_CON6			0x74
++#define ETDM_OUT1_CON0			0x7c
++#define ETDM_OUT1_CON1			0x80
++#define   EDTM_DIRECT_INPUT_MASTER_BCK	BIT(30)
++#define   EDTM_CKEN_SEL			BIT(12)
++#define   EDTM_LRCK_AUTO_OFF		BIT(10)
++#define   EDTM_INITIAL_POINT		GENMASK(9, 5)
++#define   EDTM_INITIAL_COUNT		GENMASK(4, 0)
++#define ETDM_OUT1_CON2			0x84
++#define ETDM_OUT1_CON3			0x88
++#define ETDM_OUT1_CON4			0x8c
++#define   OUT_RELATCH			GENMASK(28, 24)
++#define   OUT_CLK_SRC			GENMASK(8, 6)
++#define   OUT_SEL_FS			GENMASK(4, 0)
++#define ETDM_OUT1_CON5			0x90
++#define   ETDM_CLK_DIV			BIT(12)
++#define   OUT_CLK_INV			BIT(9)
++#define ETDM_OUT1_CON6			0x94
++#define ETDM_OUT1_CON7			0x98
++
++#define AFE_DL1_BASE			0xa8
++#define AFE_DL1_END			0xb0
++#define AFE_DL1_CUR			0xac
++#define AFE_DL1_CON0			0xb4
++#define   AFE_PBUF_SIZE_SHIFT		16
++#define   AFE_PBUF_SIZE_MASK		GENMASK(1, 0)
++#define   AFE_MINLEN_SHIFT		8
++#define   AFE_MINLEN_MASK		GENMASK(3, 0)
++#define   AFE_HD_SHIFT			5
++
++#define AFE_UL1_BASE			0xc4
++#define AFE_UL1_END			0xc8
++#define AFE_UL1_CUR			0xcc
++#define AFE_UL1_CON0			0xd0
++#define   AFE_MSB_SHIFT			6
++
++#define AFE_IRQ_CON0			0xe4
++#define   AFE_IRQ_ON_SHIFT		0
++#define   AFE_IRQ_CLR_SHIFT		1
++#define AFE_IRQ_CNT			0xe8
++#define   AFE_IRQ_CNT_SHIFT		0
++#define   AFE_IRQ_CNT_MASK		GENMASK(31, 0)
++
++#define AFE_IRQ_STS			0xf8
++#define  AFE_IRQ_STS_PLAY		BIT(1)
++#define  AFE_IRQ_STS_RECORD		BIT(0)
++
++#define AFE_IRQ1_CON0			0x100
++#define AFE_IRQ1_CNT			0x104
++
++#define AFE_MAX_REGISTER		AFE_IRQ1_CON0
++
++#endif
+--- /dev/null
++++ b/sound/soc/mediatek/an7581/an7581-wm8960.c
+@@ -0,0 +1,170 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Airoha ALSA SoC I2S platform driver for AN7581
@@ -596,6 +1151,16 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +
 +#include "an7581-afe-common.h"
 +
++static const struct snd_soc_dapm_widget an7581_wm8960_widgets[] = {
++	SND_SOC_DAPM_HP("Headphone", NULL),
++	SND_SOC_DAPM_MIC("AMIC", NULL),
++};
++
++static const struct snd_kcontrol_new an7581_wm8960_controls[] = {
++	SOC_DAPM_PIN_SWITCH("Headphone"),
++	SOC_DAPM_PIN_SWITCH("AMIC"),
++};
++
 +SND_SOC_DAILINK_DEFS(playback,
 +		     DAILINK_COMP_ARRAY(COMP_CPU("DL1")),
 +		     DAILINK_COMP_ARRAY(COMP_DUMMY()),
@@ -606,10 +1171,16 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +		     DAILINK_COMP_ARRAY(COMP_DUMMY()),
 +		     DAILINK_COMP_ARRAY(COMP_EMPTY()));
 +
-+static struct snd_soc_dai_link an7581_i2s_dai_links[] = {
++SND_SOC_DAILINK_DEFS(codec,
++		     DAILINK_COMP_ARRAY(COMP_CPU("ETDM")),
++		     DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8960-hifi")),
++		     DAILINK_COMP_ARRAY(COMP_EMPTY()));
++
++static struct snd_soc_dai_link an7581_wm8960_dai_links[] = {
++	/* FE */
 +	{
-+		.name = "an7581-i2s-playback",
-+		.stream_name = "an7581-i2s-playback",
++		.name = "wm8960-playback",
++		.stream_name = "wm8960-playback",
 +		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
 +			    SND_SOC_DPCM_TRIGGER_POST},
 +		.dynamic = 0,
@@ -617,29 +1188,43 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +		SND_SOC_DAILINK_REG(playback),
 +	},
 +	{
-+		.name = "an7581-i2s-capture",
-+		.stream_name = "an7581-i2s-capture",
++		.name = "wm8960-capture",
++		.stream_name = "wm8960-capture",
 +		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
 +			    SND_SOC_DPCM_TRIGGER_POST},
 +		.dynamic = 0,
 +		.capture_only = 1,
 +		SND_SOC_DAILINK_REG(capture),
 +	},
++	/* BE */
++	{
++		.name = "wm8960-codec",
++		.no_pcm = 1,
++		.dai_fmt = SND_SOC_DAIFMT_I2S |
++			SND_SOC_DAIFMT_NB_NF |
++			SND_SOC_DAIFMT_CBC_CFC |
++			SND_SOC_DAIFMT_GATED,
++		SND_SOC_DAILINK_REG(codec),
++	},
 +};
 +
-+static struct snd_soc_card an7581_i2s_card = {
-+	.name = "an7581-i2s",
++static struct snd_soc_card an7581_wm8960_card = {
++	.name = "an7581-wm8960",
 +	.owner = THIS_MODULE,
-+	.dai_link = an7581_i2s_dai_links,
-+	.num_links = ARRAY_SIZE(an7581_i2s_dai_links),
++	.dai_link = an7581_wm8960_dai_links,
++	.num_links = ARRAY_SIZE(an7581_wm8960_dai_links),
++	.controls = an7581_wm8960_controls,
++	.num_controls = ARRAY_SIZE(an7581_wm8960_controls),
++	.dapm_widgets = an7581_wm8960_widgets,
++	.num_dapm_widgets = ARRAY_SIZE(an7581_wm8960_widgets),
 +};
 +
-+static int an7581_i2s_machine_probe(struct platform_device *pdev)
++static int an7581_wm8960_machine_probe(struct platform_device *pdev)
 +{
-+	struct snd_soc_card *card = &an7581_i2s_card;
-+	struct device_node *platform_dai_node;
++	struct device_node *platform_dai_node, *codec_dai_node;
++	struct snd_soc_card *card = &an7581_wm8960_card;
++	struct device_node *platform, *codec;
 +	struct snd_soc_dai_link *dai_link;
-+	struct device_node *platform;
 +	int ret, i;
 +
 +	card->dev = &pdev->dev;
@@ -665,6 +1250,35 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +		dai_link->platforms->of_node = platform_dai_node;
 +	}
 +
++	codec = of_get_child_by_name(pdev->dev.of_node, "codec");
++
++	if (codec) {
++		codec_dai_node = of_parse_phandle(codec, "sound-dai", 0);
++		of_node_put(codec);
++
++		if (!codec_dai_node) {
++			of_node_put(platform_dai_node);
++			dev_err(&pdev->dev, "Failed to parse codec/sound-dai property\n");
++			return -EINVAL;
++		}
++	} else {
++		of_node_put(platform_dai_node);
++		dev_err(&pdev->dev, "Property 'codec' missing or invalid\n");
++		return -EINVAL;
++	}
++
++	for_each_card_prelinks(card, i, dai_link) {
++		if (dai_link->codecs->name)
++			continue;
++		dai_link->codecs->of_node = codec_dai_node;
++	}
++
++	ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
++	if (ret) {
++		dev_err(&pdev->dev, "Failed to parse audio-routing: %d\n", ret);
++		goto err_of_node_put;
++	}
++
 +	ret = devm_snd_soc_register_card(&pdev->dev, card);
 +	if (ret) {
 +		dev_err_probe(&pdev->dev, ret, "%s snd_soc_register_card fail\n", __func__);
@@ -675,55 +1289,24 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +
 +err_of_node_put:
 +	of_node_put(platform_dai_node);
++	of_node_put(codec_dai_node);
 +	return ret;
 +}
 +
-+static const struct of_device_id an7581_i2s_machine_dt_match[] = {
-+	{ .compatible = "airoha,an7581-i2s" },
++static const struct of_device_id an7581_wm8960_machine_dt_match[] = {
++	{ .compatible = "airoha,an7581-wm8960-sound" },
 +	{ /* sentinel */ }
 +};
-+MODULE_DEVICE_TABLE(of, an7581_i2s_machine_dt_match);
++MODULE_DEVICE_TABLE(of, an7581_wm8960_machine_dt_match);
 +
-+static struct platform_driver an7581_i2s_driver = {
++static struct platform_driver an7581_wm8960_driver = {
 +	.driver = {
-+		   .name = "an7581-i2s",
-+		   .of_match_table = an7581_i2s_machine_dt_match,
++		   .name = "an7581-wm8960",
++		   .of_match_table = an7581_wm8960_machine_dt_match,
 +	},
-+	.probe = an7581_i2s_machine_probe,
++	.probe = an7581_wm8960_machine_probe,
 +};
-+module_platform_driver(an7581_i2s_driver);
++module_platform_driver(an7581_wm8960_driver);
 +
 +MODULE_DESCRIPTION("Airoha SoC I2S platform driver for ALSA AN7581");
 +MODULE_LICENSE("GPL");
---- /dev/null
-+++ b/sound/soc/airoha/an7581/an7581-reg.h
-@@ -0,0 +1,29 @@
-+/* SPDX-License-Identifier: GPL-2.0 */
-+/*
-+ * an7581-reg.h  --  Airoha AN7581 audio driver reg definition
-+ */
-+
-+#ifndef _AN7581_REG_H_
-+#define _AN7581_REG_H_
-+
-+#define AFE_DAC_CON0			0x0
-+
-+#define AFE_DL1_BASE			0xa8
-+#define AFE_DL1_END			0xac
-+#define AFE_DL1_CUR			0xb0
-+
-+#define AFE_UL1_BASE			0xc4
-+#define AFE_UL1_END			0xc8
-+#define AFE_UL1_CUR			0xcc
-+
-+#define AFE_IRQ0_CON0			0xe4
-+
-+#define AFE_IRQ_STS			0xf8
-+#define  AFE_IRQ_STS_PLAY		BIT(1)
-+#define  AFE_IRQ_STS_RECORD		BIT(0)
-+
-+#define AFE_IRQ1_CON0			0x100
-+
-+#define AFE_MAX_REGISTER		AFE_IRQ1_CON0
-+
-+#endif



From lede-commits at lists.infradead.org  Thu Dec  4 15:55:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 04 Dec 2025 18:55:41 -0500
Subject: [openwrt/openwrt]  airoha: fix kernel panic from I2S driver
In-Reply-To: <176489254196.3044215.7542350705451213274@git-01.infra.openwrt.org>
References: <176489254196.3044215.7542350705451213274@git-01.infra.openwrt.org>
Message-ID: <mailman.33239.1764892555.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cc57e155a60891631c5040b9c4a3a2c0d1dbf38f

commit cc57e155a60891631c5040b9c4a3a2c0d1dbf38f
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Fri Dec 5 00:54:38 2025 +0100

    airoha: fix kernel panic from I2S driver
    
    Commit 8f1914053b24 ("airoha: replace I2S patch with upstream pending
    version") introduced a kernel panic with I2S driver.
    
    Add the fixed patch to fix the kernel panic.
    
    Fixes: 8f1914053b24 ("airoha: replace I2S patch with upstream pending version")
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...-02-ASoC-airoha-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/airoha/patches-6.12/123-02-ASoC-airoha-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch b/target/linux/airoha/patches-6.12/123-02-ASoC-airoha-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch
index 123d7181cd..b5cd4982f1 100644
--- a/target/linux/airoha/patches-6.12/123-02-ASoC-airoha-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch
+++ b/target/linux/airoha/patches-6.12/123-02-ASoC-airoha-Add-AFE-and-I2S-driver-for-Airoha-AN7581.patch
@@ -499,6 +499,10 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +	if (!afe->platform_priv)
 +		return -ENOMEM;
 +
++	afe_priv = afe->platform_priv;
++	afe->dev = &pdev->dev;
++	dev = afe->dev;
++
 +	reset = devm_reset_control_get_exclusive(dev, NULL);
 +	if (IS_ERR(reset))
 +		return PTR_ERR(reset);
@@ -508,10 +512,6 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +	usleep_range(10, 20);
 +	reset_control_deassert(reset);
 +
-+	afe_priv = afe->platform_priv;
-+	afe->dev = &pdev->dev;
-+	dev = afe->dev;
-+
 +	afe->base_addr = devm_platform_ioremap_resource(pdev, 0);
 +	if (IS_ERR(afe->base_addr))
 +		return PTR_ERR(afe->base_addr);



From lede-commits at lists.infradead.org  Fri Dec  5 01:27:03 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 05 Dec 2025 04:27:03 -0500
Subject: [openwrt/openwrt]  ath79: fix platform check image mikrotik nor
In-Reply-To: <176492682308.1006279.8951331177508612615@git-01.infra.openwrt.org>
References: <176492682308.1006279.8951331177508612615@git-01.infra.openwrt.org>
Message-ID: <mailman.33420.1764926829.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3a10dd596760ecebe5d8a5f3804bfe1d13f952ae

commit 3a10dd596760ecebe5d8a5f3804bfe1d13f952ae
Author: Marcin Maj <marcinmajsc at gmail.com>
AuthorDate: Thu Dec 4 01:43:41 2025 +0100

    ath79: fix platform check image mikrotik nor
    
    Every attempt to update a device with NOR flash
    and RouterBOOT v6 resulted in the error:
    ?RouterBOOT 6 and earlier requires ELF-in-YAFFS image.?
    The cause was that xargs did not fully remove whitespace,
    so the condition "$bootentry" != "kernel" always evaluated to true.
    
    Signed-off-by: Marcin Maj <marcinmajsc at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21034
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh
index 629e7fd9b8..67e8d77175 100644
--- a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh
@@ -6,7 +6,7 @@ REQUIRE_IMAGE_METADATA=1
 
 platform_check_image_mikrotik_nor() {
 	local bootfwver bootfwmajor
-	local bootentry="$(dd bs=10 skip=1 count=1 if="$1" 2>/dev/null | xargs -0)"
+	local bootentry="$(dd bs=10 skip=1 count=1 if="$1" 2>/dev/null | xargs)"
 
 	read -r bootfwver < /sys/firmware/mikrotik/hard_config/booter_version
 	bootfwmajor="${bootfwver%%.*}"



From lede-commits at lists.infradead.org  Fri Dec  5 10:48:13 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 05 Dec 2025 13:48:13 -0500
Subject: [openwrt/openwrt]  odhcp6c: update to Git HEAD (2025-12-04)
In-Reply-To: <176496049303.2839553.8109708565459479008@git-01.infra.openwrt.org>
References: <176496049303.2839553.8109708565459479008@git-01.infra.openwrt.org>
Message-ID: <mailman.33575.1764960498.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1842735a069badd074ba0a4318764c699080e3ae

commit 1842735a069badd074ba0a4318764c699080e3ae
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Dec 4 10:20:45 2025 +0100

    odhcp6c: update to Git HEAD (2025-12-04)
    
    f19dd37fb467 odhcp6c: accept EUI64 and random for interface ID
    e955729c781f formal: fix workflow permissions
    9557d3e245aa vscode: set tabs to 8 whitespaces by default
    98dfd156f399 src: fix shadowed local variables
    
    https://github.com/openwrt/odhcp6c/compare/f98b6ec82362...f19dd37fb467
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 5aa8ab0c12..a28042c934 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
-PKG_SOURCE_DATE:=2025-11-24
-PKG_SOURCE_VERSION:=f98b6ec82362607a01b7421935d99f54068a80e0
-PKG_MIRROR_HASH:=c9abe17fcfad0c4ff08c7c311e5ed160f97e0a03064d4140012c2ab62d3d3d1c
+PKG_SOURCE_DATE:=2025-12-04
+PKG_SOURCE_VERSION:=f19dd37fb467c9cf10cad57aefa0d048312d7dfd
+PKG_MIRROR_HASH:=30b8e16589cc26d251e40feaad847b47529c19f2862c6396cf85c5e474c97576
 PKG_MAINTAINER:=Hans Dedecker <dedeckeh at gmail.com>
 PKG_LICENSE:=GPL-2.0
 



From lede-commits at lists.infradead.org  Fri Dec  5 15:57:19 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 05 Dec 2025 18:57:19 -0500
Subject: [openwrt/openwrt]  rockchip: drop sdmmc speed limitation for
 RK3576/RK3588
In-Reply-To: <176497903983.3614969.7399066046506474169@git-01.infra.openwrt.org>
References: <176497903983.3614969.7399066046506474169@git-01.infra.openwrt.org>
Message-ID: <mailman.33628.1764979048.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e159d1ec815b3b6b69ffca8824cd1550b87f4735

commit e159d1ec815b3b6b69ffca8824cd1550b87f4735
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Fri Oct 17 15:28:57 2025 +0800

    rockchip: drop sdmmc speed limitation for RK3576/RK3588
    
    The stability issue doesn't seem to be found on newer rockchip SoCs
    like RK3528, RK3576 and RK3588, so drop the sdr50 limitation.
    
    In addtion, the HS200 limitation for NanoPC T6 is also removed as
    upstream fixed the real issue in mmc driver.
    
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
    Link: https://github.com/openwrt/openwrt/pull/20432
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...ockchip-lower-mmc-speed-for-Radxa-Rock-5A.patch | 26 ----------------------
 ...ockchip-lower-mmc-speed-for-Radxa-Rock-5B.patch | 26 ----------------------
 ...ts-rockchip-lower-mmc-speed-for-nanopc-t6.patch | 21 -----------------
 ...rockchip-lower-mmc-speed-for-ArmSom-Sige7.patch | 26 ----------------------
 ...ockchip-lower-mmc-speed-for-Radxa-ROCK-4D.patch | 11 ---------
 5 files changed, 110 deletions(-)

diff --git a/target/linux/rockchip/patches-6.12/117-arm64-dts-rockchip-lower-mmc-speed-for-Radxa-Rock-5A.patch b/target/linux/rockchip/patches-6.12/117-arm64-dts-rockchip-lower-mmc-speed-for-Radxa-Rock-5A.patch
deleted file mode 100644
index 46bb494e41..0000000000
--- a/target/linux/rockchip/patches-6.12/117-arm64-dts-rockchip-lower-mmc-speed-for-Radxa-Rock-5A.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Tianling Shen <cnsztl at gmail.com>
-Date: Mon Aug 05 16:14:33 2024 +0800
-Subject: [PATCH] arm64: dts: rockchip: lower mmc speed for Radxa Rock 5A
-
-The previously stated speed of sdr-104 in is too high for the hardware
-to reliably communicate with some fast SD cards.
-Rockchip boards have a common bug when operating uhs speed, which will
-hang the system during a soft reboot.
-
-To be on the safe side, lower the speed to workaround.
-
-Signed-off-by: Tianling Shen <cnsztl at gmail.com>
----
-
---- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
-+++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
-@@ -440,7 +440,7 @@
- 	max-frequency = <150000000>;
- 	no-sdio;
- 	no-mmc;
--	sd-uhs-sdr104;
-+	sd-uhs-sdr50;
- 	vmmc-supply = <&vcc_3v3_s0>;
- 	vqmmc-supply = <&vccio_sd_s0>;
- 	status = "okay";
diff --git a/target/linux/rockchip/patches-6.12/119-arm64-dts-rockchip-lower-mmc-speed-for-Radxa-Rock-5B.patch b/target/linux/rockchip/patches-6.12/119-arm64-dts-rockchip-lower-mmc-speed-for-Radxa-Rock-5B.patch
deleted file mode 100644
index 63002e753e..0000000000
--- a/target/linux/rockchip/patches-6.12/119-arm64-dts-rockchip-lower-mmc-speed-for-Radxa-Rock-5B.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Tianling Shen <cnsztl at gmail.com>
-Date: Mon Aug 05 16:14:33 2024 +0800
-Subject: [PATCH] arm64: dts: rockchip: lower mmc speed for Radxa Rock 5B
-
-The previously stated speed of sdr-104 in is too high for the hardware
-to reliably communicate with some fast SD cards.
-Rockchip boards have a common bug when operating uhs speed, which will
-hang the system during a soft reboot.
-
-To be on the safe side, lower the speed to workaround.
-
-Signed-off-by: Tianling Shen <cnsztl at gmail.com>
----
-
---- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b-5bp-5t.dtsi
-+++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b-5bp-5t.dtsi
-@@ -452,7 +452,7 @@
- 	cap-sd-highspeed;
- 	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
- 	disable-wp;
--	sd-uhs-sdr104;
-+	sd-uhs-sdr50;
- 	vmmc-supply = <&vcc_3v3_s3>;
- 	vqmmc-supply = <&vccio_sd_s0>;
- 	status = "okay";
diff --git a/target/linux/rockchip/patches-6.12/121-arm64-dts-rockchip-lower-mmc-speed-for-nanopc-t6.patch b/target/linux/rockchip/patches-6.12/121-arm64-dts-rockchip-lower-mmc-speed-for-nanopc-t6.patch
deleted file mode 100644
index 0080830f00..0000000000
--- a/target/linux/rockchip/patches-6.12/121-arm64-dts-rockchip-lower-mmc-speed-for-nanopc-t6.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
-+++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
-@@ -619,8 +619,7 @@
- 	no-sd;
- 	non-removable;
- 	max-frequency = <200000000>;
--	mmc-hs400-1_8v;
--	mmc-hs400-enhanced-strobe;
-+	mmc-hs200-1_8v;
- 	status = "okay";
- };
- 
-@@ -632,7 +631,7 @@
- 	disable-wp;
- 	no-mmc;
- 	no-sdio;
--	sd-uhs-sdr104;
-+	sd-uhs-sdr50;
- 	vmmc-supply = <&vcc3v3_sd_s0>;
- 	vqmmc-supply = <&vccio_sd_s0>;
- 	status = "okay";
diff --git a/target/linux/rockchip/patches-6.12/126-arm64-dts-rockchip-lower-mmc-speed-for-ArmSom-Sige7.patch b/target/linux/rockchip/patches-6.12/126-arm64-dts-rockchip-lower-mmc-speed-for-ArmSom-Sige7.patch
deleted file mode 100644
index 01f1c74370..0000000000
--- a/target/linux/rockchip/patches-6.12/126-arm64-dts-rockchip-lower-mmc-speed-for-ArmSom-Sige7.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Tianling Shen <cnsztl at gmail.com>
-Date: Mon Sep 23 13:22:56 2024 +0800
-Subject: [PATCH] arm64: dts: rockchip: lower mmc speed for ArmSom Sige7
-
-The previously stated speed of sdr-104 in is too high for the hardware
-to reliably communicate with some fast SD cards.
-Rockchip boards have a common bug when operating uhs speed, which will
-hang the system during a soft reboot.
-
-To be on the safe side, lower the speed to workaround.
-
-Signed-off-by: Tianling Shen <cnsztl at gmail.com>
----
-
---- a/arch/arm64/boot/dts/rockchip/rk3588-armsom-sige7.dts
-+++ b/arch/arm64/boot/dts/rockchip/rk3588-armsom-sige7.dts
-@@ -346,7 +346,7 @@
- 	max-frequency = <200000000>;
- 	no-sdio;
- 	no-mmc;
--	sd-uhs-sdr104;
-+	sd-uhs-sdr50;
- 	vmmc-supply = <&vcc_3v3_s3>;
- 	vqmmc-supply = <&vccio_sd_s0>;
- 	status = "okay";
diff --git a/target/linux/rockchip/patches-6.12/135-arm64-dts-rockchip-lower-mmc-speed-for-Radxa-ROCK-4D.patch b/target/linux/rockchip/patches-6.12/135-arm64-dts-rockchip-lower-mmc-speed-for-Radxa-ROCK-4D.patch
deleted file mode 100644
index ad5b8848e9..0000000000
--- a/target/linux/rockchip/patches-6.12/135-arm64-dts-rockchip-lower-mmc-speed-for-Radxa-ROCK-4D.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts
-+++ b/arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts
-@@ -771,7 +771,7 @@
- 	max-frequency = <200000000>;
- 	no-sdio;
- 	no-mmc;
--	sd-uhs-sdr104;
-+	sd-uhs-sdr50;
- 	vmmc-supply = <&vcc_3v3_s3>;
- 	vqmmc-supply = <&vccio_sd_s0>;
- 	status = "okay";



From lede-commits at lists.infradead.org  Fri Dec  5 15:59:55 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 05 Dec 2025 18:59:55 -0500
Subject: [openwrt/openwrt]  mpc85xx: p1010: Fix Sophos RED 15w NAND partitions
In-Reply-To: <176497919579.3620208.4801803364803068009@git-01.infra.openwrt.org>
References: <176497919579.3620208.4801803364803068009@git-01.infra.openwrt.org>
Message-ID: <mailman.33629.1764979199.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/09e7b24ceb5d9310334c4f88327dc6d58052e7fd

commit 09e7b24ceb5d9310334c4f88327dc6d58052e7fd
Author: Shine <4c.fce2 at proton.me>
AuthorDate: Tue Nov 11 19:49:16 2025 +0100

    mpc85xx: p1010: Fix Sophos RED 15w NAND partitions
    
    This partially reverts 78d259e7d28d212425164fc64bf0b9d8669d6020.
    That commit broke mounting the root fs on Sophos RED 15w due to
    partition size mismatch, and changed the partition sequence, causing
    the OpenWrt partition numbers to change from mtd3:kernel/mtd4:ubi to
    mtd4:kernel/mtd5:ubi.
    
    Fixes: 78d259e7d28d ("mpc85xx: fix some dtc warnings")
    Signed-off-by: Shine <4c.fce2 at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/20745
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files/arch/powerpc/boot/dts/red-15w-rev1.dts   | 24 +++++++++-------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
index 19bb8023ed..ac7209bd51 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
@@ -165,23 +165,19 @@
 					read-only;
 				};
 
+				partition at 300000 {
+					reg = <0x300000 0x800000>;
+					label = "kernel";
+				};
+
+				partition at b00000 {
+					reg = <0xb00000 0x7500000>;
+					label = "ubi";
+				};
+
 				oem-partition at 300000 {
 					reg = <0x300000 0x1900000>;
 					label = "sophos-os1";
-
-					compatible = "fixed-partitions";
-					#address-cells = <1>;
-					#size-cells = <1>;
-
-					partition at 0 {
-						reg = <0x0 0x800000>;
-						label = "kernel";
-					};
-
-					partition at 800000 {
-						reg = <0x800000 0x7500000>;
-						label = "ubi";
-					};
 				};
 
 				oem-partition at 1c00000 {



From lede-commits at lists.infradead.org  Fri Dec  5 16:49:23 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 05 Dec 2025 19:49:23 -0500
Subject: [openwrt/openwrt]  libunwind: fix complie for PPC32
In-Reply-To: <176498216363.3721664.1470740135875962975@git-01.infra.openwrt.org>
References: <176498216363.3721664.1470740135875962975@git-01.infra.openwrt.org>
Message-ID: <mailman.33691.1764982168.2093109.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/00c8b5c612d07e36ede1e9ebe2b44ba88fa90000

commit 00c8b5c612d07e36ede1e9ebe2b44ba88fa90000
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Fri Dec 5 19:50:22 2025 +0100

    libunwind: fix complie for PPC32
    
    libunwind fails to compile because the include for the WORDSIZE
    definition was missing when compiling with musl libc.
    
    This lead to unw_word_t being defined as 64 bit long instead
    of the correct 32 bit.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 package/libs/libunwind/Makefile                   |  2 +-
 package/libs/libunwind/patches/004-ppc-musl.patch | 26 +++++++++++++++++++++--
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/package/libs/libunwind/Makefile b/package/libs/libunwind/Makefile
index f2363116fc..2ed8988acd 100644
--- a/package/libs/libunwind/Makefile
+++ b/package/libs/libunwind/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libunwind
 PKG_VERSION:=1.8.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/libunwind/libunwind/releases/download/v$(PKG_VERSION)/
diff --git a/package/libs/libunwind/patches/004-ppc-musl.patch b/package/libs/libunwind/patches/004-ppc-musl.patch
index 5ea79e1462..22b803b785 100644
--- a/package/libs/libunwind/patches/004-ppc-musl.patch
+++ b/package/libs/libunwind/patches/004-ppc-musl.patch
@@ -1,6 +1,17 @@
 --- a/include/libunwind-ppc32.h
 +++ b/include/libunwind-ppc32.h
-@@ -81,6 +81,88 @@ typedef int64_t unw_sword_t;
+@@ -40,6 +40,10 @@ extern "C" {
+ #include <stdint.h>
+ #include <ucontext.h>
+ 
++#ifndef __GLIBC__
++#include <bits/reg.h>
++#endif
++
+ #ifndef UNW_EMPTY_STRUCT
+ #  define UNW_EMPTY_STRUCT uint8_t unused;
+ #endif
+@@ -81,6 +85,88 @@ typedef int64_t unw_sword_t;
  
  typedef long double unw_tdep_fpreg_t;
  
@@ -91,7 +102,18 @@
      UNW_PPC32_R0,
 --- a/include/libunwind-ppc64.h
 +++ b/include/libunwind-ppc64.h
-@@ -88,6 +88,88 @@ typedef struct {
+@@ -40,6 +40,10 @@ extern "C" {
+ #include <stdint.h>
+ #include <ucontext.h>
+ 
++#ifndef __GLIBC__
++#include <bits/reg.h>
++#endif
++
+ #ifndef UNW_EMPTY_STRUCT
+ #  define UNW_EMPTY_STRUCT uint8_t unused;
+ #endif
+@@ -88,6 +92,88 @@ typedef struct {
      uint64_t halves[2];
  } unw_tdep_vreg_t;
  



From lede-commits at lists.infradead.org  Sat Dec  6 09:56:55 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 06 Dec 2025 12:56:55 -0500
Subject: [openwrt/openwrt]  bcm53xx: image: sync targets names with DT
 compatible
In-Reply-To: <176504381592.2606819.16962130808447865607@git-01.infra.openwrt.org>
References: <176504381592.2606819.16962130808447865607@git-01.infra.openwrt.org>
Message-ID: <mailman.33748.1765043821.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/ff63c5cd82a555df553bdfa42f1630399fb5e019

commit ff63c5cd82a555df553bdfa42f1630399fb5e019
Author: Mario Andr?s P?rez <mapb_ at outlook.com>
AuthorDate: Sat Dec 6 02:44:18 2025 +0100

    bcm53xx: image: sync targets names with DT compatible
    
    Some devices profile names and *.dts files are named without suffix
    "-v1" but the DT compatible has the suffix. (xwr-3150 exception)
    
    This breaks ASU sysupgrades since the default SUPPORTED_DEVICES is the
    makefile image profile target and it does not match the actual DT
    compatible sent by the ASU client.
    
    This is not breaking sysupgrade because the platform implementation
    does not depends on DEVICE_NAME(not use sysupgrade-TAR). And the
    board_name() checks are done against the correct DT compatible.[1]
    
    [1]: https://github.com/openwrt/openwrt/blob/09e7b24ceb5d9310334c4f88327dc6d58052e7fd/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh#L36-L62
    Fixes: https://github.com/openwrt/asu/issues/560
    Fixes: https://github.com/openwrt/asu/issues/560#issuecomment-2083236275
    Fixes: https://github.com/openwrt/asu/issues/1108
    Fixes: https://forum.openwrt.org/t/luci-attended-sysupgrade-support-thread/230552/243
    Fixes: c459a6b "bcm53xx: add support for Luxul FullMAC WiFi devices"
    Fixes: 1d47f81 "bcm53xx: build images for Luxul ABR-4500 and XBR-4500 routers"
    Signed-off-by: Mario Andr?s P?rez <mapb_ at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21056
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/bcm53xx/image/Makefile | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index 08ed88382d..17ccdeb275 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -345,39 +345,41 @@ define Device/luxul
   IMAGE/lxl := append-ubi | trx-nand | luxul-lxl
 endef
 
-define Device/luxul_abr-4500
+define Device/luxul_abr-4500-v1
   $(Device/luxul)
   DEVICE_MODEL := ABR-4500
   DEVICE_PACKAGES := $(USB3_PACKAGES)
+  DEVICE_DTS := bcm47094-luxul-abr-4500
   LUXUL_BOARD := ABR-4500
 endef
-TARGET_DEVICES += luxul_abr-4500
+TARGET_DEVICES += luxul_abr-4500-v1
 
-define Device/luxul_xap-1610
+define Device/luxul_xap-1610-v1
   $(Device/luxul)
   DEVICE_MODEL := XAP-1610
   DEVICE_PACKAGES := $(BRCMFMAC_4366C0)
+  DEVICE_DTS := bcm47094-luxul-xap-1610
   IMAGE/lxl := append-rootfs | trx-serial | luxul-lxl
   LUXUL_BOARD := XAP-1610
 endef
-TARGET_DEVICES += luxul_xap-1610
+TARGET_DEVICES += luxul_xap-1610-v1
 
-define Device/luxul_xbr-4500
+define Device/luxul_xbr-4500-v1
   $(Device/luxul)
   DEVICE_MODEL := XBR-4500
   DEVICE_PACKAGES := $(USB3_PACKAGES)
+  DEVICE_DTS := bcm47094-luxul-xbr-4500
   LUXUL_BOARD := XBR-4500
 endef
-TARGET_DEVICES += luxul_xbr-4500
+TARGET_DEVICES += luxul_xbr-4500-v1
 
-define Device/luxul_xwr-3150
+define Device/luxul_xwr-3150-v1
   $(Device/luxul)
   DEVICE_MODEL := XWR-3150
   DEVICE_PACKAGES := $(BRCMFMAC_4366C0) $(USB3_PACKAGES)
-  DEVICE_DTS := bcm47094-luxul-xwr-3150-v1
   LUXUL_BOARD := XWR-3150
 endef
-TARGET_DEVICES += luxul_xwr-3150
+TARGET_DEVICES += luxul_xwr-3150-v1
 
 define Device/meraki_mr26
   DEVICE_VENDOR := Meraki
@@ -464,13 +466,14 @@ define Device/netgear
   NETGEAR_REGION := 1
 endef
 
-define Device/netgear_r6250
+define Device/netgear_r6250-v1
   DEVICE_MODEL := R6250
   DEVICE_PACKAGES := $(B43) $(USB3_PACKAGES)
+  DEVICE_DTS := bcm4708-netgear-r6250
   $(Device/netgear)
   NETGEAR_BOARD_ID := U12H245T00_NETGEAR
 endef
-TARGET_DEVICES += netgear_r6250
+TARGET_DEVICES += netgear_r6250-v1
 
 define Device/netgear_r6300-v2
   DEVICE_MODEL := R6300



From lede-commits at lists.infradead.org  Sat Dec  6 10:31:10 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 06 Dec 2025 13:31:10 -0500
Subject: [openwrt/openwrt]  lantiq: tplink_tdw89x0: use led-sources for wifi
 LED
In-Reply-To: <176504587048.2759339.16857865871426774737@git-01.infra.openwrt.org>
References: <176504587048.2759339.16857865871426774737@git-01.infra.openwrt.org>
Message-ID: <mailman.33752.1765045876.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a90fb76736868134793f3a934df77848afeb1b38

commit a90fb76736868134793f3a934df77848afeb1b38
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Dec 5 19:44:33 2025 -0800

    lantiq: tplink_tdw89x0: use led-sources for wifi LED
    
    Avoids having to create a custom LED for wifi.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21059
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi  | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi
index 104c905baa..30927fe549 100644
--- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi
+++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi
@@ -18,7 +18,6 @@
 
 		led-dsl = &led_dsl;
 		led-internet = &led_internet;
-		led-wifi = &led_wifi;
 	};
 
 	memory at 0 {
@@ -88,17 +87,6 @@
 		};
 	};
 
-	ath9k-leds {
-		compatible = "gpio-leds";
-
-		led_wifi: wifi {
-			label = "green:wifi";
-			gpios = <&ath9k 0 GPIO_ACTIVE_HIGH>;
-			linux,default-trigger = "phy0tpt";
-		};
-	};
-
-
 	usb_vbus: regulator-usb-vbus {
 		compatible = "regulator-fixed";
 
@@ -207,9 +195,11 @@
 
 		ath9k: wifi at 0,0 {
 			reg = <0 0 0 0 0>;
-			#gpio-cells = <2>;
-			gpio-controller;
 			ieee80211-freq-limit = <2402000 2482000>;
+
+			led {
+				led-sources = <0>;
+			};
 		};
 	};
 };



From lede-commits at lists.infradead.org  Sun Dec  7 02:25:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 05:25:43 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: remove disabled partitions
 node
In-Reply-To: <176510314396.2010935.3452729479711347936@git-01.infra.openwrt.org>
References: <176510314396.2010935.3452729479711347936@git-01.infra.openwrt.org>
Message-ID: <mailman.33783.1765103150.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3bbb4f6ce7b265b8ac13437f519fd0352bd0a3d6

commit 3bbb4f6ce7b265b8ac13437f519fd0352bd0a3d6
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Sat Nov 29 20:35:55 2025 +0400

    qualcommax: ipq50xx: remove disabled partitions node
    
    Although the bootloader tries to 'fixup' the qpic nand node, it actually
    can't find it as the node was renamed to spi based on the new driver
    architecture. The added benefit is that it also silences build warning:
    
    Warning (spi_bus_reg): /soc at 0/spi at 79b0000/partitions: missing or empty reg property
    
    Signed-off-by: George Moussalem <george.moussalem at outlook.com>
    ---
    Node rename:
    
    old node name: qpic-nand at 79b0000
    new node name: spi at 79b0000
    
    Bootloader logs:
    
       Booting using the fdt blob at 0x44d3fc78
       Uncompressing Kernel Image ... OK
       Loading Device Tree to 4a3f6000, end 4a3ff805 ... OK
    fdt_fixup_qpic: QPIC: unable to find node '/soc/qpic-nand at 79b0000'
    parse_fdt_fixup: unable to find node '/soc/qpic-nand at 79b0000/'
    Link: https://github.com/openwrt/openwrt/pull/20982
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax830.dts | 4 ----
 .../linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts | 4 ----
 .../qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi    | 4 ----
 3 files changed, 12 deletions(-)

diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax830.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax830.dts
index 8f9f027fd3..90d930909e 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax830.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax830.dts
@@ -287,10 +287,6 @@
 	pinctrl-names = "default";
 	status = "okay";
 
-	partitions {
-		status = "disabled";
-	};
-
 	nand at 0 {
 		compatible = "spi-nand";
 		reg = <0>;
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts
index f81e5171d0..592fc84c5b 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts
@@ -286,10 +286,6 @@
 	pinctrl-names = "default";
 	status = "okay";
 
-	partitions {
-		status = "disabled";
-	};
-
 	nand at 0 {
 		compatible = "spi-nand";
 		reg = <0>;
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
index 6644263545..a69385e17f 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
@@ -113,10 +113,6 @@
 	pinctrl-names = "default";
 	status = "okay";
 
-	partitions {
-		status = "disabled";
-	};
-
 	nand at 0 {
 		compatible = "spi-nand";
 		reg = <0>;



From lede-commits at lists.infradead.org  Sun Dec  7 02:25:44 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 05:25:44 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: fix qca8337 dtc warnings
In-Reply-To: <176510314396.2010935.3452729479711347936@git-01.infra.openwrt.org>
References: <176510314396.2010935.3452729479711347936@git-01.infra.openwrt.org>
Message-ID: <mailman.33784.1765103150.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9323ed52d030134f5b23e56dfd139f62167b1af6

commit 9323ed52d030134f5b23e56dfd139f62167b1af6
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Sat Nov 29 21:01:48 2025 +0400

    qualcommax: ipq50xx: fix qca8337 dtc warnings
    
    Add missing address-cells and size-cells properties under the switch's
    ports node to fix a multitude of below build warnings:
    
    Warning (reg_format): /soc at 0/mdio at 90000/ethernet-switch at 11/ports/port at 1:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
    Warning (avoid_default_addr_size): /soc at 0/mdio at 90000/ethernet-switch at 11/ports/port at 1: Relying on default #address-cells value
    
    Signed-off-by: George Moussalem <george.moussalem at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/20982
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts
index bfe9589ecd..4782101483 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts
@@ -393,6 +393,9 @@
 		reg = <17>;
 
 		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
 			port at 1 {
 				reg = <1>;
 				label = "lan1";



From lede-commits at lists.infradead.org  Sun Dec  7 02:51:39 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 05:51:39 -0500
Subject: [openwrt/openwrt]  odhcp6c: update to Git HEAD (2025-12-06)
In-Reply-To: <176510469956.2147365.4997105381280167304@git-01.infra.openwrt.org>
References: <176510469956.2147365.4997105381280167304@git-01.infra.openwrt.org>
Message-ID: <mailman.33785.1765104704.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/35dbdd644c8039e56b1537972a8995c4feba167b

commit 35dbdd644c8039e56b1537972a8995c4feba167b
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Sat Dec 6 17:13:27 2025 +0100

    odhcp6c: update to Git HEAD (2025-12-06)
    
    1d6c4e794cdb src: convert allow_slaac_only to boolean
    8cfe71daaad7 src: stop overriding allow_slaac_only values
    aac34157167b odhcp6c: drop script_sync_delay override
    05aa750fbe44 config: fix default value for allow_slaac_only
    
    https://github.com/openwrt/odhcp6c/compare/f19dd37fb467...1d6c4e794cdb
    
    Also add myself as maintainer.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index a28042c934..b34615b0c7 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -12,10 +12,11 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
-PKG_SOURCE_DATE:=2025-12-04
-PKG_SOURCE_VERSION:=f19dd37fb467c9cf10cad57aefa0d048312d7dfd
-PKG_MIRROR_HASH:=30b8e16589cc26d251e40feaad847b47529c19f2862c6396cf85c5e474c97576
-PKG_MAINTAINER:=Hans Dedecker <dedeckeh at gmail.com>
+PKG_SOURCE_DATE:=2025-12-06
+PKG_SOURCE_VERSION:=1d6c4e794cdb86963e29b7dc332d0bc20ba6306c
+PKG_MIRROR_HASH:=b7c8fb6c76a7c2f2ef3d9bb9e867e8b9f54b4ecb535d6715c0da1fdaebb6ce51
+
+PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk



From lede-commits at lists.infradead.org  Sun Dec  7 11:29:50 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 14:29:50 -0500
Subject: [openwrt/openwrt]  mpc85xx: p1010: Fix Sophos RED 15w NAND partitions
In-Reply-To: <176513579048.485425.6488627333744633756@git-01.infra.openwrt.org>
References: <176513579048.485425.6488627333744633756@git-01.infra.openwrt.org>
Message-ID: <mailman.33848.1765135794.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/0ed59099ee105925926df4d811b131b97706d530

commit 0ed59099ee105925926df4d811b131b97706d530
Author: Shine <4c.fce2 at proton.me>
AuthorDate: Tue Nov 11 19:49:16 2025 +0100

    mpc85xx: p1010: Fix Sophos RED 15w NAND partitions
    
    This partially reverts 78d259e7d28d212425164fc64bf0b9d8669d6020.
    That commit broke mounting the root fs on Sophos RED 15w due to
    partition size mismatch, and changed the partition sequence, causing
    the OpenWrt partition numbers to change from mtd3:kernel/mtd4:ubi to
    mtd4:kernel/mtd5:ubi.
    
    Fixes: 78d259e7d28d ("mpc85xx: fix some dtc warnings")
    (cherry-picked from commit 09e7b24ceb5d9310334c4f88327dc6d58052e7fd)
    Signed-off-by: Shine <4c.fce2 at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21062
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files/arch/powerpc/boot/dts/red-15w-rev1.dts   | 24 +++++++++-------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
index 19bb8023ed..ac7209bd51 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
@@ -165,23 +165,19 @@
 					read-only;
 				};
 
+				partition at 300000 {
+					reg = <0x300000 0x800000>;
+					label = "kernel";
+				};
+
+				partition at b00000 {
+					reg = <0xb00000 0x7500000>;
+					label = "ubi";
+				};
+
 				oem-partition at 300000 {
 					reg = <0x300000 0x1900000>;
 					label = "sophos-os1";
-
-					compatible = "fixed-partitions";
-					#address-cells = <1>;
-					#size-cells = <1>;
-
-					partition at 0 {
-						reg = <0x0 0x800000>;
-						label = "kernel";
-					};
-
-					partition at 800000 {
-						reg = <0x800000 0x7500000>;
-						label = "ubi";
-					};
 				};
 
 				oem-partition at 1c00000 {



From lede-commits at lists.infradead.org  Sun Dec  7 15:37:33 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 18:37:33 -0500
Subject: [openwrt/openwrt]  rtl8812au-ct: rework patch to support kernel 6.18
In-Reply-To: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
References: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
Message-ID: <mailman.33855.1765150649.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cc20942931543387d39221266829e2eabfe67d38

commit cc20942931543387d39221266829e2eabfe67d38
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Tue Dec 2 20:31:26 2025 +0100

    rtl8812au-ct: rework patch to support kernel 6.18
    
    Rework patch to support backports package based on kernel 6.18.
    
    Link: https://github.com/openwrt/openwrt/pull/20964
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../rtl8812au-ct/patches/100-api_update.patch      | 28 +++++++++++++++++++++-
 .../kernel/rtl8812au-ct/patches/110-link_id.patch  |  6 ++---
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/package/kernel/rtl8812au-ct/patches/100-api_update.patch b/package/kernel/rtl8812au-ct/patches/100-api_update.patch
index ca888d6963..d5cc72bedc 100644
--- a/package/kernel/rtl8812au-ct/patches/100-api_update.patch
+++ b/package/kernel/rtl8812au-ct/patches/100-api_update.patch
@@ -44,7 +44,33 @@
  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
                                          , bool unicast, bool multicast
  #endif
-@@ -4031,7 +4034,8 @@ static int cfg80211_rtw_change_beacon(st
+@@ -2349,7 +2352,7 @@ exit:
+ 
+ }
+ 
+-static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed)
++static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed)
+ {
+ #if 0
+ 	struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
+@@ -3142,6 +3145,7 @@ static int cfg80211_rtw_set_txpower(stru
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+                                     struct wireless_dev *wdev,
+ #endif
++				     int radio_idx,
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) || defined(COMPAT_KERNEL_RELEASE)
+                                     enum nl80211_tx_power_setting type, int mbm)
+ #else
+@@ -3180,7 +3184,7 @@ static int cfg80211_rtw_set_txpower(stru
+ 
+ static int cfg80211_rtw_get_txpower(struct wiphy *wiphy,
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+-                                    struct wireless_dev *wdev,
++                                    struct wireless_dev *wdev, int radio_idx,
+ #endif
+                                     int *dbm)
+ {
+@@ -4031,7 +4035,8 @@ static int cfg80211_rtw_change_beacon(st
  	return ret;
  }
  
diff --git a/package/kernel/rtl8812au-ct/patches/110-link_id.patch b/package/kernel/rtl8812au-ct/patches/110-link_id.patch
index 70121c27be..ae2e224aab 100644
--- a/package/kernel/rtl8812au-ct/patches/110-link_id.patch
+++ b/package/kernel/rtl8812au-ct/patches/110-link_id.patch
@@ -1,11 +1,11 @@
 --- a/os_dep/linux/ioctl_cfg80211.c
 +++ b/os_dep/linux/ioctl_cfg80211.c
-@@ -3183,7 +3183,7 @@ static int cfg80211_rtw_set_txpower(stru
+@@ -3184,7 +3184,7 @@ static int cfg80211_rtw_set_txpower(stru
  
  static int cfg80211_rtw_get_txpower(struct wiphy *wiphy,
  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
--                                    struct wireless_dev *wdev,
-+                                    struct wireless_dev *wdev, unsigned int link_id,
+-                                    struct wireless_dev *wdev, int radio_idx,
++                                    struct wireless_dev *wdev, int radio_idx, unsigned int link_id,
  #endif
                                      int *dbm)
  {



From lede-commits at lists.infradead.org  Sun Dec  7 15:37:25 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 18:37:25 -0500
Subject: [openwrt/openwrt]  generic: move reserved_mem backports patch to
 generic
In-Reply-To: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
References: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
Message-ID: <mailman.33856.1765150649.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5c513d1f65e985a816f243775fd355a72a060a78

commit 5c513d1f65e985a816f243775fd355a72a060a78
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Dec 1 23:57:53 2025 +0100

    generic: move reserved_mem backports patch to generic
    
    Move reserved_mem backports patch from airoha to generic dir as it will
    be also used by backports package based on 6.18.
    
    Link: https://github.com/openwrt/openwrt/pull/20964
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../204-v6.13-resource-Add-resource-set-range-and-size-helpers.patch}     | 0
 .../205-v6.16-of-reserved_mem-Add-functions-to-parse-memory-region.patch} | 0
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/target/linux/airoha/patches-6.12/083-01-v6.13-resource-Add-resource-set-range-and-size-helpers.patch b/target/linux/generic/backport-6.12/204-v6.13-resource-Add-resource-set-range-and-size-helpers.patch
similarity index 100%
rename from target/linux/airoha/patches-6.12/083-01-v6.13-resource-Add-resource-set-range-and-size-helpers.patch
rename to target/linux/generic/backport-6.12/204-v6.13-resource-Add-resource-set-range-and-size-helpers.patch
diff --git a/target/linux/airoha/patches-6.12/083-02-v6.16-of-reserved_mem-Add-functions-to-parse-memory-region.patch b/target/linux/generic/backport-6.12/205-v6.16-of-reserved_mem-Add-functions-to-parse-memory-region.patch
similarity index 100%
rename from target/linux/airoha/patches-6.12/083-02-v6.16-of-reserved_mem-Add-functions-to-parse-memory-region.patch
rename to target/linux/generic/backport-6.12/205-v6.16-of-reserved_mem-Add-functions-to-parse-memory-region.patch



From lede-commits at lists.infradead.org  Sun Dec  7 15:37:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 18:37:24 -0500
Subject: [openwrt/openwrt]  generic: backport support for faux base driver
In-Reply-To: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
References: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
Message-ID: <mailman.33857.1765150650.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2740ebdd60274a8b4dafe6a947387f0dcb7ac167

commit 2740ebdd60274a8b4dafe6a947387f0dcb7ac167
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Nov 27 22:00:03 2025 +0100

    generic: backport support for faux base driver
    
    Backport support for faux base driver needed for backports package to
    compile with kernel 6.18.
    
    Link: https://github.com/openwrt/openwrt/pull/20964
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...-add-a-faux-bus-for-use-when-a-simple-dev.patch | 386 +++++++++++++++++++++
 1 file changed, 386 insertions(+)

diff --git a/target/linux/generic/backport-6.12/900-v6.14-driver-core-add-a-faux-bus-for-use-when-a-simple-dev.patch b/target/linux/generic/backport-6.12/900-v6.14-driver-core-add-a-faux-bus-for-use-when-a-simple-dev.patch
new file mode 100644
index 0000000000..1ada8a6ef4
--- /dev/null
+++ b/target/linux/generic/backport-6.12/900-v6.14-driver-core-add-a-faux-bus-for-use-when-a-simple-dev.patch
@@ -0,0 +1,386 @@
+From 35fa2d88ca9481e5caf533d58b99ca259c63b2fe Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+Date: Mon, 10 Feb 2025 13:30:25 +0100
+Subject: [PATCH] driver core: add a faux bus for use when a simple device/bus
+ is needed
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Many drivers abuse the platform driver/bus system as it provides a
+simple way to create and bind a device to a driver-specific set of
+probe/release functions.  Instead of doing that, and wasting all of the
+memory associated with a platform device, here is a "faux" bus that
+can be used instead.
+
+Reviewed-by: Jonathan Cameron <Jonathan.Cameron at huawei.com>
+Reviewed-by: Danilo Krummrich <dakr at kernel.org>
+Reviewed-by: Lyude Paul <lyude at redhat.com>
+Reviewed-by: Thomas Wei?schuh <thomas.weissschuh at linutronix.de>
+Reviewed-by: Zijun Hu <quic_zijuhu at quicinc.com>
+Link: https://lore.kernel.org/r/2025021026-atlantic-gibberish-3f0c at gregkh
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ Documentation/driver-api/infrastructure.rst |   6 +
+ drivers/base/Makefile                       |   2 +-
+ drivers/base/base.h                         |   1 +
+ drivers/base/faux.c                         | 232 ++++++++++++++++++++
+ drivers/base/init.c                         |   1 +
+ include/linux/device/faux.h                 |  69 ++++++
+ 6 files changed, 310 insertions(+), 1 deletion(-)
+ create mode 100644 drivers/base/faux.c
+ create mode 100644 include/linux/device/faux.h
+
+--- a/Documentation/driver-api/infrastructure.rst
++++ b/Documentation/driver-api/infrastructure.rst
+@@ -41,6 +41,12 @@ Device Drivers Base
+ .. kernel-doc:: drivers/base/class.c
+    :export:
+ 
++.. kernel-doc:: include/linux/device/faux.h
++   :internal:
++
++.. kernel-doc:: drivers/base/faux.c
++   :export:
++
+ .. kernel-doc:: drivers/base/node.c
+    :internal:
+ 
+--- a/drivers/base/Makefile
++++ b/drivers/base/Makefile
+@@ -6,7 +6,7 @@ obj-y			:= component.o core.o bus.o dd.o
+ 			   cpu.o firmware.o init.o map.o devres.o \
+ 			   attribute_container.o transport_class.o \
+ 			   topology.o container.o property.o cacheinfo.o \
+-			   swnode.o
++			   swnode.o faux.o
+ obj-$(CONFIG_AUXILIARY_BUS) += auxiliary.o
+ obj-$(CONFIG_DEVTMPFS)	+= devtmpfs.o
+ obj-y			+= power/
+--- a/drivers/base/base.h
++++ b/drivers/base/base.h
+@@ -138,6 +138,7 @@ int hypervisor_init(void);
+ static inline int hypervisor_init(void) { return 0; }
+ #endif
+ int platform_bus_init(void);
++int faux_bus_init(void);
+ void cpu_dev_init(void);
+ void container_dev_init(void);
+ #ifdef CONFIG_AUXILIARY_BUS
+--- /dev/null
++++ b/drivers/base/faux.c
+@@ -0,0 +1,232 @@
++// SPDX-License-Identifier: GPL-2.0-only
++/*
++ * Copyright (c) 2025 Greg Kroah-Hartman <gregkh at linuxfoundation.org>
++ * Copyright (c) 2025 The Linux Foundation
++ *
++ * A "simple" faux bus that allows devices to be created and added
++ * automatically to it.  This is to be used whenever you need to create a
++ * device that is not associated with any "real" system resources, and do
++ * not want to have to deal with a bus/driver binding logic.  It is
++ * intended to be very simple, with only a create and a destroy function
++ * available.
++ */
++#include <linux/err.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/string.h>
++#include <linux/container_of.h>
++#include <linux/device/faux.h>
++#include "base.h"
++
++/*
++ * Internal wrapper structure so we can hold a pointer to the
++ * faux_device_ops for this device.
++ */
++struct faux_object {
++	struct faux_device faux_dev;
++	const struct faux_device_ops *faux_ops;
++};
++#define to_faux_object(dev) container_of_const(dev, struct faux_object, faux_dev.dev)
++
++static struct device faux_bus_root = {
++	.init_name	= "faux",
++};
++
++static int faux_match(struct device *dev, const struct device_driver *drv)
++{
++	/* Match always succeeds, we only have one driver */
++	return 1;
++}
++
++static int faux_probe(struct device *dev)
++{
++	struct faux_object *faux_obj = to_faux_object(dev);
++	struct faux_device *faux_dev = &faux_obj->faux_dev;
++	const struct faux_device_ops *faux_ops = faux_obj->faux_ops;
++	int ret = 0;
++
++	if (faux_ops && faux_ops->probe)
++		ret = faux_ops->probe(faux_dev);
++
++	return ret;
++}
++
++static void faux_remove(struct device *dev)
++{
++	struct faux_object *faux_obj = to_faux_object(dev);
++	struct faux_device *faux_dev = &faux_obj->faux_dev;
++	const struct faux_device_ops *faux_ops = faux_obj->faux_ops;
++
++	if (faux_ops && faux_ops->remove)
++		faux_ops->remove(faux_dev);
++}
++
++static const struct bus_type faux_bus_type = {
++	.name		= "faux",
++	.match		= faux_match,
++	.probe		= faux_probe,
++	.remove		= faux_remove,
++};
++
++static struct device_driver faux_driver = {
++	.name		= "faux_driver",
++	.bus		= &faux_bus_type,
++	.probe_type	= PROBE_FORCE_SYNCHRONOUS,
++};
++
++static void faux_device_release(struct device *dev)
++{
++	struct faux_object *faux_obj = to_faux_object(dev);
++
++	kfree(faux_obj);
++}
++
++/**
++ * faux_device_create_with_groups - Create and register with the driver
++ *		core a faux device and populate the device with an initial
++ *		set of sysfs attributes.
++ * @name:	The name of the device we are adding, must be unique for
++ *		all faux devices.
++ * @parent:	Pointer to a potential parent struct device.  If set to
++ *		NULL, the device will be created in the "root" of the faux
++ *		device tree in sysfs.
++ * @faux_ops:	struct faux_device_ops that the new device will call back
++ *		into, can be NULL.
++ * @groups:	The set of sysfs attributes that will be created for this
++ *		device when it is registered with the driver core.
++ *
++ * Create a new faux device and register it in the driver core properly.
++ * If present, callbacks in @faux_ops will be called with the device that
++ * for the caller to do something with at the proper time given the
++ * device's lifecycle.
++ *
++ * Note, when this function is called, the functions specified in struct
++ * faux_ops can be called before the function returns, so be prepared for
++ * everything to be properly initialized before that point in time.
++ *
++ * Return:
++ * * NULL if an error happened with creating the device
++ * * pointer to a valid struct faux_device that is registered with sysfs
++ */
++struct faux_device *faux_device_create_with_groups(const char *name,
++						   struct device *parent,
++						   const struct faux_device_ops *faux_ops,
++						   const struct attribute_group **groups)
++{
++	struct faux_object *faux_obj;
++	struct faux_device *faux_dev;
++	struct device *dev;
++	int ret;
++
++	faux_obj = kzalloc(sizeof(*faux_obj), GFP_KERNEL);
++	if (!faux_obj)
++		return NULL;
++
++	/* Save off the callbacks so we can use them in the future */
++	faux_obj->faux_ops = faux_ops;
++
++	/* Initialize the device portion and register it with the driver core */
++	faux_dev = &faux_obj->faux_dev;
++	dev = &faux_dev->dev;
++
++	device_initialize(dev);
++	dev->release = faux_device_release;
++	if (parent)
++		dev->parent = parent;
++	else
++		dev->parent = &faux_bus_root;
++	dev->bus = &faux_bus_type;
++	dev->groups = groups;
++	dev_set_name(dev, "%s", name);
++
++	ret = device_add(dev);
++	if (ret) {
++		pr_err("%s: device_add for faux device '%s' failed with %d\n",
++		       __func__, name, ret);
++		put_device(dev);
++		return NULL;
++	}
++
++	return faux_dev;
++}
++EXPORT_SYMBOL_GPL(faux_device_create_with_groups);
++
++/**
++ * faux_device_create - create and register with the driver core a faux device
++ * @name:	The name of the device we are adding, must be unique for all
++ *		faux devices.
++ * @parent:	Pointer to a potential parent struct device.  If set to
++ *		NULL, the device will be created in the "root" of the faux
++ *		device tree in sysfs.
++ * @faux_ops:	struct faux_device_ops that the new device will call back
++ *		into, can be NULL.
++ *
++ * Create a new faux device and register it in the driver core properly.
++ * If present, callbacks in @faux_ops will be called with the device that
++ * for the caller to do something with at the proper time given the
++ * device's lifecycle.
++ *
++ * Note, when this function is called, the functions specified in struct
++ * faux_ops can be called before the function returns, so be prepared for
++ * everything to be properly initialized before that point in time.
++ *
++ * Return:
++ * * NULL if an error happened with creating the device
++ * * pointer to a valid struct faux_device that is registered with sysfs
++ */
++struct faux_device *faux_device_create(const char *name,
++				       struct device *parent,
++				       const struct faux_device_ops *faux_ops)
++{
++	return faux_device_create_with_groups(name, parent, faux_ops, NULL);
++}
++EXPORT_SYMBOL_GPL(faux_device_create);
++
++/**
++ * faux_device_destroy - destroy a faux device
++ * @faux_dev:	faux device to destroy
++ *
++ * Unregisters and cleans up a device that was created with a call to
++ * faux_device_create()
++ */
++void faux_device_destroy(struct faux_device *faux_dev)
++{
++	struct device *dev = &faux_dev->dev;
++
++	if (!faux_dev)
++		return;
++
++	device_del(dev);
++
++	/* The final put_device() will clean up the memory we allocated for this device. */
++	put_device(dev);
++}
++EXPORT_SYMBOL_GPL(faux_device_destroy);
++
++int __init faux_bus_init(void)
++{
++	int ret;
++
++	ret = device_register(&faux_bus_root);
++	if (ret) {
++		put_device(&faux_bus_root);
++		return ret;
++	}
++
++	ret = bus_register(&faux_bus_type);
++	if (ret)
++		goto error_bus;
++
++	ret = driver_register(&faux_driver);
++	if (ret)
++		goto error_driver;
++
++	return ret;
++
++error_driver:
++	bus_unregister(&faux_bus_type);
++
++error_bus:
++	device_unregister(&faux_bus_root);
++	return ret;
++}
+--- a/drivers/base/init.c
++++ b/drivers/base/init.c
+@@ -32,6 +32,7 @@ void __init driver_init(void)
+ 	/* These are also core pieces, but must come after the
+ 	 * core core pieces.
+ 	 */
++	faux_bus_init();
+ 	of_core_init();
+ 	platform_bus_init();
+ 	auxiliary_bus_init();
+--- /dev/null
++++ b/include/linux/device/faux.h
+@@ -0,0 +1,69 @@
++/* SPDX-License-Identifier: GPL-2.0-only */
++/*
++ * Copyright (c) 2025 Greg Kroah-Hartman <gregkh at linuxfoundation.org>
++ * Copyright (c) 2025 The Linux Foundation
++ *
++ * A "simple" faux bus that allows devices to be created and added
++ * automatically to it.  This is to be used whenever you need to create a
++ * device that is not associated with any "real" system resources, and do
++ * not want to have to deal with a bus/driver binding logic.  It is
++ * intended to be very simple, with only a create and a destroy function
++ * available.
++ */
++#ifndef _FAUX_DEVICE_H_
++#define _FAUX_DEVICE_H_
++
++#include <linux/container_of.h>
++#include <linux/device.h>
++
++/**
++ * struct faux_device - a "faux" device
++ * @dev:	internal struct device of the object
++ *
++ * A simple faux device that can be created/destroyed.  To be used when a
++ * driver only needs to have a device to "hang" something off.  This can be
++ * used for downloading firmware or other basic tasks.  Use this instead of
++ * a struct platform_device if the device has no resources assigned to
++ * it at all.
++ */
++struct faux_device {
++	struct device dev;
++};
++#define to_faux_device(x) container_of_const((x), struct faux_device, dev)
++
++/**
++ * struct faux_device_ops - a set of callbacks for a struct faux_device
++ * @probe:	called when a faux device is probed by the driver core
++ *		before the device is fully bound to the internal faux bus
++ *		code.  If probe succeeds, return 0, otherwise return a
++ *		negative error number to stop the probe sequence from
++ *		succeeding.
++ * @remove:	called when a faux device is removed from the system
++ *
++ * Both @probe and @remove are optional, if not needed, set to NULL.
++ */
++struct faux_device_ops {
++	int (*probe)(struct faux_device *faux_dev);
++	void (*remove)(struct faux_device *faux_dev);
++};
++
++struct faux_device *faux_device_create(const char *name,
++				       struct device *parent,
++				       const struct faux_device_ops *faux_ops);
++struct faux_device *faux_device_create_with_groups(const char *name,
++						   struct device *parent,
++						   const struct faux_device_ops *faux_ops,
++						   const struct attribute_group **groups);
++void faux_device_destroy(struct faux_device *faux_dev);
++
++static inline void *faux_device_get_drvdata(const struct faux_device *faux_dev)
++{
++	return dev_get_drvdata(&faux_dev->dev);
++}
++
++static inline void faux_device_set_drvdata(struct faux_device *faux_dev, void *data)
++{
++	dev_set_drvdata(&faux_dev->dev, data);
++}
++
++#endif /* _FAUX_DEVICE_H_ */



From lede-commits at lists.infradead.org  Sun Dec  7 15:37:31 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 18:37:31 -0500
Subject: [openwrt/openwrt]  ath10k-ct: switch to base 6.18
In-Reply-To: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
References: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
Message-ID: <mailman.33858.1765150650.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5869531992ed9ffbfd17380a9942bd544709539d

commit 5869531992ed9ffbfd17380a9942bd544709539d
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Tue Dec 2 20:40:31 2025 +0100

    ath10k-ct: switch to base 6.18
    
    Switch ath10k-ct kernel version base to 6.18 to align with backports
    package based on 6.18 kernel version.
    
    Link: https://github.com/openwrt/openwrt/pull/20964
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/kernel/ath10k-ct/Makefile                  |  2 +-
 ...02-ath10k-6.10-remove-unsupported-feature.patch |  6 ++--
 ...ake-it-compatible-with-the-old-LTS-kernel.patch | 22 --------------
 ...wifi-ath10k-Use-iommu_paging_domain_alloc.patch |  8 ++---
 ...ix-missing-prototypes-warnings-on-6.12-ke.patch | 34 +++++++++++-----------
 .../202-ath10k-use-tpt-trigger-by-default.patch    | 24 +++++++--------
 ...ilence-noisy-log-caused-by-flushing-queue.patch |  8 ++---
 .../patches/300-fix-fortify-checking-error.patch   |  4 +--
 .../960-0010-ath10k-limit-htt-rx-ring-size.patch   |  4 +--
 .../960-0011-ath10k-limit-pci-buffer-size.patch    | 12 ++++----
 ...ath10k-always-use-mac80211-loss-detection.patch |  8 ++---
 11 files changed, 55 insertions(+), 77 deletions(-)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index 1bf5d3d969..7b1543dff3 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -15,7 +15,7 @@ PKG_MIRROR_HASH:=76a950c4c5f02128f4225955b1ca0d1d8f6c68c3b0918c4bc2d1265698e939a
 # Build the 6.14 ath10k-ct driver version.
 # Probably this should match as closely as
 # possible to whatever mac80211 backports version is being used.
-CT_KVER="-6.14"
+CT_KVER="-6.18"
 
 PKG_MAINTAINER:=Ben Greear <greearb at candelatech.com>
 PKG_BUILD_PARALLEL:=1
diff --git a/package/kernel/ath10k-ct/patches/002-ath10k-6.10-remove-unsupported-feature.patch b/package/kernel/ath10k-ct/patches/002-ath10k-6.10-remove-unsupported-feature.patch
index f2adce735a..1fb9958998 100644
--- a/package/kernel/ath10k-ct/patches/002-ath10k-6.10-remove-unsupported-feature.patch
+++ b/package/kernel/ath10k-ct/patches/002-ath10k-6.10-remove-unsupported-feature.patch
@@ -1,6 +1,6 @@
---- a/ath10k-6.14/mac.c
-+++ b/ath10k-6.14/mac.c
-@@ -11650,7 +11650,6 @@ int ath10k_mac_register(struct ath10k *a
+--- a/ath10k-6.18/mac.c
++++ b/ath10k-6.18/mac.c
+@@ -11686,7 +11686,6 @@ int ath10k_mac_register(struct ath10k *a
  	ar->hw->wiphy->n_cipher_suites = ar->hw_params.n_cipher_suites;
  
  	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
diff --git a/package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch b/package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch
deleted file mode 100644
index 4f1918cf52..0000000000
--- a/package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Shiji Yang <yangshiji66 at outlook.com>
-Date: Fri, 28 Mar 2025 19:56:06 +0800
-Subject: [PATCH] ath10k-ct: make it compatible with the old LTS kernel
-
-Rollback some APIs to fix compilation errors.
-
-Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
----
- ath10k-6.14/ahb.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
---- a/ath10k-6.14/ahb.c
-+++ b/ath10k-6.14/ahb.c
-@@ -842,7 +842,7 @@ static struct platform_driver ath10k_ahb
- 		.of_match_table = ath10k_ahb_of_match,
- 	},
- 	.probe = ath10k_ahb_probe,
--	.remove = ath10k_ahb_remove,
-+	.remove_new = ath10k_ahb_remove,
- };
- 
- int ath10k_ahb_init(void)
diff --git a/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch b/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch
index f765950cad..5940fd7a19 100644
--- a/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch
+++ b/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch
@@ -7,12 +7,12 @@ IPQ4019 wireless can't start after upstream commit d5b7485588df[1].
 [1] https://github.com/torvalds/linux/commit/d5b7485588dffb39c5687e965623124ab7ebcd51
 Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
 ---
- ath10k-6.14/snoc.c | 6 +++---
+ ath10k-6.18/snoc.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
---- a/ath10k-6.14/snoc.c
-+++ b/ath10k-6.14/snoc.c
-@@ -1635,10 +1635,10 @@ static int ath10k_fw_init(struct ath10k
+--- a/ath10k-6.18/snoc.c
++++ b/ath10k-6.18/snoc.c
+@@ -1630,10 +1630,10 @@ static int ath10k_fw_init(struct ath10k
  
  	ar_snoc->fw.dev = &pdev->dev;
  
diff --git a/package/kernel/ath10k-ct/patches/005-ath10k-ct-fix-missing-prototypes-warnings-on-6.12-ke.patch b/package/kernel/ath10k-ct/patches/005-ath10k-ct-fix-missing-prototypes-warnings-on-6.12-ke.patch
index 84f3d1896b..800b17da09 100644
--- a/package/kernel/ath10k-ct/patches/005-ath10k-ct-fix-missing-prototypes-warnings-on-6.12-ke.patch
+++ b/package/kernel/ath10k-ct/patches/005-ath10k-ct-fix-missing-prototypes-warnings-on-6.12-ke.patch
@@ -7,30 +7,30 @@ Fix various missing-prototypes warnings by:
 * Mark functions only used in current source file as static.
 * Comment out unused functions.
 
-/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.14/debug.c:425:6: error: no previous prototype for 'ath10k_debug_fw_ratepwr_table_process' [-Werror=missing-prototypes]
+/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.18/debug.c:425:6: error: no previous prototype for 'ath10k_debug_fw_ratepwr_table_process' [-Werror=missing-prototypes]
   425 | void ath10k_debug_fw_ratepwr_table_process(struct ath10k *ar, struct sk_buff *skb)
       |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.14/debug.c:437:6: error: no previous prototype for 'ath10k_debug_fw_powerctl_table_process' [-Werror=missing-prototypes]
+/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.18/debug.c:437:6: error: no previous prototype for 'ath10k_debug_fw_powerctl_table_process' [-Werror=missing-prototypes]
   437 | void ath10k_debug_fw_powerctl_table_process(struct ath10k *ar, struct sk_buff *skb)
       |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.14/debug.c:884:5: error: no previous prototype for 'ath10k_refresh_target_pdev_ext_ct_stats' [-Werror=missing-prototypes]
+/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.18/debug.c:884:5: error: no previous prototype for 'ath10k_refresh_target_pdev_ext_ct_stats' [-Werror=missing-prototypes]
   884 | int ath10k_refresh_target_pdev_ext_ct_stats(struct ath10k *ar)
       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.14/htt_tx.c:1190:6: error: no previous prototype for 'ieee80211_is_robust_mgmt_frame_tx' [-Werror=missing-prototypes]
+/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.18/htt_tx.c:1190:6: error: no previous prototype for 'ieee80211_is_robust_mgmt_frame_tx' [-Werror=missing-prototypes]
  1190 | bool ieee80211_is_robust_mgmt_frame_tx(struct ieee80211_hdr *hdr)
       |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.14/wmi.c:3203:5: error: no previous prototype for 'ath10k_wmi_event_txbf_cv_mesg' [-Werror=missing-prototypes]
+/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/ath10k-ct-regular/ath10k-ct-2025.03.14~63f5b605/ath10k-6.18/wmi.c:3203:5: error: no previous prototype for 'ath10k_wmi_event_txbf_cv_mesg' [-Werror=missing-prototypes]
  3203 | int ath10k_wmi_event_txbf_cv_mesg(struct ath10k *ar, struct sk_buff *skb)
       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
 ---
- ath10k-6.14/debug.c | 6 +++---
+ ath10k-6.18/debug.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
---- a/ath10k-6.14/debug.c
-+++ b/ath10k-6.14/debug.c
-@@ -422,6 +422,7 @@ static void ath10k_debug_fw_stats_reset(
+--- a/ath10k-6.18/debug.c
++++ b/ath10k-6.18/debug.c
+@@ -424,6 +424,7 @@ static void ath10k_debug_fw_stats_reset(
  	spin_unlock_bh(&ar->data_lock);
  }
  
@@ -38,7 +38,7 @@ Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
  void ath10k_debug_fw_ratepwr_table_process(struct ath10k *ar, struct sk_buff *skb)
  {
  	size_t sz = skb->len;
-@@ -445,6 +446,7 @@ void ath10k_debug_fw_powerctl_table_proc
+@@ -447,6 +448,7 @@ void ath10k_debug_fw_powerctl_table_proc
  	memcpy(ar->debug.powerctl_tbl.data, skb->data, sz);
  	complete(&ar->debug.powerctl_tbl_complete);
  }
@@ -46,7 +46,7 @@ Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
  
  void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb)
  {
-@@ -881,7 +883,7 @@ static int ath10k_refresh_target_rx_reor
+@@ -883,7 +885,7 @@ static int ath10k_refresh_target_rx_reor
  	return 0; /* fail silently if firmware does not support this option. */
  }
  
@@ -55,9 +55,9 @@ Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
  {
  	if (test_bit(ATH10K_FW_FEATURE_CUST_STATS_CT,
  		     ar->running_fw->fw_file.fw_features))
---- a/ath10k-6.14/htt_tx.c
-+++ b/ath10k-6.14/htt_tx.c
-@@ -1187,7 +1187,7 @@ static u8 ath10k_htt_tx_get_tid(struct s
+--- a/ath10k-6.18/htt_tx.c
++++ b/ath10k-6.18/htt_tx.c
+@@ -1189,7 +1189,7 @@ static u8 ath10k_htt_tx_get_tid(struct s
   * since we do tx hw crypt, and it won't actually be encrypted even when this flag is
   * set.
   */
@@ -66,9 +66,9 @@ Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
  {
          if (ieee80211_is_disassoc(hdr->frame_control) ||
              ieee80211_is_deauth(hdr->frame_control))
---- a/ath10k-6.14/wmi.c
-+++ b/ath10k-6.14/wmi.c
-@@ -3200,7 +3200,7 @@ printme:
+--- a/ath10k-6.18/wmi.c
++++ b/ath10k-6.18/wmi.c
+@@ -3206,7 +3206,7 @@ printme:
  	return 0;
  }
  
diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch
index c884777baf..cfbc74b32a 100644
--- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch
+++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch
@@ -9,14 +9,14 @@ traffic.
 
 Signed-off-by: Mathias Kresin <dev at kresin.me>
 ---
- ath10k-6.14/core.h | 4 ++++
- ath10k-6.14/leds.c | 4 +---
- ath10k-6.14/mac.c  | 2 +-
+ ath10k-6.18/core.h | 4 ++++
+ ath10k-6.18/leds.c | 4 +---
+ ath10k-6.18/mac.c  | 2 +-
  3 files changed, 6 insertions(+), 4 deletions(-)
 
---- a/ath10k-6.14/core.h
-+++ b/ath10k-6.14/core.h
-@@ -1707,6 +1707,10 @@ struct ath10k {
+--- a/ath10k-6.18/core.h
++++ b/ath10k-6.18/core.h
+@@ -1712,6 +1712,10 @@ struct ath10k {
  	u8 csi_data[4096];
  	u16 csi_data_len;
  
@@ -27,9 +27,9 @@ Signed-off-by: Mathias Kresin <dev at kresin.me>
  	/* must be last */
  	u8 drv_priv[] __aligned(sizeof(void *));
  };
---- a/ath10k-6.14/leds.c
-+++ b/ath10k-6.14/leds.c
-@@ -70,7 +70,7 @@ int ath10k_leds_register(struct ath10k *
+--- a/ath10k-6.18/leds.c
++++ b/ath10k-6.18/leds.c
+@@ -69,7 +69,7 @@ int ath10k_leds_register(struct ath10k *
  
  	ar->leds.cdev.name = ar->leds.label;
  	ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
@@ -38,9 +38,9 @@ Signed-off-by: Mathias Kresin <dev at kresin.me>
  
  	ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
  	if (ret)
---- a/ath10k-6.14/mac.c
-+++ b/ath10k-6.14/mac.c
-@@ -11654,7 +11654,7 @@ int ath10k_mac_register(struct ath10k *a
+--- a/ath10k-6.18/mac.c
++++ b/ath10k-6.18/mac.c
+@@ -11690,7 +11690,7 @@ int ath10k_mac_register(struct ath10k *a
  	ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
  #ifdef CPTCFG_MAC80211_LEDS
diff --git a/package/kernel/ath10k-ct/patches/206-ath10k-ct-silence-noisy-log-caused-by-flushing-queue.patch b/package/kernel/ath10k-ct/patches/206-ath10k-ct-silence-noisy-log-caused-by-flushing-queue.patch
index 2f6db1dd2a..64e0bc839a 100644
--- a/package/kernel/ath10k-ct/patches/206-ath10k-ct-silence-noisy-log-caused-by-flushing-queue.patch
+++ b/package/kernel/ath10k-ct/patches/206-ath10k-ct-silence-noisy-log-caused-by-flushing-queue.patch
@@ -7,12 +7,12 @@ frames from the hardware queue. Only developers need to care about it.
 
 Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
 ---
- ath10k-6.14/mac.c | 8 ++++----
+ ath10k-6.18/mac.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
 
---- a/ath10k-6.14/mac.c
-+++ b/ath10k-6.14/mac.c
-@@ -9081,12 +9081,12 @@ static void ath10k_flush(struct ieee8021
+--- a/ath10k-6.18/mac.c
++++ b/ath10k-6.18/mac.c
+@@ -9112,12 +9112,12 @@ static void ath10k_flush(struct ieee8021
          if (vif) {
                  arvif = (void *)vif->drv_priv;
                  vid = arvif->vdev_id;
diff --git a/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch b/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch
index 84a74c0d3e..41c0826265 100644
--- a/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch
+++ b/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch
@@ -1,5 +1,5 @@
---- a/ath10k-6.14/wmi.h
-+++ b/ath10k-6.14/wmi.h
+--- a/ath10k-6.18/wmi.h
++++ b/ath10k-6.18/wmi.h
 @@ -6310,7 +6310,7 @@ struct qca9880_set_ctl_table_cmd {
  	__le32 ctl_len; /* in bytes.  This may be ignored in firmware,
  			 * make sure ctl_info data is sizeof(qca9880_power_ctl) */
diff --git a/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch
index 31a5161c0a..cbf790894c 100644
--- a/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch
+++ b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch
@@ -1,5 +1,5 @@
---- a/ath10k-6.14/htt.h
-+++ b/ath10k-6.14/htt.h
+--- a/ath10k-6.18/htt.h
++++ b/ath10k-6.18/htt.h
 @@ -238,7 +238,11 @@ enum htt_rx_ring_flags {
  };
  
diff --git a/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch
index 6490e3ca9b..6746fb5ad6 100644
--- a/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch
+++ b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch
@@ -1,6 +1,6 @@
---- a/ath10k-6.14/pci.c
-+++ b/ath10k-6.14/pci.c
-@@ -132,7 +132,11 @@ static const struct ce_attr pci_host_ce_
+--- a/ath10k-6.18/pci.c
++++ b/ath10k-6.18/pci.c
+@@ -133,7 +133,11 @@ static const struct ce_attr pci_host_ce_
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 2048,
@@ -12,7 +12,7 @@
  		.recv_cb = ath10k_pci_htt_htc_rx_cb,
  	},
  
-@@ -141,7 +145,11 @@ static const struct ce_attr pci_host_ce_
+@@ -142,7 +146,11 @@ static const struct ce_attr pci_host_ce_
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 2048,
@@ -24,7 +24,7 @@
  		.recv_cb = ath10k_pci_htc_rx_cb,
  	},
  
-@@ -168,7 +176,11 @@ static const struct ce_attr pci_host_ce_
+@@ -169,7 +177,11 @@ static const struct ce_attr pci_host_ce_
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 512,
@@ -36,7 +36,7 @@
  		.recv_cb = ath10k_pci_htt_rx_cb,
  	},
  
-@@ -193,7 +205,11 @@ static const struct ce_attr pci_host_ce_
+@@ -194,7 +206,11 @@ static const struct ce_attr pci_host_ce_
  		.flags = CE_ATTR_FLAGS,
  		.src_nentries = 0,
  		.src_sz_max = 2048,
diff --git a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch
index cc93623ed8..cd1d05e850 100644
--- a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch
+++ b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch
@@ -13,12 +13,12 @@ own loss detection mechanism.
 
 Signed-off-by: David Bauer <mail at david-bauer.net>
 ---
- ath10k-6.14/mac.c | 1 -
+ ath10k-6.18/mac.c | 1 -
  1 file changed, 1 deletion(-)
 
---- a/ath10k-6.14/mac.c
-+++ b/ath10k-6.14/mac.c
-@@ -11339,7 +11339,6 @@ int ath10k_mac_register(struct ath10k *a
+--- a/ath10k-6.18/mac.c
++++ b/ath10k-6.18/mac.c
+@@ -11375,7 +11375,6 @@ int ath10k_mac_register(struct ath10k *a
  	ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
  	ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
  	ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);



From lede-commits at lists.infradead.org  Sun Dec  7 15:37:26 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 18:37:26 -0500
Subject: [openwrt/openwrt]  generic: add pending patch fixing resource_size()
In-Reply-To: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
References: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
Message-ID: <mailman.33861.1765150651.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/63e2b17c011318b7f7a5c7082fd8c969c430d7df

commit 63e2b17c011318b7f7a5c7082fd8c969c430d7df
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sun Dec 7 23:24:26 2025 +0100

    generic: add pending patch fixing resource_size()
    
    Add opending patch fixing resource_size(9 if resource start and end is
    set to zero.
    
    This is to indirectly fix a helper rework in ath11k qmi code that cause
    firmware load panic.
    
    Link: https://github.com/openwrt/openwrt/pull/20964
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...ndle-wrong-resource_size-value-on-zero-st.patch | 80 ++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/target/linux/generic/pending-6.12/210-resource-handle-wrong-resource_size-value-on-zero-st.patch b/target/linux/generic/pending-6.12/210-resource-handle-wrong-resource_size-value-on-zero-st.patch
new file mode 100644
index 0000000000..af93a56d85
--- /dev/null
+++ b/target/linux/generic/pending-6.12/210-resource-handle-wrong-resource_size-value-on-zero-st.patch
@@ -0,0 +1,80 @@
+From 7e1241396c241f9b4fff2ff133806fef4ddd9ecc Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Sun, 7 Dec 2025 22:18:11 +0100
+Subject: [PATCH] resource: handle wrong resource_size value on zero start/end
+ resource
+
+Commit 900730dc4705 ("wifi: ath: Use
+of_reserved_mem_region_to_resource() for "memory-region"") uncovered a
+massive problem with the usage of resource_size() helper.
+
+The reported commit caused a regression with ath11k WiFi firmware
+loading and the change was just a simple replacement of duplicate code
+with a new helper of_reserved_mem_region_to_resource().
+
+On reworking this, in the commit also a check for the presence of the
+node was replaced with resource_size(&res). This was done following the
+logic that if the node wasn't present then it's expected that also the
+resource_size is zero, mimicking the same if-else logic.
+
+This was also the reason the regression was mostly hard to catch at
+first sight as the rework is correctly done given the assumption on the
+used helpers.
+
+BUT this is actually not the case. On further inspection on
+resource_size() it was found that it NEVER actually returns 0.
+
+Even if the resource value of start and end are 0, the return value of
+resource_size() will ALWAYS be 1, resulting in the broken if-else
+condition ALWAYS going in the first if condition.
+
+This was simply confirmed by reading the resource_size() logic:
+
+	return res->end - res->start + 1;
+
+Given the confusion, also other case of such usage were searched in the
+kernel and with great suprise it seems LOTS of place assume
+resource_size() should return zero in the context of the resource start
+and end set to 0.
+
+Quoting for example comments in drivers/vfio/pci/vfio_pci_core.c:
+
+		/*
+		 * The PCI core shouldn't set up a resource with a
+		 * type but zero size. But there may be bugs that
+		 * cause us to do that.
+		 */
+		if (!resource_size(res))
+			goto no_mmap;
+
+It really seems resource_size() was tought with the assumption that
+resource struct was always correctly initialized before calling it and
+never set to zero.
+
+But across the year this got lost and now there are lots of driver that
+assume resource_size() returns 0 if start and end are also 0.
+
+To better handle this and make resource_size() returns correct value in
+such case, add a simple check and return 0 if both resource start and
+resource end are zero.
+
+Cc: Rob Herring (Arm) <robh at kernel.org>
+Cc: stable at vger.kernel.org
+Fixes: 1a4e564b7db9 ("resource: add resource_size()")
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+---
+ include/linux/ioport.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/include/linux/ioport.h
++++ b/include/linux/ioport.h
+@@ -283,6 +283,9 @@ static inline void resource_set_range(st
+ 
+ static inline resource_size_t resource_size(const struct resource *res)
+ {
++	if (!res->start && !res->end)
++		return 0;
++
+ 	return res->end - res->start + 1;
+ }
+ static inline unsigned long resource_type(const struct resource *res)



From lede-commits at lists.infradead.org  Sun Dec  7 15:37:28 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 18:37:28 -0500
Subject: [openwrt/openwrt]  ramips: migrate wifi compatible to new name
In-Reply-To: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
References: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
Message-ID: <mailman.33862.1765150651.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6e09394c3bff55c7b6a95b7cf04c33b57290faf9

commit 6e09394c3bff55c7b6a95b7cf04c33b57290faf9
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Nov 27 23:16:38 2025 +0100

    ramips: migrate wifi compatible to new name
    
    Migrate wifi compatible from ralink,rt2880-wmac to ralink,rt2880-wifi to
    align to new 6.18 backports version.
    
    Link: https://github.com/openwrt/openwrt/pull/20964
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/ramips/dts/mt7620a.dtsi | 2 +-
 target/linux/ramips/dts/mt7620n.dtsi | 2 +-
 target/linux/ramips/dts/rt2880.dtsi  | 2 +-
 target/linux/ramips/dts/rt3050.dtsi  | 2 +-
 target/linux/ramips/dts/rt3352.dtsi  | 2 +-
 target/linux/ramips/dts/rt3883.dtsi  | 2 +-
 target/linux/ramips/dts/rt5350.dtsi  | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/ramips/dts/mt7620a.dtsi b/target/linux/ramips/dts/mt7620a.dtsi
index ef430b1b9f..95c87cb9d5 100644
--- a/target/linux/ramips/dts/mt7620a.dtsi
+++ b/target/linux/ramips/dts/mt7620a.dtsi
@@ -627,7 +627,7 @@
 	};
 
 	wmac: wmac at 10180000 {
-		compatible = "ralink,rt7620-wmac", "ralink,rt2880-wmac";
+		compatible = "ralink,rt7620-wifi", "ralink,rt2880-wifi";
 		reg = <0x10180000 0x40000>;
 
 		clocks = <&sysc 16>;
diff --git a/target/linux/ramips/dts/mt7620n.dtsi b/target/linux/ramips/dts/mt7620n.dtsi
index 64dbd0a50e..68e7d14c65 100644
--- a/target/linux/ramips/dts/mt7620n.dtsi
+++ b/target/linux/ramips/dts/mt7620n.dtsi
@@ -369,7 +369,7 @@
 	};
 
 	wmac: wmac at 10180000 {
-		compatible = "ralink,rt7620-wmac", "ralink,rt2880-wmac";
+		compatible = "ralink,rt7620-wifi", "ralink,rt2880-wifi";
 		reg = <0x10180000 0x40000>;
 
 		clocks = <&sysc 16>;
diff --git a/target/linux/ramips/dts/rt2880.dtsi b/target/linux/ramips/dts/rt2880.dtsi
index fc289d5779..ddf4df111d 100644
--- a/target/linux/ramips/dts/rt2880.dtsi
+++ b/target/linux/ramips/dts/rt2880.dtsi
@@ -243,7 +243,7 @@
 	};
 
 	wmac: wmac at 480000 {
-		compatible = "ralink,rt2880-wmac";
+		compatible = "ralink,rt2880-wifi";
 		reg = <0x480000 0x40000>;
 
 		clocks = <&sysc 9>;
diff --git a/target/linux/ramips/dts/rt3050.dtsi b/target/linux/ramips/dts/rt3050.dtsi
index fd52e51936..cfd29fc173 100644
--- a/target/linux/ramips/dts/rt3050.dtsi
+++ b/target/linux/ramips/dts/rt3050.dtsi
@@ -331,7 +331,7 @@
 	};
 
 	wmac: wmac at 10180000 {
-		compatible = "ralink,rt3050-wmac", "ralink,rt2880-wmac";
+		compatible = "ralink,rt3050-wifi", "ralink,rt2880-wifi";
 		reg = <0x10180000 0x40000>;
 
 		clocks = <&sysc 12>;
diff --git a/target/linux/ramips/dts/rt3352.dtsi b/target/linux/ramips/dts/rt3352.dtsi
index 6713a04fcc..b60eef7971 100644
--- a/target/linux/ramips/dts/rt3352.dtsi
+++ b/target/linux/ramips/dts/rt3352.dtsi
@@ -358,7 +358,7 @@
 	};
 
 	wmac: wmac at 10180000 {
-		compatible = "ralink,rt3352-wmac", "ralink,rt2880-wmac";
+		compatible = "ralink,rt3352-wifi", "ralink,rt2880-wifi";
 		reg = <0x10180000 0x40000>;
 
 		clocks = <&sysc 13>;
diff --git a/target/linux/ramips/dts/rt3883.dtsi b/target/linux/ramips/dts/rt3883.dtsi
index 509d1c21e8..70c56db892 100644
--- a/target/linux/ramips/dts/rt3883.dtsi
+++ b/target/linux/ramips/dts/rt3883.dtsi
@@ -460,7 +460,7 @@
 	};
 
 	wmac: wmac at 10180000 {
-		compatible = "ralink,rt3883-wmac", "ralink,rt2880-wmac";
+		compatible = "ralink,rt3883-wifi", "ralink,rt2880-wifi";
 		reg = <0x10180000 0x40000>;
 
 		clocks = <&sysc 13>;
diff --git a/target/linux/ramips/dts/rt5350.dtsi b/target/linux/ramips/dts/rt5350.dtsi
index 677931ec14..2162187784 100644
--- a/target/linux/ramips/dts/rt5350.dtsi
+++ b/target/linux/ramips/dts/rt5350.dtsi
@@ -363,7 +363,7 @@
 	};
 
 	wmac: wmac at 10180000 {
-		compatible = "ralink,rt5350-wmac", "ralink,rt2880-wmac";
+		compatible = "ralink,rt5350-wifi", "ralink,rt2880-wifi";
 		reg = <0x10180000 0x40000>;
 
 		clocks = <&sysc 13>;



From lede-commits at lists.infradead.org  Sun Dec  7 15:37:30 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 18:37:30 -0500
Subject: [openwrt/openwrt]  ath10k-ct: update to Git HEAD (2025-12-01)
In-Reply-To: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
References: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
Message-ID: <mailman.33866.1765150653.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/03e197e23ea27d2e404e261fa4a7c17728550bb9

commit 03e197e23ea27d2e404e261fa4a7c17728550bb9
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Tue Dec 2 20:34:12 2025 +0100

    ath10k-ct: update to Git HEAD (2025-12-01)
    
    bb84e1597474 Add 6.18 ath10k-ct driver
    
    Link: https://github.com/openwrt/openwrt/pull/20964
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/kernel/ath10k-ct/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index dc78a12e45..1bf5d3d969 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2025-04-30
-PKG_SOURCE_VERSION:=23ee90f0ee20323b90870e8be694db3e0c972b67
-PKG_MIRROR_HASH:=ee91de4f34c76db6a80c477ee3430e4cc493d55d59d7ae8e11d78500d2d8e0d8
+PKG_SOURCE_DATE:=2025-12-01
+PKG_SOURCE_VERSION:=bb84e1597474a6db26f7681d6765fd3e69fff37e
+PKG_MIRROR_HASH:=76a950c4c5f02128f4225955b1ca0d1d8f6c68c3b0918c4bc2d1265698e939a6
 
 # Build the 6.14 ath10k-ct driver version.
 # Probably this should match as closely as



From lede-commits at lists.infradead.org  Sun Dec  7 15:37:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 18:37:29 -0500
Subject: [openwrt/openwrt]  mt76: backport patch fixing support for 6.18
In-Reply-To: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
References: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
Message-ID: <mailman.33867.1765150654.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1346dc176f58dbc9276bb76190eaf9f344fc0cf1

commit 1346dc176f58dbc9276bb76190eaf9f344fc0cf1
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sun Nov 30 13:11:56 2025 +0100

    mt76: backport patch fixing support for 6.18
    
    Backport upstream patch fixing support for 6.18 due to kernel upstream
    commit b74947b4f6ff ("wifi: cfg80211/mac80211: Add support to get radio
    index")
    
    Link: https://github.com/openwrt/openwrt/pull/20964
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/kernel/mt76/Makefile                       |   2 +-
 ...11-mac80211-Add-support-to-get-radio-inde.patch | 406 +++++++++++++++++++++
 2 files changed, 407 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index f525877fd7..c94d76456e 100644
--- a/package/kernel/mt76/Makefile
+++ b/package/kernel/mt76/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mt76
-PKG_RELEASE=1
+PKG_RELEASE=2
 
 PKG_LICENSE:=BSD-3-Clause-Clear
 PKG_LICENSE_FILES:=
diff --git a/package/kernel/mt76/patches/001-wifi-cfg80211-mac80211-Add-support-to-get-radio-inde.patch b/package/kernel/mt76/patches/001-wifi-cfg80211-mac80211-Add-support-to-get-radio-inde.patch
new file mode 100644
index 0000000000..1ef903918f
--- /dev/null
+++ b/package/kernel/mt76/patches/001-wifi-cfg80211-mac80211-Add-support-to-get-radio-inde.patch
@@ -0,0 +1,406 @@
+From 6434ec7449b854fbdf8b1cab9c142e67a0a8a9a4 Mon Sep 17 00:00:00 2001
+From: Roopni Devanathan <quic_rdevanat at quicinc.com>
+Date: Sun, 15 Jun 2025 13:53:09 +0530
+Subject: [PATCH] wifi: cfg80211/mac80211: Add support to get radio index
+
+Currently, per-radio attributes are set on per-phy basis, i.e., all the
+radios present in a wiphy will take attributes values sent from user. But
+each radio in a wiphy can get different values from userspace based on
+its requirement.
+
+To extend support to set per-radio attributes, add support to get radio
+index from userspace. Add an NL attribute - NL80211_ATTR_WIPHY_RADIO_INDEX,
+to get user specified radio index for which attributes should be changed.
+Pass this to individual drivers, so that the drivers can use this radio
+index to change per-radio attributes when necessary. Currently, per-radio
+attributes identified are:
+NL80211_ATTR_WIPHY_TX_POWER_LEVEL
+NL80211_ATTR_WIPHY_ANTENNA_TX
+NL80211_ATTR_WIPHY_ANTENNA_RX
+NL80211_ATTR_WIPHY_RETRY_SHORT
+NL80211_ATTR_WIPHY_RETRY_LONG
+NL80211_ATTR_WIPHY_FRAG_THRESHOLD
+NL80211_ATTR_WIPHY_RTS_THRESHOLD
+NL80211_ATTR_WIPHY_COVERAGE_CLASS
+NL80211_ATTR_TXQ_LIMIT
+NL80211_ATTR_TXQ_MEMORY_LIMIT
+NL80211_ATTR_TXQ_QUANTUM
+
+By default, the radio index is set to -1. This means the attribute should
+be treated as a global configuration. If the user has not specified any
+index, then the radio index passed to individual drivers would be -1. This
+would indicate that the attribute applies to all radios in that wiphy.
+
+Signed-off-by: Roopni Devanathan <quic_rdevanat at quicinc.com>
+Link: https://patch.msgid.link/20250615082312.619639-2-quic_rdevanat at quicinc.com
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+ mac80211.c        |  3 ++-
+ mt76.h            |  3 ++-
+ mt7603/main.c     |  5 +++--
+ mt7615/main.c     | 11 +++++++----
+ mt76x0/main.c     |  2 +-
+ mt76x0/mt76x0.h   |  2 +-
+ mt76x02.h         |  4 ++--
+ mt76x02_util.c    |  4 ++--
+ mt76x2/pci_main.c |  6 +++---
+ mt76x2/usb_main.c |  2 +-
+ mt7915/main.c     | 13 ++++++++-----
+ mt7921/main.c     |  8 +++++---
+ mt7925/main.c     |  8 +++++---
+ mt792x.h          |  3 ++-
+ mt792x_core.c     |  3 ++-
+ mt7996/main.c     | 11 +++++++----
+ 16 files changed, 53 insertions(+), 35 deletions(-)
+
+--- a/mac80211.c
++++ b/mac80211.c
+@@ -1936,7 +1936,8 @@ void mt76_sw_scan_complete(struct ieee80
+ }
+ EXPORT_SYMBOL_GPL(mt76_sw_scan_complete);
+ 
+-int mt76_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant)
++int mt76_get_antenna(struct ieee80211_hw *hw, int radio_idx, u32 *tx_ant,
++		     u32 *rx_ant)
+ {
+ 	struct mt76_phy *phy = hw->priv;
+ 	struct mt76_dev *dev = phy->dev;
+--- a/mt76.h
++++ b/mt76.h
+@@ -1598,7 +1598,8 @@ int mt76_get_sar_power(struct mt76_phy *
+ void mt76_csa_check(struct mt76_dev *dev);
+ void mt76_csa_finish(struct mt76_dev *dev);
+ 
+-int mt76_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
++int mt76_get_antenna(struct ieee80211_hw *hw, int radio_idx, u32 *tx_ant,
++		     u32 *rx_ant);
+ int mt76_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set);
+ void mt76_insert_ccmp_hdr(struct sk_buff *skb, u8 key_id);
+ int mt76_get_rate(struct mt76_dev *dev,
+--- a/mt7603/main.c
++++ b/mt7603/main.c
+@@ -216,7 +216,7 @@ static int mt7603_set_sar_specs(struct i
+ }
+ 
+ static int
+-mt7603_config(struct ieee80211_hw *hw, u32 changed)
++mt7603_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
+ {
+ 	struct mt7603_dev *dev = hw->priv;
+ 	int ret = 0;
+@@ -657,7 +657,8 @@ mt7603_sta_rate_tbl_update(struct ieee80
+ }
+ 
+ static void
+-mt7603_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class)
++mt7603_set_coverage_class(struct ieee80211_hw *hw, int radio_idx,
++			  s16 coverage_class)
+ {
+ 	struct mt7603_dev *dev = hw->priv;
+ 
+--- a/mt7615/main.c
++++ b/mt7615/main.c
+@@ -420,7 +420,7 @@ static int mt7615_set_sar_specs(struct i
+ 	return mt76_update_channel(phy->mt76);
+ }
+ 
+-static int mt7615_config(struct ieee80211_hw *hw, u32 changed)
++static int mt7615_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
+ {
+ 	struct mt7615_dev *dev = mt7615_hw_dev(hw);
+ 	struct mt7615_phy *phy = mt7615_hw_phy(hw);
+@@ -784,7 +784,8 @@ static void mt7615_tx(struct ieee80211_h
+ 	mt76_connac_pm_queue_skb(hw, &dev->pm, wcid, skb);
+ }
+ 
+-static int mt7615_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
++static int mt7615_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx,
++				    u32 val)
+ {
+ 	struct mt7615_dev *dev = mt7615_hw_dev(hw);
+ 	struct mt7615_phy *phy = mt7615_hw_phy(hw);
+@@ -972,7 +973,8 @@ mt7615_offset_tsf(struct ieee80211_hw *h
+ }
+ 
+ static void
+-mt7615_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class)
++mt7615_set_coverage_class(struct ieee80211_hw *hw, int radio_idx,
++			  s16 coverage_class)
+ {
+ 	struct mt7615_phy *phy = mt7615_hw_phy(hw);
+ 	struct mt7615_dev *dev = phy->dev;
+@@ -984,7 +986,8 @@ mt7615_set_coverage_class(struct ieee802
+ }
+ 
+ static int
+-mt7615_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
++mt7615_set_antenna(struct ieee80211_hw *hw, int radio_idx,
++		   u32 tx_ant, u32 rx_ant)
+ {
+ 	struct mt7615_dev *dev = mt7615_hw_dev(hw);
+ 	struct mt7615_phy *phy = mt7615_hw_phy(hw);
+--- a/mt76x0/main.c
++++ b/mt76x0/main.c
+@@ -57,7 +57,7 @@ out:
+ }
+ EXPORT_SYMBOL_GPL(mt76x0_set_sar_specs);
+ 
+-int mt76x0_config(struct ieee80211_hw *hw, u32 changed)
++int mt76x0_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
+ {
+ 	struct mt76x02_dev *dev = hw->priv;
+ 
+--- a/mt76x0/mt76x0.h
++++ b/mt76x0/mt76x0.h
+@@ -48,7 +48,7 @@ void mt76x0_chip_onoff(struct mt76x02_de
+ 
+ void mt76x0_mac_stop(struct mt76x02_dev *dev);
+ 
+-int mt76x0_config(struct ieee80211_hw *hw, u32 changed);
++int mt76x0_config(struct ieee80211_hw *hw, int radio_idx, u32 changed);
+ int mt76x0_set_channel(struct mt76_phy *mphy);
+ int mt76x0_set_sar_specs(struct ieee80211_hw *hw,
+ 			 const struct cfg80211_sar_specs *sar);
+--- a/mt76x02.h
++++ b/mt76x02.h
+@@ -183,8 +183,8 @@ void mt76x02_wdt_work(struct work_struct
+ void mt76x02_tx_set_txpwr_auto(struct mt76x02_dev *dev, s8 txpwr);
+ void mt76x02_set_tx_ackto(struct mt76x02_dev *dev);
+ void mt76x02_set_coverage_class(struct ieee80211_hw *hw,
+-				s16 coverage_class);
+-int mt76x02_set_rts_threshold(struct ieee80211_hw *hw, u32 val);
++				int radio_idx, s16 coverage_class);
++int mt76x02_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx, u32 val);
+ void mt76x02_remove_hdr_pad(struct sk_buff *skb, int len);
+ bool mt76x02_tx_status_data(struct mt76_dev *mdev, u8 *update);
+ void mt76x02_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
+--- a/mt76x02_util.c
++++ b/mt76x02_util.c
+@@ -548,7 +548,7 @@ void mt76x02_set_tx_ackto(struct mt76x02
+ EXPORT_SYMBOL_GPL(mt76x02_set_tx_ackto);
+ 
+ void mt76x02_set_coverage_class(struct ieee80211_hw *hw,
+-				s16 coverage_class)
++				int radio_idx, s16 coverage_class)
+ {
+ 	struct mt76x02_dev *dev = hw->priv;
+ 
+@@ -559,7 +559,7 @@ void mt76x02_set_coverage_class(struct i
+ }
+ EXPORT_SYMBOL_GPL(mt76x02_set_coverage_class);
+ 
+-int mt76x02_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
++int mt76x02_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx, u32 val)
+ {
+ 	struct mt76x02_dev *dev = hw->priv;
+ 
+--- a/mt76x2/pci_main.c
++++ b/mt76x2/pci_main.c
+@@ -54,7 +54,7 @@ int mt76x2e_set_channel(struct mt76_phy
+ }
+ 
+ static int
+-mt76x2_config(struct ieee80211_hw *hw, u32 changed)
++mt76x2_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
+ {
+ 	struct mt76x02_dev *dev = hw->priv;
+ 
+@@ -99,8 +99,8 @@ mt76x2_flush(struct ieee80211_hw *hw, st
+ {
+ }
+ 
+-static int mt76x2_set_antenna(struct ieee80211_hw *hw, u32 tx_ant,
+-			      u32 rx_ant)
++static int mt76x2_set_antenna(struct ieee80211_hw *hw, int radio_idx,
++			      u32 tx_ant, u32 rx_ant)
+ {
+ 	struct mt76x02_dev *dev = hw->priv;
+ 
+--- a/mt76x2/usb_main.c
++++ b/mt76x2/usb_main.c
+@@ -50,7 +50,7 @@ int mt76x2u_set_channel(struct mt76_phy
+ }
+ 
+ static int
+-mt76x2u_config(struct ieee80211_hw *hw, u32 changed)
++mt76x2u_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
+ {
+ 	struct mt76x02_dev *dev = hw->priv;
+ 	int err = 0;
+--- a/mt7915/main.c
++++ b/mt7915/main.c
+@@ -449,7 +449,8 @@ out:
+ 	return err;
+ }
+ 
+-static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
++static int mt7915_config(struct ieee80211_hw *hw, int radio_idx,
++			 u32 changed)
+ {
+ 	struct mt7915_dev *dev = mt7915_hw_dev(hw);
+ 	struct mt7915_phy *phy = mt7915_hw_phy(hw);
+@@ -913,7 +914,8 @@ static void mt7915_tx(struct ieee80211_h
+ 	mt76_tx(mphy, control->sta, wcid, skb);
+ }
+ 
+-static int mt7915_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
++static int mt7915_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx,
++				    u32 val)
+ {
+ 	struct mt7915_dev *dev = mt7915_hw_dev(hw);
+ 	struct mt7915_phy *phy = mt7915_hw_phy(hw);
+@@ -1109,7 +1111,8 @@ mt7915_offset_tsf(struct ieee80211_hw *h
+ }
+ 
+ static void
+-mt7915_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class)
++mt7915_set_coverage_class(struct ieee80211_hw *hw, int radio_idx,
++			  s16 coverage_class)
+ {
+ 	struct mt7915_phy *phy = mt7915_hw_phy(hw);
+ 	struct mt7915_dev *dev = phy->dev;
+@@ -1121,7 +1124,7 @@ mt7915_set_coverage_class(struct ieee802
+ }
+ 
+ static int
+-mt7915_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
++mt7915_set_antenna(struct ieee80211_hw *hw, int radio_idx, u32 tx_ant, u32 rx_ant)
+ {
+ 	struct mt7915_dev *dev = mt7915_hw_dev(hw);
+ 	struct mt7915_phy *phy = mt7915_hw_phy(hw);
+@@ -1699,7 +1702,7 @@ mt7915_twt_teardown_request(struct ieee8
+ }
+ 
+ static int
+-mt7915_set_frag_threshold(struct ieee80211_hw *hw, u32 val)
++mt7915_set_frag_threshold(struct ieee80211_hw *hw, int radio_idx, u32 val)
+ {
+ 	return 0;
+ }
+--- a/mt7921/main.c
++++ b/mt7921/main.c
+@@ -626,7 +626,7 @@ void mt7921_set_runtime_pm(struct mt792x
+ 	mt76_connac_mcu_set_deep_sleep(&dev->mt76, pm->ds_enable);
+ }
+ 
+-static int mt7921_config(struct ieee80211_hw *hw, u32 changed)
++static int mt7921_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
+ {
+ 	struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ 	struct mt792x_phy *phy = mt792x_hw_phy(hw);
+@@ -915,7 +915,8 @@ void mt7921_mac_sta_remove(struct mt76_d
+ }
+ EXPORT_SYMBOL_GPL(mt7921_mac_sta_remove);
+ 
+-static int mt7921_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
++static int mt7921_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx,
++				    u32 val)
+ {
+ 	struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ 
+@@ -1096,7 +1097,8 @@ mt7921_stop_sched_scan(struct ieee80211_
+ }
+ 
+ static int
+-mt7921_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
++mt7921_set_antenna(struct ieee80211_hw *hw, int radio_idx,
++		   u32 tx_ant, u32 rx_ant)
+ {
+ 	struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ 	struct mt792x_phy *phy = mt792x_hw_phy(hw);
+--- a/mt7925/main.c
++++ b/mt7925/main.c
+@@ -758,7 +758,7 @@ void mt7925_set_runtime_pm(struct mt792x
+ 	mt7925_mcu_set_deep_sleep(dev, pm->ds_enable);
+ }
+ 
+-static int mt7925_config(struct ieee80211_hw *hw, u32 changed)
++static int mt7925_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
+ {
+ 	struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ 	int ret = 0;
+@@ -1219,7 +1219,8 @@ void mt7925_mac_sta_remove(struct mt76_d
+ }
+ EXPORT_SYMBOL_GPL(mt7925_mac_sta_remove);
+ 
+-static int mt7925_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
++static int mt7925_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx,
++				    u32 val)
+ {
+ 	struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ 
+@@ -1438,7 +1439,8 @@ mt7925_stop_sched_scan(struct ieee80211_
+ }
+ 
+ static int
+-mt7925_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
++mt7925_set_antenna(struct ieee80211_hw *hw, int radio_idx,
++		   u32 tx_ant, u32 rx_ant)
+ {
+ 	struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ 	struct mt792x_phy *phy = mt792x_hw_phy(hw);
+--- a/mt792x.h
++++ b/mt792x.h
+@@ -413,7 +413,8 @@ void mt792x_sta_statistics(struct ieee80
+ 			   struct ieee80211_vif *vif,
+ 			   struct ieee80211_sta *sta,
+ 			   struct station_info *sinfo);
+-void mt792x_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class);
++void mt792x_set_coverage_class(struct ieee80211_hw *hw, int radio_idx,
++			       s16 coverage_class);
+ void mt792x_dma_cleanup(struct mt792x_dev *dev);
+ int mt792x_dma_enable(struct mt792x_dev *dev);
+ int mt792x_wpdma_reset(struct mt792x_dev *dev, bool force);
+--- a/mt792x_core.c
++++ b/mt792x_core.c
+@@ -601,7 +601,8 @@ void mt792x_sta_statistics(struct ieee80
+ }
+ EXPORT_SYMBOL_GPL(mt792x_sta_statistics);
+ 
+-void mt792x_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class)
++void mt792x_set_coverage_class(struct ieee80211_hw *hw, int radio_idx,
++			       s16 coverage_class)
+ {
+ 	struct mt792x_phy *phy = mt792x_hw_phy(hw);
+ 	struct mt792x_dev *dev = phy->dev;
+--- a/mt7996/main.c
++++ b/mt7996/main.c
+@@ -644,7 +644,7 @@ static int mt7996_set_key(struct ieee802
+ 	return err;
+ }
+ 
+-static int mt7996_config(struct ieee80211_hw *hw, u32 changed)
++static int mt7996_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
+ {
+ 	return 0;
+ }
+@@ -1370,7 +1370,8 @@ unlock:
+ 	rcu_read_unlock();
+ }
+ 
+-static int mt7996_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
++static int mt7996_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx,
++				    u32 val)
+ {
+ 	struct mt7996_dev *dev = mt7996_hw_dev(hw);
+ 	int i, ret = 0;
+@@ -1590,7 +1591,8 @@ unlock:
+ }
+ 
+ static void
+-mt7996_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class)
++mt7996_set_coverage_class(struct ieee80211_hw *hw, int radio_idx,
++			  s16 coverage_class)
+ {
+ 	struct mt7996_dev *dev = mt7996_hw_dev(hw);
+ 	struct mt7996_phy *phy;
+@@ -1604,7 +1606,8 @@ mt7996_set_coverage_class(struct ieee802
+ }
+ 
+ static int
+-mt7996_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
++mt7996_set_antenna(struct ieee80211_hw *hw, int radio_idx,
++		   u32 tx_ant, u32 rx_ant)
+ {
+ 	struct mt7996_dev *dev = mt7996_hw_dev(hw);
+ 	int i;



From lede-commits at lists.infradead.org  Sun Dec  7 15:37:32 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 07 Dec 2025 18:37:32 -0500
Subject: [openwrt/openwrt]  mwlwifi: add pending patch to support kernel 6.18
In-Reply-To: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
References: <176515064489.1409994.6463462799256253193@git-01.infra.openwrt.org>
Message-ID: <mailman.33870.1765150658.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c8855881eabf5f67456576284091580eae0561d0

commit c8855881eabf5f67456576284091580eae0561d0
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Dec 1 23:56:54 2025 +0100

    mwlwifi: add pending patch to support kernel 6.18
    
    Add pending patch to support backports package based on kernel 6.18.
    
    Link: https://github.com/openwrt/openwrt/pull/20964
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../100-mac80211-support-kernel-version-6.18.patch | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/package/kernel/mwlwifi/patches/100-mac80211-support-kernel-version-6.18.patch b/package/kernel/mwlwifi/patches/100-mac80211-support-kernel-version-6.18.patch
new file mode 100644
index 0000000000..c284111536
--- /dev/null
+++ b/package/kernel/mwlwifi/patches/100-mac80211-support-kernel-version-6.18.patch
@@ -0,0 +1,32 @@
+From 8c977646a9a7eca0fc70f785606154581cf26be3 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Mon, 1 Dec 2025 23:48:36 +0100
+Subject: [PATCH] mac80211: support kernel version 6.18
+
+Support mac80211 kernel version 6.18 with new radio_idx arg.
+
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+---
+ mac80211.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/mac80211.c
++++ b/mac80211.c
+@@ -308,7 +308,7 @@ static void mwl_mac80211_remove_interfac
+ 	mwl_mac80211_remove_vif(priv, vif);
+ }
+ 
+-static int mwl_mac80211_config(struct ieee80211_hw *hw,
++static int mwl_mac80211_config(struct ieee80211_hw *hw, int radio_idx,
+ 			       u32 changed)
+ {
+ 	struct ieee80211_conf *conf = &hw->conf;
+@@ -564,7 +564,7 @@ out:
+ 	return rc;
+ }
+ 
+-static int mwl_mac80211_set_rts_threshold(struct ieee80211_hw *hw,
++static int mwl_mac80211_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx,
+ 					  u32 value)
+ {
+ 	return mwl_fwcmd_set_rts_threshold(hw, value);



From lede-commits at lists.infradead.org  Mon Dec  8 08:26:12 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 11:26:12 -0500
Subject: [openwrt/openwrt]  hostapd: allow ubus ban client address to be a
 broadcast address
In-Reply-To: <176521117139.676493.1394279046785362629@git-01.infra.openwrt.org>
References: <176521117139.676493.1394279046785362629@git-01.infra.openwrt.org>
Message-ID: <mailman.34055.1765211177.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7f05a9af9aebdc106a226cc41d20abfb53934a35

commit 7f05a9af9aebdc106a226cc41d20abfb53934a35
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Thu May 1 17:06:20 2025 +0000

    hostapd: allow ubus ban client address to be a broadcast address
    
    This will allow del_client with ban_time on a broadcast address
    to also ban all clients temporarily.
    
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/18670
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/services/hostapd/src/src/ap/ubus.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c
index 6c23078a69..c1d68c34ff 100644
--- a/package/network/services/hostapd/src/src/ap/ubus.c
+++ b/package/network/services/hostapd/src/src/ap/ubus.c
@@ -1849,6 +1849,7 @@ ubus_event_cb(struct ubus_notify_request *req, int idx, int ret)
 int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req)
 {
 	struct ubus_banned_client *ban;
+	const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 	const char *types[HOSTAPD_UBUS_TYPE_MAX] = {
 		[HOSTAPD_UBUS_PROBE_REQ] = "probe",
 		[HOSTAPD_UBUS_AUTH_REQ] = "auth",
@@ -1867,6 +1868,10 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req
 	if (ban)
 		return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
 
+	ban = avl_find_element(&hapd->ubus.banned, bcast, ban, avl);
+	if (ban)
+		return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
+
 	if (!hapd->ubus.obj.has_subscribers)
 		return WLAN_STATUS_SUCCESS;
 



From lede-commits at lists.infradead.org  Mon Dec  8 08:26:11 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 11:26:11 -0500
Subject: [openwrt/openwrt]  hostapd: add ubus support to disasoc/deauth all
 wireless STAs
In-Reply-To: <176521117139.676493.1394279046785362629@git-01.infra.openwrt.org>
References: <176521117139.676493.1394279046785362629@git-01.infra.openwrt.org>
Message-ID: <mailman.34056.1765211177.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5d7107ef637b0249ba1d4fee1e15e81e7f95332c

commit 5d7107ef637b0249ba1d4fee1e15e81e7f95332c
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Thu May 1 16:46:35 2025 +0000

    hostapd: add ubus support to disasoc/deauth all wireless STAs
    
    Similar to the hostapd control interface, treat ff:ff:ff:ff:ff:ff
    as a stand in for "all clients".
    
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/18670
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/services/hostapd/src/src/ap/ubus.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c
index a1420619a3..6c23078a69 100644
--- a/package/network/services/hostapd/src/src/ap/ubus.c
+++ b/package/network/services/hostapd/src/src/ap/ubus.c
@@ -476,6 +476,7 @@ hostapd_bss_del_client(struct ubus_context *ctx, struct ubus_object *obj,
 			struct blob_attr *msg)
 {
 	struct blob_attr *tb[__DEL_CLIENT_MAX];
+	const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 	struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj);
 	struct sta_info *sta;
 	bool deauth = false;
@@ -496,15 +497,19 @@ hostapd_bss_del_client(struct ubus_context *ctx, struct ubus_object *obj,
 	if (tb[DEL_CLIENT_DEAUTH])
 		deauth = blobmsg_get_bool(tb[DEL_CLIENT_DEAUTH]);
 
+	if (deauth)
+		hostapd_drv_sta_deauth(hapd, addr, reason);
+	else
+		hostapd_drv_sta_disassoc(hapd, addr, reason);
+
 	sta = ap_get_sta(hapd, addr);
 	if (sta) {
-		if (deauth) {
-			hostapd_drv_sta_deauth(hapd, addr, reason);
+		if (deauth)
 			ap_sta_deauthenticate(hapd, sta, reason);
-		} else {
-			hostapd_drv_sta_disassoc(hapd, addr, reason);
+		else
 			ap_sta_disassociate(hapd, sta, reason);
-		}
+	} else if (memcmp(addr, bcast, ETH_ALEN) == 0) {
+		hostapd_free_stas(hapd);
 	}
 
 	if (tb[DEL_CLIENT_BAN_TIME])



From lede-commits at lists.infradead.org  Mon Dec  8 08:27:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 11:27:24 -0500
Subject: [openwrt/openwrt]  mediatek: fix ubi size for zbtlink zbt z8102ax v2
In-Reply-To: <176521124408.680615.9571950951764173806@git-01.infra.openwrt.org>
References: <176521124408.680615.9571950951764173806@git-01.infra.openwrt.org>
Message-ID: <mailman.34057.1765211249.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/9fa8e7e9a3a98282fac09880b014e980e476796d

commit 9fa8e7e9a3a98282fac09880b014e980e476796d
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Thu Nov 13 21:41:30 2025 +0800

    mediatek: fix ubi size for zbtlink zbt z8102ax v2
    
    According to the factory uboot and firmware[1], the ubi size is set
    to 512 MiB (0x20000000) and it exceeds the size of the flash, after
    that the uboot and kernel resizes it to 114.5 MiB (0x7280000) instead
    of 114.125 MiB (0x7220000). The mismatch of the ubi size causes
    kernel fails to read ubi volumes and throws panic.
    
    Trim whitespaces while at it.
    
    1. https://github.com/immortalwrt/immortalwrt/issues/2123#issuecomment-3523744128
    
    Fixes: c908fc7d9591 ("mediatek: add support for Zbtlink ZBT-Z8102AX v2")
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
    Link: https://github.com/openwrt/openwrt/pull/20769
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit d2fa070f7014e8b1144a23e343b31390e7f565ff)
    [rebased upon 24.10 branch]
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
    Link: https://github.com/openwrt/openwrt/pull/21085
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax-v2.dts | 12 ++++++------
 .../filogic/base-files/etc/board.d/05_compat-version         |  3 ++-
 target/linux/mediatek/image/filogic.mk                       |  2 ++
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax-v2.dts b/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax-v2.dts
index 08fc4b977a..f96be22355 100644
--- a/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax-v2.dts
+++ b/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax-v2.dts
@@ -38,7 +38,7 @@
 			linux,code = <KEY_WPS_BUTTON>;
 			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
 		};
-		
+
 	};
 
 	leds {
@@ -55,20 +55,20 @@
 			color = <LED_COLOR_ID_GREEN>;
 			function = LED_FUNCTION_STATUS;
 		};
-		
+
 		led_status_blue: blue {
 			gpios = <&pio 11 GPIO_ACTIVE_LOW>;
 			color = <LED_COLOR_ID_BLUE>;
 			function = LED_FUNCTION_STATUS;
 		};
-		
+
 		led_status_5g1: 5g1 {
 			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
 			color = <LED_COLOR_ID_BLUE>;
 			function = LED_FUNCTION_USB;
 			function-enumerator = <0>;
 		};
-		
+
 		led_status_5g2: 5g2 {
 			gpios = <&pio 13 GPIO_ACTIVE_LOW>;
 			color = <LED_COLOR_ID_BLUE>;
@@ -135,7 +135,7 @@
 			pause;
 		};
 	};
-	
+
 	gmac1: mac at 1 {
 		compatible = "mediatek,eth-mac";
 		reg = <1>;
@@ -207,7 +207,7 @@
 
 			nand_rootfs: partition at 580000 {
 				label = "ubi";
-				reg = <0x0580000 0x7220000>;
+				reg = <0x0580000 0x7280000>;
 			};
 		};
 	};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version
index 9b704b983c..74591b7b0f 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version
@@ -8,7 +8,8 @@ case "$(board_name)" in
 	bananapi,bpi-r3)
 		ucidef_set_compat_version "1.2"
 		;;
-	routerich,ax3000)
+	routerich,ax3000|\
+	zbtlink,zbt-z8102ax-v2)
 		ucidef_set_compat_version "1.1"
 		;;
 esac
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 78e77ea28d..da2a01b51c 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -2096,6 +2096,8 @@ define Device/zbtlink_zbt-z8102ax-v2
   IMAGES += factory.bin
   IMAGE/factory.bin := append-ubi | check-size $$(IMAGE_SIZE)
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := Partition layout has been changed to fit the bootloader
 endef
 TARGET_DEVICES += zbtlink_zbt-z8102ax-v2
 



From lede-commits at lists.infradead.org  Mon Dec  8 08:28:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 11:28:45 -0500
Subject: [openwrt/openwrt]  bmips: use led-sources for ath9k
In-Reply-To: <176521132498.686744.18369117498855711822@git-01.infra.openwrt.org>
References: <176521132498.686744.18369117498855711822@git-01.infra.openwrt.org>
Message-ID: <mailman.34058.1765211329.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5ba9354fc5644f2b34295437fa41c16b9832db52

commit 5ba9354fc5644f2b34295437fa41c16b9832db52
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Dec 5 19:34:37 2025 -0800

    bmips: use led-sources for ath9k
    
    Avoids having to create a custom LED for wifi.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21058
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts | 18 ++++--------------
 target/linux/bmips/dts/bcm6358-huawei-hg556a-a.dts    | 18 ++++--------------
 target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts    | 18 ++++--------------
 3 files changed, 12 insertions(+), 42 deletions(-)

diff --git a/target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts b/target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts
index d7e476b236..0127896ec5 100644
--- a/target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts
+++ b/target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts
@@ -48,17 +48,6 @@
 			linux,default-trigger = "usbport";
 		};
 	};
-
-	ath9k-leds {
-		compatible = "gpio-leds";
-
-		led-8 {
-			function = LED_FUNCTION_WLAN;
-			color = <LED_COLOR_ID_GREEN>;
-			gpios = <&ath9k 8 GPIO_ACTIVE_HIGH>;
-			linux,default-trigger = "phy0tpt";
-		};
-	};
 };
 
 &leds {
@@ -205,15 +194,16 @@
 		device_type = "pci";
 		ranges;
 
-		ath9k: wifi at 0,0 {
+		wifi at 0,0 {
 			compatible = "pci168c,002e";
 			reg = <0 0 0 0 0>;
 
 			nvmem-cells = <&macaddr_cfe_6a0 1>, <&cal_data_1000>;
 			nvmem-cell-names = "mac-address", "calibration";
 
-			#gpio-cells = <2>;
-			gpio-controller;
+			led {
+				led-sources = <8>;
+			};
 		};
 	};
 };
diff --git a/target/linux/bmips/dts/bcm6358-huawei-hg556a-a.dts b/target/linux/bmips/dts/bcm6358-huawei-hg556a-a.dts
index 0c38dc3e7a..2a7399a970 100644
--- a/target/linux/bmips/dts/bcm6358-huawei-hg556a-a.dts
+++ b/target/linux/bmips/dts/bcm6358-huawei-hg556a-a.dts
@@ -5,17 +5,6 @@
 / {
 	model = "Huawei EchoLife HG556a (version A)";
 	compatible = "huawei,hg556a-a", "brcm,bcm6358";
-
-	ath9k-leds {
-		compatible = "gpio-leds";
-
-		led-2 {
-			function = LED_FUNCTION_WLAN;
-			color = <LED_COLOR_ID_RED>;
-			gpios = <&ath9k 2 GPIO_ACTIVE_HIGH>;
-			linux,default-trigger = "phy0tpt";
-		};
-	};
 };
 
 &gpio_keys {
@@ -58,7 +47,7 @@
 &pci {
 	status = "okay";
 
-	ath9k: wifi at 1,0 {
+	wifi at 1,0 {
 		compatible = "pci168c,ff1d";
 		reg = <0x0800 0 0 0 0>;
 
@@ -67,7 +56,8 @@
 		nvmem-cells = <&macaddr_cfe_6a0 1>;
 		nvmem-cell-names = "mac-address";
 
-		#gpio-cells = <2>;
-		gpio-controller;
+		led {
+			led-sources = <2>;
+		};
 	};
 };
diff --git a/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts b/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts
index 925dce4f49..37e1b6e506 100644
--- a/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts
+++ b/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts
@@ -5,17 +5,6 @@
 / {
 	model = "Huawei EchoLife HG556a (version B)";
 	compatible = "huawei,hg556a-b", "brcm,bcm6358";
-
-	ath9k-leds {
-		compatible = "gpio-leds";
-
-		led-2 {
-			function = LED_FUNCTION_WLAN;
-			color = <LED_COLOR_ID_RED>;
-			gpios = <&ath9k 2 GPIO_ACTIVE_HIGH>;
-			linux,default-trigger = "phy0tpt";
-		};
-	};
 };
 
 &gpio_keys {
@@ -58,7 +47,7 @@
 &pci {
 	status = "okay";
 
-	ath9k: wifi at 1,0 {
+	wifi at 1,0 {
 		compatible = "pci168c,0029";
 		reg = <0x0800 0 0 0 0>;
 
@@ -67,7 +56,8 @@
 		nvmem-cells = <&macaddr_cfe_6a0 1>;
 		nvmem-cell-names = "mac-address";
 
-		#gpio-cells = <2>;
-		gpio-controller;
+		led {
+			led-sources = <2>;
+		};
 	};
 };



From lede-commits at lists.infradead.org  Mon Dec  8 08:28:46 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 11:28:46 -0500
Subject: [openwrt/openwrt]  bmips: huawei-hg556a-c: use nvmem for wifi eeprom
In-Reply-To: <176521132498.686744.18369117498855711822@git-01.infra.openwrt.org>
References: <176521132498.686744.18369117498855711822@git-01.infra.openwrt.org>
Message-ID: <mailman.34061.1765211330.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/72f43ac220616fbd2f9658b9b60a861e8565a998

commit 72f43ac220616fbd2f9658b9b60a861e8565a998
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Dec 6 13:14:03 2025 -0800

    bmips: huawei-hg556a-c: use nvmem for wifi eeprom
    
    The ralink custom property is deprecated and only kept around for
    byteswap capability.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21058
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/bmips/dts/bcm6358-huawei-hg556a-c.dts | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/target/linux/bmips/dts/bcm6358-huawei-hg556a-c.dts b/target/linux/bmips/dts/bcm6358-huawei-hg556a-c.dts
index 2c948da6d7..5133e72476 100644
--- a/target/linux/bmips/dts/bcm6358-huawei-hg556a-c.dts
+++ b/target/linux/bmips/dts/bcm6358-huawei-hg556a-c.dts
@@ -38,16 +38,26 @@
 	};
 };
 
+&cal_data {
+	nvmem-layout {
+		compatible = "fixed-layout";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		cal_data_1fe00: calibration at 1fe00 {
+			reg = <0x1fe00 0x200>;
+		};
+	};
+};
+
 &pci {
 	status = "okay";
 
 	wifi at 1,0 {
-		compatible = "pci0,0";
+		compatible = "pci1814,3062";
 		reg = <0x0800 0 0 0 0>;
 
-		ralink,mtd-eeprom = <&cal_data 0x1fe00>;
-
-		nvmem-cells = <&macaddr_cfe_6a0 1>;
-		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&cal_data_1fe00>, <&macaddr_cfe_6a0 1>;
+		nvmem-cell-names = "calibration", "mac-address";
 	};
 };



From lede-commits at lists.infradead.org  Mon Dec  8 08:30:34 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 11:30:34 -0500
Subject: [openwrt/openwrt]  econet: update en75_chboot to use OpenWrt
 board_name
In-Reply-To: <176521143476.693738.5905767336118590190@git-01.infra.openwrt.org>
References: <176521143476.693738.5905767336118590190@git-01.infra.openwrt.org>
Message-ID: <mailman.34064.1765211438.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4e0dfa6e2798fd2a301f8eb974caa2e0d8051f41

commit 4e0dfa6e2798fd2a301f8eb974caa2e0d8051f41
Author: Caleb James DeLisle <cjd at cjdns.fr>
AuthorDate: Tue Dec 2 20:37:24 2025 +0000

    econet: update en75_chboot to use OpenWrt board_name
    
    Instead of using the name from /proc/cpuinfo, use board_name from
    /lib/functions.sh
    
    Signed-off-by: Caleb James DeLisle <cjd at cjdns.fr>
    Link: https://github.com/openwrt/openwrt/pull/21023
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/econet/base-files/sbin/en75_chboot | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/target/linux/econet/base-files/sbin/en75_chboot b/target/linux/econet/base-files/sbin/en75_chboot
index ec95596bda..f5b5dafdcc 100755
--- a/target/linux/econet/base-files/sbin/en75_chboot
+++ b/target/linux/econet/base-files/sbin/en75_chboot
@@ -3,6 +3,8 @@
 
 set -e
 
+. /lib/functions.sh
+
 part=
 offset_blocks=
 block_size=
@@ -99,8 +101,8 @@ switch() {
 }
 
 main() {
-    machine=$(sed -n -e 's/^machine\s\+:\s\+//p' < /proc/cpuinfo)
-    if [ "$machine" = "TP-Link Archer VR1200v (v2)" ]; then
+    case "$(board_name)" in
+    tplink,archer-vr1200v-v2)
         # 03fe0000
         part=$(part_named '"reserve"')
         offset_blocks=0
@@ -108,7 +110,8 @@ main() {
         code_offset=0
         code_openwrt=0000000101000002
         code_factory=0000000101010003
-    elif [ "$machine" = "Nokia G-240G-E" ]; then
+        ;;
+    nokia,g240g-e)
         part=$(part_named '"flag"')
         offset_blocks=0
         block_size=$((1024 * 128))
@@ -116,7 +119,8 @@ main() {
         code_openwrt=000000000000000000000001000000010000000000000000
         code_factory=000000000000000100000001000000010000000000000000
            read_mask=000000000000000X00000000000000000000000000000000
-    elif [ "$machine" = "SmartFiber XP8421-B" ]; then
+        ;;
+    smartfiber,xp8421-b)
         # 0dfc0000
         part=$(part_named '"reservearea"')
         offset_blocks=12
@@ -124,7 +128,8 @@ main() {
         code_offset=0
         code_openwrt=30000000
         code_factory=31000000
-    elif [ "$machine" = "Zyxel PMG5617GA" ]; then
+        ;;
+    tplink,zyxel-pmg5617ga)
         # 00060fff
         part=$(part_named '"reservearea"')
         offset_blocks=3
@@ -132,10 +137,12 @@ main() {
         code_offset=4095
         code_openwrt=30
         code_factory=31
-    else
+        ;;
+    *)
         echo "Unsupported machine: $machine"
         exit 1
-    fi
+        ;;
+    esac
 
     if [ "$1" = "factory" ]; then
         switch factory



From lede-commits at lists.infradead.org  Mon Dec  8 08:30:35 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 11:30:35 -0500
Subject: [openwrt/openwrt]  econet: fix wrong board name for Zyxel PMG5617GA
In-Reply-To: <176521143476.693738.5905767336118590190@git-01.infra.openwrt.org>
References: <176521143476.693738.5905767336118590190@git-01.infra.openwrt.org>
Message-ID: <mailman.34065.1765211438.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/75915e35805322e55eced5dd9d27c7f9f1cce3e2

commit 75915e35805322e55eced5dd9d27c7f9f1cce3e2
Author: Caleb James DeLisle <cjd at cjdns.fr>
AuthorDate: Thu Dec 4 19:13:23 2025 +0000

    econet: fix wrong board name for Zyxel PMG5617GA
    
    Board name was specified incorrectly in the DT, fix.
    This bug was introduced in #20580 (31f5fc8fea8931f5) which was
    merged last week, and econet is still a mostly experimental target,
    so it is considered unnecessary to update SUPPORTED_DEVICES.
    
    Signed-off-by: Caleb James DeLisle <cjd at cjdns.fr>
    Link: https://github.com/openwrt/openwrt/pull/21023
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/econet/base-files/sbin/en75_chboot      | 2 +-
 target/linux/econet/dts/en751221_zyxel_pmg5617ga.dts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/econet/base-files/sbin/en75_chboot b/target/linux/econet/base-files/sbin/en75_chboot
index f5b5dafdcc..e6be66e582 100755
--- a/target/linux/econet/base-files/sbin/en75_chboot
+++ b/target/linux/econet/base-files/sbin/en75_chboot
@@ -129,7 +129,7 @@ main() {
         code_openwrt=30000000
         code_factory=31000000
         ;;
-    tplink,zyxel-pmg5617ga)
+    zyxel,pmg5617ga)
         # 00060fff
         part=$(part_named '"reservearea"')
         offset_blocks=3
diff --git a/target/linux/econet/dts/en751221_zyxel_pmg5617ga.dts b/target/linux/econet/dts/en751221_zyxel_pmg5617ga.dts
index 12f9c61ef9..b6a95801be 100644
--- a/target/linux/econet/dts/en751221_zyxel_pmg5617ga.dts
+++ b/target/linux/econet/dts/en751221_zyxel_pmg5617ga.dts
@@ -5,7 +5,7 @@
 
 / {
 	model = "Zyxel PMG5617GA";
-	compatible = "tplink,zyxel-pmg5617ga", "econet,en751221";
+	compatible = "zyxel,pmg5617ga", "econet,en751221";
 
 	memory at 0 {
 		device_type = "memory";



From lede-commits at lists.infradead.org  Mon Dec  8 09:47:52 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 12:47:52 -0500
Subject: [openwrt/openwrt]  mac80211: ralink: remove rt2x00soc.ko
In-Reply-To: <176521607297.1026131.10967124573668389844@git-01.infra.openwrt.org>
References: <176521607297.1026131.10967124573668389844@git-01.infra.openwrt.org>
Message-ID: <mailman.34088.1765216076.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/46c885ab6c82b35f8396af4c711b4e933202b746

commit 46c885ab6c82b35f8396af4c711b4e933202b746
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Mon Dec 8 19:02:33 2025 +0800

    mac80211: ralink: remove rt2x00soc.ko
    
    "rt2x00soc.c" was removed in 6.18 kernel backport[1]. Fix build error:
    
    openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/mac80211-regular/backports-6.18/drivers/net/wireless/ralink/rt2x00/rt2x00soc.ko' is missing.
    
    [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.18&id=7f6109086c9e7bbc78ff936dac45626870455c76
    Fixes: 52a087374227 ("mac80211: update to version 6.18")
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21089
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/kernel/mac80211/ralink.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/package/kernel/mac80211/ralink.mk b/package/kernel/mac80211/ralink.mk
index 6925d9c549..087f91c6e2 100644
--- a/package/kernel/mac80211/ralink.mk
+++ b/package/kernel/mac80211/ralink.mk
@@ -107,9 +107,7 @@ define KernelPackage/rt2800-soc
 $(call KernelPackage/rt2x00/Default)
   DEPENDS += @(TARGET_ramips_rt288x||TARGET_ramips_rt305x||TARGET_ramips_rt3883||TARGET_ramips_mt7620) +kmod-rt2800-mmio +kmod-rt2800-lib
   TITLE += (RT28xx/RT3xxx SoC)
-  FILES := \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2x00soc.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800soc.ko
+  FILES := $(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800soc.ko
   AUTOLOAD:=$(call AutoProbe,rt2800soc)
 endef
 



From lede-commits at lists.infradead.org  Mon Dec  8 09:47:53 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 12:47:53 -0500
Subject: [openwrt/openwrt]  ath10k-ct: remove outdated iommu revert patch
In-Reply-To: <176521607297.1026131.10967124573668389844@git-01.infra.openwrt.org>
References: <176521607297.1026131.10967124573668389844@git-01.infra.openwrt.org>
Message-ID: <mailman.34089.1765216079.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/301eee8099383053a13f22d9636f54b7ac932f03

commit 301eee8099383053a13f22d9636f54b7ac932f03
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Mon Dec 8 19:11:39 2025 +0800

    ath10k-ct: remove outdated iommu revert patch
    
    The issue described in the patch can not be reproduced in the latest
    6.18 ath10k-ct driver. It should have been fixed by the upstream.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21089
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...wifi-ath10k-Use-iommu_paging_domain_alloc.patch | 28 ----------------------
 1 file changed, 28 deletions(-)

diff --git a/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch b/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch
deleted file mode 100644
index 5940fd7a19..0000000000
--- a/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Shiji Yang <yangshiji66 at outlook.com>
-Date: Fri, 28 Mar 2025 19:56:06 +0800
-Subject: [PATCH] Revert "wifi: ath10k: Use iommu_paging_domain_alloc()"
-
-IPQ4019 wireless can't start after upstream commit d5b7485588df[1].
-
-[1] https://github.com/torvalds/linux/commit/d5b7485588dffb39c5687e965623124ab7ebcd51
-Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
----
- ath10k-6.18/snoc.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/ath10k-6.18/snoc.c
-+++ b/ath10k-6.18/snoc.c
-@@ -1630,10 +1630,10 @@ static int ath10k_fw_init(struct ath10k
- 
- 	ar_snoc->fw.dev = &pdev->dev;
- 
--	iommu_dom = iommu_paging_domain_alloc(ar_snoc->fw.dev);
--	if (IS_ERR(iommu_dom)) {
-+	iommu_dom = iommu_domain_alloc(&platform_bus_type);
-+	if (!iommu_dom) {
- 		ath10k_err(ar, "failed to allocate iommu domain\n");
--		ret = PTR_ERR(iommu_dom);
-+		ret = -ENOMEM;
- 		goto err_unregister;
- 	}
- 



From lede-commits at lists.infradead.org  Mon Dec  8 09:52:25 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 12:52:25 -0500
Subject: [openwrt/openwrt]  loongarch64: backport kernel BPF trampoline
In-Reply-To: <176521634593.1060790.1215759076345342583@git-01.infra.openwrt.org>
References: <176521634593.1060790.1215759076345342583@git-01.infra.openwrt.org>
Message-ID: <mailman.34090.1765216350.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/ed5cefb037c2ba5b632d7dea5b8b004af53b51a9

commit ed5cefb037c2ba5b632d7dea5b8b004af53b51a9
Author: Vincent Li <vincent.mc.li at gmail.com>
AuthorDate: Sun Dec 7 07:53:07 2025 -0800

    loongarch64: backport kernel BPF trampoline
    
    Enable xdp-loader to attach multiple XDP programs to a single interface by
    backporting the BPF trampoline implementation from Linux kernel 6.17 to
    6.12 for LoongArch64.
    
    The xdp-loader utility relies on libxdp, which in turn requires kernel
    support for BPF trampoline. While x86_64 and other architectures have
    this feature, LoongArch64 only gained it in kernel 6.17. Without this
    backport, xdp-loader fails on LoongArch64 systems running kernel 6.12.
    
    Changes backported include:
    - BPF trampoline infrastructure for LoongArch64
    - Necessary JIT compiler updates
    - Related BPF subsystem changes
    
    This allows full compatibility with the xdp-tools ecosystem on LoongArch64
    systems running older kernel versions.
    
    Reference: https://github.com/xdp-project/xdp-tools/tree/main/lib/libxdp
    
    Signed-off-by: Vincent Li <vincent.mc.li at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21077
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...ngArch-Add-larch_insn_gen_beq_bne-helpers.patch |  68 +++
 ...e-to-rename-validate_code-to-validate_ctx.patch |  52 +++
 ...BPF-Add-dynamic-code-modification-support.patch | 240 +++++++++++
 ...Arch-BPF-Add-basic-bpf-trampoline-support.patch | 467 +++++++++++++++++++++
 4 files changed, 827 insertions(+)

diff --git a/target/linux/loongarch64/patches-6.12/001-v6.17-LoongArch-Add-larch_insn_gen_beq_bne-helpers.patch b/target/linux/loongarch64/patches-6.12/001-v6.17-LoongArch-Add-larch_insn_gen_beq_bne-helpers.patch
new file mode 100644
index 0000000000..971ef78034
--- /dev/null
+++ b/target/linux/loongarch64/patches-6.12/001-v6.17-LoongArch-Add-larch_insn_gen_beq_bne-helpers.patch
@@ -0,0 +1,68 @@
+From 6ab55e0a9eac638ca390bfaef6408c10c127e623 Mon Sep 17 00:00:00 2001
+From: Chenghao Duan <duanchenghao at kylinos.cn>
+Date: Sun, 3 Aug 2025 22:49:50 +0800
+Subject: [PATCH 01/12] LoongArch: Add larch_insn_gen_{beq,bne} helpers
+
+Add larch_insn_gen_beq() and larch_insn_gen_bne() helpers which will be
+used in BPF trampoline implementation.
+
+Reviewed-by: Hengqi Chen <hengqi.chen at gmail.com>
+Co-developed-by: George Guo <guodongtai at kylinos.cn>
+Signed-off-by: George Guo <guodongtai at kylinos.cn>
+Co-developed-by: Youling Tang <tangyouling at kylinos.cn>
+Signed-off-by: Youling Tang <tangyouling at kylinos.cn>
+Signed-off-by: Chenghao Duan <duanchenghao at kylinos.cn>
+Signed-off-by: Huacai Chen <chenhuacai at loongson.cn>
+---
+ arch/loongarch/include/asm/inst.h |  2 ++
+ arch/loongarch/kernel/inst.c      | 28 ++++++++++++++++++++++++++++
+ 2 files changed, 30 insertions(+)
+
+--- a/arch/loongarch/include/asm/inst.h
++++ b/arch/loongarch/include/asm/inst.h
+@@ -515,6 +515,8 @@ u32 larch_insn_gen_move(enum loongarch_g
+ u32 larch_insn_gen_lu12iw(enum loongarch_gpr rd, int imm);
+ u32 larch_insn_gen_lu32id(enum loongarch_gpr rd, int imm);
+ u32 larch_insn_gen_lu52id(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
++u32 larch_insn_gen_beq(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
++u32 larch_insn_gen_bne(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
+ u32 larch_insn_gen_jirl(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
+ 
+ static inline bool signed_imm_check(long val, unsigned int bit)
+--- a/arch/loongarch/kernel/inst.c
++++ b/arch/loongarch/kernel/inst.c
+@@ -335,6 +335,34 @@ u32 larch_insn_gen_lu52id(enum loongarch
+ 	return insn.word;
+ }
+ 
++u32 larch_insn_gen_beq(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm)
++{
++	union loongarch_instruction insn;
++
++	if ((imm & 3) || imm < -SZ_128K || imm >= SZ_128K) {
++		pr_warn("The generated beq instruction is out of range.\n");
++		return INSN_BREAK;
++	}
++
++	emit_beq(&insn, rj, rd, imm >> 2);
++
++	return insn.word;
++}
++
++u32 larch_insn_gen_bne(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm)
++{
++	union loongarch_instruction insn;
++
++	if ((imm & 3) || imm < -SZ_128K || imm >= SZ_128K) {
++		pr_warn("The generated bne instruction is out of range.\n");
++		return INSN_BREAK;
++	}
++
++	emit_bne(&insn, rj, rd, imm >> 2);
++
++	return insn.word;
++}
++
+ u32 larch_insn_gen_jirl(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm)
+ {
+ 	union loongarch_instruction insn;
diff --git a/target/linux/loongarch64/patches-6.12/002-v6.17-LoongArch-BPF-Update-the-code-to-rename-validate_code-to-validate_ctx.patch b/target/linux/loongarch64/patches-6.12/002-v6.17-LoongArch-BPF-Update-the-code-to-rename-validate_code-to-validate_ctx.patch
new file mode 100644
index 0000000000..5ef449561b
--- /dev/null
+++ b/target/linux/loongarch64/patches-6.12/002-v6.17-LoongArch-BPF-Update-the-code-to-rename-validate_code-to-validate_ctx.patch
@@ -0,0 +1,52 @@
+From ed1a1fe6ec5e73b23b310b434ace07d1e5060657 Mon Sep 17 00:00:00 2001
+From: Chenghao Duan <duanchenghao at kylinos.cn>
+Date: Tue, 5 Aug 2025 19:00:18 +0800
+Subject: [PATCH 02/12] LoongArch: BPF: Rename and refactor validate_code()
+
+1. Rename the existing validate_code() to validate_ctx()
+2. Factor out the code validation handling into a new helper
+   validate_code()
+
+Then:
+
+* validate_code() is used to check the validity of code.
+* validate_ctx() is used to check both code validity and table entry
+  correctness.
+
+The new validate_code() will be used in subsequent changes.
+
+Reviewed-by: Hengqi Chen <hengqi.chen at gmail.com>
+Co-developed-by: George Guo <guodongtai at kylinos.cn>
+Signed-off-by: George Guo <guodongtai at kylinos.cn>
+Signed-off-by: Chenghao Duan <duanchenghao at kylinos.cn>
+Signed-off-by: Huacai Chen <chenhuacai at loongson.cn>
+---
+ arch/loongarch/net/bpf_jit.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- a/arch/loongarch/net/bpf_jit.c
++++ b/arch/loongarch/net/bpf_jit.c
+@@ -1170,6 +1170,14 @@ static int validate_code(struct jit_ctx
+ 			return -1;
+ 	}
+ 
++	return 0;
++}
++
++static int validate_ctx(struct jit_ctx *ctx)
++{
++	if (validate_code(ctx))
++		return -1;
++
+ 	if (WARN_ON_ONCE(ctx->num_exentries != ctx->prog->aux->num_exentries))
+ 		return -1;
+ 
+@@ -1278,7 +1286,7 @@ skip_init_ctx:
+ 	build_epilogue(&ctx);
+ 
+ 	/* 3. Extra pass to validate JITed code */
+-	if (validate_code(&ctx)) {
++	if (validate_ctx(&ctx)) {
+ 		bpf_jit_binary_free(header);
+ 		prog = orig_prog;
+ 		goto out_offset;
diff --git a/target/linux/loongarch64/patches-6.12/003-v6.17-loongArch-BPF-Add-dynamic-code-modification-support.patch b/target/linux/loongarch64/patches-6.12/003-v6.17-loongArch-BPF-Add-dynamic-code-modification-support.patch
new file mode 100644
index 0000000000..e011b2b31b
--- /dev/null
+++ b/target/linux/loongarch64/patches-6.12/003-v6.17-loongArch-BPF-Add-dynamic-code-modification-support.patch
@@ -0,0 +1,240 @@
+From 9fbd18cf4c69f512f7de3ab73235078f3e32ecec Mon Sep 17 00:00:00 2001
+From: Chenghao Duan <duanchenghao at kylinos.cn>
+Date: Tue, 5 Aug 2025 19:00:18 +0800
+Subject: [PATCH 03/12] LoongArch: BPF: Add dynamic code modification support
+
+This commit adds support for BPF dynamic code modification on the
+LoongArch architecture:
+1. Add bpf_arch_text_copy() for instruction block copying.
+2. Add bpf_arch_text_poke() for runtime instruction patching.
+3. Add bpf_arch_text_invalidate() for code invalidation.
+
+On LoongArch, since symbol addresses in the direct mapping region can't
+be reached via relative jump instructions from the paged mapping region,
+we use the move_imm+jirl instruction pair as absolute jump instructions.
+These require 2-5 instructions, so we reserve 5 NOP instructions in the
+program as placeholders for function jumps.
+
+The larch_insn_text_copy() function is solely used for BPF. And the use
+of larch_insn_text_copy() requires PAGE_SIZE alignment. Currently, only
+the size of the BPF trampoline is page-aligned.
+
+Co-developed-by: George Guo <guodongtai at kylinos.cn>
+Signed-off-by: George Guo <guodongtai at kylinos.cn>
+Signed-off-by: Chenghao Duan <duanchenghao at kylinos.cn>
+Signed-off-by: Huacai Chen <chenhuacai at loongson.cn>
+---
+ arch/loongarch/include/asm/inst.h |   1 +
+ arch/loongarch/kernel/inst.c      |  46 +++++++++++++
+ arch/loongarch/net/bpf_jit.c      | 105 +++++++++++++++++++++++++++++-
+ 3 files changed, 151 insertions(+), 1 deletion(-)
+
+--- a/arch/loongarch/include/asm/inst.h
++++ b/arch/loongarch/include/asm/inst.h
+@@ -502,6 +502,7 @@ void arch_simulate_insn(union loongarch_
+ int larch_insn_read(void *addr, u32 *insnp);
+ int larch_insn_write(void *addr, u32 insn);
+ int larch_insn_patch_text(void *addr, u32 insn);
++int larch_insn_text_copy(void *dst, void *src, size_t len);
+ 
+ u32 larch_insn_gen_nop(void);
+ u32 larch_insn_gen_b(unsigned long pc, unsigned long dest);
+--- a/arch/loongarch/kernel/inst.c
++++ b/arch/loongarch/kernel/inst.c
+@@ -4,6 +4,8 @@
+  */
+ #include <linux/sizes.h>
+ #include <linux/uaccess.h>
++#include <linux/set_memory.h>
++#include <linux/stop_machine.h>
+ 
+ #include <asm/cacheflush.h>
+ #include <asm/inst.h>
+@@ -229,6 +231,50 @@ int larch_insn_patch_text(void *addr, u3
+ 
+ 	return ret;
+ }
++
++struct insn_copy {
++	void *dst;
++	void *src;
++	size_t len;
++	unsigned int cpu;
++};
++
++static int text_copy_cb(void *data)
++{
++	int ret = 0;
++	struct insn_copy *copy = data;
++
++	if (smp_processor_id() == copy->cpu) {
++		ret = copy_to_kernel_nofault(copy->dst, copy->src, copy->len);
++		if (ret)
++			pr_err("%s: operation failed\n", __func__);
++	}
++
++	flush_icache_range((unsigned long)copy->dst, (unsigned long)copy->dst + copy->len);
++
++	return ret;
++}
++
++int larch_insn_text_copy(void *dst, void *src, size_t len)
++{
++	int ret = 0;
++	size_t start, end;
++	struct insn_copy copy = {
++		.dst = dst,
++		.src = src,
++		.len = len,
++		.cpu = smp_processor_id(),
++	};
++
++	start = round_down((size_t)dst, PAGE_SIZE);
++	end   = round_up((size_t)dst + len, PAGE_SIZE);
++
++	set_memory_rw(start, (end - start) / PAGE_SIZE);
++	ret = stop_machine(text_copy_cb, &copy, cpu_online_mask);
++	set_memory_rox(start, (end - start) / PAGE_SIZE);
++
++	return ret;
++}
+ 
+ u32 larch_insn_gen_nop(void)
+ {
+--- a/arch/loongarch/net/bpf_jit.c
++++ b/arch/loongarch/net/bpf_jit.c
+@@ -4,8 +4,12 @@
+  *
+  * Copyright (C) 2022 Loongson Technology Corporation Limited
+  */
++#include <linux/memory.h>
+ #include "bpf_jit.h"
+ 
++#define LOONGARCH_LONG_JUMP_NINSNS 5
++#define LOONGARCH_LONG_JUMP_NBYTES (LOONGARCH_LONG_JUMP_NINSNS * 4)
++
+ #define REG_TCC		LOONGARCH_GPR_A6
+ #define TCC_SAVED	LOONGARCH_GPR_S5
+ 
+@@ -88,7 +92,7 @@ static u8 tail_call_reg(struct jit_ctx *
+  */
+ static void build_prologue(struct jit_ctx *ctx)
+ {
+-	int stack_adjust = 0, store_offset, bpf_stack_adjust;
++	int i, stack_adjust = 0, store_offset, bpf_stack_adjust;
+ 
+ 	bpf_stack_adjust = round_up(ctx->prog->aux->stack_depth, 16);
+ 
+@@ -98,6 +102,10 @@ static void build_prologue(struct jit_ct
+ 	stack_adjust = round_up(stack_adjust, 16);
+ 	stack_adjust += bpf_stack_adjust;
+ 
++	/* Reserve space for the move_imm + jirl instruction */
++	for (i = 0; i < LOONGARCH_LONG_JUMP_NINSNS; i++)
++		emit_insn(ctx, nop);
++
+ 	/*
+ 	 * First instruction initializes the tail call count (TCC).
+ 	 * On tail call we skip this instruction, and the TCC is
+@@ -1184,6 +1192,101 @@ static int validate_ctx(struct jit_ctx *
+ 	return 0;
+ }
+ 
++static int emit_jump_and_link(struct jit_ctx *ctx, u8 rd, u64 target)
++{
++	if (!target) {
++		pr_err("bpf_jit: jump target address is error\n");
++		return -EFAULT;
++	}
++
++	move_imm(ctx, LOONGARCH_GPR_T1, target, false);
++	emit_insn(ctx, jirl, rd, LOONGARCH_GPR_T1, 0);
++
++	return 0;
++}
++
++static int emit_jump_or_nops(void *target, void *ip, u32 *insns, bool is_call)
++{
++	int i;
++	struct jit_ctx ctx;
++
++	ctx.idx = 0;
++	ctx.image = (union loongarch_instruction *)insns;
++
++	if (!target) {
++		for (i = 0; i < LOONGARCH_LONG_JUMP_NINSNS; i++)
++			emit_insn((&ctx), nop);
++		return 0;
++	}
++
++	return emit_jump_and_link(&ctx, is_call ? LOONGARCH_GPR_T0 : LOONGARCH_GPR_ZERO, (u64)target);
++}
++
++void *bpf_arch_text_copy(void *dst, void *src, size_t len)
++{
++	int ret;
++
++	mutex_lock(&text_mutex);
++	ret = larch_insn_text_copy(dst, src, len);
++	mutex_unlock(&text_mutex);
++
++	return ret ? ERR_PTR(-EINVAL) : dst;
++}
++
++int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type poke_type,
++		       void *old_addr, void *new_addr)
++{
++	int ret;
++	bool is_call = (poke_type == BPF_MOD_CALL);
++	u32 old_insns[LOONGARCH_LONG_JUMP_NINSNS] = {[0 ... 4] = INSN_NOP};
++	u32 new_insns[LOONGARCH_LONG_JUMP_NINSNS] = {[0 ... 4] = INSN_NOP};
++
++	if (!is_kernel_text((unsigned long)ip) &&
++		!is_bpf_text_address((unsigned long)ip))
++		return -ENOTSUPP;
++
++	ret = emit_jump_or_nops(old_addr, ip, old_insns, is_call);
++	if (ret)
++		return ret;
++
++	if (memcmp(ip, old_insns, LOONGARCH_LONG_JUMP_NBYTES))
++		return -EFAULT;
++
++	ret = emit_jump_or_nops(new_addr, ip, new_insns, is_call);
++	if (ret)
++		return ret;
++
++	mutex_lock(&text_mutex);
++	if (memcmp(ip, new_insns, LOONGARCH_LONG_JUMP_NBYTES))
++		ret = larch_insn_text_copy(ip, new_insns, LOONGARCH_LONG_JUMP_NBYTES);
++	mutex_unlock(&text_mutex);
++
++	return ret;
++}
++
++int bpf_arch_text_invalidate(void *dst, size_t len)
++{
++	int i;
++	int ret = 0;
++	u32 *inst;
++
++	inst = kvmalloc(len, GFP_KERNEL);
++	if (!inst)
++		return -ENOMEM;
++
++	for (i = 0; i < (len / sizeof(u32)); i++)
++		inst[i] = INSN_BREAK;
++
++	mutex_lock(&text_mutex);
++	if (larch_insn_text_copy(dst, inst, len))
++		ret = -EINVAL;
++	mutex_unlock(&text_mutex);
++
++	kvfree(inst);
++
++	return ret;
++}
++
+ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
+ {
+ 	bool tmp_blinded = false, extra_pass = false;
diff --git a/target/linux/loongarch64/patches-6.12/004-v6.17-LoongArch-BPF-Add-basic-bpf-trampoline-support.patch b/target/linux/loongarch64/patches-6.12/004-v6.17-LoongArch-BPF-Add-basic-bpf-trampoline-support.patch
new file mode 100644
index 0000000000..93bf9d986e
--- /dev/null
+++ b/target/linux/loongarch64/patches-6.12/004-v6.17-LoongArch-BPF-Add-basic-bpf-trampoline-support.patch
@@ -0,0 +1,467 @@
+From f9b6b41f0cf31791541cea9644ddbedb46465801 Mon Sep 17 00:00:00 2001
+From: Chenghao Duan <duanchenghao at kylinos.cn>
+Date: Tue, 5 Aug 2025 19:00:18 +0800
+Subject: [PATCH 04/12] LoongArch: BPF: Add basic bpf trampoline support
+
+BPF trampoline is the critical infrastructure of the BPF subsystem,
+acting as a mediator between kernel functions and BPF programs. Numerous
+important features, such as using BPF program for zero overhead kernel
+introspection, rely on this key component.
+
+The related tests have passed, including the following technical points:
+1. fentry
+2. fmod_ret
+3. fexit
+
+The following related testcases passed on LoongArch:
+sudo ./test_progs -a fentry_test/fentry
+sudo ./test_progs -a fexit_test/fexit
+sudo ./test_progs -a fentry_fexit
+sudo ./test_progs -a modify_return
+sudo ./test_progs -a fexit_sleep
+sudo ./test_progs -a test_overhead
+sudo ./test_progs -a trampoline_count
+
+This issue was first reported by Geliang Tang in June 2024 while
+debugging MPTCP BPF selftests on a LoongArch machine (see commit
+eef0532e900c "selftests/bpf: Null checks for links in bpf_tcp_ca").
+Geliang, Huacai, and Tiezhu then worked together to drive the
+implementation of this feature, encouraging broader collaboration among
+Chinese kernel engineers.
+
+Reported-by: kernel test robot <lkp at intel.com>
+Closes: https://lore.kernel.org/oe-kbuild-all/202507100034.wXofj6VX-lkp at intel.com/
+Reported-by: Geliang Tang <geliang at kernel.org>
+Tested-by: Tiezhu Yang <yangtiezhu at loongson.cn>
+Tested-by: Vincent Li <vincent.mc.li at gmail.com>
+Co-developed-by: George Guo <guodongtai at kylinos.cn>
+Signed-off-by: George Guo <guodongtai at kylinos.cn>
+Signed-off-by: Chenghao Duan <duanchenghao at kylinos.cn>
+Signed-off-by: Huacai Chen <chenhuacai at loongson.cn>
+---
+ arch/loongarch/net/bpf_jit.c | 377 +++++++++++++++++++++++++++++++++++
+ arch/loongarch/net/bpf_jit.h |   6 +
+ 2 files changed, 383 insertions(+)
+
+--- a/arch/loongarch/net/bpf_jit.c
++++ b/arch/loongarch/net/bpf_jit.c
+@@ -7,9 +7,15 @@
+ #include <linux/memory.h>
+ #include "bpf_jit.h"
+ 
++#define LOONGARCH_MAX_REG_ARGS 8
++
+ #define LOONGARCH_LONG_JUMP_NINSNS 5
+ #define LOONGARCH_LONG_JUMP_NBYTES (LOONGARCH_LONG_JUMP_NINSNS * 4)
+ 
++#define LOONGARCH_FENTRY_NINSNS 2
++#define LOONGARCH_FENTRY_NBYTES (LOONGARCH_FENTRY_NINSNS * 4)
++#define LOONGARCH_BPF_FENTRY_NBYTES (LOONGARCH_LONG_JUMP_NINSNS * 4)
++
+ #define REG_TCC		LOONGARCH_GPR_A6
+ #define TCC_SAVED	LOONGARCH_GPR_S5
+ 
+@@ -1222,6 +1228,11 @@ static int emit_jump_or_nops(void *targe
+ 	return emit_jump_and_link(&ctx, is_call ? LOONGARCH_GPR_T0 : LOONGARCH_GPR_ZERO, (u64)target);
+ }
+ 
++static int emit_call(struct jit_ctx *ctx, u64 addr)
++{
++	return emit_jump_and_link(ctx, LOONGARCH_GPR_RA, addr);
++}
++
+ void *bpf_arch_text_copy(void *dst, void *src, size_t len)
+ {
+ 	int ret;
+@@ -1287,6 +1298,372 @@ int bpf_arch_text_invalidate(void *dst,
+ 	return ret;
+ }
+ 
++static void store_args(struct jit_ctx *ctx, int nargs, int args_off)
++{
++	int i;
++
++	for (i = 0; i < nargs; i++) {
++		emit_insn(ctx, std, LOONGARCH_GPR_A0 + i, LOONGARCH_GPR_FP, -args_off);
++		args_off -= 8;
++	}
++}
++
++static void restore_args(struct jit_ctx *ctx, int nargs, int args_off)
++{
++	int i;
++
++	for (i = 0; i < nargs; i++) {
++		emit_insn(ctx, ldd, LOONGARCH_GPR_A0 + i, LOONGARCH_GPR_FP, -args_off);
++		args_off -= 8;
++	}
++}
++
++static int invoke_bpf_prog(struct jit_ctx *ctx, struct bpf_tramp_link *l,
++			   int args_off, int retval_off, int run_ctx_off, bool save_ret)
++{
++	int ret;
++	u32 *branch;
++	struct bpf_prog *p = l->link.prog;
++	int cookie_off = offsetof(struct bpf_tramp_run_ctx, bpf_cookie);
++
++	if (l->cookie) {
++		move_imm(ctx, LOONGARCH_GPR_T1, l->cookie, false);
++		emit_insn(ctx, std, LOONGARCH_GPR_T1, LOONGARCH_GPR_FP, -run_ctx_off + cookie_off);
++	} else {
++		emit_insn(ctx, std, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_FP, -run_ctx_off + cookie_off);
++	}
++
++	/* arg1: prog */
++	move_imm(ctx, LOONGARCH_GPR_A0, (const s64)p, false);
++	/* arg2: &run_ctx */
++	emit_insn(ctx, addid, LOONGARCH_GPR_A1, LOONGARCH_GPR_FP, -run_ctx_off);
++	ret = emit_call(ctx, (const u64)bpf_trampoline_enter(p));
++	if (ret)
++		return ret;
++
++	/* store prog start time */
++	move_reg(ctx, LOONGARCH_GPR_S1, LOONGARCH_GPR_A0);
++
++	/*
++	 * if (__bpf_prog_enter(prog) == 0)
++	 *      goto skip_exec_of_prog;
++	 */
++	branch = (u32 *)ctx->image + ctx->idx;
++	/* nop reserved for conditional jump */
++	emit_insn(ctx, nop);
++
++	/* arg1: &args_off */
++	emit_insn(ctx, addid, LOONGARCH_GPR_A0, LOONGARCH_GPR_FP, -args_off);
++	if (!p->jited)
++		move_imm(ctx, LOONGARCH_GPR_A1, (const s64)p->insnsi, false);
++	ret = emit_call(ctx, (const u64)p->bpf_func);
++	if (ret)
++		return ret;
++
++	if (save_ret) {
++		emit_insn(ctx, std, LOONGARCH_GPR_A0, LOONGARCH_GPR_FP, -retval_off);
++		emit_insn(ctx, std, regmap[BPF_REG_0], LOONGARCH_GPR_FP, -(retval_off - 8));
++	}
++
++	/* update branch with beqz */
++	if (ctx->image) {
++		int offset = (void *)(&ctx->image[ctx->idx]) - (void *)branch;
++		*branch = larch_insn_gen_beq(LOONGARCH_GPR_A0, LOONGARCH_GPR_ZERO, offset);
++	}
++
++	/* arg1: prog */
++	move_imm(ctx, LOONGARCH_GPR_A0, (const s64)p, false);
++	/* arg2: prog start time */
++	move_reg(ctx, LOONGARCH_GPR_A1, LOONGARCH_GPR_S1);
++	/* arg3: &run_ctx */
++	emit_insn(ctx, addid, LOONGARCH_GPR_A2, LOONGARCH_GPR_FP, -run_ctx_off);
++	ret = emit_call(ctx, (const u64)bpf_trampoline_exit(p));
++
++	return ret;
++}
++
++static void invoke_bpf_mod_ret(struct jit_ctx *ctx, struct bpf_tramp_links *tl,
++			       int args_off, int retval_off, int run_ctx_off, u32 **branches)
++{
++	int i;
++
++	emit_insn(ctx, std, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_FP, -retval_off);
++	for (i = 0; i < tl->nr_links; i++) {
++		invoke_bpf_prog(ctx, tl->links[i], args_off, retval_off, run_ctx_off, true);
++		emit_insn(ctx, ldd, LOONGARCH_GPR_T1, LOONGARCH_GPR_FP, -retval_off);
++		branches[i] = (u32 *)ctx->image + ctx->idx;
++		emit_insn(ctx, nop);
++	}
++}
++
++void *arch_alloc_bpf_trampoline(unsigned int size)
++{
++	return bpf_prog_pack_alloc(size, jit_fill_hole);
++}
++
++void arch_free_bpf_trampoline(void *image, unsigned int size)
++{
++	bpf_prog_pack_free(image, size);
++}
++
++static int __arch_prepare_bpf_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im,
++					 const struct btf_func_model *m, struct bpf_tramp_links *tlinks,
++					 void *func_addr, u32 flags)
++{
++	int i, ret, save_ret;
++	int stack_size = 0, nargs = 0;
++	int retval_off, args_off, nargs_off, ip_off, run_ctx_off, sreg_off;
++	void *orig_call = func_addr;
++	struct bpf_tramp_links *fentry = &tlinks[BPF_TRAMP_FENTRY];
++	struct bpf_tramp_links *fexit = &tlinks[BPF_TRAMP_FEXIT];
++	struct bpf_tramp_links *fmod_ret = &tlinks[BPF_TRAMP_MODIFY_RETURN];
++	u32 **branches = NULL;
++
++	if (flags & (BPF_TRAMP_F_ORIG_STACK | BPF_TRAMP_F_SHARE_IPMODIFY))
++		return -ENOTSUPP;
++
++	/*
++	 * FP + 8       [ RA to parent func ] return address to parent
++	 *                    function
++	 * FP + 0       [ FP of parent func ] frame pointer of parent
++	 *                    function
++	 * FP - 8       [ T0 to traced func ] return address of traced
++	 *                    function
++	 * FP - 16      [ FP of traced func ] frame pointer of traced
++	 *                    function
++	 *
++	 * FP - retval_off  [ return value      ] BPF_TRAMP_F_CALL_ORIG or
++	 *                    BPF_TRAMP_F_RET_FENTRY_RET
++	 *                  [ argN              ]
++	 *                  [ ...               ]
++	 * FP - args_off    [ arg1              ]
++	 *
++	 * FP - nargs_off   [ regs count        ]
++	 *
++	 * FP - ip_off      [ traced func   ] BPF_TRAMP_F_IP_ARG
++	 *
++	 * FP - run_ctx_off [ bpf_tramp_run_ctx ]
++	 *
++	 * FP - sreg_off    [ callee saved reg  ]
++	 *
++	 */
++
++	if (m->nr_args > LOONGARCH_MAX_REG_ARGS)
++		return -ENOTSUPP;
++
++	if (flags & (BPF_TRAMP_F_ORIG_STACK | BPF_TRAMP_F_SHARE_IPMODIFY))
++		return -ENOTSUPP;
++
++	stack_size = 0;
++
++	/* Room of trampoline frame to store return address and frame pointer */
++	stack_size += 16;
++
++	save_ret = flags & (BPF_TRAMP_F_CALL_ORIG | BPF_TRAMP_F_RET_FENTRY_RET);
++	if (save_ret) {
++		/* Save BPF R0 and A0 */
++		stack_size += 16;
++		retval_off = stack_size;
++	}
++
++	/* Room of trampoline frame to store args */
++	nargs = m->nr_args;
++	stack_size += nargs * 8;
++	args_off = stack_size;
++
++	/* Room of trampoline frame to store args number */
++	stack_size += 8;
++	nargs_off = stack_size;
++
++	/* Room of trampoline frame to store ip address */
++	if (flags & BPF_TRAMP_F_IP_ARG) {
++		stack_size += 8;
++		ip_off = stack_size;
++	}
++
++	/* Room of trampoline frame to store struct bpf_tramp_run_ctx */
++	stack_size += round_up(sizeof(struct bpf_tramp_run_ctx), 8);
++	run_ctx_off = stack_size;
++
++	stack_size += 8;
++	sreg_off = stack_size;
++
++	stack_size = round_up(stack_size, 16);
++
++	/* For the trampoline called from function entry */
++	/* RA and FP for parent function */
++	emit_insn(ctx, addid, LOONGARCH_GPR_SP, LOONGARCH_GPR_SP, -16);
++	emit_insn(ctx, std, LOONGARCH_GPR_RA, LOONGARCH_GPR_SP, 8);
++	emit_insn(ctx, std, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, 0);
++	emit_insn(ctx, addid, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, 16);
++
++	/* RA and FP for traced function */
++	emit_insn(ctx, addid, LOONGARCH_GPR_SP, LOONGARCH_GPR_SP, -stack_size);
++	emit_insn(ctx, std, LOONGARCH_GPR_T0, LOONGARCH_GPR_SP, stack_size - 8);
++	emit_insn(ctx, std, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, stack_size - 16);
++	emit_insn(ctx, addid, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, stack_size);
++
++	/* callee saved register S1 to pass start time */
++	emit_insn(ctx, std, LOONGARCH_GPR_S1, LOONGARCH_GPR_FP, -sreg_off);
++
++	/* store ip address of the traced function */
++	if (flags & BPF_TRAMP_F_IP_ARG) {
++		move_imm(ctx, LOONGARCH_GPR_T1, (const s64)func_addr, false);
++		emit_insn(ctx, std, LOONGARCH_GPR_T1, LOONGARCH_GPR_FP, -ip_off);
++	}
++
++	/* store nargs number */
++	move_imm(ctx, LOONGARCH_GPR_T1, nargs, false);
++	emit_insn(ctx, std, LOONGARCH_GPR_T1, LOONGARCH_GPR_FP, -nargs_off);
++
++	store_args(ctx, nargs, args_off);
++
++	/* To traced function */
++	/* Ftrace jump skips 2 NOP instructions */
++	if (is_kernel_text((unsigned long)orig_call))
++		orig_call += LOONGARCH_FENTRY_NBYTES;
++	/* Direct jump skips 5 NOP instructions */
++	else if (is_bpf_text_address((unsigned long)orig_call))
++		orig_call += LOONGARCH_BPF_FENTRY_NBYTES;
++
++	if (flags & BPF_TRAMP_F_CALL_ORIG) {
++		move_imm(ctx, LOONGARCH_GPR_A0, (const s64)im, false);
++		ret = emit_call(ctx, (const u64)__bpf_tramp_enter);
++		if (ret)
++			return ret;
++	}
++
++	for (i = 0; i < fentry->nr_links; i++) {
++		ret = invoke_bpf_prog(ctx, fentry->links[i], args_off, retval_off,
++				      run_ctx_off, flags & BPF_TRAMP_F_RET_FENTRY_RET);
++		if (ret)
++			return ret;
++	}
++	if (fmod_ret->nr_links) {
++		branches  = kcalloc(fmod_ret->nr_links, sizeof(u32 *), GFP_KERNEL);
++		if (!branches)
++			return -ENOMEM;
++
++		invoke_bpf_mod_ret(ctx, fmod_ret, args_off, retval_off, run_ctx_off, branches);
++	}
++
++	if (flags & BPF_TRAMP_F_CALL_ORIG) {
++		restore_args(ctx, m->nr_args, args_off);
++		ret = emit_call(ctx, (const u64)orig_call);
++		if (ret)
++			goto out;
++		emit_insn(ctx, std, LOONGARCH_GPR_A0, LOONGARCH_GPR_FP, -retval_off);
++		emit_insn(ctx, std, regmap[BPF_REG_0], LOONGARCH_GPR_FP, -(retval_off - 8));
++		im->ip_after_call = ctx->ro_image + ctx->idx;
++		/* Reserve space for the move_imm + jirl instruction */
++		for (i = 0; i < LOONGARCH_LONG_JUMP_NINSNS; i++)
++			emit_insn(ctx, nop);
++	}
++
++	for (i = 0; ctx->image && i < fmod_ret->nr_links; i++) {
++		int offset = (void *)(&ctx->image[ctx->idx]) - (void *)branches[i];
++		*branches[i] = larch_insn_gen_bne(LOONGARCH_GPR_T1, LOONGARCH_GPR_ZERO, offset);
++	}
++
++	for (i = 0; i < fexit->nr_links; i++) {
++		ret = invoke_bpf_prog(ctx, fexit->links[i], args_off, retval_off, run_ctx_off, false);
++		if (ret)
++			goto out;
++	}
++
++	if (flags & BPF_TRAMP_F_CALL_ORIG) {
++		im->ip_epilogue = ctx->ro_image + ctx->idx;
++		move_imm(ctx, LOONGARCH_GPR_A0, (const s64)im, false);
++		ret = emit_call(ctx, (const u64)__bpf_tramp_exit);
++		if (ret)
++			goto out;
++	}
++
++	if (flags & BPF_TRAMP_F_RESTORE_REGS)
++		restore_args(ctx, m->nr_args, args_off);
++
++	if (save_ret) {
++		emit_insn(ctx, ldd, LOONGARCH_GPR_A0, LOONGARCH_GPR_FP, -retval_off);
++		emit_insn(ctx, ldd, regmap[BPF_REG_0], LOONGARCH_GPR_FP, -(retval_off - 8));
++	}
++
++	emit_insn(ctx, ldd, LOONGARCH_GPR_S1, LOONGARCH_GPR_FP, -sreg_off);
++
++	/* trampoline called from function entry */
++	emit_insn(ctx, ldd, LOONGARCH_GPR_T0, LOONGARCH_GPR_SP, stack_size - 8);
++	emit_insn(ctx, ldd, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, stack_size - 16);
++	emit_insn(ctx, addid, LOONGARCH_GPR_SP, LOONGARCH_GPR_SP, stack_size);
++
++	emit_insn(ctx, ldd, LOONGARCH_GPR_RA, LOONGARCH_GPR_SP, 8);
++	emit_insn(ctx, ldd, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, 0);
++	emit_insn(ctx, addid, LOONGARCH_GPR_SP, LOONGARCH_GPR_SP, 16);
++
++	if (flags & BPF_TRAMP_F_SKIP_FRAME)
++		/* return to parent function */
++		emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_RA, 0);
++	else
++		/* return to traced function */
++		emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_T0, 0);
++
++	ret = ctx->idx;
++out:
++	kfree(branches);
++
++	return ret;
++}
++
++int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *ro_image,
++				void *ro_image_end, const struct btf_func_model *m,
++				u32 flags, struct bpf_tramp_links *tlinks, void *func_addr)
++{
++	int ret, size;
++	void *image, *tmp;
++	struct jit_ctx ctx;
++
++	size = ro_image_end - ro_image;
++	image = kvmalloc(size, GFP_KERNEL);
++	if (!image)
++		return -ENOMEM;
++
++	ctx.image = (union loongarch_instruction *)image;
++	ctx.ro_image = (union loongarch_instruction *)ro_image;
++	ctx.idx = 0;
++
++	jit_fill_hole(image, (unsigned int)(ro_image_end - ro_image));
++	ret = __arch_prepare_bpf_trampoline(&ctx, im, m, tlinks, func_addr, flags);
++	if (ret > 0 && validate_code(&ctx) < 0) {
++		ret = -EINVAL;
++		goto out;
++	}
++
++	tmp = bpf_arch_text_copy(ro_image, image, size);
++	if (IS_ERR(tmp)) {
++		ret = PTR_ERR(tmp);
++		goto out;
++	}
++
++	bpf_flush_icache(ro_image, ro_image_end);
++out:
++	kvfree(image);
++	return ret < 0 ? ret : size;
++}
++
++int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
++			     struct bpf_tramp_links *tlinks, void *func_addr)
++{
++	int ret;
++	struct jit_ctx ctx;
++	struct bpf_tramp_image im;
++
++	ctx.image = NULL;
++	ctx.idx = 0;
++
++	ret = __arch_prepare_bpf_trampoline(&ctx, &im, m, tlinks, func_addr, flags);
++
++	/* Page align */
++	return ret < 0 ? ret : round_up(ret * LOONGARCH_INSN_SIZE, PAGE_SIZE);
++}
++
+ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
+ {
+ 	bool tmp_blinded = false, extra_pass = false;
+--- a/arch/loongarch/net/bpf_jit.h
++++ b/arch/loongarch/net/bpf_jit.h
+@@ -18,6 +18,7 @@ struct jit_ctx {
+ 	u32 *offset;
+ 	int num_exentries;
+ 	union loongarch_instruction *image;
++	union loongarch_instruction *ro_image;
+ 	u32 stack_size;
+ };
+ 
+@@ -308,3 +309,8 @@ static inline int emit_tailcall_jmp(stru
+ 
+ 	return -EINVAL;
+ }
++
++static inline void bpf_flush_icache(void *start, void *end)
++{
++	flush_icache_range((unsigned long)start, (unsigned long)end);
++}



From lede-commits at lists.infradead.org  Mon Dec  8 09:53:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 12:53:45 -0500
Subject: [openwrt/openwrt]  dropbear: enable configurable port forwarding
 options
In-Reply-To: <176521642566.1070905.9145790946259808479@git-01.infra.openwrt.org>
References: <176521642566.1070905.9145790946259808479@git-01.infra.openwrt.org>
Message-ID: <mailman.34093.1765216429.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/83f6177dbf44fa92ecf6d2e1cda9f92cfc5fe849

commit 83f6177dbf44fa92ecf6d2e1cda9f92cfc5fe849
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Sat Dec 6 18:34:37 2025 +0000

    dropbear: enable configurable port forwarding options
    
    Currently its only possible to disable port forwarding only for specific
    keys, via the OpenSSH-style restriction in `authorized_keys` file.
    
    In some use cases it might be feasible to disable such features globally
    on service level, so lets add new LocalPortForward and RemotePortForward
    config knobs.
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
    Link: https://github.com/openwrt/openwrt/pull/21071
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/network/services/dropbear/files/dropbear.config | 2 ++
 package/network/services/dropbear/files/dropbear.init   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/package/network/services/dropbear/files/dropbear.config b/package/network/services/dropbear/files/dropbear.config
index 7eb5975449..7957cd6a49 100644
--- a/package/network/services/dropbear/files/dropbear.config
+++ b/package/network/services/dropbear/files/dropbear.config
@@ -5,3 +5,5 @@ config dropbear main
 	option RootPasswordAuth 'on'
 	option Port         '22'
 #	option BannerFile   '/etc/banner'
+#	option LocalPortForward 'off'
+#	option RemotePortForward 'off'
diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init
index 2f5d9698eb..d5eb44bf75 100755
--- a/package/network/services/dropbear/files/dropbear.init
+++ b/package/network/services/dropbear/files/dropbear.init
@@ -178,6 +178,8 @@ validate_section_dropbear()
 		'IdleTimeout:uinteger:0' \
 		'MaxAuthTries:uinteger:3' \
 		'RecvWindowSize:uinteger:0' \
+		'LocalPortForward:bool:1' \
+		'RemotePortForward:bool:1' \
 		'mdns:bool:1'
 }
 
@@ -317,6 +319,8 @@ dropbear_instance()
 	fi
 	[ "${PasswordAuth}" -eq 0 ] && procd_append_param command -s
 	[ "${GatewayPorts}" -eq 1 ] && procd_append_param command -a
+	[ "${LocalPortForward}" -eq 0 ] && procd_append_param command -j
+	[ "${RemotePortForward}" -eq 0 ] && procd_append_param command -k
 	[ -n "${ForceCommand}" ] && procd_append_param command -c "${ForceCommand}"
 	[ "${RootPasswordAuth}" -eq 0 ] && procd_append_param command -g
 	[ "${RootLogin}" -eq 0 ] && procd_append_param command -w



From lede-commits at lists.infradead.org  Mon Dec  8 09:56:36 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 12:56:36 -0500
Subject: [openwrt/openwrt]  openssl: Update to version 3.0.17
In-Reply-To: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
References: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
Message-ID: <mailman.34094.1765216599.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/1ff42fc429a59958b2659ab1df2491aa9ea3a2a9

commit 1ff42fc429a59958b2659ab1df2491aa9ea3a2a9
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jul 6 17:51:01 2025 +0200

    openssl: Update to version 3.0.17
    
    This release incorporates the following bug fixes and mitigations:
    
        Miscellaneous minor bug fixes.
    
    Link: https://github.com/openwrt/openwrt/pull/19325
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit f68c3e5057ab4fe4330bef1619fdd6a081b233bf)
---
 package/libs/openssl/Makefile                                  | 4 ++--
 package/libs/openssl/patches/100-Configure-afalg-support.patch | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 4829670f86..25a71fa7a4 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
-PKG_VERSION:=3.0.16
+PKG_VERSION:=3.0.17
 PKG_RELEASE:=1
 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
 
@@ -21,7 +21,7 @@ PKG_SOURCE_URL:= \
 	https://www.openssl.org/source/old/$(PKG_BASE)/ \
 	https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
 
-PKG_HASH:=57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86
+PKG_HASH:=dfdd77e4ea1b57ff3a6dbde6b0bdc3f31db5ac99e7fdd4eaf9e1fbb6ec2db8ce
 
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
diff --git a/package/libs/openssl/patches/100-Configure-afalg-support.patch b/package/libs/openssl/patches/100-Configure-afalg-support.patch
index e9cd7bf9c1..7ce5cd4383 100644
--- a/package/libs/openssl/patches/100-Configure-afalg-support.patch
+++ b/package/libs/openssl/patches/100-Configure-afalg-support.patch
@@ -10,7 +10,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
 
 --- a/Configure
 +++ b/Configure
-@@ -1677,7 +1677,9 @@ $config{CFLAGS} = [ map { $_ eq '--ossl-
+@@ -1678,7 +1678,9 @@ $config{CFLAGS} = [ map { $_ eq '--ossl-
  
  unless ($disabled{afalgeng}) {
      $config{afalgeng}="";



From lede-commits at lists.infradead.org  Mon Dec  8 09:56:35 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 12:56:35 -0500
Subject: [openwrt/openwrt]  openssl: update download mirrors
In-Reply-To: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
References: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
Message-ID: <mailman.34095.1765216599.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/93a08f1534b16e5070a19ce11d5ca76d44aea677

commit 93a08f1534b16e5070a19ce11d5ca76d44aea677
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Wed Sep 18 23:10:16 2024 +0800

    openssl: update download mirrors
    
    New releases of openssl are only published on GitHub, and official
    downloads are also redirected to GitHub. So remove the old download
    mirrors (file 404), and replace the current address with https.
    
    Link: https://openssl-library.org/source/
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    Link: https://github.com/openwrt/openwrt/pull/16470
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 38bb47c36c473a33b054a76dcd52827ae15fb610)
---
 package/libs/openssl/Makefile | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index a1da6f5d9c..4829670f86 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -17,13 +17,9 @@ PKG_BUILD_PARALLEL:=1
 PKG_BASE:=$(subst $(space),.,$(wordlist 1,2,$(subst .,$(space),$(PKG_VERSION))))
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
-	http://www.openssl.org/source/ \
-	http://www.openssl.org/source/old/$(PKG_BASE)/ \
-	https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ \
-	http://ftp.fi.muni.cz/pub/openssl/source/ \
-	http://ftp.fi.muni.cz/pub/openssl/source/old/$(PKG_BASE)/ \
-	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \
-	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/
+	https://www.openssl.org/source/ \
+	https://www.openssl.org/source/old/$(PKG_BASE)/ \
+	https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
 
 PKG_HASH:=57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86
 
@@ -74,7 +70,7 @@ endif
 
 define Package/openssl/Default
   TITLE:=Open source SSL toolkit
-  URL:=http://www.openssl.org/
+  URL:=https://www.openssl.org/
   SECTION:=libs
   CATEGORY:=Libraries
 endef



From lede-commits at lists.infradead.org  Mon Dec  8 09:56:37 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 12:56:37 -0500
Subject: [openwrt/openwrt]  openssl: Backport fix for OpenSSL 3.5.2 and 3.0.17
 regression
In-Reply-To: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
References: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
Message-ID: <mailman.34096.1765216600.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/26433c21685ea7c783ea930202ce38b05c1b805c

commit 26433c21685ea7c783ea930202ce38b05c1b805c
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Wed Sep 17 11:16:20 2025 +0200

    openssl: Backport fix for OpenSSL 3.5.2 and 3.0.17 regression
    
    Fixes segmentation faults in openssl. This problem was introduced in
    version 3.5.2 and 3.0.17. Backport a fix from the OpenSSL 3.0 branch.
    
    Link: https://forum.openwrt.org/t/openssl-3-0-17-libcrypto-segmentation-faults-regression/240650/9
    Link: https://github.com/openssl/openssl/issues/28171
    Link: https://github.com/openssl/openssl/commit/c0d968f0ac56ad507ab0101e537e7d530e9f0448
    Fixes: f68c3e5057ab ("openssl: Update to version 3.0.17")
    Link: https://github.com/openwrt/openwrt/pull/20069
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit aa3c98f82173c04eea4932474116a5befb7aba7b)
    (cherry picked from commit 640e364ec0622017e088368ff5422893da847211)
---
 package/libs/openssl/Makefile                      |   2 +-
 ...t-keep-the-store-open-in-by_store_ctrl_ex.patch | 127 +++++++++++++++++++++
 2 files changed, 128 insertions(+), 1 deletion(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 25a71fa7a4..9b9655975d 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
 PKG_VERSION:=3.0.17
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
 
 PKG_BUILD_PARALLEL:=1
diff --git a/package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch b/package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch
new file mode 100644
index 0000000000..18b26fa6c3
--- /dev/null
+++ b/package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch
@@ -0,0 +1,127 @@
+From c0d968f0ac56ad507ab0101e537e7d530e9f0448 Mon Sep 17 00:00:00 2001
+From: Matt Caswell <matt at openssl.org>
+Date: Thu, 7 Aug 2025 17:50:17 +0100
+Subject: [PATCH] Don't keep the store open in by_store_ctrl_ex
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Previously #27529 made a change to `by_store_ctrl_ex` in order to open
+the OSSL_STORE early. The reason given in that PR is:
+
+"This way, we can call OSSL_STORE_open_ex() in by_store_ctrl_ex(), and
+get to see possible errors when the URI is loaded"
+
+That PR then kept the store open until cache_objects is called and then
+reused it. Unfortunately by the time cache_objects() is called we could be
+in a multi-threaded scenario where the X509_STORE is being shared by
+multiple threads. We then get a race condition where multiple threads are
+all using (and ultimately closing) the same `OSSL_STORE_CTX`.
+
+The purpose of keeping the `OSSL_STORE` object between by_store_ctrl_ex()
+and `cache_objects` is presumably an optimisation to avoid having to open
+the store twice. But this does not work because of the above issue.
+
+We just take the hit and open it again.
+
+Fixes #28171
+
+Reviewed-by: Tomas Mraz <tomas at openssl.org>
+Reviewed-by: Sa?a Nedv?dick? <sashan at openssl.org>
+(Merged from https://github.com/openssl/openssl/pull/28385)
+---
+ crypto/x509/by_store.c | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+--- a/crypto/x509/by_store.c
++++ b/crypto/x509/by_store.c
+@@ -17,7 +17,6 @@ typedef struct cached_store_st {
+     char *uri;
+     OSSL_LIB_CTX *libctx;
+     char *propq;
+-    OSSL_STORE_CTX *ctx;
+ } CACHED_STORE;
+ 
+ DEFINE_STACK_OF(CACHED_STORE)
+@@ -27,14 +26,12 @@ static int cache_objects(X509_LOOKUP *lc
+                          const OSSL_STORE_SEARCH *criterion, int depth)
+ {
+     int ok = 0;
+-    OSSL_STORE_CTX *ctx = store->ctx;
++    OSSL_STORE_CTX *ctx;
+     X509_STORE *xstore = X509_LOOKUP_get_store(lctx);
+ 
+-    if (ctx == NULL
+-        && (ctx = OSSL_STORE_open_ex(store->uri, store->libctx, store->propq,
+-                                     NULL, NULL, NULL, NULL, NULL)) == NULL)
++    if ((ctx = OSSL_STORE_open_ex(store->uri, store->libctx, store->propq,
++                                  NULL, NULL, NULL, NULL, NULL)) == NULL)
+         return 0;
+-    store->ctx = ctx;
+ 
+     /*
+      * We try to set the criterion, but don't care if it was valid or not.
+@@ -79,7 +76,6 @@ static int cache_objects(X509_LOOKUP *lc
+                 substore.uri = (char *)OSSL_STORE_INFO_get0_NAME(info);
+                 substore.libctx = store->libctx;
+                 substore.propq = store->propq;
+-                substore.ctx = NULL;
+                 ok = cache_objects(lctx, &substore, criterion, depth - 1);
+             }
+         } else {
+@@ -105,7 +101,6 @@ static int cache_objects(X509_LOOKUP *lc
+             break;
+     }
+     OSSL_STORE_close(ctx);
+-    store->ctx = NULL;
+ 
+     return ok;
+ }
+@@ -114,7 +109,6 @@ static int cache_objects(X509_LOOKUP *lc
+ static void free_store(CACHED_STORE *store)
+ {
+     if (store != NULL) {
+-        OSSL_STORE_close(store->ctx);
+         OPENSSL_free(store->uri);
+         OPENSSL_free(store->propq);
+         OPENSSL_free(store);
+@@ -148,6 +142,7 @@ static int by_store_ctrl_ex(X509_LOOKUP
+         {
+             STACK_OF(CACHED_STORE) *stores = X509_LOOKUP_get_method_data(ctx);
+             CACHED_STORE *store = OPENSSL_zalloc(sizeof(*store));
++            OSSL_STORE_CTX *sctx;
+ 
+             if (store == NULL) {
+                 return 0;
+@@ -157,14 +152,20 @@ static int by_store_ctrl_ex(X509_LOOKUP
+             store->libctx = libctx;
+             if (propq != NULL)
+                 store->propq = OPENSSL_strdup(propq);
+-            store->ctx = OSSL_STORE_open_ex(argp, libctx, propq, NULL, NULL,
+-                                           NULL, NULL, NULL);
+-            if (store->ctx == NULL
++            /*
++             * We open this to check for errors now - so we can report those
++             * errors early.
++             */
++            sctx = OSSL_STORE_open_ex(argp, libctx, propq, NULL, NULL,
++                                      NULL, NULL, NULL);
++            if (sctx == NULL
+                 || (propq != NULL && store->propq == NULL)
+                 || store->uri == NULL) {
++                OSSL_STORE_close(sctx);
+                 free_store(store);
+                 return use_default;
+             }
++            OSSL_STORE_close(sctx);
+ 
+             if (stores == NULL) {
+                 stores = sk_CACHED_STORE_new_null();
+@@ -184,7 +185,6 @@ static int by_store_ctrl_ex(X509_LOOKUP
+         store.uri = (char *)argp;
+         store.libctx = libctx;
+         store.propq = (char *)propq;
+-        store.ctx = NULL;
+         return cache_objects(ctx, &store, NULL, 0);
+     }
+     default:



From lede-commits at lists.infradead.org  Mon Dec  8 09:56:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 12:56:38 -0500
Subject: [openwrt/openwrt]  openssl: correct PKG_LICENSE_FILES
In-Reply-To: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
References: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
Message-ID: <mailman.34097.1765216601.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/a25c76d8c736ea15d9e05868c62711352efefc1e

commit a25c76d8c736ea15d9e05868c62711352efefc1e
Author: Linus Kardell <linus.kardell at infobric.com>
AuthorDate: Tue Sep 9 16:24:55 2025 +0200

    openssl: correct PKG_LICENSE_FILES
    
    Point to correct file name.
    
    Signed-off-by: Linus Kardell <linus.kardell at infobric.com>
    Link: https://github.com/openwrt/openwrt/pull/19999
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit bcfc3f01a42301c08c8b2449d6a3862082c8079a)
    (cherry picked from commit daca7c049b93c950b16d46dce860cb94e4a45f42)
---
 package/libs/openssl/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 9b9655975d..267419613f 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
 PKG_VERSION:=3.0.17
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
 
 PKG_BUILD_PARALLEL:=1
@@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \
 PKG_HASH:=dfdd77e4ea1b57ff3a6dbde6b0bdc3f31db5ac99e7fdd4eaf9e1fbb6ec2db8ce
 
 PKG_LICENSE:=Apache-2.0
-PKG_LICENSE_FILES:=LICENSE
+PKG_LICENSE_FILES:=LICENSE.txt
 PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz at gmail.com>
 PKG_CPE_ID:=cpe:/a:openssl:openssl
 PKG_CONFIG_DEPENDS:= \



From lede-commits at lists.infradead.org  Mon Dec  8 09:56:39 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 12:56:39 -0500
Subject: [openwrt/openwrt]  openssl: Update to version 3.0.18
In-Reply-To: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
References: <176521659558.1092339.3317829198414354574@git-01.infra.openwrt.org>
Message-ID: <mailman.34100.1765216601.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/b6d7048c8bcf23d9852cf17f1fa1d532d1552474

commit b6d7048c8bcf23d9852cf17f1fa1d532d1552474
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 5 19:43:22 2025 +0200

    openssl: Update to version 3.0.18
    
    OpenSSL 3.0.18 is a security patch release. The most severe CVE fixed in this
    release is Moderate.
    
    This release incorporates the following bug fixes and mitigations:
    
     * Fix Out-of-bounds read & write in RFC 3211 KEK Unwrap. (CVE-2025-9230)
    
     * Fix Out-of-bounds read in HTTP client no_proxy handling. (CVE-2025-9232)
    
    The removed patch is included upstream:
    https://github.com/openssl/openssl/commit/c0d968f0ac56ad507ab0101e537e7d530e9f0448
    
    Link: https://github.com/openwrt/openwrt/pull/20312
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 6e068b7052cccadc7e3543ca6741ece26333097e)
---
 package/libs/openssl/Makefile                      |   6 +-
 ...t-keep-the-store-open-in-by_store_ctrl_ex.patch | 127 ---------------------
 2 files changed, 3 insertions(+), 130 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 267419613f..70d64d6711 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
-PKG_VERSION:=3.0.17
-PKG_RELEASE:=3
+PKG_VERSION:=3.0.18
+PKG_RELEASE:=1
 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
 
 PKG_BUILD_PARALLEL:=1
@@ -21,7 +21,7 @@ PKG_SOURCE_URL:= \
 	https://www.openssl.org/source/old/$(PKG_BASE)/ \
 	https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
 
-PKG_HASH:=dfdd77e4ea1b57ff3a6dbde6b0bdc3f31db5ac99e7fdd4eaf9e1fbb6ec2db8ce
+PKG_HASH:=d80c34f5cf902dccf1f1b5df5ebb86d0392e37049e5d73df1b3abae72e4ffe8b
 
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE.txt
diff --git a/package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch b/package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch
deleted file mode 100644
index 18b26fa6c3..0000000000
--- a/package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From c0d968f0ac56ad507ab0101e537e7d530e9f0448 Mon Sep 17 00:00:00 2001
-From: Matt Caswell <matt at openssl.org>
-Date: Thu, 7 Aug 2025 17:50:17 +0100
-Subject: [PATCH] Don't keep the store open in by_store_ctrl_ex
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Previously #27529 made a change to `by_store_ctrl_ex` in order to open
-the OSSL_STORE early. The reason given in that PR is:
-
-"This way, we can call OSSL_STORE_open_ex() in by_store_ctrl_ex(), and
-get to see possible errors when the URI is loaded"
-
-That PR then kept the store open until cache_objects is called and then
-reused it. Unfortunately by the time cache_objects() is called we could be
-in a multi-threaded scenario where the X509_STORE is being shared by
-multiple threads. We then get a race condition where multiple threads are
-all using (and ultimately closing) the same `OSSL_STORE_CTX`.
-
-The purpose of keeping the `OSSL_STORE` object between by_store_ctrl_ex()
-and `cache_objects` is presumably an optimisation to avoid having to open
-the store twice. But this does not work because of the above issue.
-
-We just take the hit and open it again.
-
-Fixes #28171
-
-Reviewed-by: Tomas Mraz <tomas at openssl.org>
-Reviewed-by: Sa?a Nedv?dick? <sashan at openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/28385)
----
- crypto/x509/by_store.c | 26 +++++++++++++-------------
- 1 file changed, 13 insertions(+), 13 deletions(-)
-
---- a/crypto/x509/by_store.c
-+++ b/crypto/x509/by_store.c
-@@ -17,7 +17,6 @@ typedef struct cached_store_st {
-     char *uri;
-     OSSL_LIB_CTX *libctx;
-     char *propq;
--    OSSL_STORE_CTX *ctx;
- } CACHED_STORE;
- 
- DEFINE_STACK_OF(CACHED_STORE)
-@@ -27,14 +26,12 @@ static int cache_objects(X509_LOOKUP *lc
-                          const OSSL_STORE_SEARCH *criterion, int depth)
- {
-     int ok = 0;
--    OSSL_STORE_CTX *ctx = store->ctx;
-+    OSSL_STORE_CTX *ctx;
-     X509_STORE *xstore = X509_LOOKUP_get_store(lctx);
- 
--    if (ctx == NULL
--        && (ctx = OSSL_STORE_open_ex(store->uri, store->libctx, store->propq,
--                                     NULL, NULL, NULL, NULL, NULL)) == NULL)
-+    if ((ctx = OSSL_STORE_open_ex(store->uri, store->libctx, store->propq,
-+                                  NULL, NULL, NULL, NULL, NULL)) == NULL)
-         return 0;
--    store->ctx = ctx;
- 
-     /*
-      * We try to set the criterion, but don't care if it was valid or not.
-@@ -79,7 +76,6 @@ static int cache_objects(X509_LOOKUP *lc
-                 substore.uri = (char *)OSSL_STORE_INFO_get0_NAME(info);
-                 substore.libctx = store->libctx;
-                 substore.propq = store->propq;
--                substore.ctx = NULL;
-                 ok = cache_objects(lctx, &substore, criterion, depth - 1);
-             }
-         } else {
-@@ -105,7 +101,6 @@ static int cache_objects(X509_LOOKUP *lc
-             break;
-     }
-     OSSL_STORE_close(ctx);
--    store->ctx = NULL;
- 
-     return ok;
- }
-@@ -114,7 +109,6 @@ static int cache_objects(X509_LOOKUP *lc
- static void free_store(CACHED_STORE *store)
- {
-     if (store != NULL) {
--        OSSL_STORE_close(store->ctx);
-         OPENSSL_free(store->uri);
-         OPENSSL_free(store->propq);
-         OPENSSL_free(store);
-@@ -148,6 +142,7 @@ static int by_store_ctrl_ex(X509_LOOKUP
-         {
-             STACK_OF(CACHED_STORE) *stores = X509_LOOKUP_get_method_data(ctx);
-             CACHED_STORE *store = OPENSSL_zalloc(sizeof(*store));
-+            OSSL_STORE_CTX *sctx;
- 
-             if (store == NULL) {
-                 return 0;
-@@ -157,14 +152,20 @@ static int by_store_ctrl_ex(X509_LOOKUP
-             store->libctx = libctx;
-             if (propq != NULL)
-                 store->propq = OPENSSL_strdup(propq);
--            store->ctx = OSSL_STORE_open_ex(argp, libctx, propq, NULL, NULL,
--                                           NULL, NULL, NULL);
--            if (store->ctx == NULL
-+            /*
-+             * We open this to check for errors now - so we can report those
-+             * errors early.
-+             */
-+            sctx = OSSL_STORE_open_ex(argp, libctx, propq, NULL, NULL,
-+                                      NULL, NULL, NULL);
-+            if (sctx == NULL
-                 || (propq != NULL && store->propq == NULL)
-                 || store->uri == NULL) {
-+                OSSL_STORE_close(sctx);
-                 free_store(store);
-                 return use_default;
-             }
-+            OSSL_STORE_close(sctx);
- 
-             if (stores == NULL) {
-                 stores = sk_CACHED_STORE_new_null();
-@@ -184,7 +185,6 @@ static int by_store_ctrl_ex(X509_LOOKUP
-         store.uri = (char *)argp;
-         store.libctx = libctx;
-         store.propq = (char *)propq;
--        store.ctx = NULL;
-         return cache_objects(ctx, &store, NULL, 0);
-     }
-     default:



From lede-commits at lists.infradead.org  Mon Dec  8 12:31:31 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 15:31:31 -0500
Subject: [openwrt/openwrt]  apk: define minimal variant for install
In-Reply-To: <176522589191.1882040.12730523571709938338@git-01.infra.openwrt.org>
References: <176522589191.1882040.12730523571709938338@git-01.infra.openwrt.org>
Message-ID: <mailman.34113.1765225900.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1684c28cfe67650cef0a9bd6f3c54fa62b0916c3

commit 1684c28cfe67650cef0a9bd6f3c54fa62b0916c3
Author: Paul Donald <newtwen+github at gmail.com>
AuthorDate: Mon Dec 8 20:45:16 2025 +0100

    apk: define minimal variant for install
    
    Choose the minimal release build which excludes a number of
    unused applets, not used on user devices.
    
    Signed-off-by: Paul Donald <newtwen+github at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21093
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/system/apk/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile
index 9627084f4e..0fda788185 100644
--- a/package/system/apk/Makefile
+++ b/package/system/apk/Makefile
@@ -70,7 +70,8 @@ MESON_HOST_ARGS += \
 
 MESON_ARGS += \
 	$(MESON_COMMON_ARGS) \
-	-Dcrypto_backend=$(BUILD_VARIANT)
+	-Dcrypto_backend=$(BUILD_VARIANT) \
+	-Dminimal=true
 
 define Package/apk/conffiles
 /etc/apk/repositories.d/customfeeds.list



From lede-commits at lists.infradead.org  Mon Dec  8 12:31:32 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 15:31:32 -0500
Subject: [openwrt/openwrt]  apk: bump to 3.0.1
In-Reply-To: <176522589191.1882040.12730523571709938338@git-01.infra.openwrt.org>
References: <176522589191.1882040.12730523571709938338@git-01.infra.openwrt.org>
Message-ID: <mailman.34114.1765225901.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b91ebdabbb09b330351b2ac8c7d3a45644344553

commit b91ebdabbb09b330351b2ac8c7d3a45644344553
Author: Paul Donald <newtwen+github at gmail.com>
AuthorDate: Mon Dec 8 17:41:25 2025 +0100

    apk: bump to 3.0.1
    
    Recently finalized 3 branch bumped to 3.0.1
    
    dropped patches
    -010-libressl4.patch; integrated at source
    -999-small-scripts-tar.patch; integrated at source
    
    refreshed remaining patches
    
    DEPRECATION: Option 'compressed-help' is deprecated - removed.
    DEPRECATION: Option 'zstd' value 'false' is replaced by 'disabled'
    
    Signed-off-by: Paul Donald <newtwen+github at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21093
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/system/apk/Makefile                        | 13 +++---
 ...0001-openwrt-move-layer-db-to-temp-folder.patch |  2 +-
 package/system/apk/patches/010-libressl4.patch     | 32 --------------
 .../system/apk/patches/999-small-scripts-tar.patch | 49 ----------------------
 4 files changed, 7 insertions(+), 89 deletions(-)

diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile
index 0fda788185..07ad1d7a32 100644
--- a/package/system/apk/Makefile
+++ b/package/system/apk/Makefile
@@ -1,15 +1,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=apk
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2025-11-10
-PKG_SOURCE_VERSION:=2c027261492169783f6aaa2b7731a4e90dc7a5b0
-PKG_MIRROR_HASH:=177769a6b7a4b0a2117ed4326060eb08b19c1b930a8a92b7c25d2f56154f497e
+PKG_SOURCE_DATE:=2025-12-03
+PKG_SOURCE_VERSION:=982c9961ad9e71b4068911329c9d8121cedfd9f7
+PKG_MIRROR_HASH:=4fc89e2bbbe10edfaa199b1ca9ace139aa39b43d3de6236e8be8b421d81b334b
 
-PKG_VERSION=3.0.0_pre$(subst -,,$(PKG_SOURCE_DATE))
+PKG_VERSION=3.0.1
 
 PKG_MAINTAINER:=Paul Spooren <mail at aparcar.org>
 PKG_LICENSE:=GPL-2.0-only
@@ -54,13 +54,12 @@ MESON_VARS+=VERSION=$(PKG_VERSION)
 
 MESON_COMMON_ARGS = \
 	-Db_lto=true \
-	-Dcompressed-help=false \
 	-Ddocs=disabled \
 	-Dhelp=enabled \
 	-Dlua_version=5.1 \
 	-Ddefault_library=static \
 	-Durl_backend=wget \
-	-Dzstd=false \
+	-Dzstd=disabled \
 	-Dpython=disabled \
 	-Dtests=disabled
 
diff --git a/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch b/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch
index 32aaa92fa5..6d80c1d77f 100644
--- a/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch
+++ b/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch
@@ -10,7 +10,7 @@ Signed-off-by: Paul Spooren <mail at aparcar.org>
 
 --- a/src/database.c
 +++ b/src/database.c
-@@ -1937,7 +1937,7 @@ const char *apk_db_layer_name(int layer)
+@@ -1918,7 +1918,7 @@ const char *apk_db_layer_name(int layer)
  {
  	switch (layer) {
  	case APK_DB_LAYER_ROOT: return "lib/apk/db";
diff --git a/package/system/apk/patches/010-libressl4.patch b/package/system/apk/patches/010-libressl4.patch
deleted file mode 100644
index 16e337e013..0000000000
--- a/package/system/apk/patches/010-libressl4.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From aa71510f843d5cce5f75b6abfa3a70caeacbe36d Mon Sep 17 00:00:00 2001
-From: Rosen Penev <rosenp at gmail.com>
-Date: Thu, 20 Nov 2025 18:26:52 -0800
-Subject: [PATCH] fix usage under LibreSSL > 3
-
-crypto needs to be initialized as the context relies on it.
-
-Fixes crash in EVP_DigestInit_ex being called with a NULL digest.
-
-Signed-off-by: Rosen Penev <rosenp at gmail.com>
----
- src/apk.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/apk.c
-+++ b/src/apk.c
-@@ -571,6 +571,7 @@ int main(int argc, char **argv)
- 	apk_argv[argc] = NULL;
- 	apk_argv[argc+1] = NULL;
- 
-+	apk_crypto_init();
- 	apk_ctx_init(&ctx);
- 	umask(0);
- 	setup_terminal();
-@@ -583,7 +584,6 @@ int main(int argc, char **argv)
- 		if (applet->parse) applet->parse(applet_ctx, &ctx, APK_OPTIONS_INIT, NULL);
- 	}
- 
--	apk_crypto_init();
- 	apk_io_url_init(&ctx.out);
- 	apk_io_url_set_timeout(60);
- 	apk_io_url_set_redirect_callback(redirect_callback);
diff --git a/package/system/apk/patches/999-small-scripts-tar.patch b/package/system/apk/patches/999-small-scripts-tar.patch
deleted file mode 100644
index e690502ccf..0000000000
--- a/package/system/apk/patches/999-small-scripts-tar.patch
+++ /dev/null
@@ -1,49 +0,0 @@
---- a/doc/apk.8.scd
-+++ b/doc/apk.8.scd
-@@ -462,7 +462,8 @@ timeout 120
- */lib/apk/db/installed*
- 	Database of installed packages and their contents.
- 
--*/lib/apk/db/scripts.tar*
-+*/lib/apk/db/scripts.tar*++
-+*/lib/apk/db/scripts.tar.gz*
- 	Collection of all package scripts from currently installed packages.
- 
- */lib/apk/db/triggers*
---- a/src/apk_database.h
-+++ b/src/apk_database.h
-@@ -210,6 +210,7 @@ struct apk_database {
- 	unsigned int compat_depversions : 1;
- 	unsigned int sorted_names : 1;
- 	unsigned int sorted_installed_packages : 1;
-+	unsigned int scripts_tar : 1;
- 
- 	struct apk_dependency_array *world;
- 	struct apk_id_cache *id_cache;
---- a/src/database.c
-+++ b/src/database.c
-@@ -1338,8 +1338,11 @@ static int apk_db_read_layer(struct apk_
- 	}
- 
- 	if (!(flags & APK_OPENF_NO_SCRIPTS)) {
--		r = apk_tar_parse(apk_istream_from_file(fd, "scripts.tar"),
--				  apk_read_script_archive_entry, db, db->id_cache);
-+		struct apk_istream *is = apk_istream_from_file(fd, "scripts.tar");
-+		if (!IS_ERR(is) || PTR_ERR(is) != -ENOENT) db->scripts_tar = 1;
-+		else is = apk_istream_gunzip(apk_istream_from_file(fd, "scripts.tar.gz"));
-+
-+		r = apk_tar_parse(is, apk_read_script_archive_entry, db, db->id_cache);
- 		if (!ret && r != -ENOENT) ret = r;
- 	}
- 
-@@ -2214,8 +2217,9 @@ static int apk_db_write_layers(struct ap
- 			continue;
- 		}
- 		ld->installed = apk_ostream_to_file(ld->fd, "installed", 0644);
--		ld->scripts   = apk_ostream_to_file(ld->fd, "scripts.tar", 0644);
- 		ld->triggers  = apk_ostream_to_file(ld->fd, "triggers", 0644);
-+		if (db->scripts_tar) ld->scripts = apk_ostream_to_file(ld->fd, "scripts.tar", 0644);
-+		else ld->scripts = apk_ostream_gzip(apk_ostream_to_file(ld->fd, "scripts.tar.gz", 0644));
- 
- 		if (i == APK_DB_LAYER_ROOT)
- 			os = apk_ostream_to_file(db->root_fd, apk_world_file, 0644);



From lede-commits at lists.infradead.org  Mon Dec  8 12:45:19 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 15:45:19 -0500
Subject: [openwrt/openwrt]  Revert "generic: add pending patch fixing
 resource_size()"
In-Reply-To: <176522671903.1964205.14679062475545557002@git-01.infra.openwrt.org>
References: <176522671903.1964205.14679062475545557002@git-01.infra.openwrt.org>
Message-ID: <mailman.34115.1765226724.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1c02c78e7c659022bb1a6eb68cd2c847799891f2

commit 1c02c78e7c659022bb1a6eb68cd2c847799891f2
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Dec 8 21:41:03 2025 +0100

    Revert "generic: add pending patch fixing resource_size()"
    
    This reverts commit 63e2b17c011318b7f7a5c7082fd8c969c430d7df.
    
    Further discussion with Upstream for the topic revealed an even subtle
    problem that require specific driver to be fixed. Revert the wrong
    generic fix in favor of specific ath11k fix.
    
    Link: https://lore.kernel.org/all/20251207215359.28895-1-ansuelsmth at gmail.com/T/#m990492684913c5a158ff0e5fc90697d8ad95351b
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...ndle-wrong-resource_size-value-on-zero-st.patch | 80 ----------------------
 1 file changed, 80 deletions(-)

diff --git a/target/linux/generic/pending-6.12/210-resource-handle-wrong-resource_size-value-on-zero-st.patch b/target/linux/generic/pending-6.12/210-resource-handle-wrong-resource_size-value-on-zero-st.patch
deleted file mode 100644
index af93a56d85..0000000000
--- a/target/linux/generic/pending-6.12/210-resource-handle-wrong-resource_size-value-on-zero-st.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 7e1241396c241f9b4fff2ff133806fef4ddd9ecc Mon Sep 17 00:00:00 2001
-From: Christian Marangi <ansuelsmth at gmail.com>
-Date: Sun, 7 Dec 2025 22:18:11 +0100
-Subject: [PATCH] resource: handle wrong resource_size value on zero start/end
- resource
-
-Commit 900730dc4705 ("wifi: ath: Use
-of_reserved_mem_region_to_resource() for "memory-region"") uncovered a
-massive problem with the usage of resource_size() helper.
-
-The reported commit caused a regression with ath11k WiFi firmware
-loading and the change was just a simple replacement of duplicate code
-with a new helper of_reserved_mem_region_to_resource().
-
-On reworking this, in the commit also a check for the presence of the
-node was replaced with resource_size(&res). This was done following the
-logic that if the node wasn't present then it's expected that also the
-resource_size is zero, mimicking the same if-else logic.
-
-This was also the reason the regression was mostly hard to catch at
-first sight as the rework is correctly done given the assumption on the
-used helpers.
-
-BUT this is actually not the case. On further inspection on
-resource_size() it was found that it NEVER actually returns 0.
-
-Even if the resource value of start and end are 0, the return value of
-resource_size() will ALWAYS be 1, resulting in the broken if-else
-condition ALWAYS going in the first if condition.
-
-This was simply confirmed by reading the resource_size() logic:
-
-	return res->end - res->start + 1;
-
-Given the confusion, also other case of such usage were searched in the
-kernel and with great suprise it seems LOTS of place assume
-resource_size() should return zero in the context of the resource start
-and end set to 0.
-
-Quoting for example comments in drivers/vfio/pci/vfio_pci_core.c:
-
-		/*
-		 * The PCI core shouldn't set up a resource with a
-		 * type but zero size. But there may be bugs that
-		 * cause us to do that.
-		 */
-		if (!resource_size(res))
-			goto no_mmap;
-
-It really seems resource_size() was tought with the assumption that
-resource struct was always correctly initialized before calling it and
-never set to zero.
-
-But across the year this got lost and now there are lots of driver that
-assume resource_size() returns 0 if start and end are also 0.
-
-To better handle this and make resource_size() returns correct value in
-such case, add a simple check and return 0 if both resource start and
-resource end are zero.
-
-Cc: Rob Herring (Arm) <robh at kernel.org>
-Cc: stable at vger.kernel.org
-Fixes: 1a4e564b7db9 ("resource: add resource_size()")
-Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
----
- include/linux/ioport.h | 3 +++
- 1 file changed, 3 insertions(+)
-
---- a/include/linux/ioport.h
-+++ b/include/linux/ioport.h
-@@ -283,6 +283,9 @@ static inline void resource_set_range(st
- 
- static inline resource_size_t resource_size(const struct resource *res)
- {
-+	if (!res->start && !res->end)
-+		return 0;
-+
- 	return res->end - res->start + 1;
- }
- static inline unsigned long resource_type(const struct resource *res)



From lede-commits at lists.infradead.org  Mon Dec  8 12:45:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 15:45:20 -0500
Subject: [openwrt/openwrt]  mac80211: add pending fix for wrong
 resource_size() usage for ath11k
In-Reply-To: <176522671903.1964205.14679062475545557002@git-01.infra.openwrt.org>
References: <176522671903.1964205.14679062475545557002@git-01.infra.openwrt.org>
Message-ID: <mailman.34116.1765226724.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/721f808253a405f3f6a03d133a3c0758ee0f88f8

commit 721f808253a405f3f6a03d133a3c0758ee0f88f8
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Dec 8 21:42:48 2025 +0100

    mac80211: add pending fix for wrong resource_size() usage for ath11k
    
    Add pending fix for wrong resource_size() usage that cause firmware
    crash on load on ath11k.
    
    Refresh all affected patch by this.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...-fix-wrong-usage-of-resource_size-causing.patch | 69 ++++++++++++++++++++++
 ...-Support-setting-bdf-addr-and-caldb-addr-.patch |  2 +-
 2 files changed, 70 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/patches/ath11k/101-wifi-ath11k-fix-wrong-usage-of-resource_size-causing.patch b/package/kernel/mac80211/patches/ath11k/101-wifi-ath11k-fix-wrong-usage-of-resource_size-causing.patch
new file mode 100644
index 0000000000..ea3f64cbc4
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/101-wifi-ath11k-fix-wrong-usage-of-resource_size-causing.patch
@@ -0,0 +1,69 @@
+From 88f17c87ddc9ee7467acdc322d383e5a443a55ab Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Mon, 8 Dec 2025 20:50:47 +0100
+Subject: [PATCH 1/2] wifi: ath11k: fix wrong usage of resource_size() causing
+ firmware panic
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On converting to the of_reserved_mem_region_to_resource() helper with
+commit 900730dc4705 ("wifi: ath: Use
+of_reserved_mem_region_to_resource() for "memory-region"") a logic error
+was introduced in the ath11k_core_coldboot_cal_support() if condition.
+
+The original code checked for hremote_node presence and skipped
+ath11k_core_coldboot_cal_support() in the other switch case but now
+everything is driven entirely on the values of the resource struct.
+
+resource_size() (in this case) is wrongly assumed to return a size of
+zero if the passed resource struct is init to zero. This is not the case
+as a resource struct should be always init with correct values (or at
+best set the end value to -1 to signal it's not configured)
+(the return value of resource_size() for a resource struct with start
+and end set to zero is 1)
+
+On top of this, using resource_size() to check if a resource struct is
+initialized or not is generally wrong and other measure should be used
+instead.
+
+To better handle this, use the DEFINE_RES macro to initialize the
+resource struct and set the IORESOURCE_UNSET flag by default.
+
+Replace the resource_size() check with checking for the resource struct
+flags and check if it's IORESOURCE_UNSET.
+
+This change effectively restore the original logic and restore correct
+loading of the ath11k firmware (restoring correct functionality of
+Wi-Fi)
+
+Cc: stable at vger.kernel.org
+Fixes: 900730dc4705 ("wifi: ath: Use of_reserved_mem_region_to_resource() for "memory-region"")
+Link: https://lore.kernel.org/all/20251207215359.28895-1-ansuelsmth at gmail.com/T/#m990492684913c5a158ff0e5fc90697d8ad95351b
+Cc: Ilpo J?rvinen <ilpo.jarvinen at linux.intel.com>
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+---
+ drivers/net/wireless/ath/ath11k/qmi.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/qmi.c
++++ b/drivers/net/wireless/ath/ath11k/qmi.c
+@@ -2039,8 +2039,8 @@ static int ath11k_qmi_alloc_target_mem_c
+ 
+ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab)
+ {
++	struct resource res = DEFINE_RES_NAMED(0, 0, NULL, IORESOURCE_UNSET);
+ 	struct device *dev = ab->dev;
+-	struct resource res = {};
+ 	u32 host_ddr_sz;
+ 	int i, idx, ret;
+ 
+@@ -2086,7 +2086,7 @@ static int ath11k_qmi_assign_target_mem_
+ 			}
+ 
+ 			if (ath11k_core_coldboot_cal_support(ab)) {
+-				if (resource_size(&res)) {
++				if (res.flags != IORESOURCE_UNSET) {
+ 					ab->qmi.target_mem[idx].paddr =
+ 							res.start + host_ddr_sz;
+ 					ab->qmi.target_mem[idx].iaddr =
diff --git a/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch b/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch
index f67aa4bb4f..721b521887 100644
--- a/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch
+++ b/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch
@@ -11,8 +11,8 @@ Signed-off-by: Ziyang Huang <hzyitc at outlook.com>
 --- a/drivers/net/wireless/ath/ath11k/qmi.c
 +++ b/drivers/net/wireless/ath/ath11k/qmi.c
 @@ -2042,6 +2042,7 @@ static int ath11k_qmi_assign_target_mem_
+ 	struct resource res = DEFINE_RES_NAMED(0, 0, NULL, IORESOURCE_UNSET);
  	struct device *dev = ab->dev;
- 	struct resource res = {};
  	u32 host_ddr_sz;
 +	u32 addr;
  	int i, idx, ret;



From lede-commits at lists.infradead.org  Mon Dec  8 14:44:39 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 17:44:39 -0500
Subject: [openwrt/openwrt]  realtek: fix SFP support on Engenius EWS2910P
In-Reply-To: <176523387989.2858468.3625464384820753649@git-01.infra.openwrt.org>
References: <176523387989.2858468.3625464384820753649@git-01.infra.openwrt.org>
Message-ID: <mailman.34134.1765233884.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c9553caa0e9e3df5c1cd549cb21c79a50543b872

commit c9553caa0e9e3df5c1cd549cb21c79a50543b872
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Nov 7 18:34:58 2025 +0000

    realtek: fix SFP support on Engenius EWS2910P
    
    EWS2910P has two SFP slots of which only one was fully supported so far.
    The issue so far was that both SFP slots share the same I2C SCL line but
    neither the kernel nor any downstream driver was able to deal with this.
    
    Thus, only one SFP slot was completely working (with detection etc.) but
    the other one had to be enabled manually. Networking was functional in
    both though.
    
    Since acd7ecc9ed we have a driver which is able to deal with that. Thus,
    we can fix the SFP support for this device.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20687
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../realtek/dts/rtl8380_engenius_ews2910p.dtsi     | 54 ++++++++++++----------
 1 file changed, 29 insertions(+), 25 deletions(-)

diff --git a/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi b/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi
index 3147a277ac..c1534b07d3 100644
--- a/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi
+++ b/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi
@@ -35,16 +35,6 @@
 		};
 	};
 
-	gpio-export {
-		compatible = "gpio-export";
-
-		sff-p9-tx-disable {
-			gpio-export,name = "sff-p9-tx-disable";
-			gpio-export,output = <1>;
-			gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
-		};
-	};
-
 	gpio-restart {
 		compatible = "gpio-restart";
 		gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
@@ -76,13 +66,29 @@
 		};
 	};
 
-	i2c1: i2c-gpio-1 {
-		compatible = "i2c-gpio";
-		sda-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	i2c-gpio-shared {
+		compatible = "i2c-gpio-shared";
 		scl-gpios = <&gpio1 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
-		i2c-gpio,delay-us = <2>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+
+		i2c0: i2c at 0 {
+			sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			i2c-gpio,delay-us = <2>;
+		};
+
+		i2c1: i2c at 1 {
+			sda-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			i2c-gpio,delay-us = <2>;
+		};
+	};
+
+	sfp0: sfp-p9 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c0>;
+		tx-disable-gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+		los-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&gpio1 12 GPIO_ACTIVE_LOW>;
 	};
 	sfp1: sfp-p10 {
 		compatible = "sff,sfp";
@@ -111,15 +117,6 @@
 			line-name = "poe-enable";
 		};
 
-		sff_p9_gpios {
-			gpio-hog;
-			gpios = < 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>,
-				< 11 GPIO_ACTIVE_HIGH>, /* los-gpio */
-				< 12 GPIO_ACTIVE_LOW>;   /* mod-def0-gpio */
-			input;
-			line-name = "sff-p9-gpios";
-		};
-
 		led-controller {
 			compatible = "realtek,rtl8231-leds";
 			status = "disabled";
@@ -202,8 +199,15 @@
 		SWITCH_PORT(14, 7, internal)
 		SWITCH_PORT(15, 8, internal)
 
-		/* TODO: fixed link SFP is not right */
-		SWITCH_SFP_PORT(24, 9, 1000base-x)
+		port at 24 {
+			reg = <24>;
+			label = "lan9";
+			pcs-handle = <&serdes4>;
+			phy-mode = "1000base-x";
+			phy-handle = <&phy24>;
+			managed = "in-band-status";
+			sfp = <&sfp0>;
+		};
 
 		port at 26 {
 			reg = <26>;



From lede-commits at lists.infradead.org  Mon Dec  8 15:06:42 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:06:42 -0500
Subject: [openwrt/openwrt]  scripts/kernel_bump: adjust commit messages
In-Reply-To: <176523520230.2922453.9645001263479361401@git-01.infra.openwrt.org>
References: <176523520230.2922453.9645001263479361401@git-01.infra.openwrt.org>
Message-ID: <mailman.34137.1765235207.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a703b9100e325596fcf870dcd137a4df4737534d

commit a703b9100e325596fcf870dcd137a4df4737534d
Author: George Sapkin <george at sapk.in>
AuthorDate: Mon Dec 1 16:57:00 2025 +0200

    scripts/kernel_bump: adjust commit messages
    
    Due to the recent changes with the formality checks kernel_bump commit
    messages no-longer pass them.
    
    Adjust these messages to follow the updated checks:
    - start the first word after prefix with lower-case
    - reduce the overall subject length by removing the redundant 'kernel'
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21012
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 scripts/kernel_bump.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kernel_bump.sh b/scripts/kernel_bump.sh
index 03e809eedc..2775b54dd5 100755
--- a/scripts/kernel_bump.sh
+++ b/scripts/kernel_bump.sh
@@ -162,14 +162,14 @@ bump_kernel()
 
 	git commit \
 		--signoff \
-		--message "kernel/${platform_name}: Create kernel files for v${target_version} (from v${source_version})" \
+		--message "kernel/${platform_name}: create files for v${target_version} (from v${source_version})" \
 		--message 'This is an automatically generated commit.' \
 		--message 'When doing `git bisect`, consider `git bisect --skip`.'
 
 	git checkout 'HEAD~' "${_target_dir}"
 	git commit \
 		--signoff \
-		--message "kernel/${platform_name}: Restore kernel files for v${source_version}" \
+		--message "kernel/${platform_name}: restore files for v${source_version}" \
 		--message "$(printf "This is an automatically generated commit which aids following Kernel patch\nhistory, as git will see the move and copy as a rename thus defeating the\npurpose.\n\nFor the original discussion see:\nhttps://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html")"
 	git switch "${initial_branch:?Unable to switch back to original branch. Quitting.}"
 	GIT_EDITOR=true git merge --no-ff '__openwrt_kernel_files_mover'



From lede-commits at lists.infradead.org  Mon Dec  8 15:29:32 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:29:32 -0500
Subject: [openwrt/openwrt]  realtek: pcs: add init_serdes_common hook
In-Reply-To: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
References: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
Message-ID: <mailman.34138.1765236576.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/328b970ecd8d43fe7ce73e23e584c984ee820a03

commit 328b970ecd8d43fe7ce73e23e584c984ee820a03
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Nov 7 12:16:45 2025 +0000

    realtek: pcs: add init_serdes_common hook
    
    Add a new hook called 'init_serdes_common' to be able to perform
    initialisations or anything else subject to all SerDes. This hook is
    called in the end of 'rtpcs_probe' after everything else is done.
    
    This is meant primarily to support the transition of RTL83XX from PHY
    driver to PCS driver. Thus, it may be removed later again or kept if
    there is sufficient need for this.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20876
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 2f0ff0ce03..2fa500396a 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -122,6 +122,7 @@ struct rtpcs_config {
 	int mac_rx_pause_sts;
 	int mac_tx_pause_sts;
 	const struct phylink_pcs_ops *pcs_ops;
+	int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
 	int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
 	int (*setup_serdes)(struct rtpcs_ctrl *ctrl, int sds, phy_interface_t mode);
 };
@@ -2769,6 +2770,12 @@ static int rtpcs_probe(struct platform_device *pdev)
 		ctrl->tx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-tx");
 	}
 
+	if (ctrl->cfg->init_serdes_common) {
+		ret = ctrl->cfg->init_serdes_common(ctrl);
+		if (ret)
+			return ret;
+	}
+
 	/*
 	 * rtpcs_create() relies on that fact that data is attached to the platform device to
 	 * determine if the driver is ready. Do this after everything is initialized properly.



From lede-commits at lists.infradead.org  Mon Dec  8 15:29:33 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:29:33 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl838x: transplant firmware config
In-Reply-To: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
References: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
Message-ID: <mailman.34139.1765236576.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6a5cae7d74914e947e2cd3a01a1b2b6ea7e813be

commit 6a5cae7d74914e947e2cd3a01a1b2b6ea7e813be
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Nov 7 10:21:43 2025 +0000

    realtek: pcs: rtl838x: transplant firmware config
    
    In the PHY driver, firmware files were used to store configuration
    values for the SerDes which need to be applied upon initialization.
    There are several issues which prevent to just take that over into the
    PCS driver:
    * SerDes and PHY parts are mixed within a firmware file
    * SerDes access in PHY driver is based on writing into the switch's
      global register space; PCS driver uses access via MDIO interface
      --> destination values do not match
    * firmware file format is not SerDes-agnostic
    * no documentation or script for the "old" firmware files
    
    Unfortunately, there is no proper firmware format yet where to take over
    the required sequences. Thus, extract the sequences needed for RTL838X
    SerDes, transform them to work with the MDIO based access and put them
    as functions in the PCS driver.
    
    Note that this should just be a temporary solution. In a next step, a
    proper firmware format should be established and all configuration
    sequences currently in the code should be moved into firmware files.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20876
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 180 +++++++++++++++++++++
 1 file changed, 180 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 2fa500396a..17f3db1e06 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -51,6 +51,9 @@
 #define RTPCS_931X_MAC_RX_PAUSE_STS		0x0f00
 #define RTPCS_931X_MAC_TX_PAUSE_STS		0x0ef8
 
+#define RTPCS_838X_SDS_CFG_REG			0x34
+#define RTPCS_838X_RST_GLB_CTRL_0		0x3c
+
 #define RTPCS_93XX_MAC_LINK_SPD_BITS		4
 
 #define RTL93XX_MODEL_NAME_INFO			(0x0004)
@@ -214,6 +217,183 @@ static struct rtpcs_link *rtpcs_phylink_pcs_to_link(struct phylink_pcs *pcs)
 
 /* Variant-specific functions */
 
+/* RTL838X */
+
+static void rtpcs_838x_sds_take_reset(struct rtpcs_ctrl *ctrl)
+{
+	regmap_write(ctrl->map, RTPCS_838X_SDS_CFG_REG, 0x3f);
+	regmap_write(ctrl->map, RTPCS_838X_RST_GLB_CTRL_0, 0x10);
+
+	rtpcs_sds_write(ctrl, 0, 0x0, 0x3, 0x7146);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 1, 0x0, 0x3, 0x7146);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 2, 0x0, 0x3, 0x7146);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 3, 0x0, 0x3, 0x7146);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 4, 0x0, 0x3, 0x7146);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 5, 0x0, 0x3, 0x7146);
+	udelay(1000);
+}
+
+static void rtpcs_838x_sds_reset(struct rtpcs_ctrl *ctrl)
+{
+	rtpcs_sds_write(ctrl, 0, 0, 0, 0xc00);
+	rtpcs_sds_write(ctrl, 1, 0, 0, 0xc00);
+	rtpcs_sds_write(ctrl, 2, 0, 0, 0xc00);
+	rtpcs_sds_write(ctrl, 3, 0, 0, 0xc00);
+	rtpcs_sds_write(ctrl, 4, 0, 0, 0xc00);
+	rtpcs_sds_write(ctrl, 5, 0, 0, 0xc00);
+
+	rtpcs_sds_write(ctrl, 0, 0, 0, 0xc03);
+	rtpcs_sds_write(ctrl, 1, 0, 0, 0xc03);
+	rtpcs_sds_write(ctrl, 2, 0, 0, 0xc03);
+	rtpcs_sds_write(ctrl, 3, 0, 0, 0xc03);
+	rtpcs_sds_write(ctrl, 4, 0, 0, 0xc03);
+	rtpcs_sds_write(ctrl, 5, 0, 0, 0xc03);
+}
+
+static void rtpcs_838x_sds_release_reset(struct rtpcs_ctrl *ctrl)
+{
+	rtpcs_sds_write(ctrl, 0, 0, 3, 0x7106);
+	rtpcs_sds_write(ctrl, 1, 0, 3, 0x7106);
+	rtpcs_sds_write(ctrl, 2, 0, 3, 0x7106);
+	rtpcs_sds_write(ctrl, 3, 0, 3, 0x7106);
+	rtpcs_sds_write(ctrl, 4, 0, 3, 0x7106);
+	rtpcs_sds_write(ctrl, 5, 0, 3, 0x7106);
+}
+
+static void rtpcs_838x_sds_patch_common(struct rtpcs_ctrl *ctrl)
+{
+	rtpcs_sds_write(ctrl, 4, 2, 30, 0x71e);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 5, 2, 30, 0x71e);
+	udelay(1000);
+
+	rtpcs_sds_write(ctrl, 0, 0, 1, 0xf00);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 1, 0, 1, 0xf00);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 2, 0, 1, 0xf00);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 3, 0, 1, 0xf00);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 4, 0, 1, 0xf00);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 5, 0, 1, 0xf00);
+	udelay(1000);
+
+	rtpcs_sds_write(ctrl, 0, 0, 2, 0x7060);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 1, 0, 2, 0x7060);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 2, 0, 2, 0x7060);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 3, 0, 2, 0x7060);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 4, 0, 2, 0x7060);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 5, 0, 2, 0x7060);
+	udelay(1000);
+
+	rtpcs_sds_write(ctrl, 4, 0, 4, 0x74d);
+	udelay(1000);
+	rtpcs_sds_write(ctrl, 5, 0, 4, 0x74d);
+	udelay(1000);
+}
+
+static void rtpcs_838x_sds_patch_01_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
+{
+	rtpcs_sds_write(ctrl, 0, 1, 3, 0xf46f);
+	rtpcs_sds_write(ctrl, 0, 1, 2, 0x85fa);
+	rtpcs_sds_write(ctrl, 1, 1, 2, 0x85fa);
+	rtpcs_sds_write(ctrl, 0, 1, 6, 0x20d8);
+	rtpcs_sds_write(ctrl, 1, 1, 6, 0x20d8);
+	rtpcs_sds_write(ctrl, 0, 1, 17, 0xb7c9);
+	rtpcs_sds_write(ctrl, 1, 1, 11, 0x482);
+	rtpcs_sds_write(ctrl, 1, 1, 10, 0x80c7);
+	rtpcs_sds_write(ctrl, 0, 1, 18, 0xab8e);
+	rtpcs_sds_write(ctrl, 0, 1, 11, 0x482);
+	rtpcs_sds_write(ctrl, 0, 1, 19, 0x24ab);
+	rtpcs_sds_write(ctrl, 1, 1, 17, 0x4208);
+	rtpcs_sds_write(ctrl, 1, 1, 18, 0xc208);
+	rtpcs_sds_write(ctrl, 0, 2, 25, 0x303);
+	rtpcs_sds_write(ctrl, 1, 2, 25, 0x303);
+	rtpcs_sds_write(ctrl, 0, 1, 14, 0xfcc2);
+	rtpcs_sds_write(ctrl, 1, 1, 14, 0xfcc2);
+
+	rtpcs_sds_write(ctrl, 0, 1, 9, 0x8e64);
+	rtpcs_sds_write(ctrl, 0, 1, 9, 0x8c64);
+
+	rtpcs_sds_write(ctrl, 1, 1, 9, 0x8e64);
+	rtpcs_sds_write(ctrl, 1, 1, 9, 0x8c64);
+}
+
+static void rtpcs_838x_sds_patch_23_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
+{
+	rtpcs_sds_write(ctrl, 2, 1, 3, 0xf46d);
+	rtpcs_sds_write(ctrl, 2, 1, 2, 0x85fa);
+	rtpcs_sds_write(ctrl, 3, 1, 2, 0x85fa);
+//	rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
+	rtpcs_sds_write(ctrl, 2, 1, 6, 0x20d8);
+	rtpcs_sds_write(ctrl, 3, 1, 6, 0x20d8);
+	rtpcs_sds_write(ctrl, 2, 1, 17, 0xb7c9);
+	rtpcs_sds_write(ctrl, 2, 1, 18, 0xab8e);
+	rtpcs_sds_write(ctrl, 2, 1, 11, 0x482);
+	rtpcs_sds_write(ctrl, 3, 1, 11, 0x482);
+	rtpcs_sds_write(ctrl, 2, 1, 19, 0x24ab);
+	rtpcs_sds_write(ctrl, 3, 1, 17, 0x4208);
+	rtpcs_sds_write(ctrl, 3, 1, 18, 0xc208);
+	rtpcs_sds_write(ctrl, 2, 2, 25, 0x303);
+	rtpcs_sds_write(ctrl, 3, 2, 25, 0x303);
+	rtpcs_sds_write(ctrl, 2, 1, 14, 0xfcc2);
+	rtpcs_sds_write(ctrl, 3, 1, 14, 0xfcc2);
+
+	rtpcs_sds_write(ctrl, 2, 1, 9, 0x8e64);
+	rtpcs_sds_write(ctrl, 2, 1, 9, 0x8c64);
+
+	rtpcs_sds_write(ctrl, 3, 1, 9, 0x8e64);
+	rtpcs_sds_write(ctrl, 3, 1, 9, 0x8c64);
+}
+
+static void rtpcs_838x_sds_patch_4_fiber_6275b(struct rtpcs_ctrl *ctrl)
+{
+	rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
+	rtpcs_sds_write(ctrl, 4, 1, 11, 0x1482);
+	rtpcs_sds_write(ctrl, 4, 1, 6, 0x20d8);
+	rtpcs_sds_write(ctrl, 4, 1, 10, 0xc3);
+	rtpcs_sds_write(ctrl, 4, 1, 17, 0xb7c9);
+	rtpcs_sds_write(ctrl, 4, 1, 18, 0xab8e);
+	rtpcs_sds_write(ctrl, 4, 2, 25, 0x303);
+	rtpcs_sds_write(ctrl, 4, 1, 14, 0xfcc2);
+
+	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8e64);
+	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8c64);
+}
+
+static void rtpcs_838x_sds_patch_5_fiber_6275b(struct rtpcs_ctrl *ctrl)
+{
+	rtpcs_sds_write(ctrl, 5, 1, 2, 0x85fa);
+	rtpcs_sds_write(ctrl, 5, 1, 3, 0x00);
+	rtpcs_sds_write(ctrl, 5, 1, 4, 0xdccc);
+	rtpcs_sds_write(ctrl, 5, 1, 5, 0x00);
+	rtpcs_sds_write(ctrl, 5, 1, 6, 0x3600);
+	rtpcs_sds_write(ctrl, 5, 1, 7, 0x03);
+	rtpcs_sds_write(ctrl, 5, 1, 8, 0x79aa);
+	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
+	rtpcs_sds_write(ctrl, 5, 1, 10, 0xc3);
+	rtpcs_sds_write(ctrl, 5, 1, 11, 0x1482);
+	rtpcs_sds_write(ctrl, 5, 2, 24, 0x14aa);
+	rtpcs_sds_write(ctrl, 5, 2, 25, 0x303);
+	rtpcs_sds_write(ctrl, 5, 1, 14, 0xf002);
+	rtpcs_sds_write(ctrl, 5, 2, 27, 0x4bf);
+
+	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8e64);
+	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
+}
+
 /* RTL930X */
 
 /* The access registers for SDS_MODE_SEL and the LSB for each SDS within */



From lede-commits at lists.infradead.org  Mon Dec  8 15:29:37 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:29:37 -0500
Subject: [openwrt/openwrt]  realtek: rtl838x: drop SFP pseudo-PHYs and
 phy-handle
In-Reply-To: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
References: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
Message-ID: <mailman.34140.1765236577.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a63da75e446516efb26551ef9ae1d9327771f6b5

commit a63da75e446516efb26551ef9ae1d9327771f6b5
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Nov 7 18:45:27 2025 +0000

    realtek: rtl838x: drop SFP pseudo-PHYs and phy-handle
    
    Remove all pseudo-PHYs and phy-handle properties from DTS of RTL838X
    devices. RTL838X SerDes is now handled by PCS driver and thus not
    treated as PHY anymore.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20876
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../realtek/dts/rtl8380_d-link_dgs-1210-10mp-f.dts |  5 ----
 .../realtek/dts/rtl8380_engenius_ews2910p.dtsi     |  5 ----
 target/linux/realtek/dts/rtl8380_hpe_1920-8g.dtsi  |  5 ----
 .../linux/realtek/dts/rtl8380_linksys_lgs310c.dts  |  4 ---
 .../realtek/dts/rtl8380_netgear_gs310tp-v1.dts     |  7 ------
 .../dts/rtl8380_panasonic_m8eg-pn28080k.dts        |  3 ---
 .../realtek/dts/rtl8380_tplink_sg2008p-v1.dts      | 15 -----------
 .../realtek/dts/rtl8380_tplink_sg2210p-v3.dts      | 29 ++++++++++++++++++----
 .../linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi   |  5 ----
 .../realtek/dts/rtl8380_zyxel_gs1900-10hp-a1.dts   |  7 ------
 .../realtek/dts/rtl8382_d-link_dgs-1210-10p.dts    |  5 ----
 .../realtek/dts/rtl8382_d-link_dgs-1210-26.dts     |  3 ---
 .../realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts     |  3 ---
 .../realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts   |  3 ---
 .../realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts   |  3 ---
 15 files changed, 24 insertions(+), 78 deletions(-)

diff --git a/target/linux/realtek/dts/rtl8380_d-link_dgs-1210-10mp-f.dts b/target/linux/realtek/dts/rtl8380_d-link_dgs-1210-10mp-f.dts
index 06c1c2c71f..dcc43281ef 100644
--- a/target/linux/realtek/dts/rtl8380_d-link_dgs-1210-10mp-f.dts
+++ b/target/linux/realtek/dts/rtl8380_d-link_dgs-1210-10mp-f.dts
@@ -84,9 +84,6 @@
 	INTERNAL_PHY(13)
 	INTERNAL_PHY(14)
 	INTERNAL_PHY(15)
-
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &switch0 {
@@ -107,7 +104,6 @@
 			reg = <24>;
 			label = "lan9";
 			pcs-handle = <&serdes4>;
-			phy-handle = <&phy24>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp0>;
@@ -117,7 +113,6 @@
 			reg = <26>;
 			label = "lan10";
 			pcs-handle = <&serdes5>;
-			phy-handle = <&phy26>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp1>;
diff --git a/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi b/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi
index c1534b07d3..2994873547 100644
--- a/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi
+++ b/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi
@@ -180,9 +180,6 @@
 	INTERNAL_PHY(13)
 	INTERNAL_PHY(14)
 	INTERNAL_PHY(15)
-
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &switch0 {
@@ -204,7 +201,6 @@
 			label = "lan9";
 			pcs-handle = <&serdes4>;
 			phy-mode = "1000base-x";
-			phy-handle = <&phy24>;
 			managed = "in-band-status";
 			sfp = <&sfp0>;
 		};
@@ -214,7 +210,6 @@
 			label = "lan10";
 			pcs-handle = <&serdes5>;
 			phy-mode = "1000base-x";
-			phy-handle = <&phy26>;
 			managed = "in-band-status";
 			sfp = <&sfp1>;
 		};
diff --git a/target/linux/realtek/dts/rtl8380_hpe_1920-8g.dtsi b/target/linux/realtek/dts/rtl8380_hpe_1920-8g.dtsi
index f47bb539c5..e77e81ed5b 100644
--- a/target/linux/realtek/dts/rtl8380_hpe_1920-8g.dtsi
+++ b/target/linux/realtek/dts/rtl8380_hpe_1920-8g.dtsi
@@ -66,9 +66,6 @@
 	INTERNAL_PHY(13)
 	INTERNAL_PHY(14)
 	INTERNAL_PHY(15)
-
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &switch0 {
@@ -89,7 +86,6 @@
 			reg = <24>;
 			label = "lan9";
 			pcs-handle = <&serdes4>;
-			phy-handle = <&phy24>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp0>;
@@ -99,7 +95,6 @@
 			reg = <26>;
 			label = "lan10";
 			pcs-handle = <&serdes5>;
-			phy-handle = <&phy26>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp1>;
diff --git a/target/linux/realtek/dts/rtl8380_linksys_lgs310c.dts b/target/linux/realtek/dts/rtl8380_linksys_lgs310c.dts
index 201d71a9e9..8a42b17c4a 100644
--- a/target/linux/realtek/dts/rtl8380_linksys_lgs310c.dts
+++ b/target/linux/realtek/dts/rtl8380_linksys_lgs310c.dts
@@ -157,8 +157,6 @@
 	INTERNAL_PHY(13)
 	INTERNAL_PHY(14)
 	INTERNAL_PHY(15)
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &switch0 {
@@ -179,7 +177,6 @@
 			reg = <24>;
 			label = "lan9";
 			pcs-handle = <&serdes4>;
-			phy-handle = <&phy24>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp0>;
@@ -189,7 +186,6 @@
 			reg = <26>;
 			label = "lan10";
 			pcs-handle = <&serdes5>;
-			phy-handle = <&phy26>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp1>;
diff --git a/target/linux/realtek/dts/rtl8380_netgear_gs310tp-v1.dts b/target/linux/realtek/dts/rtl8380_netgear_gs310tp-v1.dts
index 636046ed1b..6446925270 100644
--- a/target/linux/realtek/dts/rtl8380_netgear_gs310tp-v1.dts
+++ b/target/linux/realtek/dts/rtl8380_netgear_gs310tp-v1.dts
@@ -49,11 +49,6 @@
 	status = "okay";
 };
 
-&mdio_bus0 {
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
-};
-
 &switch0 {
 	ports {
 		/* TODO: fixed link SFP is not right */
@@ -62,7 +57,6 @@
 			reg = <24>;
 			label = SWITCH_PORT_LABEL(9);
 			pcs-handle = <&serdes4>;
-			phy-handle = <&phy24>;
 			phy-mode = "1000base-x";
 			fixed-link {
 				speed = <1000>;
@@ -73,7 +67,6 @@
 			reg = <26>;
 			label = SWITCH_PORT_LABEL(10);
 			pcs-handle = <&serdes5>;
-			phy-handle = <&phy26>;
 			phy-mode = "1000base-x";
 			fixed-link {
 				speed = <1000>;
diff --git a/target/linux/realtek/dts/rtl8380_panasonic_m8eg-pn28080k.dts b/target/linux/realtek/dts/rtl8380_panasonic_m8eg-pn28080k.dts
index 6e46039add..4ecf616469 100644
--- a/target/linux/realtek/dts/rtl8380_panasonic_m8eg-pn28080k.dts
+++ b/target/linux/realtek/dts/rtl8380_panasonic_m8eg-pn28080k.dts
@@ -83,8 +83,6 @@
 	INTERNAL_PHY(13)
 	INTERNAL_PHY(14)
 	INTERNAL_PHY(15)
-
-	INTERNAL_PHY(24)
 };
 
 &switch0 {
@@ -105,7 +103,6 @@
 			reg = <24>;
 			label = "lan9";
 			pcs-handle = <&serdes4>;
-			phy-handle = <&phy24>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp0>;
diff --git a/target/linux/realtek/dts/rtl8380_tplink_sg2008p-v1.dts b/target/linux/realtek/dts/rtl8380_tplink_sg2008p-v1.dts
index bf43e412b1..69ee268f44 100644
--- a/target/linux/realtek/dts/rtl8380_tplink_sg2008p-v1.dts
+++ b/target/linux/realtek/dts/rtl8380_tplink_sg2008p-v1.dts
@@ -11,18 +11,3 @@
 	status = "disabled";
 };
 
-&phy24 {
-	status = "disabled";
-};
-
-&phy26 {
-	status = "disabled";
-};
-
-&port24 {
-	status = "disabled";
-};
-
-&port26 {
-	status = "disabled";
-};
diff --git a/target/linux/realtek/dts/rtl8380_tplink_sg2210p-v3.dts b/target/linux/realtek/dts/rtl8380_tplink_sg2210p-v3.dts
index 4b0022c388..708999fba6 100644
--- a/target/linux/realtek/dts/rtl8380_tplink_sg2210p-v3.dts
+++ b/target/linux/realtek/dts/rtl8380_tplink_sg2210p-v3.dts
@@ -7,10 +7,29 @@
 	model = "TP-Link SG2210P v3";
 };
 
-&port24 {
-	label = "lan-sfp2";
-};
+&switch0 {
+	ports {
+		port24: port at 24 {
+			reg = <24>;
+			label = "lan-sfp2";
+			pcs-handle = <&serdes4>;
+			phy-mode = "1000base-x";
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
 
-&port26 {
-	label = "lan-sfp1";
+		port26: port at 26 {
+			reg = <26>;
+			label = "lan-sfp1";
+			pcs-handle = <&serdes5>;
+			phy-mode = "1000base-x";
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
+	};
 };
+
diff --git a/target/linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi b/target/linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi
index 3854d5cf8b..677eb0d92d 100644
--- a/target/linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi
+++ b/target/linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi
@@ -143,9 +143,6 @@
 	INTERNAL_PHY(13)
 	INTERNAL_PHY(14)
 	INTERNAL_PHY(15)
-
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &ethernet0 {
@@ -172,7 +169,6 @@
 			reg = <24>;
 			label = SWITCH_PORT_LABEL(9);
 			pcs-handle = <&serdes4>;
-			phy-handle = <&phy24>;
 			phy-mode = "1000base-x";
 			fixed-link {
 				speed = <1000>;
@@ -183,7 +179,6 @@
 			reg = <26>;
 			label = SWITCH_PORT_LABEL(10);
 			pcs-handle = <&serdes5>;
-			phy-handle = <&phy26>;
 			phy-mode = "1000base-x";
 			fixed-link {
 				speed = <1000>;
diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp-a1.dts b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp-a1.dts
index f535f1d016..928ae93527 100644
--- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp-a1.dts
+++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp-a1.dts
@@ -52,18 +52,12 @@
 	status = "okay";
 };
 
-&mdio_bus0 {
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
-};
-
 &switch0 {
 	ports {
 		port at 24 {
 			reg = <24>;
 			label = "lan9";
 			pcs-handle = <&serdes4>;
-			phy-handle = <&phy24>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp0>;
@@ -73,7 +67,6 @@
 			reg = <26>;
 			label = "lan10";
 			pcs-handle = <&serdes5>;
-			phy-handle = <&phy26>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp1>;
diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts
index a31a268c42..3a9254be12 100644
--- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts
+++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts
@@ -83,9 +83,6 @@
 	INTERNAL_PHY(13)
 	INTERNAL_PHY(14)
 	INTERNAL_PHY(15)
-
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &switch0 {
@@ -106,7 +103,6 @@
 			reg = <24>;
 			label = "lan9";
 			pcs-handle = <&serdes4>;
-			phy-handle = <&phy24>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp0>;
@@ -116,7 +112,6 @@
 			reg = <26>;
 			label = "lan10";
 			pcs-handle = <&serdes5>;
-			phy-handle = <&phy26>;
 			phy-mode = "1000base-x";
 			managed = "in-band-status";
 			sfp = <&sfp1>;
diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-26.dts b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-26.dts
index 34611e101e..94e2f553c1 100644
--- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-26.dts
+++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-26.dts
@@ -72,9 +72,6 @@
 	EXTERNAL_PHY(21)
 	EXTERNAL_PHY(22)
 	EXTERNAL_PHY(23)
-
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &switch0 {
diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts
index 63c96a88ae..214f2c7afd 100644
--- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts
+++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts
@@ -72,9 +72,6 @@
 	EXTERNAL_PHY(21)
 	EXTERNAL_PHY(22)
 	EXTERNAL_PHY(23)
-
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &switch0 {
diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts
index 8c8bc0b2ba..16abf9f2de 100644
--- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts
+++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts
@@ -72,9 +72,6 @@
 	EXTERNAL_PHY(21)
 	EXTERNAL_PHY(22)
 	EXTERNAL_PHY(23)
-
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &switch0 {
diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts
index 42f631316c..900929808f 100644
--- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts
+++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts
@@ -68,9 +68,6 @@
 	EXTERNAL_PHY(21)
 	EXTERNAL_PHY(22)
 	EXTERNAL_PHY(23)
-
-	INTERNAL_PHY(24)
-	INTERNAL_PHY(26)
 };
 
 &switch0 {



From lede-commits at lists.infradead.org  Mon Dec  8 15:29:34 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:29:34 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl838x: import SerDes code from
 DSA/PHY
In-Reply-To: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
References: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
Message-ID: <mailman.34143.1765236577.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f4129beb39703b220fdfc270aa55f395714190f5

commit f4129beb39703b220fdfc270aa55f395714190f5
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Nov 7 11:47:37 2025 +0000

    realtek: pcs: rtl838x: import SerDes code from DSA/PHY
    
    Import functions 'rtl8380_sds_rst', 'rtl8380_sds_power',
    'rtl8380_configure_serdes' and 'rtl83xx_config_interface' from DSA and
    PHY driver respectively but comment the code for now.
    
    The code needs heavy adjustments to make it compile and work. To make
    this as transparent as possible, do that in two stages.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20876
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 202 +++++++++++++++++++++
 1 file changed, 202 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 17f3db1e06..587564b078 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -53,6 +53,18 @@
 
 #define RTPCS_838X_SDS_CFG_REG			0x34
 #define RTPCS_838X_RST_GLB_CTRL_0		0x3c
+#define RTL838X_SDS_MODE_SEL                    (0x0028)
+#define RTL838X_INT_MODE_CTRL                   (0x005c)
+#define RTL838X_DMY_REG31                       (0x3b28)
+#define RTL838X_INT_RW_CTRL                     (0x0058)
+#define RTL838X_PLL_CML_CTRL                    (0x0FF8)
+
+#define RTL8380_SDS4_FIB_REG0                   (0xF800)
+#define RTL838X_SDS4_REG28                      (0xef80)
+#define RTL838X_SDS4_DUMMY0                     (0xef8c)
+#define RTL838X_SDS5_EXT_REG6                   (0xf18c)
+#define RTL838X_SDS4_FIB_REG0                   (RTL838X_SDS4_REG28 + 0x880)
+#define RTL838X_SDS5_FIB_REG0                   (RTL838X_SDS4_REG28 + 0x980)
 
 #define RTPCS_93XX_MAC_LINK_SPD_BITS		4
 
@@ -394,6 +406,196 @@ static void rtpcs_838x_sds_patch_5_fiber_6275b(struct rtpcs_ctrl *ctrl)
 	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
 }
 
+/*
+void rtl8380_sds_rst(int mac)
+{
+	u32 offset = (mac == 24) ? 0 : 0x100;
+
+	sw_w32_mask(1 << 11, 0, RTL838X_SDS4_FIB_REG0 + offset);
+	sw_w32_mask(0x3, 0, RTL838X_SDS4_REG28 + offset);
+	sw_w32_mask(0x3, 0x3, RTL838X_SDS4_REG28 + offset);
+	sw_w32_mask(0, 0x1 << 6, RTL838X_SDS4_DUMMY0 + offset);
+	sw_w32_mask(0x1 << 6, 0, RTL838X_SDS4_DUMMY0 + offset);
+	pr_debug("SERDES reset: %d\n", mac);
+}
+
+int rtl8380_sds_power(int mac, int val)
+{
+	u32 mode = (val == 1) ? 0x4 : 0x9;
+	u32 offset = (mac == 24) ? 5 : 0;
+
+	if ((mac != 24) && (mac != 26)) {
+		pr_err("%s: not a fibre port: %d\n", __func__, mac);
+		return -1;
+	}
+
+	sw_w32_mask(0x1f << offset, mode << offset, RTL838X_SDS_MODE_SEL);
+
+	rtl8380_sds_rst(mac);
+
+	return 0;
+}
+
+static int rtl8380_configure_serdes(struct phy_device *phydev)
+{
+	u32 v;
+	u32 sds_conf_value;
+	int i;
+	struct fw_header *h;
+	u32 *rtl8380_sds_take_reset;
+	u32 *rtl8380_sds_common;
+	u32 *rtl8380_sds01_qsgmii_6275b;
+	u32 *rtl8380_sds23_qsgmii_6275b;
+	u32 *rtl8380_sds4_fiber_6275b;
+	u32 *rtl8380_sds5_fiber_6275b;
+	u32 *rtl8380_sds_reset;
+	u32 *rtl8380_sds_release_reset;
+
+	phydev_info(phydev, "Detected internal RTL8380 SERDES\n");
+
+	h = rtl838x_request_fw(phydev, &rtl838x_8218b_fw, FIRMWARE_838X_8380_1);
+	if (!h)
+		return -1;
+
+	if (h->magic != 0x83808380) {
+		phydev_err(phydev, "Wrong firmware file: magic number mismatch.\n");
+		return -1;
+	}
+
+	rtl8380_sds_take_reset = (void *)h + sizeof(struct fw_header) + h->parts[0].start;
+
+	rtl8380_sds_common = (void *)h + sizeof(struct fw_header) + h->parts[1].start;
+
+	rtl8380_sds01_qsgmii_6275b = (void *)h + sizeof(struct fw_header) + h->parts[2].start;
+
+	rtl8380_sds23_qsgmii_6275b = (void *)h + sizeof(struct fw_header) + h->parts[3].start;
+
+	rtl8380_sds4_fiber_6275b = (void *)h + sizeof(struct fw_header) + h->parts[4].start;
+
+	rtl8380_sds5_fiber_6275b = (void *)h + sizeof(struct fw_header) + h->parts[5].start;
+
+	rtl8380_sds_reset = (void *)h + sizeof(struct fw_header) + h->parts[6].start;
+
+	rtl8380_sds_release_reset = (void *)h + sizeof(struct fw_header) + h->parts[7].start;
+
+	// Back up serdes power off value
+	sds_conf_value = sw_r32(RTL838X_SDS_CFG_REG);
+	pr_info("SDS power down value: %x\n", sds_conf_value);
+
+	// take serdes into reset
+	i = 0;
+	while (rtl8380_sds_take_reset[2 * i]) {
+		sw_w32(rtl8380_sds_take_reset[2 * i + 1], rtl8380_sds_take_reset[2 * i]);
+		i++;
+		udelay(1000);
+	}
+
+	// apply common serdes patch
+	i = 0;
+	while (rtl8380_sds_common[2 * i]) {
+		sw_w32(rtl8380_sds_common[2 * i + 1], rtl8380_sds_common[2 * i]);
+		i++;
+		udelay(1000);
+	}
+
+	// internal R/W enable
+	sw_w32(3, RTL838X_INT_RW_CTRL);
+
+	// SerDes ports 4 and 5 are FIBRE ports
+	sw_w32_mask(0x7 | 0x38, 1 | (1 << 3), RTL838X_INT_MODE_CTRL);
+
+	// SerDes module settings, SerDes 0-3 are QSGMII
+	v = 0x6 << 25 | 0x6 << 20 | 0x6 << 15 | 0x6 << 10;
+	// SerDes 4 and 5 are 1000BX FIBRE
+	v |= 0x4 << 5 | 0x4;
+	sw_w32(v, RTL838X_SDS_MODE_SEL);
+
+	pr_info("PLL control register: %x\n", sw_r32(RTL838X_PLL_CML_CTRL));
+	sw_w32_mask(0xfffffff0, 0xaaaaaaaf & 0xf, RTL838X_PLL_CML_CTRL);
+	i = 0;
+	while (rtl8380_sds01_qsgmii_6275b[2 * i]) {
+		sw_w32(rtl8380_sds01_qsgmii_6275b[2 * i + 1],
+		       rtl8380_sds01_qsgmii_6275b[2 * i]);
+		i++;
+	}
+
+	i = 0;
+	while (rtl8380_sds23_qsgmii_6275b[2 * i]) {
+		sw_w32(rtl8380_sds23_qsgmii_6275b[2 * i + 1], rtl8380_sds23_qsgmii_6275b[2 * i]);
+		i++;
+	}
+
+	i = 0;
+	while (rtl8380_sds4_fiber_6275b[2 * i]) {
+		sw_w32(rtl8380_sds4_fiber_6275b[2 * i + 1], rtl8380_sds4_fiber_6275b[2 * i]);
+		i++;
+	}
+
+	i = 0;
+	while (rtl8380_sds5_fiber_6275b[2 * i]) {
+		sw_w32(rtl8380_sds5_fiber_6275b[2 * i + 1], rtl8380_sds5_fiber_6275b[2 * i]);
+		i++;
+	}
+
+	i = 0;
+	while (rtl8380_sds_reset[2 * i]) {
+		sw_w32(rtl8380_sds_reset[2 * i + 1], rtl8380_sds_reset[2 * i]);
+		i++;
+	}
+
+	i = 0;
+	while (rtl8380_sds_release_reset[2 * i]) {
+		sw_w32(rtl8380_sds_release_reset[2 * i + 1], rtl8380_sds_release_reset[2 * i]);
+		i++;
+	}
+
+	pr_info("SDS power down value now: %x\n", sw_r32(RTL838X_SDS_CFG_REG));
+	sw_w32(sds_conf_value, RTL838X_SDS_CFG_REG);
+
+	pr_info("Configuration of SERDES done\n");
+
+	return 0;
+}
+
+static void rtl83xx_config_interface(int port, phy_interface_t interface)
+{
+	u32 old, int_shift, sds_shift;
+
+	switch (port) {
+	case 24:
+		int_shift = 0;
+		sds_shift = 5;
+		break;
+	case 26:
+		int_shift = 3;
+		sds_shift = 0;
+		break;
+	default:
+		return;
+	}
+
+	old = sw_r32(RTL838X_SDS_MODE_SEL);
+	switch (interface) {
+	case PHY_INTERFACE_MODE_1000BASEX:
+		if ((old >> sds_shift & 0x1f) == 4)
+			return;
+		sw_w32_mask(0x7 << int_shift, 1 << int_shift, RTL838X_INT_MODE_CTRL);
+		sw_w32_mask(0x1f << sds_shift, 4 << sds_shift, RTL838X_SDS_MODE_SEL);
+		break;
+	case PHY_INTERFACE_MODE_SGMII:
+		if ((old >> sds_shift & 0x1f) == 2)
+			return;
+		sw_w32_mask(0x7 << int_shift, 2 << int_shift, RTL838X_INT_MODE_CTRL);
+		sw_w32_mask(0x1f << sds_shift, 2 << sds_shift, RTL838X_SDS_MODE_SEL);
+		break;
+	default:
+		return;
+	}
+	pr_debug("configured port %d for interface %s\n", port, phy_modes(interface));
+}
+
+*/
+
 /* RTL930X */
 
 /* The access registers for SDS_MODE_SEL and the LSB for each SDS within */



From lede-commits at lists.infradead.org  Mon Dec  8 15:29:36 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:29:36 -0500
Subject: [openwrt/openwrt]  realtek: rtl838x: setup SDS entirely in PCS driver
In-Reply-To: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
References: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
Message-ID: <mailman.34144.1765236578.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e956adfe3eb30f68a6f6e9bb8e25fc4fb422769e

commit e956adfe3eb30f68a6f6e9bb8e25fc4fb422769e
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Nov 7 16:15:17 2025 +0000

    realtek: rtl838x: setup SDS entirely in PCS driver
    
    After having moved the configuration code and sequences from PHY and
    DSA drivers to the PCS driver, add the hooks in PCS driver and remove
    calls in PHY and DSA drivers to let PCS driver setup the SerDes
    entirely on its own.
    
    Also add pcs-handle to device tree definitions for most of the switch
    ports because, due to the refactoring of the SerDes configuration, this
    is needed now for all SerDes-attached ports.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20876
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../realtek/dts/rtl8380_netgear_gs110tup-v1.dts    | 13 ++++++-
 .../realtek/dts/rtl8380_netgear_gs310tp-v1.dts     | 25 ++++++++++++--
 .../linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi   | 24 +++++++++++--
 .../realtek/dts/rtl8382_apresia_aplgs120gtss.dts   | 24 ++++++-------
 .../realtek/dts/rtl8382_d-link_dgs-1210-16.dts     | 24 ++++++-------
 .../realtek/dts/rtl8382_d-link_dgs-1210-20.dts     | 24 ++++++-------
 .../realtek/dts/rtl8382_d-link_dgs-1210-26.dts     | 32 ++++++++---------
 .../dts/rtl8382_d-link_dgs-1210-28_common.dtsi     | 40 +++++++++++-----------
 target/linux/realtek/dts/rtl8382_hpe_1920-16g.dts  | 24 ++++++-------
 target/linux/realtek/dts/rtl8382_hpe_1920-24g.dtsi | 40 +++++++++++-----------
 .../linux/realtek/dts/rtl8382_inaba_aml2-17gp.dts  | 16 ++++-----
 .../linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts | 32 ++++++++---------
 .../dts/rtl8382_panasonic_m16eg-pn28160k.dts       | 16 ++++-----
 .../dts/rtl8382_panasonic_m24eg-pn28240k.dts       | 32 ++++++++---------
 .../realtek/dts/rtl8382_tplink_t1600g-28ts-v3.dts  | 32 ++++++++---------
 .../realtek/dts/rtl8382_zyxel_gs1900-16-a1.dts     | 16 ++++-----
 .../realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts     | 32 ++++++++---------
 .../realtek/dts/rtl8382_zyxel_gs1900-24e-a1.dts    | 32 ++++++++---------
 .../realtek/dts/rtl8382_zyxel_gs1900-24ep-a1.dts   | 32 ++++++++---------
 .../realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts   | 32 ++++++++---------
 .../realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts   | 32 ++++++++---------
 .../files-6.12/drivers/net/dsa/rtl83xx/common.c    |  7 ----
 .../files-6.12/drivers/net/dsa/rtl83xx/dsa.c       |  3 +-
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      |  4 +--
 .../files-6.12/drivers/net/phy/rtl83xx-phy.c       | 10 ++----
 25 files changed, 319 insertions(+), 279 deletions(-)

diff --git a/target/linux/realtek/dts/rtl8380_netgear_gs110tup-v1.dts b/target/linux/realtek/dts/rtl8380_netgear_gs110tup-v1.dts
index f34e9f7d96..b46aa57226 100644
--- a/target/linux/realtek/dts/rtl8380_netgear_gs110tup-v1.dts
+++ b/target/linux/realtek/dts/rtl8380_netgear_gs110tup-v1.dts
@@ -53,7 +53,18 @@
 &switch0 {
 	ports {
 		SWITCH_PORT(16, 9, qsgmii)
+
 		/* TODO: fixed link SFP is not right */
-		SWITCH_SFP_PORT(24, 10, rgmii-id)
+		port24: port at 24 {
+			reg = <24>;
+			label = SWITCH_PORT_LABEL(10);
+			pcs-handle = <&serdes4>;
+			phy-handle = <&phy24>;
+			phy-mode = "1000base-x";
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
 	};
 };
diff --git a/target/linux/realtek/dts/rtl8380_netgear_gs310tp-v1.dts b/target/linux/realtek/dts/rtl8380_netgear_gs310tp-v1.dts
index 5219e926ec..636046ed1b 100644
--- a/target/linux/realtek/dts/rtl8380_netgear_gs310tp-v1.dts
+++ b/target/linux/realtek/dts/rtl8380_netgear_gs310tp-v1.dts
@@ -57,7 +57,28 @@
 &switch0 {
 	ports {
 		/* TODO: fixed link SFP is not right */
-		SWITCH_SFP_PORT(24, 9, 1000base-x)
-		SWITCH_SFP_PORT(26, 10, 1000base-x)
+
+		port24: port at 24 {
+			reg = <24>;
+			label = SWITCH_PORT_LABEL(9);
+			pcs-handle = <&serdes4>;
+			phy-handle = <&phy24>;
+			phy-mode = "1000base-x";
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
+		port26: port at 26 {
+			reg = <26>;
+			label = SWITCH_PORT_LABEL(10);
+			pcs-handle = <&serdes5>;
+			phy-handle = <&phy26>;
+			phy-mode = "1000base-x";
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
 	};
 };
diff --git a/target/linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi b/target/linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi
index 7249d52275..3854d5cf8b 100644
--- a/target/linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi
+++ b/target/linux/realtek/dts/rtl8380_tplink_sg2xxx.dtsi
@@ -168,8 +168,28 @@
 		SWITCH_PORT(8, 8, internal)
 
 		/* TODO: fixed link SFP is not right */
-		SWITCH_SFP_PORT(24, 9, 1000base-x)
-		SWITCH_SFP_PORT(26, 10, 1000base-x)
+		port24: port at 24 {
+			reg = <24>;
+			label = SWITCH_PORT_LABEL(9);
+			pcs-handle = <&serdes4>;
+			phy-handle = <&phy24>;
+			phy-mode = "1000base-x";
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
+		port26: port at 26 {
+			reg = <26>;
+			label = SWITCH_PORT_LABEL(10);
+			pcs-handle = <&serdes5>;
+			phy-handle = <&phy26>;
+			phy-mode = "1000base-x";
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_apresia_aplgs120gtss.dts b/target/linux/realtek/dts/rtl8382_apresia_aplgs120gtss.dts
index 3d2adb27a4..db14e7963b 100644
--- a/target/linux/realtek/dts/rtl8382_apresia_aplgs120gtss.dts
+++ b/target/linux/realtek/dts/rtl8382_apresia_aplgs120gtss.dts
@@ -229,14 +229,14 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -247,10 +247,10 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(24, 17, qsgmii)
-		SWITCH_PORT(25, 18, qsgmii)
-		SWITCH_PORT(26, 19, qsgmii)
-		SWITCH_PORT(27, 20, qsgmii)
+		SWITCH_PORT_SDS(24, 17, 4, qsgmii)
+		SWITCH_PORT_SDS(25, 18, 4, qsgmii)
+		SWITCH_PORT_SDS(26, 19, 4, qsgmii)
+		SWITCH_PORT_SDS(27, 20, 4, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-16.dts b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-16.dts
index 022902f356..1591ae349a 100644
--- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-16.dts
+++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-16.dts
@@ -39,14 +39,14 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -57,10 +57,10 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(24, 17, qsgmii)
-		SWITCH_PORT(25, 18, qsgmii)
-		SWITCH_PORT(26, 19, qsgmii)
-		SWITCH_PORT(27, 20, qsgmii)
+		SWITCH_PORT_SDS(24, 17, 4, qsgmii)
+		SWITCH_PORT_SDS(25, 18, 4, qsgmii)
+		SWITCH_PORT_SDS(26, 19, 4, qsgmii)
+		SWITCH_PORT_SDS(27, 20, 4, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-20.dts b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-20.dts
index 601d2980d6..0cf6ffb00c 100644
--- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-20.dts
+++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-20.dts
@@ -39,14 +39,14 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -57,10 +57,10 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(24, 17, qsgmii)
-		SWITCH_PORT(25, 18, qsgmii)
-		SWITCH_PORT(26, 19, qsgmii)
-		SWITCH_PORT(27, 20, qsgmii)
+		SWITCH_PORT_SDS(24, 17, 4, qsgmii)
+		SWITCH_PORT_SDS(25, 18, 4, qsgmii)
+		SWITCH_PORT_SDS(26, 19, 4, qsgmii)
+		SWITCH_PORT_SDS(27, 20, 4, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-26.dts b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-26.dts
index 1102ae9424..34611e101e 100644
--- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-26.dts
+++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-26.dts
@@ -82,14 +82,14 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -100,14 +100,14 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 
 		port at 24 {
 			reg = <24>;
diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-28_common.dtsi b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-28_common.dtsi
index fe07078c2b..65e5646db4 100644
--- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-28_common.dtsi
+++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-28_common.dtsi
@@ -40,14 +40,14 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -58,19 +58,19 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 
-		SWITCH_PORT(24, 25, qsgmii)
-		SWITCH_PORT(25, 26, qsgmii)
-		SWITCH_PORT(26, 27, qsgmii)
-		SWITCH_PORT(27, 28, qsgmii)
+		SWITCH_PORT_SDS(24, 25, 4, qsgmii)
+		SWITCH_PORT_SDS(25, 26, 4, qsgmii)
+		SWITCH_PORT_SDS(26, 27, 4, qsgmii)
+		SWITCH_PORT_SDS(27, 28, 4, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_hpe_1920-16g.dts b/target/linux/realtek/dts/rtl8382_hpe_1920-16g.dts
index 59043b2f6f..3e10cd62be 100644
--- a/target/linux/realtek/dts/rtl8382_hpe_1920-16g.dts
+++ b/target/linux/realtek/dts/rtl8382_hpe_1920-16g.dts
@@ -21,19 +21,19 @@
 		SWITCH_PORT(14, 7, internal)
 		SWITCH_PORT(15, 8, internal)
 
-		SWITCH_PORT(16, 9, qsgmii)
-		SWITCH_PORT(17, 10, qsgmii)
-		SWITCH_PORT(18, 11, qsgmii)
-		SWITCH_PORT(19, 12, qsgmii)
-		SWITCH_PORT(20, 13, qsgmii)
-		SWITCH_PORT(21, 14, qsgmii)
-		SWITCH_PORT(22, 15, qsgmii)
-		SWITCH_PORT(23, 16, qsgmii)
+		SWITCH_PORT_SDS(16, 9, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 10, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 11, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 12, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 13, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 14, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 15, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 16, 3, qsgmii)
 
-		SWITCH_PORT(24, 17, qsgmii)
-		SWITCH_PORT(25, 18, qsgmii)
-		SWITCH_PORT(26, 19, qsgmii)
-		SWITCH_PORT(27, 20, qsgmii)
+		SWITCH_PORT_SDS(24, 17, 4, qsgmii)
+		SWITCH_PORT_SDS(25, 18, 4, qsgmii)
+		SWITCH_PORT_SDS(26, 19, 4, qsgmii)
+		SWITCH_PORT_SDS(27, 20, 4, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_hpe_1920-24g.dtsi b/target/linux/realtek/dts/rtl8382_hpe_1920-24g.dtsi
index 7358961943..a7cc555fa2 100644
--- a/target/linux/realtek/dts/rtl8382_hpe_1920-24g.dtsi
+++ b/target/linux/realtek/dts/rtl8382_hpe_1920-24g.dtsi
@@ -23,14 +23,14 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -41,19 +41,19 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 
-		SWITCH_PORT(24, 25, qsgmii)
-		SWITCH_PORT(25, 26, qsgmii)
-		SWITCH_PORT(26, 27, qsgmii)
-		SWITCH_PORT(27, 28, qsgmii)
+		SWITCH_PORT_SDS(24, 25, 4, qsgmii)
+		SWITCH_PORT_SDS(25, 26, 4, qsgmii)
+		SWITCH_PORT_SDS(26, 27, 4, qsgmii)
+		SWITCH_PORT_SDS(27, 28, 4, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_inaba_aml2-17gp.dts b/target/linux/realtek/dts/rtl8382_inaba_aml2-17gp.dts
index c3683dc6a8..9d60abc1fd 100644
--- a/target/linux/realtek/dts/rtl8382_inaba_aml2-17gp.dts
+++ b/target/linux/realtek/dts/rtl8382_inaba_aml2-17gp.dts
@@ -121,14 +121,14 @@
 		SWITCH_PORT(14, 7, internal)
 		SWITCH_PORT(15, 8, internal)
 
-		SWITCH_PORT(16, 9, qsgmii)
-		SWITCH_PORT(17, 10, qsgmii)
-		SWITCH_PORT(18, 11, qsgmii)
-		SWITCH_PORT(19, 12, qsgmii)
-		SWITCH_PORT(20, 13, qsgmii)
-		SWITCH_PORT(21, 14, qsgmii)
-		SWITCH_PORT(22, 15, qsgmii)
-		SWITCH_PORT(23, 16, qsgmii)
+		SWITCH_PORT_SDS(16, 9, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 10, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 11, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 12, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 13, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 14, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 15, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 16, 3, qsgmii)
 
 		port at 24 {
 			reg = <24>;
diff --git a/target/linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts b/target/linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts
index b2dd2dff8c..4f2b209e80 100644
--- a/target/linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts
+++ b/target/linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts
@@ -155,14 +155,14 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -173,14 +173,14 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_panasonic_m16eg-pn28160k.dts b/target/linux/realtek/dts/rtl8382_panasonic_m16eg-pn28160k.dts
index b2bc975722..17ed20e076 100644
--- a/target/linux/realtek/dts/rtl8382_panasonic_m16eg-pn28160k.dts
+++ b/target/linux/realtek/dts/rtl8382_panasonic_m16eg-pn28160k.dts
@@ -140,14 +140,14 @@
 		SWITCH_PORT(14, 7, internal)
 		SWITCH_PORT(15, 8, internal)
 
-		SWITCH_PORT(16, 9, qsgmii)
-		SWITCH_PORT(17, 10, qsgmii)
-		SWITCH_PORT(18, 11, qsgmii)
-		SWITCH_PORT(19, 12, qsgmii)
-		SWITCH_PORT(20, 13, qsgmii)
-		SWITCH_PORT(21, 14, qsgmii)
-		SWITCH_PORT(22, 15, qsgmii)
-		SWITCH_PORT(23, 16, qsgmii)
+		SWITCH_PORT_SDS(16, 9, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 10, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 11, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 12, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 13, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 14, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 15, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 16, 3, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_panasonic_m24eg-pn28240k.dts b/target/linux/realtek/dts/rtl8382_panasonic_m24eg-pn28240k.dts
index 41df49f0aa..ccd49ad3ca 100644
--- a/target/linux/realtek/dts/rtl8382_panasonic_m24eg-pn28240k.dts
+++ b/target/linux/realtek/dts/rtl8382_panasonic_m24eg-pn28240k.dts
@@ -141,14 +141,14 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -159,14 +159,14 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_tplink_t1600g-28ts-v3.dts b/target/linux/realtek/dts/rtl8382_tplink_t1600g-28ts-v3.dts
index 20e0a868c6..6bb0d807a8 100644
--- a/target/linux/realtek/dts/rtl8382_tplink_t1600g-28ts-v3.dts
+++ b/target/linux/realtek/dts/rtl8382_tplink_t1600g-28ts-v3.dts
@@ -128,14 +128,14 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -146,14 +146,14 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-16-a1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-16-a1.dts
index 846ddce777..4fe7a59389 100644
--- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-16-a1.dts
+++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-16-a1.dts
@@ -21,14 +21,14 @@
 
 &switch0 {
 	ports {
-		SWITCH_PORT(16, 9, qsgmii)
-		SWITCH_PORT(17, 10, qsgmii)
-		SWITCH_PORT(18, 11, qsgmii)
-		SWITCH_PORT(19, 12, qsgmii)
-		SWITCH_PORT(20, 13, qsgmii)
-		SWITCH_PORT(21, 14, qsgmii)
-		SWITCH_PORT(22, 15, qsgmii)
-		SWITCH_PORT(23, 16, qsgmii)
+		SWITCH_PORT_SDS(16, 9, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 10, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 11, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 12, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 13, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 14, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 15, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 16, 3, qsgmii)
 	};
 };
 
diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts
index b83328b03c..63c96a88ae 100644
--- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts
+++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-a1.dts
@@ -79,14 +79,14 @@
 
 &switch0 {
 	ports {
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -97,14 +97,14 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 
 		port at 24 {
 			reg = <24>;
diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24e-a1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24e-a1.dts
index 1f2a565d81..c54648cc32 100644
--- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24e-a1.dts
+++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24e-a1.dts
@@ -30,14 +30,14 @@
 
 &switch0 {
 	ports {
-		SWITCH_PORT(1, 1, qsgmii)
-		SWITCH_PORT(0, 2, qsgmii)
-		SWITCH_PORT(3, 3, qsgmii)
-		SWITCH_PORT(2, 4, qsgmii)
-		SWITCH_PORT(5, 5, qsgmii)
-		SWITCH_PORT(4, 6, qsgmii)
-		SWITCH_PORT(7, 7, qsgmii)
-		SWITCH_PORT(6, 8, qsgmii)
+		SWITCH_PORT_SDS(1, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(0, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(5, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(4, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 8, 1, qsgmii)
 
 		SWITCH_PORT(9, 9, internal)
 		SWITCH_PORT(8, 10, internal)
@@ -48,14 +48,14 @@
 		SWITCH_PORT(15, 15, internal)
 		SWITCH_PORT(14, 16, internal)
 
-		SWITCH_PORT(17, 17, qsgmii)
-		SWITCH_PORT(16, 18, qsgmii)
-		SWITCH_PORT(19, 19, qsgmii)
-		SWITCH_PORT(18, 20, qsgmii)
-		SWITCH_PORT(21, 21, qsgmii)
-		SWITCH_PORT(20, 22, qsgmii)
-		SWITCH_PORT(23, 23, qsgmii)
-		SWITCH_PORT(22, 24, qsgmii)
+		SWITCH_PORT_SDS(17, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(16, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(21, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(20, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 24, 3, qsgmii)
 	};
 };
 
diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24ep-a1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24ep-a1.dts
index b4d07dd2d5..e3006d77a4 100644
--- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24ep-a1.dts
+++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24ep-a1.dts
@@ -34,14 +34,14 @@
 
 &switch0 {
 	ports {
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -52,13 +52,13 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 	};
 };
diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts
index fb388e0a34..8c8bc0b2ba 100644
--- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts
+++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-a1.dts
@@ -79,14 +79,14 @@
 
 &switch0 {
 	ports {
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -97,14 +97,14 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 
 		port at 24 {
 			reg = <24>;
diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts
index fba5d0eb05..42f631316c 100644
--- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts
+++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-b1.dts
@@ -75,14 +75,14 @@
 
 &switch0 {
 	ports {
-		SWITCH_PORT(0, 1, qsgmii)
-		SWITCH_PORT(1, 2, qsgmii)
-		SWITCH_PORT(2, 3, qsgmii)
-		SWITCH_PORT(3, 4, qsgmii)
-		SWITCH_PORT(4, 5, qsgmii)
-		SWITCH_PORT(5, 6, qsgmii)
-		SWITCH_PORT(6, 7, qsgmii)
-		SWITCH_PORT(7, 8, qsgmii)
+		SWITCH_PORT_SDS(0, 1, 0, qsgmii)
+		SWITCH_PORT_SDS(1, 2, 0, qsgmii)
+		SWITCH_PORT_SDS(2, 3, 0, qsgmii)
+		SWITCH_PORT_SDS(3, 4, 0, qsgmii)
+		SWITCH_PORT_SDS(4, 5, 1, qsgmii)
+		SWITCH_PORT_SDS(5, 6, 1, qsgmii)
+		SWITCH_PORT_SDS(6, 7, 1, qsgmii)
+		SWITCH_PORT_SDS(7, 8, 1, qsgmii)
 
 		SWITCH_PORT(8, 9, internal)
 		SWITCH_PORT(9, 10, internal)
@@ -93,14 +93,14 @@
 		SWITCH_PORT(14, 15, internal)
 		SWITCH_PORT(15, 16, internal)
 
-		SWITCH_PORT(16, 17, qsgmii)
-		SWITCH_PORT(17, 18, qsgmii)
-		SWITCH_PORT(18, 19, qsgmii)
-		SWITCH_PORT(19, 20, qsgmii)
-		SWITCH_PORT(20, 21, qsgmii)
-		SWITCH_PORT(21, 22, qsgmii)
-		SWITCH_PORT(22, 23, qsgmii)
-		SWITCH_PORT(23, 24, qsgmii)
+		SWITCH_PORT_SDS(16, 17, 2, qsgmii)
+		SWITCH_PORT_SDS(17, 18, 2, qsgmii)
+		SWITCH_PORT_SDS(18, 19, 2, qsgmii)
+		SWITCH_PORT_SDS(19, 20, 2, qsgmii)
+		SWITCH_PORT_SDS(20, 21, 3, qsgmii)
+		SWITCH_PORT_SDS(21, 22, 3, qsgmii)
+		SWITCH_PORT_SDS(22, 23, 3, qsgmii)
+		SWITCH_PORT_SDS(23, 24, 3, qsgmii)
 
 
 		port at 24 {
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
index 6115c48f30..52a6dd7345 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
@@ -408,13 +408,6 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
 		sw_w32_mask(BIT(7), 0, RTL839X_SMI_GLB_CTRL);
 	}
 
-	/* Power on fibre ports and reset them if necessary */
-	if (priv->ports[24].phy == PHY_RTL838X_SDS) {
-		pr_debug("Powering on fibre ports & reset\n");
-		rtl8380_sds_power(24, 1);
-		rtl8380_sds_power(26, 1);
-	}
-
 	return 0;
 }
 
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
index b8c944425e..66f4c6c148 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
@@ -652,6 +652,7 @@ static struct phylink_pcs *rtldsa_phylink_mac_select_pcs(struct dsa_switch *ds,
 	return priv->pcs[port];
 }
 
+__attribute__((unused))
 static void rtl83xx_config_interface(int port, phy_interface_t interface)
 {
 	u32 old, int_shift, sds_shift;
@@ -754,7 +755,7 @@ static void rtl83xx_phylink_mac_config(struct dsa_switch *ds, int port,
 	mcr = sw_r32(priv->r->mac_force_mode_ctrl(port));
 	if (mode == MLO_AN_PHY || phylink_autoneg_inband(mode)) {
 		pr_debug("port %d PHY autonegotiates\n", port);
-		rtl83xx_config_interface(port, state->interface);
+
 		mcr |= RTL838X_NWAY_EN;
 	} else {
 		mcr &= ~RTL838X_NWAY_EN;
diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index fff84a3e84..e41c89e713 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -453,7 +453,6 @@ static int rtpcs_838x_sds_patch(struct rtpcs_ctrl *ctrl, u32 sds,
 	return 0;
 }
 
-__always_unused
 static int rtpcs_838x_init_serdes_common(struct rtpcs_ctrl *ctrl)
 {
 	u32 val;
@@ -474,7 +473,6 @@ static int rtpcs_838x_init_serdes_common(struct rtpcs_ctrl *ctrl)
 	return 0;
 }
 
-__always_unused
 static int rtpcs_838x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 				   phy_interface_t mode)
 {
@@ -3101,6 +3099,8 @@ static const struct rtpcs_config rtpcs_838x_cfg = {
 	.mac_rx_pause_sts	= RTPCS_838X_MAC_RX_PAUSE_STS,
 	.mac_tx_pause_sts	= RTPCS_838X_MAC_TX_PAUSE_STS,
 	.pcs_ops		= &rtpcs_838x_pcs_ops,
+	.init_serdes_common	= rtpcs_838x_init_serdes_common,
+	.setup_serdes		= rtpcs_838x_setup_serdes,
 };
 
 static const struct phylink_pcs_ops rtpcs_839x_pcs_ops = {
diff --git a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
index fe72beded3..04b673e0c0 100644
--- a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
+++ b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
@@ -146,6 +146,7 @@ static void rtl8380_phy_reset(struct phy_device *phydev)
 /* Read the link and speed status of the 2 internal SGMII/1000Base-X
  * ports of the RTL838x SoCs
  */
+__attribute__((unused))
 static int rtl8380_read_status(struct phy_device *phydev)
 {
 	int err;
@@ -1107,14 +1108,7 @@ static int rtl838x_serdes_probe(struct phy_device *phydev)
 	if (addr < 24)
 		return -ENODEV;
 
-	/* On the RTL8380M, PHYs 24-27 connect to the internal SerDes */
-	if (soc_info.id == 0x8380) {
-		if (addr == 24)
-			return rtl8380_configure_serdes(phydev);
-		return 0;
-	}
-
-	return -ENODEV;
+	return 0;
 }
 
 static int rtl8393_serdes_probe(struct phy_device *phydev)



From lede-commits at lists.infradead.org  Mon Dec  8 15:29:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:29:38 -0500
Subject: [openwrt/openwrt]  realtek: dsa,phy: rtl838x: remove 'SerDes as PHY'
 leftovers
In-Reply-To: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
References: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
Message-ID: <mailman.34147.1765236579.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c3887c126d986f7934570d0d19f4d80b550eda22

commit c3887c126d986f7934570d0d19f4d80b550eda22
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Nov 7 19:00:03 2025 +0000

    realtek: dsa,phy: rtl838x: remove 'SerDes as PHY' leftovers
    
    RTL838X SerDes is now completely managed by the PCS driver so it's time
    to remove all the unused leftovers from DSA and PHY drivers to have that
    finally separated.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20876
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/dsa/rtl83xx/common.c    |   8 -
 .../files-6.12/drivers/net/dsa/rtl83xx/dsa.c       |  38 -----
 .../files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c   |  28 ----
 .../files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h   |  10 --
 .../files-6.12/drivers/net/dsa/rtl83xx/rtl83xx.h   |   2 -
 .../files-6.12/drivers/net/phy/rtl83xx-phy.c       | 162 ---------------------
 .../files-6.12/drivers/net/phy/rtl83xx-phy.h       |  13 --
 7 files changed, 261 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
index 52a6dd7345..85818391b5 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
@@ -369,14 +369,6 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
 			continue;
 		}
 
-		/* Check for the integrated SerDes of the RTL8380M first */
-		if (of_property_read_bool(phy_node, "phy-is-integrated")
-		    && priv->id == 0x8380 && pn >= 24) {
-			pr_debug("----> FOUND A SERDES\n");
-			priv->ports[pn].phy = PHY_RTL838X_SDS;
-			continue;
-		}
-
 		if (of_property_read_bool(phy_node, "phy-is-integrated") &&
 		    !of_property_read_bool(phy_node, "sfp")) {
 			priv->ports[pn].phy = PHY_RTL8218B_INT;
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
index 66f4c6c148..5ddff2a1b4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
@@ -652,44 +652,6 @@ static struct phylink_pcs *rtldsa_phylink_mac_select_pcs(struct dsa_switch *ds,
 	return priv->pcs[port];
 }
 
-__attribute__((unused))
-static void rtl83xx_config_interface(int port, phy_interface_t interface)
-{
-	u32 old, int_shift, sds_shift;
-
-	switch (port) {
-	case 24:
-		int_shift = 0;
-		sds_shift = 5;
-		break;
-	case 26:
-		int_shift = 3;
-		sds_shift = 0;
-		break;
-	default:
-		return;
-	}
-
-	old = sw_r32(RTL838X_SDS_MODE_SEL);
-	switch (interface) {
-	case PHY_INTERFACE_MODE_1000BASEX:
-		if ((old >> sds_shift & 0x1f) == 4)
-			return;
-		sw_w32_mask(0x7 << int_shift, 1 << int_shift, RTL838X_INT_MODE_CTRL);
-		sw_w32_mask(0x1f << sds_shift, 4 << sds_shift, RTL838X_SDS_MODE_SEL);
-		break;
-	case PHY_INTERFACE_MODE_SGMII:
-		if ((old >> sds_shift & 0x1f) == 2)
-			return;
-		sw_w32_mask(0x7 << int_shift, 2 << int_shift, RTL838X_INT_MODE_CTRL);
-		sw_w32_mask(0x1f << sds_shift, 2 << sds_shift, RTL838X_SDS_MODE_SEL);
-		break;
-	default:
-		return;
-	}
-	pr_debug("configured port %d for interface %s\n", port, phy_modes(interface));
-}
-
 static void rtldsa_83xx_phylink_get_caps(struct dsa_switch *ds, int port,
 					 struct phylink_config *config)
 {
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c
index 1f0f3c2786..39e15ba3e0 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c
@@ -1810,31 +1810,3 @@ void rtl838x_vlan_profile_dump(int profile)
 		 profile, p & 1, (p >> 1) & 0x1ff, (p >> 10) & 0x1ff, (p >> 19) & 0x1ff);
 }
 
-void rtl8380_sds_rst(int mac)
-{
-	u32 offset = (mac == 24) ? 0 : 0x100;
-
-	sw_w32_mask(1 << 11, 0, RTL838X_SDS4_FIB_REG0 + offset);
-	sw_w32_mask(0x3, 0, RTL838X_SDS4_REG28 + offset);
-	sw_w32_mask(0x3, 0x3, RTL838X_SDS4_REG28 + offset);
-	sw_w32_mask(0, 0x1 << 6, RTL838X_SDS4_DUMMY0 + offset);
-	sw_w32_mask(0x1 << 6, 0, RTL838X_SDS4_DUMMY0 + offset);
-	pr_debug("SERDES reset: %d\n", mac);
-}
-
-int rtl8380_sds_power(int mac, int val)
-{
-	u32 mode = (val == 1) ? 0x4 : 0x9;
-	u32 offset = (mac == 24) ? 5 : 0;
-
-	if ((mac != 24) && (mac != 26)) {
-		pr_err("%s: not a fibre port: %d\n", __func__, mac);
-		return -1;
-	}
-
-	sw_w32_mask(0x1f << offset, mode << offset, RTL838X_SDS_MODE_SEL);
-
-	rtl8380_sds_rst(mac);
-
-	return 0;
-}
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
index bbb37d47c8..95ccfba639 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
@@ -21,10 +21,6 @@
 #define RTL930X_MAC_FORCE_MODE_CTRL		(0xCA1C)
 #define RTL931X_MAC_FORCE_MODE_CTRL		(0x0DCC)
 
-#define RTL838X_DMY_REG31			(0x3b28)
-#define RTL838X_SDS_MODE_SEL			(0x0028)
-#define RTL838X_SDS_CFG_REG			(0x0034)
-#define RTL838X_INT_MODE_CTRL			(0x005c)
 #define RTL838X_PORT_ISO_CTRL(port)		(0x4100 + ((port) << 2))
 #define RTL839X_PORT_ISO_CTRL(port)		(0x1400 + ((port) << 3))
 
@@ -54,12 +50,6 @@
 #define RTL839X_SDS12_13_PWR0			(0xb880)
 #define RTL839X_SDS12_13_PWR1			(0xb980)
 
-/* Registers of the internal Serdes of the 8380 */
-#define RTL838X_SDS4_FIB_REG0			(0xF800)
-#define RTL838X_SDS4_REG28			(0xef80)
-#define RTL838X_SDS4_DUMMY0			(0xef8c)
-#define RTL838X_SDS5_EXT_REG6			(0xf18c)
-
 /* VLAN registers */
 #define RTL838X_VLAN_CTRL			(0x3A74)
 #define RTL838X_VLAN_PROFILE(idx)		(0x3A88 + ((idx) << 2))
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl83xx.h b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl83xx.h
index 55cf4f32ee..a3cb62ceb7 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl83xx.h
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl83xx.h
@@ -162,8 +162,6 @@ u32 rtl838x_hash(struct rtl838x_switch_priv *priv, u64 seed);
 irqreturn_t rtl838x_switch_irq(int irq, void *dev_id);
 void rtl8380_get_version(struct rtl838x_switch_priv *priv);
 void rtl838x_vlan_profile_dump(int index);
-void rtl8380_sds_rst(int mac);
-int rtl8380_sds_power(int mac, int val);
 void rtl838x_print_matrix(void);
 
 /* RTL839x-specific */
diff --git a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
index 04b673e0c0..3281c5d7ad 100644
--- a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
+++ b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
@@ -143,24 +143,6 @@ static void rtl8380_phy_reset(struct phy_device *phydev)
 	phy_modify(phydev, 0, BMCR_RESET, BMCR_RESET);
 }
 
-/* Read the link and speed status of the 2 internal SGMII/1000Base-X
- * ports of the RTL838x SoCs
- */
-__attribute__((unused))
-static int rtl8380_read_status(struct phy_device *phydev)
-{
-	int err;
-
-	err = genphy_read_status(phydev);
-
-	if (phydev->link) {
-		phydev->speed = SPEED_1000;
-		phydev->duplex = DUPLEX_FULL;
-	}
-
-	return err;
-}
-
 /* Read the link and speed status of the 2 internal SGMII/1000Base-X
  * ports of the RTL8393 SoC
  */
@@ -808,127 +790,6 @@ static int rtl8380_configure_rtl8214fc(struct phy_device *phydev)
 	return 0;
 }
 
-static int rtl8380_configure_serdes(struct phy_device *phydev)
-{
-	u32 v;
-	u32 sds_conf_value;
-	int i;
-	struct fw_header *h;
-	u32 *rtl8380_sds_take_reset;
-	u32 *rtl8380_sds_common;
-	u32 *rtl8380_sds01_qsgmii_6275b;
-	u32 *rtl8380_sds23_qsgmii_6275b;
-	u32 *rtl8380_sds4_fiber_6275b;
-	u32 *rtl8380_sds5_fiber_6275b;
-	u32 *rtl8380_sds_reset;
-	u32 *rtl8380_sds_release_reset;
-
-	phydev_info(phydev, "Detected internal RTL8380 SERDES\n");
-
-	h = rtl838x_request_fw(phydev, &rtl838x_8218b_fw, FIRMWARE_838X_8380_1);
-	if (!h)
-		return -1;
-
-	if (h->magic != 0x83808380) {
-		phydev_err(phydev, "Wrong firmware file: magic number mismatch.\n");
-		return -1;
-	}
-
-	rtl8380_sds_take_reset = (void *)h + sizeof(struct fw_header) + h->parts[0].start;
-
-	rtl8380_sds_common = (void *)h + sizeof(struct fw_header) + h->parts[1].start;
-
-	rtl8380_sds01_qsgmii_6275b = (void *)h + sizeof(struct fw_header) + h->parts[2].start;
-
-	rtl8380_sds23_qsgmii_6275b = (void *)h + sizeof(struct fw_header) + h->parts[3].start;
-
-	rtl8380_sds4_fiber_6275b = (void *)h + sizeof(struct fw_header) + h->parts[4].start;
-
-	rtl8380_sds5_fiber_6275b = (void *)h + sizeof(struct fw_header) + h->parts[5].start;
-
-	rtl8380_sds_reset = (void *)h + sizeof(struct fw_header) + h->parts[6].start;
-
-	rtl8380_sds_release_reset = (void *)h + sizeof(struct fw_header) + h->parts[7].start;
-
-	/* Back up serdes power off value */
-	sds_conf_value = sw_r32(RTL838X_SDS_CFG_REG);
-	pr_info("SDS power down value: %x\n", sds_conf_value);
-
-	/* take serdes into reset */
-	i = 0;
-	while (rtl8380_sds_take_reset[2 * i]) {
-		sw_w32(rtl8380_sds_take_reset[2 * i + 1], rtl8380_sds_take_reset[2 * i]);
-		i++;
-		udelay(1000);
-	}
-
-	/* apply common serdes patch */
-	i = 0;
-	while (rtl8380_sds_common[2 * i]) {
-		sw_w32(rtl8380_sds_common[2 * i + 1], rtl8380_sds_common[2 * i]);
-		i++;
-		udelay(1000);
-	}
-
-	/* internal R/W enable */
-	sw_w32(3, RTL838X_INT_RW_CTRL);
-
-	/* SerDes ports 4 and 5 are FIBRE ports */
-	sw_w32_mask(0x7 | 0x38, 1 | (1 << 3), RTL838X_INT_MODE_CTRL);
-
-	/* SerDes module settings, SerDes 0-3 are QSGMII */
-	v = 0x6 << 25 | 0x6 << 20 | 0x6 << 15 | 0x6 << 10;
-	/* SerDes 4 and 5 are 1000BX FIBRE */
-	v |= 0x4 << 5 | 0x4;
-	sw_w32(v, RTL838X_SDS_MODE_SEL);
-
-	pr_info("PLL control register: %x\n", sw_r32(RTL838X_PLL_CML_CTRL));
-	sw_w32_mask(0xfffffff0, 0xaaaaaaaf & 0xf, RTL838X_PLL_CML_CTRL);
-	i = 0;
-	while (rtl8380_sds01_qsgmii_6275b[2 * i]) {
-		sw_w32(rtl8380_sds01_qsgmii_6275b[2 * i + 1],
-		       rtl8380_sds01_qsgmii_6275b[2 * i]);
-		i++;
-	}
-
-	i = 0;
-	while (rtl8380_sds23_qsgmii_6275b[2 * i]) {
-		sw_w32(rtl8380_sds23_qsgmii_6275b[2 * i + 1], rtl8380_sds23_qsgmii_6275b[2 * i]);
-		i++;
-	}
-
-	i = 0;
-	while (rtl8380_sds4_fiber_6275b[2 * i]) {
-		sw_w32(rtl8380_sds4_fiber_6275b[2 * i + 1], rtl8380_sds4_fiber_6275b[2 * i]);
-		i++;
-	}
-
-	i = 0;
-	while (rtl8380_sds5_fiber_6275b[2 * i]) {
-		sw_w32(rtl8380_sds5_fiber_6275b[2 * i + 1], rtl8380_sds5_fiber_6275b[2 * i]);
-		i++;
-	}
-
-	i = 0;
-	while (rtl8380_sds_reset[2 * i]) {
-		sw_w32(rtl8380_sds_reset[2 * i + 1], rtl8380_sds_reset[2 * i]);
-		i++;
-	}
-
-	i = 0;
-	while (rtl8380_sds_release_reset[2 * i]) {
-		sw_w32(rtl8380_sds_release_reset[2 * i + 1], rtl8380_sds_release_reset[2 * i]);
-		i++;
-	}
-
-	pr_info("SDS power down value now: %x\n", sw_r32(RTL838X_SDS_CFG_REG));
-	sw_w32(sds_conf_value, RTL838X_SDS_CFG_REG);
-
-	pr_info("Configuration of SERDES done\n");
-
-	return 0;
-}
-
 static int rtl8390_configure_serdes(struct phy_device *phydev)
 {
 	phydev_info(phydev, "Detected internal RTL8390 SERDES\n");
@@ -1099,18 +960,6 @@ static int rtl8218b_config_init(struct phy_device *phydev)
 	return 0;
 }
 
-static int rtl838x_serdes_probe(struct phy_device *phydev)
-{
-	int addr = phydev->mdio.addr;
-
-	if (soc_info.family != RTL8380_FAMILY_ID)
-		return -ENODEV;
-	if (addr < 24)
-		return -ENODEV;
-
-	return 0;
-}
-
 static int rtl8393_serdes_probe(struct phy_device *phydev)
 {
 	int addr = phydev->mdio.addr;
@@ -1218,17 +1067,6 @@ static struct phy_driver rtl83xx_phy_driver[] = {
 		.write_mmd	= rtl821x_write_mmd,
 		.write_page	= rtl821x_write_page,
 	},
-	{
-		PHY_ID_MATCH_MODEL(PHY_ID_RTL8218B_I),
-		.name		= "Realtek RTL8380 SERDES",
-		.features	= PHY_GBIT_FIBRE_FEATURES,
-		.probe		= rtl838x_serdes_probe,
-		.read_page	= rtl821x_read_page,
-		.write_page	= rtl821x_write_page,
-		.suspend	= genphy_suspend,
-		.resume		= genphy_resume,
-		.read_status	= rtl8380_read_status,
-	},
 	{
 		PHY_ID_MATCH_MODEL(PHY_ID_RTL8393_I),
 		.name		= "Realtek RTL8393 SERDES",
diff --git a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.h b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.h
index 4073292692..537a7e90ac 100644
--- a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.h
+++ b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.h
@@ -35,19 +35,6 @@ struct __packed fw_header {
 #define PHY_IS_RTL8214FB			2
 #define PHY_IS_RTL8218B_E			3
 
-/* Registers of the internal Serdes of the 8380 */
-#define RTL838X_SDS_MODE_SEL			(0x0028)
-#define RTL838X_SDS_CFG_REG			(0x0034)
-#define RTL838X_INT_MODE_CTRL			(0x005c)
-#define RTL838X_DMY_REG31			(0x3b28)
-
-#define RTL8380_SDS4_FIB_REG0			(0xF800)
-#define RTL838X_SDS4_REG28			(0xef80)
-#define RTL838X_SDS4_DUMMY0			(0xef8c)
-#define RTL838X_SDS5_EXT_REG6			(0xf18c)
-#define RTL838X_SDS4_FIB_REG0			(RTL838X_SDS4_REG28 + 0x880)
-#define RTL838X_SDS5_FIB_REG0			(RTL838X_SDS4_REG28 + 0x980)
-
 /* Registers of the internal SerDes of the RTL8390 */
 #define RTL839X_SDS12_13_XSG0			(0xB800)
 



From lede-commits at lists.infradead.org  Mon Dec  8 15:29:35 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:29:35 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl838x: refactor imported code
In-Reply-To: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
References: <176523657259.2988079.738721262422953098@git-01.infra.openwrt.org>
Message-ID: <mailman.34148.1765236579.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b670d4836641b4427b7b7b9d94bb670b0d44c12b

commit b670d4836641b4427b7b7b9d94bb670b0d44c12b
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Nov 7 11:45:30 2025 +0000

    realtek: pcs: rtl838x: refactor imported code
    
    The previous commit just imported some code as-is and commented it.
    It needs heavy adjustments to compile and work within the PCS driver.
    Do that now to that extent that it can be used within the driver. More
    cosmetics and improvements will be done later.
    
    Split the once-for-all SerDes configuration into the usual flow where
    each SerDes is configured separately and on its own, as requested by the
    PCS subsystem.
    
    Move mode setting and patching into proper functions which are called
    during SerDes configuration. Some configuration sequences are broken up
    and moved into the SerDes configuration flow, e.g. reset sequences
    because they were usually a single/few values applied to all SerDes at
    once before.
    
    Add proper configuration for SerDes 4 QSGMII to be able to setup this
    mode properly on our own.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20876
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 409 ++++++++-------------
 1 file changed, 159 insertions(+), 250 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 587564b078..fff84a3e84 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -53,18 +53,10 @@
 
 #define RTPCS_838X_SDS_CFG_REG			0x34
 #define RTPCS_838X_RST_GLB_CTRL_0		0x3c
-#define RTL838X_SDS_MODE_SEL                    (0x0028)
-#define RTL838X_INT_MODE_CTRL                   (0x005c)
-#define RTL838X_DMY_REG31                       (0x3b28)
-#define RTL838X_INT_RW_CTRL                     (0x0058)
-#define RTL838X_PLL_CML_CTRL                    (0x0FF8)
-
-#define RTL8380_SDS4_FIB_REG0                   (0xF800)
-#define RTL838X_SDS4_REG28                      (0xef80)
-#define RTL838X_SDS4_DUMMY0                     (0xef8c)
-#define RTL838X_SDS5_EXT_REG6                   (0xf18c)
-#define RTL838X_SDS4_FIB_REG0                   (RTL838X_SDS4_REG28 + 0x880)
-#define RTL838X_SDS5_FIB_REG0                   (RTL838X_SDS4_REG28 + 0x980)
+#define RTPCS_838X_SDS_MODE_SEL			0x0028
+#define RTPCS_838X_INT_RW_CTRL			0x0058
+#define RTPCS_838X_INT_MODE_CTRL		0x005c
+#define RTPCS_838X_PLL_CML_CTRL			0x0ff8
 
 #define RTPCS_93XX_MAC_LINK_SPD_BITS		4
 
@@ -231,91 +223,6 @@ static struct rtpcs_link *rtpcs_phylink_pcs_to_link(struct phylink_pcs *pcs)
 
 /* RTL838X */
 
-static void rtpcs_838x_sds_take_reset(struct rtpcs_ctrl *ctrl)
-{
-	regmap_write(ctrl->map, RTPCS_838X_SDS_CFG_REG, 0x3f);
-	regmap_write(ctrl->map, RTPCS_838X_RST_GLB_CTRL_0, 0x10);
-
-	rtpcs_sds_write(ctrl, 0, 0x0, 0x3, 0x7146);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 1, 0x0, 0x3, 0x7146);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 2, 0x0, 0x3, 0x7146);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 3, 0x0, 0x3, 0x7146);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 4, 0x0, 0x3, 0x7146);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 5, 0x0, 0x3, 0x7146);
-	udelay(1000);
-}
-
-static void rtpcs_838x_sds_reset(struct rtpcs_ctrl *ctrl)
-{
-	rtpcs_sds_write(ctrl, 0, 0, 0, 0xc00);
-	rtpcs_sds_write(ctrl, 1, 0, 0, 0xc00);
-	rtpcs_sds_write(ctrl, 2, 0, 0, 0xc00);
-	rtpcs_sds_write(ctrl, 3, 0, 0, 0xc00);
-	rtpcs_sds_write(ctrl, 4, 0, 0, 0xc00);
-	rtpcs_sds_write(ctrl, 5, 0, 0, 0xc00);
-
-	rtpcs_sds_write(ctrl, 0, 0, 0, 0xc03);
-	rtpcs_sds_write(ctrl, 1, 0, 0, 0xc03);
-	rtpcs_sds_write(ctrl, 2, 0, 0, 0xc03);
-	rtpcs_sds_write(ctrl, 3, 0, 0, 0xc03);
-	rtpcs_sds_write(ctrl, 4, 0, 0, 0xc03);
-	rtpcs_sds_write(ctrl, 5, 0, 0, 0xc03);
-}
-
-static void rtpcs_838x_sds_release_reset(struct rtpcs_ctrl *ctrl)
-{
-	rtpcs_sds_write(ctrl, 0, 0, 3, 0x7106);
-	rtpcs_sds_write(ctrl, 1, 0, 3, 0x7106);
-	rtpcs_sds_write(ctrl, 2, 0, 3, 0x7106);
-	rtpcs_sds_write(ctrl, 3, 0, 3, 0x7106);
-	rtpcs_sds_write(ctrl, 4, 0, 3, 0x7106);
-	rtpcs_sds_write(ctrl, 5, 0, 3, 0x7106);
-}
-
-static void rtpcs_838x_sds_patch_common(struct rtpcs_ctrl *ctrl)
-{
-	rtpcs_sds_write(ctrl, 4, 2, 30, 0x71e);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 5, 2, 30, 0x71e);
-	udelay(1000);
-
-	rtpcs_sds_write(ctrl, 0, 0, 1, 0xf00);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 1, 0, 1, 0xf00);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 2, 0, 1, 0xf00);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 3, 0, 1, 0xf00);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 4, 0, 1, 0xf00);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 5, 0, 1, 0xf00);
-	udelay(1000);
-
-	rtpcs_sds_write(ctrl, 0, 0, 2, 0x7060);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 1, 0, 2, 0x7060);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 2, 0, 2, 0x7060);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 3, 0, 2, 0x7060);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 4, 0, 2, 0x7060);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 5, 0, 2, 0x7060);
-	udelay(1000);
-
-	rtpcs_sds_write(ctrl, 4, 0, 4, 0x74d);
-	udelay(1000);
-	rtpcs_sds_write(ctrl, 5, 0, 4, 0x74d);
-	udelay(1000);
-}
-
 static void rtpcs_838x_sds_patch_01_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
 {
 	rtpcs_sds_write(ctrl, 0, 1, 3, 0xf46f);
@@ -348,7 +255,6 @@ static void rtpcs_838x_sds_patch_23_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
 	rtpcs_sds_write(ctrl, 2, 1, 3, 0xf46d);
 	rtpcs_sds_write(ctrl, 2, 1, 2, 0x85fa);
 	rtpcs_sds_write(ctrl, 3, 1, 2, 0x85fa);
-//	rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
 	rtpcs_sds_write(ctrl, 2, 1, 6, 0x20d8);
 	rtpcs_sds_write(ctrl, 3, 1, 6, 0x20d8);
 	rtpcs_sds_write(ctrl, 2, 1, 17, 0xb7c9);
@@ -385,6 +291,22 @@ static void rtpcs_838x_sds_patch_4_fiber_6275b(struct rtpcs_ctrl *ctrl)
 	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8c64);
 }
 
+static void rtpcs_838x_sds_patch_4_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
+{
+	rtpcs_sds_write(ctrl, 4, 1, 3, 0xf46d);
+	rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
+	rtpcs_sds_write(ctrl, 4, 1, 11, 0x0482);
+	rtpcs_sds_write(ctrl, 4, 1, 6, 0x20d8);
+	rtpcs_sds_write(ctrl, 4, 1, 10, 0x58c7);
+	rtpcs_sds_write(ctrl, 4, 1, 17, 0xb7c9);
+	rtpcs_sds_write(ctrl, 4, 1, 18, 0xab8e);
+	rtpcs_sds_write(ctrl, 4, 2, 25, 0x303);
+	rtpcs_sds_write(ctrl, 4, 1, 14, 0xfcc2);
+
+	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8e64);
+	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8c64);
+}
+
 static void rtpcs_838x_sds_patch_5_fiber_6275b(struct rtpcs_ctrl *ctrl)
 {
 	rtpcs_sds_write(ctrl, 5, 1, 2, 0x85fa);
@@ -406,195 +328,182 @@ static void rtpcs_838x_sds_patch_5_fiber_6275b(struct rtpcs_ctrl *ctrl)
 	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
 }
 
-/*
-void rtl8380_sds_rst(int mac)
+static void rtpcs_838x_sds_reset(struct rtpcs_ctrl *ctrl, u32 sds)
 {
-	u32 offset = (mac == 24) ? 0 : 0x100;
-
-	sw_w32_mask(1 << 11, 0, RTL838X_SDS4_FIB_REG0 + offset);
-	sw_w32_mask(0x3, 0, RTL838X_SDS4_REG28 + offset);
-	sw_w32_mask(0x3, 0x3, RTL838X_SDS4_REG28 + offset);
-	sw_w32_mask(0, 0x1 << 6, RTL838X_SDS4_DUMMY0 + offset);
-	sw_w32_mask(0x1 << 6, 0, RTL838X_SDS4_DUMMY0 + offset);
-	pr_debug("SERDES reset: %d\n", mac);
-}
-
-int rtl8380_sds_power(int mac, int val)
-{
-	u32 mode = (val == 1) ? 0x4 : 0x9;
-	u32 offset = (mac == 24) ? 5 : 0;
-
-	if ((mac != 24) && (mac != 26)) {
-		pr_err("%s: not a fibre port: %d\n", __func__, mac);
-		return -1;
-	}
+	rtpcs_sds_write_bits(ctrl, sds, 2, 0, 11, 11, 0x0);	/* FIB_REG0 CFG_FIB_PDOWN */
 
-	sw_w32_mask(0x1f << offset, mode << offset, RTL838X_SDS_MODE_SEL);
+	/* analog reset */
+	rtpcs_sds_write_bits(ctrl, sds, 0, 0, 1, 0, 0x0);	/* REG0 EN_RX/EN_TX */
+	rtpcs_sds_write_bits(ctrl, sds, 0, 0, 1, 0, 0x3);	/* REG0 EN_RX/EN_TX */
 
-	rtl8380_sds_rst(mac);
+	/* digital reset */
+	rtpcs_sds_write_bits(ctrl, sds, 0, 3, 6, 6, 0x1);	/* REG3 SOFT_RST */
+	rtpcs_sds_write_bits(ctrl, sds, 0, 3, 6, 6, 0x0);	/* REG3 SOFT_RST */
 
-	return 0;
+	dev_info(ctrl->dev, "SerDes %d reset\n", sds);
 }
 
-static int rtl8380_configure_serdes(struct phy_device *phydev)
+static bool rtpcs_838x_sds_is_mode_supported(u32 sds, phy_interface_t mode)
 {
-	u32 v;
-	u32 sds_conf_value;
-	int i;
-	struct fw_header *h;
-	u32 *rtl8380_sds_take_reset;
-	u32 *rtl8380_sds_common;
-	u32 *rtl8380_sds01_qsgmii_6275b;
-	u32 *rtl8380_sds23_qsgmii_6275b;
-	u32 *rtl8380_sds4_fiber_6275b;
-	u32 *rtl8380_sds5_fiber_6275b;
-	u32 *rtl8380_sds_reset;
-	u32 *rtl8380_sds_release_reset;
-
-	phydev_info(phydev, "Detected internal RTL8380 SERDES\n");
-
-	h = rtl838x_request_fw(phydev, &rtl838x_8218b_fw, FIRMWARE_838X_8380_1);
-	if (!h)
-		return -1;
-
-	if (h->magic != 0x83808380) {
-		phydev_err(phydev, "Wrong firmware file: magic number mismatch.\n");
-		return -1;
+	switch (sds) {
+	case 0 ... 3:
+		return mode == PHY_INTERFACE_MODE_QSGMII;
+	case 4:
+		return mode == PHY_INTERFACE_MODE_QSGMII ||
+		       mode == PHY_INTERFACE_MODE_SGMII ||
+		       mode == PHY_INTERFACE_MODE_1000BASEX;
+	case 5:
+		return mode == PHY_INTERFACE_MODE_SGMII ||
+		       mode == PHY_INTERFACE_MODE_1000BASEX;
+	default:
+		return false;
 	}
+}
 
-	rtl8380_sds_take_reset = (void *)h + sizeof(struct fw_header) + h->parts[0].start;
-
-	rtl8380_sds_common = (void *)h + sizeof(struct fw_header) + h->parts[1].start;
-
-	rtl8380_sds01_qsgmii_6275b = (void *)h + sizeof(struct fw_header) + h->parts[2].start;
-
-	rtl8380_sds23_qsgmii_6275b = (void *)h + sizeof(struct fw_header) + h->parts[3].start;
-
-	rtl8380_sds4_fiber_6275b = (void *)h + sizeof(struct fw_header) + h->parts[4].start;
+static int rtpcs_838x_sds_power(struct rtpcs_ctrl *ctrl, u32 sds, bool power_on)
+{
+	u8 val = power_on ? 0 : BIT(sds);
+	int ret;
 
-	rtl8380_sds5_fiber_6275b = (void *)h + sizeof(struct fw_header) + h->parts[5].start;
+	ret = regmap_write_bits(ctrl->map, RTPCS_838X_SDS_CFG_REG, BIT(sds), val);
+	if (ret)
+		return ret;
 
-	rtl8380_sds_reset = (void *)h + sizeof(struct fw_header) + h->parts[6].start;
+	if (sds >= 4)
+		ret = regmap_write_bits(ctrl->map, RTPCS_838X_SDS_CFG_REG,
+					BIT(sds) << 2, val << 2); /* SDS*_PHY_MODE */
 
-	rtl8380_sds_release_reset = (void *)h + sizeof(struct fw_header) + h->parts[7].start;
+	return ret;
+}
 
-	// Back up serdes power off value
-	sds_conf_value = sw_r32(RTL838X_SDS_CFG_REG);
-	pr_info("SDS power down value: %x\n", sds_conf_value);
+static int rtpcs_838x_sds_set_mode(struct rtpcs_ctrl *ctrl, u32 sds,
+				   phy_interface_t mode)
+{
+	u8 sds_mode_shift, int_mode_shift;
+	u32 sds_mode_val, int_mode_val;
 
-	// take serdes into reset
-	i = 0;
-	while (rtl8380_sds_take_reset[2 * i]) {
-		sw_w32(rtl8380_sds_take_reset[2 * i + 1], rtl8380_sds_take_reset[2 * i]);
-		i++;
-		udelay(1000);
+	switch (mode) {
+	case PHY_INTERFACE_MODE_1000BASEX:
+		sds_mode_val = 0x4;
+		int_mode_val = 0x1;
+		break;
+	case PHY_INTERFACE_MODE_SGMII:
+		sds_mode_val = 0x2;
+		int_mode_val = 0x2;
+		break;
+	case PHY_INTERFACE_MODE_QSGMII:
+		sds_mode_val = 0x6;
+		int_mode_val = 0x5;
+		break;
+	default:
+		return -EINVAL;
 	}
 
-	// apply common serdes patch
-	i = 0;
-	while (rtl8380_sds_common[2 * i]) {
-		sw_w32(rtl8380_sds_common[2 * i + 1], rtl8380_sds_common[2 * i]);
-		i++;
-		udelay(1000);
-	}
+	/* Configure SerDes module mode (all SDS 0-5) */
+	sds_mode_shift = (5 - sds) * 5;
+	regmap_write_bits(ctrl->map, RTPCS_838X_SDS_MODE_SEL,
+			  0x1f << sds_mode_shift, sds_mode_val << sds_mode_shift);
 
-	// internal R/W enable
-	sw_w32(3, RTL838X_INT_RW_CTRL);
+	/* Configure MAC interface mode (only SDS 4-5) */
+	if (sds >= 4) {
+		int_mode_shift = (sds == 5) ? 3 : 0;
+		regmap_write_bits(ctrl->map, RTPCS_838X_INT_MODE_CTRL,
+				  0x7 << int_mode_shift, int_mode_val << int_mode_shift);
+	}
 
-	// SerDes ports 4 and 5 are FIBRE ports
-	sw_w32_mask(0x7 | 0x38, 1 | (1 << 3), RTL838X_INT_MODE_CTRL);
+	return 0;
+}
 
-	// SerDes module settings, SerDes 0-3 are QSGMII
-	v = 0x6 << 25 | 0x6 << 20 | 0x6 << 15 | 0x6 << 10;
-	// SerDes 4 and 5 are 1000BX FIBRE
-	v |= 0x4 << 5 | 0x4;
-	sw_w32(v, RTL838X_SDS_MODE_SEL);
+static int rtpcs_838x_sds_patch(struct rtpcs_ctrl *ctrl, u32 sds,
+				phy_interface_t mode)
+{
+	rtpcs_sds_write(ctrl, sds, 0, 1, 0xf00);
+	mdelay(1);
+	rtpcs_sds_write(ctrl, sds, 0, 2, 0x7060);
+	mdelay(1);
 
-	pr_info("PLL control register: %x\n", sw_r32(RTL838X_PLL_CML_CTRL));
-	sw_w32_mask(0xfffffff0, 0xaaaaaaaf & 0xf, RTL838X_PLL_CML_CTRL);
-	i = 0;
-	while (rtl8380_sds01_qsgmii_6275b[2 * i]) {
-		sw_w32(rtl8380_sds01_qsgmii_6275b[2 * i + 1],
-		       rtl8380_sds01_qsgmii_6275b[2 * i]);
-		i++;
+	if (sds >= 4) {
+		rtpcs_sds_write(ctrl, sds, 2, 30, 0x71e);
+		mdelay(1);
+		rtpcs_sds_write(ctrl, sds, 0, 4, 0x74d);
+		mdelay(1);
 	}
 
-	i = 0;
-	while (rtl8380_sds23_qsgmii_6275b[2 * i]) {
-		sw_w32(rtl8380_sds23_qsgmii_6275b[2 * i + 1], rtl8380_sds23_qsgmii_6275b[2 * i]);
-		i++;
-	}
+	switch (mode) {
+	case PHY_INTERFACE_MODE_1000BASEX:
+		if (sds == 4)
+			rtpcs_838x_sds_patch_4_fiber_6275b(ctrl);
+		else if (sds == 5)
+			rtpcs_838x_sds_patch_5_fiber_6275b(ctrl);
 
-	i = 0;
-	while (rtl8380_sds4_fiber_6275b[2 * i]) {
-		sw_w32(rtl8380_sds4_fiber_6275b[2 * i + 1], rtl8380_sds4_fiber_6275b[2 * i]);
-		i++;
-	}
+		break;
+	case PHY_INTERFACE_MODE_QSGMII:
+		if (sds == 0 || sds == 1)
+			rtpcs_838x_sds_patch_01_qsgmii_6275b(ctrl);
+		else if (sds == 2 || sds == 3)
+			rtpcs_838x_sds_patch_23_qsgmii_6275b(ctrl);
+		else if (sds == 4)
+			rtpcs_838x_sds_patch_4_qsgmii_6275b(ctrl);
 
-	i = 0;
-	while (rtl8380_sds5_fiber_6275b[2 * i]) {
-		sw_w32(rtl8380_sds5_fiber_6275b[2 * i + 1], rtl8380_sds5_fiber_6275b[2 * i]);
-		i++;
+		break;
+	default:
+		break;
 	}
+	
+	return 0;
+}
 
-	i = 0;
-	while (rtl8380_sds_reset[2 * i]) {
-		sw_w32(rtl8380_sds_reset[2 * i + 1], rtl8380_sds_reset[2 * i]);
-		i++;
-	}
+__always_unused
+static int rtpcs_838x_init_serdes_common(struct rtpcs_ctrl *ctrl)
+{
+	u32 val;
 
-	i = 0;
-	while (rtl8380_sds_release_reset[2 * i]) {
-		sw_w32(rtl8380_sds_release_reset[2 * i + 1], rtl8380_sds_release_reset[2 * i]);
-		i++;
-	}
+	dev_dbg(ctrl->dev, "Init RTL838X SerDes common\n");
 
-	pr_info("SDS power down value now: %x\n", sw_r32(RTL838X_SDS_CFG_REG));
-	sw_w32(sds_conf_value, RTL838X_SDS_CFG_REG);
+	/* enable R/W of some protected registers */
+	regmap_write(ctrl->map, RTPCS_838X_INT_RW_CTRL, 0x3);
 
-	pr_info("Configuration of SERDES done\n");
+	regmap_read(ctrl->map, RTPCS_838X_PLL_CML_CTRL, &val);
+	dev_dbg(ctrl->dev, "PLL control register: %x\n", val);
+	regmap_write_bits(ctrl->map, RTPCS_838X_PLL_CML_CTRL, 0xfffffff0,
+			  0xaaaaaaaf & 0xf);
 
+	/* power off and reset all SerDes */
+	regmap_write(ctrl->map, RTPCS_838X_SDS_CFG_REG, 0x3f);
+	regmap_write(ctrl->map, RTPCS_838X_RST_GLB_CTRL_0, 0x10); /* SW_SERDES_RST */
 	return 0;
 }
 
-static void rtl83xx_config_interface(int port, phy_interface_t interface)
+__always_unused
+static int rtpcs_838x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
+				   phy_interface_t mode)
 {
-	u32 old, int_shift, sds_shift;
+	int ret;
 
-	switch (port) {
-	case 24:
-		int_shift = 0;
-		sds_shift = 5;
-		break;
-	case 26:
-		int_shift = 3;
-		sds_shift = 0;
-		break;
-	default:
-		return;
-	}
+	if (sds > 5)
+		return -EINVAL;
+	if (!rtpcs_838x_sds_is_mode_supported(sds, mode))
+		return -EINVAL;
 
-	old = sw_r32(RTL838X_SDS_MODE_SEL);
-	switch (interface) {
-	case PHY_INTERFACE_MODE_1000BASEX:
-		if ((old >> sds_shift & 0x1f) == 4)
-			return;
-		sw_w32_mask(0x7 << int_shift, 1 << int_shift, RTL838X_INT_MODE_CTRL);
-		sw_w32_mask(0x1f << sds_shift, 4 << sds_shift, RTL838X_SDS_MODE_SEL);
-		break;
-	case PHY_INTERFACE_MODE_SGMII:
-		if ((old >> sds_shift & 0x1f) == 2)
-			return;
-		sw_w32_mask(0x7 << int_shift, 2 << int_shift, RTL838X_INT_MODE_CTRL);
-		sw_w32_mask(0x1f << sds_shift, 2 << sds_shift, RTL838X_SDS_MODE_SEL);
-		break;
-	default:
-		return;
-	}
-	pr_debug("configured port %d for interface %s\n", port, phy_modes(interface));
-}
+	rtpcs_838x_sds_power(ctrl, sds, false);
 
-*/
+	/* take reset */
+	rtpcs_sds_write(ctrl, sds, 0x0, 0x0, 0xc00);
+	rtpcs_sds_write(ctrl, sds, 0x0, 0x3, 0x7146);
+
+	ret = rtpcs_838x_sds_set_mode(ctrl, sds, mode);
+	if (ret)
+		return ret;
+
+	rtpcs_838x_sds_patch(ctrl, sds, mode);
+	rtpcs_838x_sds_reset(ctrl, sds);
+	
+	/* release reset */
+	rtpcs_sds_write(ctrl, sds, 0, 3, 0x7106);
+
+	rtpcs_838x_sds_power(ctrl, sds, true);
+	return 0;
+}
 
 /* RTL930X */
 



From lede-commits at lists.infradead.org  Mon Dec  8 15:33:06 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:33:06 -0500
Subject: [openwrt/openwrt]  ramips: mt7621.mk: fix alphabetical ordering some
 Cudy devices
In-Reply-To: <176523678677.2997875.16129932302826479104@git-01.infra.openwrt.org>
References: <176523678677.2997875.16129932302826479104@git-01.infra.openwrt.org>
Message-ID: <mailman.34151.1765236792.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7ff663cc314160d89e0166d210f825bf077243b4

commit 7ff663cc314160d89e0166d210f825bf077243b4
Author: Marcin Leksmark <lexmark3200 at wp.pl>
AuthorDate: Thu Dec 4 17:51:11 2025 +0100

    ramips: mt7621.mk: fix alphabetical ordering some Cudy devices
    
    This PR doesn't change anything other than fixing the alphabetical order of some Cudy devices
    (R700 and c200p)
    
    Signed-off-by: Marcin Leksmark <lexmark3200 at wp.pl>
    Link: https://github.com/openwrt/openwrt/pull/21044
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ramips/image/mt7621.mk | 40 ++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 8ddfed95f5..24a4b87f0a 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -742,6 +742,16 @@ define Device/cudy_ap1300-outdoor-v1
 endef
 TARGET_DEVICES += cudy_ap1300-outdoor-v1
 
+define Device/cudy_c200p
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := C200P
+  IMAGE_SIZE := 15872k
+  UIMAGE_NAME := R74
+  DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls kmod-usb3
+endef
+TARGET_DEVICES += cudy_c200p
+
 define Device/cudy_m1300-v2
   $(Device/dsa-migration)
   IMAGE_SIZE := 15872k
@@ -765,6 +775,16 @@ define Device/cudy_m1800
 endef
 TARGET_DEVICES += cudy_m1800
 
+define Device/cudy_r700
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := R700
+  IMAGE_SIZE := 15872k
+  UIMAGE_NAME := R29
+  DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls
+endef
+TARGET_DEVICES += cudy_r700
+
 define Device/cudy_wr1300-v1
   $(Device/dsa-migration)
   IMAGE_SIZE := 15872k
@@ -811,26 +831,6 @@ define Device/cudy_wr2100
 endef
 TARGET_DEVICES += cudy_wr2100
 
-define Device/cudy_r700
-  $(Device/dsa-migration)
-  DEVICE_VENDOR := Cudy
-  DEVICE_MODEL := R700
-  IMAGE_SIZE := 15872k
-  UIMAGE_NAME := R29
-  DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls
-endef
-TARGET_DEVICES += cudy_r700
-
-define Device/cudy_c200p
-  $(Device/dsa-migration)
-  DEVICE_VENDOR := Cudy
-  DEVICE_MODEL := C200P
-  IMAGE_SIZE := 15872k
-  UIMAGE_NAME := R74
-  DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls kmod-usb3
-endef
-TARGET_DEVICES += cudy_c200p
-
 define Device/cudy_x6-v1
   $(Device/dsa-migration)
   IMAGE_SIZE := 32256k



From lede-commits at lists.infradead.org  Mon Dec  8 15:35:54 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:35:54 -0500
Subject: [openwrt/openwrt]  uboot-envtools: ipq40xx: remove unused function
 ubootenv_mtdinfo()
In-Reply-To: <176523695432.3003879.656245535090513345@git-01.infra.openwrt.org>
References: <176523695432.3003879.656245535090513345@git-01.infra.openwrt.org>
Message-ID: <mailman.34152.1765236960.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/448425261bf4a95afbcdb1a7b0d43b65c7687a56

commit 448425261bf4a95afbcdb1a7b0d43b65c7687a56
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Fri Dec 5 21:16:05 2025 +0800

    uboot-envtools: ipq40xx: remove unused function ubootenv_mtdinfo()
    
    This function is defined but unused. There is no reason to keep it.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21052
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/uboot-tools/uboot-envtools/files/ipq40xx | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/package/boot/uboot-tools/uboot-envtools/files/ipq40xx b/package/boot/uboot-tools/uboot-envtools/files/ipq40xx
index f49e94d295..6f16491747 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/ipq40xx
+++ b/package/boot/uboot-tools/uboot-envtools/files/ipq40xx
@@ -11,25 +11,6 @@ touch /etc/config/ubootenv
 
 board=$(board_name)
 
-ubootenv_mtdinfo () {
-	UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV)
-	mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//')
-	mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}')
-	mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}')
-	nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev})
-
-	if [ -n "$nor_flash" ]; then
-		ubootenv_size=$mtd_size
-	else
-		# size is fixed to 0x40000 in u-boot
-		ubootenv_size=0x40000
-	fi
-
-	sectors=$(( $ubootenv_size / $mtd_erase ))
-	sectors=$(printf "0x%x" $sectors )
-	echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
-}
-
 case "$board" in
 alfa-network,ap120c-ac|\
 devolo,magic-2-wifi-next|\



From lede-commits at lists.infradead.org  Mon Dec  8 15:35:55 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:35:55 -0500
Subject: [openwrt/openwrt]  uboot-envtools: reorganize the initialization
 scripts
In-Reply-To: <176523695432.3003879.656245535090513345@git-01.infra.openwrt.org>
References: <176523695432.3003879.656245535090513345@git-01.infra.openwrt.org>
Message-ID: <mailman.34153.1765236960.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/ac1ee98c458164fa4fe6b7f44950e073f77e1de4

commit ac1ee98c458164fa4fe6b7f44950e073f77e1de4
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Fri Dec 5 21:19:05 2025 +0800

    uboot-envtools: reorganize the initialization scripts
    
    Reorder device names alphabetically and group together the same configs.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21052
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../boot/uboot-tools/uboot-envtools/files/lantiq   |   6 +-
 .../uboot-envtools/files/mediatek_filogic          |  28 +++--
 .../uboot-envtools/files/mediatek_mt7622           |   8 +-
 .../uboot-envtools/files/qualcommax_ipq807x        |  14 +--
 .../boot/uboot-tools/uboot-envtools/files/ramips   | 114 ++++++++++-----------
 .../boot/uboot-tools/uboot-envtools/files/realtek  |   8 +-
 6 files changed, 87 insertions(+), 91 deletions(-)

diff --git a/package/boot/uboot-tools/uboot-envtools/files/lantiq b/package/boot/uboot-tools/uboot-envtools/files/lantiq
index 4e6fb48b76..5fe48d3112 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/lantiq
+++ b/package/boot/uboot-tools/uboot-envtools/files/lantiq
@@ -12,15 +12,13 @@ touch /etc/config/ubootenv
 board=$(board_name)
 
 case "$board" in
-bt,homehub-v2b)
+bt,homehub-v2b|\
+siemens,gigaset-sx76x)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
 	;;
 bt,homehub-v3a)
 	ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "1"
 	;;
-siemens,gigaset-sx76x)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
-	;;
 zyxel,p-2812hnu-f1)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1"
 	;;
diff --git a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
index 9e52025fdb..b7dc08ded2 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
+++ b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
@@ -37,6 +37,7 @@ netcore,n60|\
 netcore,n60-pro|\
 netis,nx31|\
 nokia,ea0326gmp|\
+openwrt,one|\
 qihoo,360t7|\
 routerich,ax3000-ubootmod|\
 snr,snr-cpe-ax2|\
@@ -61,6 +62,15 @@ huasifei,wh3000|\
 nradio,c8-668gl)
 	ubootenv_add_mmc "u-boot-env" "" "0x0" "0x80000"
 	;;
+asiarf,ap7986-003|\
+cetron,ct3003|\
+comfast,cf-wr632ax|\
+edgecore,eap111|\
+netgear,wax220|\
+zbtlink,zbt-z8102ax|\
+zbtlink,zbt-z8103ax)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
+	;;
 asus,rt-ax59u)
 	ubootenv_add_uci_config "/dev/mtd0" "0x100000" "0x20000" "0x20000"
 	;;
@@ -100,15 +110,6 @@ comfast,cf-e393ax|\
 iptime,ax3000m)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x80000"
 	;;
-asiarf,ap7986-003|\
-cetron,ct3003|\
-comfast,cf-wr632ax|\
-edgecore,eap111|\
-netgear,wax220|\
-zbtlink,zbt-z8102ax|\
-zbtlink,zbt-z8103ax)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
-	;;
 dlink,aquila-pro-ai-m30-a1|\
 dlink,aquila-pro-ai-m60-a1)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
@@ -123,14 +124,14 @@ openembed,som7981)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x80000"
 	ubootenv_add_uci_sys_config "/dev/mtd3" "0x0" "0x100000" "0x100000"
 	;;
-openwrt,one)
-	ubootenv_add_ubi_default
-	;;
 smartrg,sdg-8733|\
 smartrg,sdg-8733a|\
 smartrg,sdg-8734)
 	ubootenv_add_mmc "u-boot-env" "mmcblk0" "0x0" "0x8000" "0x8000"
 	;;
+teltonika,rutc50)
+	ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
+	;;
 tplink,archer-ax80-v1|\
 tplink,be450)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "8"
@@ -138,9 +139,6 @@ tplink,be450)
 ubnt,unifi-6-plus)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x10000"
 	;;
-teltonika,rutc50)
-	ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
-	;;
 xiaomi,mi-router-ax3000t|\
 xiaomi,mi-router-wr30u-stock|\
 xiaomi,redmi-router-ax6000-stock)
diff --git a/package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7622 b/package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7622
index 8a053e1cad..51d620fdb0 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7622
+++ b/package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7622
@@ -20,10 +20,6 @@ case "$board" in
 asiarf,ap7622-wh1)
 	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x10000"
 	;;
-dlink,eagle-pro-ai-m32-a1|\
-dlink,eagle-pro-ai-r32-a1)
-	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000"
-	;;
 bananapi,bpi-r64|\
 linksys,e8450-ubi)
 	. /lib/upgrade/fit.sh
@@ -41,6 +37,10 @@ linksys,e8450-ubi)
 buffalo,wsr-2533dhp2)
 	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
 	;;
+dlink,eagle-pro-ai-m32-a1|\
+dlink,eagle-pro-ai-r32-a1)
+	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000"
+	;;
 ruijie,rg-ew3200gx-pro)
 	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
 	;;
diff --git a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
index c022531a06..46a7111c1b 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
+++ b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
@@ -15,6 +15,10 @@ zyxel,nbg7815|\
 zyxel,nwa210ax)
 	ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x10000"
 	;;
+asus,rt-ax89x|\
+qnap,301w)
+	ubootenv_add_mtd "0:appsblenv" "0x0" "0x20000" "0x20000"
+	;;
 dynalink,dl-wrx36|\
 netgear,rax120v2|\
 netgear,sxr80|\
@@ -42,19 +46,15 @@ linksys,mx8500)
 linksys,mx4300)
 	ubootenv_add_mtd "u_env" "0x0" "0x40000" "0x40000"
 	;;
+prpl,haze)
+	ubootenv_add_mmc "0:APPSBLENV" "" "0x0" "0x40000" "0x400" "0x100"
+	;;
 redmi,ax6|\
 xiaomi,ax3600|\
 xiaomi,ax9000)
 	ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x20000"
 	ubootenv_add_sys_mtd "bdata" "0x0" "0x10000" "0x20000"
 	;;
-prpl,haze)
-	ubootenv_add_mmc "0:APPSBLENV" "" "0x0" "0x40000" "0x400" "0x100"
-	;;
-asus,rt-ax89x|\
-qnap,301w)
-	ubootenv_add_mtd "0:appsblenv" "0x0" "0x20000" "0x20000"
-	;;
 spectrum,sax1v1k)
 	ubootenv_add_mmc "0:APPSBLENV" "" "0x0" "0x40000" "0x40000" "1"
 	;;
diff --git a/package/boot/uboot-tools/uboot-envtools/files/ramips b/package/boot/uboot-tools/uboot-envtools/files/ramips
index 4b080b6baa..b5f7858f13 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/ramips
+++ b/package/boot/uboot-tools/uboot-envtools/files/ramips
@@ -36,13 +36,44 @@ plasmacloud,pax1800-lite|\
 yuncore,ax820)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
 	;;
+ampedwireless,ally-00x19k|\
+ampedwireless,ally-r1900k)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
+	;;
 arcadyan,we420223-99|\
 dlink,dir-806a-b1)
 	ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x1000" "0x1000"
 	;;
-ampedwireless,ally-00x19k|\
-ampedwireless,ally-r1900k)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
+asus,rt-ax53u|\
+asus,rt-ax54|\
+asus,4g-ax56|\
+belkin,rt1800|\
+elecom,wrc-x1800gs|\
+h3c,tx1800-plus|\
+h3c,tx1801-plus|\
+h3c,tx1806|\
+iptime,ax2002m|\
+iptime,ax2004m|\
+jcg,q20|\
+linksys,e7350|\
+netgear,eax12|\
+netgear,wax202|\
+netis,n6|\
+zyxel,wsm20)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
+	;;
+beeline,smartbox-flash|\
+iptime,t5004|\
+linksys,ea6350-v4|\
+linksys,ea7300-v1|\
+linksys,ea7300-v2|\
+linksys,ea7500-v2|\
+linksys,ea8100-v1|\
+linksys,ea8100-v2|\
+mts,wg430223|\
+ubnt,edgerouter-x|\
+ubnt,edgerouter-x-sfp)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
 	;;
 beeline,smartbox-giga|\
 beeline,smartbox-turbo|\
@@ -57,6 +88,12 @@ tplink,ec330-g5u-v1|\
 wifire,s1500-nbn)
 	ubootenv_add_mtd "u-boot-env" "0x0" "0x1000" "0x20000"
 	;;
+bolt,arion|\
+xiaomi,mi-router-cr6606|\
+xiaomi,mi-router-cr6608|\
+xiaomi,mi-router-cr6609)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
+	;;
 buffalo,wsr-1166dhp|\
 buffalo,wsr-600dhp|\
 kroks,kndrt31r16|\
@@ -70,23 +107,10 @@ zbtlink,zbt-wg2626|\
 zte,mf283plus)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
 	;;
-asus,rt-ax53u|\
-asus,rt-ax54|\
-asus,4g-ax56|\
-belkin,rt1800|\
-elecom,wrc-x1800gs|\
-h3c,tx1800-plus|\
-h3c,tx1801-plus|\
-h3c,tx1806|\
-iptime,ax2002m|\
-iptime,ax2004m|\
-jcg,q20|\
-linksys,e7350|\
-netgear,eax12|\
-netgear,wax202|\
-netis,n6|\
-zyxel,wsm20)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
+dna,valokuitu-plus-ex400|\
+genexis,pulse-ex400)
+	ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
+	ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
 	;;
 haier,har-20s2u1|\
 sim,simax1800t|\
@@ -98,27 +122,22 @@ hootoo,ht-tm05|\
 ravpower,rp-wd03)
 	ubootenv_add_mtd "u-boot-env" "0x4000" "0x1000" "0x1000"
 	;;
-beeline,smartbox-flash|\
-iptime,t5004|\
-linksys,ea6350-v4|\
-linksys,ea7300-v1|\
-linksys,ea7300-v2|\
-linksys,ea7500-v2|\
-linksys,ea8100-v1|\
-linksys,ea8100-v2|\
-mts,wg430223|\
-ubnt,edgerouter-x|\
-ubnt,edgerouter-x-sfp)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
+netgear,wax214v2)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
+	ubootenv_add_uci_sys_config "/dev/mtd1" "0x20000" "0x8000" "0x20000"
 	;;
 snr,snr-cpe-me1|\
 snr,snr-cpe-me2-sfp|\
 snr,cpe-w4n-mt)
 	ubootenv_add_mtd "uboot-env" "0x0" "0x1000" "0x1000"
 	;;
-xiaomi,miwifi-mini)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
-	ubootenv_add_uci_sys_config "/dev/mtd9" "0x0" "0x4000" "0x10000"
+xiaomi,mi-router-3-pro|\
+xiaomi,mi-router-3g|\
+xiaomi,mi-router-4|\
+xiaomi,mi-router-ac2100|\
+xiaomi,redmi-router-ac2100)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
+	ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
 	;;
 xiaomi,mi-router-3g-v2|\
 xiaomi,mi-router-4a-gigabit|\
@@ -126,13 +145,9 @@ xiaomi,miwifi-3c)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
 	ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
 	;;
-xiaomi,mi-router-3g|\
-xiaomi,mi-router-3-pro|\
-xiaomi,mi-router-4|\
-xiaomi,mi-router-ac2100|\
-xiaomi,redmi-router-ac2100)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
-	ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
+xiaomi,miwifi-mini)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
+	ubootenv_add_uci_sys_config "/dev/mtd9" "0x0" "0x4000" "0x10000"
 	;;
 zyxel,lte3301-plus)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
@@ -142,21 +157,6 @@ zyxel,lte7490-m904|\
 zyxel,nr7101)
 	ubootenv_add_mtd "Config" "0x0" "0x1000" "0x80000"
 	;;
-bolt,arion|\
-xiaomi,mi-router-cr6606|\
-xiaomi,mi-router-cr6608|\
-xiaomi,mi-router-cr6609)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
-	;;
-dna,valokuitu-plus-ex400|\
-genexis,pulse-ex400)
-	ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
-	ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
-	;;
-netgear,wax214v2)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
-	ubootenv_add_uci_sys_config "/dev/mtd1" "0x20000" "0x8000" "0x20000"
-	;;
 esac
 
 config_load ubootenv
diff --git a/package/boot/uboot-tools/uboot-envtools/files/realtek b/package/boot/uboot-tools/uboot-envtools/files/realtek
index 0a03792f8a..ba980363ba 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/realtek
+++ b/package/boot/uboot-tools/uboot-envtools/files/realtek
@@ -31,15 +31,15 @@ zyxel,gs1900-48-a1)
 	ubootenv_add_mtd "u-boot-env" "0x0" "0x400" "0x10000"
 	ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x1000" "0x10000"
 	;;
+iodata,bsh-g24mb)
+	ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
+	ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x3800" "0x10000"
+	;;
 tplink,sg2008p-v1|\
 tplink,sg2210p-v3|\
 tplink,sg2452p-v4)
 	ubootenv_add_mtd "u-boot-env" "0x0" "0x20000" "0x10000"
 	;;
-iodata,bsh-g24mb)
-	ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
-	ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x3800" "0x10000"
-	;;
 *)
 	ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
 	ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x1000" "0x10000"



From lede-commits at lists.infradead.org  Mon Dec  8 15:57:28 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:57:28 -0500
Subject: [openwrt/openwrt]  mediatek: import patch from Mediatek SDK for pcie
In-Reply-To: <176523824855.3072931.5845313295811623112@git-01.infra.openwrt.org>
References: <176523824855.3072931.5845313295811623112@git-01.infra.openwrt.org>
Message-ID: <mailman.34154.1765238252.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7423edb393579992d3a18cd3033469d55f2c43fb

commit 7423edb393579992d3a18cd3033469d55f2c43fb
Author: Maxim Anisimov <maxim.anisimov.ua at gmail.com>
AuthorDate: Tue Nov 11 17:38:21 2025 +0300

    mediatek: import patch from Mediatek SDK for pcie
    
    Without this patch some devices can't detect wifi chip.
    
    Signed-off-by: Maxim Anisimov <maxim.anisimov.ua at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20737
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...pcie-mediatek-gen3-Add-WIFI-HW-reset-flow.patch | 88 ++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/target/linux/mediatek/patches-6.12/966-pcie-mediatek-gen3-Add-WIFI-HW-reset-flow.patch b/target/linux/mediatek/patches-6.12/966-pcie-mediatek-gen3-Add-WIFI-HW-reset-flow.patch
new file mode 100644
index 0000000000..ae60a9645f
--- /dev/null
+++ b/target/linux/mediatek/patches-6.12/966-pcie-mediatek-gen3-Add-WIFI-HW-reset-flow.patch
@@ -0,0 +1,88 @@
+From f566462daef92eb0074013e32d0332116fc3a2eb Mon Sep 17 00:00:00 2001
+From: Jianguo Zhang <jianguo.zhang at mediatek.com>
+Date: Tue, 14 Oct 2025 16:00:03 +0800
+Subject: [PATCH] pcie: mediatek-gen3: Add WIFI HW reset flow
+
+[Description]
+Add WIFI HW reset before PCIe host detects EP device for reboot.
+
+[Release-log]
+NA
+
+Signed-off-by: Jianguo Zhang <jianguo.zhang at mediatek.com>
+---
+ drivers/pci/controller/pcie-mediatek-gen3.c | 29 +++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+--- a/drivers/pci/controller/pcie-mediatek-gen3.c
++++ b/drivers/pci/controller/pcie-mediatek-gen3.c
+@@ -10,6 +10,8 @@
+ #include <linux/clk.h>
+ #include <linux/clk-provider.h>
+ #include <linux/delay.h>
++#include <linux/gpio.h>
++#include <linux/gpio/consumer.h>
+ #include <linux/iopoll.h>
+ #include <linux/irq.h>
+ #include <linux/irqchip/chained_irq.h>
+@@ -18,6 +20,7 @@
+ #include <linux/module.h>
+ #include <linux/msi.h>
+ #include <linux/of_device.h>
++#include <linux/of_gpio.h>
+ #include <linux/of_pci.h>
+ #include <linux/pci.h>
+ #include <linux/phy/phy.h>
+@@ -160,6 +163,8 @@ struct mtk_msi_set {
+  * @phy: PHY controller block
+  * @clks: PCIe clocks
+  * @num_clks: PCIe clocks count for this port
++ * @wifi_reset: reset pin for WIFI chip
++ * @wifi_reset_delay_ms: delay time for WIFI chip reset
+  * @irq: PCIe controller interrupt number
+  * @saved_irq_state: IRQ enable state saved at suspend time
+  * @irq_lock: lock protecting IRQ register access
+@@ -181,6 +186,9 @@ struct mtk_gen3_pcie {
+ 	struct clk_bulk_data *clks;
+ 	int num_clks;
+ 
++	struct gpio_desc *wifi_reset;
++	u32 wifi_reset_delay_ms;
++
+ 	int irq;
+ 	u32 saved_irq_state;
+ 	raw_spinlock_t irq_lock;
+@@ -402,6 +410,12 @@ static int mtk_pcie_startup_port(struct
+ 	val |= PCIE_DISABLE_DVFSRC_VLT_REQ;
+ 	writel_relaxed(val, pcie->base + PCIE_MISC_CTRL_REG);
+ 
++	if (pcie->wifi_reset) {
++		gpiod_set_value_cansleep(pcie->wifi_reset, 1);
++		msleep(pcie->wifi_reset_delay_ms);
++		gpiod_set_value_cansleep(pcie->wifi_reset, 0);
++	}
++
+ 	/* Assert all reset signals */
+ 	val = readl_relaxed(pcie->base + PCIE_RST_CTRL_REG);
+ 	val |= PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB;
+@@ -864,6 +878,20 @@ static int mtk_pcie_parse_port(struct mt
+ 		return pcie->num_clks;
+ 	}
+ 
++	ret = of_property_read_u32(dev->of_node, "wifi-reset-msleep",
++				   &pcie->wifi_reset_delay_ms);
++	if (!ret) {
++		pcie->wifi_reset = devm_gpiod_get_optional(dev, "wifi-reset",
++							   GPIOD_OUT_LOW);
++		if (IS_ERR(pcie->wifi_reset)) {
++			ret = PTR_ERR(pcie->wifi_reset);
++			if (ret != -EPROBE_DEFER)
++				dev_err(dev,
++					"failed to request WIFI reset gpio\n");
++			return ret;
++		}
++	}
++
+ 	return 0;
+ }
+ 



From lede-commits at lists.infradead.org  Mon Dec  8 15:57:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 18:57:29 -0500
Subject: [openwrt/openwrt]  mediatek: add Keenetic KN-1812/Netcraze NC-1812
 support
In-Reply-To: <176523824855.3072931.5845313295811623112@git-01.infra.openwrt.org>
References: <176523824855.3072931.5845313295811623112@git-01.infra.openwrt.org>
Message-ID: <mailman.34157.1765238252.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cc2aefe6195322ce73e2f20b2801352c5be737c5

commit cc2aefe6195322ce73e2f20b2801352c5be737c5
Author: Maxim Anisimov <maxim.anisimov.ua at gmail.com>
AuthorDate: Mon Nov 10 13:58:14 2025 +0300

    mediatek: add Keenetic KN-1812/Netcraze NC-1812 support
    
    This commit adds support for Keenetic KN-1812/Netcraze NC-1812
    
    Device specification
    --------------------
    SoC Type:   MediaTek MT7988D, Cortex-A73, 64-bit
    RAM:        1024MB DDR4 Micron MT40A512M16TB-062E:R
    Flash:      SPI NAND Winbond W25N02KV (256 MiB)
    Ethernet:   4x1GbE (internal MT7988 built-in) + 2.5GbE (internal MT7988 phy) + 10GbE (RTL8261BE)
    
    WLAN:       MT7992AV
    WLAN 2g:    MediaTek MT7975N, b/g/n/ax/be, MIMO 4x4
    WLAN 5g:    MediaTek MT7977B, a/n/ac/ax/be, MIMO 4x4
    LEDs:       5 LEDs, 1 power green, 1 internet green,
                2x fn green, 1 wlan green, gpio-controlled
    Button:     4 (Reset, WPS, FN1, FN2)
    USB port:   Yes, 1xUSB3.2 and 1xUSB2.0 (via GL850G)
    Power:      12 VDC, 3 A
    
    Notes:
     * The device supports dual boot mode
     * Fn2 led reassigned to wlan 2.4
    
    Flash instruction:
    The only way to flash OpenWrt image is to use tftp recovery mode in U-Boot:
    
    1. Configure PC with static IP 192.168.1.2/24 and tftp server.
    2. a) Keenetic
          Rename "openwrt-mediatek-filogic-keenetic_kn-1812-squashfs-factory.bin"
          to "KN-1812_recovery.bin" and place it in tftp server directory.
       b) Netcraze
          Rename "openwrt-mediatek-filogic-netcraze_nc-1812-squashfs-factory.bin"
          to "NC-1812_recovery.bin" and place it in tftp server directory.
    3. Connect PC with ethernet port, press the reset button, power up
       the device and keep button pressed until status led start blinking.
    4. Device will download file from server, write it to flash and reboot.
    
    Signed-off-by: Maxim Anisimov <maxim.anisimov.ua at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20737
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../mediatek/dts/mt7988d-keenetic-kn-1812.dts      |   8 +
 .../mediatek/dts/mt7988d-keenetic-kn-1812.dtsi     | 610 +++++++++++++++++++++
 .../mediatek/dts/mt7988d-netcraze-nc-1812.dts      |   8 +
 .../filogic/base-files/etc/board.d/01_leds         |   6 +
 .../filogic/base-files/etc/board.d/02_network      |   4 +
 target/linux/mediatek/image/filogic.mk             |  35 ++
 6 files changed, 671 insertions(+)

diff --git a/target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dts b/target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dts
new file mode 100644
index 0000000000..aad37191e5
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dts
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+#include "mt7988d-keenetic-kn-1812.dtsi"
+
+/ {
+	model = "Keenetic KN-1812";
+	compatible = "keenetic,kn-1812", "mediatek,mt7988d";
+};
diff --git a/target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dtsi b/target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dtsi
new file mode 100644
index 0000000000..1eb534dbc4
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dtsi
@@ -0,0 +1,610 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7988a.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/mt65xx.h>
+#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
+
+/ {
+	aliases {
+		serial0 = &serial0;
+		label-mac-device = &gmac1;
+		led-boot = &power_led;
+		led-failsafe = &power_led;
+		led-running = &power_led;
+		led-upgrade = &power_led;
+	};
+
+	chosen {
+		stdout-path = &serial0;
+		bootargs = "console=ttyS0,115200n1 pci=pcie_bus_perf";
+	};
+
+	memory at 40000000 {
+		reg = <0x0 0x40000000 0x0 0x40000000>;
+		device_type = "memory";
+	};
+
+	cpus {
+		/delete-node/ cpu at 3;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		button-fn1 {
+			label = "fn1";
+			linux,code = <BTN_0>;
+			gpios = <&pio 29 GPIO_ACTIVE_LOW>;
+		};
+
+		button-fn2 {
+			label = "fn2";
+			linux,code = <BTN_1>;
+			gpios = <&pio 37 GPIO_ACTIVE_LOW>;
+		};
+
+		button-reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 60 GPIO_ACTIVE_LOW>;
+		};
+
+		button-wps {
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&pio 61 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		/* fn1 */
+		led-0 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <0>;
+			gpios = <&pio 42 GPIO_ACTIVE_LOW>;
+		};
+
+		/* fn2 */
+		led-1 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <1>;
+			gpios = <&pio 43 GPIO_ACTIVE_LOW>;
+		};
+
+		/* wifi */
+		led-2 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_WLAN;
+			gpios = <&pio 47 GPIO_ACTIVE_LOW>;
+		};
+
+		/* internet */
+		led-3 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_WAN_ONLINE;
+			gpios = <&pio 48 GPIO_ACTIVE_LOW>;
+		};
+
+		/* power */
+		power_led: led-4 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_POWER;
+			gpios = <&pio 50 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+
+		/* usb2.0 hub GL850G */
+		usbhub {
+			gpio-export,name = "usbhub";
+			gpio-export,output = <1>;
+			gpios = <&pio 34 GPIO_ACTIVE_HIGH>;
+		};
+
+		/* USB2.0 */
+		usb1power {
+			gpio-export,name = "usb1power";
+			gpio-export,output = <1>;
+			gpios = <&pio 44 GPIO_ACTIVE_HIGH>;
+		};
+
+		/* USB3.2 Gen1 */
+		usb2power {
+			gpio-export,name = "usb2power";
+			gpio-export,output = <1>;
+			gpios = <&pio 45 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	virtual_flash {
+		compatible = "mtd-concat";
+		devices = <&firmware1 &storage1 &firmware2 &storage2>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "kernel";
+				reg = <0x0 0x600000>;
+			};
+
+			partition at 400000 {
+				label = "ubi";
+				reg = <0x600000 0x0>;
+			};
+		};
+	};
+};
+
+/* configure uart */
+&serial0 {
+	status = "okay";
+};
+
+/* configure spi-nand */
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_flash_pins>;
+	status = "okay";
+
+	/* Winbond W25N02KV (256M) */
+	spi_nand at 0 {
+		compatible = "spi-nand";
+		reg = <0>;
+
+		spi-max-frequency = <52000000>;
+		spi-rx-bus-width = <4>;
+		spi-tx-bus-width = <4>;
+
+		mediatek,nmbm;
+		mediatek,bmt-max-ratio = <1>;
+		mediatek,bmt-max-reserved-blocks = <64>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			/* bl2 */
+			partition at 0 {
+				label = "preloader";
+				reg = <0x0 0x80000>;
+				read-only;
+			};
+
+			/* fip */
+			partition at 80000 {
+				label = "u-boot";
+				reg = <0x80000 0x200000>;
+				read-only;
+			};
+
+			partition at 280000 {
+				label = "u-config";
+				reg = <0x280000 0x80000>;
+				read-only;
+			};
+
+			partition at 300000 {
+				label = "rf-eeprom";
+				reg = <0x300000 0x400000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory_0: eeprom at 0 {
+						reg = <0x0 0x1e00>;
+					};
+
+					/* lan mac */
+					macaddr_factory_4: macaddr at 4 {
+						reg = <0x4 0x6>;
+					};
+
+					/* 5Ghz mac */
+					macaddr_factory_a: macaddr at a {
+						reg = <0xa 0x6>;
+					};
+
+					/* lan5 mac */
+					macaddr_factory_fffee: macaddr at fffee {
+						reg = <0xfffee 0x6>;
+					};
+
+					/* wan mac */
+					macaddr_factory_ffffa: macaddr at ffffa {
+						reg = <0xffffa 0x6>;
+					};
+				};
+			};
+
+			firmware1: partition at 700000 {
+				label = "firmware_1";
+				reg = <0x700000 0x3800000>;
+			};
+
+			partition at 3f00000 {
+				label = "config_1";
+				reg = <0x3f00000 0x80000>;
+				read-only;
+			};
+
+			partition at 3f80000 {
+				label = "dump";
+				reg = <0x3f80000 0x80000>;
+				read-only;
+			};
+
+			storage1: partition at 4000000 {
+				label = "storage_a";
+				reg = <0x4000000 0x3800000>;
+			};
+
+			partition at 7800000 {
+				label = "u-state";
+				reg = <0x7800000 0x80000>;
+				read-only;
+			};
+
+			partition at 7a80000 {
+				label = "u-config_res";
+				reg = <0x7a80000 0x80000>;
+				read-only;
+			};
+
+			partition at 7b00000 {
+				label = "rf-eeprom_res";
+				reg = <0x7b00000 0x400000>;
+				read-only;
+			};
+
+			firmware2: partition at 7f00000 {
+				label = "firmware_2";
+				reg = <0x7f00000 0x3800000>;
+			};
+
+			partition at b700000 {
+				label = "config_2";
+				reg = <0xb700000 0x80000>;
+				read-only;
+			};
+
+			storage2: partition at b780000 {
+				label = "storage_b";
+				reg = <0xb780000 0x3880000>;
+			};
+		};
+	};
+};
+
+/* configure switch */
+&gmac0 {
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	status = "okay";
+};
+
+/* lan1 */
+&gsw_port0 {
+	label = "lan1";
+};
+
+&gsw_phy0 {
+	pinctrl-names = "gbe-led";
+	pinctrl-0 = <&gbe0_led0_pins>;
+};
+
+&gsw_phy0_led0 {
+	status = "okay";
+	function = LED_FUNCTION_LAN;
+	color = <LED_COLOR_ID_GREEN>;
+};
+
+/* lan2 */
+&gsw_port1 {
+	label = "lan2";
+};
+
+&gsw_phy1 {
+	pinctrl-names = "gbe-led";
+	pinctrl-0 = <&gbe1_led0_pins>;
+};
+
+&gsw_phy1_led0 {
+	status = "okay";
+	function = LED_FUNCTION_LAN;
+	color = <LED_COLOR_ID_GREEN>;
+};
+
+/* lan3 */
+&gsw_port2 {
+	label = "lan3";
+};
+
+&gsw_phy2 {
+	pinctrl-names = "gbe-led";
+	pinctrl-0 = <&gbe2_led0_pins>;
+};
+
+&gsw_phy2_led0 {
+	status = "okay";
+	function = LED_FUNCTION_LAN;
+	color = <LED_COLOR_ID_GREEN>;
+};
+
+/* lan4 */
+&gsw_port3 {
+	label = "lan4";
+};
+
+&gsw_phy3 {
+	pinctrl-names = "gbe-led";
+	pinctrl-0 = <&gbe3_led0_pins>;
+};
+
+&gsw_phy3_led0 {
+	status = "okay";
+	function = LED_FUNCTION_LAN;
+	color = <LED_COLOR_ID_GREEN>;
+};
+
+/* configure wan */
+&gmac1 {
+	nvmem-cells = <&macaddr_factory_ffffa>;
+	nvmem-cell-names = "mac-address";
+	label = "wan";
+	phy-mode = "internal";
+	phy-connection-type = "internal";
+	phy = <&int_2p5g_phy>;
+	status = "okay";
+};
+
+&int_2p5g_phy {
+	pinctrl-names = "i2p5gbe-led";
+	pinctrl-0 = <&i2p5gbe_led0_pins>;
+};
+
+&i2p5gbe_led0 {
+	color = <LED_COLOR_ID_GREEN>;
+	function = LED_FUNCTION_WAN;
+	status = "okay";
+};
+
+/* configure lan5 */
+&eth {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mdio0_pins>;
+	status = "okay";
+};
+
+&mdio_bus {
+	phy27: ethernet-phy at 1b {
+		/* RTL8261BE */
+		compatible = "ethernet-phy-ieee802.3-c45";
+		reg = <0x1b>;
+
+		reset-gpios = <&pio 4 GPIO_ACTIVE_LOW>;
+		reset-assert-us = <100000>;
+		reset-deassert-us = <100000>;
+	};
+};
+
+&gmac2 {
+	nvmem-cells = <&macaddr_factory_fffee>;
+	nvmem-cell-names = "mac-address";
+	label = "lan5";
+	phy-mode = "usxgmii";
+	phy-connection-type = "usxgmii";
+	phy = <&phy27>;
+	status = "okay";
+};
+
+/* configure power supply */
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins>;
+	status = "okay";
+
+	rt5190a_64: rt5190a at 64 {
+		compatible = "richtek,rt5190a";
+		reg = <0x64>;
+
+		vin2-supply = <&rt5190_buck1>;
+		vin3-supply = <&rt5190_buck1>;
+		vin4-supply = <&rt5190_buck1>;
+
+		regulators {
+			rt5190_buck1: buck1 {
+				regulator-name = "rt5190a-buck1";
+				regulator-min-microvolt = <5090000>;
+				regulator-max-microvolt = <5090000>;
+				regulator-allowed-modes =
+				<RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			buck2 {
+				regulator-name = "vcore";
+				regulator-min-microvolt = <600000>;
+				regulator-max-microvolt = <1400000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			rt5190_buck3: buck3 {
+				regulator-name = "vproc";
+				regulator-min-microvolt = <600000>;
+				regulator-max-microvolt = <1400000>;
+				regulator-boot-on;
+			};
+
+			buck4 {
+				regulator-name = "rt5190a-buck4";
+				regulator-min-microvolt = <850000>;
+				regulator-max-microvolt = <850000>;
+				regulator-allowed-modes =
+				<RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo {
+				regulator-name = "rt5190a-ldo";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+		};
+	};
+};
+
+&cpu0 {
+	proc-supply = <&rt5190_buck3>;
+};
+
+&cpu1 {
+	proc-supply = <&rt5190_buck3>;
+};
+
+&cpu2 {
+	proc-supply = <&rt5190_buck3>;
+};
+
+&cci {
+	proc-supply = <&rt5190_buck3>;
+};
+
+/* configure wifi chip */
+&pcie0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie0_1_pins>;
+	wifi-reset-gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+	wifi-reset-msleep = <100>;
+	status = "okay";
+
+	pcie at 0,0 {
+		reg = <0x0000 0 0 0 0>;
+		#address-cells = <3>;
+		#size-cells = <2>;
+
+		mt7996 at 0,0 {
+			reg = <0x0000 0 0 0 0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			nvmem-cells = <&eeprom_factory_0>;
+			nvmem-cell-names = "eeprom";
+			ieee80211-freq-limit = <2400000 2500000>, <5170000 5835000>;
+
+			band at 0 {
+				/* 2.4 GHz */
+				reg = <0>;
+				nvmem-cells = <&macaddr_factory_4>;
+				nvmem-cell-names = "mac-address";
+			};
+
+			band at 1 {
+				/* 5 GHz */
+				reg = <1>;
+				nvmem-cells = <&macaddr_factory_a>;
+				nvmem-cell-names = "mac-address";
+			};
+		};
+	};
+};
+
+/* configure pinmux settings */
+&pio {
+	mdio0_pins: mdio0-pins {
+		mux {
+			function = "eth";
+			groups = "mdc_mdio0";
+		};
+
+		conf {
+			groups = "mdc_mdio0";
+			drive-strength = <MTK_DRIVE_4mA>;
+		};
+	};
+
+	gbe0_led0_pins: gbe0-led0-pins {
+		mux {
+			function = "led";
+			groups = "gbe0_led0";
+		};
+	};
+
+	gbe1_led0_pins: gbe1-led0-pins {
+		mux {
+			function = "led";
+			groups = "gbe1_led0";
+		};
+	};
+
+	gbe2_led0_pins: gbe2-led0-pins {
+		mux {
+			function = "led";
+			groups = "gbe2_led0";
+		};
+	};
+
+	gbe3_led0_pins: gbe3-led0-pins {
+		mux {
+			function = "led";
+			groups = "gbe3_led0";
+		};
+	};
+
+	i2p5gbe_led0_pins: 2p5gbe-led0-pins {
+		mux {
+			function = "led";
+			groups = "2p5gbe_led0";
+		};
+	};
+
+	i2c0_pins: i2c0-pins-g0 {
+		mux {
+			function = "i2c";
+			groups = "i2c0_1";
+		};
+	};
+
+	pcie0_1_pins: pcie0-pins-g1 {
+		mux {
+			function = "pcie";
+			groups = "pcie_2l_0_pereset", "pcie_clk_req_n0_0";
+		};
+	};
+
+	spi0_flash_pins: spi0-flash-pins {
+		mux {
+			function = "spi";
+			groups = "spi0", "spi0_wp_hold";
+		};
+	};
+};
+
+/* configure usb */
+&ssusb1 {
+	status = "okay";
+};
+
+&tphy {
+	status = "okay";
+};
diff --git a/target/linux/mediatek/dts/mt7988d-netcraze-nc-1812.dts b/target/linux/mediatek/dts/mt7988d-netcraze-nc-1812.dts
new file mode 100644
index 0000000000..726e3ce6ee
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7988d-netcraze-nc-1812.dts
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+#include "mt7988d-keenetic-kn-1812.dtsi"
+
+/ {
+	model = "Netcraze NC-1812";
+	compatible = "netcraze,nc-1812", "mediatek,mt7988d";
+};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
index 0ea1a24933..e40e4166cb 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
@@ -103,6 +103,12 @@ iptime,ax3000sm)
 iptime,ax7800m-6e)
 	ucidef_set_led_netdev "wan" "wan" "mdio-bus:06:blue:wan" "eth1" "link tx rx"
 	;;
+keenetic,kn-1812|\
+netcraze,nc-1812)
+	ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:indicator-1" "phy0.0-ap0"
+	ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wlan" "phy0.1-ap0"
+	ucidef_set_led_netdev "internet" "internet" "green:wan-online" "wan" "link"
+	;;
 mercusys,mr80x-v3)
 	ucidef_set_led_netdev "lan1" "lan-1" "green:lan-1" "lan1" "link tx rx"
 	ucidef_set_led_netdev "lan2" "lan-2" "green:lan-2" "lan2" "link tx rx"
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index 8a30fc0b1f..70a4d51588 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -141,6 +141,10 @@ mediatek_setup_interfaces()
 	yuncore,ax835)
 		ucidef_set_interfaces_lan_wan lan wan
 		;;
+	keenetic,kn-1812|\
+	netcraze,nc-1812)
+		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" "wan"
+		;;
 	mediatek,mt7986a-rfb)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan6" "eth1 wan"
 		;;
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 5987872e01..f42514e6c3 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1616,6 +1616,32 @@ define Device/jdcloud_re-cp-03
 endef
 TARGET_DEVICES += jdcloud_re-cp-03
 
+define Device/keenetic_kn-1812-common
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_PACKAGES := kmod-mt7992-firmware kmod-usb3 \
+		mt7988-2p5g-phy-firmware mt7988-wo-firmware
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  KERNEL_SIZE := 6144k
+  IMAGE_SIZE := 229888k
+  KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \
+	append-squashfs4-fakeroot
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  IMAGES += factory.bin
+  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \
+	append-ubi | check-size | zyimage -d $$(ZYIMAGE_ID) -v "$$(DEVICE_MODEL)"
+endef
+
+define Device/keenetic_kn-1812
+  DEVICE_VENDOR := Keenetic
+  DEVICE_MODEL := KN-1812
+  DEVICE_DTS := mt7988d-keenetic-kn-1812
+  ZYIMAGE_ID := 0x801812
+  $(call Device/keenetic_kn-1812-common)
+endef
+TARGET_DEVICES += keenetic_kn-1812
+
 define Device/keenetic_kn-3711
   DEVICE_VENDOR := Keenetic
   DEVICE_MODEL := KN-3711
@@ -2030,6 +2056,15 @@ define Device/netcore_n60-pro
 endef
 TARGET_DEVICES += netcore_n60-pro
 
+define Device/netcraze_nc-1812
+  DEVICE_VENDOR := Netcraze
+  DEVICE_MODEL := NC-1812
+  DEVICE_DTS := mt7988d-netcraze-nc-1812
+  ZYIMAGE_ID := 0xC01812
+  $(call Device/keenetic_kn-1812-common)
+endef
+TARGET_DEVICES += netcraze_nc-1812
+
 define Device/netgear_eax17
   DEVICE_VENDOR := NETGEAR
   DEVICE_MODEL := EAX17



From lede-commits at lists.infradead.org  Mon Dec  8 16:04:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 19:04:43 -0500
Subject: [openwrt/openwrt]  gpio-button-hotplug: some modern cleanups
In-Reply-To: <176523868347.3097283.16189201584189995558@git-01.infra.openwrt.org>
References: <176523868347.3097283.16189201584189995558@git-01.infra.openwrt.org>
Message-ID: <mailman.34158.1765238691.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/05cd169cd49e99ce8f022892e4ba119312e1a8f7

commit 05cd169cd49e99ce8f022892e4ba119312e1a8f7
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Tue Dec 2 15:19:10 2025 -0800

    gpio-button-hotplug: some modern cleanups
    
    devm_kmalloc_array addition.
    
    of_property_present instead of boolean hack.
    
    for_each_available_child_of_node_scoped to avoid of_node_put.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21033
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../gpio-button-hotplug/src/gpio-button-hotplug.c  | 28 +++++++++-------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index d0e35bedee..d0e3723311 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -363,38 +363,34 @@ static irqreturn_t button_handle_irq(int irq, void *_bdata)
 static struct gpio_keys_platform_data *
 gpio_keys_get_devtree_pdata(struct device *dev)
 {
-	struct device_node *node, *pp;
+	struct device_node *node = dev->of_node;
 	struct gpio_keys_platform_data *pdata;
-	struct gpio_keys_button *button;
 	int nbuttons;
 	int i = 0;
 
-	node = dev->of_node;
-	if (!node)
-		return NULL;
-
 	nbuttons = of_get_available_child_count(node);
 	if (nbuttons == 0)
 		return ERR_PTR(-EINVAL);
 
-	pdata = devm_kzalloc(dev, sizeof(*pdata) + nbuttons * (sizeof *button),
-		GFP_KERNEL);
+	pdata = devm_kzalloc(dev, sizeof(struct gpio_keys_platform_data), GFP_KERNEL);
 	if (!pdata)
 		return ERR_PTR(-ENOMEM);
 
-	pdata->buttons = (struct gpio_keys_button *)(pdata + 1);
+	pdata->buttons = devm_kmalloc_array(dev, nbuttons, sizeof(struct gpio_keys_button), GFP_KERNEL);
+	if (!pdata->buttons)
+		return ERR_PTR(-ENOMEM);
+
 	pdata->nbuttons = nbuttons;
 
-	pdata->rep = !!of_get_property(node, "autorepeat", NULL);
+	pdata->rep = of_property_present(node, "autorepeat");
 	of_property_read_u32(node, "poll-interval", &pdata->poll_interval);
 
-	for_each_available_child_of_node(node, pp) {
-		button = (struct gpio_keys_button *)(&pdata->buttons[i++]);
+	for_each_available_child_of_node_scoped(node, pp) {
+		struct gpio_keys_button *button = (struct gpio_keys_button *)&pdata->buttons[i++];
 
 		if (of_property_read_u32(pp, "linux,code", &button->code)) {
 			dev_err(dev, "Button node '%s' without keycode\n",
 				pp->full_name);
-			of_node_put(pp);
 			return ERR_PTR(-EINVAL);
 		}
 
@@ -403,7 +399,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
 		if (of_property_read_u32(pp, "linux,input-type", &button->type))
 			button->type = EV_KEY;
 
-		button->wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL);
+		button->wakeup = of_property_present(pp, "gpio-key,wakeup");
 
 		if (of_property_read_u32(pp, "debounce-interval",
 					&button->debounce_interval))
@@ -470,9 +466,7 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
 		return -ENOMEM;
 	}
 
-	bdev = devm_kzalloc(dev, sizeof(struct gpio_keys_button_dev) +
-		       pdata->nbuttons * sizeof(struct gpio_keys_button_data),
-		       GFP_KERNEL);
+	bdev = devm_kzalloc(dev, struct_size(bdev, data, pdata->nbuttons), GFP_KERNEL);
 	if (!bdev) {
 		dev_err(dev, "no memory for private data\n");
 		return -ENOMEM;



From lede-commits at lists.infradead.org  Mon Dec  8 16:13:46 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 19:13:46 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: add support for Kebidumei
 AX3000-U22
In-Reply-To: <176523922669.3156156.12340719126810782178@git-01.infra.openwrt.org>
References: <176523922669.3156156.12340719126810782178@git-01.infra.openwrt.org>
Message-ID: <mailman.34163.1765239231.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/011890ad930a7696111b9004924657e7301443ce

commit 011890ad930a7696111b9004924657e7301443ce
Author: Pawel Dembicki <paweldembicki at gmail.com>
AuthorDate: Thu Oct 2 15:49:17 2025 +0200

    mediatek: filogic: add support for Kebidumei AX3000-U22
    
    Kebidumei AX3000-U22 is one of many clones of the same range extender
    that can be found on Aliexpress or other Chinese portals.
    
    The easiest way to identify this model is by searching for "AX3000
    Repeater" and picking the device that looks like mine [0].
    
    Specification:
    - SoC:     MediaTek MT7981B (1.3 GHz)
    - RAM:     256 MB
    - Flash:   16 MB SPI NOR
    - Ports:   1 x 1 GbE
    - Antenna: 6 (2 fake)
    - WiFi:    MediaTek dual-band WiFi 6
      - 2.4 GHz: b/g/n/ax, MIMO 2x2
      - 5 GHz:   a/n/ac/ax, MIMO 2x2
    - Buttons: Reset & WPS
    - LEDs:    Ethernet (green), Status (red, green, blue)
    - Power:   110?240 V AC (internal PSU, board uses 12 V DC)
    - Serial:  unmarked connector on PCB
               [1: Vcc, 2: RX, 3: TX, 4: GND]
    
    Install via OEM web UI:
    1. Use reset button to perform factory reset.
    2. Connect PC to LAN port and obtain DHCP address.
    3. Upload the sysupgrade image via OEM firmware upgrade page,
       e.g. http://192.168.18.1/upgrade.html
    4. After reboot, hold reset button to clear leftover vendor config.
    
    Install via serial:
    1. Connect serial console (115200 8N1).
    2. Enter the console.
    3. Backup mtd4 partition if you want to restore OEM FW later.
    4. Download image.
    5. Run 'sysupgrade -n'.
    
    Revert to stock:
    1. Run sysupgrade without keeping config using mtd4 backup.
    
    [0] https://openwrt.org/_media/media/kebidumei_ax3000-u22.png
    
    Signed-off-by: Pawel Dembicki <paweldembicki at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20287
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../mediatek/dts/mt7981b-kebidumei-ax3000-u22.dts  | 192 +++++++++++++++++++++
 .../filogic/base-files/etc/board.d/01_leds         |   1 +
 .../filogic/base-files/etc/board.d/02_network      |   1 +
 .../filogic/base-files/lib/upgrade/platform.sh     |   1 +
 target/linux/mediatek/image/filogic.mk             |  15 ++
 5 files changed, 210 insertions(+)

diff --git a/target/linux/mediatek/dts/mt7981b-kebidumei-ax3000-u22.dts b/target/linux/mediatek/dts/mt7981b-kebidumei-ax3000-u22.dts
new file mode 100644
index 0000000000..63a87bb0b7
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-kebidumei-ax3000-u22.dts
@@ -0,0 +1,192 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include "mt7981b.dtsi"
+
+/ {
+	model = "Kebidumei AX3000-U22";
+	compatible = "kebidumei,ax3000-u22", "mediatek,mt7981b";
+
+	aliases {
+		label-mac-device = &gmac1;
+
+		led-boot = &led_status_green;
+		led-failsafe = &led_status_red;
+		led-running = &led_status_green;
+		led-upgrade = &led_status_green;
+
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory at 40000000 {
+		reg = <0 0x40000000 0 0x10000000>;
+		device_type = "memory";
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+		};
+		wps {
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led-0 {
+			function = LED_FUNCTION_LAN;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+		};
+
+		led_status_red: led-1 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
+		};
+
+		led-2 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 35 GPIO_ACTIVE_LOW>;
+		};
+
+		led_status_green: led-3 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&pio 34 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&watchdog {
+	status = "okay";
+};
+
+&eth {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mdio_pins>;
+
+	status = "okay";
+
+	gmac1: mac at 1 {
+		compatible = "mediatek,eth-mac";
+		reg = <1>;
+		phy-mode = "gmii";
+		phy-handle = <&int_gbe_phy>;
+		nvmem-cells = <&macaddr_factory_e000 0>;
+		nvmem-cell-names = "mac-address";
+	};
+};
+
+&spi2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi2_flash_pins>;
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "bl2";
+				reg = <0x00000 0x40000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "u-boot-env";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				label = "factory";
+				reg = <0x50000 0xb0000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory_0: eeprom at 0 {
+						reg = <0x0 0x1000>;
+					};
+
+					macaddr_factory_e000: macaddr at e000 {
+						compatible = "mac-base";
+						reg = <0xe000 0x6>;
+						#nvmem-cell-cells = <1>;
+					};
+
+				};
+			};
+
+			partition at 100000 {
+				label = "fip";
+				reg = <0x100000 0x80000>;
+				read-only;
+			};
+
+			partition at 180000 {
+				compatible = "denx,fit";
+				label = "firmware";
+				reg = <0x180000 0xe80000>;
+			};
+		};
+	};
+};
+
+&pio {
+	spi2_flash_pins: spi2-pins {
+		mux {
+			function = "spi";
+			groups = "spi2", "spi2_wp_hold";
+		};
+
+		conf-pu {
+			pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
+		};
+
+		conf-pd {
+			pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
+		};
+	};
+};
+
+&wifi {
+	status = "okay";
+
+	nvmem-cells = <&eeprom_factory_0>;
+	nvmem-cell-names = "eeprom";
+};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
index e40e4166cb..a117c8ba7c 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
@@ -58,6 +58,7 @@ bananapi,bpi-r4-lite)
 	ucidef_set_led_netdev "sfp0" "sfp0" "green:sfp" "sfp0" "link tx rx"
 	;;
 cudy,re3000-v1|\
+kebidumei,ax3000-u22|\
 wavlink,wl-wn573hx3)
 	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" "link tx rx"
 	;;
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index 70a4d51588..70ac202855 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -107,6 +107,7 @@ mediatek_setup_interfaces()
 	cudy,ap3000outdoor-v1|\
 	cudy,ap3000-v1|\
 	cudy,re3000-v1|\
+	kebidumei,ax3000-u22|\
 	netgear,eax17|\
 	netgear,wax220|\
 	openfi,6c|\
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index e4c60ce0d4..a320c67987 100755
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -157,6 +157,7 @@ platform_do_upgrade() {
 		;;
 	cudy,re3000-v1|\
 	cudy,wr3000-v1|\
+	kebidumei,ax3000-u22|\
 	totolink,x6000r|\
 	wavlink,wl-wn573hx3|\
 	widelantech,wap430x|\
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index f42514e6c3..fc4839bea1 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1616,6 +1616,21 @@ define Device/jdcloud_re-cp-03
 endef
 TARGET_DEVICES += jdcloud_re-cp-03
 
+define Device/kebidumei_ax3000-u22
+  DEVICE_VENDOR := Kebidumei
+  DEVICE_MODEL := AX3000-U22
+  DEVICE_DTS := mt7981b-kebidumei-ax3000-u22
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_DTS_LOADADDR := 0x43f00000
+  IMAGE_SIZE := 14848k
+  KERNEL_LOADADDR := 0x44000000
+  KERNEL := kernel-bin | lzma | \
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+  SUPPORTED_DEVICES += mediatek,mt7981-spim-nor-rfb
+endef
+TARGET_DEVICES += kebidumei_ax3000-u22
+
 define Device/keenetic_kn-1812-common
   DEVICE_DTS_DIR := ../dts
   DEVICE_PACKAGES := kmod-mt7992-firmware kmod-usb3 \



From lede-commits at lists.infradead.org  Mon Dec  8 16:16:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 19:16:20 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: replace spaces with tabs for
 indentation
In-Reply-To: <176523938055.3180403.13546869956209809716@git-01.infra.openwrt.org>
References: <176523938055.3180403.13546869956209809716@git-01.infra.openwrt.org>
Message-ID: <mailman.34166.1765239385.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/26ff8efc8a051c3f0987ac320469f8e8e9284246

commit 26ff8efc8a051c3f0987ac320469f8e8e9284246
Author: Brian Lee <larte332 at gmail.com>
AuthorDate: Wed Dec 3 13:57:28 2025 +0900

    mediatek: filogic: replace spaces with tabs for indentation
    
    This commit replaces the 7-8 spaces with 1 tab to modify the indentation appropriately.
    
    Signed-off-by: Brian Lee <larte332 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21018
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mediatek/image/filogic.mk | 84 +++++++++++++++++-----------------
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index fc4839bea1..89270729a0 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -154,9 +154,9 @@ define Device/abt_asr3000
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
   ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot abt_asr3000
@@ -243,9 +243,9 @@ define Device/acer_predator-w6x-ubootmod
   UBOOTENV_IN_UBI := 1
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
   ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot acer_predator-w6x
@@ -359,7 +359,7 @@ define Device/arcadyan_mozart
   KERNEL_LOADADDR := 0x46000000
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   KERNEL_INITRAMFS_SUFFIX := .itb
   IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
   IMAGES := sysupgrade.itb
@@ -436,9 +436,9 @@ define Device/asus_tuf-ax4200q
   DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
   IMAGES := sysupgrade.bin
   KERNEL := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 ifeq ($(IB),)
 ifeq ($(CONFIG_TARGET_INITRAMFS_FORCE),y)
@@ -594,8 +594,8 @@ endif
     fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \
     pad-rootfs | append-metadata
   ARTIFACTS := \
-       emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
-       snand-factory.bin snand-preloader.bin snand-bl31-uboot.fip
+	emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
+	snand-factory.bin snand-preloader.bin snand-bl31-uboot.fip
   ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
   ARTIFACT/emmc-preloader.bin := mt7986-bl2 emmc-ddr4
   ARTIFACT/emmc-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-mini-emmc
@@ -695,7 +695,7 @@ define Device/bananapi_bpi-r4-lite
   KERNEL_LOADADDR := 0x40000000
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGES := sysupgrade.itb
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL_IN_UBI := 1
@@ -873,9 +873,9 @@ define Device/comfast_cf-e393ax
   DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
   KERNEL_LOADADDR := 0x44000000
   KERNEL = kernel-bin | lzma | \
-       fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS = kernel-bin | lzma | \
-       fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
   UBINIZE_OPTS := -E 5
   BLOCKSIZE := 128k
   PAGESIZE := 2048
@@ -1407,9 +1407,9 @@ define Device/h3c_magic-nx30-pro
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
@@ -1460,9 +1460,9 @@ define Device/imou_hx21
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
   ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot imou_hx21
@@ -1538,7 +1538,7 @@ define Device/iptime_ax3000m
   KERNEL := kernel-bin | lzma | \
 	    fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGES := factory.bin sysupgrade.bin
   IMAGE/factory.bin := sysupgrade-tar | append-metadata | check-size | iptime-crc32 ax3000m
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
@@ -1580,9 +1580,9 @@ define Device/jcg_q30-pro
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
@@ -1865,7 +1865,7 @@ define Device/mediatek_mt7987a-rfb
   KERNEL_LOADADDR := 0x40000000
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGES := sysupgrade.itb
   KERNEL_INITRAMFS_SUFFIX := .itb
   KERNEL_IN_UBI := 1
@@ -2037,9 +2037,9 @@ define Device/netcore_n60
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3
@@ -2061,9 +2061,9 @@ define Device/netcore_n60-pro
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
@@ -2180,9 +2180,9 @@ define Device/nokia_ea0326gmp
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
   ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot nokia_ea0326gmp
@@ -2230,7 +2230,7 @@ define Device/openfi_6c
   DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3
   KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
 TARGET_DEVICES += openfi_6c
@@ -2295,9 +2295,9 @@ define Device/qihoo_360t7
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
@@ -2426,9 +2426,9 @@ define Device/tenbay_wr3000k
   IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   KERNEL = kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS = kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
 endef
 TARGET_DEVICES += tenbay_wr3000k
 
@@ -2499,7 +2499,7 @@ define Device/tplink_fr365-v1
   KERNEL_IN_UBI := 1
   IMAGES += factory.bin
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/factory.ubi := append-ubi | check-size $$$$(IMAGE_SIZE)
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   DEVICE_PACKAGES := fitblk kmod-sfp kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
@@ -2518,9 +2518,9 @@ define Device/tplink_tl-xdr-common
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | append-metadata
   DEVICE_PACKAGES := fitblk kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3
@@ -2725,9 +2725,9 @@ define Device/xiaomi_mi-router-ax3000t-ubootmod
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
   ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-ax3000t
@@ -2774,9 +2774,9 @@ define Device/xiaomi_mi-router-wr30u-ubootmod
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
   ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-wr30u
@@ -2823,9 +2823,9 @@ define Device/xiaomi_redmi-router-ax6000-ubootmod
   UBOOTENV_IN_UBI := 1
   KERNEL := kernel-bin | gzip
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
   ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot xiaomi_redmi-router-ax6000
@@ -2955,9 +2955,9 @@ define Device/zyxel_ex5601-t0-ubootmod
   UBOOTENV_IN_UBI := 1
   KERNEL := kernel-bin | lzma
   KERNEL_INITRAMFS := kernel-bin | lzma | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
   IMAGE/sysupgrade.itb := append-kernel | \
-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   ARTIFACTS := preloader.bin bl31-uboot.fip
   ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-4k-ddr4
   ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot zyxel_ex5601-t0



From lede-commits at lists.infradead.org  Mon Dec  8 16:18:17 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 19:18:17 -0500
Subject: [openwrt/openwrt]  ath79: moxa,awk-1137c: use nvmem for calibration
In-Reply-To: <176523949777.3199256.1611666003612447250@git-01.infra.openwrt.org>
References: <176523949777.3199256.1611666003612447250@git-01.infra.openwrt.org>
Message-ID: <mailman.34171.1765239501.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6b961303e0d919dddb7dd500ed2e20f559d26b63

commit 6b961303e0d919dddb7dd500ed2e20f559d26b63
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Wed Oct 22 18:02:12 2025 -0700

    ath79: moxa,awk-1137c: use nvmem for calibration
    
    Userspace handling is deprecated.
    
    Use led-sources for simplicity.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21026
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts   | 31 ++++++++++++++--------
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  4 ---
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |  4 +++
 3 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts b/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts
index d67e9f2a52..dc1603048e 100644
--- a/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts
+++ b/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts
@@ -48,26 +48,18 @@
 		};
 
 		led-2 {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_WLAN;
-			function-enumerator = <0>;
-			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy0tpt";
-		};
-
-		led-3 {
 			color = <LED_COLOR_ID_GREEN>;
 			function = LED_FUNCTION_WAN;
 			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
 		};
 
-		led-4 {
+		led-3 {
 			color = <LED_COLOR_ID_GREEN>;
 			function = LED_FUNCTION_LAN;
 			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
 		};
 
-		led-5 {
+		led-4 {
 			color = <LED_COLOR_ID_YELLOW>;
 			function = LED_FUNCTION_WLAN;
 			function-enumerator = <1>;
@@ -157,6 +149,16 @@
 				label = "art";
 				reg = <0xfe0000 0x010000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					cal_art_1000: calibration at 1000 {
+						reg = <0x1000 0x440>;
+					};
+				};
 			};
 
 			partition at ff0000 {
@@ -174,5 +176,12 @@
 
 &wmac {
 	status = "okay";
-	qca,no-eeprom;
+
+	nvmem-cells = <&cal_art_1000>;
+	nvmem-cell-names = "calibration";
+
+	led {
+		led-sources = <12>;
+		led-active-low;
+	};
 };
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index ed2b846433..eb9aec1361 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -15,10 +15,6 @@ case "$FIRMWARE" in
 	avm,fritzdvbc)
 		caldata_extract_reverse "urlader" 0x1541 0x440
 		;;
-	moxa,awk-1137c)
-		caldata_extract "art" 0x1000 0x440
-		ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)
-		;;
 	*)
 		caldata_die "board $board is not supported yet"
 		;;
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index e3336174d5..aaef2fc15f 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -80,6 +80,10 @@ case "$board" in
 		# which would allow to patch the macaddress
 		macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" $PHYNBR > /sys${DEVPATH}/macaddress
 		;;
+	moxa,awk-1137c)
+		[ "$PHYNBR" -eq 0 ] && \
+			mtd_get_mac_ascii u-boot-env mac_addr > /sys${DEVPATH}/macaddress
+		;;
 	dlink,dir-842-c1|\
 	dlink,dir-842-c2|\
 	dlink,dir-842-c3|\



From lede-commits at lists.infradead.org  Mon Dec  8 16:21:51 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 19:21:51 -0500
Subject: [openwrt/openwrt]  ath79: meraki_mr1[26]: userspace cal to nvmem
In-Reply-To: <176523971188.3233395.11427159069246861356@git-01.infra.openwrt.org>
References: <176523971188.3233395.11427159069246861356@git-01.infra.openwrt.org>
Message-ID: <mailman.34172.1765239715.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b182f2e0b4d44bbc373adefc649a20a28fc5e262

commit b182f2e0b4d44bbc373adefc649a20a28fc5e262
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Feb 16 21:27:05 2024 -0800

    ath79: meraki_mr1[26]: userspace cal to nvmem
    
    Userspace handling is deprecated.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21002
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ath79/dts/ar7161_meraki_mr16.dts      | 30 +++++++++++++++-------
 target/linux/ath79/dts/ar7242_meraki_mr12.dts      | 17 +++++++++---
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         | 23 -----------------
 3 files changed, 34 insertions(+), 36 deletions(-)

diff --git a/target/linux/ath79/dts/ar7161_meraki_mr16.dts b/target/linux/ath79/dts/ar7161_meraki_mr16.dts
index 0353a558f9..25f29b8323 100644
--- a/target/linux/ath79/dts/ar7161_meraki_mr16.dts
+++ b/target/linux/ath79/dts/ar7161_meraki_mr16.dts
@@ -74,22 +74,20 @@
 &pcie0 {
 	status = "okay";
 
-	ath9k0: wifi at 11,0 { /* 2.4 GHz */
+	wifi at 11,0 { /* 2.4 GHz */
 		compatible = "pci168c,0029";
 		reg = <0x8800 0 0 0 0>;
-		qca,no-eeprom;
-		nvmem-cells = <&macaddr_config_66 1>;
-		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&macaddr_config_66 1>, <&cal_art_11000>;
+		nvmem-cell-names = "mac-address", "calibration";
 		#gpio-cells = <2>;
 		gpio-controller;
 	};
 
-	ath9k1: wifi at 12,0 { /* 5 GHz */
+	wifi at 12,0 { /* 5 GHz */
 		compatible = "pci168c,0029";
 		reg = <0x9000 0 0 0 0>;
-		qca,no-eeprom;
-		nvmem-cells = <&macaddr_config_66 2>;
-		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&macaddr_config_66 2>, <&cal_art_15000>;
+		nvmem-cell-names = "mac-address", "calibration";
 		#gpio-cells = <2>;
 		gpio-controller;
 	};
@@ -139,7 +137,7 @@
 				read-only;
 			};
 
-			config: partition at 80000 {
+			partition at 80000 {
 				label = "config";
 				reg = <0x80000 0x20000>;
 				read-only;
@@ -167,6 +165,20 @@
 				label = "art";
 				reg = <0xfe0000 0x20000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					cal_art_11000: calibration at 11000 {
+						reg = <0x11000 0xeb8>;
+					};
+
+					cal_art_15000: calibration at 15000 {
+						reg = <0x15000 0xeb8>;
+					};
+				};
 			};
 		};
 	};
diff --git a/target/linux/ath79/dts/ar7242_meraki_mr12.dts b/target/linux/ath79/dts/ar7242_meraki_mr12.dts
index 2ab6f8aaf3..39fd41e7a8 100644
--- a/target/linux/ath79/dts/ar7242_meraki_mr12.dts
+++ b/target/linux/ath79/dts/ar7242_meraki_mr12.dts
@@ -77,9 +77,8 @@
 	wifi at 0,0 {
 		compatible = "pci168c,002a";
 		reg = <0x0000 0 0 0 0>;
-		qca,no-eeprom;
-		nvmem-cells = <&macaddr_config_66 1>;
-		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&macaddr_config_66 1>, <&cal_art_11000>;
+		nvmem-cell-names = "mac-address", "calibration";
 	};
 };
 
@@ -139,7 +138,7 @@
 				read-only;
 			};
 
-			config: partition at 80000 {
+			partition at 80000 {
 				label = "config";
 				reg = <0x80000 0x20000>;
 				read-only;
@@ -167,6 +166,16 @@
 				label = "art";
 				reg = <0xfe0000 0x20000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					cal_art_11000: calibration at 11000 {
+						reg = <0x11000 0xeb8>;
+					};
+				};
 			};
 		};
 	};
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index eb9aec1361..a8443cf163 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -25,9 +25,6 @@ case "$FIRMWARE" in
 	avm,fritz300e)
 		caldata_extract_reverse "urloader" 0x1541 0x440
 		;;
-	meraki,mr12)
-		caldata_extract "art" 0x11000 0xeb8
-		;;
 	wd,mynet-wifi-rangeextender)
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(nvram get wl0_hwaddr)
@@ -37,24 +34,4 @@ case "$FIRMWARE" in
 		;;
 	esac
 	;;
-"ath9k-eeprom-pci-0000:00:11.0.bin")
-	case $board in
-	meraki,mr16)
-		caldata_extract "art" 0x11000 0xeb8
-		;;
-	*)
-		caldata_die "board $board is not supported yet"
-		;;
-	esac
-	;;
-"ath9k-eeprom-pci-0000:00:12.0.bin")
-	case $board in
-	meraki,mr16)
-		caldata_extract "art" 0x15000 0xeb8
-		;;
-	*)
-		caldata_die "board $board is not supported yet"
-		;;
-	esac
-	;;
 esac



From lede-commits at lists.infradead.org  Mon Dec  8 16:31:04 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 19:31:04 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: add support Netcore
 NX30V2/N30PRO/POWER30AX/W7/GW3001
In-Reply-To: <176524026416.3311453.1574411745089765834@git-01.infra.openwrt.org>
References: <176524026416.3311453.1574411745089765834@git-01.infra.openwrt.org>
Message-ID: <mailman.34175.1765240269.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/344bb7f9162b76a864cec1ebd069651a9c2483cf

commit 344bb7f9162b76a864cec1ebd069651a9c2483cf
Author: Zhiwei Cao <bfdeh at 126.com>
AuthorDate: Fri Apr 25 11:03:56 2025 +0800

    mediatek: filogic: add support Netcore NX30V2/N30PRO/POWER30AX/W7/GW3001
    
    Hardware specification:
      SoC: MediaTek MT7981B
      Flash: ESMT F50L1G41LB 128MB
      RAM: ESMT M15T2G16128A DDR3 256MB
      Ethernet: 3x 1G
      Button: Reset, WPS
    
    MAC addresses
      LAN:  Label MAC (stored in Factory partition offset 0x1fef20)
      WAN:  LAN + 1
      WiFi: LAN
    
    Official LED layout, from left to right:
      [power] [internet] [wps] [wifi] [lan3/2/1] [wan]
    
    Redefinition for OpenWrt:
      [power]: used for led-boot, led-failsafe, and led-running
      [internet]: used for WAN RX/TX indication
      [wps]: used for led-upgrade
      [wifi] and [lan3/2/1]: unchanged
      [wan]: used for WAN link indication
    
    Installing OpenWrt:
      - Setup a tftp server on your PC. Copy
        xxx-preloader.bin, xxx-bl31-uboot.fip and
        xxx-initramfs.itb to tftp root directory.
      - Connect to the router via ssh or telnet,
        username: useradmin, password is the web
        login password of the router.
      - Backup all critical flash partitions with
        the following commands where x.x.x.x is
        the IP of your PC.
    
        IP=x.x.x.x
        cd /dev
        for d in /sys/class/mtd/mtd?; do
          if [ "$(cat $d/name)" = "BL2" ]; then
            tftp -l $(basename $d) -r bl2.img -p $IP
          elif [ "$(cat $d/name)" = "FIP" ]; then
            tftp -l $(basename $d) -r fip.bin -p $IP
          elif [ "$(cat $d/name)" = "Factory" ]; then
            tftp -l $(basename $d) -r factory.bin -p $IP
          fi
        done
        for d in /sys/devices/virtual/ubi/ubi0/ubi0_*; do
          [ "$(cat $d/name)" != "customer" ] && continue
          tftp -l $(basename $d) -r customer -p $IP
          break
        done
    
      - Flash with the following commands:
    
         cd /tmp
         tftp -r xxx-preloader.bin -g x.x.x.x
         tftp -r xxx-bl31-uboot.fip -g x.x.x.x
         mtd write xxx-preloader.bin spi0.0
         mtd write xxx-bl31-uboot.fip FIP
         mtd erase ubi
    
      - Set a static ip(192.168.1.254) for your PC.
        And then reboot the router. It will run
        initramfs image automatically.
      - After openwrt boots up, perform sysupgrade
        via web UI.
    
    Reverting to the vendor firmware:
      - Setup a tftp server on your PC with ip
        address 192.168.1.254. And make sure
        bl2.img, fip.bin, factory.bin and customer
        are located in tftp root directory.
      - Power off the router.
      - Press and hold WPS key, then power on
        the router.
      - Release WPS key, when internet/wifi/wps
        leds are blinking.
      - Wait until internet/wifi/wps leds light
        up, power off the router.
      - Press and hold reset key, power up the
        router, release reset key 15s later.
      - Connect to http://192.168.1.1, now you
        can upload vendor .bin firmware.
    
    Uboot netconsole:
      Uboot netconsole can be enabled by WPS
      or reset key.
    
      - Setup a linux PC with ip 192.168.1.254.
        Open a new terminal and execute
        'stty -isig -echo cbreak; nc -lup 6666'
      - Press and hold WPS(or reset) key, then
        power on the router.
      - Release key once internet/wifi/wps leds
        are all on.
        NOTE: don't hold the key more than 5s
        after internet/wifi/wps leds on, or it
        will try to revert to vendor firmware.
      - 5s later, uboot bootmenu will show on
        the terminal.
    
    Signed-off-by: Zhiwei Cao <bfdeh at 126.com>
    Link: https://github.com/openwrt/openwrt/pull/18631
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/uboot-mediatek/Makefile               |  13 +
 .../patches/461-add-netis-nx30v2.patch             | 390 +++++++++++++++++++++
 .../uboot-envtools/files/mediatek_filogic          |   1 +
 .../linux/mediatek/dts/mt7981b-netis-common.dtsi   | 201 +++++++++++
 target/linux/mediatek/dts/mt7981b-netis-nx30v2.dts |  64 ++++
 .../filogic/base-files/etc/board.d/01_leds         |   4 +
 .../filogic/base-files/etc/board.d/02_network      |   1 +
 .../filogic/base-files/lib/upgrade/platform.sh     |   1 +
 target/linux/mediatek/image/filogic.mk             |  31 ++
 9 files changed, 706 insertions(+)

diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile
index 07ed3144bc..2431d4fd96 100644
--- a/package/boot/uboot-mediatek/Makefile
+++ b/package/boot/uboot-mediatek/Makefile
@@ -398,6 +398,18 @@ define U-Boot/mt7981_konka_komi-a31
   DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
 endef
 
+define U-Boot/mt7981_netis_nx30v2
+  NAME:=Netis NX30V2
+  BUILD_SUBTARGET:=filogic
+  BUILD_DEVICES:=netis_nx30v2
+  UBOOT_CONFIG:=mt7981_netis_nx30v2
+  UBOOT_IMAGE:=u-boot.fip
+  BL2_BOOTDEV:=spim-nand
+  BL2_SOC:=mt7981
+  BL2_DDRTYPE:=ddr3
+  DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
+endef
+
 define U-Boot/mt7981_netis_nx31
   NAME:=netis NX31
   BUILD_SUBTARGET:=filogic
@@ -1087,6 +1099,7 @@ UBOOT_TARGETS := \
 	mt7981_imou_hx21 \
 	mt7981_jcg_q30-pro \
 	mt7981_konka_komi-a31 \
+	mt7981_netis_nx30v2 \
 	mt7981_netis_nx31 \
 	mt7981_nokia_ea0326gmp \
 	mt7981_openwrt_one-snand \
diff --git a/package/boot/uboot-mediatek/patches/461-add-netis-nx30v2.patch b/package/boot/uboot-mediatek/patches/461-add-netis-nx30v2.patch
new file mode 100644
index 0000000000..ed16e7a6fa
--- /dev/null
+++ b/package/boot/uboot-mediatek/patches/461-add-netis-nx30v2.patch
@@ -0,0 +1,390 @@
+--- /dev/null
++++ b/arch/arm/dts/mt7981-netis-nx30v2.dts
+@@ -0,0 +1,160@@
++// SPDX-License-Identifier: GPL-2.0
++
++/dts-v1/;
++#include "mt7981.dtsi"
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++
++/ {
++	model = "Netis NX30V2";
++	compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
++	chosen {
++		stdout-path = &uart0;
++		tick-timer = &timer0;
++	};
++
++	memory at 40000000 {
++		device_type = "memory";
++		reg = <0x40000000 0x10000000>;
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++
++		reset {
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
++		};
++
++		wps {
++			label = "wps";
++			linux,code = <KEY_WPS_BUTTON>;
++			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		internet {
++			label = "internet";
++			gpios = <&pio 7 GPIO_ACTIVE_LOW>;
++		};
++
++		power {
++			label = "power";
++			gpios = <&pio 4 GPIO_ACTIVE_LOW>;
++		};
++
++		wifi {
++			label = "wifi";
++			gpios = <&pio 34 GPIO_ACTIVE_LOW>;
++		};
++
++		wps {
++			label = "wps";
++			gpios = <&pio 5 GPIO_ACTIVE_LOW>;
++		};
++
++		wan {
++			label = "wan";
++			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
++		};
++
++	};
++
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&eth {
++	status = "okay";
++	mediatek,gmac-id = <0>;
++	phy-mode = "2500base-x";
++	mediatek,switch = "auto";
++	reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
++
++	fixed-link {
++		speed = <2500>;
++		full-duplex;
++	};
++};
++
++&pio {
++	spi_flash_pins: spi0-pins-func-1 {
++		mux {
++			function = "flash";
++			groups = "spi0", "spi0_wp_hold";
++		};
++
++		conf-pu {
++			pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
++			drive-strength = <MTK_DRIVE_8mA>;
++			bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
++		};
++
++		conf-pd {
++			pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
++			drive-strength = <MTK_DRIVE_8mA>;
++			bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
++		};
++	};
++};
++
++&spi0 {
++	#address-cells = <1>;
++	#size-cells = <0>;
++	pinctrl-names = "default";
++	pinctrl-0 = <&spi_flash_pins>;
++	status = "okay";
++	enhance_timing;
++	dma_ext;
++	ipm_design;
++	support_quad;
++	tick_dly = <2>;
++	sample_sel = <0>;
++
++	spi_nand at 0 {
++		compatible = "spi-nand";
++		reg = <0>;
++		spi-max-frequency = <52000000>;
++
++		partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition at 0 {
++				label = "BL2";
++				reg = <0x0 0x100000>;
++			};
++
++			partition at 100000 {
++				label = "u-boot-env";
++				reg = <0x100000 0x80000>;
++			};
++
++			partition at 180000 {
++				label = "Factory";
++				reg = <0x180000 0x200000>;
++			};
++
++			partition at 380000 {
++				label = "FIP";
++				reg = <0x380000 0x200000>;
++			};
++
++			partition at 580000 {
++				label = "ubi";
++				reg = <0x580000 0x7280000>;
++			};
++		};
++	};
++};
++
++&watchdog {
++	status = "disabled";
++};
+--- /dev/null
++++ b/configs/mt7981_netis_nx30v2_defconfig
+@@ -0,0 +1,156 @@
++CONFIG_ARM=y
++CONFIG_SYS_HAS_NONCACHED_MEMORY=y
++CONFIG_POSITION_INDEPENDENT=y
++CONFIG_ARCH_MEDIATEK=y
++CONFIG_TEXT_BASE=0x41e00000
++CONFIG_SYS_MALLOC_F_LEN=0x4000
++CONFIG_NR_DRAM_BANKS=1
++CONFIG_DEFAULT_DEVICE_TREE="mt7981-netis-nx30v2"
++CONFIG_TARGET_MT7981=y
++CONFIG_DEBUG_UART_BASE=0x11002000
++CONFIG_DEBUG_UART_CLOCK=40000000
++CONFIG_SYS_LOAD_ADDR=0x46000000
++CONFIG_DEBUG_UART=y
++CONFIG_OF_LIBFDT_OVERLAY=y
++CONFIG_SMBIOS_PRODUCT_NAME=""
++CONFIG_CFB_CONSOLE_ANSI=y
++CONFIG_BOARD_LATE_INIT=y
++CONFIG_BUTTON_CMD=y
++CONFIG_BUTTON=y
++CONFIG_BUTTON_GPIO=y
++CONFIG_GPIO_HOG=y
++CONFIG_CMD_ENV_FLAGS=y
++CONFIG_FIT=y
++CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
++CONFIG_LED=y
++CONFIG_LED_BLINK=y
++CONFIG_LED_SW_BLINK=y
++CONFIG_LED_GPIO=y
++CONFIG_SPI_BOOT=y
++CONFIG_BOOTSTD_DEFAULTS=y
++CONFIG_BOOTSTD_FULL=y
++CONFIG_USE_PREBOOT=y
++CONFIG_SYS_CBSIZE=512
++CONFIG_SYS_PBSIZE=1049
++CONFIG_AUTOBOOT_MENU_SHOW=y
++CONFIG_LOGLEVEL=7
++CONFIG_LOG=y
++# CONFIG_BOARD_INIT is not set
++CONFIG_SYS_PROMPT="MT7981> "
++# CONFIG_BOOTM_NETBSD is not set
++# CONFIG_BOOTM_PLAN9 is not set
++# CONFIG_BOOTM_RTEMS is not set
++# CONFIG_BOOTM_VXWORKS is not set
++# CONFIG_CMD_UNLZ4 is not set
++# CONFIG_CMD_UNZIP is not set
++CONFIG_CMD_BOOTMENU=y
++CONFIG_CMD_BOOTP=y
++CONFIG_CMD_BUTTON=y
++CONFIG_CMD_CACHE=y
++CONFIG_CMD_CDP=y
++CONFIG_CMD_CPU=y
++CONFIG_CMD_DHCP=y
++CONFIG_CMD_DFU=y
++CONFIG_CMD_DM=y
++CONFIG_CMD_ELF=y
++CONFIG_CMD_DNS=y
++CONFIG_CMD_ECHO=y
++CONFIG_CMD_ENV_READMEM=y
++CONFIG_CMD_ERASEENV=y
++CONFIG_CMD_FDT=y
++CONFIG_CMD_FS_GENERIC=y
++CONFIG_CMD_FS_UUID=y
++CONFIG_CMD_GPIO=y
++CONFIG_CMD_MTD=y
++CONFIG_CMD_HASH=y
++CONFIG_CMD_ITEST=y
++CONFIG_CMD_LED=y
++CONFIG_CMD_LICENSE=y
++CONFIG_CMD_LINK_LOCAL=y
++CONFIG_CMD_MTD=y
++CONFIG_CMD_NAND=y
++# CONFIG_MTD_RAW_NAND is not set
++CONFIG_CMD_NAND_TRIMFFS=y
++CONFIG_CMD_PCI=y
++CONFIG_CMD_PSTORE=y
++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
++CONFIG_CMD_PING=y
++CONFIG_CMD_PXE=y
++CONFIG_CMD_SF=y
++CONFIG_CMD_SF_TEST=y
++CONFIG_CMD_SMC=y
++CONFIG_CMD_UBI=y
++CONFIG_CMD_UBI_RENAME=y
++CONFIG_CMD_UBIFS=y
++CONFIG_CMD_TFTPBOOT=y
++CONFIG_CMD_TFTPPUT=y
++CONFIG_CMD_TFTPSRV=y
++CONFIG_CMD_ASKENV=y
++CONFIG_CMD_RARP=y
++CONFIG_CMD_SETEXPR=y
++CONFIG_CMD_SLEEP=y
++CONFIG_CMD_SNTP=y
++CONFIG_CMD_SOURCE=y
++CONFIG_CMD_STRINGS=y
++CONFIG_CMD_UUID=y
++CONFIG_ENV_OVERWRITE=y
++CONFIG_ENV_IS_IN_UBI=y
++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
++CONFIG_ENV_UBI_PART="ubi"
++CONFIG_ENV_SIZE=0x1f000
++CONFIG_ENV_SIZE_REDUND=0x1f000
++CONFIG_ENV_UBI_VOLUME="ubootenv"
++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
++CONFIG_ENV_UBI_VOLUME_CREATE=y
++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
++CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
++CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/netis_nx30v2.env"
++CONFIG_NET_RANDOM_ETHADDR=y
++CONFIG_NETCONSOLE=y
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
++CONFIG_REGEX=y
++CONFIG_REGMAP=y
++CONFIG_SYSCON=y
++CONFIG_CLK=y
++# CONFIG_MMC is not set
++CONFIG_HUSH_PARSER=y
++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
++CONFIG_SYS_RELOC_GD_ENV_ADDR=y
++CONFIG_MTD=y
++CONFIG_DM_MTD=y
++CONFIG_MTD_SPI_NAND=y
++CONFIG_DM_SPI_FLASH=y
++CONFIG_SPI_FLASH_SFDP_SUPPORT=y
++CONFIG_SPI_FLASH_EON=y
++CONFIG_SPI_FLASH_GIGADEVICE=y
++CONFIG_SPI_FLASH_ISSI=y
++CONFIG_SPI_FLASH_MACRONIX=y
++CONFIG_SPI_FLASH_SPANSION=y
++CONFIG_SPI_FLASH_STMICRO=y
++CONFIG_SPI_FLASH_WINBOND=y
++CONFIG_SPI_FLASH_XMC=y
++CONFIG_SPI_FLASH_XTX=y
++CONFIG_SPI_FLASH_MTD=y
++CONFIG_PHY_FIXED=y
++CONFIG_MEDIATEK_ETH=y
++CONFIG_PINCTRL=y
++CONFIG_PINCONF=y
++CONFIG_PINCTRL_MT7981=y
++CONFIG_POWER_DOMAIN=y
++CONFIG_MTK_POWER_DOMAIN=y
++CONFIG_DM_SERIAL=y
++CONFIG_SERIAL_RX_BUFFER=y
++CONFIG_SERIAL_RX_BUFFER_SIZE=256
++CONFIG_MTK_SERIAL=y
++CONFIG_SPI=y
++CONFIG_DM_SPI=y
++CONFIG_MTK_SPIM=y
++CONFIG_HEXDUMP=y
++# CONFIG_EFI_LOADER is not set
++CONFIG_LMB_MAX_REGIONS=64
++CONFIG_OF_SYSTEM_SETUP=y
++CONFIG_UPDATE_COMMON=y
++CONFIG_UPDATE_FIT=y
++CONFIG_CONSOLE_MUX=y
+--- /dev/null
++++ b/defenvs/netis_nx30v2.env
+@@ -0,0 +1,64 @@
++#misc settings
++serverip=192.168.1.254
++ipaddr=192.168.1.1
++ncip=192.168.1.254
++loadaddr=0x46000000
++return_bootmenu=askenv - Press ENTER to return to menu ; bootmenu 60
++
++#file name defines
++bootfile_bl2=openwrt-mediatek-filogic-netis_nx30v2-spim-nand-preloader.bin
++bootfile_fip=openwrt-mediatek-filogic-netis_nx30v2-spim-nand-bl31-uboot.fip
++bootfile_rec=openwrt-mediatek-filogic-netis_nx30v2-initramfs.itb
++bootfile_fw=openwrt-mediatek-filogic-netis_nx30v2-squashfs-sysupgrade.itb
++
++#boot commands
++bootconf=config-1
++boot_recovery=tftpboot $bootfile_rec && iminfo && bootm $loadaddr#$bootconf
++boot_nand=ubi read $loadaddr fit;bootm $loadaddr#$bootconf
++bootcmd=run boot_nand; while true; do run boot_recovery; done
++
++#bootmenu
++bootmenu_default=0
++bootmenu_0=Startup system (Default)=run bootcmd
++bootmenu_1=Upgrade firmware via TFTP=run upgrade_fw ; run return_bootmenu
++bootmenu_2=Startup recovery image via TFTP=run boot_recovery ; run return_bootmenu
++bootmenu_3=Upgrade BL2 preloader via TFTP=run upgrade_bl2 ; run return_bootmenu
++bootmenu_4=Upgrade BL31+U-Boot FIP via TFTP=run upgrade_fip ; run return_bootmenu
++bootmenu_5=Reset all settings to factory default.=run reset_all; reset
++bootmenu_6=Reboot.=reset
++
++#upgrade commands
++upgrade_bl2=run led_blink_downloading && tftpboot $bootfile_bl2 && run led_blink_writing && nand erase BL2 && nand write $loadaddr BL2; run led_on
++upgrade_fip=run led_blink_downloading && tftpboot $bootfile_fip && run led_blink_writing && nand erase FIP && nand write $loadaddr FIP; run led_on
++upgrade_fw=run led_blink_downloading && tftpboot $bootfile_fw && iminfo && run led_blink_writing && if ubi check fit; then ubi remove fit; else true; fi && ubi create fit $filesize && ubi write $loadaddr fit $filesize; run led_on
++
++#restore offical bootloader
++offical_download=run led_blink_downloading; setenv failed 1; while test $failed -eq 1; do setenv bl2addr 0x46000000 && tftpboot $bl2addr bl2.img && setenv fipaddr 0x46380000 && tftpboot $fipaddr fip.bin && setenv failed 0; done; setenv customer 0; setenv customeraddr 0x46580000 && tftpboot $customeraddr customer && setenv customer 1; test $failed -eq 0
++offical_write=run led_blink_writing; nand erase BL2 && nand write $bl2addr BL2 && nand erase FIP && nand write $fipaddr FIP; ubi detach; mtd erase ubi; ubi part ubi; if test $customer -eq 1; then ubi create customer $filesize; ubi write $customeraddr customer $filesize; fi; true
++offical_upgrade=run offical_download offical_write led_on; echo upgrade offical bootloader done; while true; do sleep 10; done
++
++#factory default
++reset_env=env default -a && saveenv
++reset_usr=ubi check rootfs_data && ubi remove rootfs_data; run create_rootfs_data
++reset_all=run reset_env reset_usr
++
++#prepare ethaddr and rootfs_data at preload
++rootfs_data_max=0x5300000
++create_rootfs_data=if env exists rootfs_data_max; then ubi create rootfs_data $rootfs_data_max; else ubi create rootfs_data -; fi
++set_ethaddr=mtd read Factory $loadaddr 0x1fe000 0x1000 && setexpr tmpaddr $loadaddr + 0xf20 && mw.b $loadaddr 0 6 && cmp.b $loadaddr $tmpaddr 6 || readmem -b ethaddr $tmpaddr 0x6
++preboot=run set_ethaddr; if ubi part; then else mtd erase ubi; ubi part ubi; fi; ubi check rootfs_data || run create_rootfs_data
++
++#led
++led_blink_downloading=led internet blink 100; led wifi blink 100; led wps blink 100
++led_blink_writing=led internet blink 1000; led wifi blink 1000; led wps blink 1000
++led_on=led internet on; led wifi on; led wps on
++
++#netconsole
++netconsole=setenv stdout serial,nc;setenv stdin serial,nc
++nonetconcole=setenv stdout serial;setenv stdin serial
++
++# button commands
++button_cmd_0=run netconsole led_on; sleep 5; if button wps; then run nonetconcole offical_upgrade; fi
++button_cmd_0_name=wps
++button_cmd_1=run netconsole led_on reset_all; sleep 5; if button reset; then run nonetconcole; while true; do run upgrade_fw && run boot_nand; done; fi
++button_cmd_1_name=reset
diff --git a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
index b7dc08ded2..379609c1af 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
+++ b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
@@ -35,6 +35,7 @@ konka,komi-a31|\
 mercusys,mr90x-v1-ubi|\
 netcore,n60|\
 netcore,n60-pro|\
+netis,nx30v2|\
 netis,nx31|\
 nokia,ea0326gmp|\
 openwrt,one|\
diff --git a/target/linux/mediatek/dts/mt7981b-netis-common.dtsi b/target/linux/mediatek/dts/mt7981b-netis-common.dtsi
new file mode 100644
index 0000000000..18d70ccecd
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-netis-common.dtsi
@@ -0,0 +1,201 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7981b.dtsi"
+
+/ {
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		rootdisk = <&ubi_rootdisk>;
+	};
+
+	memory at 40000000 {
+		reg = <0 0x40000000 0 0x20000000>;
+		device_type = "memory";
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+		};
+		wps {
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&eth {
+	status = "okay";
+
+	gmac0: mac at 0 {
+		compatible = "mediatek,eth-mac";
+		reg = <0>;
+		phy-mode = "2500base-x";
+
+		nvmem-cells = <&macaddr_lan>;
+		nvmem-cell-names = "mac-address";
+
+		fixed-link {
+			speed = <2500>;
+			full-duplex;
+			pause;
+		};
+	};
+
+	mac at 1 {
+		compatible = "mediatek,eth-mac";
+		reg = <1>;
+		phy-mode = "gmii";
+		phy-handle = <&int_gbe_phy>;
+
+		nvmem-cells = <&macaddr_wan>;
+		nvmem-cell-names = "mac-address";
+	};
+};
+
+&mdio_bus {
+	switch: switch at 1f {
+		compatible = "mediatek,mt7531";
+		reg = <31>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		interrupt-parent = <&pio>;
+		interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
+		reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
+	};
+};
+
+&crypto {
+	status = "okay";
+};
+
+&pio {
+	spi0_flash_pins: spi0-pins {
+		mux {
+			function = "spi";
+			groups = "spi0", "spi0_wp_hold";
+		};
+		conf-pu {
+			pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
+		};
+		conf-pd {
+			pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
+		};
+	};
+
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_flash_pins>;
+	status = "okay";
+
+	spi_nand at 0 {
+		compatible = "spi-nand";
+		reg = <0>;
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "BL2";
+				reg = <0x0 0x100000>;
+			};
+
+			partition at 100000 {
+				label = "u-boot-env";
+				reg = <0x100000 0x80000>;
+			};
+
+			partition at 180000 {
+				label = "Factory";
+				reg = <0x180000 0x200000>;
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory_0: eeprom at 0 {
+						reg = <0x0 0x1000>;
+					};
+
+					macaddr_lan: macaddr at 1fef20 {
+						reg = <0x1fef20 0x6>;
+					};
+
+					macaddr_wan: macaddr at 1fef26 {
+						reg = <0x1fef26 0x6>;
+					};
+				};
+			};
+
+			partition at 380000 {
+				label = "FIP";
+				reg = <0x380000 0x200000>;
+			};
+
+			partition at 580000 {
+				label = "ubi";
+				reg = <0x580000 0x7280000>;
+				compatible = "linux,ubi";
+
+				volumes {
+					ubi_rootdisk: ubi-volume-fit {
+						volname = "fit";
+					};
+				};
+			};
+		};
+	};
+};
+
+&switch {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port at 6 {
+			reg = <6>;
+			ethernet = <&gmac0>;
+			phy-mode = "2500base-x";
+
+			fixed-link {
+				speed = <2500>;
+				full-duplex;
+				pause;
+			};
+		};
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&watchdog {
+	status = "okay";
+};
+
+&wifi {
+	status = "okay";
+	nvmem-cells = <&eeprom_factory_0>;
+	nvmem-cell-names = "eeprom";
+};
diff --git a/target/linux/mediatek/dts/mt7981b-netis-nx30v2.dts b/target/linux/mediatek/dts/mt7981b-netis-nx30v2.dts
new file mode 100644
index 0000000000..cbd6666d49
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-netis-nx30v2.dts
@@ -0,0 +1,64 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+
+/dts-v1/;
+#include "mt7981b-netis-common.dtsi"
+
+/ {
+	compatible = "netis,nx30v2", "mediatek,mt7981";
+
+	aliases {
+		label-mac-device = &gmac0;
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_wps;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_POWER;
+			gpios = <&pio 4 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		internet {
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_WAN_ONLINE;
+			gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+		};
+
+		led_wps: wps {
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_WPS;
+			gpios = <&pio 5 GPIO_ACTIVE_LOW>;
+		};
+
+		wan {
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_WAN;
+			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&switch {
+	ports {
+		port at 0 {
+			reg = <1>;
+			label = "lan1";
+		};
+
+		port at 1 {
+			reg = <2>;
+			label = "lan2";
+		};
+
+		port at 2 {
+			reg = <3>;
+			label = "lan3";
+		};
+	};
+};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
index a117c8ba7c..25256fd323 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
@@ -151,6 +151,10 @@ netgear,eax17)
 netgear,wax220)
 	ucidef_set_led_netdev "eth0" "LAN" "green:lan" "eth0"
 	;;
+netis,nx30v2)
+	ucidef_set_led_netdev "wanlink" "WANLINK" "blue:wan" "eth1" "link"
+	ucidef_set_led_netdev "wanact" "WANACT" "blue:wan-online" "eth1" "tx rx"
+	;;
 netis,nx31)
 	ucidef_set_led_netdev "wan" "wan" "blue:wan" "eth1" "link tx rx"
 	;;
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index 70ac202855..6c61966fc4 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -14,6 +14,7 @@ mediatek_setup_interfaces()
 	h3c,magic-nx30-pro|\
 	imou,hx21|\
 	konka,komi-a31|\
+	netis,nx30v2|\
 	netis,nx31|\
 	nokia,ea0326gmp|\
 	mercusys,mr80x-v3|\
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index a320c67987..199ef8b1d7 100755
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -100,6 +100,7 @@ platform_do_upgrade() {
 	mediatek,mt7981-rfb|\
 	mediatek,mt7988a-rfb|\
 	mercusys,mr90x-v1-ubi|\
+	netis,nx30v2|\
 	netis,nx31|\
 	nokia,ea0326gmp|\
 	openwrt,one|\
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 89270729a0..490fb69afa 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -2140,6 +2140,37 @@ define Device/netgear_wax220
 endef
 TARGET_DEVICES += netgear_wax220
 
+define Device/netis_nx30v2
+  DEVICE_VENDOR := Netis
+  DEVICE_MODEL := NX30V2
+  DEVICE_ALT0_VENDOR := Netcore
+  DEVICE_ALT0_MODEL := POWER30AX
+  DEVICE_ALT1_VENDOR := Netcore
+  DEVICE_ALT1_MODEL := N30PRO
+  DEVICE_ALT2_VENDOR := GWBN
+  DEVICE_ALT2_MODEL := GW3001
+  DEVICE_ALT3_VENDOR := GLC
+  DEVICE_ALT3_MODEL := W7
+  DEVICE_DTS := mt7981b-netis-nx30v2
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_DTC_FLAGS := --pad 4096
+  DEVICE_DTS_LOADADDR := 0x43f00000
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+  KERNEL_LOADADDR := 0x44000000
+  KERNEL := kernel-bin | gzip
+  KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+  KERNEL_INITRAMFS_SUFFIX := .itb
+  KERNEL_IN_UBI := 1
+  UBOOTENV_IN_UBI := 1
+  IMAGES := sysupgrade.itb
+  IMAGE_SIZE := 117248k
+  IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
+  ARTIFACTS := spim-nand-preloader.bin spim-nand-bl31-uboot.fip
+  ARTIFACT/spim-nand-preloader.bin	:= mt7981-bl2 spim-nand-ddr3
+  ARTIFACT/spim-nand-bl31-uboot.fip	:= mt7981-bl31-uboot netis_nx30v2
+endef
+TARGET_DEVICES += netis_nx30v2
+
 define Device/netis_nx31
   DEVICE_VENDOR := netis
   DEVICE_MODEL := NX31



From lede-commits at lists.infradead.org  Mon Dec  8 17:10:03 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 08 Dec 2025 20:10:03 -0500
Subject: [openwrt/openwrt]  apk: Fix host compilation with C89
In-Reply-To: <176524260325.3679890.593004166980076268@git-01.infra.openwrt.org>
References: <176524260325.3679890.593004166980076268@git-01.infra.openwrt.org>
Message-ID: <mailman.34176.1765242609.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d11b77db5eca3e20c5c238c55d80059229a188b3

commit d11b77db5eca3e20c5c238c55d80059229a188b3
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Dec 9 02:06:26 2025 +0100

    apk: Fix host compilation with C89
    
    This fixes the following build error:
    ```
    ../src/apk.c: In function 'parse_options':
    ../src/apk.c:584:4: error: a label can only be part of a statement and a declaration is not a statement
      584 |    char *arg = opt_parse_arg(&st);
          |    ^~~~
    ```
    
    Upstream MR: https://gitlab.alpinelinux.org/alpine/apk-tools/-/merge_requests/376
    
    Fixes: b91ebdabbb09 ("apk: bump to 3.0.1")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../0020-apk-fix-compile-when-using-C89.patch      | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/package/system/apk/patches/0020-apk-fix-compile-when-using-C89.patch b/package/system/apk/patches/0020-apk-fix-compile-when-using-C89.patch
new file mode 100644
index 0000000000..8cd30542dd
--- /dev/null
+++ b/package/system/apk/patches/0020-apk-fix-compile-when-using-C89.patch
@@ -0,0 +1,56 @@
+From 54385e6dc02ada9ec827b6b79b9359951197fee5 Mon Sep 17 00:00:00 2001
+From: Paul Donald <newtwen+gitlab at gmail.com>
+Date: Tue, 9 Dec 2025 00:31:27 +0100
+Subject: [PATCH] apk: fix compile when using C89
+
+The older standard is more strict, and gives rise to errors:
+
+../src/apk.c: In function 'parse_options':
+../src/apk.c:584:4: error: a label can only be part of a statement and a declaration is not a statement
+  584 |    char *arg = opt_parse_arg(&st);
+      |    ^~~~
+
+So move the *arg declaration to function start.
+
+../src/app_mkpkg.c: In function 'mkpkg_setup_compat':
+../src/app_mkpkg.c:423:2: error: label at end of compound statement
+  423 |  default:
+      |  ^~~~~~~
+
+add break;
+
+Signed-off-by: Paul Donald <newtwen+gitlab at gmail.com>
+---
+ src/apk.c       | 3 ++-
+ src/app_mkpkg.c | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- a/src/apk.c
++++ b/src/apk.c
+@@ -556,6 +556,7 @@ static int parse_options(int argc, char
+ 	struct apk_opt_match m;
+ 	bool applet_arg_pending = false;
+ 	int r;
++	char *arg;
+ 
+ 	applet = applet_from_arg0(argv[0]);
+ 	if (!applet) {
+@@ -581,7 +582,7 @@ static int parse_options(int argc, char
+ 		case 0:
+ 			break;
+ 		case OPT_MATCH_NON_OPTION:
+-			char *arg = opt_parse_arg(&st);
++			arg = opt_parse_arg(&st);
+ 			if (applet_arg_pending && strcmp(arg, applet->name) == 0)
+ 				applet_arg_pending = false;
+ 			else if (arg[0] || !applet || !applet->remove_empty_arguments)
+--- a/src/app_mkpkg.c
++++ b/src/app_mkpkg.c
+@@ -421,6 +421,7 @@ static void mkpkg_setup_compat(struct mk
+ 	case 0: ctx->compat_rootnode = 1; // fallthrough
+ 	case 1: ctx->compat_dirnode = 1;  // fallthrough
+ 	default:
++		break;
+ 	}
+ }
+ 



From lede-commits at lists.infradead.org  Tue Dec  9 06:13:08 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 09 Dec 2025 09:13:08 -0500
Subject: [openwrt/openwrt]  bmips: b53: enable bcm63268 internal PHYs
In-Reply-To: <176528958824.3753839.12838367046676882119@git-01.infra.openwrt.org>
References: <176528958824.3753839.12838367046676882119@git-01.infra.openwrt.org>
Message-ID: <mailman.34323.1765289592.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c2c38469a8d37c46161076cde873ad50cb5f5e35

commit c2c38469a8d37c46161076cde873ad50cb5f5e35
Author: Kyle Hendry <kylehendrydev at gmail.com>
AuthorDate: Fri Jan 17 12:18:20 2025 -0800

    bmips: b53: enable bcm63268 internal PHYs
    
    On the smartrg sr505n the bootloader only sets registers to enable the
    PHYs if it's interrupted. When Linux boots this results in a -EINVAL
    error when trying to read from the EPHYs and the GPHY doesn't work.
    This patch disables low power mode in the GPHY/EPHYs and properly resets
    the EPHYs.
    
    Signed-off-by: Kyle Hendry <kylehendrydev at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/17648
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 target/linux/bmips/dts/bcm6318.dtsi  | 28 ++++++++++++++++++++++++++++
 target/linux/bmips/dts/bcm63268.dtsi | 31 +++++++++++++++++++++++++++++--
 target/linux/bmips/dts/bcm6328.dtsi  | 28 ++++++++++++++++++++++++++++
 target/linux/bmips/dts/bcm6362.dtsi  | 28 ++++++++++++++++++++++++++++
 target/linux/bmips/dts/bcm6368.dtsi  | 28 ++++++++++++++++++++++++++++
 5 files changed, 141 insertions(+), 2 deletions(-)

diff --git a/target/linux/bmips/dts/bcm6318.dtsi b/target/linux/bmips/dts/bcm6318.dtsi
index 03fb01bc04..3bd1eeae82 100644
--- a/target/linux/bmips/dts/bcm6318.dtsi
+++ b/target/linux/bmips/dts/bcm6318.dtsi
@@ -260,6 +260,12 @@
 					pins = "gpio40";
 				};
 			};
+
+			ephy_rst: reset-controller at 3c {
+				compatible = "brcm,bcm6345-reset";
+				reg = <0x3c 0x4>;
+				#reset-cells = <1>;
+			};
 		};
 
 		uart0: serial at 10000100 {
@@ -399,6 +405,8 @@
 			reg = <0x10080000 0x8000>;
 			big-endian;
 
+			brcm,gpio-ctrl = <&gpio_cntl>;
+
 			ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
@@ -431,21 +439,41 @@
 				phy1: ethernet-phy at 1 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <1>;
+
+					resets = <&ephy_rst 0>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy2: ethernet-phy at 2 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <2>;
+
+					resets = <&ephy_rst 1>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy3: ethernet-phy at 3 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <3>;
+
+					resets = <&ephy_rst 2>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy4: ethernet-phy at 4 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <4>;
+
+					resets = <&ephy_rst 3>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 			};
 
diff --git a/target/linux/bmips/dts/bcm63268.dtsi b/target/linux/bmips/dts/bcm63268.dtsi
index 5a8cb7193f..1344be2e43 100644
--- a/target/linux/bmips/dts/bcm63268.dtsi
+++ b/target/linux/bmips/dts/bcm63268.dtsi
@@ -288,6 +288,12 @@
 					pins = "dsl_gpio9";
 				};
 			};
+
+			ephy_rst: reset-controller at 3c {
+				compatible = "brcm,bcm6345-reset";
+				reg = <0x3c 0x4>;
+				#reset-cells = <1>;
+			};
 		};
 
 		uart0: serial at 10000180 {
@@ -481,8 +487,7 @@
 				 <&timer_clk BCM63268_TCLK_GPHY1>;
 
 			resets = <&periph_rst BCM63268_RST_ENETSW>,
-				 <&periph_rst BCM63268_RST_EPHY>,
-				 <&periph_rst BCM63268_RST_GPHY>;
+				 <&periph_rst BCM63268_RST_EPHY>;
 
 			power-domains = <&periph_pwr BCM63268_POWER_DOMAIN_ROBOSW>;
 
@@ -532,6 +537,8 @@
 			reg = <0x10700000 0x8000>;
 			big-endian;
 
+			brcm,gpio-ctrl = <&gpio_cntl>;
+
 			ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
@@ -564,21 +571,41 @@
 				phy1: ethernet-phy at 1 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <1>;
+
+					resets = <&ephy_rst 0>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy2: ethernet-phy at 2 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <2>;
+
+					resets = <&ephy_rst 1>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy3: ethernet-phy at 3 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <3>;
+
+					resets = <&ephy_rst 2>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy4: ethernet-phy at 4 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <4>;
+
+					resets = <&periph_rst BCM63268_RST_GPHY>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 			};
 
diff --git a/target/linux/bmips/dts/bcm6328.dtsi b/target/linux/bmips/dts/bcm6328.dtsi
index 52f94950a3..6376bbb8d0 100644
--- a/target/linux/bmips/dts/bcm6328.dtsi
+++ b/target/linux/bmips/dts/bcm6328.dtsi
@@ -248,6 +248,12 @@
 					pins = "usb_port1";
 				};
 			};
+
+			ephy_rst: reset-controller at 3c {
+				compatible = "brcm,bcm6345-reset";
+				reg = <0x3c 0x4>;
+				#reset-cells = <1>;
+			};
 		};
 
 		uart0: serial at 10000100 {
@@ -417,6 +423,8 @@
 			reg = <0x10e00000 0x8000>;
 			big-endian;
 
+			brcm,gpio-ctrl = <&gpio_cntl>;
+
 			ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
@@ -449,21 +457,41 @@
 				phy1: ethernet-phy at 1 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <1>;
+
+					resets = <&ephy_rst 0>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy2: ethernet-phy at 2 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <2>;
+
+					resets = <&ephy_rst 1>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy3: ethernet-phy at 3 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <3>;
+
+					resets = <&ephy_rst 2>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy4: ethernet-phy at 4 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <4>;
+
+					resets = <&ephy_rst 3>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 			};
 
diff --git a/target/linux/bmips/dts/bcm6362.dtsi b/target/linux/bmips/dts/bcm6362.dtsi
index 5722f6e30c..c73b278dc8 100644
--- a/target/linux/bmips/dts/bcm6362.dtsi
+++ b/target/linux/bmips/dts/bcm6362.dtsi
@@ -323,6 +323,12 @@
 					pins = "nand_grp";
 				};
 			};
+
+			ephy_rst: reset-controller at 3c {
+				compatible = "brcm,bcm6345-reset";
+				reg = <0x3c 0x4>;
+				#reset-cells = <1>;
+			};
 		};
 
 		uart0: serial at 10000100 {
@@ -526,6 +532,8 @@
 			reg = <0x10e00000 0x8000>;
 			big-endian;
 
+			brcm,gpio-ctrl = <&gpio_cntl>;
+
 			ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
@@ -558,21 +566,41 @@
 				phy1: ethernet-phy at 1 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <1>;
+
+					resets = <&ephy_rst 0>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy2: ethernet-phy at 2 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <2>;
+
+					resets = <&ephy_rst 1>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy3: ethernet-phy at 3 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <3>;
+
+					resets = <&ephy_rst 2>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy4: ethernet-phy at 4 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <4>;
+
+					resets = <&ephy_rst 3>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 			};
 
diff --git a/target/linux/bmips/dts/bcm6368.dtsi b/target/linux/bmips/dts/bcm6368.dtsi
index a855ab340a..51a59cc8c0 100644
--- a/target/linux/bmips/dts/bcm6368.dtsi
+++ b/target/linux/bmips/dts/bcm6368.dtsi
@@ -337,6 +337,12 @@
 					pins = "uart1_grp";
 				};
 			};
+
+			ephy_rst: reset-controller at 3c {
+				compatible = "brcm,bcm6345-reset";
+				reg = <0x3c 0x4>;
+				#reset-cells = <1>;
+			};
 		};
 
 		leds: led-controller at 100000d0 {
@@ -528,6 +534,8 @@
 			reg = <0x10f00000 0x8000>;
 			big-endian;
 
+			brcm,gpio-ctrl = <&gpio_cntl>;
+
 			ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
@@ -560,21 +568,41 @@
 				phy1: ethernet-phy at 1 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <1>;
+
+					resets = <&ephy_rst 6>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy2: ethernet-phy at 2 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <2>;
+
+					resets = <&ephy_rst 7>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy3: ethernet-phy at 3 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <3>;
+
+					resets = <&ephy_rst 8>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 
 				phy4: ethernet-phy at 4 {
 					compatible = "ethernet-phy-ieee802.3-c22";
 					reg = <4>;
+
+					resets = <&ephy_rst 9>;
+					reset-names = "phy";
+					reset-assert-us = <2000>;
+					reset-deassert-us = <2000>;
 				};
 			};
 



From lede-commits at lists.infradead.org  Tue Dec  9 11:33:52 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 09 Dec 2025 14:33:52 -0500
Subject: [openwrt/openwrt]  uboot-mediatek: fix readmem command help message
In-Reply-To: <176530883292.1102907.14393271124717778377@git-01.infra.openwrt.org>
References: <176530883292.1102907.14393271124717778377@git-01.infra.openwrt.org>
Message-ID: <mailman.34404.1765308838.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/409b2f41a1ae281259ba3dcae8a4dc4a491e4975

commit 409b2f41a1ae281259ba3dcae8a4dc4a491e4975
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Tue Dec 9 18:47:32 2025 +0800

    uboot-mediatek: fix readmem command help message
    
    Correct the order of the arguments.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21109
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch b/package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch
index 7d4018a1a4..0dd2cdd760 100644
--- a/package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch
+++ b/package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch
@@ -104,7 +104,7 @@
 +U_BOOT_CMD_COMPLETE(
 +	readmem,	CONFIG_SYS_MAXARGS,	3,	do_env_readmem,
 +	"get environment variable from memory address",
-+	"name [-b] address size\n"
++	"[-b] name address size\n"
 +	"    - store memory address to env variable\n"
 +	"      \"-b\": read binary ethaddr",
 +	var_complete



From lede-commits at lists.infradead.org  Tue Dec  9 11:37:06 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 09 Dec 2025 14:37:06 -0500
Subject: [openwrt/openwrt]  uci: update to Git HEAD (2025-12-02)
In-Reply-To: <176530902611.1129661.13143708665658932881@git-01.infra.openwrt.org>
References: <176530902611.1129661.13143708665658932881@git-01.infra.openwrt.org>
Message-ID: <mailman.34405.1765309030.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e7a57a980ef3441190dc5c85c544d6c4f5ff4bba

commit e7a57a980ef3441190dc5c85c544d6c4f5ff4bba
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:27:23 2025 +0100

    uci: update to Git HEAD (2025-12-02)
    
    66127cd76c5d formal: fix workflow permissions
    
    Changes: https://github.com/openwrt/uci/compare/5bea13572325af4fb3057ff600cc7f7d5b82012b...66127cd76c5d0bd46d5a90302cc6110f53a4e2f8
    
    Link: https://github.com/openwrt/openwrt/pull/21103
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/system/uci/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile
index 5d4750ca5c..11f89b0b15 100644
--- a/package/system/uci/Makefile
+++ b/package/system/uci/Makefile
@@ -13,9 +13,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2025-11-18
-PKG_SOURCE_VERSION:=5bea13572325af4fb3057ff600cc7f7d5b82012b
-PKG_MIRROR_HASH:=62a0f20970e7db5b0de4814168e0f9f558f16d5e8caa1203d247ae1faa1c2a18
+PKG_SOURCE_DATE:=2025-12-02
+PKG_SOURCE_VERSION:=66127cd76c5d0bd46d5a90302cc6110f53a4e2f8
+PKG_MIRROR_HASH:=ff23a9825aeac8da14a7142e985d598043c0287a463279f24863c580622bf18d
 PKG_ABI_VERSION:=20250120
 
 PKG_LICENSE:=LGPL-2.1



From lede-commits at lists.infradead.org  Tue Dec  9 11:38:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 09 Dec 2025 14:38:29 -0500
Subject: [openwrt/openwrt]  libnl-tiny: update to Git HEAD (2025-12-02)
In-Reply-To: <176530910982.1140833.15309423465574670505@git-01.infra.openwrt.org>
References: <176530910982.1140833.15309423465574670505@git-01.infra.openwrt.org>
Message-ID: <mailman.34406.1765309113.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9c286bd1e347aefbede44967251fa1e65c338db4

commit 9c286bd1e347aefbede44967251fa1e65c338db4
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:14:47 2025 +0100

    libnl-tiny: update to Git HEAD (2025-12-02)
    
    087d4ce8c07b github: ci: add cmake build and source directories
    2871f3f26abb github: ci: add powerpc arch
    567be1101523 github: ci: add MIPS64, PowerPC64 and RISCV64
    40493a655d8c formal: fix workflow permissions
    
    Changes: https://github.com/openwrt/libnl-tiny/compare/532ac744dedcf83c06e2f4a8320fcc8089f23b72...40493a655d8caa2ccf5206dde1e733abe2920432
    
    Link: https://github.com/openwrt/openwrt/pull/21098
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/libs/libnl-tiny/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile
index 7d59f68122..5c620e4e96 100644
--- a/package/libs/libnl-tiny/Makefile
+++ b/package/libs/libnl-tiny/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git
-PKG_SOURCE_DATE:=2025-11-03
-PKG_SOURCE_VERSION:=532ac744dedcf83c06e2f4a8320fcc8089f23b72
-PKG_MIRROR_HASH:=f6f6432b0aa859ffe3012f5b57590823cb4540d97fd6a13ccd8d8f5572a0ca3f
+PKG_SOURCE_DATE:=2025-12-02
+PKG_SOURCE_VERSION:=40493a655d8caa2ccf5206dde1e733abe2920432
+PKG_MIRROR_HASH:=b45c72c26961fa6eafc14f73693c2fe463912c4cb0488ccea232d61b425c60d5
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=LGPL-2.1



From lede-commits at lists.infradead.org  Tue Dec  9 11:39:52 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 09 Dec 2025 14:39:52 -0500
Subject: [openwrt/openwrt]  ubus: update to Git HEAD (2025-12-02)
In-Reply-To: <176530919250.1151008.7584019283844796331@git-01.infra.openwrt.org>
References: <176530919250.1151008.7584019283844796331@git-01.infra.openwrt.org>
Message-ID: <mailman.34407.1765309196.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0cceb4b50902a8f6cb6f720542ee8e946070031b

commit 0cceb4b50902a8f6cb6f720542ee8e946070031b
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:26:53 2025 +0100

    ubus: update to Git HEAD (2025-12-02)
    
    3cc98db1a422 formal: fix workflow permissions
    
    Changes: https://github.com/openwrt/ubus/compare/2737da3819fefafa5b63d5f82efb77ff0032a5d8...3cc98db1a422dcf560f2d6347fd410f17565a89d
    
    Link: https://github.com/openwrt/openwrt/pull/21102
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/system/ubus/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index 43eb5cd843..8608d99851 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
-PKG_SOURCE_DATE:=2025-11-18
-PKG_SOURCE_VERSION:=2737da3819fefafa5b63d5f82efb77ff0032a5d8
-PKG_MIRROR_HASH:=6044e9bde877ee585a69386ab377e3bc1924e15b7343db8df8234b1d76f870ec
+PKG_SOURCE_DATE:=2025-12-02
+PKG_SOURCE_VERSION:=3cc98db1a422dcf560f2d6347fd410f17565a89d
+PKG_MIRROR_HASH:=25a204888b41e9a432ee0b8d03c1e0f09ae9aaae6a306c41781d680b632b82ae
 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
 CMAKE_INSTALL:=1
 



From lede-commits at lists.infradead.org  Tue Dec  9 11:43:15 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 09 Dec 2025 14:43:15 -0500
Subject: [openwrt/openwrt]  libubox: update to Git HEAD (2025-12-08)
In-Reply-To: <176530939530.1180491.13281203549706173890@git-01.infra.openwrt.org>
References: <176530939530.1180491.13281203549706173890@git-01.infra.openwrt.org>
Message-ID: <mailman.34410.1765309399.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/355bb8c89028f5ca60538a53da0685c15b1c72be

commit 355bb8c89028f5ca60538a53da0685c15b1c72be
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:15:31 2025 +0100

    libubox: update to Git HEAD (2025-12-08)
    
    5714bf6ae652 build: install libubox
    440b4e988f39 tests: shunit2: add dump and setters coverage
    a3ff29ef93df tests: shunit2: add test for _jshn_append via JSON script
    38d70328ecbd github: ci: add MIPS64, PowerPC64 and RISCV64
    edaf77da740d scripts: devel-build: add missing LUAPATH
    c0773869c9d6 build: disable static json-c
    ecddb31dc34d formal: fix workflow permissions
    7928f1711703 libubox: Add ability to find ordinal position inside a table
    
    Changes: https://github.com/openwrt/libubox/compare/a75209f62982f7218f73b9b4fd9b705e19f5f94a...7928f1711703767b0ac5ce916c7231d0e1af1ca2
    
    Link: https://github.com/openwrt/openwrt/pull/21099
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/libs/libubox/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile
index b51324433e..5dd4640c07 100644
--- a/package/libs/libubox/Makefile
+++ b/package/libs/libubox/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
-PKG_MIRROR_HASH:=5bd17ef3e681529fda6992d76a7104f2fef81002c2d776c11217e3b99426a669
-PKG_SOURCE_DATE:=2025-11-14
-PKG_SOURCE_VERSION:=a75209f62982f7218f73b9b4fd9b705e19f5f94a
+PKG_MIRROR_HASH:=59cebd566db9013497e2094011f37eef9dcf5b3399b81be3e7c5217d646b82ee
+PKG_SOURCE_DATE:=2025-12-08
+PKG_SOURCE_VERSION:=7928f1711703767b0ac5ce916c7231d0e1af1ca2
 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
 CMAKE_INSTALL:=1
 



From lede-commits at lists.infradead.org  Tue Dec  9 13:41:16 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 09 Dec 2025 16:41:16 -0500
Subject: [openwrt/openwrt]  odhcp6c: update to Git HEAD (2025-12-09)
In-Reply-To: <176531647682.1765696.4607877380561743000@git-01.infra.openwrt.org>
References: <176531647682.1765696.4607877380561743000@git-01.infra.openwrt.org>
Message-ID: <mailman.34437.1765316481.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/46532c9bcb1902dc016806dd3199d16dc2fd33b4

commit 46532c9bcb1902dc016806dd3199d16dc2fd33b4
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Tue Dec 9 16:17:04 2025 +0100

    odhcp6c: update to Git HEAD (2025-12-09)
    
    5212a1019d75 odhcp6c: clear the socket buffer after initialising it
    
    https://github.com/openwrt/odhcp6c/compare/1d6c4e794cdb...5212a1019d75
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index b34615b0c7..e36e51d6b6 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
-PKG_SOURCE_DATE:=2025-12-06
-PKG_SOURCE_VERSION:=1d6c4e794cdb86963e29b7dc332d0bc20ba6306c
-PKG_MIRROR_HASH:=b7c8fb6c76a7c2f2ef3d9bb9e867e8b9f54b4ecb535d6715c0da1fdaebb6ce51
+PKG_SOURCE_DATE:=2025-12-09
+PKG_SOURCE_VERSION:=5212a1019d75db47a03c95c12e385e4625dda3d0
+PKG_MIRROR_HASH:=9c6501ea995c685e4e1b65ae74cbaecb6f787a493fdd5f8d3d095aeb0466b418
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Wed Dec 10 00:54:44 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 03:54:44 -0500
Subject: [openwrt/openwrt]  odhcpd: update to Git HEAD (2025-12-10)
In-Reply-To: <176535688494.1504010.12515717901046870342@git-01.infra.openwrt.org>
References: <176535688494.1504010.12515717901046870342@git-01.infra.openwrt.org>
Message-ID: <mailman.34491.1765356894.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4e4986aaf6e7f77da0f01fce54b067de3538e438

commit 4e4986aaf6e7f77da0f01fce54b067de3538e438
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Sat Dec 6 17:01:00 2025 +0100

    odhcpd: update to Git HEAD (2025-12-10)
    
    ca00527e5fc3 statefiles: don't write empty hosts files
    24b70c5c2ff0 Revert "statefiles: fix escape sequence for broken hostname output"
    5203ad13954c statefiles: fix stale pio handling for !ubus
    a64760b30f67 odhcpd: rename piofolder to piodir
    6779344a8c8a statefiles: use tmpfile functions for pio files
    9f8abcc662d0 statefiles: rename prefix information functions
    cb65b83e524e config: move pio json handling to statefiles.c
    5b01849cc42c statefiles: add a dirfd helper function
    eadde3d7dd74 statefiles: add tmp helper functions
    c29aa7091498 statefiles: fix escape sequence for broken hostname output
    00f2d7a4dbe5 dhcpv4: don't send zero IPv6-only preferred option
    c86d29bb83d6 Revert "dhcpv6-ia: add some noise to the T1 and T2 periods"
    b062769ab85f Revert "do not delegate ULA prefixes"
    fd4714bb2dfe do not delegate ULA prefixes
    81ea5bfef775 dhcpv6-ia: add some noise to the T1 and T2 periods
    
    https://github.com/openwrt/odhcpd/compare/79252ed0c0c2...ca00527e5fc3
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/services/odhcpd/Makefile           |  6 +--
 .../network/services/odhcpd/files/odhcpd.defaults  | 61 ++++++++++++++++++++--
 2 files changed, 59 insertions(+), 8 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 9d125734a7..92dfd823b4 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=7d2a69c9f514c01c4e520034554fe7da9a9fe065b9bccb9f0c7063f657c5b9fb
-PKG_SOURCE_DATE:=2025-12-04
-PKG_SOURCE_VERSION:=79252ed0c0c26659a95729da0f2accaa0ddb458d
+PKG_MIRROR_HASH:=cce1d4f3c88f4eec0cf8b19429f12e6fc2f47dca9b4d643a31569c1209f8fabc
+PKG_SOURCE_DATE:=2025-12-10
+PKG_SOURCE_VERSION:=ca00527e5fc3d8d2b8c1a60fbeb6a25e2bf68674
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0
diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults
index 76c75b060a..fbb7ec92af 100644
--- a/package/network/services/odhcpd/files/odhcpd.defaults
+++ b/package/network/services/odhcpd/files/odhcpd.defaults
@@ -1,13 +1,64 @@
 #!/bin/sh
 
+. /usr/share/libubox/jshn.sh
+
+pio_file_check() {
+	local file valid
+
+	file=$1
+	valid=0
+
+	json_init
+	json_load_file $file 2> /dev/null
+
+	if json_is_a slaac array; then
+		local keys len
+
+		json_select slaac
+		json_get_keys keys
+
+		len=$(echo $keys | wc -w)
+		if [ $len -gt 0 ]; then
+			valid=1
+		fi
+	fi
+
+	echo $valid
+}
+
+pio_folder_migrate() {
+	local piodir piofolder
+
+	piofolder=$1
+	piodir=$2
+
+	[ -d $piofolder ] || return
+	[ -d $piodir ] || mkdir -p $piodir
+
+	for file in $piofolder/*; do
+		[ -e "$file" ] || continue
+		if [ $(pio_file_check $file) -eq 1 ]; then
+			mv $file $piodir/odhcpd.pio.$(basename $file)
+		fi
+	done
+}
+
 if [ -n "$(uci -q get dhcp.odhcpd)" ]; then
-	local commit
-	local hostsfile
+	local commit hostsfile piodir piofolder
 
 	commit=0
 
-	if [ -z "$(uci -q get dhcp.odhcpd.piofolder)" ]; then
-		uci set dhcp.odhcpd.piofolder=/tmp/odhcpd-piofolder
+	piodir=$(uci -q get dhcp.odhcpd.piodir)
+	if [ -z "$piodir" ]; then
+		piodir=/tmp/odhcpd-piodir
+		uci set dhcp.odhcpd.piodir=$piodir
+		commit=1
+	fi
+
+	piofolder=$(uci -q get dhcp.odhcpd.piofolder)
+	if [ -n "$piofolder" ]; then
+		pio_folder_migrate $piofolder $piodir
+		uci delete dhcp.odhcpd.piofolder
 		commit=1
 	fi
 
@@ -78,7 +129,7 @@ set dhcp.odhcpd.maindhcp=$ODHCPDONLY
 set dhcp.odhcpd.leasefile=/tmp/odhcpd.leases
 set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
 set dhcp.odhcpd.loglevel=4
-set dhcp.odhcpd.piofolder=/tmp/odhcpd-piofolder
+set dhcp.odhcpd.piodir=/tmp/odhcpd-piodir
 set dhcp.odhcpd.hostsdir=/tmp/hosts
 set dhcp.lan.dhcpv4=$V4MODE
 set dhcp.lan.dhcpv6=$V6MODE



From lede-commits at lists.infradead.org  Wed Dec 10 10:04:50 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 13:04:50 -0500
Subject: [openwrt/openwrt]  build: depend on tools/zstd for download
In-Reply-To: <176538989096.581286.9461336023413125486@git-01.infra.openwrt.org>
References: <176538989096.581286.9461336023413125486@git-01.infra.openwrt.org>
Message-ID: <mailman.34604.1765389895.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f3e4620f592be9413a5c71fbc4b664c50a158faa

commit f3e4620f592be9413a5c71fbc4b664c50a158faa
Author: Andreas Gnau <andreas.gnau at iopsys.eu>
AuthorDate: Wed Dec 10 18:21:45 2025 +0100

    build: depend on tools/zstd for download
    
    Downloading packages from git requires zstd to compress their tarballs.
    Make sure that zstd from host tools is compiled when running make
    download. Otherwise, either the download would fail because zstd is not
    present or a random version from the host would be used leading to hash
    mismatches.
    
    Signed-off-by: Andreas Gnau <andreas.gnau at iopsys.eu>
    Link: https://github.com/openwrt/openwrt/pull/21125
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 include/toplevel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/toplevel.mk b/include/toplevel.mk
index bffbd4a0be..c55c92077f 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -201,7 +201,7 @@ else
   DOWNLOAD_DIRS = package/download
 endif
 
-download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile)
+download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile) $(if $(wildcard $(STAGING_DIR_HOST)/bin/zstd),,tools/zstd/compile)
 	@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
 
 clean dirclean: .config



From lede-commits at lists.infradead.org  Wed Dec 10 10:09:14 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 13:09:14 -0500
Subject: [openwrt/openwrt]  build: depend on tools/zstd for download
In-Reply-To: <176539015418.593380.13882003216765130534@git-01.infra.openwrt.org>
References: <176539015418.593380.13882003216765130534@git-01.infra.openwrt.org>
Message-ID: <mailman.34605.1765390158.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/c0b10f74428c92a4505c3390837cde5ef68672bd

commit c0b10f74428c92a4505c3390837cde5ef68672bd
Author: Andreas Gnau <andreas.gnau at iopsys.eu>
AuthorDate: Wed Dec 10 18:21:45 2025 +0100

    build: depend on tools/zstd for download
    
    Downloading packages from git requires zstd to compress their tarballs.
    Make sure that zstd from host tools is compiled when running make
    download. Otherwise, either the download would fail because zstd is not
    present or a random version from the host would be used leading to hash
    mismatches.
    
    Signed-off-by: Andreas Gnau <andreas.gnau at iopsys.eu>
    Link: https://github.com/openwrt/openwrt/pull/21125
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
    (cherry picked from commit f3e4620f592be9413a5c71fbc4b664c50a158faa)
---
 include/toplevel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/toplevel.mk b/include/toplevel.mk
index 092dff786c..5923d089fc 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -201,7 +201,7 @@ else
   DOWNLOAD_DIRS = package/download
 endif
 
-download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile)
+download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile) $(if $(wildcard $(STAGING_DIR_HOST)/bin/zstd),,tools/zstd/compile)
 	@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
 
 clean dirclean: .config



From lede-commits at lists.infradead.org  Wed Dec 10 10:10:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 13:10:38 -0500
Subject: [openwrt/openwrt]  loongarch64: Disable strict alignment to fix BPF
 program failures
In-Reply-To: <176539023870.598540.4116301051718995780@git-01.infra.openwrt.org>
References: <176539023870.598540.4116301051718995780@git-01.infra.openwrt.org>
Message-ID: <mailman.34606.1765390242.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9e9206427fba3ca301e9328c3d37f8ce1f14b2e7

commit 9e9206427fba3ca301e9328c3d37f8ce1f14b2e7
Author: Vincent Li <vincent.mc.li at gmail.com>
AuthorDate: Tue Dec 9 17:36:42 2025 -0800

    loongarch64: Disable strict alignment to fix BPF program failures
    
    CONFIG_ARCH_STRICT_ALIGN=y (default in config-6.12) causes BPF programs
    (XDP, TC, tracing, etc.) to fail verification with misaligned packet
    and memory access errors, breaking essential kernel functionality.
    
    Hardware support status:
    - Supported (modern CPUs): 2K2000, 2K3000, 3A5000, 3A6000, 3C5000,
                              3C6000, 3D5000
    - Unsupported (legacy): 2K500, 2K1000
    
    The current default prioritizes legacy compatibility over:
    1. BPF program functionality across multiple subsystems
    2. Performance on widely deployed modern hardware
    3. Modern kernel features relying on unaligned accesses
    
    Since BPF programs require unaligned access capabilities and most
    LoongArch deployments use modern CPUs with hardware support, disable
    CONFIG_ARCH_STRICT_ALIGN. Legacy system users can manually enable
    it if needed.
    
    Link: https://github.com/vincentmli/BPFire/issues/69
    Reference: https://elixir.bootlin.com/linux/v6.12/source/arch/loongarch/Kconfig#L534
    
    Signed-off-by: Vincent Li <vincent.mc.li at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21121
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/loongarch64/config-6.12 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/loongarch64/config-6.12 b/target/linux/loongarch64/config-6.12
index 99a587e6a7..c4fc987b6d 100644
--- a/target/linux/loongarch64/config-6.12
+++ b/target/linux/loongarch64/config-6.12
@@ -52,7 +52,7 @@ CONFIG_ARCH_MMAP_RND_BITS_MIN=12
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
 CONFIG_ARCH_STACKWALK=y
-CONFIG_ARCH_STRICT_ALIGN=y
+# CONFIG_ARCH_STRICT_ALIGN is not set
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_WANTS_NO_INSTR=y
 CONFIG_ARCH_WANTS_THP_SWAP=y



From lede-commits at lists.infradead.org  Wed Dec 10 10:11:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 13:11:29 -0500
Subject: [openwrt/openwrt]  scripts/jungo-image: Fix up whitespace
In-Reply-To: <176539028958.601283.15752180247104901388@git-01.infra.openwrt.org>
References: <176539028958.601283.15752180247104901388@git-01.infra.openwrt.org>
Message-ID: <mailman.34607.1765390293.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1c7ec8ab19ab0b6d6cb35d277fd1efff273ce36a

commit 1c7ec8ab19ab0b6d6cb35d277fd1efff273ce36a
Author: Linus Walleij <linus.walleij at linaro.org>
AuthorDate: Thu Jun 19 14:07:34 2025 +0200

    scripts/jungo-image: Fix up whitespace
    
    Recent Python versions are strict about whitespace and will
    complain about mixtures of tabs and spaces. Convert any tabs
    so the script just use spaces for indentation.
    
    Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
    Link: https://github.com/openwrt/openwrt/pull/21116
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 scripts/flashing/jungo-image.py | 78 ++++++++++++++++++++---------------------
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/scripts/flashing/jungo-image.py b/scripts/flashing/jungo-image.py
index fdd4562374..7797182169 100755
--- a/scripts/flashing/jungo-image.py
+++ b/scripts/flashing/jungo-image.py
@@ -97,21 +97,21 @@ def image_dump(tn, dumpfile):
         buf = tn.read_until("Returned 0",2)
         i = buf.find("Platform:")
         if i < 0:
-	    platform="jungo"
-	else:
-	    line=buf[i+9:]
-	    i=line.find('\n')
-	    platform=line[:i].split()[-1]
+            platform="jungo"
+        else:
+            line=buf[i+9:]
+            i=line.find('\n')
+            platform=line[:i].split()[-1]
 
         tn.write("rg_conf_print /dev/%s/mac\n" % device);
         buf = tn.read_until("Returned 0",3)
 
-	i = buf.find("mac(")
-	if i > 0:
-	    i += 4
-	else:
-	    print("No MAC address found! (use -f option)")
-	    sys.exit(1)
+        i = buf.find("mac(")
+        if i > 0:
+            i += 4
+        else:
+            print("No MAC address found! (use -f option)")
+            sys.exit(1)
         dumpfile = "%s-%s.bin" % (platform, buf[i:i+17].replace(':',''))
     else:
         tn.write("\n")
@@ -121,31 +121,31 @@ def image_dump(tn, dumpfile):
 
     t=flashsize/dumplen
     for addr in range(t):
-	if verbose:
-	    sys.stdout.write('\r%d%%'%(100*addr/t))
-	    sys.stdout.flush()
+        if verbose:
+            sys.stdout.write('\r%d%%'%(100*addr/t))
+            sys.stdout.flush()
 
         tn.write("flash_dump -r 0x%x -l %d -4\n" % (addr*dumplen, dumplen))
-	tn.read_until("\n")
+        tn.read_until("\n")
 
-	count = addr*dumplen
+        count = addr*dumplen
         while 1:
             buf = tn.read_until("\n")
             if buf.strip() == "Returned 0":
                 break
             s = buf.split()
             if s and s[0][-1] == ':':
-		a=int(s[0][:-1],16)
-		if a != count:
-		    print("Format error: %x != %x"%(a,count))
-		    sys.exit(2)
-	    	count += 16
-		f.write(binascii.a2b_hex(string.join(s[1:],'')))
-	tn.read_until(">",1)
+                a=int(s[0][:-1],16)
+                if a != count:
+                    print("Format error: %x != %x"%(a,count))
+                    sys.exit(2)
+                count += 16
+                f.write(binascii.a2b_hex(string.join(s[1:],'')))
+        tn.read_until(">",1)
 
     f.close()
     if verbose:
-	print("")
+        print("")
 
 def telnet_option(sock,cmd,option):
     #print "Option: %d %d" % (ord(cmd), ord(option))
@@ -175,27 +175,27 @@ except getopt.GetoptError:
 
 for o, a in opts:
     if o in ("-h", "--help"):
-	usage()
-	sys.exit(1)
+        usage()
+        sys.exit(1)
     elif o in ("-V", "--version"):
-	print("%s: 0.11" % sys.argv[0])
-	sys.exit(1)
+        print("%s: 0.11" % sys.argv[0])
+        sys.exit(1)
     elif o in ("-d", "--no-dump"):
-	do_dump = 1
+        do_dump = 1
     elif o in ("-f", "--file"):
-	dumpfile = a
+        dumpfile = a
     elif o in ("-u", "--user"):
-	user = a
+        user = a
     elif o in ("-p", "--pass"):
-	password = a
+        password = a
     elif o == "--port":
-	PORT = int(a)
+        PORT = int(a)
     elif o in ("-q", "--quiet"):
-	verbose = 0
+        verbose = 0
     elif o in ("-r", "--reboot"):
-	reboot = 1
+        reboot = 1
     elif o in ("-v", "--verbose"):
-	verbose = 1
+        verbose = 1
 
 # make sure we have enough arguments
 if len(args) > 0:
@@ -260,12 +260,12 @@ if imagefile or url:
         start_server(server)
 
     if verbose:
-	print("Unlocking flash...")
+        print("Unlocking flash...")
     tn.write("unlock 0 0x%x\n" % flashsize)
     buf = tn.read_until("Returned 0",5)
 
     if verbose:
-	print("Writing new image...")
+        print("Writing new image...")
     print(cmd, end=' ')
     tn.write(cmd)
     buf = tn.read_until("Returned 0",10)
@@ -273,7 +273,7 @@ if imagefile or url:
     # wait till the transfer completed
     buf = tn.read_until("Download completed successfully",20)
     if buf:
-	print("Flash update complete!")
+        print("Flash update complete!")
         if reboot:
             tn.write("reboot\n")
             print("Rebooting...")



From lede-commits at lists.infradead.org  Wed Dec 10 13:53:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 16:53:29 -0500
Subject: [openwrt/openwrt]  mac80211: backport patch fixing support for GCC15
In-Reply-To: <176540360970.1447959.14553603982302533881@git-01.infra.openwrt.org>
References: <176540360970.1447959.14553603982302533881@git-01.infra.openwrt.org>
Message-ID: <mailman.34677.1765403616.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/521087d13175e78e8e7d6e7a2e250063a169aa40

commit 521087d13175e78e8e7d6e7a2e250063a169aa40
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed Dec 10 22:48:55 2025 +0100

    mac80211: backport patch fixing support for GCC15
    
    Backport patch fixing support for GCC15 caused by __counted_by.
    
    This macro was moved to a different header in recent kernel version and
    caused wrong detection on the #ifndef condition.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...ove-__counted_by-to-compiler_types.h-head.patch | 64 ++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/package/kernel/mac80211/patches/build/130-backports-move-__counted_by-to-compiler_types.h-head.patch b/package/kernel/mac80211/patches/build/130-backports-move-__counted_by-to-compiler_types.h-head.patch
new file mode 100644
index 0000000000..ca821dc6e3
--- /dev/null
+++ b/package/kernel/mac80211/patches/build/130-backports-move-__counted_by-to-compiler_types.h-head.patch
@@ -0,0 +1,64 @@
+From b63f79524e6f30e58692bc9ee57c6e6e0dd10de4 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Wed, 10 Dec 2025 22:37:03 +0100
+Subject: [PATCH] backports: move __counted_by to compiler_types.h header
+
+Port f06e108a3dc5 ("Compiler Attributes: disable __counted_by for clang
+< 19.1.3") changes to align with new kernel version that moved the
+__counted_by to a new header file.
+
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+---
+ .../linux/compiler_attributes.h               | 15 ------------
+ .../backport-include/linux/compiler_types.h   | 23 +++++++++++++++++++
+ 2 files changed, 23 insertions(+), 15 deletions(-)
+ create mode 100644 backport-include/linux/compiler_types.h
+
+--- a/backport-include/linux/compiler_attributes.h
++++ b/backport-include/linux/compiler_attributes.h
+@@ -31,19 +31,4 @@
+ #endif
+ #endif /* fallthrough */
+ 
+-#ifndef __counted_by
+-/*
+- * Optional: only supported since gcc >= 14
+- * Optional: only supported since clang >= 17
+- *
+- *   gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896
+- * clang: https://reviews.llvm.org/D148381
+- */
+-#if __has_attribute(__element_count__)
+-# define __counted_by(member)		__attribute__((__element_count__(#member)))
+-#else
+-# define __counted_by(member)
+-#endif
+-#endif
+-
+ #endif /* _BACKPORTS_LINUX_COMPILER_ATTRIBUTES_H */
+--- /dev/null
++++ b/backport-include/linux/compiler_types.h
+@@ -0,0 +1,23 @@
++#ifndef _BACKPORTS_LINUX_COMPILER_TYPES_H
++#define _BACKPORTS_LINUX_COMPILER_TYPES_H 1
++
++#if LINUX_VERSION_IS_GEQ(6,12,1)
++#include_next <linux/compiler_types.h>
++#endif
++
++#ifndef __counted_by
++/*
++ * Optional: only supported since gcc >= 14
++ * Optional: only supported since clang >= 17
++ *
++ *   gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896
++ * clang: https://reviews.llvm.org/D148381
++ */
++#if __has_attribute(__element_count__)
++# define __counted_by(member)		__attribute__((__element_count__(#member)))
++#else
++# define __counted_by(member)
++#endif
++#endif
++
++#endif /* _BACKPORTS_LINUX_COMPILER_TYPES_H */



From lede-commits at lists.infradead.org  Wed Dec 10 14:20:27 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:20:27 -0500
Subject: [openwrt/openwrt]  iproute2: update to version 6.18
In-Reply-To: <176540522732.1524777.4547642976755395295@git-01.infra.openwrt.org>
References: <176540522732.1524777.4547642976755395295@git-01.infra.openwrt.org>
Message-ID: <mailman.34680.1765405231.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5cbafcbb67fe463883e0c985d11203d56dc3e5dc

commit 5cbafcbb67fe463883e0c985d11203d56dc3e5dc
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:38:25 2025 +0100

    iproute2: update to version 6.18
    
    The removed patch 001-lib-bridge-avoid-redefinition-of-in6_addr.patch
    was integrated upstream.
    
    Changes: https://github.com/iproute2/iproute2/compare/v6.17.0...v6.18.0
    
    The apk size did not increase much:
    Old size for armsr/armv8:
     43778 ip-bridge-6.17.0-r1.apk
    164653 ip-tiny-6.17.0-r1.apk
    208236 tc-bpf-6.17.0-r1.apk
    210209 tc-full-6.17.0-r1.apk
    172483 tc-tiny-6.17.0-r1.apk
    
    new size for armsr/armv8:
     43781 ip-bridge-6.18.0-r1.apk
    164956 ip-tiny-6.18.0-r1.apk
    208578 tc-bpf-6.18.0-r1.apk
    210482 tc-full-6.18.0-r1.apk
    172664 tc-tiny-6.18.0-r1.apk
    
    Link: https://github.com/openwrt/openwrt/pull/21101
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/utils/iproute2/Makefile            |  4 ++--
 ...lib-bridge-avoid-redefinition-of-in6_addr.patch | 27 ----------------------
 .../patches/130-no_netem_tipc_dcb_man_vdpa.patch   |  2 +-
 3 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index 1e02cd01b2..bdb4c1685d 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iproute2
-PKG_VERSION:=6.17.0
+PKG_VERSION:=6.18.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
-PKG_HASH:=9781e59410ab7dea8e9f79bb10ff1488e63d10fcbb70503b94426ba27a8e2dec
+PKG_HASH:=6ba520e1975e4c50dc931eeae91ea37c198b8a173744885f8895b84325f9d456
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=iptables
 PKG_LICENSE:=GPL-2.0
diff --git a/package/network/utils/iproute2/patches/001-lib-bridge-avoid-redefinition-of-in6_addr.patch b/package/network/utils/iproute2/patches/001-lib-bridge-avoid-redefinition-of-in6_addr.patch
deleted file mode 100644
index 166f15ccf4..0000000000
--- a/package/network/utils/iproute2/patches/001-lib-bridge-avoid-redefinition-of-in6_addr.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 7119f3736f689ab396ca4193ac593938affd55fa Mon Sep 17 00:00:00 2001
-From: Yureka <yureka at cyberchaos.dev>
-Date: Sun, 12 Oct 2025 14:39:47 +0200
-Subject: lib: bridge: avoid redefinition of in6_addr
-
-On musl libc, which does not use the kernel definitions of in6_addr, including
-the libc headers after the kernel (UAPI) headers would cause a redefinition
-error. The opposite order avoids the redefinition.
-
-Fixes: 9e89d5b94d749f37525cd8778311e1c9f28f172a
-Signed-off-by: Yureka <yureka at cyberchaos.dev>
----
- lib/bridge.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/lib/bridge.c
-+++ b/lib/bridge.c
-@@ -2,8 +2,8 @@
- 
- #include <net/if.h>
- 
--#include "bridge.h"
- #include "utils.h"
-+#include "bridge.h"
- 
- void bridge_print_vlan_flags(__u16 flags)
- {
diff --git a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch
index 7f946070f9..25a985d8d8 100644
--- a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch
+++ b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch
@@ -7,7 +7,7 @@
 -SUBDIRS=lib ip tc bridge misc netem genl man
 +SUBDIRS=lib ip tc bridge misc genl
  ifeq ($(HAVE_MNL),y)
--SUBDIRS += tipc devlink rdma dcb vdpa
+-SUBDIRS += tipc devlink rdma dcb vdpa netshaper
 +SUBDIRS += devlink rdma
  endif
  



From lede-commits at lists.infradead.org  Wed Dec 10 14:23:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:23:24 -0500
Subject: [openwrt/openwrt]  openwrt-keyring: update to Git HEAD (2025-12-10)
In-Reply-To: <176540540417.1535441.17851143770248532788@git-01.infra.openwrt.org>
References: <176540540417.1535441.17851143770248532788@git-01.infra.openwrt.org>
Message-ID: <mailman.34681.1765405408.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/04946ee8abd9f486bf2dbf13c29fc4394ab8f396

commit 04946ee8abd9f486bf2dbf13c29fc4394ab8f396
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed Dec 10 23:19:35 2025 +0100

    openwrt-keyring: update to Git HEAD (2025-12-10)
    
    f0670054fd3a apk: add OpenWrt 25.12 release build public key
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/system/openwrt-keyring/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/openwrt-keyring/Makefile b/package/system/openwrt-keyring/Makefile
index 7f237ed9fa..37b3840603 100644
--- a/package/system/openwrt-keyring/Makefile
+++ b/package/system/openwrt-keyring/Makefile
@@ -7,9 +7,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/keyring.git
-PKG_SOURCE_DATE:=2024-11-01
-PKG_SOURCE_VERSION:=fbae29d730f81c892f52e0ff00fe867444aeeae6
-PKG_MIRROR_HASH:=9a314756ddb61dde084f810ef056835addd9097ad26cb5e66efc6b38debc8aa0
+PKG_SOURCE_DATE:=2025-12-10
+PKG_SOURCE_VERSION:=f0670054fd3aa9616bcd8d0d0357a1a15c65b758
+PKG_MIRROR_HASH:=a8e0c09678109c576a54ed5101ac83131015533da899c10d9e276c200cf97b1b
 
 PKG_MAINTAINER:=John Crispin <john at phrozen.org>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Wed Dec 10 14:25:09 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:25:09 -0500
Subject: [openwrt/openwrt]  libnl: update to version 3.12
In-Reply-To: <176540550939.1539711.16217454509739152416@git-01.infra.openwrt.org>
References: <176540550939.1539711.16217454509739152416@git-01.infra.openwrt.org>
Message-ID: <mailman.34682.1765405513.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4e06003d065526fd1e1085449258034d846e6701

commit 4e06003d065526fd1e1085449258034d846e6701
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:12:49 2025 +0100

    libnl: update to version 3.12
    
    Changes: https://github.com/thom311/libnl/compare/libnl3_11_0...libnl3_12_0
    
    The apk size did not increase much:
    Old size for armsr/armv8:
       767 libnl200-3.11.0-r1.apk
     13480 libnl-cli200-3.11.0-r1.apk
     44511 libnl-core200-3.11.0-r1.apk
      9101 libnl-genl200-3.11.0-r1.apk
     32485 libnl-nf200-3.11.0-r1.apk
    185723 libnl-route200-3.11.0-r1.apk
    
    new size for armsr/armv8:
       764 libnl200-3.12.0-r1.apk
     13471 libnl-cli200-3.12.0-r1.apk
     45031 libnl-core200-3.12.0-r1.apk
      9098 libnl-genl200-3.12.0-r1.apk
     32479 libnl-nf200-3.12.0-r1.apk
    193131 libnl-route200-3.12.0-r1.apk
    
    Link: https://github.com/openwrt/openwrt/pull/21097
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/libs/libnl/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile
index f83a5ac684..a07606c8fa 100644
--- a/package/libs/libnl/Makefile
+++ b/package/libs/libnl/Makefile
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnl
-PKG_VERSION:=3.11.0
+PKG_VERSION:=3.12.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION))
-PKG_HASH:=2a56e1edefa3e68a7c00879496736fdbf62fc94ed3232c0baba127ecfa76874d
+PKG_HASH:=fc51ca7196f1a3f5fdf6ffd3864b50f4f9c02333be28be4eeca057e103c0dd18
 
 PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=COPYING



From lede-commits at lists.infradead.org  Wed Dec 10 14:28:35 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:28:35 -0500
Subject: [openwrt/openwrt]  nftables: update to version 1.1.6
In-Reply-To: <176540571423.1549991.1178118068543866474@git-01.infra.openwrt.org>
References: <176540571423.1549991.1178118068543866474@git-01.infra.openwrt.org>
Message-ID: <mailman.34683.1765405718.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/367d8b21156993a39240e2d419367fa1aa1c0ffa

commit 367d8b21156993a39240e2d419367fa1aa1c0ffa
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:18:31 2025 +0100

    nftables: update to version 1.1.6
    
    Announcement: https://lwn.net/Articles/1049470/
    Changes: https://git.netfilter.org/nftables/diff/?id=v1.1.6&id2=v1.1.5&dt=2
    
    The apk size did not increase much:
    Old size for armsr/armv8:
    318457 nftables-json-1.1.5-r1.apk
    
    new size for armsr/armv8:
    327941 nftables-json-1.1.6-r1.apk
    
    Link: https://github.com/openwrt/openwrt/pull/21096
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/utils/nftables/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile
index 580979dfb4..0147c4d057 100644
--- a/package/network/utils/nftables/Makefile
+++ b/package/network/utils/nftables/Makefile
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nftables
-PKG_VERSION:=1.1.5
+PKG_VERSION:=1.1.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
-PKG_HASH:=1daf10f322e14fd90a017538aaf2c034d7cc1eb1cc418ded47445d714ea168d4
+PKG_HASH:=372931bda8556b310636a2f9020adc710f9bab66f47efe0ce90bff800ac2530c
 
 PKG_MAINTAINER:=
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Wed Dec 10 14:28:34 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:28:34 -0500
Subject: [openwrt/openwrt]  libnftnl: update to version 1.3.1
In-Reply-To: <176540571423.1549991.1178118068543866474@git-01.infra.openwrt.org>
References: <176540571423.1549991.1178118068543866474@git-01.infra.openwrt.org>
Message-ID: <mailman.34684.1765405718.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f26294f161a854492306c87348a6e4a128f03e0d

commit f26294f161a854492306c87348a6e4a128f03e0d
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:17:15 2025 +0100

    libnftnl: update to version 1.3.1
    
    Announcement: https://lwn.net/Articles/1049279/
    Changes: https://git.netfilter.org/libnftnl/diff/?id=libnftnl-1.3.1&id2=libnftnl-1.3.0&dt=2
    
    The apk size did not increase much:
    Old size for armsr/armv8:
     62606 libnftnl11-1.3.0-r1.apk
    
    new size for armsr/armv8:
     64212 libnftnl11-1.3.1-r1.apk
    
    Link: https://github.com/openwrt/openwrt/pull/21096
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/libs/libnftnl/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile
index 117a8b4f9d..dd0de5c8d6 100644
--- a/package/libs/libnftnl/Makefile
+++ b/package/libs/libnftnl/Makefile
@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnftnl
 PKG_CPE_ID:=cpe:/a:netfilter:libnftnl
-PKG_VERSION:=1.3.0
+PKG_VERSION:=1.3.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
-PKG_HASH:=0f4be47a8bb8b77a350ee58cbd4b5fae6260ad486a527706ab15cfe1dd55a3c4
+PKG_HASH:=607da28dba66fbdeccf8ef1395dded9077e8d19f2995f9a4d45a9c2f0bcffba8
 
 PKG_MAINTAINER:=Steven Barth <steven at midlink.org>
 PKG_LICENSE:=GPL-2.0-or-later



From lede-commits at lists.infradead.org  Wed Dec 10 14:30:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:30:18 -0500
Subject: [openwrt/openwrt]  bridger: update to Git HEAD (2025-10-23)
In-Reply-To: <176540581856.1555350.12034742842946077784@git-01.infra.openwrt.org>
References: <176540581856.1555350.12034742842946077784@git-01.infra.openwrt.org>
Message-ID: <mailman.34687.1765405823.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/afdbdbae3b959bd16ebb14193ff6803b7320db38

commit afdbdbae3b959bd16ebb14193ff6803b7320db38
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:40:54 2025 +0100

    bridger: update to Git HEAD (2025-10-23)
    
    856921fb2062 nl: improve polling
    a40cb7994e92 nl: handle netlink socket buffer overflow
    9fc2bc3e3d4d bpf: skip all multicast packets
    
    Changes: https://github.com/nbd168/bridger/compare/95125f0b0be53b3b6fa6439641a75bedd962da09...9fc2bc3e3d4d3ffa63ee202ce8097620ce300e4f
    
    Link: https://github.com/openwrt/openwrt/pull/21104
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/services/bridger/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/bridger/Makefile b/package/network/services/bridger/Makefile
index 8bda59378d..00cec29882 100644
--- a/package/network/services/bridger/Makefile
+++ b/package/network/services/bridger/Makefile
@@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=bridger
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=https://github.com/nbd168/bridger
-PKG_SOURCE_DATE:=2025-10-21
-PKG_SOURCE_VERSION:=95125f0b0be53b3b6fa6439641a75bedd962da09
-PKG_MIRROR_HASH:=64ae76c53622ba79261e42bad37cd7af193377ff1a4d170a4a1bdbdf10dd42ca
+PKG_SOURCE_DATE:=2025-10-23
+PKG_SOURCE_VERSION:=9fc2bc3e3d4d3ffa63ee202ce8097620ce300e4f
+PKG_MIRROR_HASH:=111a95327337a775e202f1aded74069887ff85f308cdf3eeb994a21160110afb
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>



From lede-commits at lists.infradead.org  Wed Dec 10 14:32:23 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:32:23 -0500
Subject: [openwrt/openwrt]  libcap: update to 2.77
In-Reply-To: <176540594304.1561957.15362705692938525520@git-01.infra.openwrt.org>
References: <176540594304.1561957.15362705692938525520@git-01.infra.openwrt.org>
Message-ID: <mailman.34688.1765405947.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c25265953b9c06fafc6091982468ed0cfc30abb0

commit c25265953b9c06fafc6091982468ed0cfc30abb0
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sun Nov 23 09:58:30 2025 +0100

    libcap: update to 2.77
    
    Update to latest release.
    
    Add patch `003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch`
    to fix errors in the form of:
    ```
    /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(__stack_chk_fail.o): relocation R_X86_64_32 against symbol `__stack_chk_guard' can not be used when making a PIE object; recompile with -fPIE
    /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(strerror.o): relocation R_X86_64_32 against `.rodata.errmsgstr' can not be used when making a PIE object; recompile with -fPIE
    /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(realloc.o): relocation R_X86_64_32S against hidden symbol `__malloc_size_classes' can not be used when making a PIE object
    /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(__stdout_write.o): relocation R_X86_64_32S against hidden symbol `__stdio_write' can not be used when making a PIE object
    /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(ofl.o): relocation R_X86_64_32 against `.bss.ofl_lock' can not be used when making a PIE object; recompile with -fPIE
    /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(stderr.o): warning: relocation against `__stderr_FILE' in read-only section `.rodata.stderr'
    /usr/bin/ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
    (.text+0x12): undefined reference to `__libc_csu_fini'
    /usr/bin/ld.bfd: (.text+0x19): undefined reference to `__libc_csu_init'
    collect2: error: ld returned 1 exit status
    ```
    
    Changes: https://git.kernel.org/pub/scm/libs/libcap/libcap.git/diff/?id=v1.2.77&id2=v1.2.69&dt=2
    
    The apk size did not increase much:
    Old size for armsr/armv8:
     16245 libcap-2.69-r1.apk
    
    new size for armsr/armv8:
     16315 libcap-2.77-r1.apk
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
    Link: https://github.com/openwrt/openwrt/pull/20881
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/libs/libcap/Makefile                       |  4 ++--
 ...bcap-Add-build-ldflags-to-_makenames-rule.patch | 27 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/package/libs/libcap/Makefile b/package/libs/libcap/Makefile
index 989209302a..ab74ff4681 100644
--- a/package/libs/libcap/Makefile
+++ b/package/libs/libcap/Makefile
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcap
-PKG_VERSION:=2.69
+PKG_VERSION:=2.77
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
-PKG_HASH:=f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb
+PKG_HASH:=897bc18b44afc26c70e78cead3dbb31e154acc24bee085a5a09079a88dbf6f52
 
 PKG_MAINTAINER:=Paul Wassi <p.wassi at gmx.at>
 PKG_LICENSE:=GPL-2.0-only
diff --git a/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch b/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch
new file mode 100644
index 0000000000..7c5f03bdb9
--- /dev/null
+++ b/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch
@@ -0,0 +1,27 @@
+From 542d7d86ecd2129dd5fe7e5b31ba307304f5b319 Mon Sep 17 00:00:00 2001
+From: "Andrew G. Morgan" <morgan at kernel.org>
+Date: Mon, 10 Nov 2025 18:26:34 -0800
+Subject: [PATCH] Revert "libcap: Add build ldflags to _makenames rule"
+
+This reverts commit c3ddf45d9afaab85d3b7db0dc7bfd1aafb8fde50.
+
+The details of what this broke are here:
+
+  https://bugzilla.kernel.org/show_bug.cgi?id=220691#c2
+
+Signed-off-by: Andrew G. Morgan <morgan at kernel.org>
+---
+ libcap/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -80,7 +80,7 @@ $(PSXTITLE).pc: $(PSXTITLE).pc.in
+ 		$< >$@
+ 
+ _makenames: _makenames.c cap_names.list.h
+-	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@ $(BUILD_LDFLAGS)
++	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+ 
+ cap_names.h: _makenames
+ 	./_makenames > cap_names.h



From lede-commits at lists.infradead.org  Wed Dec 10 14:40:08 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:40:08 -0500
Subject: [openwrt/openwrt]  ucode: update to Git HEAD (2025-12-01)
In-Reply-To: <176540640819.1582732.10981898460259292493@git-01.infra.openwrt.org>
References: <176540640819.1582732.10981898460259292493@git-01.infra.openwrt.org>
Message-ID: <mailman.34689.1765406412.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e40ca676eee20fa6ea8b5ac36b3a858481ed9d79

commit e40ca676eee20fa6ea8b5ac36b3a858481ed9d79
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:20:46 2025 +0100

    ucode: update to Git HEAD (2025-12-01)
    
    afe4be60628a lib/fs: fix return value for flush
    5f08ecf8e372 lib/uloop: fix return value doc for run()
    1affe484f302 lib/uloop: pass eof and error to cb
    559860cbd76d lib: introduce io library
    ef07e2448a56 vm: optimize string+string concat with ucv_string_alloc
    
    Changes: https://github.com/jow-/ucode/compare/48ed18d2532e9197212c34473ab926c7b5e8ac73...f7c2b97a82e8b505bf4b2c0d8883b5116e1960f9
    
    Backport PR to fix compilation with Ubuntu 18.04:
    https://github.com/jow-/ucode/pull/355
    
    Link: https://github.com/openwrt/openwrt/pull/21100
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/utils/ucode/Makefile                         |  6 +++---
 .../patches/100-add-include-for-older-kernels.patch  | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile
index 1ca10cb88d..abc0c31e6f 100644
--- a/package/utils/ucode/Makefile
+++ b/package/utils/ucode/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=https://github.com/jow-/ucode.git
-PKG_SOURCE_DATE:=2025-11-19
-PKG_SOURCE_VERSION:=48ed18d2532e9197212c34473ab926c7b5e8ac73
-PKG_MIRROR_HASH:=34529706bcb413dffb3d73e78fe97971bd2b518c097c86470edadc1ca79a480c
+PKG_SOURCE_DATE:=2025-12-01
+PKG_SOURCE_VERSION:=f7c2b97a82e8b505bf4b2c0d8883b5116e1960f9
+PKG_MIRROR_HASH:=7de6a6d5b3c7392624bccefdc03e2dc61f097b414989eeced29ecc3e020bbd0b
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=ISC
 
diff --git a/package/utils/ucode/patches/100-add-include-for-older-kernels.patch b/package/utils/ucode/patches/100-add-include-for-older-kernels.patch
new file mode 100644
index 0000000000..f047bed928
--- /dev/null
+++ b/package/utils/ucode/patches/100-add-include-for-older-kernels.patch
@@ -0,0 +1,20 @@
+From 165d395ffa2a22e293160b24d4791302a156eab8 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp at gmail.com>
+Date: Mon, 8 Dec 2025 12:48:01 -0800
+Subject: add include for older kernels
+
+in6.h is needed for some macros. Seems newer kernels include this implicitly.
+---
+ lib/socket.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/lib/socket.c
++++ b/lib/socket.c
+@@ -77,6 +77,7 @@
+ #include "ucode/platform.h"
+ 
+ #if defined(__linux__)
++# include <linux/in6.h>
+ # include <linux/if_packet.h>
+ # include <linux/filter.h>
+ 



From lede-commits at lists.infradead.org  Wed Dec 10 14:49:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:49:20 -0500
Subject: [openwrt/openwrt]  mpc85xx: add support for Watchguard Firebox T10-W,
 T15(-W)
In-Reply-To: <176540695994.1616179.3082160485581054579@git-01.infra.openwrt.org>
References: <176540695994.1616179.3082160485581054579@git-01.infra.openwrt.org>
Message-ID: <mailman.34690.1765406964.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/be7aa5bda40ee05b1dd0b4f4a1bf88e653ef875a

commit be7aa5bda40ee05b1dd0b4f4a1bf88e653ef875a
Author: Shine <4c.fce2 at proton.me>
AuthorDate: Thu Oct 24 14:19:43 2024 +0200

    mpc85xx: add support for Watchguard Firebox T10-W, T15(-W)
    
    This commit adds support for the Watchguard Firebox models
    T10-W, T15 and T15-W.
    
    CPU:      Freescale P1010
    RAM:      512MB (T10) / 1024MB (T15)
    Flash:    1MB SPI-NOR, 512MB NAND (T10) / 1024MB NAND (T15)
    WiFi:     802.11abgn 2T2R AR9582 based Mini-PCIe card (-W models only)
    Ethernet: 3x GBE (via AR8033 PHY)
    LEDs:     7x hard-wired (6x LAN, 1x Power)
              4x GPIO single-colored (Attn/Status/Mode/Failover)
              1x GPIO dual-colored (2.4/5G WiFi, -W models only)
    Serial:   RJ45, Cisco pinout, 115200/8N1
    Other:    Battery backed RTC
              Atmel TPM 1.2 chip (unsupported)
    
    Based on 35f6d79, which introduced Watchguard Firebox T10 support.
    
    The T10 and T15 are identical hardware, with the exception of the T15
    having twice the flash and RAM size.
    
    The T10-W and T15-W models have their Mini-PCIe slot populated with an ath9
    (AR9582) based WiFi card. The slot is either unpopulated or empty for
    non-WiFi models. All required drivers are present by default on the mpc85xx
    target, so T10/T10-W resp. T15/T15-W can use the same OpenWrt image.
    
    This commit also introduces the zImage loader from 7d768a9 to boot the
    kernel. This is required, since the U-Boot version used in these devices
    appears to have a hard limit of 16MB for the kernel size it can handle. The
    current kernel size is around 17MB, though, due to kernel page alignment
    required for memory protection.
    
    Installation (replaces previous instructions for T10):
    
    1. If the U-Boot password is known, proceed with step 2.
    
       If the U-Boot password is unknown, dump the NOR flash using a SPI
       programmer and patch the unknown password to a known one. You can use
       blocktrron's Python script:
    
       https://github.com/blocktrron/t10-uboot-patcher/
    
       This script will patch the password to '1234' (without quotes).
    
       Alternatively, you can search for the hashed password in the NOR dump
       yourself and overwrite it with a known one. The SHA1 hash is:
    
       E597301A1D89FF3F6D318DBF4DBA0A5ABC5ECBEA
    
       Write the patched NOR dump back to the device.
    
    2. Connect the device via serial cable, power it on and interrupt
       the boot process by pressing Ctrl+C. Enter the U-Boot password to access
       the CLI.
    
    3. (Optional) Populate the uboot-env partition by entering:
    
       saveenv
    
       This will allow you to use uboot-envtools from within OpenWrt later,
       e.g. to increase the loadable kernel size.
    
       The default loadable kernel size is 5MB, the compressed kernel size at
       the time of this commit is 3.1MB.
    
    4. Serve the initramfs OpenWrt image from a TFTP server at 10.0.1.13/24,
       connected to eth0 (WAN) of the device. File name must be 'uImage'. Boot
       with:
    
       tftpboot; bootm;
    
       Make sure to use the correct image for your device (T10 resp. T15)!
    
    5. After booting, connect to OpenWrt on eth1 (LAN) via SSH. Verify
       that the UBI partiton is mtd7, format it and install the sysupgrade
       image.
    
       $ cat /proc/mtd
       $ ubiformat /dev/mtd7 -y
       $ sysupgrade -n <path to sysupgrade.bin>
    
    6. The device should now boot OpenWrt from NAND flash. Enjoy.
    
    Back to stock:
    
    Use the vendor recovery procedure.
    
    Stock recovery might also be necessary in case you have accidentally used
    the fw_setenv command from within OpenWrt without using saveenv in U-Boot
    first.
    
    In order to use the vendor firmware recovery procedure, the NAND partitions
    mtd3 to mtd6 must remain intact. Make sure not to overwrite them, or keep
    dumps of them for later recovery.
    
    Signed-off-by: Shine <4c.fce2 at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/16776
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../boot/uboot-tools/uboot-envtools/files/mpc85xx  |  3 +-
 .../mpc85xx/base-files/etc/board.d/02_network      |  3 +-
 .../mpc85xx/base-files/lib/upgrade/platform.sh     |  3 +-
 target/linux/mpc85xx/config-6.12                   |  2 +-
 .../files/arch/powerpc/boot/dts/firebox-t15.dts    | 89 ++++++++++++++++++++++
 .../files/arch/powerpc/boot/dts/firebox-t1x.dtsi   | 37 ++++++++-
 .../85xx/{firebox_t10.c => firebox_t1x.c}          | 28 +++++--
 target/linux/mpc85xx/image/p1010.mk                | 24 ++++++
 target/linux/mpc85xx/p1010/config-default          |  2 +-
 target/linux/mpc85xx/p1010/target.mk               |  2 +-
 ...108-powerpc-85xx-firebox-t10-t15-support.patch} | 12 +--
 .../109-powerpc-85xx-add-ws-ap3715i-support.patch  |  2 +-
 .../111-powerpc-85xx-hpe-msm-support.patch         |  6 +-
 13 files changed, 189 insertions(+), 24 deletions(-)

diff --git a/package/boot/uboot-tools/uboot-envtools/files/mpc85xx b/package/boot/uboot-tools/uboot-envtools/files/mpc85xx
index a74466ab3a..70d12bb7ea 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/mpc85xx
+++ b/package/boot/uboot-tools/uboot-envtools/files/mpc85xx
@@ -20,7 +20,8 @@ ocedo,panda)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
 	ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000"
 	;;
-watchguard,firebox-t10)
+watchguard,firebox-t10|\
+watchguard,firebox-t15)
 	ubootenv_add_uci_config "$(find_mtd_part 'u-boot-env')" "0x0" "0x2000" "0x10000"
 	;;
 aerohive,hiveap-330)
diff --git a/target/linux/mpc85xx/base-files/etc/board.d/02_network b/target/linux/mpc85xx/base-files/etc/board.d/02_network
index 6225f189a5..d1ebe806f1 100644
--- a/target/linux/mpc85xx/base-files/etc/board.d/02_network
+++ b/target/linux/mpc85xx/base-files/etc/board.d/02_network
@@ -29,7 +29,8 @@ ocedo,panda)
 tplink,tl-wdr4900-v1)
 	ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
 	;;
-watchguard,firebox-t10)
+watchguard,firebox-t10|\
+watchguard,firebox-t15)
 	ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
 	;;
 *)
diff --git a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
index 5d111676ae..f0875388af 100755
--- a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
@@ -16,7 +16,8 @@ platform_do_upgrade() {
 	hpe,msm460|\
 	ocedo,panda|\
 	sophos,red-15w-rev1|\
-	watchguard,firebox-t10)
+	watchguard,firebox-t10|\
+	watchguard,firebox-t15)
 		nand_do_upgrade "$1"
 		;;
 	*)
diff --git a/target/linux/mpc85xx/config-6.12 b/target/linux/mpc85xx/config-6.12
index e336a19914..d2a720ebcf 100644
--- a/target/linux/mpc85xx/config-6.12
+++ b/target/linux/mpc85xx/config-6.12
@@ -71,7 +71,7 @@ CONFIG_EDAC_LEGACY_SYSFS=y
 CONFIG_EDAC_MPC85XX=y
 CONFIG_EDAC_SUPPORT=y
 CONFIG_EXCLUSIVE_SYSTEM_RAM=y
-# CONFIG_FIREBOX_T10 is not set
+# CONFIG_FIREBOX_T1X is not set
 CONFIG_FIXED_PHY=y
 CONFIG_FORCE_NR_CPUS=y
 CONFIG_FSL_EMB_PERFMON=y
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t15.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t15.dts
new file mode 100644
index 0000000000..6a726aee8b
--- /dev/null
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t15.dts
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: GPL-2.0-or-later or MIT
+
+/include/ "fsl/p1010si-pre.dtsi"
+#include "firebox-t1x.dtsi"
+
+/ {
+	model = "Watchguard Firebox T15";
+	compatible = "watchguard,firebox-t15";
+
+	ifc: ifc at ffe1e000 {
+		reg = <0x0 0xffe1e000 0 0x2000>;
+
+		/* NOR, NAND Flashes and CPLD on board */
+		ranges = <0x0 0x0 0x0 0xee000000 0x02000000
+			0x1 0x0 0x0 0xff800000 0x00010000
+			0x3 0x0 0x0 0xffb00000 0x00000020>;
+
+		nand at 100000000 {
+			compatible = "fsl,ifc-nand";
+			reg = <0x1 0x0 0x10000>;
+
+			partitions {
+				compatible = "fixed-partitions";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				/*
+				 * Original partition layout:
+				 * 0x000000000000-0x000000020000 : "NAND (RW) WG DTB Image"
+				 * 0x000000020000-0x000000520000 : "NAND (RW) WG SYSA Kernel"
+				 * 0x000000520000-0x00000f720000 : "NAND (RW) WG SYSA_CODE"
+				 * 0x00000f720000-0x00000fc20000 : "NAND (RW) WG SYSB Kernel"
+				 * 0x00000fc20000-0x000011420000 : "NAND (RW) WG SYSB_CODE"
+				 * 0x000011420000-0x000011920000 : "NAND (RW) WG SYSA2 Kernel"
+				 * 0x000011920000-0x000019220000 : "NAND (RW) WG SYSA_CODE2"
+				 * 0x000019220000-0x000040000000 : "NAND (RW) WG SYSA_DATA"
+				 */
+
+				partition at 0 {
+					reg = <0x0 0x20000>;
+					label = "wg-dtb";
+					read-only;
+				};
+
+				partition at 20000 {
+					reg = <0x20000 0x500000>;
+					label = "kernel";
+				};
+
+				partition at 520000 {
+					reg = <0x520000 0xf200000>;
+					label = "wg-sysa-rootfs";
+					read-only;
+				};
+
+				partition at f720000 {
+					reg = <0xf720000 0x500000>;
+					label = "wg-sysb-kernel";
+					read-only;
+				};
+
+				partition at fc20000 {
+					reg = <0xfc20000 0x1800000>;
+					label = "wg-sysb-rootfs";
+					read-only;
+				};
+
+				partition at 11420000 {
+					reg = <0x11420000 0x500000>;
+					label = "wg-sysa2-kernel";
+					read-only;
+				};
+
+				partition at 11920000 {
+					reg = <0x11920000 0x7900000>;
+					label = "wg-sysa2-rootfs";
+					read-only;
+				};
+
+				partition at 19220000 {
+					reg = <0x19220000 0x26de0000>;
+					label = "ubi";
+				};
+			};
+		};
+	};
+};
+
+/include/ "fsl/p1010si-post.dtsi"
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
index 09824b46cb..5b494745e1 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
@@ -48,6 +48,21 @@
 			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
 			label = "green:failover";
 		};
+
+		led_wap_orange: wap_orange {
+			gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+			function = LED_FUNCTION_WLAN_2GHZ;
+			color = <LED_COLOR_ID_ORANGE>;
+			label = "orange:wap";
+		};
+
+		led_wap_green: wap_green {
+			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+			function = LED_FUNCTION_WLAN_5GHZ;
+			color = <LED_COLOR_ID_GREEN>;
+			label = "green:wap";
+			linux,default-trigger = "phy0tpt";
+		};
 	};
 
 	buttons {
@@ -221,6 +236,26 @@
 	};
 
 	pci1: pcie at ffe0a000 {
-		status = "disabled";
+		reg = <0 0xffe0a000 0 0x1000>;
+		ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
+			  0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
+		pcie at 0 {
+			ranges = <0x2000000 0x0 0x80000000
+				  0x2000000 0x0 0x80000000
+				  0x0 0x20000000
+
+				  0x1000000 0x0 0x0
+				  0x1000000 0x0 0x0
+				  0x0 0x100000>;
+
+			ath9k: wifi at 0,0 {
+				compatible = "pci168c,0033";
+				reg = <0x0000 0 0 0 0>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				nvmem-cells = <&macaddr_device_id_186c 0>;
+				nvmem-cell-names = "mac-address";
+			};
+		};
 	};
 };
diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t1x.c
similarity index 66%
rename from target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c
rename to target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t1x.c
index f8f90b22bf..edbdb8ba1e 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c
+++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t1x.c
@@ -34,7 +34,7 @@
 
 #include "mpc85xx.h"
 
-static void __init firebox_t10_pic_init(void)
+static void __init firebox_t1x_pic_init(void)
 {
 	struct mpic *mpic;
 
@@ -49,26 +49,40 @@ static void __init firebox_t10_pic_init(void)
 /*
  * Setup the architecture
  */
-static void __init firebox_t10_setup_arch(void)
+static void __init firebox_t1x_setup_arch(void)
 {
 	if (ppc_md.progress)
-		ppc_md.progress("firebox_t10_setup_arch()", 0);
+		ppc_md.progress("firebox_t1x_setup_arch()", 0);
 
 	fsl_pci_assign_primary();
 
-	pr_info("Firebox T10 from Watchguard\n");
+	pr_info("Firebox T10/T15 from Watchguard\n");
 }
 
 machine_arch_initcall(firebox_t10, mpc85xx_common_publish_devices);
+machine_arch_initcall(firebox_t15, mpc85xx_common_publish_devices);
 
 define_machine(firebox_t10) {
 	.name			= "P1010 RDB",
 	.compatible		= "watchguard,firebox-t10",
-	.setup_arch		= firebox_t10_setup_arch,
-	.init_IRQ		= firebox_t10_pic_init,
+	.setup_arch		= firebox_t1x_setup_arch,
+	.init_IRQ		= firebox_t1x_pic_init,
 #ifdef CONFIG_PCI
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
-	.pcibios_fixup_phb      = fsl_pcibios_fixup_phb,
+	.pcibios_fixup_phb	= fsl_pcibios_fixup_phb,
+#endif
+	.get_irq		= mpic_get_irq,
+	.progress		= udbg_progress,
+};
+
+define_machine(firebox_t15) {
+	.name			= "P1010 RDB",
+	.compatible		= "watchguard,firebox-t15",
+	.setup_arch		= firebox_t1x_setup_arch,
+	.init_IRQ		= firebox_t1x_pic_init,
+#ifdef CONFIG_PCI
+	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
+	.pcibios_fixup_phb	= fsl_pcibios_fixup_phb,
 #endif
 	.get_irq		= mpic_get_irq,
 	.progress		= udbg_progress,
diff --git a/target/linux/mpc85xx/image/p1010.mk b/target/linux/mpc85xx/image/p1010.mk
index 1f898c483f..b9d865f7e8 100644
--- a/target/linux/mpc85xx/image/p1010.mk
+++ b/target/linux/mpc85xx/image/p1010.mk
@@ -77,13 +77,37 @@ TARGET_DEVICES += tplink_tl-wdr4900-v1
 define Device/watchguard_firebox-t10
   DEVICE_VENDOR := Watchguard
   DEVICE_MODEL := Firebox T10
+  DEVICE_ALT0_VENDOR := Watchguard
+  DEVICE_ALT0_MODEL := Firebox T10-W
   DEVICE_PACKAGES := kmod-rtc-s35390a kmod-eeprom-at24
+  # This boot loader doesn't reliably boot an uncompressed image,
+  # therefore resort to gzipping the already compressed zImage
   KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb
+  KERNEL_NAME := zImage.la3000000
+  KERNEL_ENTRY := 0x3000000
+  KERNEL_LOADADDR := 0x3000000
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
 TARGET_DEVICES += watchguard_firebox-t10
 
+define Device/watchguard_firebox-t15
+  DEVICE_VENDOR := Watchguard
+  DEVICE_MODEL := Firebox T15
+  DEVICE_ALT0_VENDOR := Watchguard
+  DEVICE_ALT0_MODEL := Firebox T15-W
+  DEVICE_PACKAGES := kmod-rtc-s35390a kmod-eeprom-at24
+  # This boot loader doesn't reliably boot an uncompressed image,
+  # therefore resort to gzipping the already compressed zImage
+  KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb
+  KERNEL_NAME := zImage.la3000000
+  KERNEL_ENTRY := 0x3000000
+  KERNEL_LOADADDR := 0x3000000
+  IMAGES := sysupgrade.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += watchguard_firebox-t15
+
 define Device/sophos_red-15w-rev1
   DEVICE_VENDOR := Sophos
   DEVICE_MODEL := RED 15w
diff --git a/target/linux/mpc85xx/p1010/config-default b/target/linux/mpc85xx/p1010/config-default
index 2d5d1c9ea9..a300486087 100644
--- a/target/linux/mpc85xx/p1010/config-default
+++ b/target/linux/mpc85xx/p1010/config-default
@@ -6,7 +6,7 @@ CONFIG_CRYPTO_HASH_INFO=y
 CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_ZSTD=y
 CONFIG_DEFAULT_UIMAGE=y
-CONFIG_FIREBOX_T10=y
+CONFIG_FIREBOX_T1X=y
 # CONFIG_FSL_CORENET_CF is not set
 CONFIG_FSL_IFC=y
 CONFIG_GPIO_74X164=y
diff --git a/target/linux/mpc85xx/p1010/target.mk b/target/linux/mpc85xx/p1010/target.mk
index 6b54390863..b6236196f3 100644
--- a/target/linux/mpc85xx/p1010/target.mk
+++ b/target/linux/mpc85xx/p1010/target.mk
@@ -1,5 +1,5 @@
 BOARDNAME:=P1010
-KERNEL_IMAGES:=simpleImage.br200-wp simpleImage.tl-wdr4900-v1 simpleImage.ws-ap3715i
+KERNEL_IMAGES:=simpleImage.br200-wp simpleImage.tl-wdr4900-v1 simpleImage.ws-ap3715i zImage.la3000000
 
 define Target/Description
 	Build firmware images for P1010 based boards.
diff --git a/target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-support.patch.patch b/target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-t15-support.patch
similarity index 74%
rename from target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-support.patch.patch
rename to target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-t15-support.patch
index 2c722e4d9b..402a613834 100644
--- a/target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-support.patch.patch
+++ b/target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-t15-support.patch
@@ -4,15 +4,15 @@
  	  This board is a Concurrent Dual-Band wireless access point with a
  	  Freescale P1020 SoC.
  
-+config FIREBOX_T10
-+	bool "Watchguard Firebox T10"
++config FIREBOX_T1X
++	bool "Watchguard Firebox T10/T15"
 +	select DEFAULT_UIMAGE
 +	select ARCH_REQUIRE_GPIOLIB
 +	select GPIO_MPC8XXX
++	select PPC_ZIMAGE_LA3000000
 +	help
-+	  This option enables support for the Watchguard Firebox T10 board.
-+	  This board is a VPN Gateway-Router with a
-+	  Freescale P1010 SoC.
++	  This option enables support for the Watchguard Firebox T10/T15 board.
++	  This board is a VPN Gateway-Router with a Freescale P1010 SoC.
 +
  config MPC8540_ADS
  	bool "Freescale MPC8540 ADS"
@@ -23,7 +23,7 @@
  obj-$(CONFIG_TWR_P102x)   += twr_p102x.o
  obj-$(CONFIG_WS_AP3710I)  += ws-ap3710i.o
  obj-$(CONFIG_WS_AP3825I)  += ws-ap3825i.o
-+obj-$(CONFIG_FIREBOX_T10) += firebox_t10.o
++obj-$(CONFIG_FIREBOX_T1X) += firebox_t1x.o
  obj-$(CONFIG_CORENET_GENERIC)   += corenet_generic.o
  obj-$(CONFIG_FB_FSL_DIU)	+= t1042rdb_diu.o
  obj-$(CONFIG_RED_15W_REV1)	+= red15w_rev1.o
diff --git a/target/linux/mpc85xx/patches-6.12/109-powerpc-85xx-add-ws-ap3715i-support.patch b/target/linux/mpc85xx/patches-6.12/109-powerpc-85xx-add-ws-ap3715i-support.patch
index 37e3e5587a..761c4d9509 100644
--- a/target/linux/mpc85xx/patches-6.12/109-powerpc-85xx-add-ws-ap3715i-support.patch
+++ b/target/linux/mpc85xx/patches-6.12/109-powerpc-85xx-add-ws-ap3715i-support.patch
@@ -26,7 +26,7 @@
  obj-$(CONFIG_WS_AP3710I)  += ws-ap3710i.o
 +obj-$(CONFIG_WS_AP3715I)  += ws-ap3715i.o
  obj-$(CONFIG_WS_AP3825I)  += ws-ap3825i.o
- obj-$(CONFIG_FIREBOX_T10) += firebox_t10.o
+ obj-$(CONFIG_FIREBOX_T1X) += firebox_t1x.o
  obj-$(CONFIG_CORENET_GENERIC)   += corenet_generic.o
 --- a/arch/powerpc/boot/Makefile
 +++ b/arch/powerpc/boot/Makefile
diff --git a/target/linux/mpc85xx/patches-6.12/111-powerpc-85xx-hpe-msm-support.patch b/target/linux/mpc85xx/patches-6.12/111-powerpc-85xx-hpe-msm-support.patch
index 1d1fb4f54f..f9761d4447 100644
--- a/target/linux/mpc85xx/patches-6.12/111-powerpc-85xx-hpe-msm-support.patch
+++ b/target/linux/mpc85xx/patches-6.12/111-powerpc-85xx-hpe-msm-support.patch
@@ -1,8 +1,8 @@
 --- a/arch/powerpc/platforms/85xx/Kconfig
 +++ b/arch/powerpc/platforms/85xx/Kconfig
-@@ -114,6 +114,18 @@ config FIREBOX_T10
- 	  This board is a VPN Gateway-Router with a
- 	  Freescale P1010 SoC.
+@@ -114,6 +114,18 @@ config FIREBOX_T1X
+ 	  This option enables support for the Watchguard Firebox T10/T15 board.
+ 	  This board is a VPN Gateway-Router with a Freescale P1010 SoC.
  
 +config MSM460
 +	bool "HPE MSM460"



From lede-commits at lists.infradead.org  Wed Dec 10 14:49:19 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:49:19 -0500
Subject: [openwrt/openwrt]  mpc85xx: p1010: use common DTSI for Watchguard
 Firebox T1X
In-Reply-To: <176540695994.1616179.3082160485581054579@git-01.infra.openwrt.org>
References: <176540695994.1616179.3082160485581054579@git-01.infra.openwrt.org>
Message-ID: <mailman.34693.1765406964.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/15ef024805f15fd1495f9cfa129a3e29d5b349ff

commit 15ef024805f15fd1495f9cfa129a3e29d5b349ff
Author: Shine <4c.fce2 at proton.me>
AuthorDate: Thu Oct 24 18:17:43 2024 +0200

    mpc85xx: p1010: use common DTSI for Watchguard Firebox T1X
    
    In preparation of adding support for additional Watchguard Firebox devices
    based on Freescale P1010, introduce a common DTSI.
    
    Signed-off-by: Shine <4c.fce2 at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/16776
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files/arch/powerpc/boot/dts/firebox-t10.dts    | 219 +--------------------
 .../boot/dts/{firebox-t10.dts => firebox-t1x.dtsi} |  90 +--------
 2 files changed, 6 insertions(+), 303 deletions(-)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
index 7f6235ad35..a610d75f5e 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
@@ -1,229 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-or-later or MIT
 
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/leds/common.h>
-#include <dt-bindings/gpio/gpio.h>
-
 /include/ "fsl/p1010si-pre.dtsi"
+#include "firebox-t1x.dtsi"
 
 / {
 	model = "Watchguard Firebox T10";
 	compatible = "watchguard,firebox-t10";
 
-	chosen {
-		bootargs = "console=ttyS0,115200";
-		bootargs-override = "console=ttyS0,115200";
-	};
-
-	aliases {
-		spi0 = &spi0;
-		led-boot = &led_mode;
-		led-failsafe = &led_failover;
-		led-running = &led_mode;
-		led-upgrade = &led_attention;
-		/delete-property/ ethernet0;
-		/delete-property/ ethernet1;
-		/delete-property/ ethernet2;
-	};
-
-	memory {
-		device_type = "memory";
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led_attention: attention_orange {
-			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
-			label = "orange:attention";
-		};
-
-		status_red {
-			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
-			function = LED_FUNCTION_STATUS;
-			color = <LED_COLOR_ID_RED>;
-		};
-
-		led_mode: mode_green {
-			gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
-			label = "green:mode";
-		};
-
-		led_failover: failover_green {
-			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
-			label = "green:failover";
-		};
-	};
-
-	buttons {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "Reset button";
-			gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_RESTART>;
-		};
-	};
-
-
-	soc: soc at ffe00000 {
-		ranges = <0x0 0x0 0xffe00000 0x100000>;
-
-		i2c at 3000 {
-			rtc at 30 {
-				compatible = "sii,s35390a";
-				reg = <0x30>;
-			};
-		};
-
-		spi0: spi at 7000 {
-			flash at 0 {
-				compatible = "jedec,spi-nor";
-				reg = <0>;
-				spi-max-frequency = <25000000>;
-
-				partitions {
-					compatible = "fixed-partitions";
-					#address-cells = <1>;
-					#size-cells = <1>;
-
-					uboot: partition at 0 {
-						reg = <0x0 0x90000>;
-						label = "u-boot";
-						read-only;
-					};
-
-					partition at 90000 {
-						reg = <0x90000 0x10000>;
-						label = "u-boot-env";
-					};
-
-					partition at a0000 {
-						reg = <0xa0000 0x20000>;
-						label = "cfgxxx";
-						read-only;
-					};
-
-					partition at c0000 {
-						reg = <0xc0000 0x40000>;
-						label = "device_id";
-						read-only;
-
-						nvmem-layout {
-							compatible = "fixed-layout";
-							#address-cells = <1>;
-							#size-cells = <1>;
-
-							macaddr_device_id_1830: mac-address at 1830 {
-								compatible = "mac-base";
-								reg = <0x1830 0x11>;
-								#nvmem-cell-cells = <1>;
-							};
-
-							macaddr_device_id_1844: mac-address at 1844 {
-								compatible = "mac-base";
-								reg = <0x1844 0x11>;
-								#nvmem-cell-cells = <1>;
-							};
-
-							macaddr_device_id_1858: mac-address at 1858 {
-								compatible = "mac-base";
-								reg = <0x1858 0x11>;
-								#nvmem-cell-cells = <1>;
-							};
-						};
-					};
-				};
-			};
-		};
-
-		gpio0: gpio-controller at fc00 {
-		};
-
-		usb at 22000 {
-			phy_type = "utmi";
-			dr_mode = "host";
-		};
-
-		mdio at 24000 {
-			phy1: ethernet-phy at 1 {
-				reg = <0x1>;
-			};
-
-			phy2: ethernet-phy at 2 {
-				reg = <0x2>;
-			};
-
-			phy3: ethernet-phy at 3 {
-				reg = <0x3>;
-			};
-		};
-
-		mdio at 25000 {
-			tbi_phy1: tbi-phy at 11 {
-				reg = <0x11>;
-				device_type = "tbi-phy";
-			};
-		};
-
-		mdio at 26000 {
-			tbi_phy2: tbi-phy at 11 {
-				reg = <0x11>;
-				device_type = "tbi-phy";
-			};
-		};
-
-		enet0: ethernet at b0000 {
-			phy-handle = <&phy1>;
-			phy-connection-type = "rgmii-id";
-
-			nvmem-cells = <&macaddr_device_id_1830 0>;
-			nvmem-cell-names = "mac-address";
-		};
-
-		enet1: ethernet at b1000 {
-			tbi-handle = <&tbi_phy1>;
-			phy-handle = <&phy2>;
-			phy-connection-type = "sgmii";
-
-			nvmem-cells = <&macaddr_device_id_1844 0>;
-			nvmem-cell-names = "mac-address";
-		};
-
-		enet2: ethernet at b2000 {
-			tbi-handle = <&tbi_phy2>;
-			phy-handle = <&phy3>;
-			phy-connection-type = "sgmii";
-
-			nvmem-cells = <&macaddr_device_id_1858 0>;
-			nvmem-cell-names = "mac-address";
-		};
-
-		sdhc at 2e000 {
-			status = "disabled";
-		};
-
-		serial1: serial at 4600 {
-			status = "disabled";
-		};
-
-		can0: can at 1c000 {
-			status = "disabled";
-		};
-
-		can1: can at 1d000 {
-			status = "disabled";
-		};
-	};
-
-	pci0: pcie at ffe09000 {
-		status = "disabled";
-	};
-
-	pci1: pcie at ffe0a000 {
-		status = "disabled";
-	};
-
 	ifc: ifc at ffe1e000 {
 		reg = <0x0 0xffe1e000 0 0x2000>;
 
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
similarity index 66%
copy from target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
copy to target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
index 7f6235ad35..09824b46cb 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
@@ -4,12 +4,7 @@
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/gpio.h>
 
-/include/ "fsl/p1010si-pre.dtsi"
-
 / {
-	model = "Watchguard Firebox T10";
-	compatible = "watchguard,firebox-t10";
-
 	chosen {
 		bootargs = "console=ttyS0,115200";
 		bootargs-override = "console=ttyS0,115200";
@@ -131,6 +126,11 @@
 								reg = <0x1858 0x11>;
 								#nvmem-cell-cells = <1>;
 							};
+							macaddr_device_id_186c: mac-address at 186c {
+								compatible = "mac-base";
+								reg = <0x186c 0x11>;
+								#nvmem-cell-cells = <1>;
+							};
 						};
 					};
 				};
@@ -223,84 +223,4 @@
 	pci1: pcie at ffe0a000 {
 		status = "disabled";
 	};
-
-	ifc: ifc at ffe1e000 {
-		reg = <0x0 0xffe1e000 0 0x2000>;
-
-		/* NOR, NAND Flashes and CPLD on board */
-		ranges = <0x0 0x0 0x0 0xee000000 0x02000000
-			0x1 0x0 0x0 0xff800000 0x00010000
-			0x3 0x0 0x0 0xffb00000 0x00000020>;
-
-		nand at 100000000 {
-			compatible = "fsl,ifc-nand";
-			reg = <0x1 0x0 0x10000>;
-
-			partitions {
-				compatible = "fixed-partitions";
-				#address-cells = <1>;
-				#size-cells = <1>;
-
-				/*
-				 * Original partition layout:
-				 * 0x000000000000-0x000000020000 : "NAND (RW) WG DTB Image"
-				 * 0x000000020000-0x000000520000 : "NAND (RW) WG SYSA Kernel"
-				 * 0x000000520000-0x000007f00000 : "NAND (RW) WG SYSA_CODE"
-				 * 0x000007f00000-0x000008400000 : "NAND (RW) WG SYSB Kernel"
-				 * 0x000008400000-0x000009c00000 : "NAND (RW) WG SYSB_CODE"
-				 * 0x000009c00000-0x00000a100000 : "NAND (RW) WG SYSA2 Kernel"
-				 * 0x00000a100000-0x000011ae0000 : "NAND (RW) WG SYSA_CODE2"
-				 * 0x000011ae0000-0x000020000000 : "NAND (RW) WG SYSA_DATA"
-				 */
-
-				partition at 0 {
-					reg = <0x0 0x20000>;
-					label = "wg-dtb";
-					read-only;
-				};
-
-				partition at 20000 {
-					reg = <0x20000 0x500000>;
-					label = "kernel";
-				};
-
-				partition at 520000 {
-					reg = <0x520000 0x79e0000>;
-					label = "wg-sysa-rootfs";
-					read-only;
-				};
-
-				partition at 7f00000 {
-					reg = <0x7f00000 0x500000>;
-					label = "wg-sysb-kernel";
-					read-only;
-				};
-
-				partition at 8400000 {
-					reg = <0x8400000 0x1800000>;
-					label = "wg-sysb-rootfs";
-					read-only;
-				};
-
-				partition at 9c00000 {
-					reg = <0x9c00000 0x500000>;
-					label = "wg-sysa2-kernel";
-					read-only;
-				};
-
-				partition at a100000 {
-					reg = <0xa100000 0x79e0000>;
-					label = "wg-sysa2-rootfs";
-					read-only;
-				};
-
-				partition at 11ae0000 {
-					reg = <0x11ae0000 0xe520000>;
-					label = "ubi";
-				};
-			};
-		};
-	};
 };
-
-/include/ "fsl/p1010si-post.dtsi"



From lede-commits at lists.infradead.org  Wed Dec 10 14:56:12 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 17:56:12 -0500
Subject: [openwrt/openwrt]  kernel: add network teaming modules
In-Reply-To: <176540737298.1652108.6405192576887756300@git-01.infra.openwrt.org>
References: <176540737298.1652108.6405192576887756300@git-01.infra.openwrt.org>
Message-ID: <mailman.34696.1765407376.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8b05db405bb98b764f6b3e7a500e3ee10199657b

commit 8b05db405bb98b764f6b3e7a500e3ee10199657b
Author: Qingfang Deng <dqfext at gmail.com>
AuthorDate: Wed Dec 10 09:28:29 2025 +0800

    kernel: add network teaming modules
    
    Teaming is a link aggregation implementation similar to bonding, but
    it's configured by a userspace program.
    
    Signed-off-by: Qingfang Deng <dqfext at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21120
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/linux/modules/netsupport.mk | 65 ++++++++++++++++++++++++++++++
 target/linux/generic/config-6.12           |  5 +++
 2 files changed, 70 insertions(+)

diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk
index 7ae729f6ba..82c992b853 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -1654,3 +1654,68 @@ define KernelPackage/packet-diag
 endef
 
 $(eval $(call KernelPackage,packet-diag))
+
+define KernelPackage/team
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Ethernet team driver
+  KCONFIG:=CONFIG_NET_TEAM
+  FILES:=$(LINUX_DIR)/drivers/net/team/team.ko
+  AUTOLOAD:=$(call AutoProbe,team)
+endef
+
+$(eval $(call KernelPackage,team))
+
+define KernelPackage/team-mode-broadcast
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Broadcast mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_BROADCAST
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_broadcast.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_broadcast)
+endef
+
+$(eval $(call KernelPackage,team-mode-broadcast))
+
+define KernelPackage/team-mode-roundrobin
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Round-robin mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_ROUNDROBIN
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_roundrobin.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_roundrobin)
+endef
+
+$(eval $(call KernelPackage,team-mode-roundrobin))
+
+define KernelPackage/team-mode-random
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Random mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_RANDOM
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_random.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_random)
+endef
+
+$(eval $(call KernelPackage,team-mode-random))
+
+define KernelPackage/team-mode-activebackup
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Active-backup mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_ACTIVEBACKUP
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_activebackup.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_activebackup)
+endef
+
+$(eval $(call KernelPackage,team-mode-activebackup))
+
+define KernelPackage/team-mode-loadbalance
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Load-balance mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_LOADBALANCE
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_loadbalance.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_loadbalance)
+endef
+
+$(eval $(call KernelPackage,team-mode-loadbalance))
diff --git a/target/linux/generic/config-6.12 b/target/linux/generic/config-6.12
index 2b96eb286c..fda78b422e 100644
--- a/target/linux/generic/config-6.12
+++ b/target/linux/generic/config-6.12
@@ -4223,6 +4223,11 @@ CONFIG_NET_SOCK_MSG=y
 CONFIG_NET_SWITCHDEV=y
 # CONFIG_NET_TC_SKB_EXT is not set
 # CONFIG_NET_TEAM is not set
+# CONFIG_NET_TEAM_MODE_ACTIVEBACKUP is not set
+# CONFIG_NET_TEAM_MODE_BROADCAST is not set
+# CONFIG_NET_TEAM_MODE_LOADBALANCE is not set
+# CONFIG_NET_TEAM_MODE_RANDOM is not set
+# CONFIG_NET_TEAM_MODE_ROUNDROBIN is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_NET_UDP_TUNNEL is not set
 CONFIG_NET_VENDOR_3COM=y



From lede-commits at lists.infradead.org  Wed Dec 10 15:01:40 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:01:40 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: rearrange some
 images
In-Reply-To: <176540770052.1674818.4052339230042357968@git-01.infra.openwrt.org>
References: <176540770052.1674818.4052339230042357968@git-01.infra.openwrt.org>
Message-ID: <mailman.34697.1765407704.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/69918d1e0bde11b99076eaf4ec93443cade8840f

commit 69918d1e0bde11b99076eaf4ec93443cade8840f
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Tue Mar 11 23:15:20 2025 +0800

    arm-trusted-firmware-mediatek: rearrange some images
    
    Rearrange some images to maintain consistency.
    
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    Link: https://github.com/openwrt/openwrt/pull/21000
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../boot/arm-trusted-firmware-mediatek/Makefile    | 34 +++++++++++-----------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index 7045133739..7bb4e7bd31 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -139,6 +139,14 @@ define Trusted-Firmware-A/mt7622-sdmmc-2ddr
   DDR3_FLYBY:=1
 endef
 
+define Trusted-Firmware-A/mt7981-nor-ddr4
+  NAME:=MediaTek MT7981 (SPI-NOR, DDR4)
+  BOOT_DEVICE:=nor
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7981
+  DDR_TYPE:=ddr4
+endef
+
 define Trusted-Firmware-A/mt7981-ram-ddr4
   NAME:=MediaTek MT7981 (RAM, DDR4)
   BOOT_DEVICE:=ram
@@ -186,14 +194,6 @@ define Trusted-Firmware-A/mt7981-ram-ddr3
   DEFAULT:=TARGET_mediatek_filogic
 endef
 
-define Trusted-Firmware-A/mt7981-nor-ddr4
-  NAME:=MediaTek MT7981 (SPI-NOR, DDR4)
-  BOOT_DEVICE:=nor
-  BUILD_SUBTARGET:=filogic
-  PLAT:=mt7981
-  DDR_TYPE:=ddr4
-endef
-
 define Trusted-Firmware-A/mt7981-emmc-ddr3
   NAME:=MediaTek MT7981 (eMMC, DDR3)
   BOOT_DEVICE:=emmc
@@ -244,6 +244,15 @@ define Trusted-Firmware-A/mt7981-spim-nand-ddr3-1866mhz
   DDR3_FREQ_1866:=1
 endef
 
+define Trusted-Firmware-A/mt7981-spim-nand-ubi-ddr4
+  NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
+  BOOT_DEVICE:=spim-nand
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7981
+  DDR_TYPE:=ddr4
+  USE_UBI:=1
+endef
+
 define Trusted-Firmware-A/mt7981-cudy-tr3000-v1
   NAME:=Cudy TR3000 v1 (SPI-NAND via SPIM, DDR3)
   BOOT_DEVICE:=spim-nand
@@ -265,15 +274,6 @@ define Trusted-Firmware-A/mt7986-ram-ddr4
   DEFAULT:=TARGET_mediatek_filogic
 endef
 
-define Trusted-Firmware-A/mt7981-spim-nand-ubi-ddr4
-  NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
-  BOOT_DEVICE:=spim-nand
-  BUILD_SUBTARGET:=filogic
-  PLAT:=mt7981
-  DDR_TYPE:=ddr4
-  USE_UBI:=1
-endef
-
 define Trusted-Firmware-A/mt7986-nor-ddr4
   NAME:=MediaTek MT7986 (SPI-NOR, DDR4)
   BOOT_DEVICE:=nor



From lede-commits at lists.infradead.org  Wed Dec 10 15:01:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:01:41 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: add MT7981 sdmmc
 images
In-Reply-To: <176540770052.1674818.4052339230042357968@git-01.infra.openwrt.org>
References: <176540770052.1674818.4052339230042357968@git-01.infra.openwrt.org>
Message-ID: <mailman.34698.1765407705.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3b14ace444c8597ea67738b16b9fa39ae3bc2de3

commit 3b14ace444c8597ea67738b16b9fa39ae3bc2de3
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Mon Mar 10 23:15:38 2025 +0800

    arm-trusted-firmware-mediatek: add MT7981 sdmmc images
    
    Add bl2 images for mt7981 sdmmc ddr4 devices.
    
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    Link: https://github.com/openwrt/openwrt/pull/21000
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/arm-trusted-firmware-mediatek/Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index 7bb4e7bd31..f90915ed67 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -166,6 +166,14 @@ define Trusted-Firmware-A/mt7981-emmc-ddr4
   DDR_TYPE:=ddr4
 endef
 
+define Trusted-Firmware-A/mt7981-sdmmc-ddr4
+  NAME:=MediaTek MT7981 (SD card, DDR4)
+  BOOT_DEVICE:=sdmmc
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7981
+  DDR_TYPE:=ddr4
+endef
+
 define Trusted-Firmware-A/mt7981-spim-nand-ddr4
   NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
   BOOT_DEVICE:=spim-nand
@@ -643,6 +651,7 @@ TFA_TARGETS:= \
 	mt7981-spim-nand-ubi-ddr4 \
 	mt7981-ram-ddr4 \
 	mt7981-emmc-ddr4 \
+	mt7981-sdmmc-ddr4 \
 	mt7981-spim-nand-ddr4 \
 	mt7981-cudy-tr3000-v1 \
 	mt7986-ram-ddr3 \



From lede-commits at lists.infradead.org  Wed Dec 10 15:01:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:01:43 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: remove DDR combo
 for MT7987
In-Reply-To: <176540770052.1674818.4052339230042357968@git-01.infra.openwrt.org>
References: <176540770052.1674818.4052339230042357968@git-01.infra.openwrt.org>
Message-ID: <mailman.34701.1765407705.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/bb2d9c1a65424f318bcda46237e82d170c95688b

commit bb2d9c1a65424f318bcda46237e82d170c95688b
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Tue Nov 11 21:10:36 2025 +0800

    arm-trusted-firmware-mediatek: remove DDR combo for MT7987
    
    The DRAM_USE_COMB option is only valid for the MT7988. There
    is no DRAM type selection for the MT7987, so remove it.
    
    Fixes: de8fc8b ("arm-trusted-firmware-mediatek: add builds for MT7987")
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    Link: https://github.com/openwrt/openwrt/pull/21000
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/arm-trusted-firmware-mediatek/Makefile | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index 24fa97e5ce..3ce3b582fb 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -408,7 +408,6 @@ define Trusted-Firmware-A/mt7987-emmc-comb
   BOOT_DEVICE:=emmc
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
 endef
 
 define Trusted-Firmware-A/mt7987-emmc-ddr4-4bg
@@ -424,7 +423,6 @@ define Trusted-Firmware-A/mt7987-nor-comb
   BOOT_DEVICE:=nor
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
 endef
 
 define Trusted-Firmware-A/mt7987-sdmmc-comb
@@ -432,7 +430,6 @@ define Trusted-Firmware-A/mt7987-sdmmc-comb
   BOOT_DEVICE:=sdmmc
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
 endef
 
 define Trusted-Firmware-A/mt7987-sdmmc-ddr4-4bg
@@ -448,7 +445,6 @@ define Trusted-Firmware-A/mt7987-spim-nand0-ubi-comb
   BOOT_DEVICE:=spim-nand
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
   USE_UBI:=1
   SPIM_CTRL:=0
 endef
@@ -458,7 +454,6 @@ define Trusted-Firmware-A/mt7987-spim-nand2-ubi-comb
   BOOT_DEVICE:=spim-nand
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
   USE_UBI:=1
   SPIM_CTRL:=2
 endef
@@ -468,7 +463,6 @@ define Trusted-Firmware-A/mt7987-ram-comb
   BOOT_DEVICE:=ram
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
   RAM_BOOT_UART_DL:=1
   HIDDEN:=
   DEFAULT:=TARGET_mediatek_filogic



From lede-commits at lists.infradead.org  Wed Dec 10 15:01:42 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:01:42 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: add MT7987 DDR4 4BG
 images
In-Reply-To: <176540770052.1674818.4052339230042357968@git-01.infra.openwrt.org>
References: <176540770052.1674818.4052339230042357968@git-01.infra.openwrt.org>
Message-ID: <mailman.34702.1765407706.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f037a2e8bb86d0edd4a4913afd69d39b60a03062

commit f037a2e8bb86d0edd4a4913afd69d39b60a03062
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Mon Nov 10 18:16:30 2025 +0800

    arm-trusted-firmware-mediatek: add MT7987 DDR4 4BG images
    
    Add the DDR4_4BG_MODE option, which supports 4GB DDR4 RAM
    for the MT7987 and 8GB DDR4 RAM for the MT7988. If this mode
    is not enabled, bl2 can only recognize half the size of RAM.
    
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    Link: https://github.com/openwrt/openwrt/pull/21000
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/arm-trusted-firmware-mediatek/Makefile | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index f90915ed67..24fa97e5ce 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -30,6 +30,7 @@ define Trusted-Firmware-A/Default
   BOOT_DEVICE:=
   DDR3_FLYBY:=
   DDR3_FREQ_1866:=
+  DDR4_4BG_MODE:=
   DDR_TYPE:=
   NAND_TYPE:=
   BOARD_QFN:=
@@ -410,6 +411,14 @@ define Trusted-Firmware-A/mt7987-emmc-comb
   DRAM_USE_COMB:=1
 endef
 
+define Trusted-Firmware-A/mt7987-emmc-ddr4-4bg
+  NAME:=MediaTek MT7987 (eMMC, DDR4 4GB)
+  BOOT_DEVICE:=emmc
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7987
+  DDR4_4BG_MODE:=1
+endef
+
 define Trusted-Firmware-A/mt7987-nor-comb
   NAME:=MediaTek MT7987 (NOR)
   BOOT_DEVICE:=nor
@@ -426,6 +435,14 @@ define Trusted-Firmware-A/mt7987-sdmmc-comb
   DRAM_USE_COMB:=1
 endef
 
+define Trusted-Firmware-A/mt7987-sdmmc-ddr4-4bg
+  NAME:=MediaTek MT7987 (SD card, DDR4 4GB)
+  BOOT_DEVICE:=sdmmc
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7987
+  DDR4_4BG_MODE:=1
+endef
+
 define Trusted-Firmware-A/mt7987-spim-nand0-ubi-comb
   NAME:=MediaTek MT7987 (SPI-NAND via SPIM, UBI)
   BOOT_DEVICE:=spim-nand
@@ -670,8 +687,10 @@ TFA_TARGETS:= \
 	mt7986-spim-nand-ubi-ddr4 \
 	mt7986-spim-nand-4k-ddr4 \
 	mt7987-emmc-comb \
+	mt7987-emmc-ddr4-4bg \
 	mt7987-nor-comb \
 	mt7987-sdmmc-comb \
+	mt7987-sdmmc-ddr4-4bg \
 	mt7987-spim-nand0-ubi-comb \
 	mt7987-spim-nand2-ubi-comb \
 	mt7987-ram-comb \
@@ -705,6 +724,7 @@ TFA_MAKE_FLAGS += \
 	HAVE_DRAM_OBJ_FILE=yes \
 	$(if $(DDR3_FLYBY),DDR3_FLYBY=1) \
 	$(if $(DDR3_FREQ_1866),DDR3_FREQ_1866=1) \
+	$(if $(DDR4_4BG_MODE),DDR4_4BG_MODE=1) \
 	$(if $(DRAM_USE_COMB),DRAM_USE_COMB=1) \
 	$(if $(RAM_BOOT_UART_DL),RAM_BOOT_UART_DL=1) \
 	$(if $(USE_UBI),UBI=1 $(if $(findstring mt7622,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x80000)) \



From lede-commits at lists.infradead.org  Wed Dec 10 15:27:16 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:27:16 -0500
Subject: [openwrt/openwrt]  bcm27xx: fix patch wrong CRLF line-ending
In-Reply-To: <176540923689.1741649.4152455752402095432@git-01.infra.openwrt.org>
References: <176540923689.1741649.4152455752402095432@git-01.infra.openwrt.org>
Message-ID: <mailman.34703.1765409241.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/86bd55c4fd0f3ffe6bf7df672b051900352af3ad

commit 86bd55c4fd0f3ffe6bf7df672b051900352af3ad
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Sat Nov 29 00:21:04 2025 +0800

    bcm27xx: fix patch wrong CRLF line-ending
    
    Use Unix LF style instead of Windows CRLF style.
    
    Fixes: 738876e76bb2 ("kernel: bump 6.12 to 6.12.58")
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/20973
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...dv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch b/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch
index d67112a069..1ec30edc79 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch
@@ -1,14 +1,14 @@
-From 954129f16c200e41a00ebebe2e22efc01b243538 Mon Sep 17 00:00:00 2001
-From: Dom Cobley <popcornmix at gmail.com>
-Date: Fri, 14 Nov 2025 14:08:18 +0000
-Subject: [PATCH] Revert "Revert "media: i2c: adv7180: Add support for
- V4L2_CID_LINK_FREQ""
-
-This reverts commit 00ecb85c58501f8f7ae75fcb069bbbad5542e853.
----
- drivers/media/i2c/adv7180.c | 39 +++++++++++++++++++++++++++++++++++--
- 1 file changed, 37 insertions(+), 2 deletions(-)
-
+From 954129f16c200e41a00ebebe2e22efc01b243538 Mon Sep 17 00:00:00 2001
+From: Dom Cobley <popcornmix at gmail.com>
+Date: Fri, 14 Nov 2025 14:08:18 +0000
+Subject: [PATCH] Revert "Revert "media: i2c: adv7180: Add support for
+ V4L2_CID_LINK_FREQ""
+
+This reverts commit 00ecb85c58501f8f7ae75fcb069bbbad5542e853.
+---
+ drivers/media/i2c/adv7180.c | 39 +++++++++++++++++++++++++++++++++++--
+ 1 file changed, 37 insertions(+), 2 deletions(-)
+
 --- a/drivers/media/i2c/adv7180.c
 +++ b/drivers/media/i2c/adv7180.c
 @@ -189,6 +189,16 @@



From lede-commits at lists.infradead.org  Wed Dec 10 15:50:17 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:50:17 -0500
Subject: [openwrt/openwrt]  OpenWrt v25.12: set branch defaults
In-Reply-To: <176541061723.1801917.11095094674782496367@git-01.infra.openwrt.org>
References: <176541061723.1801917.11095094674782496367@git-01.infra.openwrt.org>
Message-ID: <mailman.34706.1765410621.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/12316d0280c5b45b95f8a15d3e7536e5b709da5a

commit 12316d0280c5b45b95f8a15d3e7536e5b709da5a
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 11 00:49:28 2025 +0100

    OpenWrt v25.12: set branch defaults
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 feeds.conf.default                      | 13 +++++--------
 include/version.mk                      |  4 ++--
 package/base-files/image-config.in      |  2 +-
 package/system/openwrt-keyring/Makefile |  2 +-
 4 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index 05f5c8c47c..c28e51d2b2 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,8 +1,5 @@
-src-git packages https://git.openwrt.org/feed/packages.git
-src-git luci https://git.openwrt.org/project/luci.git
-src-git routing https://git.openwrt.org/feed/routing.git
-src-git telephony https://git.openwrt.org/feed/telephony.git
-src-git video https://github.com/openwrt/video.git
-#src-git targets https://github.com/openwrt/targets.git
-#src-git oldpackages http://git.openwrt.org/packages.git
-#src-link custom /usr/src/openwrt/custom-feed
+src-git packages https://git.openwrt.org/feed/packages.git;openwrt-25.12
+src-git luci https://git.openwrt.org/project/luci.git;openwrt-25.12
+src-git routing https://git.openwrt.org/feed/routing.git;openwrt-25.12
+src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-25.12
+src-git video https://github.com/openwrt/video.git;openwrt-25.12
diff --git a/include/version.mk b/include/version.mk
index b1e414f189..0f0d8b0312 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -27,13 +27,13 @@ PKG_CONFIG_DEPENDS += \
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),25.12-SNAPSHOT)
 
 VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
 VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
 
 VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/snapshots)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/25.12-SNAPSHOT)
 
 VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index 67ef4d415a..f1439550b0 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -190,7 +190,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "https://downloads.openwrt.org/snapshots"
+		default "https://downloads.openwrt.org/releases/25.12-SNAPSHOT"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
diff --git a/package/system/openwrt-keyring/Makefile b/package/system/openwrt-keyring/Makefile
index 37b3840603..9cbc03f0f6 100644
--- a/package/system/openwrt-keyring/Makefile
+++ b/package/system/openwrt-keyring/Makefile
@@ -33,7 +33,7 @@ Build/Compile=
 ifneq ($(CONFIG_USE_APK),)
 define Package/openwrt-keyring/install
 	$(INSTALL_DIR) $(1)/etc/apk/keys/
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/apk/openwrt-snapshots.pem $(1)/etc/apk/keys/
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/apk/openwrt-25.12.pem $(1)/etc/apk/keys/
 endef
 else
 define Package/openwrt-keyring/install



From lede-commits at lists.infradead.org  Wed Dec 10 15:58:55 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:58:55 -0500
Subject: [openwrt/openwrt]  kernel: add network teaming modules
In-Reply-To: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
References: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
Message-ID: <mailman.34707.1765411135.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/cd88eb969fd8a1ca497184a8b76ec706d24d9d30

commit cd88eb969fd8a1ca497184a8b76ec706d24d9d30
Author: Qingfang Deng <dqfext at gmail.com>
AuthorDate: Wed Dec 10 09:28:29 2025 +0800

    kernel: add network teaming modules
    
    Teaming is a link aggregation implementation similar to bonding, but
    it's configured by a userspace program.
    
    Signed-off-by: Qingfang Deng <dqfext at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21120
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 8b05db405bb98b764f6b3e7a500e3ee10199657b)
---
 package/kernel/linux/modules/netsupport.mk | 65 ++++++++++++++++++++++++++++++
 target/linux/generic/config-6.12           |  5 +++
 2 files changed, 70 insertions(+)

diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk
index 7ae729f6ba..82c992b853 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -1654,3 +1654,68 @@ define KernelPackage/packet-diag
 endef
 
 $(eval $(call KernelPackage,packet-diag))
+
+define KernelPackage/team
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Ethernet team driver
+  KCONFIG:=CONFIG_NET_TEAM
+  FILES:=$(LINUX_DIR)/drivers/net/team/team.ko
+  AUTOLOAD:=$(call AutoProbe,team)
+endef
+
+$(eval $(call KernelPackage,team))
+
+define KernelPackage/team-mode-broadcast
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Broadcast mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_BROADCAST
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_broadcast.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_broadcast)
+endef
+
+$(eval $(call KernelPackage,team-mode-broadcast))
+
+define KernelPackage/team-mode-roundrobin
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Round-robin mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_ROUNDROBIN
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_roundrobin.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_roundrobin)
+endef
+
+$(eval $(call KernelPackage,team-mode-roundrobin))
+
+define KernelPackage/team-mode-random
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Random mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_RANDOM
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_random.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_random)
+endef
+
+$(eval $(call KernelPackage,team-mode-random))
+
+define KernelPackage/team-mode-activebackup
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Active-backup mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_ACTIVEBACKUP
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_activebackup.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_activebackup)
+endef
+
+$(eval $(call KernelPackage,team-mode-activebackup))
+
+define KernelPackage/team-mode-loadbalance
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Load-balance mode support
+  DEPENDS:=kmod-team
+  KCONFIG:=CONFIG_NET_TEAM_MODE_LOADBALANCE
+  FILES:=$(LINUX_DIR)/drivers/net/team/team_mode_loadbalance.ko
+  AUTOLOAD:=$(call AutoProbe,team_mode_loadbalance)
+endef
+
+$(eval $(call KernelPackage,team-mode-loadbalance))
diff --git a/target/linux/generic/config-6.12 b/target/linux/generic/config-6.12
index 2b96eb286c..fda78b422e 100644
--- a/target/linux/generic/config-6.12
+++ b/target/linux/generic/config-6.12
@@ -4223,6 +4223,11 @@ CONFIG_NET_SOCK_MSG=y
 CONFIG_NET_SWITCHDEV=y
 # CONFIG_NET_TC_SKB_EXT is not set
 # CONFIG_NET_TEAM is not set
+# CONFIG_NET_TEAM_MODE_ACTIVEBACKUP is not set
+# CONFIG_NET_TEAM_MODE_BROADCAST is not set
+# CONFIG_NET_TEAM_MODE_LOADBALANCE is not set
+# CONFIG_NET_TEAM_MODE_RANDOM is not set
+# CONFIG_NET_TEAM_MODE_ROUNDROBIN is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_NET_UDP_TUNNEL is not set
 CONFIG_NET_VENDOR_3COM=y



From lede-commits at lists.infradead.org  Wed Dec 10 15:58:52 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:58:52 -0500
Subject: [openwrt/openwrt]  ucode: update to Git HEAD (2025-12-01)
In-Reply-To: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
References: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
Message-ID: <mailman.34710.1765411136.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/39b578147b5a88e88d16cd7adcd46ab209eab115

commit 39b578147b5a88e88d16cd7adcd46ab209eab115
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 8 22:20:46 2025 +0100

    ucode: update to Git HEAD (2025-12-01)
    
    afe4be60628a lib/fs: fix return value for flush
    5f08ecf8e372 lib/uloop: fix return value doc for run()
    1affe484f302 lib/uloop: pass eof and error to cb
    559860cbd76d lib: introduce io library
    ef07e2448a56 vm: optimize string+string concat with ucv_string_alloc
    
    Changes: https://github.com/jow-/ucode/compare/48ed18d2532e9197212c34473ab926c7b5e8ac73...f7c2b97a82e8b505bf4b2c0d8883b5116e1960f9
    
    Backport PR to fix compilation with Ubuntu 18.04:
    https://github.com/jow-/ucode/pull/355
    
    Link: https://github.com/openwrt/openwrt/pull/21100
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit e40ca676eee20fa6ea8b5ac36b3a858481ed9d79)
---
 package/utils/ucode/Makefile                         |  6 +++---
 .../patches/100-add-include-for-older-kernels.patch  | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile
index 1ca10cb88d..abc0c31e6f 100644
--- a/package/utils/ucode/Makefile
+++ b/package/utils/ucode/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=https://github.com/jow-/ucode.git
-PKG_SOURCE_DATE:=2025-11-19
-PKG_SOURCE_VERSION:=48ed18d2532e9197212c34473ab926c7b5e8ac73
-PKG_MIRROR_HASH:=34529706bcb413dffb3d73e78fe97971bd2b518c097c86470edadc1ca79a480c
+PKG_SOURCE_DATE:=2025-12-01
+PKG_SOURCE_VERSION:=f7c2b97a82e8b505bf4b2c0d8883b5116e1960f9
+PKG_MIRROR_HASH:=7de6a6d5b3c7392624bccefdc03e2dc61f097b414989eeced29ecc3e020bbd0b
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=ISC
 
diff --git a/package/utils/ucode/patches/100-add-include-for-older-kernels.patch b/package/utils/ucode/patches/100-add-include-for-older-kernels.patch
new file mode 100644
index 0000000000..f047bed928
--- /dev/null
+++ b/package/utils/ucode/patches/100-add-include-for-older-kernels.patch
@@ -0,0 +1,20 @@
+From 165d395ffa2a22e293160b24d4791302a156eab8 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp at gmail.com>
+Date: Mon, 8 Dec 2025 12:48:01 -0800
+Subject: add include for older kernels
+
+in6.h is needed for some macros. Seems newer kernels include this implicitly.
+---
+ lib/socket.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/lib/socket.c
++++ b/lib/socket.c
+@@ -77,6 +77,7 @@
+ #include "ucode/platform.h"
+ 
+ #if defined(__linux__)
++# include <linux/in6.h>
+ # include <linux/if_packet.h>
+ # include <linux/filter.h>
+ 



From lede-commits at lists.infradead.org  Wed Dec 10 15:58:57 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:58:57 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: add MT7981 sdmmc
 images
In-Reply-To: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
References: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
Message-ID: <mailman.34711.1765411137.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/c6d74b2ddddf2d7f387f4fe44c124ce938a9de53

commit c6d74b2ddddf2d7f387f4fe44c124ce938a9de53
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Mon Mar 10 23:15:38 2025 +0800

    arm-trusted-firmware-mediatek: add MT7981 sdmmc images
    
    Add bl2 images for mt7981 sdmmc ddr4 devices.
    
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    Link: https://github.com/openwrt/openwrt/pull/21000
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 3b14ace444c8597ea67738b16b9fa39ae3bc2de3)
---
 package/boot/arm-trusted-firmware-mediatek/Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index 7bb4e7bd31..f90915ed67 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -166,6 +166,14 @@ define Trusted-Firmware-A/mt7981-emmc-ddr4
   DDR_TYPE:=ddr4
 endef
 
+define Trusted-Firmware-A/mt7981-sdmmc-ddr4
+  NAME:=MediaTek MT7981 (SD card, DDR4)
+  BOOT_DEVICE:=sdmmc
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7981
+  DDR_TYPE:=ddr4
+endef
+
 define Trusted-Firmware-A/mt7981-spim-nand-ddr4
   NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
   BOOT_DEVICE:=spim-nand
@@ -643,6 +651,7 @@ TFA_TARGETS:= \
 	mt7981-spim-nand-ubi-ddr4 \
 	mt7981-ram-ddr4 \
 	mt7981-emmc-ddr4 \
+	mt7981-sdmmc-ddr4 \
 	mt7981-spim-nand-ddr4 \
 	mt7981-cudy-tr3000-v1 \
 	mt7986-ram-ddr3 \



From lede-commits at lists.infradead.org  Wed Dec 10 15:58:56 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:58:56 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: rearrange some
 images
In-Reply-To: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
References: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
Message-ID: <mailman.34712.1765411137.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/e40288294310485dedf0c657dc17f88738716471

commit e40288294310485dedf0c657dc17f88738716471
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Tue Mar 11 23:15:20 2025 +0800

    arm-trusted-firmware-mediatek: rearrange some images
    
    Rearrange some images to maintain consistency.
    
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    Link: https://github.com/openwrt/openwrt/pull/21000
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 69918d1e0bde11b99076eaf4ec93443cade8840f)
---
 .../boot/arm-trusted-firmware-mediatek/Makefile    | 34 +++++++++++-----------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index 7045133739..7bb4e7bd31 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -139,6 +139,14 @@ define Trusted-Firmware-A/mt7622-sdmmc-2ddr
   DDR3_FLYBY:=1
 endef
 
+define Trusted-Firmware-A/mt7981-nor-ddr4
+  NAME:=MediaTek MT7981 (SPI-NOR, DDR4)
+  BOOT_DEVICE:=nor
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7981
+  DDR_TYPE:=ddr4
+endef
+
 define Trusted-Firmware-A/mt7981-ram-ddr4
   NAME:=MediaTek MT7981 (RAM, DDR4)
   BOOT_DEVICE:=ram
@@ -186,14 +194,6 @@ define Trusted-Firmware-A/mt7981-ram-ddr3
   DEFAULT:=TARGET_mediatek_filogic
 endef
 
-define Trusted-Firmware-A/mt7981-nor-ddr4
-  NAME:=MediaTek MT7981 (SPI-NOR, DDR4)
-  BOOT_DEVICE:=nor
-  BUILD_SUBTARGET:=filogic
-  PLAT:=mt7981
-  DDR_TYPE:=ddr4
-endef
-
 define Trusted-Firmware-A/mt7981-emmc-ddr3
   NAME:=MediaTek MT7981 (eMMC, DDR3)
   BOOT_DEVICE:=emmc
@@ -244,6 +244,15 @@ define Trusted-Firmware-A/mt7981-spim-nand-ddr3-1866mhz
   DDR3_FREQ_1866:=1
 endef
 
+define Trusted-Firmware-A/mt7981-spim-nand-ubi-ddr4
+  NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
+  BOOT_DEVICE:=spim-nand
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7981
+  DDR_TYPE:=ddr4
+  USE_UBI:=1
+endef
+
 define Trusted-Firmware-A/mt7981-cudy-tr3000-v1
   NAME:=Cudy TR3000 v1 (SPI-NAND via SPIM, DDR3)
   BOOT_DEVICE:=spim-nand
@@ -265,15 +274,6 @@ define Trusted-Firmware-A/mt7986-ram-ddr4
   DEFAULT:=TARGET_mediatek_filogic
 endef
 
-define Trusted-Firmware-A/mt7981-spim-nand-ubi-ddr4
-  NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
-  BOOT_DEVICE:=spim-nand
-  BUILD_SUBTARGET:=filogic
-  PLAT:=mt7981
-  DDR_TYPE:=ddr4
-  USE_UBI:=1
-endef
-
 define Trusted-Firmware-A/mt7986-nor-ddr4
   NAME:=MediaTek MT7986 (SPI-NOR, DDR4)
   BOOT_DEVICE:=nor



From lede-commits at lists.infradead.org  Wed Dec 10 15:58:58 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:58:58 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: add MT7987 DDR4 4BG
 images
In-Reply-To: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
References: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
Message-ID: <mailman.34713.1765411137.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/4f889c2caad4fa797ef4714fd6b22a98b256fe2f

commit 4f889c2caad4fa797ef4714fd6b22a98b256fe2f
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Mon Nov 10 18:16:30 2025 +0800

    arm-trusted-firmware-mediatek: add MT7987 DDR4 4BG images
    
    Add the DDR4_4BG_MODE option, which supports 4GB DDR4 RAM
    for the MT7987 and 8GB DDR4 RAM for the MT7988. If this mode
    is not enabled, bl2 can only recognize half the size of RAM.
    
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    Link: https://github.com/openwrt/openwrt/pull/21000
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit f037a2e8bb86d0edd4a4913afd69d39b60a03062)
---
 package/boot/arm-trusted-firmware-mediatek/Makefile | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index f90915ed67..24fa97e5ce 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -30,6 +30,7 @@ define Trusted-Firmware-A/Default
   BOOT_DEVICE:=
   DDR3_FLYBY:=
   DDR3_FREQ_1866:=
+  DDR4_4BG_MODE:=
   DDR_TYPE:=
   NAND_TYPE:=
   BOARD_QFN:=
@@ -410,6 +411,14 @@ define Trusted-Firmware-A/mt7987-emmc-comb
   DRAM_USE_COMB:=1
 endef
 
+define Trusted-Firmware-A/mt7987-emmc-ddr4-4bg
+  NAME:=MediaTek MT7987 (eMMC, DDR4 4GB)
+  BOOT_DEVICE:=emmc
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7987
+  DDR4_4BG_MODE:=1
+endef
+
 define Trusted-Firmware-A/mt7987-nor-comb
   NAME:=MediaTek MT7987 (NOR)
   BOOT_DEVICE:=nor
@@ -426,6 +435,14 @@ define Trusted-Firmware-A/mt7987-sdmmc-comb
   DRAM_USE_COMB:=1
 endef
 
+define Trusted-Firmware-A/mt7987-sdmmc-ddr4-4bg
+  NAME:=MediaTek MT7987 (SD card, DDR4 4GB)
+  BOOT_DEVICE:=sdmmc
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7987
+  DDR4_4BG_MODE:=1
+endef
+
 define Trusted-Firmware-A/mt7987-spim-nand0-ubi-comb
   NAME:=MediaTek MT7987 (SPI-NAND via SPIM, UBI)
   BOOT_DEVICE:=spim-nand
@@ -670,8 +687,10 @@ TFA_TARGETS:= \
 	mt7986-spim-nand-ubi-ddr4 \
 	mt7986-spim-nand-4k-ddr4 \
 	mt7987-emmc-comb \
+	mt7987-emmc-ddr4-4bg \
 	mt7987-nor-comb \
 	mt7987-sdmmc-comb \
+	mt7987-sdmmc-ddr4-4bg \
 	mt7987-spim-nand0-ubi-comb \
 	mt7987-spim-nand2-ubi-comb \
 	mt7987-ram-comb \
@@ -705,6 +724,7 @@ TFA_MAKE_FLAGS += \
 	HAVE_DRAM_OBJ_FILE=yes \
 	$(if $(DDR3_FLYBY),DDR3_FLYBY=1) \
 	$(if $(DDR3_FREQ_1866),DDR3_FREQ_1866=1) \
+	$(if $(DDR4_4BG_MODE),DDR4_4BG_MODE=1) \
 	$(if $(DRAM_USE_COMB),DRAM_USE_COMB=1) \
 	$(if $(RAM_BOOT_UART_DL),RAM_BOOT_UART_DL=1) \
 	$(if $(USE_UBI),UBI=1 $(if $(findstring mt7622,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x80000)) \



From lede-commits at lists.infradead.org  Wed Dec 10 15:58:54 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:58:54 -0500
Subject: [openwrt/openwrt]  mpc85xx: add support for Watchguard Firebox T10-W,
 T15(-W)
In-Reply-To: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
References: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
Message-ID: <mailman.34714.1765411137.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/4e5e8b95a645f6f2bd952cbd51cd34b1dcbbda3d

commit 4e5e8b95a645f6f2bd952cbd51cd34b1dcbbda3d
Author: Shine <4c.fce2 at proton.me>
AuthorDate: Thu Oct 24 14:19:43 2024 +0200

    mpc85xx: add support for Watchguard Firebox T10-W, T15(-W)
    
    This commit adds support for the Watchguard Firebox models
    T10-W, T15 and T15-W.
    
    CPU:      Freescale P1010
    RAM:      512MB (T10) / 1024MB (T15)
    Flash:    1MB SPI-NOR, 512MB NAND (T10) / 1024MB NAND (T15)
    WiFi:     802.11abgn 2T2R AR9582 based Mini-PCIe card (-W models only)
    Ethernet: 3x GBE (via AR8033 PHY)
    LEDs:     7x hard-wired (6x LAN, 1x Power)
              4x GPIO single-colored (Attn/Status/Mode/Failover)
              1x GPIO dual-colored (2.4/5G WiFi, -W models only)
    Serial:   RJ45, Cisco pinout, 115200/8N1
    Other:    Battery backed RTC
              Atmel TPM 1.2 chip (unsupported)
    
    Based on 35f6d79, which introduced Watchguard Firebox T10 support.
    
    The T10 and T15 are identical hardware, with the exception of the T15
    having twice the flash and RAM size.
    
    The T10-W and T15-W models have their Mini-PCIe slot populated with an ath9
    (AR9582) based WiFi card. The slot is either unpopulated or empty for
    non-WiFi models. All required drivers are present by default on the mpc85xx
    target, so T10/T10-W resp. T15/T15-W can use the same OpenWrt image.
    
    This commit also introduces the zImage loader from 7d768a9 to boot the
    kernel. This is required, since the U-Boot version used in these devices
    appears to have a hard limit of 16MB for the kernel size it can handle. The
    current kernel size is around 17MB, though, due to kernel page alignment
    required for memory protection.
    
    Installation (replaces previous instructions for T10):
    
    1. If the U-Boot password is known, proceed with step 2.
    
       If the U-Boot password is unknown, dump the NOR flash using a SPI
       programmer and patch the unknown password to a known one. You can use
       blocktrron's Python script:
    
       https://github.com/blocktrron/t10-uboot-patcher/
    
       This script will patch the password to '1234' (without quotes).
    
       Alternatively, you can search for the hashed password in the NOR dump
       yourself and overwrite it with a known one. The SHA1 hash is:
    
       E597301A1D89FF3F6D318DBF4DBA0A5ABC5ECBEA
    
       Write the patched NOR dump back to the device.
    
    2. Connect the device via serial cable, power it on and interrupt
       the boot process by pressing Ctrl+C. Enter the U-Boot password to access
       the CLI.
    
    3. (Optional) Populate the uboot-env partition by entering:
    
       saveenv
    
       This will allow you to use uboot-envtools from within OpenWrt later,
       e.g. to increase the loadable kernel size.
    
       The default loadable kernel size is 5MB, the compressed kernel size at
       the time of this commit is 3.1MB.
    
    4. Serve the initramfs OpenWrt image from a TFTP server at 10.0.1.13/24,
       connected to eth0 (WAN) of the device. File name must be 'uImage'. Boot
       with:
    
       tftpboot; bootm;
    
       Make sure to use the correct image for your device (T10 resp. T15)!
    
    5. After booting, connect to OpenWrt on eth1 (LAN) via SSH. Verify
       that the UBI partiton is mtd7, format it and install the sysupgrade
       image.
    
       $ cat /proc/mtd
       $ ubiformat /dev/mtd7 -y
       $ sysupgrade -n <path to sysupgrade.bin>
    
    6. The device should now boot OpenWrt from NAND flash. Enjoy.
    
    Back to stock:
    
    Use the vendor recovery procedure.
    
    Stock recovery might also be necessary in case you have accidentally used
    the fw_setenv command from within OpenWrt without using saveenv in U-Boot
    first.
    
    In order to use the vendor firmware recovery procedure, the NAND partitions
    mtd3 to mtd6 must remain intact. Make sure not to overwrite them, or keep
    dumps of them for later recovery.
    
    Signed-off-by: Shine <4c.fce2 at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/16776
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit be7aa5bda40ee05b1dd0b4f4a1bf88e653ef875a)
---
 .../boot/uboot-tools/uboot-envtools/files/mpc85xx  |  3 +-
 .../mpc85xx/base-files/etc/board.d/02_network      |  3 +-
 .../mpc85xx/base-files/lib/upgrade/platform.sh     |  3 +-
 target/linux/mpc85xx/config-6.12                   |  2 +-
 .../files/arch/powerpc/boot/dts/firebox-t15.dts    | 89 ++++++++++++++++++++++
 .../files/arch/powerpc/boot/dts/firebox-t1x.dtsi   | 37 ++++++++-
 .../85xx/{firebox_t10.c => firebox_t1x.c}          | 28 +++++--
 target/linux/mpc85xx/image/p1010.mk                | 24 ++++++
 target/linux/mpc85xx/p1010/config-default          |  2 +-
 target/linux/mpc85xx/p1010/target.mk               |  2 +-
 ...108-powerpc-85xx-firebox-t10-t15-support.patch} | 12 +--
 .../109-powerpc-85xx-add-ws-ap3715i-support.patch  |  2 +-
 .../111-powerpc-85xx-hpe-msm-support.patch         |  6 +-
 13 files changed, 189 insertions(+), 24 deletions(-)

diff --git a/package/boot/uboot-tools/uboot-envtools/files/mpc85xx b/package/boot/uboot-tools/uboot-envtools/files/mpc85xx
index a74466ab3a..70d12bb7ea 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/mpc85xx
+++ b/package/boot/uboot-tools/uboot-envtools/files/mpc85xx
@@ -20,7 +20,8 @@ ocedo,panda)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
 	ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000"
 	;;
-watchguard,firebox-t10)
+watchguard,firebox-t10|\
+watchguard,firebox-t15)
 	ubootenv_add_uci_config "$(find_mtd_part 'u-boot-env')" "0x0" "0x2000" "0x10000"
 	;;
 aerohive,hiveap-330)
diff --git a/target/linux/mpc85xx/base-files/etc/board.d/02_network b/target/linux/mpc85xx/base-files/etc/board.d/02_network
index 6225f189a5..d1ebe806f1 100644
--- a/target/linux/mpc85xx/base-files/etc/board.d/02_network
+++ b/target/linux/mpc85xx/base-files/etc/board.d/02_network
@@ -29,7 +29,8 @@ ocedo,panda)
 tplink,tl-wdr4900-v1)
 	ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
 	;;
-watchguard,firebox-t10)
+watchguard,firebox-t10|\
+watchguard,firebox-t15)
 	ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
 	;;
 *)
diff --git a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
index 5d111676ae..f0875388af 100755
--- a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
@@ -16,7 +16,8 @@ platform_do_upgrade() {
 	hpe,msm460|\
 	ocedo,panda|\
 	sophos,red-15w-rev1|\
-	watchguard,firebox-t10)
+	watchguard,firebox-t10|\
+	watchguard,firebox-t15)
 		nand_do_upgrade "$1"
 		;;
 	*)
diff --git a/target/linux/mpc85xx/config-6.12 b/target/linux/mpc85xx/config-6.12
index e336a19914..d2a720ebcf 100644
--- a/target/linux/mpc85xx/config-6.12
+++ b/target/linux/mpc85xx/config-6.12
@@ -71,7 +71,7 @@ CONFIG_EDAC_LEGACY_SYSFS=y
 CONFIG_EDAC_MPC85XX=y
 CONFIG_EDAC_SUPPORT=y
 CONFIG_EXCLUSIVE_SYSTEM_RAM=y
-# CONFIG_FIREBOX_T10 is not set
+# CONFIG_FIREBOX_T1X is not set
 CONFIG_FIXED_PHY=y
 CONFIG_FORCE_NR_CPUS=y
 CONFIG_FSL_EMB_PERFMON=y
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t15.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t15.dts
new file mode 100644
index 0000000000..6a726aee8b
--- /dev/null
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t15.dts
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: GPL-2.0-or-later or MIT
+
+/include/ "fsl/p1010si-pre.dtsi"
+#include "firebox-t1x.dtsi"
+
+/ {
+	model = "Watchguard Firebox T15";
+	compatible = "watchguard,firebox-t15";
+
+	ifc: ifc at ffe1e000 {
+		reg = <0x0 0xffe1e000 0 0x2000>;
+
+		/* NOR, NAND Flashes and CPLD on board */
+		ranges = <0x0 0x0 0x0 0xee000000 0x02000000
+			0x1 0x0 0x0 0xff800000 0x00010000
+			0x3 0x0 0x0 0xffb00000 0x00000020>;
+
+		nand at 100000000 {
+			compatible = "fsl,ifc-nand";
+			reg = <0x1 0x0 0x10000>;
+
+			partitions {
+				compatible = "fixed-partitions";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				/*
+				 * Original partition layout:
+				 * 0x000000000000-0x000000020000 : "NAND (RW) WG DTB Image"
+				 * 0x000000020000-0x000000520000 : "NAND (RW) WG SYSA Kernel"
+				 * 0x000000520000-0x00000f720000 : "NAND (RW) WG SYSA_CODE"
+				 * 0x00000f720000-0x00000fc20000 : "NAND (RW) WG SYSB Kernel"
+				 * 0x00000fc20000-0x000011420000 : "NAND (RW) WG SYSB_CODE"
+				 * 0x000011420000-0x000011920000 : "NAND (RW) WG SYSA2 Kernel"
+				 * 0x000011920000-0x000019220000 : "NAND (RW) WG SYSA_CODE2"
+				 * 0x000019220000-0x000040000000 : "NAND (RW) WG SYSA_DATA"
+				 */
+
+				partition at 0 {
+					reg = <0x0 0x20000>;
+					label = "wg-dtb";
+					read-only;
+				};
+
+				partition at 20000 {
+					reg = <0x20000 0x500000>;
+					label = "kernel";
+				};
+
+				partition at 520000 {
+					reg = <0x520000 0xf200000>;
+					label = "wg-sysa-rootfs";
+					read-only;
+				};
+
+				partition at f720000 {
+					reg = <0xf720000 0x500000>;
+					label = "wg-sysb-kernel";
+					read-only;
+				};
+
+				partition at fc20000 {
+					reg = <0xfc20000 0x1800000>;
+					label = "wg-sysb-rootfs";
+					read-only;
+				};
+
+				partition at 11420000 {
+					reg = <0x11420000 0x500000>;
+					label = "wg-sysa2-kernel";
+					read-only;
+				};
+
+				partition at 11920000 {
+					reg = <0x11920000 0x7900000>;
+					label = "wg-sysa2-rootfs";
+					read-only;
+				};
+
+				partition at 19220000 {
+					reg = <0x19220000 0x26de0000>;
+					label = "ubi";
+				};
+			};
+		};
+	};
+};
+
+/include/ "fsl/p1010si-post.dtsi"
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
index 09824b46cb..5b494745e1 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
@@ -48,6 +48,21 @@
 			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
 			label = "green:failover";
 		};
+
+		led_wap_orange: wap_orange {
+			gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+			function = LED_FUNCTION_WLAN_2GHZ;
+			color = <LED_COLOR_ID_ORANGE>;
+			label = "orange:wap";
+		};
+
+		led_wap_green: wap_green {
+			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+			function = LED_FUNCTION_WLAN_5GHZ;
+			color = <LED_COLOR_ID_GREEN>;
+			label = "green:wap";
+			linux,default-trigger = "phy0tpt";
+		};
 	};
 
 	buttons {
@@ -221,6 +236,26 @@
 	};
 
 	pci1: pcie at ffe0a000 {
-		status = "disabled";
+		reg = <0 0xffe0a000 0 0x1000>;
+		ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
+			  0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
+		pcie at 0 {
+			ranges = <0x2000000 0x0 0x80000000
+				  0x2000000 0x0 0x80000000
+				  0x0 0x20000000
+
+				  0x1000000 0x0 0x0
+				  0x1000000 0x0 0x0
+				  0x0 0x100000>;
+
+			ath9k: wifi at 0,0 {
+				compatible = "pci168c,0033";
+				reg = <0x0000 0 0 0 0>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				nvmem-cells = <&macaddr_device_id_186c 0>;
+				nvmem-cell-names = "mac-address";
+			};
+		};
 	};
 };
diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t1x.c
similarity index 66%
rename from target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c
rename to target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t1x.c
index f8f90b22bf..edbdb8ba1e 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c
+++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t1x.c
@@ -34,7 +34,7 @@
 
 #include "mpc85xx.h"
 
-static void __init firebox_t10_pic_init(void)
+static void __init firebox_t1x_pic_init(void)
 {
 	struct mpic *mpic;
 
@@ -49,26 +49,40 @@ static void __init firebox_t10_pic_init(void)
 /*
  * Setup the architecture
  */
-static void __init firebox_t10_setup_arch(void)
+static void __init firebox_t1x_setup_arch(void)
 {
 	if (ppc_md.progress)
-		ppc_md.progress("firebox_t10_setup_arch()", 0);
+		ppc_md.progress("firebox_t1x_setup_arch()", 0);
 
 	fsl_pci_assign_primary();
 
-	pr_info("Firebox T10 from Watchguard\n");
+	pr_info("Firebox T10/T15 from Watchguard\n");
 }
 
 machine_arch_initcall(firebox_t10, mpc85xx_common_publish_devices);
+machine_arch_initcall(firebox_t15, mpc85xx_common_publish_devices);
 
 define_machine(firebox_t10) {
 	.name			= "P1010 RDB",
 	.compatible		= "watchguard,firebox-t10",
-	.setup_arch		= firebox_t10_setup_arch,
-	.init_IRQ		= firebox_t10_pic_init,
+	.setup_arch		= firebox_t1x_setup_arch,
+	.init_IRQ		= firebox_t1x_pic_init,
 #ifdef CONFIG_PCI
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
-	.pcibios_fixup_phb      = fsl_pcibios_fixup_phb,
+	.pcibios_fixup_phb	= fsl_pcibios_fixup_phb,
+#endif
+	.get_irq		= mpic_get_irq,
+	.progress		= udbg_progress,
+};
+
+define_machine(firebox_t15) {
+	.name			= "P1010 RDB",
+	.compatible		= "watchguard,firebox-t15",
+	.setup_arch		= firebox_t1x_setup_arch,
+	.init_IRQ		= firebox_t1x_pic_init,
+#ifdef CONFIG_PCI
+	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
+	.pcibios_fixup_phb	= fsl_pcibios_fixup_phb,
 #endif
 	.get_irq		= mpic_get_irq,
 	.progress		= udbg_progress,
diff --git a/target/linux/mpc85xx/image/p1010.mk b/target/linux/mpc85xx/image/p1010.mk
index 1f898c483f..b9d865f7e8 100644
--- a/target/linux/mpc85xx/image/p1010.mk
+++ b/target/linux/mpc85xx/image/p1010.mk
@@ -77,13 +77,37 @@ TARGET_DEVICES += tplink_tl-wdr4900-v1
 define Device/watchguard_firebox-t10
   DEVICE_VENDOR := Watchguard
   DEVICE_MODEL := Firebox T10
+  DEVICE_ALT0_VENDOR := Watchguard
+  DEVICE_ALT0_MODEL := Firebox T10-W
   DEVICE_PACKAGES := kmod-rtc-s35390a kmod-eeprom-at24
+  # This boot loader doesn't reliably boot an uncompressed image,
+  # therefore resort to gzipping the already compressed zImage
   KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb
+  KERNEL_NAME := zImage.la3000000
+  KERNEL_ENTRY := 0x3000000
+  KERNEL_LOADADDR := 0x3000000
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
 TARGET_DEVICES += watchguard_firebox-t10
 
+define Device/watchguard_firebox-t15
+  DEVICE_VENDOR := Watchguard
+  DEVICE_MODEL := Firebox T15
+  DEVICE_ALT0_VENDOR := Watchguard
+  DEVICE_ALT0_MODEL := Firebox T15-W
+  DEVICE_PACKAGES := kmod-rtc-s35390a kmod-eeprom-at24
+  # This boot loader doesn't reliably boot an uncompressed image,
+  # therefore resort to gzipping the already compressed zImage
+  KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb
+  KERNEL_NAME := zImage.la3000000
+  KERNEL_ENTRY := 0x3000000
+  KERNEL_LOADADDR := 0x3000000
+  IMAGES := sysupgrade.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += watchguard_firebox-t15
+
 define Device/sophos_red-15w-rev1
   DEVICE_VENDOR := Sophos
   DEVICE_MODEL := RED 15w
diff --git a/target/linux/mpc85xx/p1010/config-default b/target/linux/mpc85xx/p1010/config-default
index 2d5d1c9ea9..a300486087 100644
--- a/target/linux/mpc85xx/p1010/config-default
+++ b/target/linux/mpc85xx/p1010/config-default
@@ -6,7 +6,7 @@ CONFIG_CRYPTO_HASH_INFO=y
 CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_ZSTD=y
 CONFIG_DEFAULT_UIMAGE=y
-CONFIG_FIREBOX_T10=y
+CONFIG_FIREBOX_T1X=y
 # CONFIG_FSL_CORENET_CF is not set
 CONFIG_FSL_IFC=y
 CONFIG_GPIO_74X164=y
diff --git a/target/linux/mpc85xx/p1010/target.mk b/target/linux/mpc85xx/p1010/target.mk
index 6b54390863..b6236196f3 100644
--- a/target/linux/mpc85xx/p1010/target.mk
+++ b/target/linux/mpc85xx/p1010/target.mk
@@ -1,5 +1,5 @@
 BOARDNAME:=P1010
-KERNEL_IMAGES:=simpleImage.br200-wp simpleImage.tl-wdr4900-v1 simpleImage.ws-ap3715i
+KERNEL_IMAGES:=simpleImage.br200-wp simpleImage.tl-wdr4900-v1 simpleImage.ws-ap3715i zImage.la3000000
 
 define Target/Description
 	Build firmware images for P1010 based boards.
diff --git a/target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-support.patch.patch b/target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-t15-support.patch
similarity index 74%
rename from target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-support.patch.patch
rename to target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-t15-support.patch
index 2c722e4d9b..402a613834 100644
--- a/target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-support.patch.patch
+++ b/target/linux/mpc85xx/patches-6.12/108-powerpc-85xx-firebox-t10-t15-support.patch
@@ -4,15 +4,15 @@
  	  This board is a Concurrent Dual-Band wireless access point with a
  	  Freescale P1020 SoC.
  
-+config FIREBOX_T10
-+	bool "Watchguard Firebox T10"
++config FIREBOX_T1X
++	bool "Watchguard Firebox T10/T15"
 +	select DEFAULT_UIMAGE
 +	select ARCH_REQUIRE_GPIOLIB
 +	select GPIO_MPC8XXX
++	select PPC_ZIMAGE_LA3000000
 +	help
-+	  This option enables support for the Watchguard Firebox T10 board.
-+	  This board is a VPN Gateway-Router with a
-+	  Freescale P1010 SoC.
++	  This option enables support for the Watchguard Firebox T10/T15 board.
++	  This board is a VPN Gateway-Router with a Freescale P1010 SoC.
 +
  config MPC8540_ADS
  	bool "Freescale MPC8540 ADS"
@@ -23,7 +23,7 @@
  obj-$(CONFIG_TWR_P102x)   += twr_p102x.o
  obj-$(CONFIG_WS_AP3710I)  += ws-ap3710i.o
  obj-$(CONFIG_WS_AP3825I)  += ws-ap3825i.o
-+obj-$(CONFIG_FIREBOX_T10) += firebox_t10.o
++obj-$(CONFIG_FIREBOX_T1X) += firebox_t1x.o
  obj-$(CONFIG_CORENET_GENERIC)   += corenet_generic.o
  obj-$(CONFIG_FB_FSL_DIU)	+= t1042rdb_diu.o
  obj-$(CONFIG_RED_15W_REV1)	+= red15w_rev1.o
diff --git a/target/linux/mpc85xx/patches-6.12/109-powerpc-85xx-add-ws-ap3715i-support.patch b/target/linux/mpc85xx/patches-6.12/109-powerpc-85xx-add-ws-ap3715i-support.patch
index 37e3e5587a..761c4d9509 100644
--- a/target/linux/mpc85xx/patches-6.12/109-powerpc-85xx-add-ws-ap3715i-support.patch
+++ b/target/linux/mpc85xx/patches-6.12/109-powerpc-85xx-add-ws-ap3715i-support.patch
@@ -26,7 +26,7 @@
  obj-$(CONFIG_WS_AP3710I)  += ws-ap3710i.o
 +obj-$(CONFIG_WS_AP3715I)  += ws-ap3715i.o
  obj-$(CONFIG_WS_AP3825I)  += ws-ap3825i.o
- obj-$(CONFIG_FIREBOX_T10) += firebox_t10.o
+ obj-$(CONFIG_FIREBOX_T1X) += firebox_t1x.o
  obj-$(CONFIG_CORENET_GENERIC)   += corenet_generic.o
 --- a/arch/powerpc/boot/Makefile
 +++ b/arch/powerpc/boot/Makefile
diff --git a/target/linux/mpc85xx/patches-6.12/111-powerpc-85xx-hpe-msm-support.patch b/target/linux/mpc85xx/patches-6.12/111-powerpc-85xx-hpe-msm-support.patch
index 1d1fb4f54f..f9761d4447 100644
--- a/target/linux/mpc85xx/patches-6.12/111-powerpc-85xx-hpe-msm-support.patch
+++ b/target/linux/mpc85xx/patches-6.12/111-powerpc-85xx-hpe-msm-support.patch
@@ -1,8 +1,8 @@
 --- a/arch/powerpc/platforms/85xx/Kconfig
 +++ b/arch/powerpc/platforms/85xx/Kconfig
-@@ -114,6 +114,18 @@ config FIREBOX_T10
- 	  This board is a VPN Gateway-Router with a
- 	  Freescale P1010 SoC.
+@@ -114,6 +114,18 @@ config FIREBOX_T1X
+ 	  This option enables support for the Watchguard Firebox T10/T15 board.
+ 	  This board is a VPN Gateway-Router with a Freescale P1010 SoC.
  
 +config MSM460
 +	bool "HPE MSM460"



From lede-commits at lists.infradead.org  Wed Dec 10 15:59:00 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:59:00 -0500
Subject: [openwrt/openwrt]  bcm27xx: fix patch wrong CRLF line-ending
In-Reply-To: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
References: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
Message-ID: <mailman.34717.1765411142.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/65a60d2fa7c0fc5d5fae26b49ffa3e1ac965d0f0

commit 65a60d2fa7c0fc5d5fae26b49ffa3e1ac965d0f0
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Sat Nov 29 00:21:04 2025 +0800

    bcm27xx: fix patch wrong CRLF line-ending
    
    Use Unix LF style instead of Windows CRLF style.
    
    Fixes: 738876e76bb2 ("kernel: bump 6.12 to 6.12.58")
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/20973
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 86bd55c4fd0f3ffe6bf7df672b051900352af3ad)
---
 ...dv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch b/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch
index d67112a069..1ec30edc79 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch
@@ -1,14 +1,14 @@
-From 954129f16c200e41a00ebebe2e22efc01b243538 Mon Sep 17 00:00:00 2001
-From: Dom Cobley <popcornmix at gmail.com>
-Date: Fri, 14 Nov 2025 14:08:18 +0000
-Subject: [PATCH] Revert "Revert "media: i2c: adv7180: Add support for
- V4L2_CID_LINK_FREQ""
-
-This reverts commit 00ecb85c58501f8f7ae75fcb069bbbad5542e853.
----
- drivers/media/i2c/adv7180.c | 39 +++++++++++++++++++++++++++++++++++--
- 1 file changed, 37 insertions(+), 2 deletions(-)
-
+From 954129f16c200e41a00ebebe2e22efc01b243538 Mon Sep 17 00:00:00 2001
+From: Dom Cobley <popcornmix at gmail.com>
+Date: Fri, 14 Nov 2025 14:08:18 +0000
+Subject: [PATCH] Revert "Revert "media: i2c: adv7180: Add support for
+ V4L2_CID_LINK_FREQ""
+
+This reverts commit 00ecb85c58501f8f7ae75fcb069bbbad5542e853.
+---
+ drivers/media/i2c/adv7180.c | 39 +++++++++++++++++++++++++++++++++++--
+ 1 file changed, 37 insertions(+), 2 deletions(-)
+
 --- a/drivers/media/i2c/adv7180.c
 +++ b/drivers/media/i2c/adv7180.c
 @@ -189,6 +189,16 @@



From lede-commits at lists.infradead.org  Wed Dec 10 15:58:53 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:58:53 -0500
Subject: [openwrt/openwrt]  mpc85xx: p1010: use common DTSI for Watchguard
 Firebox T1X
In-Reply-To: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
References: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
Message-ID: <mailman.34718.1765411142.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/bb61b5b31d2a16d72d821e0d195495ab1aebb8d6

commit bb61b5b31d2a16d72d821e0d195495ab1aebb8d6
Author: Shine <4c.fce2 at proton.me>
AuthorDate: Thu Oct 24 18:17:43 2024 +0200

    mpc85xx: p1010: use common DTSI for Watchguard Firebox T1X
    
    In preparation of adding support for additional Watchguard Firebox devices
    based on Freescale P1010, introduce a common DTSI.
    
    Signed-off-by: Shine <4c.fce2 at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/16776
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 15ef024805f15fd1495f9cfa129a3e29d5b349ff)
---
 .../files/arch/powerpc/boot/dts/firebox-t10.dts    | 219 +--------------------
 .../boot/dts/{firebox-t10.dts => firebox-t1x.dtsi} |  90 +--------
 2 files changed, 6 insertions(+), 303 deletions(-)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
index 7f6235ad35..a610d75f5e 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
@@ -1,229 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-or-later or MIT
 
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/leds/common.h>
-#include <dt-bindings/gpio/gpio.h>
-
 /include/ "fsl/p1010si-pre.dtsi"
+#include "firebox-t1x.dtsi"
 
 / {
 	model = "Watchguard Firebox T10";
 	compatible = "watchguard,firebox-t10";
 
-	chosen {
-		bootargs = "console=ttyS0,115200";
-		bootargs-override = "console=ttyS0,115200";
-	};
-
-	aliases {
-		spi0 = &spi0;
-		led-boot = &led_mode;
-		led-failsafe = &led_failover;
-		led-running = &led_mode;
-		led-upgrade = &led_attention;
-		/delete-property/ ethernet0;
-		/delete-property/ ethernet1;
-		/delete-property/ ethernet2;
-	};
-
-	memory {
-		device_type = "memory";
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led_attention: attention_orange {
-			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
-			label = "orange:attention";
-		};
-
-		status_red {
-			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
-			function = LED_FUNCTION_STATUS;
-			color = <LED_COLOR_ID_RED>;
-		};
-
-		led_mode: mode_green {
-			gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
-			label = "green:mode";
-		};
-
-		led_failover: failover_green {
-			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
-			label = "green:failover";
-		};
-	};
-
-	buttons {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "Reset button";
-			gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_RESTART>;
-		};
-	};
-
-
-	soc: soc at ffe00000 {
-		ranges = <0x0 0x0 0xffe00000 0x100000>;
-
-		i2c at 3000 {
-			rtc at 30 {
-				compatible = "sii,s35390a";
-				reg = <0x30>;
-			};
-		};
-
-		spi0: spi at 7000 {
-			flash at 0 {
-				compatible = "jedec,spi-nor";
-				reg = <0>;
-				spi-max-frequency = <25000000>;
-
-				partitions {
-					compatible = "fixed-partitions";
-					#address-cells = <1>;
-					#size-cells = <1>;
-
-					uboot: partition at 0 {
-						reg = <0x0 0x90000>;
-						label = "u-boot";
-						read-only;
-					};
-
-					partition at 90000 {
-						reg = <0x90000 0x10000>;
-						label = "u-boot-env";
-					};
-
-					partition at a0000 {
-						reg = <0xa0000 0x20000>;
-						label = "cfgxxx";
-						read-only;
-					};
-
-					partition at c0000 {
-						reg = <0xc0000 0x40000>;
-						label = "device_id";
-						read-only;
-
-						nvmem-layout {
-							compatible = "fixed-layout";
-							#address-cells = <1>;
-							#size-cells = <1>;
-
-							macaddr_device_id_1830: mac-address at 1830 {
-								compatible = "mac-base";
-								reg = <0x1830 0x11>;
-								#nvmem-cell-cells = <1>;
-							};
-
-							macaddr_device_id_1844: mac-address at 1844 {
-								compatible = "mac-base";
-								reg = <0x1844 0x11>;
-								#nvmem-cell-cells = <1>;
-							};
-
-							macaddr_device_id_1858: mac-address at 1858 {
-								compatible = "mac-base";
-								reg = <0x1858 0x11>;
-								#nvmem-cell-cells = <1>;
-							};
-						};
-					};
-				};
-			};
-		};
-
-		gpio0: gpio-controller at fc00 {
-		};
-
-		usb at 22000 {
-			phy_type = "utmi";
-			dr_mode = "host";
-		};
-
-		mdio at 24000 {
-			phy1: ethernet-phy at 1 {
-				reg = <0x1>;
-			};
-
-			phy2: ethernet-phy at 2 {
-				reg = <0x2>;
-			};
-
-			phy3: ethernet-phy at 3 {
-				reg = <0x3>;
-			};
-		};
-
-		mdio at 25000 {
-			tbi_phy1: tbi-phy at 11 {
-				reg = <0x11>;
-				device_type = "tbi-phy";
-			};
-		};
-
-		mdio at 26000 {
-			tbi_phy2: tbi-phy at 11 {
-				reg = <0x11>;
-				device_type = "tbi-phy";
-			};
-		};
-
-		enet0: ethernet at b0000 {
-			phy-handle = <&phy1>;
-			phy-connection-type = "rgmii-id";
-
-			nvmem-cells = <&macaddr_device_id_1830 0>;
-			nvmem-cell-names = "mac-address";
-		};
-
-		enet1: ethernet at b1000 {
-			tbi-handle = <&tbi_phy1>;
-			phy-handle = <&phy2>;
-			phy-connection-type = "sgmii";
-
-			nvmem-cells = <&macaddr_device_id_1844 0>;
-			nvmem-cell-names = "mac-address";
-		};
-
-		enet2: ethernet at b2000 {
-			tbi-handle = <&tbi_phy2>;
-			phy-handle = <&phy3>;
-			phy-connection-type = "sgmii";
-
-			nvmem-cells = <&macaddr_device_id_1858 0>;
-			nvmem-cell-names = "mac-address";
-		};
-
-		sdhc at 2e000 {
-			status = "disabled";
-		};
-
-		serial1: serial at 4600 {
-			status = "disabled";
-		};
-
-		can0: can at 1c000 {
-			status = "disabled";
-		};
-
-		can1: can at 1d000 {
-			status = "disabled";
-		};
-	};
-
-	pci0: pcie at ffe09000 {
-		status = "disabled";
-	};
-
-	pci1: pcie at ffe0a000 {
-		status = "disabled";
-	};
-
 	ifc: ifc at ffe1e000 {
 		reg = <0x0 0xffe1e000 0 0x2000>;
 
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
similarity index 66%
copy from target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
copy to target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
index 7f6235ad35..09824b46cb 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t1x.dtsi
@@ -4,12 +4,7 @@
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/gpio.h>
 
-/include/ "fsl/p1010si-pre.dtsi"
-
 / {
-	model = "Watchguard Firebox T10";
-	compatible = "watchguard,firebox-t10";
-
 	chosen {
 		bootargs = "console=ttyS0,115200";
 		bootargs-override = "console=ttyS0,115200";
@@ -131,6 +126,11 @@
 								reg = <0x1858 0x11>;
 								#nvmem-cell-cells = <1>;
 							};
+							macaddr_device_id_186c: mac-address at 186c {
+								compatible = "mac-base";
+								reg = <0x186c 0x11>;
+								#nvmem-cell-cells = <1>;
+							};
 						};
 					};
 				};
@@ -223,84 +223,4 @@
 	pci1: pcie at ffe0a000 {
 		status = "disabled";
 	};
-
-	ifc: ifc at ffe1e000 {
-		reg = <0x0 0xffe1e000 0 0x2000>;
-
-		/* NOR, NAND Flashes and CPLD on board */
-		ranges = <0x0 0x0 0x0 0xee000000 0x02000000
-			0x1 0x0 0x0 0xff800000 0x00010000
-			0x3 0x0 0x0 0xffb00000 0x00000020>;
-
-		nand at 100000000 {
-			compatible = "fsl,ifc-nand";
-			reg = <0x1 0x0 0x10000>;
-
-			partitions {
-				compatible = "fixed-partitions";
-				#address-cells = <1>;
-				#size-cells = <1>;
-
-				/*
-				 * Original partition layout:
-				 * 0x000000000000-0x000000020000 : "NAND (RW) WG DTB Image"
-				 * 0x000000020000-0x000000520000 : "NAND (RW) WG SYSA Kernel"
-				 * 0x000000520000-0x000007f00000 : "NAND (RW) WG SYSA_CODE"
-				 * 0x000007f00000-0x000008400000 : "NAND (RW) WG SYSB Kernel"
-				 * 0x000008400000-0x000009c00000 : "NAND (RW) WG SYSB_CODE"
-				 * 0x000009c00000-0x00000a100000 : "NAND (RW) WG SYSA2 Kernel"
-				 * 0x00000a100000-0x000011ae0000 : "NAND (RW) WG SYSA_CODE2"
-				 * 0x000011ae0000-0x000020000000 : "NAND (RW) WG SYSA_DATA"
-				 */
-
-				partition at 0 {
-					reg = <0x0 0x20000>;
-					label = "wg-dtb";
-					read-only;
-				};
-
-				partition at 20000 {
-					reg = <0x20000 0x500000>;
-					label = "kernel";
-				};
-
-				partition at 520000 {
-					reg = <0x520000 0x79e0000>;
-					label = "wg-sysa-rootfs";
-					read-only;
-				};
-
-				partition at 7f00000 {
-					reg = <0x7f00000 0x500000>;
-					label = "wg-sysb-kernel";
-					read-only;
-				};
-
-				partition at 8400000 {
-					reg = <0x8400000 0x1800000>;
-					label = "wg-sysb-rootfs";
-					read-only;
-				};
-
-				partition at 9c00000 {
-					reg = <0x9c00000 0x500000>;
-					label = "wg-sysa2-kernel";
-					read-only;
-				};
-
-				partition at a100000 {
-					reg = <0xa100000 0x79e0000>;
-					label = "wg-sysa2-rootfs";
-					read-only;
-				};
-
-				partition at 11ae0000 {
-					reg = <0x11ae0000 0xe520000>;
-					label = "ubi";
-				};
-			};
-		};
-	};
 };
-
-/include/ "fsl/p1010si-post.dtsi"



From lede-commits at lists.infradead.org  Wed Dec 10 15:58:59 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 10 Dec 2025 18:58:59 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: remove DDR combo
 for MT7987
In-Reply-To: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
References: <176541113210.1825938.10173462979420064269@git-01.infra.openwrt.org>
Message-ID: <mailman.34719.1765411142.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/8117f30f6f8e816e0193a96bc97c126a887dd16b

commit 8117f30f6f8e816e0193a96bc97c126a887dd16b
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Tue Nov 11 21:10:36 2025 +0800

    arm-trusted-firmware-mediatek: remove DDR combo for MT7987
    
    The DRAM_USE_COMB option is only valid for the MT7988. There
    is no DRAM type selection for the MT7987, so remove it.
    
    Fixes: de8fc8b ("arm-trusted-firmware-mediatek: add builds for MT7987")
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    Link: https://github.com/openwrt/openwrt/pull/21000
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit bb2d9c1a65424f318bcda46237e82d170c95688b)
---
 package/boot/arm-trusted-firmware-mediatek/Makefile | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index 24fa97e5ce..3ce3b582fb 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -408,7 +408,6 @@ define Trusted-Firmware-A/mt7987-emmc-comb
   BOOT_DEVICE:=emmc
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
 endef
 
 define Trusted-Firmware-A/mt7987-emmc-ddr4-4bg
@@ -424,7 +423,6 @@ define Trusted-Firmware-A/mt7987-nor-comb
   BOOT_DEVICE:=nor
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
 endef
 
 define Trusted-Firmware-A/mt7987-sdmmc-comb
@@ -432,7 +430,6 @@ define Trusted-Firmware-A/mt7987-sdmmc-comb
   BOOT_DEVICE:=sdmmc
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
 endef
 
 define Trusted-Firmware-A/mt7987-sdmmc-ddr4-4bg
@@ -448,7 +445,6 @@ define Trusted-Firmware-A/mt7987-spim-nand0-ubi-comb
   BOOT_DEVICE:=spim-nand
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
   USE_UBI:=1
   SPIM_CTRL:=0
 endef
@@ -458,7 +454,6 @@ define Trusted-Firmware-A/mt7987-spim-nand2-ubi-comb
   BOOT_DEVICE:=spim-nand
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
   USE_UBI:=1
   SPIM_CTRL:=2
 endef
@@ -468,7 +463,6 @@ define Trusted-Firmware-A/mt7987-ram-comb
   BOOT_DEVICE:=ram
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7987
-  DRAM_USE_COMB:=1
   RAM_BOOT_UART_DL:=1
   HIDDEN:=
   DEFAULT:=TARGET_mediatek_filogic



From lede-commits at lists.infradead.org  Wed Dec 10 22:41:40 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 01:41:40 -0500
Subject: [openwrt/openwrt]  base-files: always generate default DUID
In-Reply-To: <176543530038.175032.3918796283554359468@git-01.infra.openwrt.org>
References: <176543530038.175032.3918796283554359468@git-01.infra.openwrt.org>
Message-ID: <mailman.34751.1765435304.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/52fa3728e5304ecdfca77332bdfe870696b95d35

commit 52fa3728e5304ecdfca77332bdfe870696b95d35
Author: David H?rdeman <david at hardeman.nu>
AuthorDate: Tue Dec 9 23:49:48 2025 +0100

    base-files: always generate default DUID
    
    The previous logic was copied from 12_network-generate-ula, but fails to
    account for upgrades where the "auto" value isn't set (it is set by
    base-files/files/bin/config_generate). Fix this to always set the
    default duid if it isn't set.
    
    Also, rename the file to better reflect what it does.
    
    Closes: #21029
    Fixes: a660a076db5a ("base-files: generate a global DHCP DUID")
    Link: https://github.com/openwrt/openwrt/pull/21118
    Signed-off-by: David H?rdeman <david at hardeman.nu>
    Signed-off-by: Petr ?tetiar <ynezz at true.cz> [fixes,closes tag]
---
 .../{14_network-generate-clientid => 14_network-generate-duid}          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/uci-defaults/14_network-generate-clientid b/package/base-files/files/etc/uci-defaults/14_network-generate-duid
similarity index 69%
rename from package/base-files/files/etc/uci-defaults/14_network-generate-clientid
rename to package/base-files/files/etc/uci-defaults/14_network-generate-duid
index 11806dd19c..c793dba695 100644
--- a/package/base-files/files/etc/uci-defaults/14_network-generate-clientid
+++ b/package/base-files/files/etc/uci-defaults/14_network-generate-duid
@@ -1,4 +1,4 @@
-[ "$(uci -q get network.globals.dhcp_default_duid)" != "auto" ] && exit 0
+[ "$(uci -q get network.globals.dhcp_default_duid || echo "auto")" != "auto" ] && exit 0
 
 uci -q batch <<-EOF >/dev/null
 	# DUID-UUID - RFC6355



From lede-commits at lists.infradead.org  Wed Dec 10 22:42:50 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 01:42:50 -0500
Subject: [openwrt/openwrt]  base-files: always generate default DUID
In-Reply-To: <176543537061.180686.4436135872929524650@git-01.infra.openwrt.org>
References: <176543537061.180686.4436135872929524650@git-01.infra.openwrt.org>
Message-ID: <mailman.34752.1765435375.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/4444f314ac3d51c0eb0684b480afb275383478f3

commit 4444f314ac3d51c0eb0684b480afb275383478f3
Author: David H?rdeman <david at hardeman.nu>
AuthorDate: Tue Dec 9 23:49:48 2025 +0100

    base-files: always generate default DUID
    
    The previous logic was copied from 12_network-generate-ula, but fails to
    account for upgrades where the "auto" value isn't set (it is set by
    base-files/files/bin/config_generate). Fix this to always set the
    default duid if it isn't set.
    
    Also, rename the file to better reflect what it does.
    
    Closes: #21029
    Fixes: a660a076db5a ("base-files: generate a global DHCP DUID")
    Link: https://github.com/openwrt/openwrt/pull/21118
    Signed-off-by: David H?rdeman <david at hardeman.nu>
    Signed-off-by: Petr ?tetiar <ynezz at true.cz> [fixes,closes tag]
    (cherry picked from commit 52fa3728e5304ecdfca77332bdfe870696b95d35)
---
 .../{14_network-generate-clientid => 14_network-generate-duid}          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/uci-defaults/14_network-generate-clientid b/package/base-files/files/etc/uci-defaults/14_network-generate-duid
similarity index 69%
rename from package/base-files/files/etc/uci-defaults/14_network-generate-clientid
rename to package/base-files/files/etc/uci-defaults/14_network-generate-duid
index 11806dd19c..c793dba695 100644
--- a/package/base-files/files/etc/uci-defaults/14_network-generate-clientid
+++ b/package/base-files/files/etc/uci-defaults/14_network-generate-duid
@@ -1,4 +1,4 @@
-[ "$(uci -q get network.globals.dhcp_default_duid)" != "auto" ] && exit 0
+[ "$(uci -q get network.globals.dhcp_default_duid || echo "auto")" != "auto" ] && exit 0
 
 uci -q batch <<-EOF >/dev/null
 	# DUID-UUID - RFC6355



From lede-commits at lists.infradead.org  Thu Dec 11 11:17:19 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 14:17:19 -0500
Subject: [buildbot]  phase1: fix signing steps when only apk_key is defined
In-Reply-To: <176548063853.451255.8758686477447128614@git-01.infra.openwrt.org>
References: <176548063853.451255.8758686477447128614@git-01.infra.openwrt.org>
Message-ID: <mailman.35009.1765480643.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to buildbot.git, branch main:
https://git.openwrt.org/b92996c987fa8d09e927be15e5bde3fc405b55b9

commit b92996c987fa8d09e927be15e5bde3fc405b55b9
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Thu Dec 11 18:13:05 2025 +0000

    phase1: fix signing steps when only apk_key is defined
    
    Signing steps are currently skipped if only `apk_key` is configured for a
    branch, because `IsSignEnabled` only checks for `usign_key` or `gpg_key`.
    
    Fix this by explicitly checking for `apk_key`.
    
    While at it, refactor the signing checks into dedicated helper functions
    `IsApkSigningEnabled` and `IsGpgSigningEnabled` for better readability.
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 phase1/master.cfg | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/phase1/master.cfg b/phase1/master.cfg
index e3dee37..de60972 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -88,7 +88,9 @@ def ini_parse_branch(section):
     b["src_url"] = section.get("source_url")
     b["src_key"] = section.get("source_password")
 
+    b["apk_key"] = section.get("apk_key")
     b["gpg_key"] = section.get("gpg_key")
+    b["gpg_keyid"] = section.get("gpg_keyid")
 
     b["usign_key"] = section.get("usign_key")
     usign_comment = "untrusted comment: " + name.replace("-", " ").title() + " key"
@@ -573,9 +575,24 @@ def IsUsignEnabled(step):
     return branch and branches[branch].get("usign_key")
 
 
-def IsSignEnabled(step):
+def IsApkSigningEnabled(step):
     branch = step.getProperty("branch")
-    return IsUsignEnabled(step) or branch and branches[branch].get("gpg_key")
+    return branch and branches[branch].get("apk_key")
+
+
+# gpg_key - contains the key in PGP format
+# gpg_keyid - contains the keyid of the key on the nk3 dongle
+def IsGpgSigningEnabled(step):
+    branch = step.getProperty("branch")
+    return branch and (
+        branches[branch].get("gpg_key") or branches[branch].get("gpg_keyid")
+    )
+
+
+def IsSignEnabled(step):
+    return (
+        IsUsignEnabled(step) or IsApkSigningEnabled(step) or IsGpgSigningEnabled(step)
+    )
 
 
 def IsKmodArchiveEnabled(step):



From lede-commits at lists.infradead.org  Thu Dec 11 11:17:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 14:17:18 -0500
Subject: [buildbot]  CI(deps): Bump actions/checkout from 4 to 5
In-Reply-To: <176548063853.451255.8758686477447128614@git-01.infra.openwrt.org>
References: <176548063853.451255.8758686477447128614@git-01.infra.openwrt.org>
Message-ID: <mailman.35010.1765480643.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to buildbot.git, branch main:
https://git.openwrt.org/54e80480d2cb1cd4f723d89addf65058b0e56709

commit 54e80480d2cb1cd4f723d89addf65058b0e56709
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Tue Aug 12 04:55:28 2025 +0000

    CI(deps): Bump actions/checkout from 4 to 5
    
    Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/actions/checkout/compare/v4...v5)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-version: '5'
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support at github.com>
---
 .github/workflows/build-push.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml
index e3c0be6..16b66e0 100644
--- a/.github/workflows/build-push.yml
+++ b/.github/workflows/build-push.yml
@@ -27,7 +27,7 @@ jobs:
 
     steps:
       - name: Checkout
-        uses: actions/checkout at v4
+        uses: actions/checkout at v5
 
       - uses: actions/setup-python at v5
         with:
@@ -63,7 +63,7 @@ jobs:
 
     steps:
       - name: Checkout
-        uses: actions/checkout at v4
+        uses: actions/checkout at v5
 
       - name: Environment variables
         run: |
@@ -105,7 +105,7 @@ jobs:
 
     steps:
       - name: Checkout
-        uses: actions/checkout at v4
+        uses: actions/checkout at v5
 
       - name: Environment variables
         run: |



From lede-commits at lists.infradead.org  Thu Dec 11 13:36:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 16:36:41 -0500
Subject: [openwrt/openwrt]  kernel: bump 6.6 to 6.6.119
In-Reply-To: <176548900177.926286.1147963133367838395@git-01.infra.openwrt.org>
References: <176548900177.926286.1147963133367838395@git-01.infra.openwrt.org>
Message-ID: <mailman.35057.1765489008.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/581050ce4e1f28a8e371cbd090f48945e02d4448

commit 581050ce4e1f28a8e371cbd090f48945e02d4448
Author: Goetz Goerisch <ggoerisch at gmail.com>
AuthorDate: Sun Dec 7 08:48:11 2025 +0100

    kernel: bump 6.6 to 6.6.119
    
    Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.119
    
    Removed upstreamed patch:
    bcm27xx/patches-6.6/950-1255-Revert-Bluetooth-Always-request-for-user-confirmatio.patch [1]
    
    All other patches auto-refreshed.
    
    Upstream patch:
    [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.119&id=fd6a1261d05d7f4d6630229e1f280dd7256b9ce8
    
    Signed-off-by: Goetz Goerisch <ggoerisch at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21076
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/kernel-6.6                                 |  4 +-
 .../patches-6.6/901-snand-mtk-bmt-support.patch    |  6 +--
 ...-for-all-the-downstream-rpi-sound-card-dr.patch |  2 +-
 ...-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch |  4 +-
 ...tooth-Always-request-for-user-confirmatio.patch | 45 ----------------------
 ...re-add-support-for-setting-NAK-enhancemen.patch |  4 +-
 ...usb-dwc3-Set-DMA-and-coherent-masks-early.patch | 16 ++++----
 ...-0003-nvmem-layouts-add-U-Boot-env-layout.patch |  2 +-
 ...t-bitflip_threshold-to-75-of-ECC-strength.patch |  2 +-
 ...lock-add-uImage.FIT-subimage-block-driver.patch |  2 +-
 .../701-staging-add-fsl_ppfe-driver.patch          |  4 +-
 .../patches-6.6/330-snand-mtk-bmt-support.patch    |  6 +--
 ...-drivers-spi-mem-Add-spi-calibration-hook.patch |  4 +-
 ...-spinand-Add-calibration-support-for-spin.patch |  2 +-
 .../960-asus-hack-u-boot-ignore-mtdparts.patch     |  4 +-
 ...mtd-nor-support-mtd-name-from-device-tree.patch |  4 +-
 ...sb-dwc3-add-optional-PHY-interface-clocks.patch |  6 +--
 ...9-MAINTAINERS-Update-all-StarFive-entries.patch |  8 ++--
 ...et-starfive-Add-JH7100-audio-reset-driver.patch |  2 +-
 19 files changed, 41 insertions(+), 86 deletions(-)

diff --git a/include/kernel-6.6 b/include/kernel-6.6
index e5c3c5c302..7f4bc6fbfa 100644
--- a/include/kernel-6.6
+++ b/include/kernel-6.6
@@ -1,2 +1,2 @@
-LINUX_VERSION-6.6 = .118
-LINUX_KERNEL_HASH-6.6.118 = 4bdddce35474afc8d26f74ebfbcd0e1045ecd15f69e60f53529dba143374b17d
+LINUX_VERSION-6.6 = .119
+LINUX_KERNEL_HASH-6.6.119 = 3da09b980bb404cc28793479bb2d6c636522679215ffa65a04c893575253e5e8
diff --git a/target/linux/airoha/patches-6.6/901-snand-mtk-bmt-support.patch b/target/linux/airoha/patches-6.6/901-snand-mtk-bmt-support.patch
index e62a810a57..ad11affefe 100644
--- a/target/linux/airoha/patches-6.6/901-snand-mtk-bmt-support.patch
+++ b/target/linux/airoha/patches-6.6/901-snand-mtk-bmt-support.patch
@@ -8,7 +8,7 @@
  
  static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
  {
-@@ -1353,6 +1354,7 @@ static int spinand_probe(struct spi_mem
+@@ -1355,6 +1356,7 @@ static int spinand_probe(struct spi_mem
  	if (ret)
  		return ret;
  
@@ -16,7 +16,7 @@
  	ret = mtd_device_register(mtd, NULL, 0);
  	if (ret)
  		goto err_spinand_cleanup;
-@@ -1360,6 +1362,7 @@ static int spinand_probe(struct spi_mem
+@@ -1362,6 +1364,7 @@ static int spinand_probe(struct spi_mem
  	return 0;
  
  err_spinand_cleanup:
@@ -24,7 +24,7 @@
  	spinand_cleanup(spinand);
  
  	return ret;
-@@ -1378,6 +1381,7 @@ static int spinand_remove(struct spi_mem
+@@ -1380,6 +1383,7 @@ static int spinand_remove(struct spi_mem
  	if (ret)
  		return ret;
  
diff --git a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch
index 09ad4d0ac7..8521837175 100644
--- a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch
+++ b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch
@@ -17583,7 +17583,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
  	 * For devices with more than one control interface, we assume the
 --- a/sound/usb/quirks.c
 +++ b/sound/usb/quirks.c
-@@ -2278,6 +2278,8 @@ static const struct usb_audio_quirk_flag
+@@ -2279,6 +2279,8 @@ static const struct usb_audio_quirk_flag
  		   QUIRK_FLAG_ALIGN_TRANSFER),
  	DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */
  		   QUIRK_FLAG_ALIGN_TRANSFER),
diff --git a/target/linux/bcm27xx/patches-6.6/950-0853-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch b/target/linux/bcm27xx/patches-6.6/950-0853-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch
index 77aebef467..fe0a610ab8 100644
--- a/target/linux/bcm27xx/patches-6.6/950-0853-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch
+++ b/target/linux/bcm27xx/patches-6.6/950-0853-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch
@@ -16,7 +16,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
 
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -1367,6 +1367,9 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1368,6 +1368,9 @@ static int dwc3_core_init(struct dwc3 *d
  		if (dwc->parkmode_disable_hs_quirk)
  			reg |= DWC3_GUCTL1_PARKMODE_DISABLE_HS;
  
@@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		if (DWC3_VER_IS_WITHIN(DWC3, 290A, ANY) &&
  		    (dwc->maximum_speed == USB_SPEED_HIGH ||
  		     dwc->maximum_speed == USB_SPEED_FULL))
-@@ -1634,6 +1637,8 @@ static void dwc3_get_properties(struct d
+@@ -1635,6 +1638,8 @@ static void dwc3_get_properties(struct d
  				"snps,parkmode-disable-ss-quirk");
  	dwc->parkmode_disable_hs_quirk = device_property_read_bool(dev,
  				"snps,parkmode-disable-hs-quirk");
diff --git a/target/linux/bcm27xx/patches-6.6/950-1255-Revert-Bluetooth-Always-request-for-user-confirmatio.patch b/target/linux/bcm27xx/patches-6.6/950-1255-Revert-Bluetooth-Always-request-for-user-confirmatio.patch
deleted file mode 100644
index e549f27d7b..0000000000
--- a/target/linux/bcm27xx/patches-6.6/950-1255-Revert-Bluetooth-Always-request-for-user-confirmatio.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From d6a12dd8f4e9362f7dd355969dd046adc44b1f47 Mon Sep 17 00:00:00 2001
-From: Phil Elwell <phil at raspberrypi.com>
-Date: Mon, 1 Mar 2021 09:12:44 +0000
-Subject: [PATCH 1255/1350] Revert "Bluetooth: Always request for user
- confirmation for Just Works (LE SC)"
-
-This reverts commit ffee202a78c2980688bc5d2f7d56480e69a5e0c9.
-
-The commit "Bluetooth: Always request for user confirmation for Just
-Works" prevents BLE devices pairing in (at least) the Raspberry Pi OS
-GUI. After reverting it, pairing works again. Although this companion
-commit ("... (LE SC)") has not been demonstrated to be problematic,
-it follows the same logic and therefore could affect some use cases.
-
-If another solution to the problem is found then this reversion will
-be removed.
-
-See: https://github.com/raspberrypi/linux/issues/4139
-
-Signed-off-by: Phil Elwell <phil at raspberrypi.com>
----
- net/bluetooth/smp.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
---- a/net/bluetooth/smp.c
-+++ b/net/bluetooth/smp.c
-@@ -2208,7 +2208,7 @@ mackey_and_ltk:
- 	if (err)
- 		return SMP_UNSPECIFIED;
- 
--	if (smp->method == REQ_OOB) {
-+	if (smp->method == JUST_WORKS || smp->method == REQ_OOB) {
- 		if (test_bit(SMP_FLAG_INITIATOR, &smp->flags)) {
- 			sc_dhkey_check(smp);
- 			SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK);
-@@ -2223,9 +2223,6 @@ mackey_and_ltk:
- 	confirm_hint = 0;
- 
- confirm:
--	if (smp->method == JUST_WORKS)
--		confirm_hint = 1;
--
- 	err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type,
- 					hcon->dst_type, passkey, confirm_hint);
- 	if (err)
diff --git a/target/linux/bcm27xx/patches-6.6/950-1359-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch b/target/linux/bcm27xx/patches-6.6/950-1359-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch
index db0cce8d59..38ee7d3aef 100644
--- a/target/linux/bcm27xx/patches-6.6/950-1359-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch
+++ b/target/linux/bcm27xx/patches-6.6/950-1359-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch
@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
 
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -1361,6 +1361,12 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1362,6 +1362,12 @@ static int dwc3_core_init(struct dwc3 *d
  		if (dwc->dis_tx_ipgap_linecheck_quirk)
  			reg |= DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS;
  
@@ -35,7 +35,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		if (dwc->parkmode_disable_ss_quirk)
  			reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS;
  
-@@ -1633,6 +1639,10 @@ static void dwc3_get_properties(struct d
+@@ -1634,6 +1640,10 @@ static void dwc3_get_properties(struct d
  				"snps,resume-hs-terminations");
  	dwc->ulpi_ext_vbus_drv = device_property_read_bool(dev,
  				"snps,ulpi-ext-vbus-drv");
diff --git a/target/linux/bcm27xx/patches-6.6/950-1539-Reapply-usb-dwc3-Set-DMA-and-coherent-masks-early.patch b/target/linux/bcm27xx/patches-6.6/950-1539-Reapply-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
index 327819f289..95cbe44e38 100644
--- a/target/linux/bcm27xx/patches-6.6/950-1539-Reapply-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
+++ b/target/linux/bcm27xx/patches-6.6/950-1539-Reapply-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
@@ -171,7 +171,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
  	},
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -1223,6 +1223,24 @@ static void dwc3_config_threshold(struct
+@@ -1224,6 +1224,24 @@ static void dwc3_config_threshold(struct
  	}
  }
  
@@ -196,7 +196,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
  /**
   * dwc3_core_init - Low-level initialization of DWC3 Core
   * @dwc: Pointer to our controller context structure
-@@ -1288,6 +1306,8 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1289,6 +1307,8 @@ static int dwc3_core_init(struct dwc3 *d
  
  	dwc3_set_incr_burst_type(dwc);
  
@@ -205,7 +205,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
  	ret = dwc3_phy_power_on(dwc);
  	if (ret)
  		goto err_exit_phy;
-@@ -1386,6 +1406,24 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1387,6 +1407,24 @@ static int dwc3_core_init(struct dwc3 *d
  
  	dwc3_config_threshold(dwc);
  
@@ -230,7 +230,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
  	return 0;
  
  err_power_off_phy:
-@@ -1529,6 +1567,7 @@ static void dwc3_get_properties(struct d
+@@ -1530,6 +1568,7 @@ static void dwc3_get_properties(struct d
  	u8			tx_thr_num_pkt_prd = 0;
  	u8			tx_max_burst_prd = 0;
  	u8			tx_fifo_resize_max_num;
@@ -238,7 +238,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
  
  	/* default to highest possible threshold */
  	lpm_nyet_threshold = 0xf;
-@@ -1549,6 +1588,9 @@ static void dwc3_get_properties(struct d
+@@ -1550,6 +1589,9 @@ static void dwc3_get_properties(struct d
  	 */
  	tx_fifo_resize_max_num = 6;
  
@@ -248,7 +248,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
  	dwc->maximum_speed = usb_get_maximum_speed(dev);
  	dwc->max_ssp_rate = usb_get_maximum_ssp_rate(dev);
  	dwc->dr_mode = usb_get_dr_mode(dev);
-@@ -1669,6 +1711,9 @@ static void dwc3_get_properties(struct d
+@@ -1670,6 +1712,9 @@ static void dwc3_get_properties(struct d
  	dwc->dis_split_quirk = device_property_read_bool(dev,
  				"snps,dis-split-quirk");
  
@@ -258,7 +258,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
  	dwc->lpm_nyet_threshold = lpm_nyet_threshold;
  	dwc->tx_de_emphasis = tx_de_emphasis;
  
-@@ -1686,6 +1731,8 @@ static void dwc3_get_properties(struct d
+@@ -1687,6 +1732,8 @@ static void dwc3_get_properties(struct d
  	dwc->tx_thr_num_pkt_prd = tx_thr_num_pkt_prd;
  	dwc->tx_max_burst_prd = tx_max_burst_prd;
  
@@ -267,7 +267,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
  	dwc->tx_fifo_resize_max_num = tx_fifo_resize_max_num;
  }
  
-@@ -1978,6 +2025,12 @@ static int dwc3_probe(struct platform_de
+@@ -1979,6 +2026,12 @@ static int dwc3_probe(struct platform_de
  	if (IS_ERR(dwc->usb_psy))
  		return dev_err_probe(dev, PTR_ERR(dwc->usb_psy), "couldn't get usb power supply\n");
  
diff --git a/target/linux/generic/backport-6.6/823-v6.12-0003-nvmem-layouts-add-U-Boot-env-layout.patch b/target/linux/generic/backport-6.6/823-v6.12-0003-nvmem-layouts-add-U-Boot-env-layout.patch
index f869fc2037..e087b51c20 100644
--- a/target/linux/generic/backport-6.6/823-v6.12-0003-nvmem-layouts-add-U-Boot-env-layout.patch
+++ b/target/linux/generic/backport-6.6/823-v6.12-0003-nvmem-layouts-add-U-Boot-env-layout.patch
@@ -41,7 +41,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -21990,6 +21990,7 @@ U-BOOT ENVIRONMENT VARIABLES
+@@ -21984,6 +21984,7 @@ U-BOOT ENVIRONMENT VARIABLES
  M:	Rafa? Mi?ecki <rafal at milecki.pl>
  S:	Maintained
  F:	Documentation/devicetree/bindings/nvmem/u-boot,env.yaml
diff --git a/target/linux/generic/pending-6.6/410-mtd-spinand-set-bitflip_threshold-to-75-of-ECC-strength.patch b/target/linux/generic/pending-6.6/410-mtd-spinand-set-bitflip_threshold-to-75-of-ECC-strength.patch
index 814b50e19c..6b935eb602 100644
--- a/target/linux/generic/pending-6.6/410-mtd-spinand-set-bitflip_threshold-to-75-of-ECC-strength.patch
+++ b/target/linux/generic/pending-6.6/410-mtd-spinand-set-bitflip_threshold-to-75-of-ECC-strength.patch
@@ -53,7 +53,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/mtd/nand/spi/core.c
 +++ b/drivers/mtd/nand/spi/core.c
-@@ -1292,6 +1292,7 @@ static int spinand_init(struct spinand_d
+@@ -1294,6 +1294,7 @@ static int spinand_init(struct spinand_d
  	/* Propagate ECC information to mtd_info */
  	mtd->ecc_strength = nanddev_get_ecc_conf(nand)->strength;
  	mtd->ecc_step_size = nanddev_get_ecc_conf(nand)->step_size;
diff --git a/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch b/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch
index 1ad2210352..1d91f8372a 100644
--- a/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch
+++ b/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch
@@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -22017,6 +22017,12 @@ F:	Documentation/filesystems/ubifs-authe
+@@ -22011,6 +22011,12 @@ F:	Documentation/filesystems/ubifs-authe
  F:	Documentation/filesystems/ubifs.rst
  F:	fs/ubifs/
  
diff --git a/target/linux/layerscape/patches-6.6/701-staging-add-fsl_ppfe-driver.patch b/target/linux/layerscape/patches-6.6/701-staging-add-fsl_ppfe-driver.patch
index 59bbb964c5..f912d4ed3b 100644
--- a/target/linux/layerscape/patches-6.6/701-staging-add-fsl_ppfe-driver.patch
+++ b/target/linux/layerscape/patches-6.6/701-staging-add-fsl_ppfe-driver.patch
@@ -908,7 +908,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong at nxp.com>
  L:	linux-spi at vger.kernel.org
 --- a/drivers/staging/Kconfig
 +++ b/drivers/staging/Kconfig
-@@ -78,4 +78,6 @@ source "drivers/staging/qlge/Kconfig"
+@@ -76,4 +76,6 @@ source "drivers/staging/qlge/Kconfig"
  
  source "drivers/staging/vme_user/Kconfig"
  
@@ -917,7 +917,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong at nxp.com>
  endif # STAGING
 --- a/drivers/staging/Makefile
 +++ b/drivers/staging/Makefile
-@@ -28,3 +28,4 @@ obj-$(CONFIG_PI433)		+= pi433/
+@@ -27,3 +27,4 @@ obj-$(CONFIG_PI433)		+= pi433/
  obj-$(CONFIG_XIL_AXIS_FIFO)	+= axis-fifo/
  obj-$(CONFIG_FIELDBUS_DEV)     += fieldbus/
  obj-$(CONFIG_QLGE)		+= qlge/
diff --git a/target/linux/mediatek/patches-6.6/330-snand-mtk-bmt-support.patch b/target/linux/mediatek/patches-6.6/330-snand-mtk-bmt-support.patch
index e62a810a57..ad11affefe 100644
--- a/target/linux/mediatek/patches-6.6/330-snand-mtk-bmt-support.patch
+++ b/target/linux/mediatek/patches-6.6/330-snand-mtk-bmt-support.patch
@@ -8,7 +8,7 @@
  
  static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
  {
-@@ -1353,6 +1354,7 @@ static int spinand_probe(struct spi_mem
+@@ -1355,6 +1356,7 @@ static int spinand_probe(struct spi_mem
  	if (ret)
  		return ret;
  
@@ -16,7 +16,7 @@
  	ret = mtd_device_register(mtd, NULL, 0);
  	if (ret)
  		goto err_spinand_cleanup;
-@@ -1360,6 +1362,7 @@ static int spinand_probe(struct spi_mem
+@@ -1362,6 +1364,7 @@ static int spinand_probe(struct spi_mem
  	return 0;
  
  err_spinand_cleanup:
@@ -24,7 +24,7 @@
  	spinand_cleanup(spinand);
  
  	return ret;
-@@ -1378,6 +1381,7 @@ static int spinand_remove(struct spi_mem
+@@ -1380,6 +1383,7 @@ static int spinand_remove(struct spi_mem
  	if (ret)
  		return ret;
  
diff --git a/target/linux/mediatek/patches-6.6/433-drivers-spi-mem-Add-spi-calibration-hook.patch b/target/linux/mediatek/patches-6.6/433-drivers-spi-mem-Add-spi-calibration-hook.patch
index d9fe480b17..c0b51d84ad 100644
--- a/target/linux/mediatek/patches-6.6/433-drivers-spi-mem-Add-spi-calibration-hook.patch
+++ b/target/linux/mediatek/patches-6.6/433-drivers-spi-mem-Add-spi-calibration-hook.patch
@@ -11,7 +11,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang at mediatek.com>
 
 --- a/drivers/spi/spi-mem.c
 +++ b/drivers/spi/spi-mem.c
-@@ -419,6 +419,14 @@ int spi_mem_exec_op(struct spi_mem *mem,
+@@ -439,6 +439,14 @@ int spi_mem_exec_op(struct spi_mem *mem,
  }
  EXPORT_SYMBOL_GPL(spi_mem_exec_op);
  
@@ -28,7 +28,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang at mediatek.com>
   *			upper layer if necessary
 --- a/include/linux/spi/spi-mem.h
 +++ b/include/linux/spi/spi-mem.h
-@@ -370,6 +370,10 @@ bool spi_mem_supports_op(struct spi_mem
+@@ -388,6 +388,10 @@ bool spi_mem_supports_op(struct spi_mem
  int spi_mem_exec_op(struct spi_mem *mem,
  		    const struct spi_mem_op *op);
  
diff --git a/target/linux/mediatek/patches-6.6/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch b/target/linux/mediatek/patches-6.6/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch
index 7d54700718..45d1199f8d 100644
--- a/target/linux/mediatek/patches-6.6/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch
+++ b/target/linux/mediatek/patches-6.6/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch
@@ -68,7 +68,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang at mediatek.com>
  static int spinand_id_detect(struct spinand_device *spinand)
  {
  	u8 *id = spinand->id.data;
-@@ -1235,6 +1285,10 @@ static int spinand_init(struct spinand_d
+@@ -1237,6 +1287,10 @@ static int spinand_init(struct spinand_d
  	if (!spinand->scratchbuf)
  		return -ENOMEM;
  
diff --git a/target/linux/mediatek/patches-6.6/960-asus-hack-u-boot-ignore-mtdparts.patch b/target/linux/mediatek/patches-6.6/960-asus-hack-u-boot-ignore-mtdparts.patch
index 8337e12887..14d98e9025 100644
--- a/target/linux/mediatek/patches-6.6/960-asus-hack-u-boot-ignore-mtdparts.patch
+++ b/target/linux/mediatek/patches-6.6/960-asus-hack-u-boot-ignore-mtdparts.patch
@@ -29,7 +29,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/mtd/nand/spi/core.c
 +++ b/drivers/mtd/nand/spi/core.c
-@@ -1447,6 +1447,7 @@ static int spinand_remove(struct spi_mem
+@@ -1449,6 +1449,7 @@ static int spinand_remove(struct spi_mem
  
  static const struct spi_device_id spinand_ids[] = {
  	{ .name = "spi-nand" },
@@ -37,7 +37,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  	{ /* sentinel */ },
  };
  MODULE_DEVICE_TABLE(spi, spinand_ids);
-@@ -1454,6 +1455,7 @@ MODULE_DEVICE_TABLE(spi, spinand_ids);
+@@ -1456,6 +1457,7 @@ MODULE_DEVICE_TABLE(spi, spinand_ids);
  #ifdef CONFIG_OF
  static const struct of_device_id spinand_of_ids[] = {
  	{ .compatible = "spi-nand" },
diff --git a/target/linux/pistachio/patches-6.6/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-6.6/401-mtd-nor-support-mtd-name-from-device-tree.patch
index 0000c22a89..3e2a7abff5 100644
--- a/target/linux/pistachio/patches-6.6/401-mtd-nor-support-mtd-name-from-device-tree.patch
+++ b/target/linux/pistachio/patches-6.6/401-mtd-nor-support-mtd-name-from-device-tree.patch
@@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
 
 --- a/drivers/spi/spi-mem.c
 +++ b/drivers/spi/spi-mem.c
-@@ -846,7 +846,9 @@ static int spi_mem_probe(struct spi_devi
+@@ -883,7 +883,9 @@ static int spi_mem_probe(struct spi_devi
  {
  	struct spi_mem_driver *memdrv = to_spi_mem_drv(spi->dev.driver);
  	struct spi_controller *ctlr = spi->controller;
@@ -20,7 +20,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
  
  	mem = devm_kzalloc(&spi->dev, sizeof(*mem), GFP_KERNEL);
  	if (!mem)
-@@ -854,10 +856,15 @@ static int spi_mem_probe(struct spi_devi
+@@ -891,10 +893,15 @@ static int spi_mem_probe(struct spi_devi
  
  	mem->spi = spi;
  
diff --git a/target/linux/rockchip/patches-6.6/034-v6.7-usb-dwc3-add-optional-PHY-interface-clocks.patch b/target/linux/rockchip/patches-6.6/034-v6.7-usb-dwc3-add-optional-PHY-interface-clocks.patch
index 4d358ea219..02c47b4826 100644
--- a/target/linux/rockchip/patches-6.6/034-v6.7-usb-dwc3-add-optional-PHY-interface-clocks.patch
+++ b/target/linux/rockchip/patches-6.6/034-v6.7-usb-dwc3-add-optional-PHY-interface-clocks.patch
@@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -860,8 +860,20 @@ static int dwc3_clk_enable(struct dwc3 *
+@@ -861,8 +861,20 @@ static int dwc3_clk_enable(struct dwc3 *
  	if (ret)
  		goto disable_ref_clk;
  
@@ -39,7 +39,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  disable_ref_clk:
  	clk_disable_unprepare(dwc->ref_clk);
  disable_bus_clk:
-@@ -871,6 +883,8 @@ disable_bus_clk:
+@@ -872,6 +884,8 @@ disable_bus_clk:
  
  static void dwc3_clk_disable(struct dwc3 *dwc)
  {
@@ -48,7 +48,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	clk_disable_unprepare(dwc->susp_clk);
  	clk_disable_unprepare(dwc->ref_clk);
  	clk_disable_unprepare(dwc->bus_clk);
-@@ -1886,6 +1900,20 @@ static int dwc3_get_clocks(struct dwc3 *
+@@ -1887,6 +1901,20 @@ static int dwc3_get_clocks(struct dwc3 *
  		}
  	}
  
diff --git a/target/linux/starfive/patches-6.6/0049-MAINTAINERS-Update-all-StarFive-entries.patch b/target/linux/starfive/patches-6.6/0049-MAINTAINERS-Update-all-StarFive-entries.patch
index 5f2c94914f..1f023052fc 100644
--- a/target/linux/starfive/patches-6.6/0049-MAINTAINERS-Update-all-StarFive-entries.patch
+++ b/target/linux/starfive/patches-6.6/0049-MAINTAINERS-Update-all-StarFive-entries.patch
@@ -88,7 +88,7 @@ Signed-off-by: Hal Feng <hal.feng at starfivetech.com>
  F:	drivers/pwm/pwm-microchip-core.c
  F:	drivers/reset/reset-mpfs.c
  F:	drivers/rtc/rtc-mpfs.c
-@@ -20437,6 +20467,15 @@ M:	Ion Badulescu <ionut at badula.org>
+@@ -20431,6 +20461,15 @@ M:	Ion Badulescu <ionut at badula.org>
  S:	Odd Fixes
  F:	drivers/net/ethernet/adaptec/starfire*
  
@@ -104,7 +104,7 @@ Signed-off-by: Hal Feng <hal.feng at starfivetech.com>
  STARFIVE CRYPTO DRIVER
  M:	Jia Jie Ho <jiajie.ho at starfivetech.com>
  M:	William Qiu <william.qiu at starfivetech.com>
-@@ -20475,6 +20514,13 @@ S:	Supported
+@@ -20469,6 +20508,13 @@ S:	Supported
  F:	Documentation/devicetree/bindings/clock/starfive,jh7110-pll.yaml
  F:	drivers/clk/starfive/clk-starfive-jh7110-pll.c
  
@@ -118,7 +118,7 @@ Signed-off-by: Hal Feng <hal.feng at starfivetech.com>
  STARFIVE JH7110 SYSCON
  M:	William Qiu <william.qiu at starfivetech.com>
  M:	Xingyu Wu <xingyu.wu at starfivetech.com>
-@@ -20522,9 +20568,10 @@ F:	drivers/usb/cdns3/cdns3-starfive.c
+@@ -20516,9 +20562,10 @@ F:	drivers/usb/cdns3/cdns3-starfive.c
  
  STARFIVE JH71XX PMU CONTROLLER DRIVER
  M:	Walker Chen <walker.chen at starfivetech.com>
@@ -130,7 +130,7 @@ Signed-off-by: Hal Feng <hal.feng at starfivetech.com>
  F:	include/dt-bindings/power/starfive,jh7110-pmu.h
  
  STARFIVE SOC DRIVERS
-@@ -20532,7 +20579,13 @@ M:	Conor Dooley <conor at kernel.org>
+@@ -20526,7 +20573,13 @@ M:	Conor Dooley <conor at kernel.org>
  S:	Maintained
  T:	git https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/
  F:	Documentation/devicetree/bindings/soc/starfive/
diff --git a/target/linux/starfive/patches-6.6/1014-reset-starfive-Add-JH7100-audio-reset-driver.patch b/target/linux/starfive/patches-6.6/1014-reset-starfive-Add-JH7100-audio-reset-driver.patch
index 8b24eb33e5..578b6bf84a 100644
--- a/target/linux/starfive/patches-6.6/1014-reset-starfive-Add-JH7100-audio-reset-driver.patch
+++ b/target/linux/starfive/patches-6.6/1014-reset-starfive-Add-JH7100-audio-reset-driver.patch
@@ -20,7 +20,7 @@ Signed-off-by: Emil Renner Berthing <kernel at esmil.dk>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -20556,7 +20556,7 @@ STARFIVE JH71X0 RESET CONTROLLER DRIVERS
+@@ -20550,7 +20550,7 @@ STARFIVE JH71X0 RESET CONTROLLER DRIVERS
  M:	Emil Renner Berthing <kernel at esmil.dk>
  M:	Hal Feng <hal.feng at starfivetech.com>
  S:	Maintained



From lede-commits at lists.infradead.org  Thu Dec 11 14:04:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 17:04:41 -0500
Subject: [openwrt/openwrt]  ramips: add support for D-Link DIR-2660 A2
In-Reply-To: <176549068110.1075921.2586353382942820616@git-01.infra.openwrt.org>
References: <176549068110.1075921.2586353382942820616@git-01.infra.openwrt.org>
Message-ID: <mailman.35058.1765490689.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/6a92e68c51651da16bc8eb8d7eb5da19f2fe8091

commit 6a92e68c51651da16bc8eb8d7eb5da19f2fe8091
Author: Marcin Leksmark <lexmark3200 at wp.pl>
AuthorDate: Thu Sep 11 16:40:20 2025 +0200

    ramips: add support for D-Link DIR-2660 A2
    
    This patch adds support for D-Link DIR-2660 A2.
    Based on the commit: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=b5dd746cbb1aaf91f4b68e9f3eda97413550d904,
    
    Both devices look identical, except for the A1/A2 designation.
    You can safely install the A1 firmware for the A2 ? I've been testing it for several months as a DUMB AP ? without any problems.
    
    Specifications:
    * SoC: MediaTek MT7621AT
    * RAM: 256 MB (DDR3)
    * Flash: 128 MB (NAND)
    * WiFi: MediaTek MT7615N (x2)
    * Switch: 1 WAN, 4 LAN (Gigabit)
    * Ports: 1 USB 2.0, 1 USB 3.0
    * Buttons: Reset, WPS
    * LEDs: Power (white/orange), Internet (white/orange), WiFi 2.4G (white),
            WiFi 5G (white), USB 3.0 (white), USB 2.0 (white)
    
    Notes:
    * WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips
    
    Installation:
    * D-Link Recovery GUI: power down the router, press and hold the reset
      button, then re-plug it. Keep the reset button pressed until the power
      LED starts flashing orange, manually assign a static IP address under
      the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1
    
    * Some modern browsers may have problems flashing via the Recovery GUI,
      if that occurs consider uploading the firmware through cURL:
    
        curl -v -i -F "firmware=@file.bin" 192.168.0.1
    
    Signed-off-by: Marcin Leksmark <lexmark3200 at wp.pl>
    Link: https://github.com/openwrt/openwrt/pull/20020
    (cherry picked from commit 485f9b0d31fb406f3f4f0f4327cd6320443e550e)
    Link: https://github.com/openwrt/openwrt/pull/21113
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ramips/image/mt7621.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index fcef42bfb9..28745e9e82 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -960,6 +960,9 @@ define Device/dlink_dir-2660-a1
   $(Device/dlink_dir_nand_128m)
   DEVICE_MODEL := DIR-2660
   DEVICE_VARIANT := A1
+  DEVICE_ALT0_VENDOR := D-Link
+  DEVICE_ALT0_MODEL := DIR-2660
+  DEVICE_ALT0_VARIANT := A2
 endef
 TARGET_DEVICES += dlink_dir-2660-a1
 



From lede-commits at lists.infradead.org  Thu Dec 11 14:15:16 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 17:15:16 -0500
Subject: [openwrt/openwrt]  mac80211: ath12k: backport correctly handle mcast
 packets
In-Reply-To: <176549131599.1144395.3792712598408491861@git-01.infra.openwrt.org>
References: <176549131599.1144395.3792712598408491861@git-01.infra.openwrt.org>
Message-ID: <mailman.35061.1765491322.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/849811889350319f7aade56b083a58fc7b1d1bfc

commit 849811889350319f7aade56b083a58fc7b1d1bfc
Author: Oliver Sedlbauer <os at dev.tdt.de>
AuthorDate: Mon Dec 8 10:29:33 2025 +0100

    mac80211: ath12k: backport correctly handle mcast packets
    
    Backport upstream commit that fixes handling of multicast packets.
    Without this patch, ARP resolution fails, and connectivity from a
    station to an AP does not work reliably until traffic is initiated
    by the AP.
    
    Signed-off-by: Oliver Sedlbauer <os at dev.tdt.de>
    Link: https://github.com/openwrt/openwrt/pull/21088
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...-correctly-handle-mcast-packets-for-clien.patch | 66 ++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/package/kernel/mac80211/patches/ath12k/002-wifi-ath12k-correctly-handle-mcast-packets-for-clien.patch b/package/kernel/mac80211/patches/ath12k/002-wifi-ath12k-correctly-handle-mcast-packets-for-clien.patch
new file mode 100644
index 0000000000..2e5e080524
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath12k/002-wifi-ath12k-correctly-handle-mcast-packets-for-clien.patch
@@ -0,0 +1,66 @@
+From a1eb56723b3203d366d2293a368b8bc8ef8894cd Mon Sep 17 00:00:00 2001
+From: Sarika Sharma <quic_sarishar at quicinc.com>
+Date: Fri, 11 Apr 2025 11:45:23 +0530
+Subject: [PATCH] wifi: ath12k: correctly handle mcast packets for clients
+
+commit 4541b0c8c3c1b85564971d497224e57cf8076a02 upstream.
+
+Currently, RX is_mcbc bit is set for packets sent from client as
+destination address (DA) is multicast/broadcast address, but packets
+are actually unicast as receiver address (RA) is not multicast address.
+Hence, packets are not handled properly due to this is_mcbc bit.
+
+Therefore, reset the is_mcbc bit if interface type is AP.
+
+Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Sarika Sharma <quic_sarishar at quicinc.com>
+Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan at oss.qualcomm.com>
+Link: https://patch.msgid.link/20250411061523.859387-3-quic_sarishar at quicinc.com
+Signed-off-by: Jeff Johnson <jeff.johnson at oss.qualcomm.com>
+[ Adjust context ]
+Signed-off-by: Oliver Sedlbauer <os at dev.tdt.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/net/wireless/ath/ath12k/dp_rx.c | 5 +++++
+ drivers/net/wireless/ath/ath12k/peer.c  | 3 +++
+ drivers/net/wireless/ath/ath12k/peer.h  | 2 ++
+ 3 files changed, 10 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
++++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
+@@ -2214,6 +2214,11 @@ static void ath12k_dp_rx_h_mpdu(struct a
+ 	spin_lock_bh(&ar->ab->base_lock);
+ 	peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu);
+ 	if (peer) {
++		/* resetting mcbc bit because mcbc packets are unicast
++		 * packets only for AP as STA sends unicast packets.
++		 */
++		rxcb->is_mcbc = rxcb->is_mcbc && !peer->ucast_ra_only;
++
+ 		if (rxcb->is_mcbc)
+ 			enctype = peer->sec_type_grp;
+ 		else
+--- a/drivers/net/wireless/ath/ath12k/peer.c
++++ b/drivers/net/wireless/ath/ath12k/peer.c
+@@ -331,6 +331,9 @@ int ath12k_peer_create(struct ath12k *ar
+ 		arvif->ast_idx = peer->hw_peer_id;
+ 	}
+ 
++	if (arvif->vif->type == NL80211_IFTYPE_AP)
++		peer->ucast_ra_only = true;
++
+ 	peer->sec_type = HAL_ENCRYPT_TYPE_OPEN;
+ 	peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN;
+ 
+--- a/drivers/net/wireless/ath/ath12k/peer.h
++++ b/drivers/net/wireless/ath/ath12k/peer.h
+@@ -47,6 +47,8 @@ struct ath12k_peer {
+ 
+ 	/* protected by ab->data_lock */
+ 	bool dp_setup_done;
++
++	bool ucast_ra_only;
+ };
+ 
+ void ath12k_peer_unmap_event(struct ath12k_base *ab, u16 peer_id);



From lede-commits at lists.infradead.org  Thu Dec 11 14:39:11 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 17:39:11 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: add support for ASUS
 TUF-AX4200Q
In-Reply-To: <176549275189.1270467.3428141120171361831@git-01.infra.openwrt.org>
References: <176549275189.1270467.3428141120171361831@git-01.infra.openwrt.org>
Message-ID: <mailman.35062.1765492757.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/237b1c29e15206554c27049bbb109311311534a9

commit 237b1c29e15206554c27049bbb109311311534a9
Author: Brian Lee <larte332 at gmail.com>
AuthorDate: Thu Dec 4 18:09:49 2025 +0900

    mediatek: filogic: add support for ASUS TUF-AX4200Q
    
    ASUS TUF-AX4200Q(TUF ???Pro WiFi6 AX4200) is a home router that adds an additional 2.5G Ethernet port to ASUS TUF-AX4200.
    
    Hardware
    - - - - - - - -
    - SOC   : MediaTek MT7986
    - RAM   : 512MB DDR3
    - FLASH : 256MB SPI-NAND (Winbond W25N02KV)
    - WIFI  : Mediatek MT7986 DBDC 802.11ax 2.4/5 GHz
    - ETH   : MediaTek MT7531 Switch
              MaxLinear GPY211C 2.5 N-Base-T PHY (WAN)
              MaxLinear GPY211C 2.5 N-Base-T PHY (LAN)
    - UART  : 3V3 115200 8N1 (Pinout silkscreened / Do not ocnnect VCC)
    
    Installation
    - - - - - - - -
    Vendor-UI Method:
    
    1. Download or make 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.50.1/
    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 image.
    6. Wait for OpenWrt to boot. Transfer the sysupgrade image to the device using SCP and install using sysupgrade.
    
       $ sysupgrade -n <path-to-sysupgrade.bin>
    
    TFTP Method:
    
    1. Download the OpenWrt initramfs image.
       Copy the image to a TFTP server reachable at 192.168.1.70/24.
       Rename the image to tufax4200q.bin.
    
    2. Connect the PC with TFTP server to the TUF-AX4200Q.
       Set a static ip on the ethernet interface of your PC.
       (IP address: 192.168.1.70, subnet mask: 255.255.255.0)
       Connect to the serial console,
       interrupt the autoboot process by pressing '4' when prompted.
    
    3. Download & Boot the OpenWrt initramfs image.
    
       $ setenv ipaddr 192.168.1.1
       $ setenv serverip 192.168.1.70
       $ tftpboot 0x46000000 tufax4200q.bin
       $ bootm 0x46000000
    
    4. Wait for OpenWrt to boot.
       Transfer the sysupgrade image to the device using SCP and install using sysupgrade.
    
       $ sysupgrade -n <path-to-sysupgrade.bin>
    
    (based on support for ASUS RT-AX52 by achterin and trx image generation by remittor)
    
    Link: https://github.com/openwrt/openwrt/pull/20900
    (cherry picked from commit e7086d7a2fc00410df079b4897a47a823a36068d)
    Signed-off-by: Brian Lee <larte332 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21036
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../mediatek/dts/mt7986a-asus-tuf-ax4200q.dts      | 435 +++++++++++++++++++++
 .../filogic/base-files/etc/board.d/01_leds         |   4 +
 .../filogic/base-files/etc/board.d/02_network      |   1 +
 .../etc/hotplug.d/ieee80211/11_fix_wifi_mac        |   1 +
 .../base-files/lib/preinit/10_fix_eth_mac.sh       |   1 +
 .../filogic/base-files/lib/upgrade/platform.sh     |   2 +
 target/linux/mediatek/image/filogic.mk             |  22 ++
 7 files changed, 466 insertions(+)

diff --git a/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200q.dts b/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200q.dts
new file mode 100644
index 0000000000..3161d53076
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200q.dts
@@ -0,0 +1,435 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/mt65xx.h>
+
+#include "mt7986a.dtsi"
+
+/ {
+	model = "ASUS TUF-AX4200Q";
+	compatible = "asus,tuf-ax4200q", "mediatek,mt7986a";
+
+	aliases {
+		serial0 = &uart0;
+		label-mac-device = &gmac0;
+		led-boot = &led_system;
+		led-failsafe = &led_system;
+		led-running = &led_system;
+		led-upgrade = &led_system;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-override = "";
+	};
+
+	memory at 40000000 {
+		reg = <0 0x40000000 0 0x20000000>;
+		device_type = "memory";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		mesh {
+			label = "wps";
+			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		wlan {
+			function = LED_FUNCTION_WLAN;
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		led_system: system {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
+		};
+
+		wan-red {
+			function = LED_FUNCTION_WAN;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&pio 12 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_5v: regulator-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+};
+
+&crypto {
+	status = "okay";
+};
+
+&eth {
+	status = "okay";
+
+	gmac0: mac at 0 {
+		/* LAN */
+		compatible = "mediatek,eth-mac";
+		reg = <0>;
+		nvmem-cells = <&macaddr_factory_4>;
+		nvmem-cell-names = "mac-address";
+		phy-mode = "2500base-x";
+
+		fixed-link {
+			speed = <2500>;
+			full-duplex;
+			pause;
+		};
+	};
+
+	mac at 1 {
+		/* WAN */
+		compatible = "mediatek,eth-mac";
+		reg = <1>;
+		phy-mode = "2500base-x";
+		phy-handle = <&phy6>;
+	};
+
+	mdio-bus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+		reset-delay-us = <50000>;
+		reset-post-delay-us = <20000>;
+
+		phy5: phy at 5 {
+			compatible = "ethernet-phy-ieee802.3-c45";
+			reg = <5>;
+
+			leds {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				led at 0 {
+					reg = <0>;
+					active-high;
+					color = <LED_COLOR_ID_WHITE>;
+					function = LED_FUNCTION_LAN;
+				};
+			};
+		};
+
+		phy6: phy at 6 {
+			compatible = "ethernet-phy-ieee802.3-c45";
+			reg = <6>;
+
+			leds {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				led at 0 {
+					reg = <0>;
+					color = <LED_COLOR_ID_WHITE>;
+					function = LED_FUNCTION_WAN;
+				};
+			};
+		};
+
+		switch at 1f {
+			compatible = "mediatek,mt7531";
+			reg = <31>;
+			reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port at 1 {
+					reg = <1>;
+					label = "lan1";
+					phy-handle = <&swphy1>;
+				};
+
+				port at 2 {
+					reg = <2>;
+					label = "lan2";
+					phy-handle = <&swphy2>;
+				};
+
+				port at 3 {
+					reg = <3>;
+					label = "lan3";
+					phy-handle = <&swphy3>;
+				};
+
+				port at 4 {
+					reg = <4>;
+					label = "lan4";
+					phy-handle = <&swphy4>;
+				};
+
+				port at 5 {
+					reg = <5>;
+					label = "lan5";
+					phy-mode = "2500base-x";
+					phy-handle = <&phy5>;
+				};
+
+				port at 6 {
+					reg = <6>;
+					label = "cpu";
+					ethernet = <&gmac0>;
+					phy-mode = "2500base-x";
+
+					fixed-link {
+						speed = <2500>;
+						full-duplex;
+						pause;
+					};
+				};
+			};
+
+			mdio {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				swphy1: phy at 1 {
+					reg = <1>;
+
+					mediatek,led-config = <
+						0x21 0x8009 /* BASIC_CTRL */
+						0x22 0x0c00 /* ON_DURATION */
+						0x23 0x1400 /* BLINK_DURATION */
+						0x24 0x8000 /* LED0_ON_CTRL */
+						0x25 0x0000 /* LED0_BLINK_CTRL */
+						0x26 0xc007 /* LED1_ON_CTRL */
+						0x27 0x003f /* LED1_BLINK_CTRL */
+					>;
+				};
+
+				swphy2: phy at 2 {
+					reg = <2>;
+
+					mediatek,led-config = <
+						0x21 0x8009 /* BASIC_CTRL */
+						0x22 0x0c00 /* ON_DURATION */
+						0x23 0x1400 /* BLINK_DURATION */
+						0x24 0x8000 /* LED0_ON_CTRL */
+						0x25 0x0000 /* LED0_BLINK_CTRL */
+						0x26 0xc007 /* LED1_ON_CTRL */
+						0x27 0x003f /* LED1_BLINK_CTRL */
+					>;
+				};
+
+				swphy3: phy at 3 {
+					reg = <3>;
+
+					mediatek,led-config = <
+						0x21 0x8009 /* BASIC_CTRL */
+						0x22 0x0c00 /* ON_DURATION */
+						0x23 0x1400 /* BLINK_DURATION */
+						0x24 0x8000 /* LED0_ON_CTRL */
+						0x25 0x0000 /* LED0_BLINK_CTRL */
+						0x26 0xc007 /* LED1_ON_CTRL */
+						0x27 0x003f /* LED1_BLINK_CTRL */
+					>;
+				};
+
+				swphy4: phy at 4 {
+					reg = <4>;
+
+					mediatek,led-config = <
+						0x21 0x8009 /* BASIC_CTRL */
+						0x22 0x0c00 /* ON_DURATION */
+						0x23 0x1400 /* BLINK_DURATION */
+						0x24 0x8000 /* LED0_ON_CTRL */
+						0x25 0x0000 /* LED0_BLINK_CTRL */
+						0x26 0xc007 /* LED1_ON_CTRL */
+						0x27 0x003f /* LED1_BLINK_CTRL */
+					>;
+				};
+			};
+		};
+	};
+};
+
+&pio {
+	spi_flash_pins: spi-flash-pins-33-to-38 {
+		mux {
+			function = "spi";
+			groups = "spi0", "spi0_wp_hold";
+		};
+		conf-pu {
+			pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-disable; /* bias-disable */
+		};
+		conf-pd {
+			pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-disable; /* bias-disable */
+		};
+	};
+
+	wf_2g_5g_pins: wf_2g_5g-pins {
+		mux {
+			function = "wifi";
+			groups = "wf_2g", "wf_5g";
+		};
+		conf {
+			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
+			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
+			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
+			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
+			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
+			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
+			       "WF1_TOP_CLK", "WF1_TOP_DATA";
+			drive-strength = <MTK_DRIVE_4mA>;
+		};
+	};
+
+	wf_dbdc_pins: wf-dbdc-pins {
+		mux {
+			function = "wifi";
+			groups = "wf_dbdc";
+		};
+		conf {
+			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
+			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
+			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
+			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
+			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
+			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
+			       "WF1_TOP_CLK", "WF1_TOP_DATA";
+			drive-strength = <MTK_DRIVE_4mA>;
+		};
+	};
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi_flash_pins>;
+	status = "okay";
+
+	spi_nand_flash: flash at 0 {
+		compatible = "u-boot-dont-touch-spi-nand";
+		reg = <0>;
+
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+
+		/*
+		 * ASUS bootloader tries to replace the partitions defined in
+		 * Device Tree and by that also deletes all additional properties
+		 * needed for UBI and NVMEM-on-UBI.
+		 * Prevent this from happening by tricking the loader to delete and
+		 * replace a bait node instead (works with older bootloaders).
+		 */
+		partitions: dummy {
+			compatible = "u-boot-dummy-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				reg = <0x0 0x0>;
+				label = "remove_me";
+			};
+		};
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				reg = <0x0 0x400000>;
+				label = "bootloader";
+				read-only;
+			};
+
+			partition at 400000 {
+				compatible = "linux,ubi";
+				reg = <0x400000 0xfc00000>;
+				label = "UBI_DEV";
+
+				volumes {
+					ubi-volume-factory {
+						volname = "Factory";
+
+						nvmem-layout {
+							compatible = "fixed-layout";
+							#address-cells = <1>;
+							#size-cells = <1>;
+
+							eeprom_factory_0: eeprom at 0 {
+								reg = <0x0 0x1000>;
+							};
+
+							macaddr_factory_4: macaddr at 4 {
+								reg = <0x4 0x6>;
+							};
+						};
+					};
+				};
+			};
+		};
+	};
+};
+
+&watchdog {
+	status = "okay";
+};
+
+&wifi {
+	nvmem-cells = <&eeprom_factory_0>;
+	nvmem-cell-names = "eeprom";
+	pinctrl-0 = <&wf_2g_5g_pins>;
+	pinctrl-1 = <&wf_dbdc_pins>;
+	pinctrl-names = "default", "dbdc";
+	status = "okay";
+};
+
+&trng {
+	status = "okay";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&ssusb {
+	vusb33-supply = <&reg_3p3v>;
+	vbus-supply = <&reg_5v>;
+	status = "okay";
+};
+
+&usb_phy {
+	status = "okay";
+};
+
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
index c8c1aab525..0f5270483d 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
@@ -14,6 +14,10 @@ abt,asr3000)
 asus,rt-ax52)
 	ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "link tx rx"
 	;;
+asus,tuf-ax4200q)
+	ucidef_set_led_netdev "lan5" "LAN5" "mdio-bus:05:white:lan" "lan5" "link tx rx"
+	ucidef_set_led_netdev "wan" "WAN" "mdio-bus:06:white:wan" "eth1" "link tx rx"
+	;;
 confiabits,mt7981)
 	ucidef_set_led_netdev "lan1" "lan1" "blue:lan-1" "lan1" "link tx rx"
 	ucidef_set_led_netdev "lan2" "lan2" "blue:lan-2" "lan2" "link tx rx"
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index f9bf2b1faf..f2c38d595a 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -61,6 +61,7 @@ mediatek_setup_interfaces()
 	zyxel,ex5601-t0-ubootmod)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1
 		;;
+	asus,tuf-ax4200q|\
 	asus,tuf-ax6000|\
 	glinet,gl-mt6000|\
 	tplink,tl-xdr4288|\
diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
index b0b301559b..aa70cfc0c3 100644
--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
@@ -39,6 +39,7 @@ case "$board" in
 		;;
 	asus,rt-ax52|\
 	asus,tuf-ax4200|\
+	asus,tuf-ax4200q|\
 	asus,tuf-ax6000)
 		CI_UBIPART="UBI_DEV"
 		addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh
index 936ed44ff9..8a8424e97c 100644
--- a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh
@@ -21,6 +21,7 @@ preinit_set_mac_address() {
 		ip link set dev internet address "$wan_mac"
 		;;
 	asus,tuf-ax4200|\
+	asus,tuf-ax4200q|\
 	asus,tuf-ax6000)
 		CI_UBIPART="UBI_DEV"
 		addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index 3cc8b91b74..8ba706f85b 100755
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -122,6 +122,7 @@ platform_do_upgrade() {
 	asus,rt-ax52|\
 	asus,rt-ax59u|\
 	asus,tuf-ax4200|\
+	asus,tuf-ax4200q|\
 	asus,tuf-ax6000)
 		CI_UBIPART="UBI_DEV"
 		CI_KERNPART="linux"
@@ -256,6 +257,7 @@ platform_pre_upgrade() {
 	asus,rt-ax52|\
 	asus,rt-ax59u|\
 	asus,tuf-ax4200|\
+	asus,tuf-ax4200q|\
 	asus,tuf-ax6000)
 		asus_initial_setup
 		;;
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index da2a01b51c..8eb0932a98 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -304,6 +304,28 @@ define Device/asus_tuf-ax4200
 endef
 TARGET_DEVICES += asus_tuf-ax4200
 
+define Device/asus_tuf-ax4200q
+  DEVICE_VENDOR := ASUS
+  DEVICE_MODEL := TUF-AX4200Q
+  DEVICE_DTS := mt7986a-asus-tuf-ax4200q
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
+  IMAGES := sysupgrade.bin
+  KERNEL := kernel-bin | lzma | \
+        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+  KERNEL_INITRAMFS := kernel-bin | lzma | \
+        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ifeq ($(IB),)
+ifeq ($(CONFIG_TARGET_INITRAMFS_FORCE),y)
+  ARTIFACTS := initramfs.trx
+  ARTIFACT/initramfs.trx := append-image-stage initramfs-kernel.bin | \
+	uImage none | asus-trx -v 3 -n TUF-AX4200
+endif
+endif
+endef
+TARGET_DEVICES += asus_tuf-ax4200q
+
 define Device/arcadyan_mozart
   DEVICE_VENDOR := Arcadyan
   DEVICE_MODEL := Mozart



From lede-commits at lists.infradead.org  Thu Dec 11 16:06:01 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 19:06:01 -0500
Subject: [openwrt/openwrt]  mvebu: gl-mv1000: fix sdhci1 controller
In-Reply-To: <176549796164.1643279.16084794392125092969@git-01.infra.openwrt.org>
References: <176549796164.1643279.16084794392125092969@git-01.infra.openwrt.org>
Message-ID: <mailman.35097.1765497969.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/ce660d934f06044be7cce1bd877cad63e806daa2

commit ce660d934f06044be7cce1bd877cad63e806daa2
Author: Mikhail Zadorozhnyi <zador.blood.stained+git at protonmail.com>
AuthorDate: Sat Oct 11 12:00:06 2025 +0300

    mvebu: gl-mv1000: fix sdhci1 controller
    
    GL-MV1000 external SD controller was broken by a recent kernel update
    between OpenWRT releases 24.10.2 and 24.10.3 due to a mistake in Device
    Tree: "regulator-gpio" was defined without required "gpios" property.
    
    Since "no-1-8-v" property is also defined for this controller
    a switchable vqmmc-supply regulator performs no function - a fixed 3.3V
    IO voltage will always be used.
    
    This regulator definition was probably added by mistake from a Device
    Tree from another device.
    
    Remove incomplete vcc_sd_reg1 regulator definition to fix this issue.
    
    Issue discussion for reference: openwrt/openwrt#20309
    
    Upstream commit: 6f2325b23d2cfa28099c26c299ae774625f1872b
    Signed-off-by: Mikhail Zadorozhnyi <zador.blood.stained+git at protonmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20378
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts  | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
index e098ede75f..2ad9660e48 100644
--- a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
+++ b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
@@ -26,19 +26,6 @@
 		reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
 	};
 
-	vcc_sd_reg1: regulator {
-		compatible = "regulator-gpio";
-		regulator-name = "vcc_sd1";
-		regulator-min-microvolt = <1800000>;
-		regulator-max-microvolt = <3300000>;
-		regulator-boot-on;
-
-		gpios-states = <0>;
-		states = <1800000 0x1
-			3300000 0x0>;
-		enable-active-high;
-	};
-
 	keys {
 		compatible = "gpio-keys";
 
@@ -149,7 +136,6 @@
 	cd-gpios = <&gpionb 17 GPIO_ACTIVE_LOW>;
 	marvell,pad-type = "sd";
 	no-1-8-v;
-	vqmmc-supply = <&vcc_sd_reg1>;
 	status = "okay";
 };
 



From lede-commits at lists.infradead.org  Thu Dec 11 16:09:53 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 19:09:53 -0500
Subject: [openwrt/openwrt]  ramips: add support for Hongdian H8850 v20
In-Reply-To: <176549819303.1658206.4313837255306957344@git-01.infra.openwrt.org>
References: <176549819303.1658206.4313837255306957344@git-01.infra.openwrt.org>
Message-ID: <mailman.35100.1765498197.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/61408bb99a1673ae8579a0386be53d79e542fc1b

commit 61408bb99a1673ae8579a0386be53d79e542fc1b
Author: Coia Prant <coiaprant at gmail.com>
AuthorDate: Wed Oct 1 18:04:26 2025 +0800

    ramips: add support for Hongdian H8850 v20
    
    This is an industrial 4G router equipped with OpenWrt SNAPSHOT OEM
    customized version
    
    WARNING: The original firmware device tree is modified from evb
    boards, and the device tree name is evb board. This submitted device
    tree is a modified version, which deletes the non-this-device parts
    and adds GPIO watchdog.
    
    Specification:
    - SoC: MediaTek MT7628DAN
    - Flash: 16 MB
    - RAM: 64 MB
    - Power: DC 5V-36V 1.5A
    - Ethernet: 1x WAN/LAN, 3x LAN (10/100 Mbps)
    - Wireless radio: 802.11n 2.4g-only
    - LED:
      System/Power (PWR): Always Off
      Modem (NET): GPIO/3 active-low
      LAN: Always On
      RF (Modem Signal): GPIO/2 active-low
      WIFI: GPIO/44 active-low
    - Button:
      WPS / RESET: GPIO/11 active-low
    - UART: 1x UART on PCB - 115200 8N1
    - GPIO Watchdog: GPIO/0 mode=toggle timeout=1s
    - Modem: 1x Built-in modem on board (Power: GPIO/4 active-high)
    - SIM Slots: 1x SIM Slots
    
    Issue:
    - Factory partition not store mac address on original firmware
    
    Flash instruction:
    Using TTL:
    1. Connect the board to the computer via TTL.
    2. Enter original firmware failsafe mode.
    3. Use wget download firmware to board /tmp
    4. Use command "mtd -r write openwrt-ramips-mt76x8-hongdian_h8850-v20-squashfs-sysupgrade.bin firmware"
       to flash
    
    Original Firmware Dump / More details:
    https://blog.gov.cooking/archives/research-hongdian-h8850-v20-and-flash.html
    
    Signed-off-by: Coia Prant <coiaprant at gmail.com>
    Tested-by: Coia Prant <coiaprant at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20259
    (cherry picked from commit 23a070dfb1fd3ed7659fad4934a6a38d8693326f)
    Link: https://github.com/openwrt/openwrt/pull/21007
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../ramips/dts/mt7628an_hongdian_h8850-v20.dts     | 157 +++++++++++++++++++++
 target/linux/ramips/image/mt76x8.mk                |   9 ++
 .../mt76x8/base-files/etc/board.d/02_network       |  12 +-
 .../mt76x8/base-files/etc/board.d/03_gpio_switches |   3 +
 4 files changed, 176 insertions(+), 5 deletions(-)

diff --git a/target/linux/ramips/dts/mt7628an_hongdian_h8850-v20.dts b/target/linux/ramips/dts/mt7628an_hongdian_h8850-v20.dts
new file mode 100644
index 0000000000..8983203e2c
--- /dev/null
+++ b/target/linux/ramips/dts/mt7628an_hongdian_h8850-v20.dts
@@ -0,0 +1,157 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7628an.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	compatible = "hongdian,h8850-v20", "mediatek,mt7628an-soc";
+	model = "Hongdian H8850 v20";
+
+	aliases {
+		led-boot = &led_net;
+		led-failsafe = &led_net;
+		led-running = &led_net;
+		led-upgrade = &led_net;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led-rf {
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = "rf";
+		};
+
+		led_net: led-net {
+			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_MOBILE;
+		};
+
+		led-wifi {
+			gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_WLAN;
+			linux,default-trigger = "phy0tpt";
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	watchdog {
+		compatible = "linux,wdt-gpio";
+
+		gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+		hw_algo = "toggle";
+		hw_margin_ms = <600>;
+		always-running;
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+
+		gpio_modem_power {
+			gpio-export,name = "modem_power";
+			gpio-export,output = <1>;
+			gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&watchdog {
+	status = "disabled";
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory_0: eeprom at 0 {
+						reg = <0x0 0x400>;
+					};
+
+					macaddr_factory_4: macaddr at 4 {
+						reg = <0x4 0x6>;
+					};
+				};
+			};
+
+			partition at 50000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x50000 0xfb0000>;
+			};
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2s", "i2c", "spi cs1", "gpio", "perst", "refclk", "wdt", "p4led_an", "wled_an";
+		function = "gpio";
+	};
+};
+
+&ethernet {
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&esw {
+	mediatek,portmap = <0x3e>;
+	mediatek,portdisable = <0x30>;
+};
+
+&wmac {
+	status = "okay";
+
+	nvmem-cells = <&eeprom_factory_0>;
+	nvmem-cell-names = "eeprom";
+};
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index 94cccab743..f1873a794e 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -347,6 +347,15 @@ define Device/hongdian_h7920-v40
 endef
 TARGET_DEVICES += hongdian_h7920-v40
 
+define Device/hongdian_h8850-v20
+  IMAGE_SIZE := 16064k
+  DEVICE_VENDOR := Hongdian
+  DEVICE_MODEL := H8850
+  DEVICE_VARIANT := v20
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
+endef
+TARGET_DEVICES += hongdian_h8850-v20
+
 define Device/iptime_a3
   IMAGE_SIZE := 7936k
   UIMAGE_NAME := a3
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
index 92168d1fcf..b47c499e95 100644
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
@@ -117,6 +117,12 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0:lan" "1:lan" "4:wan" "6 at eth0"
 		;;
+	hongdian,h8850-v20|\
+	keenetic,kn-1613|\
+	motorola,mwr03)
+		ucidef_add_switch "switch0" \
+			"1:lan" "2:lan" "3:lan" "0:wan" "6 at eth0"
+		;;
 	iptime,a3|\
 	totolink,a3)
 		ucidef_add_switch "switch0" \
@@ -132,11 +138,6 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0:lan" "1:lan" "2:lan" "6 at eth0"
 		;;
-	keenetic,kn-1613|\
-	motorola,mwr03)
-		ucidef_add_switch "switch0" \
-			"1:lan" "2:lan" "3:lan" "0:wan" "6 at eth0"
-		;;
 	kroks,kndrt31r19)
 		ucidef_add_switch "switch0" \
 			"0:lan" "6 at eth0"
@@ -260,6 +261,7 @@ ramips_setup_macs()
 		;;
 	duzun,dm06|\
 	hongdian,h7920-v40|\
+	hongdian,h8850-v20|\
 	netgear,r6020|\
 	netgear,r6080|\
 	netgear,r6120|\
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt76x8/base-files/etc/board.d/03_gpio_switches
index c70e59c480..199a8466a0 100644
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/03_gpio_switches
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/03_gpio_switches
@@ -13,6 +13,9 @@ hongdian,h7920-v40)
 	ucidef_add_gpio_switch "modem_enable" "Modem power" "modem_power" "1"
 	ucidef_add_gpio_switch "switch_serial_mode" "Switch RS232 to RS485" "serial_rs485_mode" "0"
 	;;
+hongdian,h8850-v20)
+	ucidef_add_gpio_switch "modem_enable" "Modem power" "modem_power" "1"
+	;;
 esac
 
 board_config_flush



From lede-commits at lists.infradead.org  Thu Dec 11 16:15:10 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 19:15:10 -0500
Subject: [openwrt/openwrt]  ramips: add support for Cudy C200P
In-Reply-To: <176549851098.1676639.15149681490017720999@git-01.infra.openwrt.org>
References: <176549851098.1676639.15149681490017720999@git-01.infra.openwrt.org>
Message-ID: <mailman.35101.1765498520.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/a9858a9632b06bc0a998e55c8338af56fa797d42

commit a9858a9632b06bc0a998e55c8338af56fa797d42
Author: Marcin Leksmark <lexmark3200 at wp.pl>
AuthorDate: Sat Dec 6 14:43:22 2025 +0100

    ramips: add support for Cudy C200P
    
    This patch adds support for Cudy C200P.
    Because v24.10 stable has no regulator definition, so we cannot make simple cherry-pick. We need another DTS file.
    
    Specifications:
    
        SoC: MediaTek MT7621AT
        RAM: 256 MB (DDR3)
        Flash: 16 MB (NOR)
        POE Chip: IP804AR
    
    Interfaces:
    
        Switch: 1 WAN, 4 LAN (Gigabit)
        Gigabit RJ45 PoE Ports on 2~5
        Max Power on a Single PoE Ports     30W
        PoE Ports : The PoE ports comply with IEEE 802.3at/af standards.
        Ports: 1 USB-A 3.0 Ports
    
    LED:
    
        System
        PoE Max Status
        Link/ACT/PoE Status of Each PoE Port
    
    Physical Buttons:
    
            Reset Button
    
    Power Input:
    
            DC Jack
    
    Power Methods:
    
        DC: 54V 1.11A
        802.3at/af PoE
        Passive PoE: 24/48V
    
    Max Power Consumption (W):
    
            Total: 60W
        PoE: 55W
        PoE (when USB Device is plugged in): 50W
        No PoE: 5W
    
    Installation:
    
    To install OpenWRT, you need the intermediate firmware from Cudy. (U-boot is locked). After installing the intermediate firmware, you can install OpenWRT via sysupgrade.
    
    Recovery:
    
    TFTP available.
    1. Place the recovery.bin in the serving directory of your TFTP server.
    2. Set your IP to 192.168.1.88/24.
    3. Press the ?Reset? button of Cudy router and hold it. Before the Cudy router is powered on and before TFTP start to download the firmware, don't release the ?Reset? button.
    4. Power on the Cudy router.
    5. You can release the reset button only when TFTP starts downloading firmware.
    6. When the SYSTEM LED turns solid green, the upgrade is complete.
    
    Serial:
    
    1. Serial connection parameters: 115200 / 8N1
    2. Serial connection voltage: 3.3V
    
    PoE is not supported at the time of PR. The IP804R chip is not yet supported by OpenWRT.
    
    Signed-off-by: Marcin Leksmark <lexmark3200 at wp.pl>
    Link: https://github.com/openwrt/openwrt/pull/21064
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ramips/dts/mt7621_cudy_c200p.dts      | 199 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  10 ++
 .../mt7621/base-files/etc/board.d/02_network       |   7 +-
 3 files changed, 213 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_cudy_c200p.dts b/target/linux/ramips/dts/mt7621_cudy_c200p.dts
new file mode 100644
index 0000000000..df1b923f93
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_cudy_c200p.dts
@@ -0,0 +1,199 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	compatible = "cudy,c200p", "mediatek,mt7621-soc";
+	model = "Cudy C200P";
+
+	aliases {
+		led-boot = &led_sys;
+		led-failsafe = &led_sys;
+		led-running = &led_sys;
+		led-upgrade = &led_sys;
+		label-mac-device = &gmac0;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	watchdog {
+		compatible = "linux,wdt-gpio";
+		gpios = <&gpio 10 GPIO_ACTIVE_HIGH>;
+		hw_algo = "toggle";
+		hw_margin_ms = <1000>;
+		always-running;
+	};
+
+	reg_vbus: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "power_usb";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
+	output-reg-vbus {
+		compatible = "regulator-output";
+		vout-supply = <&reg_vbus>;
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
+
+		pse {
+			gpio-export,name = "pse";
+			gpio-export,output = <1>;
+			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_sys: status {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+
+		led_poe {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&xhci {
+	vbus-supply = <&reg_vbus>;
+};
+
+&i2c {
+	status = "okay";
+};
+
+&gmac0 {
+	nvmem-cells = <&macaddr_bdinfo_de00 0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x50000 0xfa0000>;
+			};
+
+			partition at ff0000 {
+				label = "bdinfo";
+				reg = <0xff0000 0x10000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					macaddr_bdinfo_de00: macaddr at de00 {
+						compatible = "mac-base";
+						reg = <0xde00 0x6>;
+						#nvmem-cell-cells = <1>;
+					};
+				};
+			};
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "jtag", "uart2", "uart3", "wdt";
+		function = "gpio";
+	};
+};
+
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_bdinfo_de00 1>;
+	nvmem-cell-names = "mac-address";
+};
+
+&ethphy4 {
+	/delete-property/ interrupts;
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan5";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan4";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan2";
+		};
+
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 28745e9e82..83b8767622 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -716,6 +716,16 @@ define Device/cudy_ap1300-outdoor-v1
 endef
 TARGET_DEVICES += cudy_ap1300-outdoor-v1
 
+define Device/cudy_c200p
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := C200P
+  IMAGE_SIZE := 15872k
+  UIMAGE_NAME := R74
+  DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls kmod-usb3
+endef
+TARGET_DEVICES += cudy_c200p
+
 define Device/cudy_m1300-v2
   $(Device/dsa-migration)
   IMAGE_SIZE := 15872k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 9d2f119c7e..15c98242ad 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -115,6 +115,10 @@ ramips_setup_interfaces()
 		uci add_list firewall. at zone[1].network='eth_data'
 		uci add_list firewall. at zone[1].network='eth_om'
 		;;
+	cudy,c200p|\
+	mikrotik,routerboard-750gr3)
+		ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan"
+		;;
 	dlink,covr-x1860-a1)
 		ucidef_set_interfaces_lan_wan "ethernet" "internet"
 		;;
@@ -133,9 +137,6 @@ ramips_setup_interfaces()
 	gnubee,gb-pc2)
 		ucidef_set_interface_lan "ethblack ethblue ethyellow"
 		;;
-	mikrotik,routerboard-750gr3)
-		ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan"
-		;;
 	mikrotik,routerboard-760igs)
 		ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp"
 		;;



From lede-commits at lists.infradead.org  Thu Dec 11 16:24:30 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 19:24:30 -0500
Subject: [openwrt/openwrt]  ramips: fix support for Cudy r700
In-Reply-To: <176549906970.1706893.8759428889427958244@git-01.infra.openwrt.org>
References: <176549906970.1706893.8759428889427958244@git-01.infra.openwrt.org>
Message-ID: <mailman.35102.1765499074.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/22391baf99634fc9f24d47a5ca475a654f444cd3

commit 22391baf99634fc9f24d47a5ca475a654f444cd3
Author: Marcin Leksmark <lexmark3200 at wp.pl>
AuthorDate: Wed Nov 12 21:39:56 2025 +0100

    ramips: fix support for Cudy r700
    
    This PR fixes support for Cudy r700.
    
    Original PR: https://github.com/openwrt/openwrt/pull/18532
    Fixed:
    
    - WAN port functionality;
    - RESET button;
    - Status LED;
    - LAN port names consistent with the chassis;
    - Merged partitions "debug", "backup" & "firmware"  to one partition "firmware" ("debug" & "backup" contained unimportant data);
    - Removed redundant DTS elements.
    
    Installation:
    
    To install OpenWRT, you need the intermediate firmware from Cudy. (U-boot is locked). After installing the intermediate firmware, you can install OpenWRT via sysupgrade.
    
    Recovery:
    
    TFTP available.
    1. Place the recovery.bin in the serving directory of your TFTP server.
    2. Set your IP to 192.168.1.88/24.
    3. Press the ?Reset? button of Cudy router and hold it. Before the Cudy router is powered on and before TFTP start to download the firmware, don't release the ?Reset? button.
    4. Power on the Cudy router.
    5. You can release the reset button only when TFTP starts downloading firmware.
    6. When the SYSTEM LED turns solid green, the upgrade is complete.
    
    Fixes: 75403dd1d05b ("ramips: add support for Cudy R700")
    Link: https://github.com/openwrt/openwrt/pull/20756
    (cherry picked from commit 35a86267e90312f24fd11553cd5a5db0736b79ca)
    Signed-off-by: Marcin Leksmark <lexmark3200 at wp.pl>
    Link: https://github.com/openwrt/openwrt/pull/21068
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ramips/dts/mt7621_cudy_r700.dts       | 81 ++++------------------
 target/linux/ramips/image/mt7621.mk                |  2 +-
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |  1 -
 .../mt7621/base-files/etc/board.d/02_network       |  1 +
 4 files changed, 16 insertions(+), 69 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_cudy_r700.dts b/target/linux/ramips/dts/mt7621_cudy_r700.dts
index 6d1c1ec004..ce23e1a701 100644
--- a/target/linux/ramips/dts/mt7621_cudy_r700.dts
+++ b/target/linux/ramips/dts/mt7621_cudy_r700.dts
@@ -11,10 +11,9 @@
 	model = "Cudy R700";
 
 	aliases {
-		led-boot = &led_internet_blue;
-		led-failsafe = &led_internet_blue;
-		led-running = &led_internet_blue;
-		led-upgrade = &led_internet_blue;
+		led-boot = &led_status_green;
+		led-failsafe = &led_status_green;
+		led-running = &led_status_green;
 		label-mac-device = &gmac0;
 	};
 
@@ -27,7 +26,7 @@
 
 		reset {
 			label = "reset";
-			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
 			linux,code = <KEY_RESTART>;
 		};
 	};
@@ -35,41 +34,11 @@
 	leds {
 		compatible = "gpio-leds";
 
-		led_internet_blue: internet_blue {
-			label = "blue:internet";
-			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
-		};
-
-		internet_red {
-			label = "red:internet";
-			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
-		};
-
-		wan {
-			function = LED_FUNCTION_WAN;
+		led_status_green: led-status-green {
 			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
 			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
 		};
-
-		lan1 {
-			label = "green:lan1";
-			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
-		};
-
-		lan2 {
-			label = "green:lan2";
-			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
-		};
-
-		lan3 {
-			label = "green:lan3";
-			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
-		};
-
-		lan4 {
-			label = "green:lan4";
-			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
-		};
 	};
 };
 
@@ -107,38 +76,12 @@
 				label = "factory";
 				reg = <0x40000 0x10000>;
 				read-only;
-
-				nvmem-layout {
-					compatible = "fixed-layout";
-					#address-cells = <1>;
-					#size-cells = <1>;
-
-					eeprom_factory_0: eeprom at 0 {
-						reg = <0x0 0x400>;
-					};
-
-					eeprom_factory_8000: eeprom at 8000 {
-						reg = <0x8000 0x4da8>;
-					};
-				};
 			};
 
 			partition at 50000 {
 				compatible = "denx,uimage";
 				label = "firmware";
-				reg = <0x50000 0xf80000>;
-			};
-
-			partition at fd0000 {
-				label = "debug";
-				reg = <0xfd0000 0x10000>;
-				read-only;
-			};
-
-			partition at fe0000 {
-				label = "backup";
-				reg = <0xfe0000 0x10000>;
-				read-only;
+				reg = <0x50000 0xfa0000>;
 			};
 
 			partition at ff0000 {
@@ -178,16 +121,20 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&ethphy4 {
+	/delete-property/ interrupts;
+};
+
 &switch0 {
 	ports {
 		port at 0 {
 			status = "okay";
-			label = "lan1";
+			label = "lan5";
 		};
 
 		port at 1 {
 			status = "okay";
-			label = "lan2";
+			label = "lan4";
 		};
 
 		port at 2 {
@@ -197,7 +144,7 @@
 
 		port at 3 {
 			status = "okay";
-			label = "lan4";
+			label = "lan2";
 		};
 	};
 };
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 31bdb40b26..4184977b27 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -801,7 +801,7 @@ define Device/cudy_r700
   DEVICE_MODEL := R700
   IMAGE_SIZE := 15872k
   UIMAGE_NAME := R29
-  DEVICE_PACKAGES := -uboot-envtools
+  DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += cudy_r700
 
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 4c4e7a2f42..94f36c1f6e 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -66,7 +66,6 @@ genexis,pulse-ex400|\
 netis,n6)
 	ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx"
 	;;
-cudy,r700|\
 cudy,wr2100)
 	ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1"
 	ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2"
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 15c98242ad..557755064a 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -116,6 +116,7 @@ ramips_setup_interfaces()
 		uci add_list firewall. at zone[1].network='eth_om'
 		;;
 	cudy,c200p|\
+	cudy,r700|\
 	mikrotik,routerboard-750gr3)
 		ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan"
 		;;



From lede-commits at lists.infradead.org  Thu Dec 11 16:24:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 19:24:29 -0500
Subject: [openwrt/openwrt]  ramips: add support for Cudy R700
In-Reply-To: <176549906970.1706893.8759428889427958244@git-01.infra.openwrt.org>
References: <176549906970.1706893.8759428889427958244@git-01.infra.openwrt.org>
Message-ID: <mailman.35105.1765499074.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/4a3409f628e2aebabac02c81750b25373c22d992

commit 4a3409f628e2aebabac02c81750b25373c22d992
Author: David DeGraw <degraw at fastmail.com>
AuthorDate: Fri Apr 18 11:55:34 2025 -0600

    ramips: add support for Cudy R700
    
    This is the same hardware as the Cudy WR2100 that's
    had support for some time now, just without the WLAN
    hardware.
    
    This PR is mostly copied from the commit that added
    support for the WR2100, here: 3501db9
    
    Specifications:
    SoC: MT7621
    CPU: 880 MHz
    Flash: 16 MiB
    RAM: 128 MiB
    Ethernet: 5x Gbit ports
    
    Installation:
    There are two known options:
    
    The Luci-based UI.
    Press and hold the reset button during power up.
    The router will request 'recovery.bin' from a TFTP server at
    192.168.1.88.
    
    Both options require a signed firmware binary.
    A signed firmware can be found in GitHub PR #18532.
    
    R4 & R5 need to be shorted (0-100?) for the UART to work.
    
    Link: https://github.com/openwrt/openwrt/pull/18532
    
    Signed-off-by: David DeGraw <degraw at fastmail.com>
    (cherry picked from commit 75403dd1d05bea1b65349ebb9f8b7deb40b9c802)
    Link: https://github.com/openwrt/openwrt/pull/21068
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ramips/dts/mt7621_cudy_r700.dts       | 203 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  10 +
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   1 +
 3 files changed, 214 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_cudy_r700.dts b/target/linux/ramips/dts/mt7621_cudy_r700.dts
new file mode 100644
index 0000000000..6d1c1ec004
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_cudy_r700.dts
@@ -0,0 +1,203 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	compatible = "cudy,r700", "mediatek,mt7621-soc";
+	model = "Cudy R700";
+
+	aliases {
+		led-boot = &led_internet_blue;
+		led-failsafe = &led_internet_blue;
+		led-running = &led_internet_blue;
+		led-upgrade = &led_internet_blue;
+		label-mac-device = &gmac0;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_internet_blue: internet_blue {
+			label = "blue:internet";
+			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+		};
+
+		internet_red {
+			label = "red:internet";
+			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+		};
+
+		wan {
+			function = LED_FUNCTION_WAN;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		};
+
+		lan1 {
+			label = "green:lan1";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+
+		lan2 {
+			label = "green:lan2";
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+		};
+
+		lan3 {
+			label = "green:lan3";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+		};
+
+		lan4 {
+			label = "green:lan4";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&gmac0 {
+	nvmem-cells = <&macaddr_bdinfo_de00 0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory_0: eeprom at 0 {
+						reg = <0x0 0x400>;
+					};
+
+					eeprom_factory_8000: eeprom at 8000 {
+						reg = <0x8000 0x4da8>;
+					};
+				};
+			};
+
+			partition at 50000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x50000 0xf80000>;
+			};
+
+			partition at fd0000 {
+				label = "debug";
+				reg = <0xfd0000 0x10000>;
+				read-only;
+			};
+
+			partition at fe0000 {
+				label = "backup";
+				reg = <0xfe0000 0x10000>;
+				read-only;
+			};
+
+			partition at ff0000 {
+				label = "bdinfo";
+				reg = <0xff0000 0x10000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					macaddr_bdinfo_de00: macaddr at de00 {
+						compatible = "mac-base";
+						reg = <0xde00 0x6>;
+						#nvmem-cell-cells = <1>;
+					};
+				};
+			};
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2c", "jtag", "uart3", "wdt";
+		function = "gpio";
+	};
+};
+
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_bdinfo_de00 1>;
+	nvmem-cell-names = "mac-address";
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan4";
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 83b8767622..31bdb40b26 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -795,6 +795,16 @@ define Device/cudy_wr2100
 endef
 TARGET_DEVICES += cudy_wr2100
 
+define Device/cudy_r700
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := R700
+  IMAGE_SIZE := 15872k
+  UIMAGE_NAME := R29
+  DEVICE_PACKAGES := -uboot-envtools
+endef
+TARGET_DEVICES += cudy_r700
+
 define Device/cudy_x6-v1
   $(Device/dsa-migration)
   IMAGE_SIZE := 32256k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 94f36c1f6e..4c4e7a2f42 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -66,6 +66,7 @@ genexis,pulse-ex400|\
 netis,n6)
 	ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx"
 	;;
+cudy,r700|\
 cudy,wr2100)
 	ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1"
 	ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2"



From lede-commits at lists.infradead.org  Thu Dec 11 16:26:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 19:26:24 -0500
Subject: [openwrt/openwrt]  mpc85xx: p1010: Use zImage loader for Watchguard
 Firebox T10
In-Reply-To: <176549918454.1715180.13480660711398166481@git-01.infra.openwrt.org>
References: <176549918454.1715180.13480660711398166481@git-01.infra.openwrt.org>
Message-ID: <mailman.35106.1765499188.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/9123a0c358d0b5275fcd99c3001f47020d27425b

commit 9123a0c358d0b5275fcd99c3001f47020d27425b
Author: Shine <4c.fce2 at proton.me>
AuthorDate: Thu Dec 11 00:21:48 2025 +0100

    mpc85xx: p1010: Use zImage loader for Watchguard Firebox T10
    
    Since kernel 6.1, the Watchguard Firebox T10 can't boot anymore due to
    increased kernel size.
    
    This commit introduces the zImage loader from 7d768a9 to boot the kernel.
    This is required, since the U-Boot version used in this device appears
    to have a hard limit of 16MB for the kernel size it can handle. The
    current kernel size is around 17MB, though, due to kernel page alignment
    required for memory protection.
    
    (cherry-picked from commit be7aa5bda40ee05b1dd0b4f4a1bf88e653ef875a)
    Signed-off-by: Shine <4c.fce2 at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21130
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mpc85xx/image/p1010.mk                                  | 5 +++++
 target/linux/mpc85xx/p1010/target.mk                                 | 2 +-
 ...upport.patch.patch => 108-powerpc-85xx-firebox-t10-support.patch} | 3 ++-
 .../linux/mpc85xx/patches-6.6/111-powerpc-85xx-hpe-msm-support.patch | 2 +-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/target/linux/mpc85xx/image/p1010.mk b/target/linux/mpc85xx/image/p1010.mk
index 1f898c483f..c873c29f9d 100644
--- a/target/linux/mpc85xx/image/p1010.mk
+++ b/target/linux/mpc85xx/image/p1010.mk
@@ -78,7 +78,12 @@ define Device/watchguard_firebox-t10
   DEVICE_VENDOR := Watchguard
   DEVICE_MODEL := Firebox T10
   DEVICE_PACKAGES := kmod-rtc-s35390a kmod-eeprom-at24
+  # This boot loader doesn't reliably boot an uncompressed image,
+  # therefore resort to gzipping the already compressed zImage
   KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb
+  KERNEL_NAME := zImage.la3000000
+  KERNEL_ENTRY := 0x3000000
+  KERNEL_LOADADDR := 0x3000000
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
diff --git a/target/linux/mpc85xx/p1010/target.mk b/target/linux/mpc85xx/p1010/target.mk
index 6b54390863..b6236196f3 100644
--- a/target/linux/mpc85xx/p1010/target.mk
+++ b/target/linux/mpc85xx/p1010/target.mk
@@ -1,5 +1,5 @@
 BOARDNAME:=P1010
-KERNEL_IMAGES:=simpleImage.br200-wp simpleImage.tl-wdr4900-v1 simpleImage.ws-ap3715i
+KERNEL_IMAGES:=simpleImage.br200-wp simpleImage.tl-wdr4900-v1 simpleImage.ws-ap3715i zImage.la3000000
 
 define Target/Description
 	Build firmware images for P1010 based boards.
diff --git a/target/linux/mpc85xx/patches-6.6/108-powerpc-85xx-firebox-t10-support.patch.patch b/target/linux/mpc85xx/patches-6.6/108-powerpc-85xx-firebox-t10-support.patch
similarity index 93%
rename from target/linux/mpc85xx/patches-6.6/108-powerpc-85xx-firebox-t10-support.patch.patch
rename to target/linux/mpc85xx/patches-6.6/108-powerpc-85xx-firebox-t10-support.patch
index 2c722e4d9b..910154bf0d 100644
--- a/target/linux/mpc85xx/patches-6.6/108-powerpc-85xx-firebox-t10-support.patch.patch
+++ b/target/linux/mpc85xx/patches-6.6/108-powerpc-85xx-firebox-t10-support.patch
@@ -1,6 +1,6 @@
 --- a/arch/powerpc/platforms/85xx/Kconfig
 +++ b/arch/powerpc/platforms/85xx/Kconfig
-@@ -83,6 +83,16 @@ config WS_AP3825I
+@@ -83,6 +83,17 @@ config WS_AP3825I
  	  This board is a Concurrent Dual-Band wireless access point with a
  	  Freescale P1020 SoC.
  
@@ -9,6 +9,7 @@
 +	select DEFAULT_UIMAGE
 +	select ARCH_REQUIRE_GPIOLIB
 +	select GPIO_MPC8XXX
++	select PPC_ZIMAGE_LA3000000
 +	help
 +	  This option enables support for the Watchguard Firebox T10 board.
 +	  This board is a VPN Gateway-Router with a
diff --git a/target/linux/mpc85xx/patches-6.6/111-powerpc-85xx-hpe-msm-support.patch b/target/linux/mpc85xx/patches-6.6/111-powerpc-85xx-hpe-msm-support.patch
index 1d1fb4f54f..f87b2af1d2 100644
--- a/target/linux/mpc85xx/patches-6.6/111-powerpc-85xx-hpe-msm-support.patch
+++ b/target/linux/mpc85xx/patches-6.6/111-powerpc-85xx-hpe-msm-support.patch
@@ -1,6 +1,6 @@
 --- a/arch/powerpc/platforms/85xx/Kconfig
 +++ b/arch/powerpc/platforms/85xx/Kconfig
-@@ -114,6 +114,18 @@ config FIREBOX_T10
+@@ -115,6 +115,18 @@ config FIREBOX_T10
  	  This board is a VPN Gateway-Router with a
  	  Freescale P1010 SoC.
  



From lede-commits at lists.infradead.org  Thu Dec 11 16:33:36 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 11 Dec 2025 19:33:36 -0500
Subject: [openwrt/openwrt]  ath11k: fix transmit queue flushing through
 flush_sta implementation
In-Reply-To: <176549961650.1750033.8204489872232148062@git-01.infra.openwrt.org>
References: <176549961650.1750033.8204489872232148062@git-01.infra.openwrt.org>
Message-ID: <mailman.35107.1765499621.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/f415748ba8e979757595d8619feddc3ec8aca788

commit f415748ba8e979757595d8619feddc3ec8aca788
Author: Florian Maurer <f.maurer at outlook.de>
AuthorDate: Fri Oct 3 09:30:59 2025 +0200

    ath11k: fix transmit queue flushing through flush_sta implementation
    
    warning print "ath11k c000000.wifi: failed to flush transmit queue 0"
    is observed during busy times.
    
    The mac80211 fallback implementation of `flush_sta` does not handle the per STA queues well.
    This is fixed by providing a ath11k specific implementation of flush_sta telling the firmware to flush a given station.
    The draining of the transmit queues should therefore stop correctly, even if new packets arrive in the mean time.
    
    An upstream ath11k RFC is available at:
    https://patchwork.kernel.org/project/linux-wireless/patch/GV1P250MB14333A5BF24623C4753A10E1E8E0A at GV1P250MB1433.EURP250.PROD.OUTLOOK.COM/
    
    The patch was tested on a Xiaomi AX3600.
    
    Signed-off-by: Florian Maurer <f.maurer at outlook.de>
    Tested-by: Florian Maurer  <f.maurer at outlook.de>
    Co-authored-by: Benjamin Berg <benjamin at sipsolutions.net>
    Tested-by: Flole <flole at flole.de>
    Link: https://github.com/openwrt/openwrt/pull/20293
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
    (cherry picked from commit 8faa9dedb40dd0d7f7ebe59fddb2d33ed7a75190)
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/20667
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...ath11k_mac_op_flush_sta-to-properly-flush.patch | 65 ++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/package/kernel/mac80211/patches/ath11k/453-ath11k-add-ath11k_mac_op_flush_sta-to-properly-flush.patch b/package/kernel/mac80211/patches/ath11k/453-ath11k-add-ath11k_mac_op_flush_sta-to-properly-flush.patch
new file mode 100644
index 0000000000..0612150f3c
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/453-ath11k-add-ath11k_mac_op_flush_sta-to-properly-flush.patch
@@ -0,0 +1,65 @@
+From b5ade0e0e1c1622a85fbfd2c93b41caff479f305 Mon Sep 17 00:00:00 2001
+From: Florian Maurer <f.maurer at outlook.de>
+Date: Fri, 3 Oct 2025 12:56:13 +0200
+Subject: [PATCH] ath11k: add ath11k_mac_op_flush_sta to properly flush pending
+ packets
+
+When a STA is marked as no longer authorized, if the driver doesn't
+implement flush_sta(), mac80211 calls ieee80211_flush_queues() to
+flush hardware queues to avoid sending unencrypted frames.
+
+This has became a problem for ath11k because ieee80211_flush_queues()
+will stop all traffic and call ath11k_flush, which waits until the
+whole HW queue is empty. In a busy environment this will trigger a
+timeout warning and stalls other STAs.
+
+Fix this by implementing flush_sta method using WMI command to flush
+frames of a specific STA.
+Flushed frames will be marked as discard in tx complete indication.
+
+warning print "ath11k c000000.wifi: failed to flush transmit queue 0"
+was observed on various openwrt devices, and is fixed through this patch.
+
+Tested-by: Florian Maurer  <f.maurer at outlook.de>
+Tested-by: Flole <flole at flole.de>
+Co-developed-by: Benjamin Berg <benjamin at sipsolutions.net>
+Signed-off-by: Benjamin Berg <benjamin at sipsolutions.net>
+Signed-off-by: Florian Maurer <f.maurer at outlook.de>
+---
+ drivers/net/wireless/ath/ath11k/mac.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath11k/mac.c
++++ b/drivers/net/wireless/ath/ath11k/mac.c
+@@ -8278,6 +8278,23 @@ static void ath11k_mac_op_flush(struct i
+ 	ath11k_mac_flush_tx_complete(ar);
+ }
+ 
++static void ath11k_mac_op_flush_sta(struct ieee80211_hw *hw,
++				    struct ieee80211_vif *vif,
++				    struct ieee80211_sta *sta)
++{
++	struct ath11k_vif *arvif = (void *)vif->drv_priv;
++	struct ath11k *ar = hw->priv;
++	struct peer_flush_params params = {
++		.peer_tid_bitmap = 0xFF,
++		.vdev_id = arvif->vdev_id,
++	};
++	int ret;
++
++	ret = ath11k_wmi_send_peer_flush_tids_cmd(ar, sta->addr, &params);
++	if (ret)
++		ath11k_warn(ar->ab, "failed to flush sta %pM: %d\n", sta->addr, ret);
++}
++
+ static bool
+ ath11k_mac_has_single_legacy_rate(struct ath11k *ar,
+ 				  enum nl80211_band band,
+@@ -9910,6 +9927,7 @@ static const struct ieee80211_ops ath11k
+ 	.set_bitrate_mask		= ath11k_mac_op_set_bitrate_mask,
+ 	.get_survey			= ath11k_mac_op_get_survey,
+ 	.flush				= ath11k_mac_op_flush,
++	.flush_sta			= ath11k_mac_op_flush_sta,
+ 	.sta_statistics			= ath11k_mac_op_sta_statistics,
+ 	CFG80211_TESTMODE_CMD(ath11k_tm_cmd)
+ 



From lede-commits at lists.infradead.org  Fri Dec 12 04:59:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 12 Dec 2025 07:59:43 -0500
Subject: [openwrt/openwrt]  apk: bump to 3.0.2
In-Reply-To: <176554438367.1239622.8366943418425151134@git-01.infra.openwrt.org>
References: <176554438367.1239622.8366943418425151134@git-01.infra.openwrt.org>
Message-ID: <mailman.35262.1765544388.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b15628ec80160d4eeadbd5a7c71702cef1249fe4

commit b15628ec80160d4eeadbd5a7c71702cef1249fe4
Author: Paul Donald <newtwen+github at gmail.com>
AuthorDate: Thu Dec 11 00:51:15 2025 +0100

    apk: bump to 3.0.2
    
    We drop patch 0020-apk-fix-compile: integrated at source.
    Compressed help now functions normally.
    
    Signed-off-by: Paul Donald <newtwen+github at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21127
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/system/apk/Makefile                        |  7 ++-
 .../0020-apk-fix-compile-when-using-C89.patch      | 56 ----------------------
 2 files changed, 3 insertions(+), 60 deletions(-)

diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile
index 07ad1d7a32..25a2b0a9a2 100644
--- a/package/system/apk/Makefile
+++ b/package/system/apk/Makefile
@@ -5,11 +5,10 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2025-12-03
-PKG_SOURCE_VERSION:=982c9961ad9e71b4068911329c9d8121cedfd9f7
-PKG_MIRROR_HASH:=4fc89e2bbbe10edfaa199b1ca9ace139aa39b43d3de6236e8be8b421d81b334b
+PKG_SOURCE_VERSION:=d093f7c198a64bff0cd58afeaf638909fda24ca8
+PKG_MIRROR_HASH:=596dffa2fa019be2755433ed210e30593a6a8708346cf31486d6ad8008e47556
 
-PKG_VERSION=3.0.1
+PKG_VERSION=3.0.2
 
 PKG_MAINTAINER:=Paul Spooren <mail at aparcar.org>
 PKG_LICENSE:=GPL-2.0-only
diff --git a/package/system/apk/patches/0020-apk-fix-compile-when-using-C89.patch b/package/system/apk/patches/0020-apk-fix-compile-when-using-C89.patch
deleted file mode 100644
index 8cd30542dd..0000000000
--- a/package/system/apk/patches/0020-apk-fix-compile-when-using-C89.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 54385e6dc02ada9ec827b6b79b9359951197fee5 Mon Sep 17 00:00:00 2001
-From: Paul Donald <newtwen+gitlab at gmail.com>
-Date: Tue, 9 Dec 2025 00:31:27 +0100
-Subject: [PATCH] apk: fix compile when using C89
-
-The older standard is more strict, and gives rise to errors:
-
-../src/apk.c: In function 'parse_options':
-../src/apk.c:584:4: error: a label can only be part of a statement and a declaration is not a statement
-  584 |    char *arg = opt_parse_arg(&st);
-      |    ^~~~
-
-So move the *arg declaration to function start.
-
-../src/app_mkpkg.c: In function 'mkpkg_setup_compat':
-../src/app_mkpkg.c:423:2: error: label at end of compound statement
-  423 |  default:
-      |  ^~~~~~~
-
-add break;
-
-Signed-off-by: Paul Donald <newtwen+gitlab at gmail.com>
----
- src/apk.c       | 3 ++-
- src/app_mkpkg.c | 1 +
- 2 files changed, 3 insertions(+), 1 deletion(-)
-
---- a/src/apk.c
-+++ b/src/apk.c
-@@ -556,6 +556,7 @@ static int parse_options(int argc, char
- 	struct apk_opt_match m;
- 	bool applet_arg_pending = false;
- 	int r;
-+	char *arg;
- 
- 	applet = applet_from_arg0(argv[0]);
- 	if (!applet) {
-@@ -581,7 +582,7 @@ static int parse_options(int argc, char
- 		case 0:
- 			break;
- 		case OPT_MATCH_NON_OPTION:
--			char *arg = opt_parse_arg(&st);
-+			arg = opt_parse_arg(&st);
- 			if (applet_arg_pending && strcmp(arg, applet->name) == 0)
- 				applet_arg_pending = false;
- 			else if (arg[0] || !applet || !applet->remove_empty_arguments)
---- a/src/app_mkpkg.c
-+++ b/src/app_mkpkg.c
-@@ -421,6 +421,7 @@ static void mkpkg_setup_compat(struct mk
- 	case 0: ctx->compat_rootnode = 1; // fallthrough
- 	case 1: ctx->compat_dirnode = 1;  // fallthrough
- 	default:
-+		break;
- 	}
- }
- 



From lede-commits at lists.infradead.org  Fri Dec 12 05:00:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 12 Dec 2025 08:00:38 -0500
Subject: [openwrt/openwrt]  apk: bump to 3.0.2
In-Reply-To: <176554443879.1243577.2782645100850954726@git-01.infra.openwrt.org>
References: <176554443879.1243577.2782645100850954726@git-01.infra.openwrt.org>
Message-ID: <mailman.35265.1765544442.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/25f32651f8f7146144f5678f3ebb8c54beca071c

commit 25f32651f8f7146144f5678f3ebb8c54beca071c
Author: Paul Donald <newtwen+github at gmail.com>
AuthorDate: Thu Dec 11 00:51:15 2025 +0100

    apk: bump to 3.0.2
    
    We drop patch 0020-apk-fix-compile: integrated at source.
    Compressed help now functions normally.
    
    Signed-off-by: Paul Donald <newtwen+github at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21127
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit b15628ec80160d4eeadbd5a7c71702cef1249fe4)
---
 package/system/apk/Makefile                        |  7 ++-
 .../0020-apk-fix-compile-when-using-C89.patch      | 56 ----------------------
 2 files changed, 3 insertions(+), 60 deletions(-)

diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile
index 07ad1d7a32..25a2b0a9a2 100644
--- a/package/system/apk/Makefile
+++ b/package/system/apk/Makefile
@@ -5,11 +5,10 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2025-12-03
-PKG_SOURCE_VERSION:=982c9961ad9e71b4068911329c9d8121cedfd9f7
-PKG_MIRROR_HASH:=4fc89e2bbbe10edfaa199b1ca9ace139aa39b43d3de6236e8be8b421d81b334b
+PKG_SOURCE_VERSION:=d093f7c198a64bff0cd58afeaf638909fda24ca8
+PKG_MIRROR_HASH:=596dffa2fa019be2755433ed210e30593a6a8708346cf31486d6ad8008e47556
 
-PKG_VERSION=3.0.1
+PKG_VERSION=3.0.2
 
 PKG_MAINTAINER:=Paul Spooren <mail at aparcar.org>
 PKG_LICENSE:=GPL-2.0-only
diff --git a/package/system/apk/patches/0020-apk-fix-compile-when-using-C89.patch b/package/system/apk/patches/0020-apk-fix-compile-when-using-C89.patch
deleted file mode 100644
index 8cd30542dd..0000000000
--- a/package/system/apk/patches/0020-apk-fix-compile-when-using-C89.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 54385e6dc02ada9ec827b6b79b9359951197fee5 Mon Sep 17 00:00:00 2001
-From: Paul Donald <newtwen+gitlab at gmail.com>
-Date: Tue, 9 Dec 2025 00:31:27 +0100
-Subject: [PATCH] apk: fix compile when using C89
-
-The older standard is more strict, and gives rise to errors:
-
-../src/apk.c: In function 'parse_options':
-../src/apk.c:584:4: error: a label can only be part of a statement and a declaration is not a statement
-  584 |    char *arg = opt_parse_arg(&st);
-      |    ^~~~
-
-So move the *arg declaration to function start.
-
-../src/app_mkpkg.c: In function 'mkpkg_setup_compat':
-../src/app_mkpkg.c:423:2: error: label at end of compound statement
-  423 |  default:
-      |  ^~~~~~~
-
-add break;
-
-Signed-off-by: Paul Donald <newtwen+gitlab at gmail.com>
----
- src/apk.c       | 3 ++-
- src/app_mkpkg.c | 1 +
- 2 files changed, 3 insertions(+), 1 deletion(-)
-
---- a/src/apk.c
-+++ b/src/apk.c
-@@ -556,6 +556,7 @@ static int parse_options(int argc, char
- 	struct apk_opt_match m;
- 	bool applet_arg_pending = false;
- 	int r;
-+	char *arg;
- 
- 	applet = applet_from_arg0(argv[0]);
- 	if (!applet) {
-@@ -581,7 +582,7 @@ static int parse_options(int argc, char
- 		case 0:
- 			break;
- 		case OPT_MATCH_NON_OPTION:
--			char *arg = opt_parse_arg(&st);
-+			arg = opt_parse_arg(&st);
- 			if (applet_arg_pending && strcmp(arg, applet->name) == 0)
- 				applet_arg_pending = false;
- 			else if (arg[0] || !applet || !applet->remove_empty_arguments)
---- a/src/app_mkpkg.c
-+++ b/src/app_mkpkg.c
-@@ -421,6 +421,7 @@ static void mkpkg_setup_compat(struct mk
- 	case 0: ctx->compat_rootnode = 1; // fallthrough
- 	case 1: ctx->compat_dirnode = 1;  // fallthrough
- 	default:
-+		break;
- 	}
- }
- 



From lede-commits at lists.infradead.org  Fri Dec 12 13:19:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 12 Dec 2025 16:19:41 -0500
Subject: [buildbot]  phase1: fix CONFIG_SIGNED_PACKAGES for apk signing
In-Reply-To: <176557438174.3728453.14546024888103367672@git-01.infra.openwrt.org>
References: <176557438174.3728453.14546024888103367672@git-01.infra.openwrt.org>
Message-ID: <mailman.35392.1765574386.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to buildbot.git, branch main:
https://git.openwrt.org/a51561bb76cdd9759c693f99527f88a6287532cf

commit a51561bb76cdd9759c693f99527f88a6287532cf
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Fri Dec 12 20:46:05 2025 +0000

    phase1: fix CONFIG_SIGNED_PACKAGES for apk signing
    
    Currently `CONFIG_SIGNED_PACKAGES` is only enabled when `usign_key` is
    configured. However, we also want to enable it when `apk_key` is
    configured, as we support signing APK packages as well.
    
    So lets fix it by adding `IsSignedPackagesEnabled` helper which checks
    for both keys and updates the .config generation to use it.
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 phase1/master.cfg | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/phase1/master.cfg b/phase1/master.cfg
index de60972..a2870da 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -650,6 +650,15 @@ def GetUsignKey(props):
     return branch and branches[branch].get("usign_key")
 
 
+ at util.renderer
+def IsSignedPackagesEnabled(props):
+    branch = props.getProperty("branch")
+    if not branch:
+        return False
+    b = branches.get(branch, {})
+    return bool(b.get("usign_key") or b.get("apk_key"))
+
+
 def GetNextBuild(builder, requests):
     for r in requests:
         if r.properties:
@@ -1018,10 +1027,10 @@ def prepareFactory(target):
             command=Interpolate(
                 "printf 'CONFIG_TARGET_%(kw:target)s=y\\n"
                 "CONFIG_TARGET_%(kw:target)s_%(kw:subtarget)s=y\\n"
-                "CONFIG_SIGNED_PACKAGES=%(kw:usign:#?|y|n)s\\n' >> .config",
+                "CONFIG_SIGNED_PACKAGES=%(kw:signed:#?|y|n)s\\n' >> .config",
                 target=target,
                 subtarget=subtarget,
-                usign=GetUsignKey,
+                signed=IsSignedPackagesEnabled,
             ),
         )
     )



From lede-commits at lists.infradead.org  Fri Dec 12 14:06:47 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 12 Dec 2025 17:06:47 -0500
Subject: [openwrt/openwrt]  image: add CONFIG_EXTRA_IMAGE_NAME
In-Reply-To: <176557720735.3934640.13564747187505322011@git-01.infra.openwrt.org>
References: <176557720735.3934640.13564747187505322011@git-01.infra.openwrt.org>
Message-ID: <mailman.35397.1765577218.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/24b8db118b6c84b92d17f969794b2bd6d73b8cdc

commit 24b8db118b6c84b92d17f969794b2bd6d73b8cdc
Author: David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Sat Nov 29 16:18:26 2025 +0000

    image: add CONFIG_EXTRA_IMAGE_NAME
    
    This allows an optional tag to be put in the .config file which is
    included in the filename of the resulting images, so it's easier to
    build images with different functionality for the same target hardware.
    
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
    Link: https://github.com/openwrt/openwrt/pull/20984
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 include/image.mk                   | 3 +++
 package/base-files/image-config.in | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 0fbaf66dd1..38005b2ab2 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -41,6 +41,9 @@ KDIR=$(KERNEL_BUILD_DIR)
 KDIR_TMP=$(KDIR)/tmp
 DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
 
+ifeq ($(EXTRA_IMAGE_NAME),)
+EXTRA_IMAGE_NAME:=$(call qstrip,$(CONFIG_EXTRA_IMAGE_NAME))
+endif
 IMG_PREFIX_EXTRA:=$(if $(EXTRA_IMAGE_NAME),$(call sanitize,$(EXTRA_IMAGE_NAME))-)
 IMG_PREFIX_VERNUM:=$(if $(CONFIG_VERSION_FILENAMES),$(call sanitize,$(VERSION_NUMBER))-)
 IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERSION_CODE))-)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index 67ef4d415a..0f71384190 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -5,6 +5,14 @@
 # See /LICENSE for more information.
 #
 
+config EXTRA_IMAGE_NAME
+	string
+	prompt "Extra image filename" if IMAGEOPT
+	default ""
+	help
+		Add this to the output image filenames, to distinguish between
+		different builds for the same hardware type.
+
 config TARGET_DEFAULT_LAN_IP_FROM_PREINIT
 	bool "Use preinit IP configuration as default LAN IP" if IMAGEOPT
 	default n



From lede-commits at lists.infradead.org  Fri Dec 12 14:08:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 12 Dec 2025 17:08:38 -0500
Subject: [openwrt/openwrt]  image: add CONFIG_EXTRA_IMAGE_NAME
In-Reply-To: <176557731856.3941538.2114492985270709464@git-01.infra.openwrt.org>
References: <176557731856.3941538.2114492985270709464@git-01.infra.openwrt.org>
Message-ID: <mailman.35398.1765577322.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/74c8435ebde1b8b104fcbff6a2c918051c561660

commit 74c8435ebde1b8b104fcbff6a2c918051c561660
Author: David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Sat Nov 29 16:18:26 2025 +0000

    image: add CONFIG_EXTRA_IMAGE_NAME
    
    This allows an optional tag to be put in the .config file which is
    included in the filename of the resulting images, so it's easier to
    build images with different functionality for the same target hardware.
    
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
    Link: https://github.com/openwrt/openwrt/pull/20984
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
    (cherry picked from commit 24b8db118b6c84b92d17f969794b2bd6d73b8cdc)
---
 include/image.mk                   | 3 +++
 package/base-files/image-config.in | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 0fbaf66dd1..38005b2ab2 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -41,6 +41,9 @@ KDIR=$(KERNEL_BUILD_DIR)
 KDIR_TMP=$(KDIR)/tmp
 DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
 
+ifeq ($(EXTRA_IMAGE_NAME),)
+EXTRA_IMAGE_NAME:=$(call qstrip,$(CONFIG_EXTRA_IMAGE_NAME))
+endif
 IMG_PREFIX_EXTRA:=$(if $(EXTRA_IMAGE_NAME),$(call sanitize,$(EXTRA_IMAGE_NAME))-)
 IMG_PREFIX_VERNUM:=$(if $(CONFIG_VERSION_FILENAMES),$(call sanitize,$(VERSION_NUMBER))-)
 IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERSION_CODE))-)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index f1439550b0..5c3e157846 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -5,6 +5,14 @@
 # See /LICENSE for more information.
 #
 
+config EXTRA_IMAGE_NAME
+	string
+	prompt "Extra image filename" if IMAGEOPT
+	default ""
+	help
+		Add this to the output image filenames, to distinguish between
+		different builds for the same hardware type.
+
 config TARGET_DEFAULT_LAN_IP_FROM_PREINIT
 	bool "Use preinit IP configuration as default LAN IP" if IMAGEOPT
 	default n



From lede-commits at lists.infradead.org  Sat Dec 13 09:40:01 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 13 Dec 2025 12:40:01 -0500
Subject: [openwrt/openwrt]  odhcpd: update to Git HEAD (2025-12-13)
In-Reply-To: <176564760133.594509.5377226277588955202@git-01.infra.openwrt.org>
References: <176564760133.594509.5377226277588955202@git-01.infra.openwrt.org>
Message-ID: <mailman.35495.1765647607.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/ff4546093e0146654007d71a2cc37034fe9f633e

commit ff4546093e0146654007d71a2cc37034fe9f633e
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Sat Dec 13 12:53:39 2025 +0100

    odhcpd: update to Git HEAD (2025-12-13)
    
    cf51aeb93220 odhcpd: fix captive_portal_uri reset
    e8b7fdea8d5e dhcpv4: fix DNS server option
    b84553e496a3 router: Modify relayed RA PIO P flag according to interface policy
    da3e2a9829cc router: Modify relayed RA PIO A flags according to interface policy
    bad7138b70f0 README.md: update dhcp ubus events
    
    https://github.com/openwrt/odhcpd/compare/ca00527e5fc3...cf51aeb93220
    
    Also remove duplicated /usr/share/libubox/jshn.sh include.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/services/odhcpd/Makefile              | 6 +++---
 package/network/services/odhcpd/files/odhcpd.defaults | 2 --
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 92dfd823b4..71bbb70616 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=cce1d4f3c88f4eec0cf8b19429f12e6fc2f47dca9b4d643a31569c1209f8fabc
-PKG_SOURCE_DATE:=2025-12-10
-PKG_SOURCE_VERSION:=ca00527e5fc3d8d2b8c1a60fbeb6a25e2bf68674
+PKG_MIRROR_HASH:=b69961edb0de3d2d0c4a7c883fba264c88fd158328ce0e8f42c634e164679fb9
+PKG_SOURCE_DATE:=2025-12-13
+PKG_SOURCE_VERSION:=cf51aeb93220672d54d0d0f3707710bf544801e2
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0
diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults
index fbb7ec92af..3e01ba2d9b 100644
--- a/package/network/services/odhcpd/files/odhcpd.defaults
+++ b/package/network/services/odhcpd/files/odhcpd.defaults
@@ -89,8 +89,6 @@ fi
 
 touch /etc/config/dhcp
 
-. /usr/share/libubox/jshn.sh
-
 json_load "$(cat /etc/board.json)"
 json_select network
 json_select lan



From lede-commits at lists.infradead.org  Sat Dec 13 09:42:03 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 13 Dec 2025 12:42:03 -0500
Subject: [openwrt/openwrt]  odhcpd: update to 25.12 Git HEAD (2025-12-13)
In-Reply-To: <176564772355.602699.9055843213549065029@git-01.infra.openwrt.org>
References: <176564772355.602699.9055843213549065029@git-01.infra.openwrt.org>
Message-ID: <mailman.35496.1765647727.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/5db1b65d3efe7922a5ae23994627939eb1faef0a

commit 5db1b65d3efe7922a5ae23994627939eb1faef0a
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Sat Dec 13 12:24:49 2025 +0100

    odhcpd: update to 25.12 Git HEAD (2025-12-13)
    
    1ff1328a4fc1 odhcpd: fix captive_portal_uri reset
    74f00bf43eab dhcpv4: fix DNS server option
    0d0fc5ffe993 README.md: update dhcp ubus events
    
    https://github.com/openwrt/odhcpd/compare/ca00527e5fc3...1ff1328a4fc1
    
    Also remove duplicated /usr/share/libubox/jshn.sh include.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/services/odhcpd/Makefile              | 6 +++---
 package/network/services/odhcpd/files/odhcpd.defaults | 2 --
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 92dfd823b4..b97ee8c09e 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=cce1d4f3c88f4eec0cf8b19429f12e6fc2f47dca9b4d643a31569c1209f8fabc
-PKG_SOURCE_DATE:=2025-12-10
-PKG_SOURCE_VERSION:=ca00527e5fc3d8d2b8c1a60fbeb6a25e2bf68674
+PKG_MIRROR_HASH:=0a9cc90d242e98bbb93c8cf3274ace9ba005028f2cdb1ad0b4ddfbf66e4b1f27
+PKG_SOURCE_DATE:=2025-12-13
+PKG_SOURCE_VERSION:=1ff1328a4fc1baca2e0040fe84ca4664dbca69d7
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0
diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults
index fbb7ec92af..3e01ba2d9b 100644
--- a/package/network/services/odhcpd/files/odhcpd.defaults
+++ b/package/network/services/odhcpd/files/odhcpd.defaults
@@ -89,8 +89,6 @@ fi
 
 touch /etc/config/dhcp
 
-. /usr/share/libubox/jshn.sh
-
 json_load "$(cat /etc/board.json)"
 json_select network
 json_select lan



From lede-commits at lists.infradead.org  Sat Dec 13 21:05:22 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 14 Dec 2025 00:05:22 -0500
Subject: [buildbot]  phase2: fix signing steps when only apk_key is defined
In-Reply-To: <176568872222.2984241.17907205768984774293@git-01.infra.openwrt.org>
References: <176568872222.2984241.17907205768984774293@git-01.infra.openwrt.org>
Message-ID: <mailman.35517.1765688729.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to buildbot.git, branch main:
https://git.openwrt.org/b0a3bf3f9b2acf5be391ed1d684e135f1161af19

commit b0a3bf3f9b2acf5be391ed1d684e135f1161af19
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Sat Dec 13 08:02:33 2025 +0000

    phase2: fix signing steps when only apk_key is defined
    
    Signing steps are currently skipped if only APK signing is configured,
    because phase2 effectively enables signing only when `usign` is present.
    
    Fix this by making `IsSignEnabled` explicitly cover APK signing too.
    
    While at it, refactor the signing checks into dedicated helper functions
    `IsUsignEnabled`, `IsApkSigningEnabled`, and `IsGpgSigningEnabled`, and
    use them consistently to align phase2 with the phase1 implementation.
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 phase2/master.cfg | 143 +++++++++++++++++++++++++++++++-----------------------
 1 file changed, 83 insertions(+), 60 deletions(-)

diff --git a/phase2/master.cfg b/phase2/master.cfg
index 3fb117e..7af1b30 100644
--- a/phase2/master.cfg
+++ b/phase2/master.cfg
@@ -303,6 +303,22 @@ def UsignSec2Pub(seckey, comment="untrusted comment: secret key"):
 def IsSharedWorkdir(step):
 	return bool(step.getProperty("shared_wd"))
 
+def IsUsignEnabled(step):
+	return ini.has_option("usign", "key")
+
+def IsApkSigningEnabled(step):
+	return ini.has_option("apk", "key")
+
+# gpg_key - contains the key in PGP format
+# gpg_keyid - contains the keyid of the key on the nk3
+def IsGpgSigningEnabled(step):
+	return ini.has_option("gpg", "key") or ini.has_option("gpg", "keyid")
+
+def IsSignEnabled(step):
+	return (
+		IsUsignEnabled(step) or IsApkSigningEnabled(step) or IsGpgSigningEnabled(step)
+	)
+
 @defer.inlineCallbacks
 def getNewestCompleteTime(bldr):
 	"""Returns the complete_at of the latest completed and not SKIPPED
@@ -485,24 +501,26 @@ for arch in arches:
 		command = ["make", "-f", "getversion.mk"]))
 
 	# install build key
-	if usign_key is not None:
-		factory.addStep(StringDownload(
-			name = "dlkeybuildpub",
-			s = UsignSec2Pub(usign_key, usign_comment),
-			workerdest = "sdk/key-build.pub",
-			mode = 0o600))
-
-		factory.addStep(StringDownload(
-			name = "dlkeybuild",
-			s = "# fake private key",
-			workerdest = "sdk/key-build",
-			mode = 0o600))
-
-		factory.addStep(StringDownload(
-			name = "dlkeybuilducert",
-			s = "# fake certificate",
-			workerdest = "sdk/key-build.ucert",
-			mode = 0o600))
+	factory.addStep(StringDownload(
+		name = "dlkeybuildpub",
+		s = UsignSec2Pub(usign_key, usign_comment),
+		workerdest = "sdk/key-build.pub",
+		mode = 0o600,
+		doStepIf = IsUsignEnabled))
+
+	factory.addStep(StringDownload(
+		name = "dlkeybuild",
+		s = "# fake private key",
+		workerdest = "sdk/key-build",
+		mode = 0o600,
+		doStepIf = IsUsignEnabled))
+
+	factory.addStep(StringDownload(
+		name = "dlkeybuilducert",
+		s = "# fake certificate",
+		workerdest = "sdk/key-build.ucert",
+		mode = 0o600,
+		doStepIf = IsUsignEnabled))
 
 	factory.addStep(ShellCommand(
 		name = "mkdldir",
@@ -579,53 +597,58 @@ for arch in arches:
 		haltOnFailure = True
 	))
 
-	if ini.has_option("gpg", "key") or usign_key is not None:
-		factory.addStep(MasterShellCommand(
-			name = "signprepare",
-			description = "Preparing temporary signing directory",
-			command = ["mkdir", "-p", "%s/signing" %(work_dir)],
-			haltOnFailure = True
-		))
+	factory.addStep(MasterShellCommand(
+		name = "signprepare",
+		description = "Preparing temporary signing directory",
+		command = ["mkdir", "-p", "%s/signing" %(work_dir)],
+		haltOnFailure = True,
+		doStepIf = IsSignEnabled
+	))
 
-		factory.addStep(ShellCommand(
-			name = "signpack",
-			description = "Packing files to sign",
-			workdir = "build/sdk",
-			command = "find bin/packages/%s/ -mindepth 1 -maxdepth 2 -type f " %(arch[0])
-			+ "-name sha256sums -print0 -or "
-			+ "-name Packages -print0 -or "
-			+ "-name packages.adb -print0 | "
-			+ "xargs -0 tar -czf sign.tar.gz",
-			haltOnFailure = True
-		))
+	factory.addStep(ShellCommand(
+		name = "signpack",
+		description = "Packing files to sign",
+		workdir = "build/sdk",
+		command = "find bin/packages/%s/ -mindepth 1 -maxdepth 2 -type f " %(arch[0])
+		+ "-name sha256sums -print0 -or "
+		+ "-name Packages -print0 -or "
+		+ "-name packages.adb -print0 | "
+		+ "xargs -0 tar -czf sign.tar.gz",
+		haltOnFailure = True,
+		doStepIf = IsSignEnabled
+	))
 
-		factory.addStep(FileUpload(
-			workersrc = "sdk/sign.tar.gz",
-			masterdest = "%s/signing/%s.tar.gz" %(work_dir, arch[0]),
-			haltOnFailure = True
-		))
+	factory.addStep(FileUpload(
+		workersrc = "sdk/sign.tar.gz",
+		masterdest = "%s/signing/%s.tar.gz" %(work_dir, arch[0]),
+		haltOnFailure = True,
+		doStepIf = IsSignEnabled
+	))
 
-		factory.addStep(MasterShellCommand(
-			name = "signfiles",
-			description = "Signing files",
-			command = ["%s/signall.sh" %(scripts_dir), "%s/signing/%s.tar.gz" %(work_dir, arch[0])],
-			env = { 'CONFIG_INI': os.getenv("BUILDMASTER_CONFIG", "./config.ini") },
-			haltOnFailure = True
-		))
+	factory.addStep(MasterShellCommand(
+		name = "signfiles",
+		description = "Signing files",
+		command = ["%s/signall.sh" %(scripts_dir), "%s/signing/%s.tar.gz" %(work_dir, arch[0])],
+		env = { 'CONFIG_INI': os.getenv("BUILDMASTER_CONFIG", "./config.ini") },
+		haltOnFailure = True,
+		doStepIf = IsSignEnabled
+	))
 
-		factory.addStep(FileDownload(
-			mastersrc = "%s/signing/%s.tar.gz" %(work_dir, arch[0]),
-			workerdest = "sdk/sign.tar.gz",
-			haltOnFailure = True
-		))
+	factory.addStep(FileDownload(
+		mastersrc = "%s/signing/%s.tar.gz" %(work_dir, arch[0]),
+		workerdest = "sdk/sign.tar.gz",
+		haltOnFailure = True,
+		doStepIf = IsSignEnabled
+	))
 
-		factory.addStep(ShellCommand(
-			name = "signunpack",
-			description = "Unpacking signed files",
-			workdir = "build/sdk",
-			command = ["tar", "-xzf", "sign.tar.gz"],
-			haltOnFailure = True
-		))
+	factory.addStep(ShellCommand(
+		name = "signunpack",
+		description = "Unpacking signed files",
+		workdir = "build/sdk",
+		command = ["tar", "-xzf", "sign.tar.gz"],
+		haltOnFailure = True,
+		doStepIf = IsSignEnabled
+	))
 
 	# download remote sha256sums to 'target-sha256sums'
 	factory.addStep(ShellCommand(



From lede-commits at lists.infradead.org  Sat Dec 13 21:10:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 14 Dec 2025 00:10:20 -0500
Subject: [buildbot]  phase1: add support for overriding feeds host
In-Reply-To: <176568902026.2997021.6632522467399650756@git-01.infra.openwrt.org>
References: <176568902026.2997021.6632522467399650756@git-01.infra.openwrt.org>
Message-ID: <mailman.35518.1765689025.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to buildbot.git, branch main:
https://git.openwrt.org/057e8adc9d49eda73499b5b771cba5df5e8f80d1

commit 057e8adc9d49eda73499b5b771cba5df5e8f80d1
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Fri Dec 12 21:41:01 2025 +0000

    phase1: add support for overriding feeds host
    
    Currently git.openwrt.org is sometimes overloaded, so lets implement a
    mechanism to override the source host for feeds.
    
    This introduces a `feeds_host_override` configuration option. When set,
    the buildmaster will temporarily modify `feeds.conf.default` to point to
    the alternate host (e.g., GitHub) before updating feeds, and restore the
    original configuration afterwards.
    
    This is particularly useful when the primary git server is returning 503
    errors:
    
        Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git' ...
        Cloning into './feeds/packages'...
        fatal: unable to access 'https://git.openwrt.org/feed/packages.git/': The requested URL returned error: 503
        failed.
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 docker/config.ini         |  1 +
 phase1/config.ini.example |  1 +
 phase1/master.cfg         | 52 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+)

diff --git a/docker/config.ini b/docker/config.ini
index 9da83eb..8daa00e 100644
--- a/docker/config.ini
+++ b/docker/config.ini
@@ -10,6 +10,7 @@ status_password = admin
 buildbot_url = http://buildmaster-phase1:8010/
 expire = 1209600
 port = ssl:9989:privateKey=/certs/master.key:certKey=/certs/master.crt
+feeds_host_override = github.com/openwrt
 config_seed = # Seed configuration
 	CONFIG_BUILDBOT=y
 	CONFIG_DEVEL=y
diff --git a/phase1/config.ini.example b/phase1/config.ini.example
index 455507e..79cb44f 100644
--- a/phase1/config.ini.example
+++ b/phase1/config.ini.example
@@ -9,6 +9,7 @@ status_bind = tcp:8010:interface=127.0.0.1
 status_user = example
 status_password = example
 port = 9989
+feeds_host_override =
 
 [irc]
 host = irc.freenode.net
diff --git a/phase1/master.cfg b/phase1/master.cfg
index a2870da..9967eaf 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -107,6 +107,7 @@ def ini_parse_branch(section):
 
 # PB port can be either a numeric port or a connection string
 pb_port = inip1.get("port") or 9989
+feeds_host_override = inip1.get("feeds_host_override", "").strip()
 
 # This is the dictionary that the buildmaster pays attention to. We also use
 # a shorter alias to save typing.
@@ -609,6 +610,15 @@ def IsRemoteShaSumsAvailable(step):
     return step.getProperty("have_remote_shasums")
 
 
+def IsFeedsHostOverrideEnabled(step):
+    return bool(feeds_host_override)
+
+
+ at util.renderer
+def GetFeedsHostOverride(props):
+    return feeds_host_override
+
+
 def GetBaseVersion(branch):
     if re.match(r"^[^-]+-[0-9]+\.[0-9]+$", branch):
         return branch.split("-")[1]
@@ -986,6 +996,37 @@ def prepareFactory(target):
         )
     )
 
+    factory.addStep(
+        ShellCommand(
+            name="feeds-backup",
+            description="Backing up feeds.conf.default",
+            descriptionDone="feeds.conf.default backed up",
+            command=["cp", "-p", "feeds.conf.default", "feeds.conf.default.bak"],
+            doStepIf=IsFeedsHostOverrideEnabled,
+            haltOnFailure=True,
+        )
+    )
+
+    factory.addStep(
+        ShellCommand(
+            name="feeds-override",
+            description="Overriding feeds host",
+            descriptionDone="Feeds host overridden",
+            command=[
+                "sed",
+                "-i",
+                "-E",
+                Interpolate(
+                    "s;git.openwrt.org/(feed|project);%(kw:host)s;",
+                    host=GetFeedsHostOverride,
+                ),
+                "feeds.conf.default",
+            ],
+            doStepIf=IsFeedsHostOverrideEnabled,
+            haltOnFailure=True,
+        )
+    )
+
     # feed
     factory.addStep(
         ShellCommand(
@@ -998,6 +1039,17 @@ def prepareFactory(target):
         )
     )
 
+    factory.addStep(
+        ShellCommand(
+            name="feeds-restore",
+            description="Restoring feeds.conf.default",
+            descriptionDone="feeds.conf.default restored",
+            command="test -f feeds.conf.default.bak && mv -f feeds.conf.default.bak feeds.conf.default || true",
+            doStepIf=IsFeedsHostOverrideEnabled,
+            haltOnFailure=True,
+        )
+    )
+
     # feed
     factory.addStep(
         ShellCommand(



From lede-commits at lists.infradead.org  Sun Dec 14 13:43:23 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 14 Dec 2025 16:43:23 -0500
Subject: [openwrt/openwrt]  mac80211: update to version 6.12.61
In-Reply-To: <176574860308.1989460.14285251102801163681@git-01.infra.openwrt.org>
References: <176574860308.1989460.14285251102801163681@git-01.infra.openwrt.org>
Message-ID: <mailman.35565.1765748610.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/454fd695894fba1fb81d5b6fa92feab8707d7419

commit 454fd695894fba1fb81d5b6fa92feab8707d7419
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Thu Dec 11 23:25:19 2025 +0100

    mac80211: update to version 6.12.61
    
    This contains the following commits:
    ```
    git log --oneline   v6.12.52...v6.12.61 -- drivers/net/wireless/ net/mac80211/ net/wireless/
    a1eb56723b32 wifi: ath12k: correctly handle mcast packets for clients
    c0a9c2c1b7b9 wifi: mac80211: use wiphy_hrtimer_work for csa.switch_work
    d4caee32a9f8 wifi: cfg80211: add an hrtimer based delayed work item
    6455948c8aab wifi: mac80211: reject address change while connecting
    80dc5a2ce5b7 wifi: ath11k: Clear affinity hint before calling ath11k_pcic_free_irq() in error path
    acd24d509227 wifi: mac80211: skip rate verification for not captured PSDUs
    53cf801b8555 wifi: ath11k: zero init info->status in wmi_process_mgmt_tx_comp()
    e8fa86b0bd96 wifi: mac80211_hwsim: Limit destroy_on_close radio removal to netgroup
    77d4afd6c78b Revert "wifi: ath10k: avoid unnecessary wait for service ready message"
    07d862c7de3d wifi: ath12k: Increase DP_REO_CMD_RING_SIZE to 256
    522734fc807c wifi: mac80211: Track NAN interface start/stop
    8db790c2491e wifi: ath10k: Fix connection after GTK rekeying
    72f1984246e6 wifi: rtw89: renew a completion for each H2C command waiting C2H event
    336da4414300 wifi: rtw89: obtain RX path from ppdu status IE00
    da91687f01f4 wifi: mt76: mt7996: fix memory leak on mt7996_mcu_sta_key_tlv error
    a534dd44b70e wifi: mt76: mt76_eeprom_override to int
    aa5ed215cfe8 wifi: mt76: mt7996: Temporarily disable EPCS
    efe2ef24feab wifi: mt76: mt7921: Add 160MHz beamformee capability for mt7922 device
    5de410dfb4d9 wifi: mac80211: Fix HE capabilities element check
    f157d1cb2cdc wifi: iwlwifi: fw: Add ASUS to PPAG and TAS list
    c9df78e84e85 wifi: mac80211: Fix 6 GHz Band capabilities element advertisement in lower bands
    958234997dd5 wifi: rtw89: fix BSSID comparison for non-transmitted BSSID
    ca18975c4de2 wifi: rtw89: wow: remove notify during WoWLAN net-detect
    bc1ca06998c1 wifi: rtw88: sdio: use indirect IO for device registers before power-on
    8ebef59d0294 wifi: rtw89: print just once for unknown C2H events
    5596a90c8952 wifi: mac80211: fix key tailroom accounting leak
    23b8682f05ec wifi: mac80211: don't mark keys for inactive links as uploaded
    e3373f10c6a6 wifi: ath11k: avoid bit operation on key flags
    50f50dd024b4 wifi: ath11k: add support for MU EDCA
    2a6cd5951ba8 wifi: ath12k: free skb during idr cleanup callback
    775e37df2acc wifi: ath11k: Add missing platform IDs for quirk table
    c4840991ee4c wifi: ath10k: Fix memory leak on unsupported WMI command
    a6eed58249e7 wifi: brcmfmac: fix crash while sending Action Frames in standalone AP Mode
    57100b87c778 wifi: ath12k: fix read pointer after free in ath12k_mac_assign_vif_to_vdev()
    4a63523d3541 wifi: cfg80211: Add missing lock in cfg80211_check_and_end_cac()
    e9fd43b799d2 wifi: rtw89: avoid possible TX wait initialization race
    b419093e5e42 wifi: mt76: mt7921u: Add VID/PID for Netgear A7500
    feb1774aaf85 wifi: mt76: mt7925u: Add VID/PID for Netgear A9000
    bd3ac455a88d wifi: ath11k: HAL SRNG: don't deinitialize and re-initialize again
    8055133a9f64 wifi: rtw89: avoid circular locking dependency in ser_state_run()
    1c873416758f wifi: mac80211: fix Rx packet handling when pubsta information is not available
    6e7d9fa61d7d wifi: ath10k: avoid unnecessary wait for service ready message
    8d4f6ab4c53e wifi: ath12k: fix wrong logging ID used for CE
    fc00890c55e3 wifi: mt76: mt7915: fix mt7981 pre-calibration
    e18c4e6ba36c wifi: mt76: mt7996: Convert mt7996_wed_rro_addr to LE
    f481404a9826 wifi: mt76: mt7996: Fix RX packets configuration for primary WED device
    57519239c76c wifi: mt76: fix potential memory leak in mt76_wmac_probe()
    27c8e2e4b56f wifi: iwlwifi: Remove redundant header files
    605402433eb8 wifi: mwifiex: send world regulatory domain to driver
    ```
    
    The removed patch was added upstream.
    
    Link: https://github.com/openwrt/openwrt/pull/21134
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/mac80211/Makefile                   |  4 +-
 .../ath10k/930-ath10k_add_tpt_led_trigger.patch    |  4 +-
 .../975-ath10k-use-tpt-trigger-by-default.patch    |  2 +-
 ...st-tx-power-reduction-for-US-regulatory-d.patch |  8 +--
 ...ath10k-always-use-mac80211-loss-detection.patch |  2 +-
 .../991-ath10k-support-flush_sta-method.patch      |  6 +-
 ...ath11k_mac_op_flush_sta-to-properly-flush.patch |  4 +-
 ...11k-support-setting-FW-memory-mode-via-DT.patch |  4 +-
 ...pport-and-handle-country-code-for-WCN7850.patch | 18 +++---
 ...-correctly-handle-mcast-packets-for-clien.patch | 66 ----------------------
 ...c-Prefer-a-ccode-from-OTP-over-nvram-file.patch |  2 +-
 ...x-interoperating-DPP-and-other-encryption.patch |  2 +-
 ...1-brcmfmac-disable-dump_survey-on-bcm2835.patch |  6 +-
 .../patches/build/140-trace_backport.patch         |  2 +-
 ...30-fix-init_vqs-build-error-on-kernel-6.6.patch |  4 +-
 ...Parse-the-RX-descriptor-with-a-single-fun.patch |  2 +-
 ...Enable-data-rate-fallback-for-older-chips.patch |  2 +-
 .../subsys/110-mac80211_keep_keys_on_stop_ap.patch |  2 +-
 .../mac80211/patches/subsys/210-ap_scan.patch      |  2 +-
 ...211-add-AQL-support-for-broadcast-packets.patch |  2 +-
 ...fg80211-add-option-for-vif-allowed-radios.patch |  6 +-
 ...1-pass-net_device-to-.set_monitor_channel.patch |  4 +-
 ...11-add-flag-to-opt-out-of-virtual-monitor.patch | 20 +++----
 ...11-add-support-for-the-monitor-SKIP_TX-fl.patch |  4 +-
 ...11-fix-vif-addr-when-switching-from-monit.patch |  4 +-
 ...11-Support-EHT-1024-aggregation-size-in-T.patch |  2 +-
 ...11-Add-link-iteration-macro-for-link-data.patch |  2 +-
 ...mac80211-extend-beacon-monitoring-for-MLO.patch |  4 +-
 ...0211-extend-connection-monitoring-for-MLO.patch |  6 +-
 29 files changed, 65 insertions(+), 131 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 80ffb9f598..93f664dbb4 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=6.12.52
+PKG_VERSION:=6.12.61
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0-only
 PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
-PKG_HASH:=ed6ef4c67e08b294ed1101c7cc5ae584a5f338c99ef95362fa3921eb6d207f5d
+PKG_HASH:=9db2f836dba7f38ad68f8798720ad4360bce6a3557bde02b88b3a4f068c77118
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION)
diff --git a/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch
index c71123a8fe..ad43dcef90 100644
--- a/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch
+++ b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -9924,6 +9924,21 @@ static int ath10k_mac_init_rd(struct ath
+@@ -9932,6 +9932,21 @@ static int ath10k_mac_init_rd(struct ath
  	return 0;
  }
  
@@ -22,7 +22,7 @@
  int ath10k_mac_register(struct ath10k *ar)
  {
  	static const u32 cipher_suites[] = {
-@@ -10286,6 +10301,12 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10294,6 +10309,12 @@ int ath10k_mac_register(struct ath10k *a
  
  	ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
diff --git a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch
index be2ccfd0bf..d5f8a56c00 100644
--- a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch
+++ b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch
@@ -40,7 +40,7 @@ Signed-off-by: Mathias Kresin <dev at kresin.me>
  	if (ret)
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -10302,7 +10302,7 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10310,7 +10310,7 @@ int ath10k_mac_register(struct ath10k *a
  	ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
  #ifdef CPTCFG_MAC80211_LEDS
diff --git a/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch b/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
index f1770cfbe0..2aba614090 100644
--- a/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
+++ b/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
@@ -28,7 +28,7 @@ Forwarded: no
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -1022,6 +1022,40 @@ static inline int ath10k_vdev_setup_sync
+@@ -1030,6 +1030,40 @@ static inline int ath10k_vdev_setup_sync
  	return ar->last_wmi_vdev_start_status;
  }
  
@@ -69,7 +69,7 @@ Forwarded: no
  static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
  {
  	struct cfg80211_chan_def *chandef = NULL;
-@@ -1054,7 +1088,8 @@ static int ath10k_monitor_vdev_start(str
+@@ -1062,7 +1096,8 @@ static int ath10k_monitor_vdev_start(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = channel->max_power * 2;
  	arg.channel.max_reg_power = channel->max_reg_power * 2;
@@ -79,7 +79,7 @@ Forwarded: no
  
  	reinit_completion(&ar->vdev_setup_done);
  	reinit_completion(&ar->vdev_delete_done);
-@@ -1500,7 +1535,8 @@ static int ath10k_vdev_start_restart(str
+@@ -1508,7 +1543,8 @@ static int ath10k_vdev_start_restart(str
  	arg.channel.min_power = 0;
  	arg.channel.max_power = chandef->chan->max_power * 2;
  	arg.channel.max_reg_power = chandef->chan->max_reg_power * 2;
@@ -89,7 +89,7 @@ Forwarded: no
  
  	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
  		arg.ssid = arvif->u.ap.ssid;
-@@ -3431,7 +3467,8 @@ static int ath10k_update_channel_list(st
+@@ -3439,7 +3475,8 @@ static int ath10k_update_channel_list(st
  			ch->min_power = 0;
  			ch->max_power = channel->max_power * 2;
  			ch->max_reg_power = channel->max_reg_power * 2;
diff --git a/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch b/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch
index f7387595a9..619555cbad 100644
--- a/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch
+++ b/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch
@@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail at david-bauer.net>
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -10094,7 +10094,6 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10102,7 +10102,6 @@ int ath10k_mac_register(struct ath10k *a
  	ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
  	ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
  	ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
diff --git a/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch b/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch
index c426d4b6a8..1111568af2 100644
--- a/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch
+++ b/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch
@@ -29,7 +29,7 @@ Tested-by: Florian Maurer <maurer at fh-aachen.de>
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -8135,6 +8135,20 @@ static void ath10k_flush(struct ieee8021
+@@ -8143,6 +8143,20 @@ static void ath10k_flush(struct ieee8021
  	mutex_unlock(&ar->conf_mutex);
  }
  
@@ -50,7 +50,7 @@ Tested-by: Florian Maurer <maurer at fh-aachen.de>
  /* TODO: Implement this function properly
   * For now it is needed to reply to Probe Requests in IBSS mode.
   * Probably we need this information from FW.
-@@ -9486,6 +9500,7 @@ static const struct ieee80211_ops ath10k
+@@ -9494,6 +9508,7 @@ static const struct ieee80211_ops ath10k
  	.set_rts_threshold		= ath10k_set_rts_threshold,
  	.set_frag_threshold		= ath10k_mac_op_set_frag_threshold,
  	.flush				= ath10k_flush,
@@ -58,7 +58,7 @@ Tested-by: Florian Maurer <maurer at fh-aachen.de>
  	.tx_last_beacon			= ath10k_tx_last_beacon,
  	.set_antenna			= ath10k_set_antenna,
  	.get_antenna			= ath10k_get_antenna,
-@@ -10307,6 +10322,9 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10315,6 +10330,9 @@ int ath10k_mac_register(struct ath10k *a
  	if (!ar->hw_params.hw_ops->set_coverage_class)
  		ar->ops->set_coverage_class = NULL;
  
diff --git a/package/kernel/mac80211/patches/ath11k/453-ath11k-add-ath11k_mac_op_flush_sta-to-properly-flush.patch b/package/kernel/mac80211/patches/ath11k/453-ath11k-add-ath11k_mac_op_flush_sta-to-properly-flush.patch
index 0612150f3c..056c2f09e5 100644
--- a/package/kernel/mac80211/patches/ath11k/453-ath11k-add-ath11k_mac_op_flush_sta-to-properly-flush.patch
+++ b/package/kernel/mac80211/patches/ath11k/453-ath11k-add-ath11k_mac_op_flush_sta-to-properly-flush.patch
@@ -31,7 +31,7 @@ Signed-off-by: Florian Maurer <f.maurer at outlook.de>
 
 --- a/drivers/net/wireless/ath/ath11k/mac.c
 +++ b/drivers/net/wireless/ath/ath11k/mac.c
-@@ -8278,6 +8278,23 @@ static void ath11k_mac_op_flush(struct i
+@@ -8327,6 +8327,23 @@ static void ath11k_mac_op_flush(struct i
  	ath11k_mac_flush_tx_complete(ar);
  }
  
@@ -55,7 +55,7 @@ Signed-off-by: Florian Maurer <f.maurer at outlook.de>
  static bool
  ath11k_mac_has_single_legacy_rate(struct ath11k *ar,
  				  enum nl80211_band band,
-@@ -9910,6 +9927,7 @@ static const struct ieee80211_ops ath11k
+@@ -9959,6 +9976,7 @@ static const struct ieee80211_ops ath11k
  	.set_bitrate_mask		= ath11k_mac_op_set_bitrate_mask,
  	.get_survey			= ath11k_mac_op_get_survey,
  	.flush				= ath11k_mac_op_flush,
diff --git a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch
index 2bc1ca3c7d..c7ce4b7235 100644
--- a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch
+++ b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch
@@ -31,7 +31,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
  	{
  		.hw_rev = ATH11K_HW_IPQ8074,
  		.name = "ipq8074 hw2.0",
-@@ -2201,7 +2201,8 @@ static void ath11k_core_reset(struct wor
+@@ -2239,7 +2239,8 @@ static void ath11k_core_reset(struct wor
  static int ath11k_init_hw_params(struct ath11k_base *ab)
  {
  	const struct ath11k_hw_params *hw_params = NULL;
@@ -41,7 +41,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
  
  	for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) {
  		hw_params = &ath11k_hw_params[i];
-@@ -2217,7 +2218,31 @@ static int ath11k_init_hw_params(struct
+@@ -2255,7 +2256,31 @@ static int ath11k_init_hw_params(struct
  
  	ab->hw_params = *hw_params;
  
diff --git a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch
index b265fcdeab..5005b796da 100644
--- a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch
+++ b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch
@@ -532,7 +532,7 @@ Acked-by: Jeff Johnson <quic_jjohnson at quicinc.com>
  	return ret;
  }
  
-@@ -5998,7 +6013,7 @@ static int ath12k_mac_start(struct ath12
+@@ -6000,7 +6015,7 @@ static int ath12k_mac_start(struct ath12
  
  	/* TODO: Do we need to enable ANI? */
  
@@ -541,7 +541,7 @@ Acked-by: Jeff Johnson <quic_jjohnson at quicinc.com>
  
  	ar->num_started_vdevs = 0;
  	ar->num_created_vdevs = 0;
-@@ -6178,6 +6193,9 @@ static void ath12k_mac_stop(struct ath12
+@@ -6180,6 +6195,9 @@ static void ath12k_mac_stop(struct ath12
  	cancel_delayed_work_sync(&ar->scan.timeout);
  	cancel_work_sync(&ar->regd_update_work);
  	cancel_work_sync(&ar->ab->rfkill_work);
@@ -551,7 +551,7 @@ Acked-by: Jeff Johnson <quic_jjohnson at quicinc.com>
  
  	spin_lock_bh(&ar->data_lock);
  	list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
-@@ -6424,6 +6442,117 @@ static void ath12k_mac_op_update_vif_off
+@@ -6426,6 +6444,117 @@ static void ath12k_mac_op_update_vif_off
  	ath12k_mac_update_vif_offload(arvif);
  }
  
@@ -669,7 +669,7 @@ Acked-by: Jeff Johnson <quic_jjohnson at quicinc.com>
  static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
  {
  	struct ath12k_hw *ah = ar->ah;
-@@ -6538,6 +6667,7 @@ static int ath12k_mac_vdev_create(struct
+@@ -6540,6 +6669,7 @@ static int ath12k_mac_vdev_create(struct
  				    arvif->vdev_id, ret);
  			goto err_peer_del;
  		}
@@ -677,7 +677,7 @@ Acked-by: Jeff Johnson <quic_jjohnson at quicinc.com>
  		break;
  	case WMI_VDEV_TYPE_STA:
  		param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
-@@ -6576,6 +6706,13 @@ static int ath12k_mac_vdev_create(struct
+@@ -6578,6 +6708,13 @@ static int ath12k_mac_vdev_create(struct
  				    arvif->vdev_id, ret);
  			goto err_peer_del;
  		}
@@ -691,7 +691,7 @@ Acked-by: Jeff Johnson <quic_jjohnson at quicinc.com>
  		break;
  	default:
  		break;
-@@ -6916,6 +7053,11 @@ static void ath12k_mac_op_remove_interfa
+@@ -6918,6 +7055,11 @@ static void ath12k_mac_op_remove_interfa
  	ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
  		   arvif->vdev_id);
  
@@ -703,7 +703,7 @@ Acked-by: Jeff Johnson <quic_jjohnson at quicinc.com>
  	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
  		ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
  		if (ret)
-@@ -7756,6 +7898,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
+@@ -7758,6 +7900,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
  	    ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
  		ath12k_mac_monitor_stop(ar);
  
@@ -718,7 +718,7 @@ Acked-by: Jeff Johnson <quic_jjohnson at quicinc.com>
  	mutex_unlock(&ar->conf_mutex);
  }
  
-@@ -8294,6 +8444,14 @@ ath12k_mac_op_reconfig_complete(struct i
+@@ -8296,6 +8446,14 @@ ath12k_mac_op_reconfig_complete(struct i
  		ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
  			    ar->pdev->pdev_id);
  
@@ -733,7 +733,7 @@ Acked-by: Jeff Johnson <quic_jjohnson at quicinc.com>
  		if (ab->is_reset) {
  			recovery_count = atomic_inc_return(&ab->recovery_count);
  
-@@ -9344,6 +9502,9 @@ static void ath12k_mac_setup(struct ath1
+@@ -9346,6 +9504,9 @@ static void ath12k_mac_setup(struct ath1
  
  	INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work);
  	skb_queue_head_init(&ar->wmi_mgmt_tx_queue);
diff --git a/package/kernel/mac80211/patches/ath12k/002-wifi-ath12k-correctly-handle-mcast-packets-for-clien.patch b/package/kernel/mac80211/patches/ath12k/002-wifi-ath12k-correctly-handle-mcast-packets-for-clien.patch
deleted file mode 100644
index 2e5e080524..0000000000
--- a/package/kernel/mac80211/patches/ath12k/002-wifi-ath12k-correctly-handle-mcast-packets-for-clien.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From a1eb56723b3203d366d2293a368b8bc8ef8894cd Mon Sep 17 00:00:00 2001
-From: Sarika Sharma <quic_sarishar at quicinc.com>
-Date: Fri, 11 Apr 2025 11:45:23 +0530
-Subject: [PATCH] wifi: ath12k: correctly handle mcast packets for clients
-
-commit 4541b0c8c3c1b85564971d497224e57cf8076a02 upstream.
-
-Currently, RX is_mcbc bit is set for packets sent from client as
-destination address (DA) is multicast/broadcast address, but packets
-are actually unicast as receiver address (RA) is not multicast address.
-Hence, packets are not handled properly due to this is_mcbc bit.
-
-Therefore, reset the is_mcbc bit if interface type is AP.
-
-Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
-
-Signed-off-by: Sarika Sharma <quic_sarishar at quicinc.com>
-Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan at oss.qualcomm.com>
-Link: https://patch.msgid.link/20250411061523.859387-3-quic_sarishar at quicinc.com
-Signed-off-by: Jeff Johnson <jeff.johnson at oss.qualcomm.com>
-[ Adjust context ]
-Signed-off-by: Oliver Sedlbauer <os at dev.tdt.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
----
- drivers/net/wireless/ath/ath12k/dp_rx.c | 5 +++++
- drivers/net/wireless/ath/ath12k/peer.c  | 3 +++
- drivers/net/wireless/ath/ath12k/peer.h  | 2 ++
- 3 files changed, 10 insertions(+)
-
---- a/drivers/net/wireless/ath/ath12k/dp_rx.c
-+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
-@@ -2214,6 +2214,11 @@ static void ath12k_dp_rx_h_mpdu(struct a
- 	spin_lock_bh(&ar->ab->base_lock);
- 	peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu);
- 	if (peer) {
-+		/* resetting mcbc bit because mcbc packets are unicast
-+		 * packets only for AP as STA sends unicast packets.
-+		 */
-+		rxcb->is_mcbc = rxcb->is_mcbc && !peer->ucast_ra_only;
-+
- 		if (rxcb->is_mcbc)
- 			enctype = peer->sec_type_grp;
- 		else
---- a/drivers/net/wireless/ath/ath12k/peer.c
-+++ b/drivers/net/wireless/ath/ath12k/peer.c
-@@ -331,6 +331,9 @@ int ath12k_peer_create(struct ath12k *ar
- 		arvif->ast_idx = peer->hw_peer_id;
- 	}
- 
-+	if (arvif->vif->type == NL80211_IFTYPE_AP)
-+		peer->ucast_ra_only = true;
-+
- 	peer->sec_type = HAL_ENCRYPT_TYPE_OPEN;
- 	peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN;
- 
---- a/drivers/net/wireless/ath/ath12k/peer.h
-+++ b/drivers/net/wireless/ath/ath12k/peer.h
-@@ -47,6 +47,8 @@ struct ath12k_peer {
- 
- 	/* protected by ab->data_lock */
- 	bool dp_setup_done;
-+
-+	bool ucast_ra_only;
- };
- 
- void ath12k_peer_unmap_event(struct ath12k_base *ab, u16 peer_id);
diff --git a/package/kernel/mac80211/patches/brcm/870-02-rpi-6.12-brcmfmac-Prefer-a-ccode-from-OTP-over-nvram-file.patch b/package/kernel/mac80211/patches/brcm/870-02-rpi-6.12-brcmfmac-Prefer-a-ccode-from-OTP-over-nvram-file.patch
index 9a7f9eb266..f3606dce41 100644
--- a/package/kernel/mac80211/patches/brcm/870-02-rpi-6.12-brcmfmac-Prefer-a-ccode-from-OTP-over-nvram-file.patch
+++ b/package/kernel/mac80211/patches/brcm/870-02-rpi-6.12-brcmfmac-Prefer-a-ccode-from-OTP-over-nvram-file.patch
@@ -22,7 +22,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
  #include <net/cfg80211.h>
  #include <net/netlink.h>
  #include <uapi/linux/if_arp.h>
-@@ -8212,31 +8213,45 @@ static void brcmf_cfg80211_reg_notifier(
+@@ -8211,31 +8212,45 @@ static void brcmf_cfg80211_reg_notifier(
  	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  	struct brcmf_pub *drvr = cfg->pub;
  	struct brcmf_fil_country_le ccreq;
diff --git a/package/kernel/mac80211/patches/brcm/870-05-rpi-6.12-brcmfmac-Fix-interoperating-DPP-and-other-encryption.patch b/package/kernel/mac80211/patches/brcm/870-05-rpi-6.12-brcmfmac-Fix-interoperating-DPP-and-other-encryption.patch
index 080ce2bb86..ccf3ae71fd 100644
--- a/package/kernel/mac80211/patches/brcm/870-05-rpi-6.12-brcmfmac-Fix-interoperating-DPP-and-other-encryption.patch
+++ b/package/kernel/mac80211/patches/brcm/870-05-rpi-6.12-brcmfmac-Fix-interoperating-DPP-and-other-encryption.patch
@@ -119,7 +119,7 @@ Signed-off-by: Chi-hsien Lin <chi-hsien.lin at cypress.com>
  	err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe_abort", &int_val,
  					sizeof(s32));
  	if (err)
-@@ -1826,6 +1830,7 @@ bool brcmf_p2p_send_action_frame(struct
+@@ -1817,6 +1821,7 @@ bool brcmf_p2p_send_action_frame(struct
  	/* validate channel and p2p ies */
  	if (config_af_params.search_channel &&
  	    IS_P2P_SOCIAL_CHANNEL(le32_to_cpu(af_params->channel)) &&
diff --git a/package/kernel/mac80211/patches/brcm/871-brcmfmac-disable-dump_survey-on-bcm2835.patch b/package/kernel/mac80211/patches/brcm/871-brcmfmac-disable-dump_survey-on-bcm2835.patch
index 0dd0d11c18..97af080710 100644
--- a/package/kernel/mac80211/patches/brcm/871-brcmfmac-disable-dump_survey-on-bcm2835.patch
+++ b/package/kernel/mac80211/patches/brcm/871-brcmfmac-disable-dump_survey-on-bcm2835.patch
@@ -9,7 +9,7 @@ Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
 
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -7991,6 +7991,7 @@ static s32 brcmf_translate_country_code(
+@@ -7990,6 +7990,7 @@ static s32 brcmf_translate_country_code(
  	return 0;
  }
  
@@ -17,7 +17,7 @@ Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
  static int
  brcmf_parse_dump_obss(char *buf, struct brcmf_dump_survey *survey)
  {
-@@ -8213,6 +8214,7 @@ exit:
+@@ -8212,6 +8213,7 @@ exit:
  		brcmf_set_mpc(ifp, 1);
  	return err;
  }
@@ -25,7 +25,7 @@ Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
  
  static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy,
  					struct regulatory_request *req)
-@@ -8379,8 +8381,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802
+@@ -8378,8 +8380,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  	if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK))
  		ops->set_rekey_data = brcmf_cfg80211_set_rekey_data;
  #endif
diff --git a/package/kernel/mac80211/patches/build/140-trace_backport.patch b/package/kernel/mac80211/patches/build/140-trace_backport.patch
index 8b77b7e83d..50cbc2255e 100644
--- a/package/kernel/mac80211/patches/build/140-trace_backport.patch
+++ b/package/kernel/mac80211/patches/build/140-trace_backport.patch
@@ -530,7 +530,7 @@
  
 --- a/net/wireless/trace.h
 +++ b/net/wireless/trace.h
-@@ -446,7 +446,7 @@ TRACE_EVENT(rdev_add_virtual_intf,
+@@ -467,7 +467,7 @@ TRACE_EVENT(rdev_add_virtual_intf,
  	),
  	TP_fast_assign(
  		WIPHY_ASSIGN;
diff --git a/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch b/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch
index 229deee9e8..42acb1d627 100644
--- a/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch
+++ b/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c
 +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
-@@ -6636,6 +6636,7 @@ static void hwsim_virtio_rx_done(struct
+@@ -6637,6 +6637,7 @@ static void hwsim_virtio_rx_done(struct
  
  static int init_vqs(struct virtio_device *vdev)
  {
@@ -8,7 +8,7 @@
  	struct virtqueue_info vqs_info[HWSIM_NUM_VQS] = {
  		[HWSIM_VQ_TX] = { "tx", hwsim_virtio_tx_done },
  		[HWSIM_VQ_RX] = { "rx", hwsim_virtio_rx_done },
-@@ -6643,6 +6644,19 @@ static int init_vqs(struct virtio_device
+@@ -6644,6 +6645,19 @@ static int init_vqs(struct virtio_device
  
  	return virtio_find_vqs(vdev, HWSIM_NUM_VQS,
  			       hwsim_vqs, vqs_info, NULL);
diff --git a/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch b/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch
index 4c6966a3c6..2f7bdce51a 100644
--- a/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch
+++ b/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch
@@ -535,7 +535,7 @@ Link: https://patch.msgid.link/913f1747-38fc-4409-85a4-57bb9cee506b at gmail.com
  				struct rtw_rx_pkt_stat *pkt_stat);
 --- a/drivers/net/wireless/realtek/rtw88/sdio.c
 +++ b/drivers/net/wireless/realtek/rtw88/sdio.c
-@@ -979,8 +979,7 @@ static void rtw_sdio_rxfifo_recv(struct
+@@ -983,8 +983,7 @@ static void rtw_sdio_rxfifo_recv(struct
  
  	while (true) {
  		rx_desc = skb->data;
diff --git a/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch b/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch
index 9c3bf29321..3e28fe9595 100644
--- a/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch
+++ b/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch
@@ -121,7 +121,7 @@ Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a at gmail.com
  	.ht_supported = true,
 --- a/drivers/net/wireless/realtek/rtw88/sdio.c
 +++ b/drivers/net/wireless/realtek/rtw88/sdio.c
-@@ -862,7 +862,7 @@ static void rtw_sdio_tx_skb_prepare(stru
+@@ -866,7 +866,7 @@ static void rtw_sdio_tx_skb_prepare(stru
  
  	pkt_info->qsel = rtw_sdio_get_tx_qsel(rtwdev, skb, queue);
  
diff --git a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
index 68534f4e7b..c0f0fbc796 100644
--- a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
+++ b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
@@ -9,7 +9,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnect
 
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -1649,12 +1649,6 @@ static int ieee80211_stop_ap(struct wiph
+@@ -1663,12 +1663,6 @@ static int ieee80211_stop_ap(struct wiph
  
  	__sta_info_flush(sdata, true, link_id);
  
diff --git a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
index ca4ac8adb6..0e886899c9 100644
--- a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
+++ b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
@@ -8,7 +8,7 @@ Subject: [PATCH] mac80211: allow scans in access point mode (for site survey)
 
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -2863,6 +2863,8 @@ static int ieee80211_scan(struct wiphy *
+@@ -2877,6 +2877,8 @@ static int ieee80211_scan(struct wiphy *
  		 */
  		fallthrough;
  	case NL80211_IFTYPE_AP:
diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch
index 6ec52af9a4..b976e8d7a2 100644
--- a/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch
+++ b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1360,10 +1360,12 @@ struct ieee80211_local {
+@@ -1362,10 +1362,12 @@ struct ieee80211_local {
  	spinlock_t handle_wake_tx_queue_lock;
  
  	u16 airtime_flags;
diff --git a/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch b/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch
index 4ecbc514fc..faf40ddb2e 100644
--- a/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch
+++ b/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -6274,6 +6274,7 @@ enum ieee80211_ap_reg_power {
+@@ -6352,6 +6352,7 @@ enum ieee80211_ap_reg_power {
   *	entered.
   * @links.cac_time_ms: CAC time in ms
   * @valid_links: bitmap describing what elements of @links are valid
@@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
   */
  struct wireless_dev {
  	struct wiphy *wiphy;
-@@ -6386,6 +6387,8 @@ struct wireless_dev {
+@@ -6464,6 +6465,8 @@ struct wireless_dev {
  		unsigned int cac_time_ms;
  	} links[IEEE80211_MLD_MAX_NUM_LINKS];
  	u16 valid_links;
@@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  };
  
  static inline const u8 *wdev_address(struct wireless_dev *wdev)
-@@ -6572,6 +6575,17 @@ bool cfg80211_radio_chandef_valid(const
+@@ -6650,6 +6653,17 @@ bool cfg80211_radio_chandef_valid(const
  				  const struct cfg80211_chan_def *chandef);
  
  /**
diff --git a/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch b/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch
index f1fc9190fc..a2a269ee35 100644
--- a/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch
+++ b/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch
@@ -59,7 +59,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	int	(*scan)(struct wiphy *wiphy,
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -879,6 +879,7 @@ static int ieee80211_get_station(struct
+@@ -893,6 +893,7 @@ static int ieee80211_get_station(struct
  }
  
  static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
@@ -126,7 +126,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
 --- a/net/wireless/trace.h
 +++ b/net/wireless/trace.h
-@@ -1318,19 +1318,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
+@@ -1339,19 +1339,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
  );
  
  TRACE_EVENT(rdev_set_monitor_channel,
diff --git a/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch b/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch
index bb2d5da1a4..5f27b3d103 100644
--- a/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch
+++ b/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch
@@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		ieee80211_set_mu_mimo_follow(monitor_sdata, params);
  
  	if (params->flags) {
-@@ -889,22 +894,25 @@ static int ieee80211_set_monitor_channel
+@@ -903,22 +908,25 @@ static int ieee80211_set_monitor_channel
  
  	lockdep_assert_wiphy(local->hw.wiphy);
  
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (ret)
  		return ret;
  done:
-@@ -3050,7 +3058,8 @@ static int ieee80211_set_tx_power(struct
+@@ -3064,7 +3072,8 @@ static int ieee80211_set_tx_power(struct
  	if (wdev) {
  		sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
  
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
  				return -EOPNOTSUPP;
  
-@@ -3098,7 +3107,8 @@ static int ieee80211_set_tx_power(struct
+@@ -3112,7 +3121,8 @@ static int ieee80211_set_tx_power(struct
  	}
  
  	list_for_each_entry(sdata, &local->interfaces, list) {
@@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			has_monitor = true;
  			continue;
  		}
-@@ -3108,7 +3118,8 @@ static int ieee80211_set_tx_power(struct
+@@ -3122,7 +3132,8 @@ static int ieee80211_set_tx_power(struct
  		sdata->vif.bss_conf.txpower_type = txp_type;
  	}
  	list_for_each_entry(sdata, &local->interfaces, list) {
@@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			continue;
  		ieee80211_recalc_txpower(sdata, update_txp_type);
  	}
-@@ -4303,7 +4314,8 @@ static int ieee80211_cfg_get_channel(str
+@@ -4317,7 +4328,8 @@ static int ieee80211_cfg_get_channel(str
  	if (chanctx_conf) {
  		*chandef = link->conf->chanreq.oper;
  		ret = 0;
@@ -201,7 +201,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -279,8 +279,13 @@ static int _ieee80211_change_mac(struct
+@@ -296,8 +296,13 @@ static int _ieee80211_change_mac(struct
  	ret = eth_mac_addr(sdata->dev, sa);
  
  	if (ret == 0) {
@@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  
  	/* Regardless of eth_mac_addr() return we still want to add the
-@@ -705,9 +710,11 @@ static void ieee80211_do_stop(struct iee
+@@ -722,9 +727,11 @@ static void ieee80211_do_stop(struct iee
  		ieee80211_recalc_idle(local);
  		ieee80211_recalc_offload(local);
  
@@ -230,7 +230,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		fallthrough;
  	default:
  		if (!going_down)
-@@ -1140,7 +1147,8 @@ int ieee80211_add_virtual_monitor(struct
+@@ -1157,7 +1164,8 @@ int ieee80211_add_virtual_monitor(struct
  	ASSERT_RTNL();
  	lockdep_assert_wiphy(local->hw.wiphy);
  
@@ -240,7 +240,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		return 0;
  
  	sdata = kzalloc(sizeof(*sdata) + local->hw.vif_data_size, GFP_KERNEL);
-@@ -1202,6 +1210,9 @@ void ieee80211_del_virtual_monitor(struc
+@@ -1219,6 +1227,9 @@ void ieee80211_del_virtual_monitor(struc
  {
  	struct ieee80211_sub_if_data *sdata;
  
@@ -250,7 +250,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	ASSERT_RTNL();
  	lockdep_assert_wiphy(local->hw.wiphy);
  
-@@ -1345,7 +1356,8 @@ int ieee80211_do_open(struct wireless_de
+@@ -1362,7 +1373,8 @@ int ieee80211_do_open(struct wireless_de
  			break;
  		}
  
diff --git a/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch b/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch
index 3cd8baefe1..f25ed44c80 100644
--- a/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch
+++ b/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1382,7 +1382,7 @@ struct ieee80211_local {
+@@ -1384,7 +1384,7 @@ struct ieee80211_local {
  	spinlock_t queue_stop_reason_lock;
  
  	int open_count;
@@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	    fif_probe_req;
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -1103,6 +1103,8 @@ void ieee80211_adjust_monitor_flags(stru
+@@ -1120,6 +1120,8 @@ void ieee80211_adjust_monitor_flags(stru
  	ADJUST(CONTROL, control);
  	ADJUST(CONTROL, pspoll);
  	ADJUST(OTHER_BSS, other_bss);
diff --git a/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch b/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch
index 4e6d2ee5e9..a803736c4c 100644
--- a/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch
+++ b/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch
@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	u8 cab_queue;
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -279,13 +279,8 @@ static int _ieee80211_change_mac(struct
+@@ -296,13 +296,8 @@ static int _ieee80211_change_mac(struct
  	ret = eth_mac_addr(sdata->dev, sa);
  
  	if (ret == 0) {
@@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  
  	/* Regardless of eth_mac_addr() return we still want to add the
-@@ -1336,6 +1331,8 @@ int ieee80211_do_open(struct wireless_de
+@@ -1353,6 +1348,8 @@ int ieee80211_do_open(struct wireless_de
  		}
  	}
  
diff --git a/package/kernel/mac80211/patches/subsys/342-wifi-mac80211-Support-EHT-1024-aggregation-size-in-T.patch b/package/kernel/mac80211/patches/subsys/342-wifi-mac80211-Support-EHT-1024-aggregation-size-in-T.patch
index e4159d2b3d..ec5255c20c 100644
--- a/package/kernel/mac80211/patches/subsys/342-wifi-mac80211-Support-EHT-1024-aggregation-size-in-T.patch
+++ b/package/kernel/mac80211/patches/subsys/342-wifi-mac80211-Support-EHT-1024-aggregation-size-in-T.patch
@@ -284,7 +284,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  				       sta->ampdu_mlme.tid_rx_manage_offl))
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -2131,14 +2131,19 @@ int ieee80211_send_smps_action(struct ie
+@@ -2133,14 +2133,19 @@ int ieee80211_send_smps_action(struct ie
  			       const u8 *bssid, int link_id);
  bool ieee80211_smps_is_restrictive(enum ieee80211_smps_mode smps_mode_old,
  				   enum ieee80211_smps_mode smps_mode_new);
diff --git a/package/kernel/mac80211/patches/subsys/350-wifi-mac80211-Add-link-iteration-macro-for-link-data.patch b/package/kernel/mac80211/patches/subsys/350-wifi-mac80211-Add-link-iteration-macro-for-link-data.patch
index fd6e5dc169..e2cd61962b 100644
--- a/package/kernel/mac80211/patches/subsys/350-wifi-mac80211-Add-link-iteration-macro-for-link-data.patch
+++ b/package/kernel/mac80211/patches/subsys/350-wifi-mac80211-Add-link-iteration-macro-for-link-data.patch
@@ -25,7 +25,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
 
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1220,6 +1220,19 @@ struct ieee80211_sub_if_data *vif_to_sda
+@@ -1222,6 +1222,19 @@ struct ieee80211_sub_if_data *vif_to_sda
  		    ((__link) = sdata_dereference((__sdata)->link[__link_id],	\
  						  (__sdata))))
  
diff --git a/package/kernel/mac80211/patches/subsys/351-wifi-mac80211-extend-beacon-monitoring-for-MLO.patch b/package/kernel/mac80211/patches/subsys/351-wifi-mac80211-extend-beacon-monitoring-for-MLO.patch
index 7722bcf64c..c45dcec3e3 100644
--- a/package/kernel/mac80211/patches/subsys/351-wifi-mac80211-extend-beacon-monitoring-for-MLO.patch
+++ b/package/kernel/mac80211/patches/subsys/351-wifi-mac80211-extend-beacon-monitoring-for-MLO.patch
@@ -23,7 +23,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
 
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
-@@ -2167,6 +2167,21 @@ static void ieee80211_csa_switch_work(st
+@@ -2168,6 +2168,21 @@ static void ieee80211_csa_switch_work(st
  		}
  	}
  
@@ -45,7 +45,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	ieee80211_sta_reset_beacon_monitor(sdata);
  	ieee80211_sta_reset_conn_monitor(sdata);
  }
-@@ -7892,6 +7907,29 @@ void ieee80211_sta_work(struct ieee80211
+@@ -7893,6 +7908,29 @@ void ieee80211_sta_work(struct ieee80211
  	}
  }
  
diff --git a/package/kernel/mac80211/patches/subsys/352-wifi-mac80211-extend-connection-monitoring-for-MLO.patch b/package/kernel/mac80211/patches/subsys/352-wifi-mac80211-extend-connection-monitoring-for-MLO.patch
index 9f16bea626..10ba0cb06d 100644
--- a/package/kernel/mac80211/patches/subsys/352-wifi-mac80211-extend-connection-monitoring-for-MLO.patch
+++ b/package/kernel/mac80211/patches/subsys/352-wifi-mac80211-extend-connection-monitoring-for-MLO.patch
@@ -25,7 +25,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
 
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
-@@ -3841,9 +3841,6 @@ static void ieee80211_mgd_probe_ap_send(
+@@ -3842,9 +3842,6 @@ static void ieee80211_mgd_probe_ap_send(
  
  	lockdep_assert_wiphy(sdata->local->hw.wiphy);
  
@@ -35,7 +35,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	/*
  	 * Try sending broadcast probe requests for the last three
  	 * probe requests after the first ones failed since some
-@@ -3889,9 +3886,6 @@ static void ieee80211_mgd_probe_ap(struc
+@@ -3890,9 +3887,6 @@ static void ieee80211_mgd_probe_ap(struc
  
  	lockdep_assert_wiphy(sdata->local->hw.wiphy);
  
@@ -45,7 +45,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	if (!ieee80211_sdata_running(sdata))
  		return;
  
-@@ -7950,36 +7944,73 @@ static void ieee80211_sta_bcn_mon_timer(
+@@ -7951,36 +7945,73 @@ static void ieee80211_sta_bcn_mon_timer(
  			 &sdata->u.mgd.beacon_connection_loss_work);
  }
  



From lede-commits at lists.infradead.org  Sun Dec 14 13:52:57 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 14 Dec 2025 16:52:57 -0500
Subject: [openwrt/openwrt]  mediatek/filogic: fix Totolink X6000R sysupgrade
 failed
In-Reply-To: <176574917610.2015364.2586357177963482844@git-01.infra.openwrt.org>
References: <176574917610.2015364.2586357177963482844@git-01.infra.openwrt.org>
Message-ID: <mailman.35568.1765749180.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/30b7a5f27aa34aa3392a5f6e1e54b02d30934cde

commit 30b7a5f27aa34aa3392a5f6e1e54b02d30934cde
Author: Ayra Hikari <ayrahikari at linuxmail.org>
AuthorDate: Thu Oct 30 19:08:50 2025 +0700

    mediatek/filogic: fix Totolink X6000R sysupgrade failed
    
    Fix Totolink X6000R image failing to upgrade via sysupgrade due to an
    incorrect upgrade case. The fallback upgrade path used the NAND upgrade
    routine, which caused the "layout volume not found" error on NOR flash
    devices. By adding a specific case for this board, sysupgrade now uses
    `default_do_upgrade`, which is compatible with the NOR flash layout.
    
    Fixes: 7cd10ad
    Signed-off-by: Ayra Hikari <ayrahikari at linuxmail.org>
    (cherry picked from commit 7cd10add2de3c8227cf7383c7ca5cf3b12eeb822)
    Link: https://github.com/openwrt/openwrt/pull/20674
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index 8ba706f85b..8af61b0289 100755
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -136,7 +136,8 @@ platform_do_upgrade() {
 	cudy,re3000-v1|\
 	cudy,wr3000-v1|\
 	yuncore,ax835|\
-	wavlink,wl-wn573hx3)
+	wavlink,wl-wn573hx3|\
+	totolink,x6000r)
 		default_do_upgrade "$1"
 		;;
 	dlink,aquila-pro-ai-m30-a1|\



From lede-commits at lists.infradead.org  Sun Dec 14 13:52:56 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 14 Dec 2025 16:52:56 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: add support for Totolink X6000R
In-Reply-To: <176574917610.2015364.2586357177963482844@git-01.infra.openwrt.org>
References: <176574917610.2015364.2586357177963482844@git-01.infra.openwrt.org>
Message-ID: <mailman.35569.1765749180.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/8db7b6ff53042848cb9212069b3ebec33076c38a

commit 8db7b6ff53042848cb9212069b3ebec33076c38a
Author: Ari Kurniawan <noobhek at gmail.com>
AuthorDate: Mon Sep 15 20:13:29 2025 +0700

    mediatek: filogic: add support for Totolink X6000R
    
    Specification :
    - SOC : Mediatek MT7981B (1.3GHz)
    - RAM : 256MB
    - Flash : 16MB SPI NOR
    - Ports : 4 LAN (1G) & 1 WAN (1G)
    - WIFI : MediaTek dual-band WiFi 6
      - 2.4 GHz : b/g/n/ax, MIMO 2x2
      - 5 GHz   : a/n/ac/ax, MIMO 2x2
    - Buttons : Reset & WPS/Mesh
    - LEDS : WAN (Green), Status (Red & Blue)
    - Power : 12V1A
    
    Install via OEM web ui:
    Upload the sysupgrade image to firmware upgrade page on OEM web ui
    
    Install via recovery / revert to stock firmware:
    1. Unplug from power
    2. Download the Sysupgrade (for openwrt installation) or OEM Factory image (for revert to stock firmware)
    3. Set your computer ethernet IP to 192.168.1.X, subnet 255.255.255.0 (X=your chosen ip number ranging from 2-254)
    4. Press and hold reset button while turn on / plug power adapter to the router. Wait untill ALL LAN green LED turn on, then release the reset button.
    5. Plug the LAN cable from your computer into LAN 1 port then open web browser, and type in the address column : 192.168.1.1
    6. Upload the sysupgrade / oem factory image
    7. Wait until the router finished flashing (the router will reboot)
    8. Set ethernet ip to dhcp
    9. Open 192.168.1.1 (for openwrt install) / 192.168.0.1 (for OEM firmware)
    
    Signed-off-by: Ari Kurniawan <noobhek at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20035
    (cherry picked from commit 7cd10add2de3c8227cf7383c7ca5cf3b12eeb822)
    Signed-off-by: Ari Kurniawan <noobhek at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20674
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../linux/mediatek/dts/mt7981b-totolink-x6000r.dts | 254 +++++++++++++++++++++
 .../filogic/base-files/etc/board.d/01_leds         |   3 +
 target/linux/mediatek/image/filogic.mk             |  11 +
 3 files changed, 268 insertions(+)

diff --git a/target/linux/mediatek/dts/mt7981b-totolink-x6000r.dts b/target/linux/mediatek/dts/mt7981b-totolink-x6000r.dts
new file mode 100644
index 0000000000..80d4cdea73
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-totolink-x6000r.dts
@@ -0,0 +1,254 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include <dt-bindings/leds/common.h>
+
+#include "mt7981.dtsi"
+
+/ {
+	model = "TOTOLINK X6000R";
+	compatible = "totolink,x6000r", "mediatek,mt7981";
+
+	aliases {
+		label-mac-device = &gmac0;
+		led-boot = &led_status;
+		led-failsafe = &led_status_red;
+		led-running = &led_status;
+		led-upgrade = &led_status;
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+		
+	memory at 40000000 {
+		reg = <0 0x40000000 0 0x10000000>;
+		device_type = "memory";
+	};
+	
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+		};
+
+		wps {
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		led-0 {
+			function = LED_FUNCTION_WAN;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
+		};
+
+		led_status_red: led-1 {
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			gpios = <&pio 13 GPIO_ACTIVE_LOW>;
+		};
+
+		led_status: led-2 {
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+			gpios = <&pio 15 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&eth {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mdio_pins &gbe_led0_pins &gbe_led1_pins>;
+	status = "okay";
+
+	gmac0: mac at 0 {
+		compatible = "mediatek,eth-mac";
+		reg = <0>;
+		phy-mode = "2500base-x";
+
+		nvmem-cells = <&macaddr_factory_14>;
+		nvmem-cell-names = "mac-address";
+		
+		fixed-link {
+			speed = <2500>;
+			full-duplex;
+			pause;
+		};
+	};
+
+	mac at 1 {
+		compatible = "mediatek,eth-mac";
+		reg = <1>;
+		phy-mode = "gmii";
+		phy-handle = <&int_gbe_phy>;
+		label = "wan";
+
+		nvmem-cells = <&macaddr_factory_1a>;
+		nvmem-cell-names = "mac-address";
+	};
+};
+
+&mdio_bus {
+	switch: switch at 1f {
+		compatible = "mediatek,mt7531";
+		reg = <31>;
+		reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		interrupt-parent = <&pio>;
+		interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port at 0 {
+				reg = <0>;
+				label = "lan4";
+			};
+
+			port at 1 {
+				reg = <1>;
+				label = "lan3";
+			};
+
+			port at 2 {
+				reg = <2>;
+				label = "lan2";
+			};
+
+			port at 3 {
+				reg = <3>;
+				label = "lan1";
+			};
+			
+			port at 6 {
+				reg = <6>;
+				label = "cpu";
+				ethernet = <&gmac0>;
+				phy-mode = "2500base-x";
+
+				fixed-link {
+					speed = <2500>;
+					full-duplex;
+					pause;
+				};
+			};
+		};
+	};
+};
+
+&spi2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi2_flash_pins>;
+	status = "okay";
+
+	flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "BL2";
+				reg = <0x00000 0x40000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "u-boot-env";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				label = "Factory";
+				reg = <0x50000 0xb0000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory_0: eeprom at 0 {
+						reg = <0x0 0x1000>;
+					};
+
+					macaddr_factory_14: macaddr at 14 {
+						reg = <0x14 0x6>;
+					};
+
+					macaddr_factory_1a: macaddr at 1a {
+						reg = <0x1a 0x6>;
+					};
+				};
+			};
+
+			partition at 100000 {
+				label = "FIP";
+				reg = <0x100000 0x80000>;
+				read-only;
+			};
+
+			partition at 180000 {
+				compatible = "denx,fit";
+				label = "firmware";
+				reg = <0x180000 0xe00000>;
+			};
+		};
+	};
+};
+
+&pio {
+	spi2_flash_pins: spi2-pins {
+		mux {
+			function = "spi";
+			groups = "spi2", "spi2_wp_hold";
+		};
+
+		conf-pu {
+			pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
+		};
+
+		conf-pd {
+			pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
+		};
+	};
+};
+
+&wifi {
+	status = "okay";
+	nvmem-cells = <&eeprom_factory_0>;
+	nvmem-cell-names = "eeprom";
+};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
index 0f5270483d..7f8fb4b7c4 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
@@ -153,6 +153,9 @@ smartrg,sdg-8733a)
 	ucidef_set_led_netdev "wan-orange" "WAN" "mdio-bus:08:orange:wan" "wan" "link_100 link_1000"
 	ucidef_set_led_netdev "wan-white" "WAN" "mdio-bus:08:white:wan" "wan" "link_10000"
 	;;
+totolink,x6000r)
+	ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx"
+	;;
 tplink,re6000xd)
 	ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-0" "lan1" "link tx rx"
 	ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-1" "lan2" "link tx rx"
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 8eb0932a98..e33f8a3aec 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1761,6 +1761,17 @@ define Device/ruijie_rg-x60-pro
 endef
 TARGET_DEVICES += ruijie_rg-x60-pro
 
+define Device/totolink_x6000r
+  DEVICE_VENDOR := TOTOLINK
+  DEVICE_MODEL := X6000R
+  DEVICE_DTS := mt7981b-totolink-x6000r
+  DEVICE_DTS_DIR := ../dts
+  IMAGES := sysupgrade.bin
+  IMAGE_SIZE := 14336k
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+endef
+TARGET_DEVICES += totolink_x6000r
+
 define Device/tplink_archer-ax80-v1
   DEVICE_VENDOR := TP-Link
   DEVICE_MODEL := Archer AX80V1



From lede-commits at lists.infradead.org  Mon Dec 15 00:29:23 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:29:23 -0500
Subject: [openwrt/openwrt]  realtek: use devm_kzalloc() for serdes debugfs
 setup
In-Reply-To: <176578736153.4040378.6918036102873646229@git-01.infra.openwrt.org>
References: <176578736153.4040378.6918036102873646229@git-01.infra.openwrt.org>
Message-ID: <mailman.35681.1765787368.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a4011797c2fb160a696edfc29993c78ab5edc3d1

commit a4011797c2fb160a696edfc29993c78ab5edc3d1
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Sun Dec 14 10:07:38 2025 +0100

    realtek: use devm_kzalloc() for serdes debugfs setup
    
    This will free memory automatically during driver unloading.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21157
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 394af71250..5c8741383f 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -148,7 +148,7 @@ static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds)
 	struct dentry *dir, *root;
 	char dirname[32];
 
-	dbg_info = kzalloc(sizeof(*dbg_info), GFP_KERNEL);
+	dbg_info = devm_kzalloc(ctrl->dev, sizeof(*dbg_info), GFP_KERNEL);
 	if (!dbg_info)
 		return -ENOMEM;
 



From lede-commits at lists.infradead.org  Mon Dec 15 00:29:21 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:29:21 -0500
Subject: [openwrt/openwrt]  realtek: simplify backing serdes calculation
In-Reply-To: <176578736153.4040378.6918036102873646229@git-01.infra.openwrt.org>
References: <176578736153.4040378.6918036102873646229@git-01.infra.openwrt.org>
Message-ID: <mailman.35682.1765787368.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/dcbc8722e970292af1526adf173895bf2f2cae14

commit dcbc8722e970292af1526adf173895bf2f2cae14
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Sun Dec 14 09:53:49 2025 +0100

    realtek: simplify backing serdes calculation
    
    Calculating the backing serdes of a given frontend serdes does
    not need any info about the control structure. Drop the reference.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21157
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 95ef214ec8..2bd38f382d 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -52,7 +52,7 @@ struct rtsds_config {
 	int sds_cnt;
 	int page_cnt;
 	int base;
-	int (*get_backing_sds)(struct rtsds_ctrl *ctrl, int sds, int page);
+	int (*get_backing_sds)(int sds, int page);
 	int (*read)(struct rtsds_ctrl *ctrl, int sds, int page, int regnum);
 	int (*write)(struct rtsds_ctrl *ctrl, int sds, int page, int regnum, u16 value);
 };
@@ -120,7 +120,7 @@ static int rtsds_dbg_registers_show(struct seq_file *seqf, void *unused)
 	do {
 		subpage = RTSDS_SUBPAGE(page);
 		if (!subpage) {
-			seq_printf(seqf, "Back SDS %02d:", ctrl->cfg->get_backing_sds(ctrl, sds, page));
+			seq_printf(seqf, "Back SDS %02d:", ctrl->cfg->get_backing_sds(sds, page));
 			for (regnum = 0; regnum < RTSDS_REG_CNT; regnum++)
 				seq_printf(seqf, "   %02X", regnum);
 			seq_puts(seqf, "\n");
@@ -285,7 +285,7 @@ static int rtsds_839x_write(struct rtsds_ctrl *ctrl, int sds, int page, int regn
 	return regmap_write(ctrl->map, ctrl->cfg->base + offset, write_value);
 }
 
-static int rtsds_83xx_get_backing_sds(struct rtsds_ctrl *ctrl, int sds, int page)
+static int rtsds_83xx_get_backing_sds(int sds, int page)
 {
 	return sds;
 }
@@ -321,7 +321,7 @@ static int rtsds_rt93xx_io(struct rtsds_ctrl *ctrl, int sds, int page, int regnu
  * - SerDes 2-9 are USXGMII capabable with either quad or single configuration
  * - SerDes 10-11 are 10GBase-R capable
  */
-static int rtsds_930x_get_backing_sds(struct rtsds_ctrl *ctrl, int sds, int page)
+static int rtsds_930x_get_backing_sds(int sds, int page)
 {
 	if (sds == 3 && page < 4)
 		return 10;
@@ -360,7 +360,7 @@ static int rtsds_930x_get_backing_sds(struct rtsds_ctrl *ctrl, int sds, int page
  * page 0x40-0x7f (digi 1):	page 0x00-0x3f back SDS		page 0x00-0x3f back SDS+1
  * page 0x80-0xbf (digi 2):	page 0x00-0x3f back SDS+1	page 0x00-0x3f back SDS+2
  */
-static int rtsds_931x_get_backing_sds(struct rtsds_ctrl *ctrl, int sds, int page)
+static int rtsds_931x_get_backing_sds(int sds, int page)
 {
 	int map[] = { 0, 1, 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23 };
 	int backsds;
@@ -383,7 +383,7 @@ static int rtsds_93xx_read(struct rtsds_ctrl *ctrl, int sds, int page, int regnu
 	int subpage = RTSDS_SUBPAGE(page);
 	int ret, backsds, value;
 
-	backsds = ctrl->cfg->get_backing_sds(ctrl, sds, page);
+	backsds = ctrl->cfg->get_backing_sds(sds, page);
 	ret = rtsds_rt93xx_io(ctrl, backsds, subpage, regnum, RTSDS_93XX_CMD_READ);
 	if (ret)
 		return ret;
@@ -398,7 +398,7 @@ static int rtsds_93xx_write(struct rtsds_ctrl *ctrl, int sds, int page, int regn
 	int subpage = RTSDS_SUBPAGE(page);
 	int ret, backsds;
 
-	backsds = ctrl->cfg->get_backing_sds(ctrl, sds, page);
+	backsds = ctrl->cfg->get_backing_sds(sds, page);
 	ret = regmap_write(ctrl->map, ctrl->cfg->base + 4, value);
 	if (ret)
 		return ret;



From lede-commits at lists.infradead.org  Mon Dec 15 00:29:22 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:29:22 -0500
Subject: [openwrt/openwrt]  realtek: cleanup debugfs creation in serdes driver
In-Reply-To: <176578736153.4040378.6918036102873646229@git-01.infra.openwrt.org>
References: <176578736153.4040378.6918036102873646229@git-01.infra.openwrt.org>
Message-ID: <mailman.35683.1765787370.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3c073b5cb208e9ca77a786f38dc941316ee25c67

commit 3c073b5cb208e9ca77a786f38dc941316ee25c67
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Sun Dec 14 10:03:47 2025 +0100

    realtek: cleanup debugfs creation in serdes driver
    
    debugfs_create_dir() has a proper logic to handle existing directories.
    Skip the manual test. Additionally quit early if directory creation fails.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21157
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 2bd38f382d..394af71250 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -155,9 +155,9 @@ static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds)
 	dbg_info->ctrl = ctrl;
 	dbg_info->sds = sds;
 
-	root = debugfs_lookup(RTSDS_DBG_ROOT_DIR, NULL);
-	if (!root)
-		root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL);
+	root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL);
+	if (IS_ERR(root))
+		return PTR_ERR(root);
 
 	snprintf(dirname, sizeof(dirname), "serdes.%d", sds);
 	dir = debugfs_create_dir(dirname, root);



From lede-commits at lists.infradead.org  Mon Dec 15 00:30:08 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:30:08 -0500
Subject: [openwrt/openwrt]  realtek: use devm_kzalloc() for serdes debugfs
 setup
In-Reply-To: <176578740655.4043531.12785853670771110175@git-01.infra.openwrt.org>
References: <176578740655.4043531.12785853670771110175@git-01.infra.openwrt.org>
Message-ID: <mailman.35686.1765787411.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/bcbf4bd8acd2f05850ed64e7900a68af79e1a774

commit bcbf4bd8acd2f05850ed64e7900a68af79e1a774
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Sun Dec 14 10:07:38 2025 +0100

    realtek: use devm_kzalloc() for serdes debugfs setup
    
    This will free memory automatically during driver unloading.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21157
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit a4011797c2fb160a696edfc29993c78ab5edc3d1)
---
 .../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 394af71250..5c8741383f 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -148,7 +148,7 @@ static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds)
 	struct dentry *dir, *root;
 	char dirname[32];
 
-	dbg_info = kzalloc(sizeof(*dbg_info), GFP_KERNEL);
+	dbg_info = devm_kzalloc(ctrl->dev, sizeof(*dbg_info), GFP_KERNEL);
 	if (!dbg_info)
 		return -ENOMEM;
 



From lede-commits at lists.infradead.org  Mon Dec 15 00:30:07 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:30:07 -0500
Subject: [openwrt/openwrt]  realtek: cleanup debugfs creation in serdes driver
In-Reply-To: <176578740655.4043531.12785853670771110175@git-01.infra.openwrt.org>
References: <176578740655.4043531.12785853670771110175@git-01.infra.openwrt.org>
Message-ID: <mailman.35687.1765787416.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/77b47f33e58da08d7038457972341460c9d30632

commit 77b47f33e58da08d7038457972341460c9d30632
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Sun Dec 14 10:03:47 2025 +0100

    realtek: cleanup debugfs creation in serdes driver
    
    debugfs_create_dir() has a proper logic to handle existing directories.
    Skip the manual test. Additionally quit early if directory creation fails.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21157
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 3c073b5cb208e9ca77a786f38dc941316ee25c67)
---
 .../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 2bd38f382d..394af71250 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -155,9 +155,9 @@ static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds)
 	dbg_info->ctrl = ctrl;
 	dbg_info->sds = sds;
 
-	root = debugfs_lookup(RTSDS_DBG_ROOT_DIR, NULL);
-	if (!root)
-		root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL);
+	root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL);
+	if (IS_ERR(root))
+		return PTR_ERR(root);
 
 	snprintf(dirname, sizeof(dirname), "serdes.%d", sds);
 	dir = debugfs_create_dir(dirname, root);



From lede-commits at lists.infradead.org  Mon Dec 15 00:30:06 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:30:06 -0500
Subject: [openwrt/openwrt]  realtek: simplify backing serdes calculation
In-Reply-To: <176578740655.4043531.12785853670771110175@git-01.infra.openwrt.org>
References: <176578740655.4043531.12785853670771110175@git-01.infra.openwrt.org>
Message-ID: <mailman.35688.1765787416.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/a53655ed143ef5adb383cbb3b945197e7365d628

commit a53655ed143ef5adb383cbb3b945197e7365d628
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Sun Dec 14 09:53:49 2025 +0100

    realtek: simplify backing serdes calculation
    
    Calculating the backing serdes of a given frontend serdes does
    not need any info about the control structure. Drop the reference.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21157
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit dcbc8722e970292af1526adf173895bf2f2cae14)
---
 .../files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 95ef214ec8..2bd38f382d 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -52,7 +52,7 @@ struct rtsds_config {
 	int sds_cnt;
 	int page_cnt;
 	int base;
-	int (*get_backing_sds)(struct rtsds_ctrl *ctrl, int sds, int page);
+	int (*get_backing_sds)(int sds, int page);
 	int (*read)(struct rtsds_ctrl *ctrl, int sds, int page, int regnum);
 	int (*write)(struct rtsds_ctrl *ctrl, int sds, int page, int regnum, u16 value);
 };
@@ -120,7 +120,7 @@ static int rtsds_dbg_registers_show(struct seq_file *seqf, void *unused)
 	do {
 		subpage = RTSDS_SUBPAGE(page);
 		if (!subpage) {
-			seq_printf(seqf, "Back SDS %02d:", ctrl->cfg->get_backing_sds(ctrl, sds, page));
+			seq_printf(seqf, "Back SDS %02d:", ctrl->cfg->get_backing_sds(sds, page));
 			for (regnum = 0; regnum < RTSDS_REG_CNT; regnum++)
 				seq_printf(seqf, "   %02X", regnum);
 			seq_puts(seqf, "\n");
@@ -285,7 +285,7 @@ static int rtsds_839x_write(struct rtsds_ctrl *ctrl, int sds, int page, int regn
 	return regmap_write(ctrl->map, ctrl->cfg->base + offset, write_value);
 }
 
-static int rtsds_83xx_get_backing_sds(struct rtsds_ctrl *ctrl, int sds, int page)
+static int rtsds_83xx_get_backing_sds(int sds, int page)
 {
 	return sds;
 }
@@ -321,7 +321,7 @@ static int rtsds_rt93xx_io(struct rtsds_ctrl *ctrl, int sds, int page, int regnu
  * - SerDes 2-9 are USXGMII capabable with either quad or single configuration
  * - SerDes 10-11 are 10GBase-R capable
  */
-static int rtsds_930x_get_backing_sds(struct rtsds_ctrl *ctrl, int sds, int page)
+static int rtsds_930x_get_backing_sds(int sds, int page)
 {
 	if (sds == 3 && page < 4)
 		return 10;
@@ -360,7 +360,7 @@ static int rtsds_930x_get_backing_sds(struct rtsds_ctrl *ctrl, int sds, int page
  * page 0x40-0x7f (digi 1):	page 0x00-0x3f back SDS		page 0x00-0x3f back SDS+1
  * page 0x80-0xbf (digi 2):	page 0x00-0x3f back SDS+1	page 0x00-0x3f back SDS+2
  */
-static int rtsds_931x_get_backing_sds(struct rtsds_ctrl *ctrl, int sds, int page)
+static int rtsds_931x_get_backing_sds(int sds, int page)
 {
 	int map[] = { 0, 1, 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23 };
 	int backsds;
@@ -383,7 +383,7 @@ static int rtsds_93xx_read(struct rtsds_ctrl *ctrl, int sds, int page, int regnu
 	int subpage = RTSDS_SUBPAGE(page);
 	int ret, backsds, value;
 
-	backsds = ctrl->cfg->get_backing_sds(ctrl, sds, page);
+	backsds = ctrl->cfg->get_backing_sds(sds, page);
 	ret = rtsds_rt93xx_io(ctrl, backsds, subpage, regnum, RTSDS_93XX_CMD_READ);
 	if (ret)
 		return ret;
@@ -398,7 +398,7 @@ static int rtsds_93xx_write(struct rtsds_ctrl *ctrl, int sds, int page, int regn
 	int subpage = RTSDS_SUBPAGE(page);
 	int ret, backsds;
 
-	backsds = ctrl->cfg->get_backing_sds(ctrl, sds, page);
+	backsds = ctrl->cfg->get_backing_sds(sds, page);
 	ret = regmap_write(ctrl->map, ctrl->cfg->base + 4, value);
 	if (ret)
 		return ret;



From lede-commits at lists.infradead.org  Mon Dec 15 00:31:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:31:24 -0500
Subject: [openwrt/openwrt]  kernel: rtl836x: remove legacy platform_data
 support
In-Reply-To: <176578748471.4048759.11454430605104105461@git-01.infra.openwrt.org>
References: <176578748471.4048759.11454430605104105461@git-01.infra.openwrt.org>
Message-ID: <mailman.35689.1765787489.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/852d17ed826787039ae1720963a392e964976f76

commit 852d17ed826787039ae1720963a392e964976f76
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Fri Dec 12 08:32:56 2025 +0800

    kernel: rtl836x: remove legacy platform_data support
    
    There are no platform_data based devices using it anymore. Also move
    header files to the driver folder.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21138
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../generic/files/drivers/net/phy/rtl8366_smi.c    | 81 +---------------------
 .../generic/files/drivers/net/phy/rtl8366rb.c      | 14 ++--
 .../linux/generic/files/drivers/net/phy/rtl8366s.c | 27 ++------
 .../linux/generic/files/drivers/net/phy/rtl8367.c  | 37 ++--------
 .../{include/linux => drivers/net/phy}/rtl8367.h   | 11 +--
 .../linux/generic/files/drivers/net/phy/rtl8367b.c | 37 ++--------
 target/linux/generic/files/include/linux/rtl8366.h | 42 -----------
 7 files changed, 24 insertions(+), 225 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
index 89fc04fa64..905283b0c2 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
@@ -16,11 +16,10 @@
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
 #include <linux/of_gpio.h>
-#include <linux/rtl8366.h>
 #include <linux/version.h>
 #include <linux/of_mdio.h>
+#include <linux/platform_device.h>
 
 #ifdef CONFIG_RTL8366_SMI_DEBUG_FS
 #include <linux/debugfs.h>
@@ -1011,13 +1010,8 @@ static inline void rtl8366_debugfs_remove(struct rtl8366_smi *smi) {}
 static int rtl8366_smi_mii_init(struct rtl8366_smi *smi)
 {
 	int ret;
-
-#ifdef CONFIG_OF
 	struct device_node *np = NULL;
 
-	np = of_get_child_by_name(smi->parent->of_node, "mdio-bus");
-#endif
-
 	smi->mii_bus = mdiobus_alloc();
 	if (smi->mii_bus == NULL) {
 		ret = -ENOMEM;
@@ -1033,11 +1027,10 @@ static int rtl8366_smi_mii_init(struct rtl8366_smi *smi)
 	smi->mii_bus->parent = smi->parent;
 	smi->mii_bus->phy_mask = ~(0x1f);
 
-#ifdef CONFIG_OF
+	np = of_get_child_by_name(smi->parent->of_node, "mdio-bus");
 	if (np)
 		ret = of_mdiobus_register(smi->mii_bus, np);
 	else
-#endif
 		ret = mdiobus_register(smi->mii_bus);
 
 	if (ret)
@@ -1412,45 +1405,6 @@ static void __rtl8366_smi_cleanup(struct rtl8366_smi *smi)
 	}
 }
 
-enum rtl8366_type rtl8366_smi_detect(struct rtl8366_platform_data *pdata)
-{
-	static struct rtl8366_smi smi;
-	enum rtl8366_type type = RTL8366_TYPE_UNKNOWN;
-	u32 reg = 0;
-
-	memset(&smi, 0, sizeof(smi));
-	smi.gpio_sda = pdata->gpio_sda;
-	smi.gpio_sck = pdata->gpio_sck;
-	smi.clk_delay = 10;
-	smi.cmd_read  = 0xa9;
-	smi.cmd_write = 0xa8;
-
-	if (__rtl8366_smi_init(&smi, "rtl8366"))
-		goto out;
-
-	if (rtl8366_smi_read_reg(&smi, 0x5c, &reg))
-		goto cleanup;
-
-	switch(reg) {
-	case 0x6027:
-		printk("Found an RTL8366S switch\n");
-		type = RTL8366_TYPE_S;
-		break;
-	case 0x5937:
-		printk("Found an RTL8366RB switch\n");
-		type = RTL8366_TYPE_RB;
-		break;
-	default:
-		printk("Found an Unknown RTL8366 switch (id=0x%04x)\n", reg);
-		break;
-	}
-
-cleanup:
-	__rtl8366_smi_cleanup(&smi);
-out:
-	return type;
-}
-
 int rtl8366_smi_init(struct rtl8366_smi *smi)
 {
 	int err;
@@ -1518,7 +1472,6 @@ void rtl8366_smi_cleanup(struct rtl8366_smi *smi)
 }
 EXPORT_SYMBOL_GPL(rtl8366_smi_cleanup);
 
-#ifdef CONFIG_OF
 static void rtl8366_smi_reset(struct rtl8366_smi *smi, bool active)
 {
 	if (active)
@@ -1570,30 +1523,6 @@ try_gpio:
 
 	return 0;
 }
-#else
-static inline int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
-{
-	return -ENODEV;
-}
-#endif
-
-static int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi)
-{
-	struct rtl8366_platform_data *pdata = pdev->dev.platform_data;
-
-	if (!pdev->dev.platform_data) {
-		dev_err(&pdev->dev, "no platform data specified\n");
-		return -EINVAL;
-	}
-
-	smi->gpio_sda = pdata->gpio_sda;
-	smi->gpio_sck = pdata->gpio_sck;
-	smi->hw_reset = pdata->hw_reset;
-	smi->phy_id = MDC_REALTEK_PHY_ADDR;
-
-	return 0;
-}
-
 
 struct rtl8366_smi *rtl8366_smi_probe(struct platform_device *pdev)
 {
@@ -1604,11 +1533,7 @@ struct rtl8366_smi *rtl8366_smi_probe(struct platform_device *pdev)
 	if (!smi)
 		return NULL;
 
-	if (pdev->dev.of_node)
-		err = rtl8366_smi_probe_of(pdev, smi);
-	else
-		err = rtl8366_smi_probe_plat(pdev, smi);
-
+	err = rtl8366_smi_probe_of(pdev, smi);
 	if (err)
 		goto free_smi;
 
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
index 7057b25252..0f4bbb1f68 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
@@ -16,15 +16,15 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/skbuff.h>
-#include <linux/rtl8366.h>
 
 #include "rtl8366_smi.h"
 
 #define RTL8366RB_DRIVER_DESC	"Realtek RTL8366RB ethernet switch driver"
 #define RTL8366RB_DRIVER_VER	"0.2.4"
+#define RTL8366RB_DRIVER_NAME	"rtl8366rb"
 
 #define RTL8366RB_PHY_NO_MAX	4
 #define RTL8366RB_PHY_PAGE_MAX	7
@@ -285,13 +285,10 @@ static int rtl8366rb_reset_chip(struct rtl8366_smi *smi)
 static int rtl8366rb_setup(struct rtl8366_smi *smi)
 {
 	int err;
-#ifdef CONFIG_OF
 	unsigned i;
-	struct device_node *np;
 	unsigned num_initvals;
 	const __be32 *paddr;
-
-	np = smi->parent->of_node;
+	struct device_node *np = smi->parent->of_node;
 
 	paddr = of_get_property(np, "realtek,initvals", &num_initvals);
 	if (paddr) {
@@ -309,7 +306,6 @@ static int rtl8366rb_setup(struct rtl8366_smi *smi)
 			REG_WR(smi, reg, val);
 		}
 	}
-#endif
 
 	/* set maximum packet length to 1536 bytes */
 	REG_RMW(smi, RTL8366RB_SGCR, RTL8366RB_SGCR_MAX_LENGTH_MASK,
@@ -1490,18 +1486,16 @@ static void rtl8366rb_remove(struct platform_device *pdev)
 	}
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id rtl8366rb_match[] = {
 	{ .compatible = "realtek,rtl8366rb" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, rtl8366rb_match);
-#endif
 
 static struct platform_driver rtl8366rb_driver = {
 	.driver = {
 		.name		= RTL8366RB_DRIVER_NAME,
-		.of_match_table = of_match_ptr(rtl8366rb_match),
+		.of_match_table = rtl8366rb_match,
 	},
 	.probe		= rtl8366rb_probe,
 	.remove_new		= rtl8366rb_remove,
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
index 5458c50487..0b37a4e73c 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
@@ -14,15 +14,15 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/skbuff.h>
-#include <linux/rtl8366.h>
 
 #include "rtl8366_smi.h"
 
 #define RTL8366S_DRIVER_DESC	"Realtek RTL8366S ethernet switch driver"
 #define RTL8366S_DRIVER_VER	"0.2.2"
+#define RTL8366S_DRIVER_NAME	"rtl8366s"
 
 #define RTL8366S_PHY_NO_MAX	4
 #define RTL8366S_PHY_PAGE_MAX	7
@@ -375,25 +375,11 @@ static int rtl8366s_set_green(struct rtl8366_smi *smi, int enable)
 
 static int rtl8366s_setup(struct rtl8366_smi *smi)
 {
-	struct rtl8366_platform_data *pdata;
 	int err;
 	unsigned i;
-#ifdef CONFIG_OF
-	struct device_node *np;
 	unsigned num_initvals;
 	const __be32 *paddr;
-#endif
-
-	pdata = smi->parent->platform_data;
-	if (pdata && pdata->num_initvals && pdata->initvals) {
-		dev_info(smi->parent, "applying initvals\n");
-		for (i = 0; i < pdata->num_initvals; i++)
-			REG_WR(smi, pdata->initvals[i].reg,
-			       pdata->initvals[i].val);
-	}
-
-#ifdef CONFIG_OF
-	np = smi->parent->of_node;
+	struct device_node *np = smi->parent->of_node;
 
 	paddr = of_get_property(np, "realtek,initvals", &num_initvals);
 	if (paddr) {
@@ -425,7 +411,6 @@ static int rtl8366s_setup(struct rtl8366_smi *smi)
 				return err;
 		}
 	}
-#endif
 
 	/* set maximum packet length to 1536 bytes */
 	REG_RMW(smi, RTL8366S_SGCR, RTL8366S_SGCR_MAX_LENGTH_MASK,
@@ -1278,20 +1263,16 @@ static void rtl8366s_remove(struct platform_device *pdev)
 	}
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id rtl8366s_match[] = {
 	{ .compatible = "realtek,rtl8366s" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, rtl8366s_match);
-#endif
 
 static struct platform_driver rtl8366s_driver = {
 	.driver = {
 		.name		= RTL8366S_DRIVER_NAME,
-#ifdef CONFIG_OF
-		.of_match_table = of_match_ptr(rtl8366s_match),
-#endif
+		.of_match_table = rtl8366s_match,
 	},
 	.probe		= rtl8366s_probe,
 	.remove_new	= rtl8366s_remove,
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367.c b/target/linux/generic/files/drivers/net/phy/rtl8367.c
index 1b996019a6..2c11190c01 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8367.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8367.c
@@ -13,11 +13,11 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/skbuff.h>
-#include <linux/rtl8367.h>
 
+#include "rtl8367.h"
 #include "rtl8366_smi.h"
 
 #define RTL8367_RESET_DELAY	1000	/* msecs*/
@@ -1076,7 +1076,6 @@ static int rtl8367_led_blinkrate_set(struct rtl8366_smi *smi, unsigned int rate)
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static int rtl8367_extif_init_of(struct rtl8366_smi *smi,
 				 const char *name)
 {
@@ -1133,40 +1132,20 @@ err_init:
 
 	return err;
 }
-#else
-static int rtl8367_extif_init_of(struct rtl8366_smi *smi,
-				 const char *name)
-{
-	return -EINVAL;
-}
-#endif
 
 static int rtl8367_setup(struct rtl8366_smi *smi)
 {
-	struct rtl8367_platform_data *pdata;
 	int err;
 	int i;
 
-	pdata = smi->parent->platform_data;
-
 	err = rtl8367_init_regs(smi);
 	if (err)
 		return err;
 
 	/* initialize external interfaces */
-	if (smi->parent->of_node) {
-		err = rtl8367_extif_init_of(smi, "realtek,extif");
-		if (err)
-			return err;
-	} else {
-		err = rtl8367_extif_init(smi, 0, pdata->extif0_cfg);
-		if (err)
-			return err;
-
-		err = rtl8367_extif_init(smi, 1, pdata->extif1_cfg);
-		if (err)
-			return err;
-	}
+	err = rtl8367_extif_init_of(smi, "realtek,extif");
+	if (err)
+		return err;
 
 	/* set maximum packet length to 1536 bytes */
 	REG_RMW(smi, RTL8367_SWC0_REG, RTL8367_SWC0_MAX_LENGTH_MASK,
@@ -1821,20 +1800,16 @@ static void rtl8367_shutdown(struct platform_device *pdev)
 		rtl8367_reset_chip(smi);
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id rtl8367_match[] = {
        { .compatible = "realtek,rtl8367" },
        {},
 };
 MODULE_DEVICE_TABLE(of, rtl8367_match);
-#endif
 
 static struct platform_driver rtl8367_driver = {
 	.driver = {
 		.name		= RTL8367_DRIVER_NAME,
-#ifdef CONFIG_OF
-		.of_match_table = of_match_ptr(rtl8367_match),
-#endif
+		.of_match_table = rtl8367_match,
 	},
 	.probe		= rtl8367_probe,
 	.remove_new	= rtl8367_remove,
diff --git a/target/linux/generic/files/include/linux/rtl8367.h b/target/linux/generic/files/drivers/net/phy/rtl8367.h
similarity index 81%
rename from target/linux/generic/files/include/linux/rtl8367.h
rename to target/linux/generic/files/drivers/net/phy/rtl8367.h
index 14150393e2..a32991966c 100644
--- a/target/linux/generic/files/include/linux/rtl8367.h
+++ b/target/linux/generic/files/drivers/net/phy/rtl8367.h
@@ -1,5 +1,5 @@
 /*
- * Platform data definition for the Realtek RTL8367 ethernet switch driver
+ * Realtek RTL8367 ethernet switch driver
  *
  * Copyright (C) 2011 Gabor Juhos <juhosg at openwrt.org>
  *
@@ -51,13 +51,4 @@ struct rtl8367_extif_config {
 	struct rtl8367_port_ability ability;
 };
 
-struct rtl8367_platform_data {
-	unsigned gpio_sda;
-	unsigned gpio_sck;
-	void (*hw_reset)(bool active);
-
-	struct rtl8367_extif_config *extif0_cfg;
-	struct rtl8367_extif_config *extif1_cfg;
-};
-
 #endif /*  _RTL8367_H */
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367b.c b/target/linux/generic/files/drivers/net/phy/rtl8367b.c
index 7bd1d94252..ae309367dc 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8367b.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8367b.c
@@ -15,11 +15,11 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/skbuff.h>
-#include <linux/rtl8367.h>
 
+#include "rtl8367.h"
 #include "rtl8366_smi.h"
 
 #define RTL8367B_RESET_DELAY	1000	/* msecs*/
@@ -765,7 +765,6 @@ static int rtl8367b_extif_init(struct rtl8366_smi *smi, int id,
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static int rtl8367b_extif_init_of(struct rtl8366_smi *smi,
 				  const char *name)
 {
@@ -842,40 +841,20 @@ err_init:
 
 	return err;
 }
-#else
-static int rtl8367b_extif_init_of(struct rtl8366_smi *smi,
-				  const char *name)
-{
-	return -EINVAL;
-}
-#endif
 
 static int rtl8367b_setup(struct rtl8366_smi *smi)
 {
-	struct rtl8367_platform_data *pdata;
 	int err;
 	int i;
 
-	pdata = smi->parent->platform_data;
-
 	err = rtl8367b_init_regs(smi);
 	if (err)
 		return err;
 
 	/* initialize external interfaces */
-	if (smi->parent->of_node) {
-		err = rtl8367b_extif_init_of(smi, "realtek,extif");
-		if (err)
-			return err;
-	} else {
-		err = rtl8367b_extif_init(smi, 0, pdata->extif0_cfg);
-		if (err)
-			return err;
-
-		err = rtl8367b_extif_init(smi, 1, pdata->extif1_cfg);
-		if (err)
-			return err;
-	}
+	err = rtl8367b_extif_init_of(smi, "realtek,extif");
+	if (err)
+		return err;
 
 	/* set maximum packet length to 1536 bytes */
 	REG_RMW(smi, RTL8367B_SWC0_REG, RTL8367B_SWC0_MAX_LENGTH_MASK,
@@ -1619,20 +1598,16 @@ static void rtl8367b_shutdown(struct platform_device *pdev)
 		rtl8367b_reset_chip(smi);
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id rtl8367b_match[] = {
 	{ .compatible = "realtek,rtl8367b" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, rtl8367b_match);
-#endif
 
 static struct platform_driver rtl8367b_driver = {
 	.driver = {
 		.name		= RTL8367B_DRIVER_NAME,
-#ifdef CONFIG_OF
-		.of_match_table = of_match_ptr(rtl8367b_match),
-#endif
+		.of_match_table = rtl8367b_match,
 	},
 	.probe		= rtl8367b_probe,
 	.remove_new	= rtl8367b_remove,
diff --git a/target/linux/generic/files/include/linux/rtl8366.h b/target/linux/generic/files/include/linux/rtl8366.h
deleted file mode 100644
index e3ce8f5361..0000000000
--- a/target/linux/generic/files/include/linux/rtl8366.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Platform data definition for the Realtek RTL8366RB/S ethernet switch driver
- *
- * Copyright (C) 2009-2010 Gabor Juhos <juhosg at openwrt.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- */
-
-#ifndef _RTL8366_H
-#define _RTL8366_H
-
-#define RTL8366_DRIVER_NAME	"rtl8366"
-#define RTL8366S_DRIVER_NAME	"rtl8366s"
-#define RTL8366RB_DRIVER_NAME	"rtl8366rb"
-
-struct rtl8366_smi;
-
-enum rtl8366_type {
-	RTL8366_TYPE_UNKNOWN,
-	RTL8366_TYPE_S,
-	RTL8366_TYPE_RB,
-};
-
-struct rtl8366_initval {
-	unsigned	reg;
-	u16		val;
-};
-
-struct rtl8366_platform_data {
-	unsigned	gpio_sda;
-	unsigned	gpio_sck;
-	void		(*hw_reset)(struct rtl8366_smi *smi, bool active);
-
-	unsigned	num_initvals;
-	struct rtl8366_initval *initvals;
-};
-
-enum rtl8366_type rtl8366_smi_detect(struct rtl8366_platform_data *pdata);
-
-#endif /*  _RTL8366_H */



From lede-commits at lists.infradead.org  Mon Dec 15 00:32:12 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:32:12 -0500
Subject: [openwrt/openwrt]  kernel: rtl836x: remove legacy platform_data
 support
In-Reply-To: <176578753282.4052092.3464135322906290690@git-01.infra.openwrt.org>
References: <176578753282.4052092.3464135322906290690@git-01.infra.openwrt.org>
Message-ID: <mailman.35692.1765787537.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/ec22ac94014274c235728692957169e33f0dbefa

commit ec22ac94014274c235728692957169e33f0dbefa
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Fri Dec 12 08:32:56 2025 +0800

    kernel: rtl836x: remove legacy platform_data support
    
    There are no platform_data based devices using it anymore. Also move
    header files to the driver folder.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21138
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 852d17ed826787039ae1720963a392e964976f76)
---
 .../generic/files/drivers/net/phy/rtl8366_smi.c    | 81 +---------------------
 .../generic/files/drivers/net/phy/rtl8366rb.c      | 14 ++--
 .../linux/generic/files/drivers/net/phy/rtl8366s.c | 27 ++------
 .../linux/generic/files/drivers/net/phy/rtl8367.c  | 37 ++--------
 .../{include/linux => drivers/net/phy}/rtl8367.h   | 11 +--
 .../linux/generic/files/drivers/net/phy/rtl8367b.c | 37 ++--------
 target/linux/generic/files/include/linux/rtl8366.h | 42 -----------
 7 files changed, 24 insertions(+), 225 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
index 89fc04fa64..905283b0c2 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
@@ -16,11 +16,10 @@
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
 #include <linux/of_gpio.h>
-#include <linux/rtl8366.h>
 #include <linux/version.h>
 #include <linux/of_mdio.h>
+#include <linux/platform_device.h>
 
 #ifdef CONFIG_RTL8366_SMI_DEBUG_FS
 #include <linux/debugfs.h>
@@ -1011,13 +1010,8 @@ static inline void rtl8366_debugfs_remove(struct rtl8366_smi *smi) {}
 static int rtl8366_smi_mii_init(struct rtl8366_smi *smi)
 {
 	int ret;
-
-#ifdef CONFIG_OF
 	struct device_node *np = NULL;
 
-	np = of_get_child_by_name(smi->parent->of_node, "mdio-bus");
-#endif
-
 	smi->mii_bus = mdiobus_alloc();
 	if (smi->mii_bus == NULL) {
 		ret = -ENOMEM;
@@ -1033,11 +1027,10 @@ static int rtl8366_smi_mii_init(struct rtl8366_smi *smi)
 	smi->mii_bus->parent = smi->parent;
 	smi->mii_bus->phy_mask = ~(0x1f);
 
-#ifdef CONFIG_OF
+	np = of_get_child_by_name(smi->parent->of_node, "mdio-bus");
 	if (np)
 		ret = of_mdiobus_register(smi->mii_bus, np);
 	else
-#endif
 		ret = mdiobus_register(smi->mii_bus);
 
 	if (ret)
@@ -1412,45 +1405,6 @@ static void __rtl8366_smi_cleanup(struct rtl8366_smi *smi)
 	}
 }
 
-enum rtl8366_type rtl8366_smi_detect(struct rtl8366_platform_data *pdata)
-{
-	static struct rtl8366_smi smi;
-	enum rtl8366_type type = RTL8366_TYPE_UNKNOWN;
-	u32 reg = 0;
-
-	memset(&smi, 0, sizeof(smi));
-	smi.gpio_sda = pdata->gpio_sda;
-	smi.gpio_sck = pdata->gpio_sck;
-	smi.clk_delay = 10;
-	smi.cmd_read  = 0xa9;
-	smi.cmd_write = 0xa8;
-
-	if (__rtl8366_smi_init(&smi, "rtl8366"))
-		goto out;
-
-	if (rtl8366_smi_read_reg(&smi, 0x5c, &reg))
-		goto cleanup;
-
-	switch(reg) {
-	case 0x6027:
-		printk("Found an RTL8366S switch\n");
-		type = RTL8366_TYPE_S;
-		break;
-	case 0x5937:
-		printk("Found an RTL8366RB switch\n");
-		type = RTL8366_TYPE_RB;
-		break;
-	default:
-		printk("Found an Unknown RTL8366 switch (id=0x%04x)\n", reg);
-		break;
-	}
-
-cleanup:
-	__rtl8366_smi_cleanup(&smi);
-out:
-	return type;
-}
-
 int rtl8366_smi_init(struct rtl8366_smi *smi)
 {
 	int err;
@@ -1518,7 +1472,6 @@ void rtl8366_smi_cleanup(struct rtl8366_smi *smi)
 }
 EXPORT_SYMBOL_GPL(rtl8366_smi_cleanup);
 
-#ifdef CONFIG_OF
 static void rtl8366_smi_reset(struct rtl8366_smi *smi, bool active)
 {
 	if (active)
@@ -1570,30 +1523,6 @@ try_gpio:
 
 	return 0;
 }
-#else
-static inline int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
-{
-	return -ENODEV;
-}
-#endif
-
-static int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi)
-{
-	struct rtl8366_platform_data *pdata = pdev->dev.platform_data;
-
-	if (!pdev->dev.platform_data) {
-		dev_err(&pdev->dev, "no platform data specified\n");
-		return -EINVAL;
-	}
-
-	smi->gpio_sda = pdata->gpio_sda;
-	smi->gpio_sck = pdata->gpio_sck;
-	smi->hw_reset = pdata->hw_reset;
-	smi->phy_id = MDC_REALTEK_PHY_ADDR;
-
-	return 0;
-}
-
 
 struct rtl8366_smi *rtl8366_smi_probe(struct platform_device *pdev)
 {
@@ -1604,11 +1533,7 @@ struct rtl8366_smi *rtl8366_smi_probe(struct platform_device *pdev)
 	if (!smi)
 		return NULL;
 
-	if (pdev->dev.of_node)
-		err = rtl8366_smi_probe_of(pdev, smi);
-	else
-		err = rtl8366_smi_probe_plat(pdev, smi);
-
+	err = rtl8366_smi_probe_of(pdev, smi);
 	if (err)
 		goto free_smi;
 
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
index 7057b25252..0f4bbb1f68 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
@@ -16,15 +16,15 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/skbuff.h>
-#include <linux/rtl8366.h>
 
 #include "rtl8366_smi.h"
 
 #define RTL8366RB_DRIVER_DESC	"Realtek RTL8366RB ethernet switch driver"
 #define RTL8366RB_DRIVER_VER	"0.2.4"
+#define RTL8366RB_DRIVER_NAME	"rtl8366rb"
 
 #define RTL8366RB_PHY_NO_MAX	4
 #define RTL8366RB_PHY_PAGE_MAX	7
@@ -285,13 +285,10 @@ static int rtl8366rb_reset_chip(struct rtl8366_smi *smi)
 static int rtl8366rb_setup(struct rtl8366_smi *smi)
 {
 	int err;
-#ifdef CONFIG_OF
 	unsigned i;
-	struct device_node *np;
 	unsigned num_initvals;
 	const __be32 *paddr;
-
-	np = smi->parent->of_node;
+	struct device_node *np = smi->parent->of_node;
 
 	paddr = of_get_property(np, "realtek,initvals", &num_initvals);
 	if (paddr) {
@@ -309,7 +306,6 @@ static int rtl8366rb_setup(struct rtl8366_smi *smi)
 			REG_WR(smi, reg, val);
 		}
 	}
-#endif
 
 	/* set maximum packet length to 1536 bytes */
 	REG_RMW(smi, RTL8366RB_SGCR, RTL8366RB_SGCR_MAX_LENGTH_MASK,
@@ -1490,18 +1486,16 @@ static void rtl8366rb_remove(struct platform_device *pdev)
 	}
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id rtl8366rb_match[] = {
 	{ .compatible = "realtek,rtl8366rb" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, rtl8366rb_match);
-#endif
 
 static struct platform_driver rtl8366rb_driver = {
 	.driver = {
 		.name		= RTL8366RB_DRIVER_NAME,
-		.of_match_table = of_match_ptr(rtl8366rb_match),
+		.of_match_table = rtl8366rb_match,
 	},
 	.probe		= rtl8366rb_probe,
 	.remove_new		= rtl8366rb_remove,
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
index 5458c50487..0b37a4e73c 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
@@ -14,15 +14,15 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/skbuff.h>
-#include <linux/rtl8366.h>
 
 #include "rtl8366_smi.h"
 
 #define RTL8366S_DRIVER_DESC	"Realtek RTL8366S ethernet switch driver"
 #define RTL8366S_DRIVER_VER	"0.2.2"
+#define RTL8366S_DRIVER_NAME	"rtl8366s"
 
 #define RTL8366S_PHY_NO_MAX	4
 #define RTL8366S_PHY_PAGE_MAX	7
@@ -375,25 +375,11 @@ static int rtl8366s_set_green(struct rtl8366_smi *smi, int enable)
 
 static int rtl8366s_setup(struct rtl8366_smi *smi)
 {
-	struct rtl8366_platform_data *pdata;
 	int err;
 	unsigned i;
-#ifdef CONFIG_OF
-	struct device_node *np;
 	unsigned num_initvals;
 	const __be32 *paddr;
-#endif
-
-	pdata = smi->parent->platform_data;
-	if (pdata && pdata->num_initvals && pdata->initvals) {
-		dev_info(smi->parent, "applying initvals\n");
-		for (i = 0; i < pdata->num_initvals; i++)
-			REG_WR(smi, pdata->initvals[i].reg,
-			       pdata->initvals[i].val);
-	}
-
-#ifdef CONFIG_OF
-	np = smi->parent->of_node;
+	struct device_node *np = smi->parent->of_node;
 
 	paddr = of_get_property(np, "realtek,initvals", &num_initvals);
 	if (paddr) {
@@ -425,7 +411,6 @@ static int rtl8366s_setup(struct rtl8366_smi *smi)
 				return err;
 		}
 	}
-#endif
 
 	/* set maximum packet length to 1536 bytes */
 	REG_RMW(smi, RTL8366S_SGCR, RTL8366S_SGCR_MAX_LENGTH_MASK,
@@ -1278,20 +1263,16 @@ static void rtl8366s_remove(struct platform_device *pdev)
 	}
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id rtl8366s_match[] = {
 	{ .compatible = "realtek,rtl8366s" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, rtl8366s_match);
-#endif
 
 static struct platform_driver rtl8366s_driver = {
 	.driver = {
 		.name		= RTL8366S_DRIVER_NAME,
-#ifdef CONFIG_OF
-		.of_match_table = of_match_ptr(rtl8366s_match),
-#endif
+		.of_match_table = rtl8366s_match,
 	},
 	.probe		= rtl8366s_probe,
 	.remove_new	= rtl8366s_remove,
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367.c b/target/linux/generic/files/drivers/net/phy/rtl8367.c
index 1b996019a6..2c11190c01 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8367.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8367.c
@@ -13,11 +13,11 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/skbuff.h>
-#include <linux/rtl8367.h>
 
+#include "rtl8367.h"
 #include "rtl8366_smi.h"
 
 #define RTL8367_RESET_DELAY	1000	/* msecs*/
@@ -1076,7 +1076,6 @@ static int rtl8367_led_blinkrate_set(struct rtl8366_smi *smi, unsigned int rate)
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static int rtl8367_extif_init_of(struct rtl8366_smi *smi,
 				 const char *name)
 {
@@ -1133,40 +1132,20 @@ err_init:
 
 	return err;
 }
-#else
-static int rtl8367_extif_init_of(struct rtl8366_smi *smi,
-				 const char *name)
-{
-	return -EINVAL;
-}
-#endif
 
 static int rtl8367_setup(struct rtl8366_smi *smi)
 {
-	struct rtl8367_platform_data *pdata;
 	int err;
 	int i;
 
-	pdata = smi->parent->platform_data;
-
 	err = rtl8367_init_regs(smi);
 	if (err)
 		return err;
 
 	/* initialize external interfaces */
-	if (smi->parent->of_node) {
-		err = rtl8367_extif_init_of(smi, "realtek,extif");
-		if (err)
-			return err;
-	} else {
-		err = rtl8367_extif_init(smi, 0, pdata->extif0_cfg);
-		if (err)
-			return err;
-
-		err = rtl8367_extif_init(smi, 1, pdata->extif1_cfg);
-		if (err)
-			return err;
-	}
+	err = rtl8367_extif_init_of(smi, "realtek,extif");
+	if (err)
+		return err;
 
 	/* set maximum packet length to 1536 bytes */
 	REG_RMW(smi, RTL8367_SWC0_REG, RTL8367_SWC0_MAX_LENGTH_MASK,
@@ -1821,20 +1800,16 @@ static void rtl8367_shutdown(struct platform_device *pdev)
 		rtl8367_reset_chip(smi);
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id rtl8367_match[] = {
        { .compatible = "realtek,rtl8367" },
        {},
 };
 MODULE_DEVICE_TABLE(of, rtl8367_match);
-#endif
 
 static struct platform_driver rtl8367_driver = {
 	.driver = {
 		.name		= RTL8367_DRIVER_NAME,
-#ifdef CONFIG_OF
-		.of_match_table = of_match_ptr(rtl8367_match),
-#endif
+		.of_match_table = rtl8367_match,
 	},
 	.probe		= rtl8367_probe,
 	.remove_new	= rtl8367_remove,
diff --git a/target/linux/generic/files/include/linux/rtl8367.h b/target/linux/generic/files/drivers/net/phy/rtl8367.h
similarity index 81%
rename from target/linux/generic/files/include/linux/rtl8367.h
rename to target/linux/generic/files/drivers/net/phy/rtl8367.h
index 14150393e2..a32991966c 100644
--- a/target/linux/generic/files/include/linux/rtl8367.h
+++ b/target/linux/generic/files/drivers/net/phy/rtl8367.h
@@ -1,5 +1,5 @@
 /*
- * Platform data definition for the Realtek RTL8367 ethernet switch driver
+ * Realtek RTL8367 ethernet switch driver
  *
  * Copyright (C) 2011 Gabor Juhos <juhosg at openwrt.org>
  *
@@ -51,13 +51,4 @@ struct rtl8367_extif_config {
 	struct rtl8367_port_ability ability;
 };
 
-struct rtl8367_platform_data {
-	unsigned gpio_sda;
-	unsigned gpio_sck;
-	void (*hw_reset)(bool active);
-
-	struct rtl8367_extif_config *extif0_cfg;
-	struct rtl8367_extif_config *extif1_cfg;
-};
-
 #endif /*  _RTL8367_H */
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367b.c b/target/linux/generic/files/drivers/net/phy/rtl8367b.c
index 7bd1d94252..ae309367dc 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8367b.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8367b.c
@@ -15,11 +15,11 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/skbuff.h>
-#include <linux/rtl8367.h>
 
+#include "rtl8367.h"
 #include "rtl8366_smi.h"
 
 #define RTL8367B_RESET_DELAY	1000	/* msecs*/
@@ -765,7 +765,6 @@ static int rtl8367b_extif_init(struct rtl8366_smi *smi, int id,
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static int rtl8367b_extif_init_of(struct rtl8366_smi *smi,
 				  const char *name)
 {
@@ -842,40 +841,20 @@ err_init:
 
 	return err;
 }
-#else
-static int rtl8367b_extif_init_of(struct rtl8366_smi *smi,
-				  const char *name)
-{
-	return -EINVAL;
-}
-#endif
 
 static int rtl8367b_setup(struct rtl8366_smi *smi)
 {
-	struct rtl8367_platform_data *pdata;
 	int err;
 	int i;
 
-	pdata = smi->parent->platform_data;
-
 	err = rtl8367b_init_regs(smi);
 	if (err)
 		return err;
 
 	/* initialize external interfaces */
-	if (smi->parent->of_node) {
-		err = rtl8367b_extif_init_of(smi, "realtek,extif");
-		if (err)
-			return err;
-	} else {
-		err = rtl8367b_extif_init(smi, 0, pdata->extif0_cfg);
-		if (err)
-			return err;
-
-		err = rtl8367b_extif_init(smi, 1, pdata->extif1_cfg);
-		if (err)
-			return err;
-	}
+	err = rtl8367b_extif_init_of(smi, "realtek,extif");
+	if (err)
+		return err;
 
 	/* set maximum packet length to 1536 bytes */
 	REG_RMW(smi, RTL8367B_SWC0_REG, RTL8367B_SWC0_MAX_LENGTH_MASK,
@@ -1619,20 +1598,16 @@ static void rtl8367b_shutdown(struct platform_device *pdev)
 		rtl8367b_reset_chip(smi);
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id rtl8367b_match[] = {
 	{ .compatible = "realtek,rtl8367b" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, rtl8367b_match);
-#endif
 
 static struct platform_driver rtl8367b_driver = {
 	.driver = {
 		.name		= RTL8367B_DRIVER_NAME,
-#ifdef CONFIG_OF
-		.of_match_table = of_match_ptr(rtl8367b_match),
-#endif
+		.of_match_table = rtl8367b_match,
 	},
 	.probe		= rtl8367b_probe,
 	.remove_new	= rtl8367b_remove,
diff --git a/target/linux/generic/files/include/linux/rtl8366.h b/target/linux/generic/files/include/linux/rtl8366.h
deleted file mode 100644
index e3ce8f5361..0000000000
--- a/target/linux/generic/files/include/linux/rtl8366.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Platform data definition for the Realtek RTL8366RB/S ethernet switch driver
- *
- * Copyright (C) 2009-2010 Gabor Juhos <juhosg at openwrt.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- */
-
-#ifndef _RTL8366_H
-#define _RTL8366_H
-
-#define RTL8366_DRIVER_NAME	"rtl8366"
-#define RTL8366S_DRIVER_NAME	"rtl8366s"
-#define RTL8366RB_DRIVER_NAME	"rtl8366rb"
-
-struct rtl8366_smi;
-
-enum rtl8366_type {
-	RTL8366_TYPE_UNKNOWN,
-	RTL8366_TYPE_S,
-	RTL8366_TYPE_RB,
-};
-
-struct rtl8366_initval {
-	unsigned	reg;
-	u16		val;
-};
-
-struct rtl8366_platform_data {
-	unsigned	gpio_sda;
-	unsigned	gpio_sck;
-	void		(*hw_reset)(struct rtl8366_smi *smi, bool active);
-
-	unsigned	num_initvals;
-	struct rtl8366_initval *initvals;
-};
-
-enum rtl8366_type rtl8366_smi_detect(struct rtl8366_platform_data *pdata);
-
-#endif /*  _RTL8366_H */



From lede-commits at lists.infradead.org  Mon Dec 15 00:55:59 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:55:59 -0500
Subject: [openwrt/openwrt]  ipq-wifi: update to Git HEAD (2025-12-15)
In-Reply-To: <176578895901.4138597.4731290836017143420@git-01.infra.openwrt.org>
References: <176578895901.4138597.4731290836017143420@git-01.infra.openwrt.org>
Message-ID: <mailman.35707.1765788962.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b4bc9ed318ba8c8652b9273377cbf331ad279182

commit b4bc9ed318ba8c8652b9273377cbf331ad279182
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Mon Dec 15 09:54:23 2025 +0100

    ipq-wifi: update to Git HEAD (2025-12-15)
    
    c6202981872e ipq5018: use correct board for GL-iNet B3000 IPQ5018 radio
    ec72376cadf1 qca4019: Add Meraki Underdog
    059b7114c77b ipq6018: add tp-link eap620hd v2
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/firmware/ipq-wifi/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 47b2f8788b..ce4fc26541 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -6,9 +6,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
-PKG_SOURCE_DATE:=2025-11-15
-PKG_SOURCE_VERSION:=7c6b7545f69a3ef3ddaaff68fc97e9e172117e2e
-PKG_MIRROR_HASH:=ac77840bafd111b3cc3d6cfc7a3b770fdaabb929209c38cd2109be2efd575dae
+PKG_SOURCE_DATE:=2025-12-15
+PKG_SOURCE_VERSION:=059b7114c77b861b05784b07f0fa129c2591d171
+PKG_MIRROR_HASH:=6a717318ccf0e16cda89f96c79df6bcf754b291e249495f0e8b618da9b5be709
 PKG_FLAGS:=nonshared
 
 include $(INCLUDE_DIR)/package.mk



From lede-commits at lists.infradead.org  Mon Dec 15 00:56:33 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 03:56:33 -0500
Subject: [openwrt/openwrt]  ipq-wifi: update to Git HEAD (2025-12-15)
In-Reply-To: <176578899300.4140723.11755489164194723433@git-01.infra.openwrt.org>
References: <176578899300.4140723.11755489164194723433@git-01.infra.openwrt.org>
Message-ID: <mailman.35708.1765789001.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/87fd61bd029b1452dbba208f1153d0d9f8c2c87e

commit 87fd61bd029b1452dbba208f1153d0d9f8c2c87e
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Mon Dec 15 09:54:23 2025 +0100

    ipq-wifi: update to Git HEAD (2025-12-15)
    
    c6202981872e ipq5018: use correct board for GL-iNet B3000 IPQ5018 radio
    ec72376cadf1 qca4019: Add Meraki Underdog
    059b7114c77b ipq6018: add tp-link eap620hd v2
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit b4bc9ed318ba8c8652b9273377cbf331ad279182)
---
 package/firmware/ipq-wifi/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 47b2f8788b..ce4fc26541 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -6,9 +6,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
-PKG_SOURCE_DATE:=2025-11-15
-PKG_SOURCE_VERSION:=7c6b7545f69a3ef3ddaaff68fc97e9e172117e2e
-PKG_MIRROR_HASH:=ac77840bafd111b3cc3d6cfc7a3b770fdaabb929209c38cd2109be2efd575dae
+PKG_SOURCE_DATE:=2025-12-15
+PKG_SOURCE_VERSION:=059b7114c77b861b05784b07f0fa129c2591d171
+PKG_MIRROR_HASH:=6a717318ccf0e16cda89f96c79df6bcf754b291e249495f0e8b618da9b5be709
 PKG_FLAGS:=nonshared
 
 include $(INCLUDE_DIR)/package.mk



From lede-commits at lists.infradead.org  Mon Dec 15 03:30:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 06:30:20 -0500
Subject: [openwrt/openwrt]  wifi-scripts: add support for using list for iface
 in wifi-station/vlan
In-Reply-To: <176579821993.475078.1786174324576446486@git-01.infra.openwrt.org>
References: <176579821993.475078.1786174324576446486@git-01.infra.openwrt.org>
Message-ID: <mailman.35781.1765798227.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1ead4e6e16e869397456318e4e1fa177ea325cee

commit 1ead4e6e16e869397456318e4e1fa177ea325cee
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Sat Nov 29 00:04:09 2025 +0000

    wifi-scripts: add support for using list for iface in wifi-station/vlan
    
    This is a trivial change to allow users to use 'list' on iface.
    Old wifi-scripts already implements this, so this just ensures
    that shell-based and ucode wifi-scripts are on-par with each other.
    
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/20977
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/config/wifi-scripts/files/lib/netifd/wireless.uc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
index ad935ce414..cb505a9eb8 100644
--- a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
+++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
@@ -192,8 +192,9 @@ function config_init(uci)
 	}
 
 	for (let name, data in sections.vlan) {
+		let ifaces = parse_array(data.iface);
 		for (let iface, iface_vifs in vifs) {
-			if (data.iface && data.iface != iface)
+			if (length(ifaces) && index(ifaces, iface) < 0)
 				continue;
 
 			for (let vif in iface_vifs) {
@@ -214,8 +215,9 @@ function config_init(uci)
 	}
 
 	for (let name, data in sections.station) {
+		let ifaces = parse_array(data.iface);
 		for (let iface, iface_vifs in vifs) {
-			if (data.iface && data.iface != iface)
+			if (length(ifaces) && index(ifaces, iface) < 0)
 				continue;
 
 			for (let vif in iface_vifs) {



From lede-commits at lists.infradead.org  Mon Dec 15 03:30:19 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 06:30:19 -0500
Subject: [openwrt/openwrt]  wifi-scripts: fix broken match all case for
 wifi-vlan
In-Reply-To: <176579821993.475078.1786174324576446486@git-01.infra.openwrt.org>
References: <176579821993.475078.1786174324576446486@git-01.infra.openwrt.org>
Message-ID: <mailman.35784.1765798229.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/211b11a56e6e6a45d2e3a2a733e78f3e9dd14a16

commit 211b11a56e6e6a45d2e3a2a733e78f3e9dd14a16
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Sat Nov 29 12:37:22 2025 +0200

    wifi-scripts: fix broken match all case for wifi-vlan
    
    When iface is omitted, wifi-vlan will apply to all interfaces.
    However, netifd.set_vlan call is not successful as it assumes
    that every wifi-vlan section corresponds to one VIF.
    
    For this reason in the wifi-vlan case (cur_type == "vlan")
    we create a composite key in the form `${vif.name}/${vlan.name}`
    allowing the same vlan section to correspond to multiple VAPs.
    `/` was decided as a delimiter as it is an invalid character
    for a network interface name and UCI identifier; so it is
    impossible for it to cause conflicts.
    
    It was verified that the `ubus call network.wireless status`
    works as expected with this change. Moreover, wifi-station
    is not susceptible to this problem.
    
    This also means that it is now possible for wifi-vlan
    to support `list` iface similar to old shell-based wifi-scripts.
    This will be done in a follow-up commit.
    
    Fixes: 98435a37a7 ("wifi-scripts: iface should be optional in wifi-vlan definition")
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/20977
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../wifi-scripts/files/lib/netifd/wireless-device.uc     | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc
index cccb6c9c8c..428db6ee6a 100644
--- a/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc
+++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc
@@ -488,7 +488,11 @@ function wdev_set_data(wdev, vif, vlan, data)
 		cur_type = "vlan";
 	}
 
-	wdev.handler_data[cur.name] = {
+	let key = cur.name;
+	if (cur_type == "vlan")
+		key = vif.name + "/" + vlan.name;
+
+	wdev.handler_data[key] = {
 		...cur,
 		...data,
 		type: cur_type,
@@ -545,9 +549,13 @@ function hotplug(name, add)
 	}
 }
 
-function get_status_data(wdev, vif)
+function get_status_data(wdev, vif, parent_vif)
 {
-	let hdata = wdev.handler_data[vif.name];
+	let key = vif.name;
+	if (parent_vif)
+		key = parent_vif.name + "/" + vif.name;
+
+	let hdata = wdev.handler_data[key];
 	let data = {
 		section: vif.name,
 		config: vif.config
@@ -561,7 +569,7 @@ function get_status_vlans(wdev, vif)
 {
 	let vlans = [];
 	for (let vlan in vif.vlan)
-		push(vlans, get_status_data(wdev, vlan));
+		push(vlans, get_status_data(wdev, vlan, vif));
 	return vlans;
 }
 



From lede-commits at lists.infradead.org  Mon Dec 15 03:31:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 06:31:18 -0500
Subject: [openwrt/openwrt]  wifi-scripts: add support for using list for iface
 in wifi-station/vlan
In-Reply-To: <176579827798.478287.10844705173445385594@git-01.infra.openwrt.org>
References: <176579827798.478287.10844705173445385594@git-01.infra.openwrt.org>
Message-ID: <mailman.35785.1765798282.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/c743099fe1af383cf70e25080d6ab1b1744285b0

commit c743099fe1af383cf70e25080d6ab1b1744285b0
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Sat Nov 29 00:04:09 2025 +0000

    wifi-scripts: add support for using list for iface in wifi-station/vlan
    
    This is a trivial change to allow users to use 'list' on iface.
    Old wifi-scripts already implements this, so this just ensures
    that shell-based and ucode wifi-scripts are on-par with each other.
    
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/20977
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 1ead4e6e16e869397456318e4e1fa177ea325cee)
---
 package/network/config/wifi-scripts/files/lib/netifd/wireless.uc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
index ad935ce414..cb505a9eb8 100644
--- a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
+++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
@@ -192,8 +192,9 @@ function config_init(uci)
 	}
 
 	for (let name, data in sections.vlan) {
+		let ifaces = parse_array(data.iface);
 		for (let iface, iface_vifs in vifs) {
-			if (data.iface && data.iface != iface)
+			if (length(ifaces) && index(ifaces, iface) < 0)
 				continue;
 
 			for (let vif in iface_vifs) {
@@ -214,8 +215,9 @@ function config_init(uci)
 	}
 
 	for (let name, data in sections.station) {
+		let ifaces = parse_array(data.iface);
 		for (let iface, iface_vifs in vifs) {
-			if (data.iface && data.iface != iface)
+			if (length(ifaces) && index(ifaces, iface) < 0)
 				continue;
 
 			for (let vif in iface_vifs) {



From lede-commits at lists.infradead.org  Mon Dec 15 03:31:17 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 06:31:17 -0500
Subject: [openwrt/openwrt]  wifi-scripts: fix broken match all case for
 wifi-vlan
In-Reply-To: <176579827798.478287.10844705173445385594@git-01.infra.openwrt.org>
References: <176579827798.478287.10844705173445385594@git-01.infra.openwrt.org>
Message-ID: <mailman.35786.1765798283.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/b13c6a732a7d289a05d53aa1d7f6ef2aebfeb8e5

commit b13c6a732a7d289a05d53aa1d7f6ef2aebfeb8e5
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Sat Nov 29 12:37:22 2025 +0200

    wifi-scripts: fix broken match all case for wifi-vlan
    
    When iface is omitted, wifi-vlan will apply to all interfaces.
    However, netifd.set_vlan call is not successful as it assumes
    that every wifi-vlan section corresponds to one VIF.
    
    For this reason in the wifi-vlan case (cur_type == "vlan")
    we create a composite key in the form `${vif.name}/${vlan.name}`
    allowing the same vlan section to correspond to multiple VAPs.
    `/` was decided as a delimiter as it is an invalid character
    for a network interface name and UCI identifier; so it is
    impossible for it to cause conflicts.
    
    It was verified that the `ubus call network.wireless status`
    works as expected with this change. Moreover, wifi-station
    is not susceptible to this problem.
    
    This also means that it is now possible for wifi-vlan
    to support `list` iface similar to old shell-based wifi-scripts.
    This will be done in a follow-up commit.
    
    Fixes: 98435a37a7 ("wifi-scripts: iface should be optional in wifi-vlan definition")
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/20977
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 211b11a56e6e6a45d2e3a2a733e78f3e9dd14a16)
---
 .../wifi-scripts/files/lib/netifd/wireless-device.uc     | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc
index cccb6c9c8c..428db6ee6a 100644
--- a/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc
+++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc
@@ -488,7 +488,11 @@ function wdev_set_data(wdev, vif, vlan, data)
 		cur_type = "vlan";
 	}
 
-	wdev.handler_data[cur.name] = {
+	let key = cur.name;
+	if (cur_type == "vlan")
+		key = vif.name + "/" + vlan.name;
+
+	wdev.handler_data[key] = {
 		...cur,
 		...data,
 		type: cur_type,
@@ -545,9 +549,13 @@ function hotplug(name, add)
 	}
 }
 
-function get_status_data(wdev, vif)
+function get_status_data(wdev, vif, parent_vif)
 {
-	let hdata = wdev.handler_data[vif.name];
+	let key = vif.name;
+	if (parent_vif)
+		key = parent_vif.name + "/" + vif.name;
+
+	let hdata = wdev.handler_data[key];
 	let data = {
 		section: vif.name,
 		config: vif.config
@@ -561,7 +569,7 @@ function get_status_vlans(wdev, vif)
 {
 	let vlans = [];
 	for (let vlan in vif.vlan)
-		push(vlans, get_status_data(wdev, vlan));
+		push(vlans, get_status_data(wdev, vlan, vif));
 	return vlans;
 }
 



From lede-commits at lists.infradead.org  Mon Dec 15 03:39:17 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 06:39:17 -0500
Subject: [openwrt/openwrt]  wifi-scripts: ucode: improve formatting of
 expected throughput
In-Reply-To: <176579875707.501526.16156296705042948215@git-01.infra.openwrt.org>
References: <176579875707.501526.16156296705042948215@git-01.infra.openwrt.org>
Message-ID: <mailman.35791.1765798761.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/36da03a6c16b6e6c0d16b1471635647e46028ebc

commit 36da03a6c16b6e6c0d16b1471635647e46028ebc
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Mon Oct 27 16:14:22 2025 +0000

    wifi-scripts: ucode: improve formatting of expected throughput
    
    Convert to MBit/s like all other fields and specify the unit.
    Most users probably aren't aware that this is in kilobits/s.
    
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/20567
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo      | 3 ++-
 .../config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc       | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo b/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo
index a1290ac201..d36268b06e 100755
--- a/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo
+++ b/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo
@@ -25,7 +25,8 @@ function print_assoclist(stations) {
 				printf(', %s', flags);
 			printf('%10d Pkts.\n', bitrate.packets);
 		}
-		printf(`\texpected throughput: ${station.expected_throughput}\n\n`);
+		let expected_throughput = station.expected_throughput;
+		printf(`\texpected throughput: ${expected_throughput == 'unknown' ? 'unknown' : expected_throughput + ' MBit/s'}\n\n`);
 	}
 }
 
diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
index 21244089ab..b2eb8cfd10 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
@@ -169,6 +169,10 @@ function format_rate(rate) {
 	return rate ? sprintf('%.01f', rate / 10.0) : 'unknown';
 }
 
+function format_expected_throughput(rate) {
+	return rate ? sprintf('%.01f', rate / 1000.0) : 'unknown';
+}
+
 function format_mgmt_key(key) {
 	switch(+key) {
 	case 1:
@@ -352,7 +356,7 @@ export function assoclist(dev) {
 				packets: station.sta_info.tx_packets ?? 0,
 				flags: assoc_flags(station.sta_info.tx_bitrate ?? {}),
 			},
-			expected_throughput: station.sta_info.expected_throughput ?? 'unknown',
+			expected_throughput: format_expected_throughput(station.sta_info.expected_throughput ?? 0),
 		};
 		ret[sta.mac] = sta;
 	}



From lede-commits at lists.infradead.org  Mon Dec 15 03:39:59 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 06:39:59 -0500
Subject: [openwrt/openwrt]  wifi-scripts: ucode: improve formatting of
 expected throughput
In-Reply-To: <176579879949.504142.7496450073426911076@git-01.infra.openwrt.org>
References: <176579879949.504142.7496450073426911076@git-01.infra.openwrt.org>
Message-ID: <mailman.35792.1765798804.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/7c4da36cf2c601d28a4637b453a44e86d5094be8

commit 7c4da36cf2c601d28a4637b453a44e86d5094be8
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Mon Oct 27 16:14:22 2025 +0000

    wifi-scripts: ucode: improve formatting of expected throughput
    
    Convert to MBit/s like all other fields and specify the unit.
    Most users probably aren't aware that this is in kilobits/s.
    
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/20567
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 36da03a6c16b6e6c0d16b1471635647e46028ebc)
---
 package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo      | 3 ++-
 .../config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc       | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo b/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo
index a1290ac201..d36268b06e 100755
--- a/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo
+++ b/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo
@@ -25,7 +25,8 @@ function print_assoclist(stations) {
 				printf(', %s', flags);
 			printf('%10d Pkts.\n', bitrate.packets);
 		}
-		printf(`\texpected throughput: ${station.expected_throughput}\n\n`);
+		let expected_throughput = station.expected_throughput;
+		printf(`\texpected throughput: ${expected_throughput == 'unknown' ? 'unknown' : expected_throughput + ' MBit/s'}\n\n`);
 	}
 }
 
diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
index 21244089ab..b2eb8cfd10 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
@@ -169,6 +169,10 @@ function format_rate(rate) {
 	return rate ? sprintf('%.01f', rate / 10.0) : 'unknown';
 }
 
+function format_expected_throughput(rate) {
+	return rate ? sprintf('%.01f', rate / 1000.0) : 'unknown';
+}
+
 function format_mgmt_key(key) {
 	switch(+key) {
 	case 1:
@@ -352,7 +356,7 @@ export function assoclist(dev) {
 				packets: station.sta_info.tx_packets ?? 0,
 				flags: assoc_flags(station.sta_info.tx_bitrate ?? {}),
 			},
-			expected_throughput: station.sta_info.expected_throughput ?? 'unknown',
+			expected_throughput: format_expected_throughput(station.sta_info.expected_throughput ?? 0),
 		};
 		ret[sta.mac] = sta;
 	}



From lede-commits at lists.infradead.org  Mon Dec 15 10:26:04 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 13:26:04 -0500
Subject: [openwrt/openwrt]  dropbear: enable configurable port forwarding
 options
In-Reply-To: <176582316424.1616724.5414142939341360973@git-01.infra.openwrt.org>
References: <176582316424.1616724.5414142939341360973@git-01.infra.openwrt.org>
Message-ID: <mailman.36029.1765823170.2093109.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/3c97c4a44cbeb767281f3260c1f6da4772432807

commit 3c97c4a44cbeb767281f3260c1f6da4772432807
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Sat Dec 6 18:34:37 2025 +0000

    dropbear: enable configurable port forwarding options
    
    Currently its only possible to disable port forwarding only for specific
    keys, via the OpenSSH-style restriction in `authorized_keys` file.
    
    In some use cases it might be feasible to disable such features globally
    on service level, so lets add new LocalPortForward and RemotePortForward
    config knobs.
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
    Link: https://github.com/openwrt/openwrt/pull/21071
    (cherry picked from commit 83f6177dbf44fa92ecf6d2e1cda9f92cfc5fe849)
    [ fix conflict error ]
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/network/services/dropbear/files/dropbear.config | 2 ++
 package/network/services/dropbear/files/dropbear.init   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/package/network/services/dropbear/files/dropbear.config b/package/network/services/dropbear/files/dropbear.config
index 7eb5975449..7957cd6a49 100644
--- a/package/network/services/dropbear/files/dropbear.config
+++ b/package/network/services/dropbear/files/dropbear.config
@@ -5,3 +5,5 @@ config dropbear main
 	option RootPasswordAuth 'on'
 	option Port         '22'
 #	option BannerFile   '/etc/banner'
+#	option LocalPortForward 'off'
+#	option RemotePortForward 'off'
diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init
index 395237f9bc..6e45a55a64 100755
--- a/package/network/services/dropbear/files/dropbear.init
+++ b/package/network/services/dropbear/files/dropbear.init
@@ -179,6 +179,8 @@ validate_section_dropbear()
 		'IdleTimeout:uinteger:0' \
 		'MaxAuthTries:uinteger:3' \
 		'RecvWindowSize:uinteger:262144' \
+		'LocalPortForward:bool:1' \
+		'RemotePortForward:bool:1' \
 		'mdns:bool:1'
 }
 
@@ -319,6 +321,8 @@ dropbear_instance()
 	fi
 	[ "${PasswordAuth}" -eq 0 ] && procd_append_param command -s
 	[ "${GatewayPorts}" -eq 1 ] && procd_append_param command -a
+	[ "${LocalPortForward}" -eq 0 ] && procd_append_param command -j
+	[ "${RemotePortForward}" -eq 0 ] && procd_append_param command -k
 	[ -n "${ForceCommand}" ] && procd_append_param command -c "${ForceCommand}"
 	[ "${RootPasswordAuth}" -eq 0 ] && procd_append_param command -g
 	[ "${RootLogin}" -eq 0 ] && procd_append_param command -w



From lede-commits at lists.infradead.org  Mon Dec 15 15:10:32 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 18:10:32 -0500
Subject: [openwrt/openwrt]  kernel: Fix boot of realtek rtl838x
In-Reply-To: <176584023244.2181282.8835274302107549545@git-01.infra.openwrt.org>
References: <176584023244.2181282.8835274302107549545@git-01.infra.openwrt.org>
Message-ID: <mailman.36082.1765840237.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/b8d232d9dca82078b89f3a18da434cfbae641f2b

commit b8d232d9dca82078b89f3a18da434cfbae641f2b
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 15 02:02:35 2025 +0100

    kernel: Fix boot of realtek rtl838x
    
    Revert two patches from upstream Linux:
    https://github.com/gregkh/linux/commit/135713cd0751bf296e515f5fdec234320f73bbd8
    https://github.com/gregkh/linux/commit/231ac951fabae2aaed8b2c00b4a097107be49c8c
    
    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 at hauke-m.de/T/#u
    
    Link: https://github.com/openwrt/openwrt/pull/21166
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch |  60 +++++++++
 ...-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch | 146 +++++++++++++++++++++
 2 files changed, 206 insertions(+)

diff --git a/target/linux/generic/pending-6.6/360-Revert-MIPS-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch b/target/linux/generic/pending-6.6/360-Revert-MIPS-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch
new file mode 100644
index 0000000000..1b53919a0c
--- /dev/null
+++ b/target/linux/generic/pending-6.6/360-Revert-MIPS-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch
@@ -0,0 +1,60 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Mon, 15 Dec 2025 01:45:07 +0100
+Subject: Revert "MIPS: mm: kmalloc tlb_vpn array to avoid stack overflow"
+
+This reverts commit 231ac951fabae2aaed8b2c00b4a097107be49c8c.
+---
+ arch/mips/mm/tlb-r4k.c | 18 ++----------------
+ 1 file changed, 2 insertions(+), 16 deletions(-)
+
+--- a/arch/mips/mm/tlb-r4k.c
++++ b/arch/mips/mm/tlb-r4k.c
+@@ -12,7 +12,6 @@
+ #include <linux/init.h>
+ #include <linux/sched.h>
+ #include <linux/smp.h>
+-#include <linux/memblock.h>
+ #include <linux/mm.h>
+ #include <linux/hugetlb.h>
+ #include <linux/export.h>
+@@ -521,26 +520,17 @@ static int r4k_vpn_cmp(const void *a, co
+  * Initialise all TLB entries with unique values that do not clash with
+  * what we have been handed over and what we'll be using ourselves.
+  */
+-static void __ref r4k_tlb_uniquify(void)
++static void r4k_tlb_uniquify(void)
+ {
++	unsigned long tlb_vpns[1 << MIPS_CONF1_TLBS_SIZE];
+ 	int tlbsize = current_cpu_data.tlbsize;
+-	bool use_slab = slab_is_available();
+ 	int start = num_wired_entries();
+-	phys_addr_t tlb_vpn_size;
+-	unsigned long *tlb_vpns;
+ 	unsigned long vpn_mask;
+ 	int cnt, ent, idx, i;
+ 
+ 	vpn_mask = GENMASK(cpu_vmbits - 1, 13);
+ 	vpn_mask |= IS_ENABLED(CONFIG_64BIT) ? 3ULL << 62 : 1 << 31;
+ 
+-	tlb_vpn_size = tlbsize * sizeof(*tlb_vpns);
+-	tlb_vpns = (use_slab ?
+-		    kmalloc(tlb_vpn_size, GFP_KERNEL) :
+-		    memblock_alloc_raw(tlb_vpn_size, sizeof(*tlb_vpns)));
+-	if (WARN_ON(!tlb_vpns))
+-		return; /* Pray local_flush_tlb_all() is good enough. */
+-
+ 	htw_stop();
+ 
+ 	for (i = start, cnt = 0; i < tlbsize; i++, cnt++) {
+@@ -593,10 +583,6 @@ static void __ref r4k_tlb_uniquify(void)
+ 	tlbw_use_hazard();
+ 	htw_start();
+ 	flush_micro_tlb();
+-	if (use_slab)
+-		kfree(tlb_vpns);
+-	else
+-		memblock_free(tlb_vpns, tlb_vpn_size);
+ }
+ 
+ /*
diff --git a/target/linux/generic/pending-6.6/361-Revert-MIPS-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch b/target/linux/generic/pending-6.6/361-Revert-MIPS-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch
new file mode 100644
index 0000000000..17d0b50ad8
--- /dev/null
+++ b/target/linux/generic/pending-6.6/361-Revert-MIPS-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch
@@ -0,0 +1,146 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Mon, 15 Dec 2025 01:45:20 +0100
+Subject: Revert "MIPS: mm: Prevent a TLB shutdown on initial uniquification"
+
+This reverts commit 135713cd0751bf296e515f5fdec234320f73bbd8.
+---
+ arch/mips/mm/tlb-r4k.c | 100 +++++++++++++++--------------------------
+ 1 file changed, 37 insertions(+), 63 deletions(-)
+
+--- a/arch/mips/mm/tlb-r4k.c
++++ b/arch/mips/mm/tlb-r4k.c
+@@ -15,7 +15,6 @@
+ #include <linux/mm.h>
+ #include <linux/hugetlb.h>
+ #include <linux/export.h>
+-#include <linux/sort.h>
+ 
+ #include <asm/cpu.h>
+ #include <asm/cpu-type.h>
+@@ -507,79 +506,55 @@ static int __init set_ntlb(char *str)
+ 
+ __setup("ntlb=", set_ntlb);
+ 
+-
+-/* Comparison function for EntryHi VPN fields.  */
+-static int r4k_vpn_cmp(const void *a, const void *b)
+-{
+-	long v = *(unsigned long *)a - *(unsigned long *)b;
+-	int s = sizeof(long) > sizeof(int) ? sizeof(long) * 8 - 1: 0;
+-	return s ? (v != 0) | v >> s : v;
+-}
+-
+-/*
+- * Initialise all TLB entries with unique values that do not clash with
+- * what we have been handed over and what we'll be using ourselves.
+- */
++/* Initialise all TLB entries with unique values */
+ static void r4k_tlb_uniquify(void)
+ {
+-	unsigned long tlb_vpns[1 << MIPS_CONF1_TLBS_SIZE];
+-	int tlbsize = current_cpu_data.tlbsize;
+-	int start = num_wired_entries();
+-	unsigned long vpn_mask;
+-	int cnt, ent, idx, i;
+-
+-	vpn_mask = GENMASK(cpu_vmbits - 1, 13);
+-	vpn_mask |= IS_ENABLED(CONFIG_64BIT) ? 3ULL << 62 : 1 << 31;
++	int entry = num_wired_entries();
+ 
+ 	htw_stop();
++	write_c0_entrylo0(0);
++	write_c0_entrylo1(0);
+ 
+-	for (i = start, cnt = 0; i < tlbsize; i++, cnt++) {
+-		unsigned long vpn;
++	while (entry < current_cpu_data.tlbsize) {
++		unsigned long asid_mask = cpu_asid_mask(&current_cpu_data);
++		unsigned long asid = 0;
++		int idx;
+ 
+-		write_c0_index(i);
+-		mtc0_tlbr_hazard();
+-		tlb_read();
+-		tlb_read_hazard();
+-		vpn = read_c0_entryhi();
+-		vpn &= vpn_mask & PAGE_MASK;
+-		tlb_vpns[cnt] = vpn;
++		/* Skip wired MMID to make ginvt_mmid work */
++		if (cpu_has_mmid)
++			asid = MMID_KERNEL_WIRED + 1;
+ 
+-		/* Prevent any large pages from overlapping regular ones.  */
+-		write_c0_pagemask(read_c0_pagemask() & PM_DEFAULT_MASK);
++		/* Check for match before using UNIQUE_ENTRYHI */
++		do {
++			if (cpu_has_mmid) {
++				write_c0_memorymapid(asid);
++				write_c0_entryhi(UNIQUE_ENTRYHI(entry));
++			} else {
++				write_c0_entryhi(UNIQUE_ENTRYHI(entry) | asid);
++			}
++			mtc0_tlbw_hazard();
++			tlb_probe();
++			tlb_probe_hazard();
++			idx = read_c0_index();
++			/* No match or match is on current entry */
++			if (idx < 0 || idx == entry)
++				break;
++			/*
++			 * If we hit a match, we need to try again with
++			 * a different ASID.
++			 */
++			asid++;
++		} while (asid < asid_mask);
++
++		if (idx >= 0 && idx != entry)
++			panic("Unable to uniquify TLB entry %d", idx);
++
++		write_c0_index(entry);
+ 		mtc0_tlbw_hazard();
+ 		tlb_write_indexed();
+-		tlbw_use_hazard();
++		entry++;
+ 	}
+ 
+-	sort(tlb_vpns, cnt, sizeof(tlb_vpns[0]), r4k_vpn_cmp, NULL);
+-
+-	write_c0_pagemask(PM_DEFAULT_MASK);
+-	write_c0_entrylo0(0);
+-	write_c0_entrylo1(0);
+-
+-	idx = 0;
+-	ent = tlbsize;
+-	for (i = start; i < tlbsize; i++)
+-		while (1) {
+-			unsigned long entryhi, vpn;
+-
+-			entryhi = UNIQUE_ENTRYHI(ent);
+-			vpn = entryhi & vpn_mask & PAGE_MASK;
+-
+-			if (idx >= cnt || vpn < tlb_vpns[idx]) {
+-				write_c0_entryhi(entryhi);
+-				write_c0_index(i);
+-				mtc0_tlbw_hazard();
+-				tlb_write_indexed();
+-				ent++;
+-				break;
+-			} else if (vpn == tlb_vpns[idx]) {
+-				ent++;
+-			} else {
+-				idx++;
+-			}
+-		}
+-
+ 	tlbw_use_hazard();
+ 	htw_start();
+ 	flush_micro_tlb();
+@@ -625,7 +600,6 @@ static void r4k_tlb_configure(void)
+ 
+ 	/* From this point on the ARC firmware is dead.	 */
+ 	r4k_tlb_uniquify();
+-	local_flush_tlb_all();
+ 
+ 	/* Did I tell you that ARC SUCKS?  */
+ }



From lede-commits at lists.infradead.org  Mon Dec 15 15:12:49 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 18:12:49 -0500
Subject: [openwrt/openwrt]  mediatek/filogic: fix Cudy WR3000H ethernet port
 order
In-Reply-To: <176584036944.2185146.605080547339182109@git-01.infra.openwrt.org>
References: <176584036944.2185146.605080547339182109@git-01.infra.openwrt.org>
Message-ID: <mailman.36083.1765840374.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/7aa929881e444ebc0ec0ae6cf027144db26392d1

commit 7aa929881e444ebc0ec0ae6cf027144db26392d1
Author: Thibaut VAR?NE <hacks at slashdirt.org>
AuthorDate: Fri Oct 24 11:27:59 2025 +0200

    mediatek/filogic: fix Cudy WR3000H ethernet port order
    
    The ports are physically labelled in reverse order on the device.
    This patch aligns logical names with physical ones.
    LED order on front of device is correct after this patch.
    
    Fixes: 9d66b8b312fb6a4087244ee3ee10e1ba1623df81
    Signed-off-by: Thibaut VAR?NE <hacks at slashdirt.org>
    Link: https://github.com/openwrt/openwrt/pull/20528
    (cherry picked from commit 887cab883bc4b3e104b70e74af775522d060e1d4)
    Signed-off-by: Thibaut VAR?NE <hacks at slashdirt.org>
    Link: https://github.com/openwrt/openwrt/pull/21173
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1.dts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1.dts
index e34d2a9ad2..69e1098b43 100644
--- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1.dts
+++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1.dts
@@ -118,22 +118,22 @@
 
 		port at 0 {
 			reg = <0>;
-			label = "lan1";
+			label = "lan4";
 		};
 
 		port at 1 {
 			reg = <1>;
-			label = "lan2";
+			label = "lan3";
 		};
 
 		port at 2 {
 			reg = <2>;
-			label = "lan3";
+			label = "lan2";
 		};
 
 		port at 3 {
 			reg = <3>;
-			label = "lan4";
+			label = "lan1";
 		};
 
 		port at 6 {



From lede-commits at lists.infradead.org  Mon Dec 15 15:18:13 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 18:18:13 -0500
Subject: [openwrt/openwrt]  mediatek: fix IPv4 address missing on interface in
 failsafe mode for cudy ap3000-v1
In-Reply-To: <176584069331.2194287.5814739878930208284@git-01.infra.openwrt.org>
References: <176584069331.2194287.5814739878930208284@git-01.infra.openwrt.org>
Message-ID: <mailman.36084.1765840697.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e5cd6461c905184db8f49692f931b20fec4b819e

commit e5cd6461c905184db8f49692f931b20fec4b819e
Author: Martin Nadvornik <martin.nadvornik at gmx.at>
AuthorDate: Mon Dec 15 16:54:52 2025 +0100

    mediatek: fix IPv4 address missing on interface in failsafe mode for cudy ap3000-v1
    
    cudy ap3000-v1 did not work correctly in failsafe mode
    because the address 192.168.1.1 was missing on the eth0 inteface.
    it was reachable via it's IPv6 link-local address however.
    this commit fixes the issue.
    
    Fixes: https://github.com/openwrt/openwrt/issues/20750
    Signed-off-by: Martin Nadvornik <martin.nadvornik at gmx.at>
    Link: https://github.com/openwrt/openwrt/pull/21172
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface b/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface
index ed166de595..5d3a3319fc 100644
--- a/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface
+++ b/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface
@@ -11,6 +11,7 @@ set_preinit_iface() {
 		ip link set eth1 up
 		ifname=eth1
 		;;
+	cudy,ap3000-v1|\
 	cudy,ap3000outdoor-v1|\
 	cudy,re3000-v1|\
 	ubnt,unifi-6-lr|\



From lede-commits at lists.infradead.org  Mon Dec 15 15:29:42 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 18:29:42 -0500
Subject: [openwrt/openwrt]  mediatek: fix IPv4 address missing on interface in
 failsafe mode for cudy ap3000-v1
In-Reply-To: <176584138249.2210876.12449295351498219470@git-01.infra.openwrt.org>
References: <176584138249.2210876.12449295351498219470@git-01.infra.openwrt.org>
Message-ID: <mailman.36086.1765841387.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/81d7d379c74ef36ba8521dd1c694739a29d07bb2

commit 81d7d379c74ef36ba8521dd1c694739a29d07bb2
Author: Martin Nadvornik <martin.nadvornik at gmx.at>
AuthorDate: Mon Dec 15 16:54:52 2025 +0100

    mediatek: fix IPv4 address missing on interface in failsafe mode for cudy ap3000-v1
    
    cudy ap3000-v1 did not work correctly in failsafe mode
    because the address 192.168.1.1 was missing on the eth0 inteface.
    it was reachable via it's IPv6 link-local address however.
    this commit fixes the issue.
    
    Fixes: https://github.com/openwrt/openwrt/issues/20750
    Signed-off-by: Martin Nadvornik <martin.nadvornik at gmx.at>
    Link: https://github.com/openwrt/openwrt/pull/21172
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit e5cd6461c905184db8f49692f931b20fec4b819e)
---
 target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface b/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface
index ed166de595..5d3a3319fc 100644
--- a/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface
+++ b/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface
@@ -11,6 +11,7 @@ set_preinit_iface() {
 		ip link set eth1 up
 		ifname=eth1
 		;;
+	cudy,ap3000-v1|\
 	cudy,ap3000outdoor-v1|\
 	cudy,re3000-v1|\
 	ubnt,unifi-6-lr|\



From lede-commits at lists.infradead.org  Mon Dec 15 15:30:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 18:30:20 -0500
Subject: [openwrt/openwrt]  mediatek: fix IPv4 address missing on interface in
 failsafe mode for cudy ap3000-v1
In-Reply-To: <176584142088.2212129.14723765601865080125@git-01.infra.openwrt.org>
References: <176584142088.2212129.14723765601865080125@git-01.infra.openwrt.org>
Message-ID: <mailman.36087.1765841425.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/58a0211f8201ab622b7b11d31629d6d755bd6526

commit 58a0211f8201ab622b7b11d31629d6d755bd6526
Author: Martin Nadvornik <martin.nadvornik at gmx.at>
AuthorDate: Mon Dec 15 16:54:52 2025 +0100

    mediatek: fix IPv4 address missing on interface in failsafe mode for cudy ap3000-v1
    
    cudy ap3000-v1 did not work correctly in failsafe mode
    because the address 192.168.1.1 was missing on the eth0 inteface.
    it was reachable via it's IPv6 link-local address however.
    this commit fixes the issue.
    
    Fixes: https://github.com/openwrt/openwrt/issues/20750
    Signed-off-by: Martin Nadvornik <martin.nadvornik at gmx.at>
    Link: https://github.com/openwrt/openwrt/pull/21172
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit e5cd6461c905184db8f49692f931b20fec4b819e)
---
 target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface b/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface
index 5d8151741d..acfeaf2d4a 100644
--- a/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface
+++ b/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface
@@ -10,6 +10,7 @@ set_preinit_iface() {
 		ip link set eth1 up
 		ifname=eth1
 		;;
+	cudy,ap3000-v1|\
 	cudy,ap3000outdoor-v1|\
 	cudy,re3000-v1|\
 	ubnt,unifi-6-lr|\



From lede-commits at lists.infradead.org  Mon Dec 15 16:26:14 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 19:26:14 -0500
Subject: [openwrt/openwrt]  libcap: Revert "libcap: update to 2.77"
In-Reply-To: <176584477466.2328169.875172428960442680@git-01.infra.openwrt.org>
References: <176584477466.2328169.875172428960442680@git-01.infra.openwrt.org>
Message-ID: <mailman.36120.1765844780.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5b0617ae1fbd2af11e7e157a6a6bd76eb01d6560

commit 5b0617ae1fbd2af11e7e157a6a6bd76eb01d6560
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Dec 16 01:22:26 2025 +0100

    libcap: Revert "libcap: update to 2.77"
    
    This reverts commit c25265953b9c06fafc6091982468ed0cfc30abb0.
    
    Linking of libpsx.so from libcap 2.77 fails on powerpc 464fp. Revert
    back to the older version which works.
    
    Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=220860
    Fixes: c25265953b9c ("libcap: update to 2.77")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/libs/libcap/Makefile                       |  4 ++--
 ...bcap-Add-build-ldflags-to-_makenames-rule.patch | 27 ----------------------
 2 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/package/libs/libcap/Makefile b/package/libs/libcap/Makefile
index ab74ff4681..989209302a 100644
--- a/package/libs/libcap/Makefile
+++ b/package/libs/libcap/Makefile
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcap
-PKG_VERSION:=2.77
+PKG_VERSION:=2.69
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
-PKG_HASH:=897bc18b44afc26c70e78cead3dbb31e154acc24bee085a5a09079a88dbf6f52
+PKG_HASH:=f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb
 
 PKG_MAINTAINER:=Paul Wassi <p.wassi at gmx.at>
 PKG_LICENSE:=GPL-2.0-only
diff --git a/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch b/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch
deleted file mode 100644
index 7c5f03bdb9..0000000000
--- a/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 542d7d86ecd2129dd5fe7e5b31ba307304f5b319 Mon Sep 17 00:00:00 2001
-From: "Andrew G. Morgan" <morgan at kernel.org>
-Date: Mon, 10 Nov 2025 18:26:34 -0800
-Subject: [PATCH] Revert "libcap: Add build ldflags to _makenames rule"
-
-This reverts commit c3ddf45d9afaab85d3b7db0dc7bfd1aafb8fde50.
-
-The details of what this broke are here:
-
-  https://bugzilla.kernel.org/show_bug.cgi?id=220691#c2
-
-Signed-off-by: Andrew G. Morgan <morgan at kernel.org>
----
- libcap/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -80,7 +80,7 @@ $(PSXTITLE).pc: $(PSXTITLE).pc.in
- 		$< >$@
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@ $(BUILD_LDFLAGS)
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h



From lede-commits at lists.infradead.org  Mon Dec 15 16:26:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 19:26:43 -0500
Subject: [openwrt/openwrt]  libcap: Revert "libcap: update to 2.77"
In-Reply-To: <176584480300.2329244.5096811291257725186@git-01.infra.openwrt.org>
References: <176584480300.2329244.5096811291257725186@git-01.infra.openwrt.org>
Message-ID: <mailman.36121.1765844807.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/7f4272dc18eb150c19d3c80f21e6a62cce5495a5

commit 7f4272dc18eb150c19d3c80f21e6a62cce5495a5
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Dec 16 01:22:26 2025 +0100

    libcap: Revert "libcap: update to 2.77"
    
    This reverts commit c25265953b9c06fafc6091982468ed0cfc30abb0.
    
    Linking of libpsx.so from libcap 2.77 fails on powerpc 464fp. Revert
    back to the older version which works.
    
    Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=220860
    Fixes: c25265953b9c ("libcap: update to 2.77")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 5b0617ae1fbd2af11e7e157a6a6bd76eb01d6560)
---
 package/libs/libcap/Makefile                       |  4 ++--
 ...bcap-Add-build-ldflags-to-_makenames-rule.patch | 27 ----------------------
 2 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/package/libs/libcap/Makefile b/package/libs/libcap/Makefile
index ab74ff4681..989209302a 100644
--- a/package/libs/libcap/Makefile
+++ b/package/libs/libcap/Makefile
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcap
-PKG_VERSION:=2.77
+PKG_VERSION:=2.69
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
-PKG_HASH:=897bc18b44afc26c70e78cead3dbb31e154acc24bee085a5a09079a88dbf6f52
+PKG_HASH:=f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb
 
 PKG_MAINTAINER:=Paul Wassi <p.wassi at gmx.at>
 PKG_LICENSE:=GPL-2.0-only
diff --git a/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch b/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch
deleted file mode 100644
index 7c5f03bdb9..0000000000
--- a/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 542d7d86ecd2129dd5fe7e5b31ba307304f5b319 Mon Sep 17 00:00:00 2001
-From: "Andrew G. Morgan" <morgan at kernel.org>
-Date: Mon, 10 Nov 2025 18:26:34 -0800
-Subject: [PATCH] Revert "libcap: Add build ldflags to _makenames rule"
-
-This reverts commit c3ddf45d9afaab85d3b7db0dc7bfd1aafb8fde50.
-
-The details of what this broke are here:
-
-  https://bugzilla.kernel.org/show_bug.cgi?id=220691#c2
-
-Signed-off-by: Andrew G. Morgan <morgan at kernel.org>
----
- libcap/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -80,7 +80,7 @@ $(PSXTITLE).pc: $(PSXTITLE).pc.in
- 		$< >$@
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@ $(BUILD_LDFLAGS)
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h



From lede-commits at lists.infradead.org  Mon Dec 15 16:40:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 19:40:43 -0500
Subject: [openwrt/openwrt]  scripts,ipkg-build: Fix error message for invalid
 package name
In-Reply-To: <176584564387.2368707.15804928493966004473@git-01.infra.openwrt.org>
References: <176584564387.2368707.15804928493966004473@git-01.infra.openwrt.org>
Message-ID: <mailman.36122.1765845649.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/63bf77b801d59e7cf97b6bcd90aa040f8464d99c

commit 63bf77b801d59e7cf97b6bcd90aa040f8464d99c
Author: Karsten Sperling <ksperling at apple.com>
AuthorDate: Fri Sep 12 15:49:13 2025 +1200

    scripts,ipkg-build: Fix error message for invalid package name
    
    Use the correct variable ($pkg instead of $name) in the error message.
    
    Signed-off-by: Karsten Sperling <ksperling at apple.com>
    Link: https://github.com/openwrt/openwrt/pull/20077
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 scripts/ipkg-build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index 6abcc58832..d2beb41844 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -45,7 +45,7 @@ pkg_appears_sane() {
 	arch="$(required_field Architecture)"
 
 	if echo "$pkg" | grep '[^a-zA-Z0-9_.+-]'; then
-		echo "*** Error: Package name $name contains illegal characters, (other than [a-z0-9.+-])" >&2
+		echo "*** Error: Package name '$pkg' contains illegal characters, (other than [a-z0-9.+-])" >&2
 		PKG_ERROR=1;
 	fi
 



From lede-commits at lists.infradead.org  Mon Dec 15 16:41:57 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 19:41:57 -0500
Subject: [openwrt/openwrt]  scripts,ipkg-build: Fix error message for invalid
 package name
In-Reply-To: <176584571788.2372159.9615277623301265424@git-01.infra.openwrt.org>
References: <176584571788.2372159.9615277623301265424@git-01.infra.openwrt.org>
Message-ID: <mailman.36123.1765845727.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/946e43c3d80d9616b5f4cfeeb386a5c8f31a7b6a

commit 946e43c3d80d9616b5f4cfeeb386a5c8f31a7b6a
Author: Karsten Sperling <ksperling at apple.com>
AuthorDate: Fri Sep 12 15:49:13 2025 +1200

    scripts,ipkg-build: Fix error message for invalid package name
    
    Use the correct variable ($pkg instead of $name) in the error message.
    
    Signed-off-by: Karsten Sperling <ksperling at apple.com>
    Link: https://github.com/openwrt/openwrt/pull/20077
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 63bf77b801d59e7cf97b6bcd90aa040f8464d99c)
---
 scripts/ipkg-build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index 6abcc58832..d2beb41844 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -45,7 +45,7 @@ pkg_appears_sane() {
 	arch="$(required_field Architecture)"
 
 	if echo "$pkg" | grep '[^a-zA-Z0-9_.+-]'; then
-		echo "*** Error: Package name $name contains illegal characters, (other than [a-z0-9.+-])" >&2
+		echo "*** Error: Package name '$pkg' contains illegal characters, (other than [a-z0-9.+-])" >&2
 		PKG_ERROR=1;
 	fi
 



From lede-commits at lists.infradead.org  Mon Dec 15 16:46:33 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 19:46:33 -0500
Subject: [openwrt/openwrt]  sunxi: image: sync target profiles names with DT
 compatible
In-Reply-To: <176584599320.2384356.3002880318955761447@git-01.infra.openwrt.org>
References: <176584599320.2384356.3002880318955761447@git-01.infra.openwrt.org>
Message-ID: <mailman.36124.1765845998.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d871e95e7f836435e8323074e3abab2c7608e016

commit d871e95e7f836435e8323074e3abab2c7608e016
Author: Mario Andr?s P?rez <mapb_ at outlook.com>
AuthorDate: Sun Dec 14 18:45:10 2025 +0100

    sunxi: image: sync target profiles names with DT compatible
    
    Following up with errors reported in the ASU repo, these bananapi cases
    do not match the DT compatible "bpi", sync with dts sources.
    Also some profiles were overwriting SUPPORTED_DEVICES.
    Sysupgrade would be failing in SUPPORTED_DEVICES check since
    the DT compatible(/tmp/sysinfo/board_name) is not in SUPPORTED_DEVICES.
    This should also fix errors when using ASU sysupgrade clients.
    - Sync profile makefile target names with DT compatibles.
    - Fix overwrites of SUPPORTED_DEVICES instead of appending.
    - Adapt the uboot-sunxi profiles accordingly.
    *bpi-p2-zero dts is still not upstream.
    
    V2:
    - Include fixes for arm926ejs(ARM926EJ-S) subtarget (LicheePi Nano and
    PopStick v1.1) (profile rename for correct default SUPPORTED_DEVICES)
    
    Fixes: https://forum.openwrt.org/t/luci-attended-sysupgrade-support-thread/230552/246
    Fixes: https://github.com/openwrt/asu/issues/486
    Fixes: https://github.com/openwrt/asu/issues/524
    Fixes: 9aa66b8ce730aebff76d353392151708a897a3a0 "sunxi: add support for Banana Pi M2 Berry"
    Fixes: d5f615bf2a0434c15d13943b566d46f25da579bb "sunxi: add support for Sinovoip Banana Pi M2 Plus"
    Fixes: 3819c1638a9d300840d0f869628891f9696be112 "sunxi: Add support for Banana Pi M2 Ultra"
    Fixes: 6bf8193b25a147abfe3720104e63af890c1ca2b8 "sunxi: add support for Bananapi P2 Zero"
    Fixes: 80edfaf675364835e6d2e17d97ebec6afc6b2103 "sunxi: add support for Banana Pi M3"
    Fixes: 3c24a1d423a6052b101c00cb7d94e70d72702639 "sunxi: add support for NanoPi NEO Plus2 board"
    Fixes: a689307c970e37c247c6452ba3963be8b109eb4f "sunxi: build image/uboot for the NanoPi NEO2"
    Fixes: fde68cb80941a60be93ece75e808b5b407d11cc8 "sunxi: add support for FriendlyARM NanoPi R1S H5"
    Fixes: 3ec468ff4fa3106d459ae58ec4bc4833715118c6 "sunxi: add F1C100 (arm926ej-s) support"
    
    Signed-off-by: Mario Andr?s P?rez <mapb_ at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21095
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/uboot-sunxi/Makefile     | 42 +++++++++++++++++------------------
 target/linux/sunxi/image/arm926ejs.mk | 15 +++++++------
 target/linux/sunxi/image/cortexa53.mk |  7 +++---
 target/linux/sunxi/image/cortexa7.mk  | 29 ++++++++++++++----------
 target/linux/sunxi/image/cortexa8.mk  | 13 ++---------
 5 files changed, 51 insertions(+), 55 deletions(-)

diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
index 02a951e550..515d6d6a92 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -134,17 +134,17 @@ define U-Boot/Mele_M9
   BUILD_DEVICES:=mele_m9
 endef
 
-define U-Boot/OLIMEX_A13_SOM
+define U-Boot/a13-som
   BUILD_SUBTARGET:=cortexa8
   NAME:=Olimex A13 SOM
-  BUILD_DEVICES:=olimex_a13-olimex-som
+  BUILD_DEVICES:=olimex_a13-olinuxino
 endef
 
 define U-Boot/licheepi_nano
   BUILD_SUBTARGET:=arm926ejs
   NAME:=LicheePi Nano
   UENV:=f1c
-  BUILD_DEVICES:=licheepi-nano
+  BUILD_DEVICES:=licheepi_licheepi-nano
 endef
 
 define U-Boot/Linksprite_pcDuino
@@ -268,7 +268,7 @@ define U-Boot/popstick
   BUILD_SUBTARGET:=arm926ejs
   NAME:=PopStick
   UENV:=f1c
-  BUILD_DEVICES:=popstick-v1.1
+  BUILD_DEVICES:=sourceparts_popstick-v1.1
 endef
 
 define U-Boot/libretech_all_h3_cc_h5
@@ -316,16 +316,16 @@ define U-Boot/pine64_plus
   ATF:=a64
 endef
 
-define U-Boot/bananapi_m2_plus_h3
+define U-Boot/bpi_m2_plus_h3
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Plus H3
-  BUILD_DEVICES:=sinovoip_bananapi-m2-plus
+  BUILD_DEVICES:=sinovoip_bpi-m2-plus
 endef
 
-define U-Boot/Sinovoip_BPI_M3
+define U-Boot/bpi_m3
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M3
-  BUILD_DEVICES:=sinovoip_bananapi-m3
+  BUILD_DEVICES:=sinovoip_bpi-m3
 endef
 
 define U-Boot/sopine_baseboard
@@ -382,22 +382,22 @@ define U-Boot/orangepi_zero3
   ATF:=h616
 endef
 
-define U-Boot/Bananapi_M2_Ultra
+define U-Boot/bpi_m2_ultra
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Ultra
-  BUILD_DEVICES:=sinovoip_bananapi-m2-ultra
+  BUILD_DEVICES:=sinovoip_bpi-m2-ultra
 endef
 
-define U-Boot/bananapi_m2_berry
+define U-Boot/bpi_m2_berry
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Berry
-  BUILD_DEVICES:=sinovoip_bananapi-m2-berry
+  BUILD_DEVICES:=sinovoip_bpi-m2-berry
 endef
 
-define U-Boot/bananapi_p2_zero
+define U-Boot/bpi_p2_zero
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi P2 Zero
-  BUILD_DEVICES:=sinovoip_bananapi-p2-zero
+  BUILD_DEVICES:=sinovoip_bpi-p2-zero
 endef
 
 
@@ -406,24 +406,25 @@ UBOOT_TARGETS := \
 	a64-olinuxino-emmc \
 	A10-OLinuXino-Lime \
 	A13-OLinuXino \
+	a13-som \
 	A20-OLinuXino-Lime \
 	A20-OLinuXino-Lime2 \
 	A20-OLinuXino-Lime2-eMMC \
 	A20-OLinuXino_MICRO \
-	bananapi_m2_plus_h3 \
+	beelink_x2 \
+	bpi_m2_berry \
+	bpi_m2_plus_h3 \
+	bpi_m2_ultra \
+	bpi_m3 \
+	bpi_p2_zero \
 	Bananapi \
-	bananapi_m2_berry \
-	bananapi_p2_zero \
-	Bananapi_M2_Ultra \
 	Bananapro \
-	beelink_x2 \
 	Cubieboard \
 	Cubieboard2 \
 	Cubietruck \
 	Hummingbird_A31 \
 	Marsboard_A10 \
 	Mele_M9 \
-	OLIMEX_A13_SOM \
 	licheepi_nano \
 	LicheePi_Zero \
 	Linksprite_pcDuino \
@@ -453,7 +454,6 @@ UBOOT_TARGETS := \
 	pangolin \
 	popstick \
 	pine64_plus \
-	Sinovoip_BPI_M3 \
 	sopine_baseboard \
 	orangepi_zero_plus \
 	libretech_all_h3_cc_h5
diff --git a/target/linux/sunxi/image/arm926ejs.mk b/target/linux/sunxi/image/arm926ejs.mk
index 42d3ee6f29..928133e16e 100644
--- a/target/linux/sunxi/image/arm926ejs.mk
+++ b/target/linux/sunxi/image/arm926ejs.mk
@@ -7,20 +7,21 @@
 
 KERNEL_LOADADDR=0x81000000
 
-define Device/licheepi-nano
+define Device/licheepi_licheepi-nano
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := LicheePi
-  DEVICE_MODEL := Nano
+  DEVICE_MODEL := LicheePi Nano
   DEVICE_PACKAGES := kmod-rtc-sunxi
   SOC := suniv-f1c100s
 endef
-TARGET_DEVICES += licheepi-nano
+TARGET_DEVICES += licheepi_licheepi-nano
 
-define Device/popstick-v1.1
+define Device/sourceparts_popstick-v1.1
   $(call Device/FitImageGzip)
-  DEVICE_VENDOR := PopStick
-  DEVICE_MODEL := v1.1
+  DEVICE_VENDOR := SourceParts
+  DEVICE_MODEL := PopStick
+  DEVICE_VARIANT := v1.1
   DEVICE_PACKAGES := kmod-rtc-sunxi
   SOC := suniv-f1c200s
 endef
-TARGET_DEVICES += popstick-v1.1
+TARGET_DEVICES += sourceparts_popstick-v1.1
diff --git a/target/linux/sunxi/image/cortexa53.mk b/target/linux/sunxi/image/cortexa53.mk
index 49702ebadd..50b286a98f 100644
--- a/target/linux/sunxi/image/cortexa53.mk
+++ b/target/linux/sunxi/image/cortexa53.mk
@@ -39,7 +39,7 @@ endef
 define Device/friendlyarm_nanopi-neo-plus2
   DEVICE_VENDOR := FriendlyARM
   DEVICE_MODEL := NanoPi NEO Plus2
-  SUPPORTED_DEVICES:=nanopi-neo-plus2
+  SUPPORTED_DEVICES += nanopi-neo-plus2
   $(Device/sun50i-h5)
 endef
 TARGET_DEVICES += friendlyarm_nanopi-neo-plus2
@@ -47,7 +47,7 @@ TARGET_DEVICES += friendlyarm_nanopi-neo-plus2
 define Device/friendlyarm_nanopi-neo2
   DEVICE_VENDOR := FriendlyARM
   DEVICE_MODEL := NanoPi NEO2
-  SUPPORTED_DEVICES:=nanopi-neo2
+  SUPPORTED_DEVICES += nanopi-neo2
   $(Device/sun50i-h5)
 endef
 TARGET_DEVICES += friendlyarm_nanopi-neo2
@@ -56,7 +56,7 @@ define Device/friendlyarm_nanopi-r1s-h5
   DEVICE_VENDOR := FriendlyARM
   DEVICE_MODEL := Nanopi R1S H5
   DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-usb-net-rtl8152
-  SUPPORTED_DEVICES:=nanopi-r1s-h5
+  SUPPORTED_DEVICES += nanopi-r1s-h5
   $(Device/sun50i-h5)
 endef
 TARGET_DEVICES += friendlyarm_nanopi-r1s-h5
@@ -109,7 +109,6 @@ define Device/xunlong_orangepi-one-plus
   $(Device/sun50i-h6)
   DEVICE_VENDOR := Xunlong
   DEVICE_MODEL := Orange Pi One Plus
-  SUNXI_DTS_DIR := allwinner/
 endef
 TARGET_DEVICES += xunlong_orangepi-one-plus
 
diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk
index 9b0d12f125..4f0ec9b47a 100644
--- a/target/linux/sunxi/image/cortexa7.mk
+++ b/target/linux/sunxi/image/cortexa7.mk
@@ -92,27 +92,29 @@ define Device/lemaker_bananapi
 endef
 TARGET_DEVICES += lemaker_bananapi
 
-define Device/sinovoip_bananapi-m2-berry
+define Device/sinovoip_bpi-m2-berry
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2 Berry
   DEVICE_PACKAGES:=kmod-ata-sunxi kmod-brcmfmac \
 	cypress-firmware-43430-sdio wpad-basic-mbedtls
-  SUPPORTED_DEVICES:=lemaker,bananapi-m2-berry
+  SUPPORTED_DEVICES += lemaker,bananapi-m2-berry
   SOC := sun8i-v40
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-m2-berry
 endef
-TARGET_DEVICES += sinovoip_bananapi-m2-berry
+TARGET_DEVICES += sinovoip_bpi-m2-berry
 
-define Device/sinovoip_bananapi-m2-ultra
+define Device/sinovoip_bpi-m2-ultra
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2 Ultra
   DEVICE_PACKAGES:=kmod-ata-sunxi kmod-brcmfmac \
 	brcmfmac-firmware-43430a0-sdio wpad-basic-mbedtls
-  SUPPORTED_DEVICES:=lemaker,bananapi-m2-ultra
+  SUPPORTED_DEVICES += lemaker,bananapi-m2-ultra
   SOC := sun8i-r40
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-m2-ultra
 endef
-TARGET_DEVICES += sinovoip_bananapi-m2-ultra
+TARGET_DEVICES += sinovoip_bpi-m2-ultra
 
 define Device/lemaker_bananapro
   $(call Device/FitImageGzip)
@@ -217,35 +219,38 @@ define Device/roofull_beelink-x2
 endef
 TARGET_DEVICES += roofull_beelink-x2
 
-define Device/sinovoip_bananapi-m2-plus
+define Device/sinovoip_bpi-m2-plus
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2+
   DEVICE_PACKAGES:=kmod-leds-gpio kmod-brcmfmac \
 	brcmfmac-firmware-43430a0-sdio wpad-basic-mbedtls
   SOC := sun8i-h3
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-m2-plus
 endef
-TARGET_DEVICES += sinovoip_bananapi-m2-plus
+TARGET_DEVICES += sinovoip_bpi-m2-plus
 
-define Device/sinovoip_bananapi-m3
+define Device/sinovoip_bpi-m3
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M3
   DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-leds-gpio kmod-rtc-ac100 \
 	kmod-brcmfmac cypress-firmware-43430-sdio wpad-basic-mbedtls
   SOC := sun8i-a83t
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-m3
 endef
-TARGET_DEVICES += sinovoip_bananapi-m3
+TARGET_DEVICES += sinovoip_bpi-m3
 
-define Device/sinovoip_bananapi-p2-zero
+define Device/sinovoip_bpi-p2-zero
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi P2 Zero
   DEVICE_PACKAGES:=kmod-leds-gpio kmod-brcmfmac \
 	cypress-firmware-43430-sdio wpad-basic-mbedtls
   SOC := sun8i-h2-plus
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-p2-zero
 endef
-TARGET_DEVICES += sinovoip_bananapi-p2-zero
+TARGET_DEVICES += sinovoip_bpi-p2-zero
 
 define Device/xunlong_orangepi-one
   $(call Device/FitImageGzip)
diff --git a/target/linux/sunxi/image/cortexa8.mk b/target/linux/sunxi/image/cortexa8.mk
index f79c8d3513..2ca33163f4 100644
--- a/target/linux/sunxi/image/cortexa8.mk
+++ b/target/linux/sunxi/image/cortexa8.mk
@@ -43,21 +43,12 @@ define Device/olimex_a10-olinuxino-lime
 endef
 TARGET_DEVICES += olimex_a10-olinuxino-lime
 
-define Device/olimex_a13-olimex-som
-  $(call Device/FitImageGzip)
-  DEVICE_VENDOR := Olimex
-  DEVICE_MODEL := A13-SOM
-  DEVICE_PACKAGES:=kmod-rtl8192cu
-  SUPPORTED_DEVICES:=olimex,a13-olinuxino
-  SOC := sun5i-a13
-  SUNXI_DTS := $$(SUNXI_DTS_DIR)sun5i-a13-olinuxino
-endef
-TARGET_DEVICES += olimex_a13-olimex-som
-
 define Device/olimex_a13-olinuxino
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Olimex
   DEVICE_MODEL := A13-OLinuXino
+  DEVICE_ALT0_VENDOR := Olimex
+  DEVICE_ALT0_MODEL := A13-SOM
   DEVICE_PACKAGES:=kmod-rtl8192cu
   SOC := sun5i
 endef



From lede-commits at lists.infradead.org  Mon Dec 15 16:47:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 15 Dec 2025 19:47:18 -0500
Subject: [openwrt/openwrt]  sunxi: image: sync target profiles names with DT
 compatible
In-Reply-To: <176584603851.2386749.3713392444531637237@git-01.infra.openwrt.org>
References: <176584603851.2386749.3713392444531637237@git-01.infra.openwrt.org>
Message-ID: <mailman.36127.1765846042.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/6d7fbcccacb70f2c9425e78b063175ff3cd39297

commit 6d7fbcccacb70f2c9425e78b063175ff3cd39297
Author: Mario Andr?s P?rez <mapb_ at outlook.com>
AuthorDate: Sun Dec 14 18:45:10 2025 +0100

    sunxi: image: sync target profiles names with DT compatible
    
    Following up with errors reported in the ASU repo, these bananapi cases
    do not match the DT compatible "bpi", sync with dts sources.
    Also some profiles were overwriting SUPPORTED_DEVICES.
    Sysupgrade would be failing in SUPPORTED_DEVICES check since
    the DT compatible(/tmp/sysinfo/board_name) is not in SUPPORTED_DEVICES.
    This should also fix errors when using ASU sysupgrade clients.
    - Sync profile makefile target names with DT compatibles.
    - Fix overwrites of SUPPORTED_DEVICES instead of appending.
    - Adapt the uboot-sunxi profiles accordingly.
    *bpi-p2-zero dts is still not upstream.
    
    V2:
    - Include fixes for arm926ejs(ARM926EJ-S) subtarget (LicheePi Nano and
    PopStick v1.1) (profile rename for correct default SUPPORTED_DEVICES)
    
    Fixes: https://forum.openwrt.org/t/luci-attended-sysupgrade-support-thread/230552/246
    Fixes: https://github.com/openwrt/asu/issues/486
    Fixes: https://github.com/openwrt/asu/issues/524
    Fixes: 9aa66b8ce730aebff76d353392151708a897a3a0 "sunxi: add support for Banana Pi M2 Berry"
    Fixes: d5f615bf2a0434c15d13943b566d46f25da579bb "sunxi: add support for Sinovoip Banana Pi M2 Plus"
    Fixes: 3819c1638a9d300840d0f869628891f9696be112 "sunxi: Add support for Banana Pi M2 Ultra"
    Fixes: 6bf8193b25a147abfe3720104e63af890c1ca2b8 "sunxi: add support for Bananapi P2 Zero"
    Fixes: 80edfaf675364835e6d2e17d97ebec6afc6b2103 "sunxi: add support for Banana Pi M3"
    Fixes: 3c24a1d423a6052b101c00cb7d94e70d72702639 "sunxi: add support for NanoPi NEO Plus2 board"
    Fixes: a689307c970e37c247c6452ba3963be8b109eb4f "sunxi: build image/uboot for the NanoPi NEO2"
    Fixes: fde68cb80941a60be93ece75e808b5b407d11cc8 "sunxi: add support for FriendlyARM NanoPi R1S H5"
    Fixes: 3ec468ff4fa3106d459ae58ec4bc4833715118c6 "sunxi: add F1C100 (arm926ej-s) support"
    
    Signed-off-by: Mario Andr?s P?rez <mapb_ at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21095
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit d871e95e7f836435e8323074e3abab2c7608e016)
---
 package/boot/uboot-sunxi/Makefile     | 42 +++++++++++++++++------------------
 target/linux/sunxi/image/arm926ejs.mk | 15 +++++++------
 target/linux/sunxi/image/cortexa53.mk |  7 +++---
 target/linux/sunxi/image/cortexa7.mk  | 29 ++++++++++++++----------
 target/linux/sunxi/image/cortexa8.mk  | 13 ++---------
 5 files changed, 51 insertions(+), 55 deletions(-)

diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
index 02a951e550..515d6d6a92 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -134,17 +134,17 @@ define U-Boot/Mele_M9
   BUILD_DEVICES:=mele_m9
 endef
 
-define U-Boot/OLIMEX_A13_SOM
+define U-Boot/a13-som
   BUILD_SUBTARGET:=cortexa8
   NAME:=Olimex A13 SOM
-  BUILD_DEVICES:=olimex_a13-olimex-som
+  BUILD_DEVICES:=olimex_a13-olinuxino
 endef
 
 define U-Boot/licheepi_nano
   BUILD_SUBTARGET:=arm926ejs
   NAME:=LicheePi Nano
   UENV:=f1c
-  BUILD_DEVICES:=licheepi-nano
+  BUILD_DEVICES:=licheepi_licheepi-nano
 endef
 
 define U-Boot/Linksprite_pcDuino
@@ -268,7 +268,7 @@ define U-Boot/popstick
   BUILD_SUBTARGET:=arm926ejs
   NAME:=PopStick
   UENV:=f1c
-  BUILD_DEVICES:=popstick-v1.1
+  BUILD_DEVICES:=sourceparts_popstick-v1.1
 endef
 
 define U-Boot/libretech_all_h3_cc_h5
@@ -316,16 +316,16 @@ define U-Boot/pine64_plus
   ATF:=a64
 endef
 
-define U-Boot/bananapi_m2_plus_h3
+define U-Boot/bpi_m2_plus_h3
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Plus H3
-  BUILD_DEVICES:=sinovoip_bananapi-m2-plus
+  BUILD_DEVICES:=sinovoip_bpi-m2-plus
 endef
 
-define U-Boot/Sinovoip_BPI_M3
+define U-Boot/bpi_m3
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M3
-  BUILD_DEVICES:=sinovoip_bananapi-m3
+  BUILD_DEVICES:=sinovoip_bpi-m3
 endef
 
 define U-Boot/sopine_baseboard
@@ -382,22 +382,22 @@ define U-Boot/orangepi_zero3
   ATF:=h616
 endef
 
-define U-Boot/Bananapi_M2_Ultra
+define U-Boot/bpi_m2_ultra
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Ultra
-  BUILD_DEVICES:=sinovoip_bananapi-m2-ultra
+  BUILD_DEVICES:=sinovoip_bpi-m2-ultra
 endef
 
-define U-Boot/bananapi_m2_berry
+define U-Boot/bpi_m2_berry
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Berry
-  BUILD_DEVICES:=sinovoip_bananapi-m2-berry
+  BUILD_DEVICES:=sinovoip_bpi-m2-berry
 endef
 
-define U-Boot/bananapi_p2_zero
+define U-Boot/bpi_p2_zero
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi P2 Zero
-  BUILD_DEVICES:=sinovoip_bananapi-p2-zero
+  BUILD_DEVICES:=sinovoip_bpi-p2-zero
 endef
 
 
@@ -406,24 +406,25 @@ UBOOT_TARGETS := \
 	a64-olinuxino-emmc \
 	A10-OLinuXino-Lime \
 	A13-OLinuXino \
+	a13-som \
 	A20-OLinuXino-Lime \
 	A20-OLinuXino-Lime2 \
 	A20-OLinuXino-Lime2-eMMC \
 	A20-OLinuXino_MICRO \
-	bananapi_m2_plus_h3 \
+	beelink_x2 \
+	bpi_m2_berry \
+	bpi_m2_plus_h3 \
+	bpi_m2_ultra \
+	bpi_m3 \
+	bpi_p2_zero \
 	Bananapi \
-	bananapi_m2_berry \
-	bananapi_p2_zero \
-	Bananapi_M2_Ultra \
 	Bananapro \
-	beelink_x2 \
 	Cubieboard \
 	Cubieboard2 \
 	Cubietruck \
 	Hummingbird_A31 \
 	Marsboard_A10 \
 	Mele_M9 \
-	OLIMEX_A13_SOM \
 	licheepi_nano \
 	LicheePi_Zero \
 	Linksprite_pcDuino \
@@ -453,7 +454,6 @@ UBOOT_TARGETS := \
 	pangolin \
 	popstick \
 	pine64_plus \
-	Sinovoip_BPI_M3 \
 	sopine_baseboard \
 	orangepi_zero_plus \
 	libretech_all_h3_cc_h5
diff --git a/target/linux/sunxi/image/arm926ejs.mk b/target/linux/sunxi/image/arm926ejs.mk
index 42d3ee6f29..928133e16e 100644
--- a/target/linux/sunxi/image/arm926ejs.mk
+++ b/target/linux/sunxi/image/arm926ejs.mk
@@ -7,20 +7,21 @@
 
 KERNEL_LOADADDR=0x81000000
 
-define Device/licheepi-nano
+define Device/licheepi_licheepi-nano
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := LicheePi
-  DEVICE_MODEL := Nano
+  DEVICE_MODEL := LicheePi Nano
   DEVICE_PACKAGES := kmod-rtc-sunxi
   SOC := suniv-f1c100s
 endef
-TARGET_DEVICES += licheepi-nano
+TARGET_DEVICES += licheepi_licheepi-nano
 
-define Device/popstick-v1.1
+define Device/sourceparts_popstick-v1.1
   $(call Device/FitImageGzip)
-  DEVICE_VENDOR := PopStick
-  DEVICE_MODEL := v1.1
+  DEVICE_VENDOR := SourceParts
+  DEVICE_MODEL := PopStick
+  DEVICE_VARIANT := v1.1
   DEVICE_PACKAGES := kmod-rtc-sunxi
   SOC := suniv-f1c200s
 endef
-TARGET_DEVICES += popstick-v1.1
+TARGET_DEVICES += sourceparts_popstick-v1.1
diff --git a/target/linux/sunxi/image/cortexa53.mk b/target/linux/sunxi/image/cortexa53.mk
index 49702ebadd..50b286a98f 100644
--- a/target/linux/sunxi/image/cortexa53.mk
+++ b/target/linux/sunxi/image/cortexa53.mk
@@ -39,7 +39,7 @@ endef
 define Device/friendlyarm_nanopi-neo-plus2
   DEVICE_VENDOR := FriendlyARM
   DEVICE_MODEL := NanoPi NEO Plus2
-  SUPPORTED_DEVICES:=nanopi-neo-plus2
+  SUPPORTED_DEVICES += nanopi-neo-plus2
   $(Device/sun50i-h5)
 endef
 TARGET_DEVICES += friendlyarm_nanopi-neo-plus2
@@ -47,7 +47,7 @@ TARGET_DEVICES += friendlyarm_nanopi-neo-plus2
 define Device/friendlyarm_nanopi-neo2
   DEVICE_VENDOR := FriendlyARM
   DEVICE_MODEL := NanoPi NEO2
-  SUPPORTED_DEVICES:=nanopi-neo2
+  SUPPORTED_DEVICES += nanopi-neo2
   $(Device/sun50i-h5)
 endef
 TARGET_DEVICES += friendlyarm_nanopi-neo2
@@ -56,7 +56,7 @@ define Device/friendlyarm_nanopi-r1s-h5
   DEVICE_VENDOR := FriendlyARM
   DEVICE_MODEL := Nanopi R1S H5
   DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-usb-net-rtl8152
-  SUPPORTED_DEVICES:=nanopi-r1s-h5
+  SUPPORTED_DEVICES += nanopi-r1s-h5
   $(Device/sun50i-h5)
 endef
 TARGET_DEVICES += friendlyarm_nanopi-r1s-h5
@@ -109,7 +109,6 @@ define Device/xunlong_orangepi-one-plus
   $(Device/sun50i-h6)
   DEVICE_VENDOR := Xunlong
   DEVICE_MODEL := Orange Pi One Plus
-  SUNXI_DTS_DIR := allwinner/
 endef
 TARGET_DEVICES += xunlong_orangepi-one-plus
 
diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk
index 9b0d12f125..4f0ec9b47a 100644
--- a/target/linux/sunxi/image/cortexa7.mk
+++ b/target/linux/sunxi/image/cortexa7.mk
@@ -92,27 +92,29 @@ define Device/lemaker_bananapi
 endef
 TARGET_DEVICES += lemaker_bananapi
 
-define Device/sinovoip_bananapi-m2-berry
+define Device/sinovoip_bpi-m2-berry
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2 Berry
   DEVICE_PACKAGES:=kmod-ata-sunxi kmod-brcmfmac \
 	cypress-firmware-43430-sdio wpad-basic-mbedtls
-  SUPPORTED_DEVICES:=lemaker,bananapi-m2-berry
+  SUPPORTED_DEVICES += lemaker,bananapi-m2-berry
   SOC := sun8i-v40
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-m2-berry
 endef
-TARGET_DEVICES += sinovoip_bananapi-m2-berry
+TARGET_DEVICES += sinovoip_bpi-m2-berry
 
-define Device/sinovoip_bananapi-m2-ultra
+define Device/sinovoip_bpi-m2-ultra
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2 Ultra
   DEVICE_PACKAGES:=kmod-ata-sunxi kmod-brcmfmac \
 	brcmfmac-firmware-43430a0-sdio wpad-basic-mbedtls
-  SUPPORTED_DEVICES:=lemaker,bananapi-m2-ultra
+  SUPPORTED_DEVICES += lemaker,bananapi-m2-ultra
   SOC := sun8i-r40
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-m2-ultra
 endef
-TARGET_DEVICES += sinovoip_bananapi-m2-ultra
+TARGET_DEVICES += sinovoip_bpi-m2-ultra
 
 define Device/lemaker_bananapro
   $(call Device/FitImageGzip)
@@ -217,35 +219,38 @@ define Device/roofull_beelink-x2
 endef
 TARGET_DEVICES += roofull_beelink-x2
 
-define Device/sinovoip_bananapi-m2-plus
+define Device/sinovoip_bpi-m2-plus
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2+
   DEVICE_PACKAGES:=kmod-leds-gpio kmod-brcmfmac \
 	brcmfmac-firmware-43430a0-sdio wpad-basic-mbedtls
   SOC := sun8i-h3
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-m2-plus
 endef
-TARGET_DEVICES += sinovoip_bananapi-m2-plus
+TARGET_DEVICES += sinovoip_bpi-m2-plus
 
-define Device/sinovoip_bananapi-m3
+define Device/sinovoip_bpi-m3
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M3
   DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-leds-gpio kmod-rtc-ac100 \
 	kmod-brcmfmac cypress-firmware-43430-sdio wpad-basic-mbedtls
   SOC := sun8i-a83t
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-m3
 endef
-TARGET_DEVICES += sinovoip_bananapi-m3
+TARGET_DEVICES += sinovoip_bpi-m3
 
-define Device/sinovoip_bananapi-p2-zero
+define Device/sinovoip_bpi-p2-zero
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi P2 Zero
   DEVICE_PACKAGES:=kmod-leds-gpio kmod-brcmfmac \
 	cypress-firmware-43430-sdio wpad-basic-mbedtls
   SOC := sun8i-h2-plus
+  SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-bananapi-p2-zero
 endef
-TARGET_DEVICES += sinovoip_bananapi-p2-zero
+TARGET_DEVICES += sinovoip_bpi-p2-zero
 
 define Device/xunlong_orangepi-one
   $(call Device/FitImageGzip)
diff --git a/target/linux/sunxi/image/cortexa8.mk b/target/linux/sunxi/image/cortexa8.mk
index f79c8d3513..2ca33163f4 100644
--- a/target/linux/sunxi/image/cortexa8.mk
+++ b/target/linux/sunxi/image/cortexa8.mk
@@ -43,21 +43,12 @@ define Device/olimex_a10-olinuxino-lime
 endef
 TARGET_DEVICES += olimex_a10-olinuxino-lime
 
-define Device/olimex_a13-olimex-som
-  $(call Device/FitImageGzip)
-  DEVICE_VENDOR := Olimex
-  DEVICE_MODEL := A13-SOM
-  DEVICE_PACKAGES:=kmod-rtl8192cu
-  SUPPORTED_DEVICES:=olimex,a13-olinuxino
-  SOC := sun5i-a13
-  SUNXI_DTS := $$(SUNXI_DTS_DIR)sun5i-a13-olinuxino
-endef
-TARGET_DEVICES += olimex_a13-olimex-som
-
 define Device/olimex_a13-olinuxino
   $(call Device/FitImageGzip)
   DEVICE_VENDOR := Olimex
   DEVICE_MODEL := A13-OLinuXino
+  DEVICE_ALT0_VENDOR := Olimex
+  DEVICE_ALT0_MODEL := A13-SOM
   DEVICE_PACKAGES:=kmod-rtl8192cu
   SOC := sun5i
 endef



From lede-commits at lists.infradead.org  Tue Dec 16 01:22:37 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:22:37 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq807x: use ascii-env driver for
 Linksys MX4200v1
In-Reply-To: <176587695754.3897420.10596754110929430290@git-01.infra.openwrt.org>
References: <176587695754.3897420.10596754110929430290@git-01.infra.openwrt.org>
Message-ID: <mailman.36221.1765876964.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f0c534877531a7cafe8f46e05560cc68b1e25dba

commit f0c534877531a7cafe8f46e05560cc68b1e25dba
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Mon Nov 10 23:44:21 2025 +0100

    qualcommax: ipq807x: use ascii-env driver for Linksys MX4200v1
    
    Just like it has already been changed for v2, use the ascii-eq-delim-env
    driver to extract the label mac from the devinfo partition.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20732
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi   | 14 +++++++++++++
 .../arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts  |  7 -------
 .../arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts  | 24 ----------------------
 3 files changed, 14 insertions(+), 31 deletions(-)

diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi
index 612ad6b50d..16fd4b5237 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi
@@ -3,6 +3,12 @@
 
 #include "ipq8174-mx4x00.dtsi"
 
+/ {
+	aliases {
+		label-mac-device = &dp2;
+	};
+};
+
 &tlmm {
 	iot_pins: iot-state {
 		recovery-pins {
@@ -238,23 +244,31 @@
 &dp2 {
 	status = "okay";
 	phy-handle = <&qca8075_1>;
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
 	label = "wan";
 };
 
 &dp3 {
 	status = "okay";
 	phy-handle = <&qca8075_2>;
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
 	label = "lan1";
 };
 
 &dp4 {
 	status = "okay";
 	phy-handle = <&qca8075_3>;
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
 	label = "lan2";
 };
 
 &dp5 {
 	status = "okay";
 	phy-handle = <&qca8075_4>;
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
 	label = "lan3";
 };
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts
index fb09648357..7946e5c54d 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts
@@ -9,13 +9,6 @@
 / {
 	model = "Linksys MX4200v1";
 	compatible = "linksys,mx4200v1", "qcom,ipq8074";
-
-	aliases {
-		ethernet1 = &dp2;
-		ethernet2 = &dp3;
-		ethernet3 = &dp4;
-		ethernet4 = &dp5;
-	};
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts
index da3af3c75b..44e1b72f16 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts
@@ -8,30 +8,6 @@
 / {
 	model = "Linksys MX4200v2";
 	compatible = "linksys,mx4200v2", "qcom,ipq8074";
-
-	aliases {
-		label-mac-device = &dp2;
-	};
-};
-
-&dp2 {
-	nvmem-cells = <&hw_mac_addr 0>;
-	nvmem-cell-names = "mac-address";
-};
-
-&dp3 {
-	nvmem-cells = <&hw_mac_addr 0>;
-	nvmem-cell-names = "mac-address";
-};
-
-&dp4 {
-	nvmem-cells = <&hw_mac_addr 0>;
-	nvmem-cell-names = "mac-address";
-};
-
-&dp5 {
-	nvmem-cells = <&hw_mac_addr 0>;
-	nvmem-cell-names = "mac-address";
 };
 
 &wifi {



From lede-commits at lists.infradead.org  Tue Dec 16 01:24:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:24:20 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq807x: use ascii-env driver for
 Linksys MX4200v1
In-Reply-To: <176587706023.3903304.9267544637238997739@git-01.infra.openwrt.org>
References: <176587706023.3903304.9267544637238997739@git-01.infra.openwrt.org>
Message-ID: <mailman.36222.1765877064.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/d18dfbdcbcde1bf10a491797640bdd2469be5036

commit d18dfbdcbcde1bf10a491797640bdd2469be5036
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Mon Nov 10 23:44:21 2025 +0100

    qualcommax: ipq807x: use ascii-env driver for Linksys MX4200v1
    
    Just like it has already been changed for v2, use the ascii-eq-delim-env
    driver to extract the label mac from the devinfo partition.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20732
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit f0c534877531a7cafe8f46e05560cc68b1e25dba)
---
 .../arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi   | 14 +++++++++++++
 .../arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts  |  7 -------
 .../arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts  | 24 ----------------------
 3 files changed, 14 insertions(+), 31 deletions(-)

diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi
index 612ad6b50d..16fd4b5237 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi
@@ -3,6 +3,12 @@
 
 #include "ipq8174-mx4x00.dtsi"
 
+/ {
+	aliases {
+		label-mac-device = &dp2;
+	};
+};
+
 &tlmm {
 	iot_pins: iot-state {
 		recovery-pins {
@@ -238,23 +244,31 @@
 &dp2 {
 	status = "okay";
 	phy-handle = <&qca8075_1>;
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
 	label = "wan";
 };
 
 &dp3 {
 	status = "okay";
 	phy-handle = <&qca8075_2>;
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
 	label = "lan1";
 };
 
 &dp4 {
 	status = "okay";
 	phy-handle = <&qca8075_3>;
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
 	label = "lan2";
 };
 
 &dp5 {
 	status = "okay";
 	phy-handle = <&qca8075_4>;
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
 	label = "lan3";
 };
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts
index fb09648357..7946e5c54d 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v1.dts
@@ -9,13 +9,6 @@
 / {
 	model = "Linksys MX4200v1";
 	compatible = "linksys,mx4200v1", "qcom,ipq8074";
-
-	aliases {
-		ethernet1 = &dp2;
-		ethernet2 = &dp3;
-		ethernet3 = &dp4;
-		ethernet4 = &dp5;
-	};
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts
index da3af3c75b..44e1b72f16 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200v2.dts
@@ -8,30 +8,6 @@
 / {
 	model = "Linksys MX4200v2";
 	compatible = "linksys,mx4200v2", "qcom,ipq8074";
-
-	aliases {
-		label-mac-device = &dp2;
-	};
-};
-
-&dp2 {
-	nvmem-cells = <&hw_mac_addr 0>;
-	nvmem-cell-names = "mac-address";
-};
-
-&dp3 {
-	nvmem-cells = <&hw_mac_addr 0>;
-	nvmem-cell-names = "mac-address";
-};
-
-&dp4 {
-	nvmem-cells = <&hw_mac_addr 0>;
-	nvmem-cell-names = "mac-address";
-};
-
-&dp5 {
-	nvmem-cells = <&hw_mac_addr 0>;
-	nvmem-cell-names = "mac-address";
 };
 
 &wifi {



From lede-commits at lists.infradead.org  Tue Dec 16 01:27:50 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:27:50 -0500
Subject: [openwrt/openwrt]  ipq-wifi: update to Git HEAD (2025-12-16)
In-Reply-To: <176587727031.3913858.6795244387755642803@git-01.infra.openwrt.org>
References: <176587727031.3913858.6795244387755642803@git-01.infra.openwrt.org>
Message-ID: <mailman.36223.1765877274.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4e688db5a8ae02bf6a2cd5f85812f1095424041e

commit 4e688db5a8ae02bf6a2cd5f85812f1095424041e
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Tue Dec 16 10:27:34 2025 +0100

    ipq-wifi: update to Git HEAD (2025-12-16)
    
    10eddd6f1cba qca4019: qca9888: add bdfs for Netgear RBK40
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/firmware/ipq-wifi/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index ce4fc26541..b5f90c1a10 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -6,9 +6,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
-PKG_SOURCE_DATE:=2025-12-15
-PKG_SOURCE_VERSION:=059b7114c77b861b05784b07f0fa129c2591d171
-PKG_MIRROR_HASH:=6a717318ccf0e16cda89f96c79df6bcf754b291e249495f0e8b618da9b5be709
+PKG_SOURCE_DATE:=2025-12-16
+PKG_SOURCE_VERSION:=10eddd6f1cbabd1972a71526d979033325f958c6
+PKG_MIRROR_HASH:=1fd55a5cf582f131a371d70de5919b7e54c6ecdc078991dd8a2d21469976c12f
 PKG_FLAGS:=nonshared
 
 include $(INCLUDE_DIR)/package.mk



From lede-commits at lists.infradead.org  Tue Dec 16 01:28:22 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:28:22 -0500
Subject: [openwrt/openwrt]  ipq-wifi: update to Git HEAD (2025-12-16)
In-Reply-To: <176587730271.3915416.14752406236230582441@git-01.infra.openwrt.org>
References: <176587730271.3915416.14752406236230582441@git-01.infra.openwrt.org>
Message-ID: <mailman.36226.1765877306.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/872fd1f0b690c4a1c104defced4a411c8e830f3f

commit 872fd1f0b690c4a1c104defced4a411c8e830f3f
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Tue Dec 16 10:27:34 2025 +0100

    ipq-wifi: update to Git HEAD (2025-12-16)
    
    10eddd6f1cba qca4019: qca9888: add bdfs for Netgear RBK40
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 4e688db5a8ae02bf6a2cd5f85812f1095424041e)
---
 package/firmware/ipq-wifi/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index ce4fc26541..b5f90c1a10 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -6,9 +6,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
-PKG_SOURCE_DATE:=2025-12-15
-PKG_SOURCE_VERSION:=059b7114c77b861b05784b07f0fa129c2591d171
-PKG_MIRROR_HASH:=6a717318ccf0e16cda89f96c79df6bcf754b291e249495f0e8b618da9b5be709
+PKG_SOURCE_DATE:=2025-12-16
+PKG_SOURCE_VERSION:=10eddd6f1cbabd1972a71526d979033325f958c6
+PKG_MIRROR_HASH:=1fd55a5cf582f131a371d70de5919b7e54c6ecdc078991dd8a2d21469976c12f
 PKG_FLAGS:=nonshared
 
 include $(INCLUDE_DIR)/package.mk



From lede-commits at lists.infradead.org  Tue Dec 16 01:29:39 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:29:39 -0500
Subject: [openwrt/openwrt]  ipq40xx: fix Netgear RBR40 wan mac
In-Reply-To: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
References: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
Message-ID: <mailman.36227.1765877381.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0f0f578d0af408ea14b001cac82a8c1996c6ada0

commit 0f0f578d0af408ea14b001cac82a8c1996c6ada0
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 20:25:29 2025 +0100

    ipq40xx: fix Netgear RBR40 wan mac
    
    The WAN port currently has the same MAC set as all the other LAN ports.
    Fix this by adding the missing case in ipq40xx_setup_macs().
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/ipq40xx/base-files/etc/board.d/02_network | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 29c437037d..9b1ea2994a 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -244,6 +244,7 @@ ipq40xx_setup_macs()
 		lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
 		label_mac="$lan_mac"
 		;;
+	netgear,rbr40|\
 	netgear,rbr50|\
 	netgear,srr60|\
 	pakedge,wr-1)



From lede-commits at lists.infradead.org  Tue Dec 16 01:29:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:29:38 -0500
Subject: [openwrt/openwrt]  ipq40xx: split orbi devices in router and
 satellite
In-Reply-To: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
References: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
Message-ID: <mailman.36228.1765877381.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/314dbb7fec81c8fbadf22f87837ae98dbd268a29

commit 314dbb7fec81c8fbadf22f87837ae98dbd268a29
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 20:20:14 2025 +0100

    ipq40xx: split orbi devices in router and satellite
    
    Netgear Orbi devices are split into router and satellite units. Even
    though the hardware is mostly the same, the network configuration is
    different. Router units have a designated WAN port while satellite units
    have all available ports labeled as "Ethernet".
    This splits the device trees into both unit types and adjusts the port
    labels.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../ipq40xx/base-files/etc/board.d/02_network      | 12 ++++------
 .../boot/dts/qcom/qcom-ipq4019-orbi-router.dtsi    | 27 ++++++++++++++++++++++
 .../boot/dts/qcom/qcom-ipq4019-orbi-satellite.dtsi | 27 ++++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi  | 24 -------------------
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts  |  2 +-
 10 files changed, 65 insertions(+), 37 deletions(-)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 773cb5a2ff..29c437037d 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -70,14 +70,14 @@ ipq40xx_setup_interfaces()
 	buffalo,wtr-m2133hp|\
 	ezviz,cs-w3-wd1200g-eup|\
 	netgear,rbr40|\
-	netgear,rbs40|\
 	netgear,rbr50|\
-	netgear,rbs50|\
-	netgear,srr60|\
-	netgear,srs60)
+	netgear,srr60)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
 		;;
-	avm,fritzbox-7530)
+	avm,fritzbox-7530|\
+	netgear,rbs40|\
+	netgear,rbs50|\
+	netgear,srs60)
 		ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
 		;;
 	avm,fritzrepeater-3000|\
@@ -245,9 +245,7 @@ ipq40xx_setup_macs()
 		label_mac="$lan_mac"
 		;;
 	netgear,rbr50|\
-	netgear,rbs50|\
 	netgear,srr60|\
-	netgear,srs60|\
 	pakedge,wr-1)
 		wan_mac=$(macaddr_add $(get_mac_label) 1)
 		;;
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-router.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-router.dtsi
new file mode 100644
index 0000000000..6bdd82887d
--- /dev/null
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-router.dtsi
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qcom-ipq4019-orbi.dtsi"
+
+&swport1 {
+	status = "okay";
+
+	label = "wan";
+};
+
+&swport2 {
+	status = "okay";
+
+	label = "lan1";
+};
+
+&swport3 {
+	status = "okay";
+
+	label = "lan2";
+};
+
+&swport4 {
+	status = "okay";
+
+	label = "lan3";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-satellite.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-satellite.dtsi
new file mode 100644
index 0000000000..b2c40f8f6a
--- /dev/null
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-satellite.dtsi
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qcom-ipq4019-orbi.dtsi"
+
+&swport1 {
+	status = "okay";
+
+	label = "lan1";
+};
+
+&swport2 {
+	status = "okay";
+
+	label = "lan2";
+};
+
+&swport3 {
+	status = "okay";
+
+	label = "lan3";
+};
+
+&swport4 {
+	status = "okay";
+
+	label = "lan4";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
index ef88bb02a2..10aa56de27 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
@@ -278,30 +278,6 @@
 	status = "okay";
 };
 
-&swport1 {
-	status = "okay";
-
-	label = "wan";
-};
-
-&swport2 {
-	status = "okay";
-
-	label = "lan1";
-};
-
-&swport3 {
-	status = "okay";
-
-	label = "lan2";
-};
-
-&swport4 {
-	status = "okay";
-
-	label = "lan3";
-};
-
 &ethphy4 {
 	status = "disabled";
 };
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
index 26e87b808c..1c579dcdfb 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-router.dtsi"
 
 / {
 	model = "NETGEAR RBR40";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
index f83f75b464..81e846fb1f 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-router.dtsi"
 
 / {
 	model = "NETGEAR RBR50";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
index 2dfa0c9654..6ff0ed8bb1 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-satellite.dtsi"
 
 / {
 	model = "NETGEAR RBS40";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
index 9151c5d33c..3ac6df3761 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-satellite.dtsi"
 
 / {
 	model = "NETGEAR RBS50";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
index 80bcb2e204..c137b41ee8 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-router.dtsi"
 
 / {
 	model = "NETGEAR SRR60";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
index 65bb7ac397..5b09e1ee24 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-satellite.dtsi"
 
 / {
 	model = "NETGEAR SRS60";



From lede-commits at lists.infradead.org  Tue Dec 16 01:29:42 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:29:42 -0500
Subject: [openwrt/openwrt]  ipq40xx: convert Orbi led labels to function/color
In-Reply-To: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
References: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
Message-ID: <mailman.36229.1765877382.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3045f205b379b160af3b3af16fc976cc216f0248

commit 3045f205b379b160af3b3af16fc976cc216f0248
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 22:34:04 2025 +0100

    ipq40xx: convert Orbi led labels to function/color
    
    The eight leds controlled by the LED controller are RGB leds themselves
    but are flashing white by default. The color part is controlled by GPIOs
    53 (green), 54 (red), 57 (blue) and 60 (white).
    Therefore define the led nodes of the controller as white instead of RBG
    as well as backlight as their function.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi  | 32 ++++++++++++++++------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
index 9e58e0de40..1ef49f7fa1 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
@@ -204,49 +204,65 @@
 		reg = <0x27>;
 
 		led0 at 0 {
-			label = "rgb:led0";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <0>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x0>;
 			linux,default-trigger = "default-on";
 		};
 
 		led1 at 1 {
-			label = "rgb:led1";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <1>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x1>;
 			linux,default-trigger = "default-on";
 		};
 
 		led2 at 2 {
-			label = "rgb:led2";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <2>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x2>;
 			linux,default-trigger = "default-on";
 		};
 
 		led3 at 3 {
-			label = "rgb:led3";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <3>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x3>;
 			linux,default-trigger = "default-on";
 		};
 
 		led4 at 4 {
-			label = "rgb:led4";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <4>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x4>;
 			linux,default-trigger = "default-on";
 		};
 
 		led5 at 5 {
-			label = "rgb:led5";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <5>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x5>;
 			linux,default-trigger = "default-on";
 		};
 
 		led6 at 6 {
-			label = "rgb:led6";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <6>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x6>;
 			linux,default-trigger = "default-on";
 		};
 
 		led7 at 7 {
-			label = "rgb:led7";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <7>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x7>;
 			linux,default-trigger = "default-on";
 		};



From lede-commits at lists.infradead.org  Tue Dec 16 01:29:40 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:29:40 -0500
Subject: [openwrt/openwrt]  ipq-wifi: add entry for Netgear RBK40
In-Reply-To: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
References: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
Message-ID: <mailman.36230.1765877383.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e9d6015beff08bb8e5b18d502aa0f059eda3b1e8

commit e9d6015beff08bb8e5b18d502aa0f059eda3b1e8
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 20:40:49 2025 +0100

    ipq-wifi: add entry for Netgear RBK40
    
    Add boardfile override packages for Netgear RBK40 devices.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/firmware/ipq-wifi/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index b5f90c1a10..1106de7fc4 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -63,6 +63,7 @@ ALLWIFIBOARDS:= \
 	netgear_lbr20 \
 	netgear_rax120v2 \
 	netgear_rbk20 \
+	netgear_rbk40 \
 	netgear_sxk80 \
 	netgear_wax214 \
 	netgear_wax218 \
@@ -242,6 +243,7 @@ $(eval $(call generate-ipq-wifi-package,meraki_z3,Meraki Z3))
 $(eval $(call generate-ipq-wifi-package,netgear_lbr20,Netgear LBR20))
 $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))
 $(eval $(call generate-ipq-wifi-package,netgear_rbk20,Netgear RBK20))
+$(eval $(call generate-ipq-wifi-package,netgear_rbk40,Netgear RBK40))
 $(eval $(call generate-ipq-wifi-package,netgear_sxk80,Netgear SXK80))
 $(eval $(call generate-ipq-wifi-package,netgear_wax214,Netgear WAX214))
 $(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218))



From lede-commits at lists.infradead.org  Tue Dec 16 01:29:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:29:41 -0500
Subject: [openwrt/openwrt]  ipq40xx: fix second 5ghz radio on Netgear RBx40
In-Reply-To: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
References: <176587737828.3918524.1347627817296352706@git-01.infra.openwrt.org>
Message-ID: <mailman.36233.1765877383.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f0909f7a05cbc0f3d91bae55df2d251f065a5b68

commit f0909f7a05cbc0f3d91bae55df2d251f065a5b68
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 20:42:33 2025 +0100

    ipq40xx: fix second 5ghz radio on Netgear RBx40
    
    When support was added for the RBR40 and RBS40 it was assumed that they
    also share the same second 5ghz wifi chip as their bigger siblings.
    Turns out that instead of QCA9984 (RBx50, SRx60) these devices use
    QCA9886 like the RBx20 devices to.
    They also load different boardfiles for the IPQ4019 chip.
    
    This moves the wifi nodes from the orbi.dtsi to each device dts file and
    change the RBx40 boardfile variants.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi   | 21 ---------------------
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts   | 21 +++++++++++++++++++++
 target/linux/ipq40xx/image/generic.mk               |  5 ++++-
 8 files changed, 130 insertions(+), 22 deletions(-)

diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
index 10aa56de27..9e58e0de40 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
@@ -288,24 +288,3 @@
 	perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
 	wake-gpios = <&tlmm 50 GPIO_ACTIVE_LOW>;
 };
-
-&pcie_bridge0 {
-	wifi at 0,0 {
-		compatible = "qcom,ath10k";
-		reg = <0x00010000 0 0 0 0>;
-		ieee80211-freq-limit = <5470000 5875000>;
-		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
-	};
-};
-
-&wifi0 {
-	status = "okay";
-
-	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
-};
-
-&wifi1 {
-	status = "okay";
-
-	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
-};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
index 1c579dcdfb..799a1df1df 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
@@ -10,3 +10,24 @@
 		bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K at 17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K at 9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squas [...]
 	};
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5170000 5350000>;
+		qcom,ath10k-calibration-variant = "Netgear-RBK40";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-RBK40";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-RBK40";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
index 81e846fb1f..902ee821ee 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
@@ -26,3 +26,24 @@
 &usb2 {
 	status = "okay";
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5470000 5875000>;
+		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
index 6ff0ed8bb1..882af0bb61 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
@@ -10,3 +10,24 @@
 		bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K at 17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K at 9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squas [...]
 	};
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5170000 5350000>;
+		qcom,ath10k-calibration-variant = "Netgear-RBK40";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-RBK40";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-RBK40";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
index 3ac6df3761..5453ad5f6d 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
@@ -26,3 +26,24 @@
 &usb2 {
 	status = "okay";
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5470000 5875000>;
+		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
index c137b41ee8..0e1d855255 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
@@ -10,3 +10,24 @@
 		bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K at 17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K at 9233K(firmware),256K(mtdoops)ro,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K at 44 [...]
 	};
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5470000 5875000>;
+		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
index 5b09e1ee24..70b4b896a7 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
@@ -10,3 +10,24 @@
 		bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K at 17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K at 9233K(firmware),256K(mtdoops)ro,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K at 44 [...]
 	};
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5470000 5875000>;
+		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index 36f7e4047f..1d02a2fc1f 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -904,7 +904,7 @@ define Device/netgear_orbi
 		append-rootfs | pad-rootfs | netgear-dni
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | \
 		sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs kmod-fs-ext4 losetup
+	DEVICE_PACKAGES := e2fsprogs kmod-fs-ext4 losetup
 endef
 
 define Device/netgear_lbr20
@@ -967,6 +967,7 @@ define Device/netgear_rbx40
 	KERNEL_SIZE := 3932160
 	ROOTFS_SIZE := 32243712
 	IMAGE_SIZE := 36175872
+	DEVICE_PACKAGES += ipq-wifi-netgear_rbk40 ath10k-firmware-qca9888-ct
 endef
 
 define Device/netgear_rbr40
@@ -991,6 +992,7 @@ define Device/netgear_rbx50
 	KERNEL_SIZE := 3932160
 	ROOTFS_SIZE := 32243712
 	IMAGE_SIZE := 36175872
+	DEVICE_PACKAGES += ath10k-firmware-qca9984-ct
 endef
 
 define Device/netgear_rbr50
@@ -1015,6 +1017,7 @@ define Device/netgear_srx60
 	KERNEL_SIZE := 3932160
 	ROOTFS_SIZE := 32243712
 	IMAGE_SIZE := 36175872
+	DEVICE_PACKAGES += ath10k-firmware-qca9984-ct
 endef
 
 define Device/netgear_srr60



From lede-commits at lists.infradead.org  Tue Dec 16 01:30:31 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:30:31 -0500
Subject: [openwrt/openwrt]  ipq-wifi: add entry for Netgear RBK40
In-Reply-To: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
References: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
Message-ID: <mailman.36234.1765877433.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/368c9c0c991fe224774eafde21b3c9ef8ed26d11

commit 368c9c0c991fe224774eafde21b3c9ef8ed26d11
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 20:40:49 2025 +0100

    ipq-wifi: add entry for Netgear RBK40
    
    Add boardfile override packages for Netgear RBK40 devices.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit e9d6015beff08bb8e5b18d502aa0f059eda3b1e8)
---
 package/firmware/ipq-wifi/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index b5f90c1a10..1106de7fc4 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -63,6 +63,7 @@ ALLWIFIBOARDS:= \
 	netgear_lbr20 \
 	netgear_rax120v2 \
 	netgear_rbk20 \
+	netgear_rbk40 \
 	netgear_sxk80 \
 	netgear_wax214 \
 	netgear_wax218 \
@@ -242,6 +243,7 @@ $(eval $(call generate-ipq-wifi-package,meraki_z3,Meraki Z3))
 $(eval $(call generate-ipq-wifi-package,netgear_lbr20,Netgear LBR20))
 $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))
 $(eval $(call generate-ipq-wifi-package,netgear_rbk20,Netgear RBK20))
+$(eval $(call generate-ipq-wifi-package,netgear_rbk40,Netgear RBK40))
 $(eval $(call generate-ipq-wifi-package,netgear_sxk80,Netgear SXK80))
 $(eval $(call generate-ipq-wifi-package,netgear_wax214,Netgear WAX214))
 $(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218))



From lede-commits at lists.infradead.org  Tue Dec 16 01:30:33 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:30:33 -0500
Subject: [openwrt/openwrt]  ipq40xx: convert Orbi led labels to function/color
In-Reply-To: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
References: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
Message-ID: <mailman.36235.1765877434.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/86ebe649c27f97fc298f034da2d6a96fd61cdc5c

commit 86ebe649c27f97fc298f034da2d6a96fd61cdc5c
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 22:34:04 2025 +0100

    ipq40xx: convert Orbi led labels to function/color
    
    The eight leds controlled by the LED controller are RGB leds themselves
    but are flashing white by default. The color part is controlled by GPIOs
    53 (green), 54 (red), 57 (blue) and 60 (white).
    Therefore define the led nodes of the controller as white instead of RBG
    as well as backlight as their function.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 3045f205b379b160af3b3af16fc976cc216f0248)
---
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi  | 32 ++++++++++++++++------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
index 9e58e0de40..1ef49f7fa1 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
@@ -204,49 +204,65 @@
 		reg = <0x27>;
 
 		led0 at 0 {
-			label = "rgb:led0";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <0>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x0>;
 			linux,default-trigger = "default-on";
 		};
 
 		led1 at 1 {
-			label = "rgb:led1";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <1>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x1>;
 			linux,default-trigger = "default-on";
 		};
 
 		led2 at 2 {
-			label = "rgb:led2";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <2>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x2>;
 			linux,default-trigger = "default-on";
 		};
 
 		led3 at 3 {
-			label = "rgb:led3";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <3>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x3>;
 			linux,default-trigger = "default-on";
 		};
 
 		led4 at 4 {
-			label = "rgb:led4";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <4>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x4>;
 			linux,default-trigger = "default-on";
 		};
 
 		led5 at 5 {
-			label = "rgb:led5";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <5>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x5>;
 			linux,default-trigger = "default-on";
 		};
 
 		led6 at 6 {
-			label = "rgb:led6";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <6>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x6>;
 			linux,default-trigger = "default-on";
 		};
 
 		led7 at 7 {
-			label = "rgb:led7";
+			function = LED_FUNCTION_BACKLIGHT;
+			function-enumerator = <7>;
+			color = <LED_COLOR_ID_WHITE>;
 			reg = <0x7>;
 			linux,default-trigger = "default-on";
 		};



From lede-commits at lists.infradead.org  Tue Dec 16 01:30:32 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:30:32 -0500
Subject: [openwrt/openwrt]  ipq40xx: fix second 5ghz radio on Netgear RBx40
In-Reply-To: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
References: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
Message-ID: <mailman.36236.1765877434.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/ce54f6e893a11a4f02169217db77ecbd79c39c5d

commit ce54f6e893a11a4f02169217db77ecbd79c39c5d
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 20:42:33 2025 +0100

    ipq40xx: fix second 5ghz radio on Netgear RBx40
    
    When support was added for the RBR40 and RBS40 it was assumed that they
    also share the same second 5ghz wifi chip as their bigger siblings.
    Turns out that instead of QCA9984 (RBx50, SRx60) these devices use
    QCA9886 like the RBx20 devices to.
    They also load different boardfiles for the IPQ4019 chip.
    
    This moves the wifi nodes from the orbi.dtsi to each device dts file and
    change the RBx40 boardfile variants.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit f0909f7a05cbc0f3d91bae55df2d251f065a5b68)
---
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi   | 21 ---------------------
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts   | 21 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts   | 21 +++++++++++++++++++++
 target/linux/ipq40xx/image/generic.mk               |  5 ++++-
 8 files changed, 130 insertions(+), 22 deletions(-)

diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
index 10aa56de27..9e58e0de40 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
@@ -288,24 +288,3 @@
 	perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
 	wake-gpios = <&tlmm 50 GPIO_ACTIVE_LOW>;
 };
-
-&pcie_bridge0 {
-	wifi at 0,0 {
-		compatible = "qcom,ath10k";
-		reg = <0x00010000 0 0 0 0>;
-		ieee80211-freq-limit = <5470000 5875000>;
-		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
-	};
-};
-
-&wifi0 {
-	status = "okay";
-
-	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
-};
-
-&wifi1 {
-	status = "okay";
-
-	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
-};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
index 1c579dcdfb..799a1df1df 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
@@ -10,3 +10,24 @@
 		bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K at 17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K at 9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squas [...]
 	};
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5170000 5350000>;
+		qcom,ath10k-calibration-variant = "Netgear-RBK40";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-RBK40";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-RBK40";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
index 81e846fb1f..902ee821ee 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
@@ -26,3 +26,24 @@
 &usb2 {
 	status = "okay";
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5470000 5875000>;
+		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
index 6ff0ed8bb1..882af0bb61 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
@@ -10,3 +10,24 @@
 		bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K at 17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K at 9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squas [...]
 	};
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5170000 5350000>;
+		qcom,ath10k-calibration-variant = "Netgear-RBK40";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-RBK40";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-RBK40";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
index 3ac6df3761..5453ad5f6d 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
@@ -26,3 +26,24 @@
 &usb2 {
 	status = "okay";
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5470000 5875000>;
+		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
index c137b41ee8..0e1d855255 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
@@ -10,3 +10,24 @@
 		bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K at 17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K at 9233K(firmware),256K(mtdoops)ro,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K at 44 [...]
 	};
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5470000 5875000>;
+		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
index 5b09e1ee24..70b4b896a7 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
@@ -10,3 +10,24 @@
 		bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K at 17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K at 9233K(firmware),256K(mtdoops)ro,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K at 44 [...]
 	};
 };
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		ieee80211-freq-limit = <5470000 5875000>;
+		qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+	};
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60";
+};
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index 36f7e4047f..1d02a2fc1f 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -904,7 +904,7 @@ define Device/netgear_orbi
 		append-rootfs | pad-rootfs | netgear-dni
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | \
 		sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs kmod-fs-ext4 losetup
+	DEVICE_PACKAGES := e2fsprogs kmod-fs-ext4 losetup
 endef
 
 define Device/netgear_lbr20
@@ -967,6 +967,7 @@ define Device/netgear_rbx40
 	KERNEL_SIZE := 3932160
 	ROOTFS_SIZE := 32243712
 	IMAGE_SIZE := 36175872
+	DEVICE_PACKAGES += ipq-wifi-netgear_rbk40 ath10k-firmware-qca9888-ct
 endef
 
 define Device/netgear_rbr40
@@ -991,6 +992,7 @@ define Device/netgear_rbx50
 	KERNEL_SIZE := 3932160
 	ROOTFS_SIZE := 32243712
 	IMAGE_SIZE := 36175872
+	DEVICE_PACKAGES += ath10k-firmware-qca9984-ct
 endef
 
 define Device/netgear_rbr50
@@ -1015,6 +1017,7 @@ define Device/netgear_srx60
 	KERNEL_SIZE := 3932160
 	ROOTFS_SIZE := 32243712
 	IMAGE_SIZE := 36175872
+	DEVICE_PACKAGES += ath10k-firmware-qca9984-ct
 endef
 
 define Device/netgear_srr60



From lede-commits at lists.infradead.org  Tue Dec 16 01:30:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:30:29 -0500
Subject: [openwrt/openwrt]  ipq40xx: split orbi devices in router and
 satellite
In-Reply-To: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
References: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
Message-ID: <mailman.36239.1765877434.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/8e5cdd84eb9da36ad98b53e1da8cc30e9078be54

commit 8e5cdd84eb9da36ad98b53e1da8cc30e9078be54
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 20:20:14 2025 +0100

    ipq40xx: split orbi devices in router and satellite
    
    Netgear Orbi devices are split into router and satellite units. Even
    though the hardware is mostly the same, the network configuration is
    different. Router units have a designated WAN port while satellite units
    have all available ports labeled as "Ethernet".
    This splits the device trees into both unit types and adjusts the port
    labels.
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 314dbb7fec81c8fbadf22f87837ae98dbd268a29)
---
 .../ipq40xx/base-files/etc/board.d/02_network      | 12 ++++------
 .../boot/dts/qcom/qcom-ipq4019-orbi-router.dtsi    | 27 ++++++++++++++++++++++
 .../boot/dts/qcom/qcom-ipq4019-orbi-satellite.dtsi | 27 ++++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi  | 24 -------------------
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts  |  2 +-
 .../arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts  |  2 +-
 10 files changed, 65 insertions(+), 37 deletions(-)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 773cb5a2ff..29c437037d 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -70,14 +70,14 @@ ipq40xx_setup_interfaces()
 	buffalo,wtr-m2133hp|\
 	ezviz,cs-w3-wd1200g-eup|\
 	netgear,rbr40|\
-	netgear,rbs40|\
 	netgear,rbr50|\
-	netgear,rbs50|\
-	netgear,srr60|\
-	netgear,srs60)
+	netgear,srr60)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
 		;;
-	avm,fritzbox-7530)
+	avm,fritzbox-7530|\
+	netgear,rbs40|\
+	netgear,rbs50|\
+	netgear,srs60)
 		ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
 		;;
 	avm,fritzrepeater-3000|\
@@ -245,9 +245,7 @@ ipq40xx_setup_macs()
 		label_mac="$lan_mac"
 		;;
 	netgear,rbr50|\
-	netgear,rbs50|\
 	netgear,srr60|\
-	netgear,srs60|\
 	pakedge,wr-1)
 		wan_mac=$(macaddr_add $(get_mac_label) 1)
 		;;
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-router.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-router.dtsi
new file mode 100644
index 0000000000..6bdd82887d
--- /dev/null
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-router.dtsi
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qcom-ipq4019-orbi.dtsi"
+
+&swport1 {
+	status = "okay";
+
+	label = "wan";
+};
+
+&swport2 {
+	status = "okay";
+
+	label = "lan1";
+};
+
+&swport3 {
+	status = "okay";
+
+	label = "lan2";
+};
+
+&swport4 {
+	status = "okay";
+
+	label = "lan3";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-satellite.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-satellite.dtsi
new file mode 100644
index 0000000000..b2c40f8f6a
--- /dev/null
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi-satellite.dtsi
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qcom-ipq4019-orbi.dtsi"
+
+&swport1 {
+	status = "okay";
+
+	label = "lan1";
+};
+
+&swport2 {
+	status = "okay";
+
+	label = "lan2";
+};
+
+&swport3 {
+	status = "okay";
+
+	label = "lan3";
+};
+
+&swport4 {
+	status = "okay";
+
+	label = "lan4";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
index ef88bb02a2..10aa56de27 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-orbi.dtsi
@@ -278,30 +278,6 @@
 	status = "okay";
 };
 
-&swport1 {
-	status = "okay";
-
-	label = "wan";
-};
-
-&swport2 {
-	status = "okay";
-
-	label = "lan1";
-};
-
-&swport3 {
-	status = "okay";
-
-	label = "lan2";
-};
-
-&swport4 {
-	status = "okay";
-
-	label = "lan3";
-};
-
 &ethphy4 {
 	status = "disabled";
 };
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
index 26e87b808c..1c579dcdfb 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr40.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-router.dtsi"
 
 / {
 	model = "NETGEAR RBR40";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
index f83f75b464..81e846fb1f 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbr50.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-router.dtsi"
 
 / {
 	model = "NETGEAR RBR50";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
index 2dfa0c9654..6ff0ed8bb1 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs40.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-satellite.dtsi"
 
 / {
 	model = "NETGEAR RBS40";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
index 9151c5d33c..3ac6df3761 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-rbs50.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-satellite.dtsi"
 
 / {
 	model = "NETGEAR RBS50";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
index 80bcb2e204..c137b41ee8 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srr60.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-router.dtsi"
 
 / {
 	model = "NETGEAR SRR60";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
index 65bb7ac397..5b09e1ee24 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4019-srs60.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qcom-ipq4019-orbi.dtsi"
+#include "qcom-ipq4019-orbi-satellite.dtsi"
 
 / {
 	model = "NETGEAR SRS60";



From lede-commits at lists.infradead.org  Tue Dec 16 01:30:30 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 04:30:30 -0500
Subject: [openwrt/openwrt]  ipq40xx: fix Netgear RBR40 wan mac
In-Reply-To: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
References: <176587742902.3921334.11410067154585076735@git-01.infra.openwrt.org>
Message-ID: <mailman.36240.1765877435.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/d4274a10f65d08ee4ecc113d0b0a9bdcbd7a542b

commit d4274a10f65d08ee4ecc113d0b0a9bdcbd7a542b
Author: Christoph Krapp <achterin at gmail.com>
AuthorDate: Sat Nov 22 20:25:29 2025 +0100

    ipq40xx: fix Netgear RBR40 wan mac
    
    The WAN port currently has the same MAC set as all the other LAN ports.
    Fix this by adding the missing case in ipq40xx_setup_macs().
    
    Signed-off-by: Christoph Krapp <achterin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20877
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 0f0f578d0af408ea14b001cac82a8c1996c6ada0)
---
 target/linux/ipq40xx/base-files/etc/board.d/02_network | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 29c437037d..9b1ea2994a 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -244,6 +244,7 @@ ipq40xx_setup_macs()
 		lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
 		label_mac="$lan_mac"
 		;;
+	netgear,rbr40|\
 	netgear,rbr50|\
 	netgear,srr60|\
 	pakedge,wr-1)



From lede-commits at lists.infradead.org  Tue Dec 16 04:11:37 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:11:37 -0500
Subject: [openwrt/openwrt]  realtek: mdio-serdes: improve debugfs creation
In-Reply-To: <176588709755.160368.9431581764391767934@git-01.infra.openwrt.org>
References: <176588709755.160368.9431581764391767934@git-01.infra.openwrt.org>
Message-ID: <mailman.36281.1765887102.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8e4730fd60a1b4998d1c9c07aeb6c6a27bce210f

commit 8e4730fd60a1b4998d1c9c07aeb6c6a27bce210f
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Tue Dec 16 10:20:13 2025 +0000

    realtek: mdio-serdes: improve debugfs creation
    
    Commit 3c073b5cb2 cleaned up the debugfs creation in
    mdio-realtek-otto-serdes driver to not explicitly check if the root
    directory already exists. This is fine because kernel handles the case
    properly so there's no need to check anymore.
    
    However, this pollutes the boot log with:
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    
    Now, the root directory creation is attempted multiple times, causing
    the kernel to print an error message because the directory already
    exists.
    
    Fix this by moving the SerDes loop into rtsds_debug_init and only try
    to create the root debugfs directory once.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21179
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../drivers/net/mdio/mdio-realtek-otto-serdes.c    | 28 ++++++++++++----------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 5c8741383f..097fcc41b4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -142,27 +142,30 @@ static int rtsds_dbg_registers_show(struct seq_file *seqf, void *unused)
 }
 DEFINE_SHOW_ATTRIBUTE(rtsds_dbg_registers);
 
-static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds)
+static int rtsds_debug_init(struct rtsds_ctrl *ctrl)
 {
 	struct rtsds_debug_info *dbg_info;
 	struct dentry *dir, *root;
 	char dirname[32];
 
-	dbg_info = devm_kzalloc(ctrl->dev, sizeof(*dbg_info), GFP_KERNEL);
-	if (!dbg_info)
-		return -ENOMEM;
-
-	dbg_info->ctrl = ctrl;
-	dbg_info->sds = sds;
-
 	root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL);
 	if (IS_ERR(root))
 		return PTR_ERR(root);
 
-	snprintf(dirname, sizeof(dirname), "serdes.%d", sds);
-	dir = debugfs_create_dir(dirname, root);
+	for (int sds = 0; sds < ctrl->cfg->sds_cnt; sds++) {
+		dbg_info = devm_kzalloc(ctrl->dev, sizeof(*dbg_info), GFP_KERNEL);
+		if (!dbg_info)
+			return -ENOMEM;
 
-	debugfs_create_file("registers", 0600, dir, dbg_info, &rtsds_dbg_registers_fops);
+		dbg_info->ctrl = ctrl;
+		dbg_info->sds = sds;
+
+		snprintf(dirname, sizeof(dirname), "serdes.%d", sds);
+		dir = debugfs_create_dir(dirname, root);
+
+		debugfs_create_file("registers", 0600, dir, dbg_info,
+				    &rtsds_dbg_registers_fops);
+	}
 
 	return 0;
 }
@@ -461,8 +464,7 @@ static int rtsds_probe(struct platform_device *pdev)
 		return ret;
 
 #ifdef CONFIG_DEBUG_FS
-	for (int sds = 0; sds < ctrl->cfg->sds_cnt; sds++)
-		rtsds_debug_init(ctrl, sds);
+	rtsds_debug_init(ctrl);
 #endif
 
 	dev_info(dev, "Realtek SerDes mdio bus initialized, %d SerDes, %d pages, %d registers\n",



From lede-commits at lists.infradead.org  Tue Dec 16 04:12:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:12:18 -0500
Subject: [openwrt/openwrt]  realtek: mdio-serdes: improve debugfs creation
In-Reply-To: <176588713875.164399.839072859205711160@git-01.infra.openwrt.org>
References: <176588713875.164399.839072859205711160@git-01.infra.openwrt.org>
Message-ID: <mailman.36282.1765887143.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/2e56a1ffc6914d60201fa3fce9b82e089148feb4

commit 2e56a1ffc6914d60201fa3fce9b82e089148feb4
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Tue Dec 16 10:20:13 2025 +0000

    realtek: mdio-serdes: improve debugfs creation
    
    Commit 3c073b5cb2 cleaned up the debugfs creation in
    mdio-realtek-otto-serdes driver to not explicitly check if the root
    directory already exists. This is fine because kernel handles the case
    properly so there's no need to check anymore.
    
    However, this pollutes the boot log with:
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    [..] debugfs: 'realtek_otto_serdes' already exists in '/'
    
    Now, the root directory creation is attempted multiple times, causing
    the kernel to print an error message because the directory already
    exists.
    
    Fix this by moving the SerDes loop into rtsds_debug_init and only try
    to create the root debugfs directory once.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21179
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 8e4730fd60a1b4998d1c9c07aeb6c6a27bce210f)
---
 .../drivers/net/mdio/mdio-realtek-otto-serdes.c    | 28 ++++++++++++----------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 5c8741383f..097fcc41b4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -142,27 +142,30 @@ static int rtsds_dbg_registers_show(struct seq_file *seqf, void *unused)
 }
 DEFINE_SHOW_ATTRIBUTE(rtsds_dbg_registers);
 
-static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds)
+static int rtsds_debug_init(struct rtsds_ctrl *ctrl)
 {
 	struct rtsds_debug_info *dbg_info;
 	struct dentry *dir, *root;
 	char dirname[32];
 
-	dbg_info = devm_kzalloc(ctrl->dev, sizeof(*dbg_info), GFP_KERNEL);
-	if (!dbg_info)
-		return -ENOMEM;
-
-	dbg_info->ctrl = ctrl;
-	dbg_info->sds = sds;
-
 	root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL);
 	if (IS_ERR(root))
 		return PTR_ERR(root);
 
-	snprintf(dirname, sizeof(dirname), "serdes.%d", sds);
-	dir = debugfs_create_dir(dirname, root);
+	for (int sds = 0; sds < ctrl->cfg->sds_cnt; sds++) {
+		dbg_info = devm_kzalloc(ctrl->dev, sizeof(*dbg_info), GFP_KERNEL);
+		if (!dbg_info)
+			return -ENOMEM;
 
-	debugfs_create_file("registers", 0600, dir, dbg_info, &rtsds_dbg_registers_fops);
+		dbg_info->ctrl = ctrl;
+		dbg_info->sds = sds;
+
+		snprintf(dirname, sizeof(dirname), "serdes.%d", sds);
+		dir = debugfs_create_dir(dirname, root);
+
+		debugfs_create_file("registers", 0600, dir, dbg_info,
+				    &rtsds_dbg_registers_fops);
+	}
 
 	return 0;
 }
@@ -461,8 +464,7 @@ static int rtsds_probe(struct platform_device *pdev)
 		return ret;
 
 #ifdef CONFIG_DEBUG_FS
-	for (int sds = 0; sds < ctrl->cfg->sds_cnt; sds++)
-		rtsds_debug_init(ctrl, sds);
+	rtsds_debug_init(ctrl);
 #endif
 
 	dev_info(dev, "Realtek SerDes mdio bus initialized, %d SerDes, %d pages, %d registers\n",



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:40 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:40 -0500
Subject: [openwrt/openwrt]  realtek: pcs: add separate SerDes struct
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36289.1765888661.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6b3f8fb16faf1e9c28b282340a112b2bcb06b0d3

commit 6b3f8fb16faf1e9c28b282340a112b2bcb06b0d3
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 10:12:35 2025 +0000

    realtek: pcs: add separate SerDes struct
    
    Add a separate structure for a SerDes. This is needed to appropriately
    store per-SerDes information, which in turn is needed for future work.
    Additionally, it's intended to reduce boilerplate and several
    inconsistencies.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 26 +++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 7cc5bb1730..566e79962c 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -129,11 +129,20 @@ enum rtpcs_sds_mode {
 	RTPCS_SDS_MODE_USXGMII_2_5GSXGMII,
 };
 
+struct rtpcs_ctrl;
+
+struct rtpcs_serdes {
+	struct rtpcs_ctrl *ctrl;
+	u8 id;
+	enum rtpcs_sds_mode mode;
+};
+
 struct rtpcs_ctrl {
 	struct device *dev;
 	struct regmap *map;
 	struct mii_bus *bus;
 	const struct rtpcs_config *cfg;
+	struct rtpcs_serdes serdes[RTPCS_SDS_CNT];
 	struct rtpcs_link *link[RTPCS_PORT_CNT];
 	bool rx_pol_inv[RTPCS_SDS_CNT];
 	bool tx_pol_inv[RTPCS_SDS_CNT];
@@ -3025,9 +3034,10 @@ static int rtpcs_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
 	struct device_node *child;
+	struct rtpcs_serdes *sds;
 	struct rtpcs_ctrl *ctrl;
-	u32 sds;
-	int ret;
+	u32 sds_id;
+	int i, ret;
 
 	ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
 	if (!ctrl)
@@ -3045,15 +3055,21 @@ static int rtpcs_probe(struct platform_device *pdev)
 	if (IS_ERR(ctrl->bus))
 		return PTR_ERR(ctrl->bus);
 
+	for (i = 0; i < ctrl->cfg->serdes_count; i++) {
+		sds = &ctrl->serdes[i];
+		sds->ctrl = ctrl;
+		sds->id = i;
+	}
+
 	for_each_child_of_node(dev->of_node, child) {
-		ret = of_property_read_u32(child, "reg", &sds);
+		ret = of_property_read_u32(child, "reg", &sds_id);
 		if (ret)
 			return ret;
 		if (sds >= ctrl->cfg->serdes_count)
 			return -EINVAL;
 
-		ctrl->rx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-rx");
-		ctrl->tx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-tx");
+		ctrl->rx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-rx");
+		ctrl->tx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-tx");
 	}
 
 	if (ctrl->cfg->init_serdes_common) {



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:37 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:37 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl930x: drop unused and broken
 function
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36290.1765888662.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/decc4f6ba808fb8aa469cd4886ffeea1bb86bcda

commit decc4f6ba808fb8aa469cd4886ffeea1bb86bcda
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Dec 12 20:05:52 2025 +0000

    realtek: pcs: rtl930x: drop unused and broken function
    
    Drop the unused and broken function rtpcs_930x_sds_clock_wait from the
    PCS driver. The proper working variant is already some lines above and
    called rtpcs_930x_sds_wait_clock_ready.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c        | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 8368870b62..def6b445d4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -966,26 +966,6 @@ static void rtpcs_930x_sds_tx_config(struct rtpcs_ctrl *ctrl, int sds,
 	rtpcs_sds_write_bits(ctrl, sds, page, 0x18, 15, 12, impedance);
 }
 
-/* Wait for clock ready, this assumes the SerDes is in XGMII mode
- * timeout is in ms
- */
-__always_unused
-static int rtpcs_930x_sds_clock_wait(struct rtpcs_ctrl *ctrl, int timeout)
-{
-	u32 v;
-	unsigned long start = jiffies;
-	unsigned long end = start + (HZ / 1000) * timeout;
-
-	do {
-		rtpcs_sds_write_bits(ctrl, 2, 0x1f, 0x2, 15, 0, 53);
-		v = rtpcs_sds_read_bits(ctrl, 2, 0x1f, 20, 5, 4);
-		if (v == 3)
-			return 0;
-	} while (time_before(jiffies, end));
-
-	return 1;
-}
-
 __always_unused
 static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
 					     u32 dcvs_id, bool manual, u32 dvcs_list[])



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:41 -0500
Subject: [openwrt/openwrt]  realtek: pcs: add helpers for even, odd,
 neighbor SerDes
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36291.1765888664.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/232c1fb14a072ee5c3c96ead43919ab5add526dd

commit 232c1fb14a072ee5c3c96ead43919ab5add526dd
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 10:16:21 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c       | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 566e79962c..435a74af7c 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -239,6 +239,27 @@ static int rtpcs_sds_modify(struct rtpcs_ctrl *ctrl, int sds, int page, int regn
 				  mask, set);
 }
 
+__maybe_unused
+static struct rtpcs_serdes *rtpcs_sds_get_even(struct rtpcs_serdes *sds)
+{
+	u32 even_sds = sds->id & ~1;
+	return &sds->ctrl->serdes[even_sds];
+}
+
+__maybe_unused
+static struct rtpcs_serdes *rtpcs_sds_get_odd(struct rtpcs_serdes *sds)
+{
+	u32 odd_sds = sds->id | 1;
+	return &sds->ctrl->serdes[odd_sds];
+}
+
+__maybe_unused
+static struct rtpcs_serdes *rtpcs_sds_get_neighbor(struct rtpcs_serdes *sds)
+{
+	u32 nb_sds = sds->id ^ 1;
+	return &sds->ctrl->serdes[nb_sds];
+}
+
 static int rtpcs_regmap_read_bits(struct rtpcs_ctrl *ctrl, int base, int bithigh, int bitlow)
 {
 	int offset = base + (bitlow / 32) * 4;



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:38 -0500
Subject: [openwrt/openwrt]  realtek: pcs: add dedicated enum for SerDes modes
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36292.1765888664.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a4d6e10bf2561a39d9bb3c9e622531e8d5c9caf3

commit a4d6e10bf2561a39d9bb3c9e622531e8d5c9caf3
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Thu Dec 11 19:17:26 2025 +0000

    realtek: pcs: add dedicated enum for SerDes modes
    
    The Realtek SerDes mode capabilities do not map 1:1 to the
    PHY_INTERFACE_MODE_* modes used in the kernel and passed to the PCS.
    For example, some PHY chips use the proprietary XSGMII mode for which
    there isn't an equivalent in the kernel, or HSGMII.
    
    In the past, this led to problems and confusion using kernel's XGMII to
    handle the XSGMII mode, and needed a downstream patch for HSGMII. They
    have been solved/worked around for now, but XSGMII is currently not
    implemented at all. And who knows what might come in the future.
    
    To make our life easier, introduce a dedicated internal representation
    of SerDes modes which differs from kernel's PHY_INTERFACE_MODE_*. This
    allows us to map "external" modes to different internal modes as needed
    instead of carrying the PHY_INTERFACE_MODE_* through the whole SerDes
    configuration code. The PCS driver needs to map PHY_INTERFACE_MODE_* to
    RTPCS_SDS_MODE_* in pcs_config, and the latter should be used as the
    only one.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index def6b445d4..1a87d0d112 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -102,6 +102,29 @@
 #define RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR	(0x13F4)
 #define RTL931X_MAC_SERDES_MODE_CTRL(sds)	(0x136C + (((sds) << 2)))
 
+enum rtpcs_sds_mode {
+	RTPCS_SDS_MODE_OFF = 0,
+
+	/* fiber modes */
+	RTPCS_SDS_MODE_1000BASEX,
+	RTPCS_SDS_MODE_2500BASEX,
+	RTPCS_SDS_MODE_10GBASER,
+
+	/* mii modes */
+	RTPCS_SDS_MODE_SGMII,
+	RTPCS_SDS_MODE_HISGMII,
+	RTPCS_SDS_MODE_QSGMII,
+	RTPCS_SDS_MODE_QHSGMII,
+	RTPCS_SDS_MODE_XSGMII,
+
+	RTPCS_SDS_MODE_USXGMII_10GSXGMII,
+	RTPCS_SDS_MODE_USXGMII_10GDXGMII,
+	RTPCS_SDS_MODE_USXGMII_10GQXGMII,
+	RTPCS_SDS_MODE_USXGMII_5GSXGMII,
+	RTPCS_SDS_MODE_USXGMII_5GDXGMII,
+	RTPCS_SDS_MODE_USXGMII_2_5GSXGMII,
+};
+
 struct rtpcs_ctrl {
 	struct device *dev;
 	struct regmap *map;



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:45 -0500
Subject: [openwrt/openwrt]  realtek: pcs: make use of SerDes struct in
 set_autoneg
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36293.1765888664.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d8dd8bd88f264d39f8c8c1cff056b4ec32a985bb

commit d8dd8bd88f264d39f8c8c1cff056b4ec32a985bb
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 20:12:13 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index a6a2a50f34..1158097801 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -168,7 +168,7 @@ struct rtpcs_config {
 
 	const struct phylink_pcs_ops *pcs_ops;
 	int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
-	int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
+	int (*set_autoneg)(struct rtpcs_serdes *sds, unsigned int neg_mode);
 	int (*setup_serdes)(struct rtpcs_serdes *sds, phy_interface_t mode);
 };
 
@@ -232,12 +232,12 @@ static int rtpcs_sds_write_bits(struct rtpcs_serdes *sds, int page,
 	return rtpcs_sds_write(sds, page, regnum, reg);
 }
 
-static int rtpcs_sds_modify(struct rtpcs_ctrl *ctrl, int sds, int page, int regnum,
+static int rtpcs_sds_modify(struct rtpcs_serdes *sds, int page, int regnum,
 			    u16 mask, u16 set)
 {
 	int mmd_regnum = rtpcs_sds_to_mmd(page, regnum);
 
-	return mdiobus_c45_modify(ctrl->bus, sds, MDIO_MMD_VEND1,
+	return mdiobus_c45_modify(sds->ctrl->bus, sds->id, MDIO_MMD_VEND1,
 				  mmd_regnum, mask, set);
 }
 
@@ -2975,7 +2975,7 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	}
 
 	if (ctrl->cfg->set_autoneg) {
-		ret = ctrl->cfg->set_autoneg(ctrl, link->sds->id, neg_mode);
+		ret = ctrl->cfg->set_autoneg(link->sds, neg_mode);
 		if (ret < 0)
 			goto out;
 	}
@@ -3136,12 +3136,11 @@ static int rtpcs_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rtpcs_93xx_set_autoneg(struct rtpcs_ctrl *ctrl, int sds,
-				  unsigned int neg_mode)
+static int rtpcs_93xx_set_autoneg(struct rtpcs_serdes *sds, unsigned int neg_mode)
 {
 	u16 bmcr = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED ? BMCR_ANENABLE : 0;
 
-	return rtpcs_sds_modify(ctrl, sds, 2, MII_BMCR, BMCR_ANENABLE, bmcr);
+	return rtpcs_sds_modify(sds, 2, MII_BMCR, BMCR_ANENABLE, bmcr);
 }
 
 static const struct phylink_pcs_ops rtpcs_838x_pcs_ops = {



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:36 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:36 -0500
Subject: [openwrt/openwrt]  realtek: pcs: drop PCS creation without SerDes ref
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36294.1765888664.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a58e41e522bf5b273fa626e03546b92141731d9c

commit a58e41e522bf5b273fa626e03546b92141731d9c
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Thu Dec 11 22:37:33 2025 +0000

    realtek: pcs: drop PCS creation without SerDes ref
    
    Since the beginning, the PCS driver had the ability to call its
    rtpcs_create without a reference to a valid PCS node. A comment in the
    code mentions that this is done for RTL838X and its built-in octa-PHY
    which is connected directly instead of via a SerDes. Further
    explanations are not provided.
    
    Drop this ability and make the rtpcs_create call in the dsa driver
    conditional. As the built-in PHY of RTL838X isn't attached to a SerDes,
    there is no obvious point of having the PCS driver in that chain. The
    ports are marked as internal and have no pcs-handle, thus no phylink_pcs
    instance should be created.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/dsa/rtl83xx/common.c    | 14 +++++++-----
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 26 ++++++----------------
 2 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
index 85818391b5..787ceda834 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
@@ -331,12 +331,14 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
 			continue;
 		}
 
-		priv->pcs[pn] = rtpcs_create(priv->dev, pcs_node, pn);
-		if (IS_ERR(priv->pcs[pn])) {
-			dev_err(priv->dev, "port %u failed to create PCS instance: %ld\n",
-				pn, PTR_ERR(priv->pcs[pn]));
-			priv->pcs[pn] = NULL;
-			continue;
+		if (pcs_node) {
+			priv->pcs[pn] = rtpcs_create(priv->dev, pcs_node, pn);
+			if (IS_ERR(priv->pcs[pn])) {
+				dev_err(priv->dev, "port %u failed to create PCS instance: %ld\n",
+					pn, PTR_ERR(priv->pcs[pn]));
+				priv->pcs[pn] = NULL;
+				continue;
+			}
 		}
 
 		if (of_get_phy_mode(dn, &interface))
diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index e41c89e713..8368870b62 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2930,26 +2930,12 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	struct device_node *pcs_np;
 	struct rtpcs_ctrl *ctrl;
 	struct rtpcs_link *link;
-	int sds;
-
-	/*
-	 * RTL838x devices have a built-in octa port RTL8218B PHY that is not attached via
-	 * a SerDes. Allow to be called with an empty SerDes device node. In this case lookup
-	 * the parent/driver node directly.
-	 */
-	if (np) {
-		if (!of_device_is_available(np))
-			return ERR_PTR(-ENODEV);
-
-		if (of_property_read_u32(np, "reg", &sds))
-			return ERR_PTR(-EINVAL);
+	u32 sds;
 
-		pcs_np = of_get_parent(np);
-	} else {
-		pcs_np = of_find_compatible_node(NULL, NULL, "realtek,otto-pcs");
-		sds = -1;
-	}
+	if (!np || !of_device_is_available(np))
+		return ERR_PTR(-ENODEV);
 
+	pcs_np = of_get_parent(np);
 	if (!pcs_np)
 		return ERR_PTR(-ENODEV);
 
@@ -2972,7 +2958,9 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	if (port < 0 || port > ctrl->cfg->cpu_port)
 		return ERR_PTR(-EINVAL);
 
-	if (sds !=  -1 && rtpcs_sds_read(ctrl, sds, 0, 0) < 0)
+	if (of_property_read_u32(np, "reg", &sds))
+		return ERR_PTR(-EINVAL);
+	if (rtpcs_sds_read(ctrl, sds, 0, 0) < 0)
 		return ERR_PTR(-EINVAL);
 
 	link = kzalloc(sizeof(*link), GFP_KERNEL);



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:42 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:42 -0500
Subject: [openwrt/openwrt]  realtek: pcs: assign SerDes reference upon PCS
 creation
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36297.1765888664.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/69bbcc685b3c11719a1b2dbbc08aa02fba636455

commit 69bbcc685b3c11719a1b2dbbc08aa02fba636455
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 10:29:56 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 28 ++++++++++++----------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 435a74af7c..01b4b3af62 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -152,7 +152,8 @@ struct rtpcs_ctrl {
 struct rtpcs_link {
 	struct rtpcs_ctrl *ctrl;
 	struct phylink_pcs pcs;
-	int sds;
+	struct rtpcs_serdes *sds;
+	int sds_id;
 	int port;
 };
 
@@ -2919,7 +2920,7 @@ static void rtpcs_pcs_an_restart(struct phylink_pcs *pcs)
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 
 	dev_warn(ctrl->dev, "an_restart() for port %d and sds %d not yet implemented\n",
-		 link->port, link->sds);
+		 link->port, link->sds_id);
 }
 
 static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
@@ -2930,7 +2931,7 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 	int ret = 0;
 
-	if (link->sds < 0)
+	if (link->sds_id < 0)
 		return 0;
 
 	/*
@@ -2940,18 +2941,18 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	 */
 
 	dev_warn(ctrl->dev, "pcs_config(%s) for port %d and sds %d not yet fully implemented\n",
-		 phy_modes(interface), link->port, link->sds);
+		 phy_modes(interface), link->port, link->sds_id);
 
 	mutex_lock(&ctrl->lock);
 
 	if (ctrl->cfg->setup_serdes) {
-		ret = ctrl->cfg->setup_serdes(ctrl, link->sds, interface);
+		ret = ctrl->cfg->setup_serdes(ctrl, link->sds_id, interface);
 		if (ret < 0)
 			goto out;
 	}
 
 	if (ctrl->cfg->set_autoneg) {
-		ret = ctrl->cfg->set_autoneg(ctrl, link->sds, neg_mode);
+		ret = ctrl->cfg->set_autoneg(ctrl, link->sds_id, neg_mode);
 		if (ret < 0)
 			goto out;
 	}
@@ -2969,7 +2970,7 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	struct device_node *pcs_np;
 	struct rtpcs_ctrl *ctrl;
 	struct rtpcs_link *link;
-	u32 sds;
+	u32 sds_id;
 
 	if (!np || !of_device_is_available(np))
 		return ERR_PTR(-ENODEV);
@@ -2997,9 +2998,11 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	if (port < 0 || port > ctrl->cfg->cpu_port)
 		return ERR_PTR(-EINVAL);
 
-	if (of_property_read_u32(np, "reg", &sds))
+	if (of_property_read_u32(np, "reg", &sds_id))
+		return ERR_PTR(-EINVAL);
+	if (sds_id >= ctrl->cfg->serdes_count)
 		return ERR_PTR(-EINVAL);
-	if (rtpcs_sds_read(ctrl, sds, 0, 0) < 0)
+	if (rtpcs_sds_read(ctrl, sds_id, 0, 0) < 0)
 		return ERR_PTR(-EINVAL);
 
 	link = kzalloc(sizeof(*link), GFP_KERNEL);
@@ -3012,13 +3015,14 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 
 	link->ctrl = ctrl;
 	link->port = port;
-	link->sds = sds;
+	link->sds = &ctrl->serdes[sds_id];
+	link->sds_id = sds_id;
 	link->pcs.ops = ctrl->cfg->pcs_ops;
 	link->pcs.neg_mode = true;
 
 	ctrl->link[port] = link;
 
-	dev_dbg(ctrl->dev, "phylink_pcs created, port %d, sds %d\n", port, sds);
+	dev_dbg(ctrl->dev, "phylink_pcs created, port %d, sds %d\n", port, sds_id);
 
 	return &link->pcs;
 }
@@ -3086,7 +3090,7 @@ static int rtpcs_probe(struct platform_device *pdev)
 		ret = of_property_read_u32(child, "reg", &sds_id);
 		if (ret)
 			return ret;
-		if (sds >= ctrl->cfg->serdes_count)
+		if (sds_id >= ctrl->cfg->serdes_count)
 			return -EINVAL;
 
 		ctrl->rx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-rx");



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:44 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:44 -0500
Subject: [openwrt/openwrt]  realtek: pcs: make use of SerDes struct in SerDes
 setup
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36298.1765888664.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1fccb0eb1636ad7c417a14c55e766cd97e875015

commit 1fccb0eb1636ad7c417a14c55e766cd97e875015
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Thu Dec 11 21:42:38 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 1516 ++++++++++----------
 1 file changed, 770 insertions(+), 746 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index d2a70e65e4..a6a2a50f34 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -169,7 +169,7 @@ struct rtpcs_config {
 	const struct phylink_pcs_ops *pcs_ops;
 	int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
 	int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
-	int (*setup_serdes)(struct rtpcs_ctrl *ctrl, int sds, phy_interface_t mode);
+	int (*setup_serdes)(struct rtpcs_serdes *sds, phy_interface_t mode);
 };
 
 typedef struct {
@@ -183,14 +183,15 @@ static int rtpcs_sds_to_mmd(int sds_page, int sds_regnum)
 	return (sds_page << 8) + sds_regnum;
 }
 
-static int rtpcs_sds_read(struct rtpcs_ctrl *ctrl, int sds, int page, int regnum)
+static int rtpcs_sds_read(struct rtpcs_serdes *sds, int page, int regnum)
 {
 	int mmd_regnum = rtpcs_sds_to_mmd(page, regnum);
 
-	return mdiobus_c45_read(ctrl->bus, sds, MDIO_MMD_VEND1, mmd_regnum);
+	return mdiobus_c45_read(sds->ctrl->bus, sds->id, MDIO_MMD_VEND1,
+				mmd_regnum);
 }
 
-static int rtpcs_sds_read_bits(struct rtpcs_ctrl *ctrl, int sds, int page,
+static int rtpcs_sds_read_bits(struct rtpcs_serdes *sds, int page,
 			       int regnum, int bithigh, int bitlow)
 {
 	int mask, val;
@@ -198,21 +199,22 @@ static int rtpcs_sds_read_bits(struct rtpcs_ctrl *ctrl, int sds, int page,
 	WARN_ON(bithigh < bitlow);
 
 	mask = GENMASK(bithigh, bitlow);
-	val = rtpcs_sds_read(ctrl, sds, page, regnum);
+	val = rtpcs_sds_read(sds, page, regnum);
 	if (val < 0)
 		return val;
 
 	return (val & mask) >> bitlow;
 }
 
-static int rtpcs_sds_write(struct rtpcs_ctrl *ctrl, int sds, int page, int regnum, u16 value)
+static int rtpcs_sds_write(struct rtpcs_serdes *sds, int page, int regnum, u16 value)
 {
 	int mmd_regnum = rtpcs_sds_to_mmd(page, regnum);
 
-	return mdiobus_c45_write(ctrl->bus, sds, MDIO_MMD_VEND1, mmd_regnum, value);
+	return mdiobus_c45_write(sds->ctrl->bus, sds->id, MDIO_MMD_VEND1,
+				 mmd_regnum, value);
 }
 
-static int rtpcs_sds_write_bits(struct rtpcs_ctrl *ctrl, int sds, int page,
+static int rtpcs_sds_write_bits(struct rtpcs_serdes *sds, int page,
 				int regnum, int bithigh, int bitlow, u16 value)
 {
 	int mask, reg;
@@ -220,14 +222,14 @@ static int rtpcs_sds_write_bits(struct rtpcs_ctrl *ctrl, int sds, int page,
 	WARN_ON(bithigh < bitlow);
 
 	mask = GENMASK(bithigh, bitlow);
-	reg = rtpcs_sds_read(ctrl, sds, page, regnum);
+	reg = rtpcs_sds_read(sds, page, regnum);
 	if (reg < 0)
 		return reg;
 
 	reg = (reg & ~mask);
 	reg |= (value << bitlow) & mask;
 
-	return rtpcs_sds_write(ctrl, sds, page, regnum, reg);
+	return rtpcs_sds_write(sds, page, regnum, reg);
 }
 
 static int rtpcs_sds_modify(struct rtpcs_ctrl *ctrl, int sds, int page, int regnum,
@@ -235,25 +237,22 @@ static int rtpcs_sds_modify(struct rtpcs_ctrl *ctrl, int sds, int page, int regn
 {
 	int mmd_regnum = rtpcs_sds_to_mmd(page, regnum);
 
-	return mdiobus_c45_modify(ctrl->bus, sds, MDIO_MMD_VEND1, mmd_regnum,
-				  mask, set);
+	return mdiobus_c45_modify(ctrl->bus, sds, MDIO_MMD_VEND1,
+				  mmd_regnum, mask, set);
 }
 
-__maybe_unused
 static struct rtpcs_serdes *rtpcs_sds_get_even(struct rtpcs_serdes *sds)
 {
 	u32 even_sds = sds->id & ~1;
 	return &sds->ctrl->serdes[even_sds];
 }
 
-__maybe_unused
 static struct rtpcs_serdes *rtpcs_sds_get_odd(struct rtpcs_serdes *sds)
 {
 	u32 odd_sds = sds->id | 1;
 	return &sds->ctrl->serdes[odd_sds];
 }
 
-__maybe_unused
 static struct rtpcs_serdes *rtpcs_sds_get_neighbor(struct rtpcs_serdes *sds)
 {
 	u32 nb_sds = sds->id ^ 1;
@@ -282,129 +281,131 @@ static struct rtpcs_link *rtpcs_phylink_pcs_to_link(struct phylink_pcs *pcs)
 
 /* RTL838X */
 
+#define SDS(ctrl,n)	(&(ctrl)->serdes[n])
+
 static void rtpcs_838x_sds_patch_01_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 0, 1, 3, 0xf46f);
-	rtpcs_sds_write(ctrl, 0, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 1, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 0, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 1, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 0, 1, 17, 0xb7c9);
-	rtpcs_sds_write(ctrl, 1, 1, 11, 0x482);
-	rtpcs_sds_write(ctrl, 1, 1, 10, 0x80c7);
-	rtpcs_sds_write(ctrl, 0, 1, 18, 0xab8e);
-	rtpcs_sds_write(ctrl, 0, 1, 11, 0x482);
-	rtpcs_sds_write(ctrl, 0, 1, 19, 0x24ab);
-	rtpcs_sds_write(ctrl, 1, 1, 17, 0x4208);
-	rtpcs_sds_write(ctrl, 1, 1, 18, 0xc208);
-	rtpcs_sds_write(ctrl, 0, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 1, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 0, 1, 14, 0xfcc2);
-	rtpcs_sds_write(ctrl, 1, 1, 14, 0xfcc2);
-
-	rtpcs_sds_write(ctrl, 0, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 0, 1, 9, 0x8c64);
-
-	rtpcs_sds_write(ctrl, 1, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 1, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 3, 0xf46f);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 17, 0xb7c9);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 11, 0x482);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 10, 0x80c7);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 18, 0xab8e);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 11, 0x482);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 19, 0x24ab);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 17, 0x4208);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 18, 0xc208);
+	rtpcs_sds_write(SDS(ctrl, 0), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 1), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 14, 0xfcc2);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 14, 0xfcc2);
+
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 9, 0x8c64);
+
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 9, 0x8c64);
 }
 
 static void rtpcs_838x_sds_patch_23_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 2, 1, 3, 0xf46d);
-	rtpcs_sds_write(ctrl, 2, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 3, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 2, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 3, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 2, 1, 17, 0xb7c9);
-	rtpcs_sds_write(ctrl, 2, 1, 18, 0xab8e);
-	rtpcs_sds_write(ctrl, 2, 1, 11, 0x482);
-	rtpcs_sds_write(ctrl, 3, 1, 11, 0x482);
-	rtpcs_sds_write(ctrl, 2, 1, 19, 0x24ab);
-	rtpcs_sds_write(ctrl, 3, 1, 17, 0x4208);
-	rtpcs_sds_write(ctrl, 3, 1, 18, 0xc208);
-	rtpcs_sds_write(ctrl, 2, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 3, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 2, 1, 14, 0xfcc2);
-	rtpcs_sds_write(ctrl, 3, 1, 14, 0xfcc2);
-
-	rtpcs_sds_write(ctrl, 2, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 2, 1, 9, 0x8c64);
-
-	rtpcs_sds_write(ctrl, 3, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 3, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 3, 0xf46d);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 17, 0xb7c9);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 18, 0xab8e);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 11, 0x482);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 11, 0x482);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 19, 0x24ab);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 17, 0x4208);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 18, 0xc208);
+	rtpcs_sds_write(SDS(ctrl, 2), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 3), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 14, 0xfcc2);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 14, 0xfcc2);
+
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 9, 0x8c64);
+
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 9, 0x8c64);
 }
 
 static void rtpcs_838x_sds_patch_4_fiber_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 4, 1, 11, 0x1482);
-	rtpcs_sds_write(ctrl, 4, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 4, 1, 10, 0xc3);
-	rtpcs_sds_write(ctrl, 4, 1, 17, 0xb7c9);
-	rtpcs_sds_write(ctrl, 4, 1, 18, 0xab8e);
-	rtpcs_sds_write(ctrl, 4, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 4, 1, 14, 0xfcc2);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 11, 0x1482);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 10, 0xc3);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 17, 0xb7c9);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 18, 0xab8e);
+	rtpcs_sds_write(SDS(ctrl, 4), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 14, 0xfcc2);
 
-	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 9, 0x8c64);
 }
 
 static void rtpcs_838x_sds_patch_4_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 4, 1, 3, 0xf46d);
-	rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 4, 1, 11, 0x0482);
-	rtpcs_sds_write(ctrl, 4, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 4, 1, 10, 0x58c7);
-	rtpcs_sds_write(ctrl, 4, 1, 17, 0xb7c9);
-	rtpcs_sds_write(ctrl, 4, 1, 18, 0xab8e);
-	rtpcs_sds_write(ctrl, 4, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 4, 1, 14, 0xfcc2);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 3, 0xf46d);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 11, 0x0482);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 10, 0x58c7);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 17, 0xb7c9);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 18, 0xab8e);
+	rtpcs_sds_write(SDS(ctrl, 4), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 14, 0xfcc2);
 
-	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 9, 0x8c64);
 }
 
 static void rtpcs_838x_sds_patch_5_fiber_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 5, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 5, 1, 3, 0x00);
-	rtpcs_sds_write(ctrl, 5, 1, 4, 0xdccc);
-	rtpcs_sds_write(ctrl, 5, 1, 5, 0x00);
-	rtpcs_sds_write(ctrl, 5, 1, 6, 0x3600);
-	rtpcs_sds_write(ctrl, 5, 1, 7, 0x03);
-	rtpcs_sds_write(ctrl, 5, 1, 8, 0x79aa);
-	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
-	rtpcs_sds_write(ctrl, 5, 1, 10, 0xc3);
-	rtpcs_sds_write(ctrl, 5, 1, 11, 0x1482);
-	rtpcs_sds_write(ctrl, 5, 2, 24, 0x14aa);
-	rtpcs_sds_write(ctrl, 5, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 5, 1, 14, 0xf002);
-	rtpcs_sds_write(ctrl, 5, 2, 27, 0x4bf);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 3, 0x00);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 4, 0xdccc);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 5, 0x00);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 6, 0x3600);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 7, 0x03);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 8, 0x79aa);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 10, 0xc3);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 11, 0x1482);
+	rtpcs_sds_write(SDS(ctrl, 5), 2, 24, 0x14aa);
+	rtpcs_sds_write(SDS(ctrl, 5), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 14, 0xf002);
+	rtpcs_sds_write(SDS(ctrl, 5), 2, 27, 0x4bf);
 
-	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 9, 0x8c64);
 }
 
-static void rtpcs_838x_sds_reset(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_838x_sds_reset(struct rtpcs_serdes *sds)
 {
-	rtpcs_sds_write_bits(ctrl, sds, 2, 0, 11, 11, 0x0);	/* FIB_REG0 CFG_FIB_PDOWN */
+	rtpcs_sds_write_bits(sds, 2, 0, 11, 11, 0x0);	/* FIB_REG0 CFG_FIB_PDOWN */
 
 	/* analog reset */
-	rtpcs_sds_write_bits(ctrl, sds, 0, 0, 1, 0, 0x0);	/* REG0 EN_RX/EN_TX */
-	rtpcs_sds_write_bits(ctrl, sds, 0, 0, 1, 0, 0x3);	/* REG0 EN_RX/EN_TX */
+	rtpcs_sds_write_bits(sds, 0, 0, 1, 0, 0x0);	/* REG0 EN_RX/EN_TX */
+	rtpcs_sds_write_bits(sds, 0, 0, 1, 0, 0x3);	/* REG0 EN_RX/EN_TX */
 
 	/* digital reset */
-	rtpcs_sds_write_bits(ctrl, sds, 0, 3, 6, 6, 0x1);	/* REG3 SOFT_RST */
-	rtpcs_sds_write_bits(ctrl, sds, 0, 3, 6, 6, 0x0);	/* REG3 SOFT_RST */
+	rtpcs_sds_write_bits(sds, 0, 3, 6, 6, 0x1);	/* REG3 SOFT_RST */
+	rtpcs_sds_write_bits(sds, 0, 3, 6, 6, 0x0);	/* REG3 SOFT_RST */
 
-	dev_info(ctrl->dev, "SerDes %d reset\n", sds);
+	dev_info(sds->ctrl->dev, "SerDes %d reset\n", sds->id);
 }
 
-static bool rtpcs_838x_sds_is_mode_supported(u32 sds, phy_interface_t mode)
+static bool rtpcs_838x_sds_is_mode_supported(struct rtpcs_serdes *sds, phy_interface_t mode)
 {
-	switch (sds) {
+	switch (sds->id) {
 	case 0 ... 3:
 		return mode == PHY_INTERFACE_MODE_QSGMII;
 	case 4:
@@ -419,23 +420,26 @@ static bool rtpcs_838x_sds_is_mode_supported(u32 sds, phy_interface_t mode)
 	}
 }
 
-static int rtpcs_838x_sds_power(struct rtpcs_ctrl *ctrl, u32 sds, bool power_on)
+static int rtpcs_838x_sds_power(struct rtpcs_serdes *sds, bool power_on)
 {
-	u8 val = power_on ? 0 : BIT(sds);
+	u8 sds_id = sds->id;
 	int ret;
+	u8 val;
+
+	val = power_on ? 0 : BIT(sds_id);
 
-	ret = regmap_write_bits(ctrl->map, RTPCS_838X_SDS_CFG_REG, BIT(sds), val);
+	ret = regmap_write_bits(sds->ctrl->map, RTPCS_838X_SDS_CFG_REG, BIT(sds_id), val);
 	if (ret)
 		return ret;
 
-	if (sds >= 4)
-		ret = regmap_write_bits(ctrl->map, RTPCS_838X_SDS_CFG_REG,
-					BIT(sds) << 2, val << 2); /* SDS*_PHY_MODE */
+	if (sds_id >= 4)
+		ret = regmap_write_bits(sds->ctrl->map, RTPCS_838X_SDS_CFG_REG,
+					BIT(sds_id) << 2, val << 2); /* SDS*_PHY_MODE */
 
 	return ret;
 }
 
-static int rtpcs_838x_sds_set_mode(struct rtpcs_ctrl *ctrl, u32 sds,
+static int rtpcs_838x_sds_set_mode(struct rtpcs_serdes *sds,
 				   phy_interface_t mode)
 {
 	u8 sds_mode_shift, int_mode_shift;
@@ -459,49 +463,52 @@ static int rtpcs_838x_sds_set_mode(struct rtpcs_ctrl *ctrl, u32 sds,
 	}
 
 	/* Configure SerDes module mode (all SDS 0-5) */
-	sds_mode_shift = (5 - sds) * 5;
-	regmap_write_bits(ctrl->map, RTPCS_838X_SDS_MODE_SEL,
+	sds_mode_shift = (5 - sds->id) * 5;
+	regmap_write_bits(sds->ctrl->map, RTPCS_838X_SDS_MODE_SEL,
 			  0x1f << sds_mode_shift, sds_mode_val << sds_mode_shift);
 
 	/* Configure MAC interface mode (only SDS 4-5) */
-	if (sds >= 4) {
-		int_mode_shift = (sds == 5) ? 3 : 0;
-		regmap_write_bits(ctrl->map, RTPCS_838X_INT_MODE_CTRL,
+	if (sds->id >= 4) {
+		int_mode_shift = (sds->id == 5) ? 3 : 0;
+		regmap_write_bits(sds->ctrl->map, RTPCS_838X_INT_MODE_CTRL,
 				  0x7 << int_mode_shift, int_mode_val << int_mode_shift);
 	}
 
 	return 0;
 }
 
-static int rtpcs_838x_sds_patch(struct rtpcs_ctrl *ctrl, u32 sds,
+static int rtpcs_838x_sds_patch(struct rtpcs_serdes *sds,
 				phy_interface_t mode)
 {
-	rtpcs_sds_write(ctrl, sds, 0, 1, 0xf00);
+	struct rtpcs_ctrl *ctrl = sds->ctrl;
+	u8 sds_id = sds->id;
+
+	rtpcs_sds_write(sds, 0, 1, 0xf00);
 	mdelay(1);
-	rtpcs_sds_write(ctrl, sds, 0, 2, 0x7060);
+	rtpcs_sds_write(sds, 0, 2, 0x7060);
 	mdelay(1);
 
-	if (sds >= 4) {
-		rtpcs_sds_write(ctrl, sds, 2, 30, 0x71e);
+	if (sds_id >= 4) {
+		rtpcs_sds_write(sds, 2, 30, 0x71e);
 		mdelay(1);
-		rtpcs_sds_write(ctrl, sds, 0, 4, 0x74d);
+		rtpcs_sds_write(sds, 0, 4, 0x74d);
 		mdelay(1);
 	}
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_1000BASEX:
-		if (sds == 4)
+		if (sds_id == 4)
 			rtpcs_838x_sds_patch_4_fiber_6275b(ctrl);
-		else if (sds == 5)
+		else if (sds_id == 5)
 			rtpcs_838x_sds_patch_5_fiber_6275b(ctrl);
 
 		break;
 	case PHY_INTERFACE_MODE_QSGMII:
-		if (sds == 0 || sds == 1)
+		if (sds_id == 0 || sds_id == 1)
 			rtpcs_838x_sds_patch_01_qsgmii_6275b(ctrl);
-		else if (sds == 2 || sds == 3)
+		else if (sds_id == 2 || sds_id == 3)
 			rtpcs_838x_sds_patch_23_qsgmii_6275b(ctrl);
-		else if (sds == 4)
+		else if (sds_id == 4)
 			rtpcs_838x_sds_patch_4_qsgmii_6275b(ctrl);
 
 		break;
@@ -532,33 +539,33 @@ static int rtpcs_838x_init_serdes_common(struct rtpcs_ctrl *ctrl)
 	return 0;
 }
 
-static int rtpcs_838x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_838x_setup_serdes(struct rtpcs_serdes *sds,
 				   phy_interface_t mode)
 {
 	int ret;
 
-	if (sds > 5)
+	if (sds->id > 5)
 		return -EINVAL;
 	if (!rtpcs_838x_sds_is_mode_supported(sds, mode))
 		return -EINVAL;
 
-	rtpcs_838x_sds_power(ctrl, sds, false);
+	rtpcs_838x_sds_power(sds, false);
 
 	/* take reset */
-	rtpcs_sds_write(ctrl, sds, 0x0, 0x0, 0xc00);
-	rtpcs_sds_write(ctrl, sds, 0x0, 0x3, 0x7146);
+	rtpcs_sds_write(sds, 0x0, 0x0, 0xc00);
+	rtpcs_sds_write(sds, 0x0, 0x3, 0x7146);
 
-	ret = rtpcs_838x_sds_set_mode(ctrl, sds, mode);
+	ret = rtpcs_838x_sds_set_mode(sds, mode);
 	if (ret)
 		return ret;
 
-	rtpcs_838x_sds_patch(ctrl, sds, mode);
-	rtpcs_838x_sds_reset(ctrl, sds);
+	rtpcs_838x_sds_patch(sds, mode);
+	rtpcs_838x_sds_reset(sds);
 	
 	/* release reset */
-	rtpcs_sds_write(ctrl, sds, 0, 3, 0x7106);
+	rtpcs_sds_write(sds, 0, 3, 0x7106);
 
-	rtpcs_838x_sds_power(ctrl, sds, true);
+	rtpcs_838x_sds_power(sds, true);
 	return 0;
 }
 
@@ -573,57 +580,63 @@ u16 rtpcs_930x_sds_submode_regs[] = { 0x1cc, 0x1cc, 0x2d8, 0x2d8, 0x2d8, 0x2d8,
 				      0x2d8, 0x2d8};
 u8  rtpcs_930x_sds_submode_lsb[]  = { 0, 5, 0, 5, 10, 15, 20, 25 };
 
-static void rtpcs_930x_sds_set(struct rtpcs_ctrl *ctrl, int sds_num, u32 mode)
+static void rtpcs_930x_sds_set(struct rtpcs_serdes *sds, u32 mode)
 {
+	u8 sds_id = sds->id;
+
 	pr_info("%s %d\n", __func__, mode);
-	if (sds_num < 0 || sds_num > 11) {
-		pr_err("Wrong SerDes number: %d\n", sds_num);
+	if (sds_id < 0 || sds_id > 11) {
+		pr_err("Wrong SerDes number: %d\n", sds_id);
 		return;
 	}
 
-	regmap_write_bits(ctrl->map, rtpcs_930x_sds_regs[sds_num],
-			  RTL930X_SDS_MASK << rtpcs_930x_sds_lsb[sds_num],
-			  mode << rtpcs_930x_sds_lsb[sds_num]);
+	regmap_write_bits(sds->ctrl->map, rtpcs_930x_sds_regs[sds_id],
+			  RTL930X_SDS_MASK << rtpcs_930x_sds_lsb[sds_id],
+			  mode << rtpcs_930x_sds_lsb[sds_id]);
 	mdelay(10);
 }
 
 __always_unused
-static u32 rtpcs_930x_sds_mode_get(struct rtpcs_ctrl *ctrl, int sds_num)
+static u32 rtpcs_930x_sds_mode_get(struct rtpcs_serdes *sds)
 {
+	u8 sds_id = sds->id;
 	u32 v;
 
-	if (sds_num < 0 || sds_num > 11) {
-		pr_err("Wrong SerDes number: %d\n", sds_num);
+	if (sds_id < 0 || sds_id > 11) {
+		pr_err("Wrong SerDes number: %d\n", sds_id);
 		return 0;
 	}
 
-	regmap_read(ctrl->map, rtpcs_930x_sds_regs[sds_num], &v);
-	v >>= rtpcs_930x_sds_lsb[sds_num];
+	regmap_read(sds->ctrl->map, rtpcs_930x_sds_regs[sds_id], &v);
+	v >>= rtpcs_930x_sds_lsb[sds_id];
 
 	return v & RTL930X_SDS_MASK;
 }
 
 __always_unused
-static u32 rtpcs_930x_sds_submode_get(struct rtpcs_ctrl *ctrl, int sds_num)
+static u32 rtpcs_930x_sds_submode_get(struct rtpcs_serdes *sds)
 {
+	u8 sds_id = sds->id;
 	u32 v;
 
-	if (sds_num < 2 || sds_num > 9) {
-		pr_err("%s: unsupported SerDes %d\n", __func__, sds_num);
+	if (sds_id < 2 || sds_id > 9) {
+		pr_err("%s: unsupported SerDes %d\n", __func__, sds_id);
 		return 0;
 	}
 
-	regmap_read(ctrl->map, rtpcs_930x_sds_submode_regs[sds_num], &v);
-	v >>= rtpcs_930x_sds_submode_lsb[sds_num];
+	regmap_read(sds->ctrl->map, rtpcs_930x_sds_submode_regs[sds_id], &v);
+	v >>= rtpcs_930x_sds_submode_lsb[sds_id];
 
 	return v & RTL930X_SDS_MASK;
 }
 
-static void rtpcs_930x_sds_submode_set(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_submode_set(struct rtpcs_serdes *sds,
 				       u32 submode)
 {
-	if (sds < 2 || sds > 9) {
-		pr_err("%s: submode unsupported on serdes %d\n", __func__, sds);
+	u8 sds_id = sds->id;
+
+	if (sds_id < 2 || sds_id > 9) {
+		pr_err("%s: submode unsupported on serdes %d\n", __func__, sds_id);
 		return;
 	}
 
@@ -632,12 +645,12 @@ static void rtpcs_930x_sds_submode_set(struct rtpcs_ctrl *ctrl, int sds,
 		pr_err("%s: unsupported submode 0x%x\n", __func__, submode);
 	}
 
-	regmap_write_bits(ctrl->map, rtpcs_930x_sds_submode_regs[sds - 2],
-			  RTL930X_SDS_MASK << rtpcs_930x_sds_submode_lsb[sds - 2],
-			  submode << rtpcs_930x_sds_submode_lsb[sds - 2]);
+	regmap_write_bits(sds->ctrl->map, rtpcs_930x_sds_submode_regs[sds_id - 2],
+			  RTL930X_SDS_MASK << rtpcs_930x_sds_submode_lsb[sds_id - 2],
+			  submode << rtpcs_930x_sds_submode_lsb[sds_id - 2]);
 }
 
-static void rtpcs_930x_sds_rx_reset(struct rtpcs_ctrl *ctrl, int sds_num,
+static void rtpcs_930x_sds_rx_reset(struct rtpcs_serdes *sds,
 				    phy_interface_t phy_if)
 {
 	int page = 0x2e; /* 10GR and USXGMII */
@@ -645,33 +658,33 @@ static void rtpcs_930x_sds_rx_reset(struct rtpcs_ctrl *ctrl, int sds_num,
 	if (phy_if == PHY_INTERFACE_MODE_1000BASEX)
 		page = 0x24;
 
-	rtpcs_sds_write_bits(ctrl, sds_num, page, 0x15, 4, 4, 0x1);
+	rtpcs_sds_write_bits(sds, page, 0x15, 4, 4, 0x1);
 	mdelay(5);
-	rtpcs_sds_write_bits(ctrl, sds_num, page, 0x15, 4, 4, 0x0);
+	rtpcs_sds_write_bits(sds, page, 0x15, 4, 4, 0x0);
 }
 
-static void rtpcs_930x_sds_get_pll_data(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_get_pll_data(struct rtpcs_serdes *sds,
 					int *pll, int *speed)
 {
-	int sbit, pbit = sds & 1 ? 6 : 4;
-	int base_sds = sds & ~1;
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
+	int sbit, pbit = (sds == even_sds) ? 4 : 6;
 
 	/*
 	 * PLL data is shared between adjacent SerDes in the even lane. Each SerDes defines
 	 * what PLL it needs (ring or LC) while the PLL itself stores the current speed.
 	 */
 
-	*pll = rtpcs_sds_read_bits(ctrl, base_sds, 0x20, 0x12, pbit + 1, pbit);
+	*pll = rtpcs_sds_read_bits(even_sds, 0x20, 0x12, pbit + 1, pbit);
 	sbit = *pll == RTSDS_930X_PLL_LC ? 8 : 12;
-	*speed = rtpcs_sds_read_bits(ctrl, base_sds, 0x20, 0x12, sbit + 3, sbit);
+	*speed = rtpcs_sds_read_bits(even_sds, 0x20, 0x12, sbit + 3, sbit);
 }
 
-static int rtpcs_930x_sds_set_pll_data(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_930x_sds_set_pll_data(struct rtpcs_serdes *sds,
 				       int pll, int speed)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int sbit = pll == RTSDS_930X_PLL_LC ? 8 : 12;
-	int pbit = sds & 1 ? 6 : 4;
-	int base_sds = sds & ~1;
+	int pbit = (sds == even_sds) ? 4 : 6;
 
 	if ((speed != RTSDS_930X_PLL_1000) &&
 	    (speed != RTSDS_930X_PLL_2500) &&
@@ -690,17 +703,17 @@ static int rtpcs_930x_sds_set_pll_data(struct rtpcs_ctrl *ctrl, int sds,
 	 * always activate both.
 	 */
 
-	rtpcs_sds_write_bits(ctrl, base_sds, 0x20, 0x12, 3, 0, 0xf);
-	rtpcs_sds_write_bits(ctrl, base_sds, 0x20, 0x12, pbit + 1, pbit, pll);
-	rtpcs_sds_write_bits(ctrl, base_sds, 0x20, 0x12, sbit + 3, sbit, speed);
+	rtpcs_sds_write_bits(even_sds, 0x20, 0x12, 3, 0, 0xf);
+	rtpcs_sds_write_bits(even_sds, 0x20, 0x12, pbit + 1, pbit, pll);
+	rtpcs_sds_write_bits(even_sds, 0x20, 0x12, sbit + 3, sbit, speed);
 
 	return 0;
 }
 
-static void rtpcs_930x_sds_reset_cmu(struct rtpcs_ctrl *ctrl, int sds)
+static void rtpcs_930x_sds_reset_cmu(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int reset_sequence[4] = { 3, 2, 3, 1 };
-	int base_sds = sds & ~1;
 	int pll, speed, i, bit;
 
 	/*
@@ -709,17 +722,18 @@ static void rtpcs_930x_sds_reset_cmu(struct rtpcs_ctrl *ctrl, int sds)
 	 * to flipping two bits in a special sequence.
 	 */
 
-	rtpcs_930x_sds_get_pll_data(ctrl, sds, &pll, &speed);
+	rtpcs_930x_sds_get_pll_data(sds, &pll, &speed);
 	bit = pll == RTSDS_930X_PLL_LC ? 2 : 0;
 
 	for (i = 0; i < ARRAY_SIZE(reset_sequence); i++)
-		rtpcs_sds_write_bits(ctrl, base_sds, 0x21, 0x0b, bit + 1, bit,
+		rtpcs_sds_write_bits(even_sds, 0x21, 0x0b, bit + 1, bit,
 				     reset_sequence[i]);
 }
 
-static int rtpcs_930x_sds_wait_clock_ready(struct rtpcs_ctrl *ctrl, int sds)
+static int rtpcs_930x_sds_wait_clock_ready(struct rtpcs_serdes *sds)
 {
-	int i, base_sds = sds & ~1, ready, ready_cnt = 0, bit = (sds & 1) + 4;
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
+	int i, ready, ready_cnt = 0, bit = (sds == even_sds) ? 4 : 5;
 
 	/*
 	 * While reconfiguring a SerDes it might take some time until its clock is in sync with
@@ -730,8 +744,8 @@ static int rtpcs_930x_sds_wait_clock_ready(struct rtpcs_ctrl *ctrl, int sds)
 	for (i = 0; i < 20; i++) {
 		usleep_range(10000, 15000);
 
-		rtpcs_sds_write(ctrl, base_sds, 0x1f, 0x02, 53);
-		ready = rtpcs_sds_read_bits(ctrl, base_sds, 0x1f, 0x14, bit, bit);
+		rtpcs_sds_write(even_sds, 0x1f, 0x02, 53);
+		ready = rtpcs_sds_read_bits(even_sds, 0x1f, 0x14, bit, bit);
 
 		ready_cnt = ready ? ready_cnt + 1 : 0;
 		if (ready_cnt >= 3)
@@ -741,51 +755,51 @@ static int rtpcs_930x_sds_wait_clock_ready(struct rtpcs_ctrl *ctrl, int sds)
 	return -EBUSY;
 }
 
-static int rtpcs_930x_sds_get_internal_mode(struct rtpcs_ctrl *ctrl, int sds)
+static int rtpcs_930x_sds_get_internal_mode(struct rtpcs_serdes *sds)
 {
-	return rtpcs_sds_read_bits(ctrl, sds, 0x1f, 0x09, 11, 7);
+	return rtpcs_sds_read_bits(sds, 0x1f, 0x09, 11, 7);
 }
 
-static void rtpcs_930x_sds_set_internal_mode(struct rtpcs_ctrl *ctrl, int sds,
-					     int mode)
+static void rtpcs_930x_sds_set_internal_mode(struct rtpcs_serdes *sds, int mode)
 {
-	rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0x09, 6, 6, 0x1); /* Force mode enable */
-	rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0x09, 11, 7, mode);
+	rtpcs_sds_write_bits(sds, 0x1f, 0x09, 6, 6, 0x1); /* Force mode enable */
+	rtpcs_sds_write_bits(sds, 0x1f, 0x09, 11, 7, mode);
 }
 
-static void rtpcs_930x_sds_set_power(struct rtpcs_ctrl *ctrl, int sds, bool on)
+static void rtpcs_930x_sds_set_power(struct rtpcs_serdes *sds, bool on)
 {
 	int power_down = on ? 0x0 : 0x3;
 	int rx_enable = on ? 0x3 : 0x1;
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x20, 0x00, 7, 6, power_down);
-	rtpcs_sds_write_bits(ctrl, sds, 0x20, 0x00, 5, 4, rx_enable);
+	rtpcs_sds_write_bits(sds, 0x20, 0x00, 7, 6, power_down);
+	rtpcs_sds_write_bits(sds, 0x20, 0x00, 5, 4, rx_enable);
 }
 
-static void rtpcs_930x_sds_reconfigure_pll(struct rtpcs_ctrl *ctrl, int sds, int pll)
+static void rtpcs_930x_sds_reconfigure_pll(struct rtpcs_serdes *sds, int pll)
 {
 	int mode, tmp, speed;
 
-	mode = rtpcs_930x_sds_get_internal_mode(ctrl, sds);
-	rtpcs_930x_sds_get_pll_data(ctrl, sds, &tmp, &speed);
+	mode = rtpcs_930x_sds_get_internal_mode(sds);
+	rtpcs_930x_sds_get_pll_data(sds, &tmp, &speed);
 
-	rtpcs_930x_sds_set_power(ctrl, sds, false);
-	rtpcs_930x_sds_set_internal_mode(ctrl, sds, RTL930X_SDS_OFF);
+	rtpcs_930x_sds_set_power(sds, false);
+	rtpcs_930x_sds_set_internal_mode(sds, RTL930X_SDS_OFF);
 
-	rtpcs_930x_sds_set_pll_data(ctrl, sds, pll, speed);
-	rtpcs_930x_sds_reset_cmu(ctrl, sds);
+	rtpcs_930x_sds_set_pll_data(sds, pll, speed);
+	rtpcs_930x_sds_reset_cmu(sds);
 
-	rtpcs_930x_sds_set_internal_mode(ctrl, sds, mode);
-	if (rtpcs_930x_sds_wait_clock_ready(ctrl, sds))
-		pr_err("%s: SDS %d could not sync clock\n", __func__, sds);
+	rtpcs_930x_sds_set_internal_mode(sds, mode);
+	if (rtpcs_930x_sds_wait_clock_ready(sds))
+		pr_err("%s: SDS %d could not sync clock\n", __func__, sds->id);
 
-	rtpcs_930x_sds_set_power(ctrl, sds, true);
+	rtpcs_930x_sds_set_power(sds, true);
 }
 
-static int rtpcs_930x_sds_config_pll(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_930x_sds_config_pll(struct rtpcs_serdes *sds,
 				     phy_interface_t interface)
 {
-	int neighbor_speed, neighbor_mode, neighbor_pll, neighbor = sds ^ 1;
+	struct rtpcs_serdes *nb_sds = rtpcs_sds_get_neighbor(sds);
+	int neighbor_speed, neighbor_mode, neighbor_pll;
 	bool speed_changed = true;
 	int pll, speed;
 
@@ -808,8 +822,8 @@ static int rtpcs_930x_sds_config_pll(struct rtpcs_ctrl *ctrl, int sds,
 	 * the state of a SerDes back to RTL930X_SDS_OFF is not (yet) implemented.
 	 */
 
-	neighbor_mode = rtpcs_930x_sds_get_internal_mode(ctrl, neighbor);
-	rtpcs_930x_sds_get_pll_data(ctrl, neighbor, &neighbor_pll, &neighbor_speed);
+	neighbor_mode = rtpcs_930x_sds_get_internal_mode(nb_sds);
+	rtpcs_930x_sds_get_pll_data(nb_sds, &neighbor_pll, &neighbor_speed);
 
 	if ((interface == PHY_INTERFACE_MODE_1000BASEX) ||
 	    (interface == PHY_INTERFACE_MODE_SGMII))
@@ -830,32 +844,32 @@ static int rtpcs_930x_sds_config_pll(struct rtpcs_ctrl *ctrl, int sds,
 		pll = RTSDS_930X_PLL_LC;
 	else if (speed == RTSDS_930X_PLL_10000) {
 		pr_info("%s: SDS %d needs LC PLL, reconfigure SDS %d to use ring PLL\n",
-			__func__, sds, neighbor);
-		rtpcs_930x_sds_reconfigure_pll(ctrl, neighbor, RTSDS_930X_PLL_RING);
+			__func__, sds->id, nb_sds->id);
+		rtpcs_930x_sds_reconfigure_pll(nb_sds, RTSDS_930X_PLL_RING);
 		pll = RTSDS_930X_PLL_LC;
 	} else
 		pll = RTSDS_930X_PLL_RING;
 
-	rtpcs_930x_sds_set_pll_data(ctrl, sds, pll, speed);
+	rtpcs_930x_sds_set_pll_data(sds, pll, speed);
 
 	if (speed_changed)
-		rtpcs_930x_sds_reset_cmu(ctrl, sds);
+		rtpcs_930x_sds_reset_cmu(sds);
 
-	pr_info("%s: SDS %d using %s PLL for %s\n", __func__, sds,
+	pr_info("%s: SDS %d using %s PLL for %s\n", __func__, sds->id,
 		pll == RTSDS_930X_PLL_LC ? "LC" : "ring", phy_modes(interface));
 
 	return 0;
 }
 
-static void rtpcs_930x_sds_reset_state_machine(struct rtpcs_ctrl *ctrl, int sds)
+static void rtpcs_930x_sds_reset_state_machine(struct rtpcs_serdes *sds)
 {
-	rtpcs_sds_write_bits(ctrl, sds, 0x06, 0x02, 12, 12, 0x01); /* SM_RESET bit */
+	rtpcs_sds_write_bits(sds, 0x06, 0x02, 12, 12, 0x01); /* SM_RESET bit */
 	usleep_range(10000, 20000);
-	rtpcs_sds_write_bits(ctrl, sds, 0x06, 0x02, 12, 12, 0x00);
+	rtpcs_sds_write_bits(sds, 0x06, 0x02, 12, 12, 0x00);
 	usleep_range(10000, 20000);
 }
 
-static int rtpcs_930x_sds_init_state_machine(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_930x_sds_init_state_machine(struct rtpcs_serdes *sds,
 					     phy_interface_t interface)
 {
 	int loopback, link, cnt = 20, ret = -EBUSY;
@@ -867,24 +881,24 @@ static int rtpcs_930x_sds_init_state_machine(struct rtpcs_ctrl *ctrl, int sds,
 	 * works properly for 10G. To verify operation readyness run a connection check via
 	 * loopback.
 	 */
-	loopback = rtpcs_sds_read_bits(ctrl, sds, 0x06, 0x01, 2, 2); /* CFG_AFE_LPK bit */
-	rtpcs_sds_write_bits(ctrl, sds, 0x06, 0x01, 2, 2, 0x01);
+	loopback = rtpcs_sds_read_bits(sds, 0x06, 0x01, 2, 2); /* CFG_AFE_LPK bit */
+	rtpcs_sds_write_bits(sds, 0x06, 0x01, 2, 2, 0x01);
 
 	while (cnt-- && ret) {
-		rtpcs_930x_sds_reset_state_machine(ctrl, sds);
-		link = rtpcs_sds_read_bits(ctrl, sds, 0x05, 0x00, 12, 12); /* 10G link state (latched) */
-		link = rtpcs_sds_read_bits(ctrl, sds, 0x05, 0x00, 12, 12);
+		rtpcs_930x_sds_reset_state_machine(sds);
+		link = rtpcs_sds_read_bits(sds, 0x05, 0x00, 12, 12); /* 10G link state (latched) */
+		link = rtpcs_sds_read_bits(sds, 0x05, 0x00, 12, 12);
 		if (link)
 			ret = 0;
 	}
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x06, 0x01, 2, 2, loopback);
-	rtpcs_930x_sds_reset_state_machine(ctrl, sds);
+	rtpcs_sds_write_bits(sds, 0x06, 0x01, 2, 2, loopback);
+	rtpcs_930x_sds_reset_state_machine(sds);
 
 	return ret;
 }
 
-static void rtpcs_930x_sds_force_mode(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_force_mode(struct rtpcs_serdes *sds,
 				      phy_interface_t interface)
 {
 	int mode;
@@ -913,38 +927,40 @@ static void rtpcs_930x_sds_force_mode(struct rtpcs_ctrl *ctrl, int sds,
 		mode = RTL930X_SDS_OFF;
 		break;
 	default:
-		pr_err("%s: SDS %d does not support %s\n", __func__, sds, phy_modes(interface));
+		pr_err("%s: SDS %d does not support %s\n", __func__,
+		       sds->id, phy_modes(interface));
 		return;
 	}
 
-	rtpcs_930x_sds_set_power(ctrl, sds, false);
-	rtpcs_930x_sds_set_internal_mode(ctrl, sds, RTL930X_SDS_OFF);
+	rtpcs_930x_sds_set_power(sds, false);
+	rtpcs_930x_sds_set_internal_mode(sds, RTL930X_SDS_OFF);
 	if (interface == PHY_INTERFACE_MODE_NA)
 		return;
 
-	if (rtpcs_930x_sds_config_pll(ctrl, sds, interface))
+	if (rtpcs_930x_sds_config_pll(sds, interface))
 		pr_err("%s: SDS %d could not configure PLL for %s\n", __func__,
-		       sds, phy_modes(interface));
+		       sds->id, phy_modes(interface));
 
-	rtpcs_930x_sds_set_internal_mode(ctrl, sds, mode);
-	if (rtpcs_930x_sds_wait_clock_ready(ctrl, sds))
-		pr_err("%s: SDS %d could not sync clock\n", __func__, sds);
+	rtpcs_930x_sds_set_internal_mode(sds, mode);
+	if (rtpcs_930x_sds_wait_clock_ready(sds))
+		pr_err("%s: SDS %d could not sync clock\n", __func__, sds->id);
 
-	if (rtpcs_930x_sds_init_state_machine(ctrl, sds, interface))
-		pr_err("%s: SDS %d could not reset state machine\n", __func__, sds);
+	if (rtpcs_930x_sds_init_state_machine(sds, interface))
+		pr_err("%s: SDS %d could not reset state machine\n", __func__,
+		       sds->id);
 
-	rtpcs_930x_sds_set_power(ctrl, sds, true);
-	rtpcs_930x_sds_rx_reset(ctrl, sds, interface);
+	rtpcs_930x_sds_set_power(sds, true);
+	rtpcs_930x_sds_rx_reset(sds, interface);
 }
 
-static void rtpcs_930x_sds_mode_set(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_mode_set(struct rtpcs_serdes *sds,
 				    phy_interface_t phy_mode)
 {
 	u32 mode;
 	u32 submode;
 
-	if (sds < 0 || sds > 11) {
-		pr_err("%s: invalid SerDes number: %d\n", __func__, sds);
+	if (sds->id < 0 || sds->id > 11) {
+		pr_err("%s: invalid SerDes number: %d\n", __func__, sds->id);
 		return;
 	}
 
@@ -953,7 +969,7 @@ static void rtpcs_930x_sds_mode_set(struct rtpcs_ctrl *ctrl, int sds,
 	case PHY_INTERFACE_MODE_1000BASEX:
 	case PHY_INTERFACE_MODE_2500BASEX:
 	case PHY_INTERFACE_MODE_10GBASER:
-		rtpcs_930x_sds_force_mode(ctrl, sds, phy_mode);
+		rtpcs_930x_sds_force_mode(sds, phy_mode);
 		return;
 	case PHY_INTERFACE_MODE_10G_QXGMII:
 		mode = RTL930X_SDS_MODE_USXGMII;
@@ -965,17 +981,17 @@ static void rtpcs_930x_sds_mode_set(struct rtpcs_ctrl *ctrl, int sds,
 	}
 
 	/* SerDes off first. */
-	rtpcs_930x_sds_set(ctrl, sds, RTL930X_SDS_OFF);
+	rtpcs_930x_sds_set(sds, RTL930X_SDS_OFF);
 
 	/* Set the mode. */
-	rtpcs_930x_sds_set(ctrl, sds, mode);
+	rtpcs_930x_sds_set(sds, mode);
 
 	/* Set the submode if needed. */
 	if (phy_mode == PHY_INTERFACE_MODE_10G_QXGMII)
-		rtpcs_930x_sds_submode_set(ctrl, sds, submode);
+		rtpcs_930x_sds_submode_set(sds, submode);
 }
 
-static void rtpcs_930x_sds_tx_config(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_tx_config(struct rtpcs_serdes *sds,
 				     phy_interface_t phy_if)
 {
 	/* parameters: rtl9303_80G_txParam_s2 */
@@ -1017,49 +1033,49 @@ static void rtpcs_930x_sds_tx_config(struct rtpcs_ctrl *ctrl, int sds,
 		return;
 	}
 
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x01, 15, 11, pre_amp);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x06,  4,  0, post_amp);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x07,  0,  0, pre_en);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x07,  3,  3, post_en);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x07,  8,  4, main_amp);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x18, 15, 12, impedance);
+	rtpcs_sds_write_bits(sds, page, 0x01, 15, 11, pre_amp);
+	rtpcs_sds_write_bits(sds, page, 0x06,  4,  0, post_amp);
+	rtpcs_sds_write_bits(sds, page, 0x07,  0,  0, pre_en);
+	rtpcs_sds_write_bits(sds, page, 0x07,  3,  3, post_en);
+	rtpcs_sds_write_bits(sds, page, 0x07,  8,  4, main_amp);
+	rtpcs_sds_write_bits(sds, page, 0x18, 15, 12, impedance);
 }
 
 __always_unused
-static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_serdes *sds,
 					     u32 dcvs_id, bool manual, u32 dvcs_list[])
 {
 	if (manual) {
 		switch (dcvs_id) {
 		case 0:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 14, 14, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x03,  5,  5, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x03,  4,  0, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 14, 14, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x03,  5,  5, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x03,  4,  0, dvcs_list[1]);
 			break;
 		case 1:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 13, 13, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d, 15, 15, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d, 14, 11, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 13, 13, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 15, 15, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 14, 11, dvcs_list[1]);
 			break;
 		case 2:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 12, 12, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d, 10, 10, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d,  9,  6, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 12, 12, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 10, 10, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d,  9,  6, dvcs_list[1]);
 			break;
 		case 3:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 11, 11, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d,  5,  5, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d,  4,  1, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 11, 11, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d,  5,  5, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d,  4,  1, dvcs_list[1]);
 			break;
 		case 4:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x01, 15, 15, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x11, 10, 10, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x11,  9,  6, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x01, 15, 15, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x11, 10, 10, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x11,  9,  6, dvcs_list[1]);
 			break;
 		case 5:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x02, 11, 11, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x11,  4,  4, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x11,  3,  0, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x02, 11, 11, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x11,  4,  4, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x11,  3,  0, dvcs_list[1]);
 			break;
 		default:
 			break;
@@ -1067,22 +1083,22 @@ static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_ctrl *ctrl, u32 sds_nu
 	} else {
 		switch (dcvs_id) {
 		case 0:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 14, 14, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 14, 14, 0x0);
 			break;
 		case 1:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 13, 13, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 13, 13, 0x0);
 			break;
 		case 2:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 12, 12, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 12, 12, 0x0);
 			break;
 		case 3:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 11, 11, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 11, 11, 0x0);
 			break;
 		case 4:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x01, 15, 15, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x01, 15, 15, 0x0);
 			break;
 		case 5:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x02, 11, 11, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x02, 11, 11, 0x0);
 			break;
 		default:
 			break;
@@ -1092,81 +1108,82 @@ static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_ctrl *ctrl, u32 sds_nu
 }
 
 __always_unused
-static void rtpcs_930x_sds_rxcal_dcvs_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_dcvs_get(struct rtpcs_serdes *sds,
 					  u32 dcvs_id, u32 dcvs_list[])
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 dcvs_sign_out = 0, dcvs_coef_bin = 0;
 	bool dcvs_manual;
 
-	if (!(sds_num % 2))
-		rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+	if (sds == even_sds)
+		rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 	else
-		rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 	/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 
 	/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[1 0 x x x x] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x20);
+	rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x20);
 
 	switch (dcvs_id) {
 	case 0:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x22);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x22);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x1e, 14, 14);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x1e, 14, 14);
 		break;
 
 	case 1:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x23);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x23);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x1e, 13, 13);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x1e, 13, 13);
 		break;
 
 	case 2:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x24);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x24);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x1e, 12, 12);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x1e, 12, 12);
 		break;
 	case 3:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x25);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x25);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual   = rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x1e, 11, 11);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual   = rtpcs_sds_read_bits(sds, 0x2e, 0x1e, 11, 11);
 		break;
 
 	case 4:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x2c);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x2c);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x01, 15, 15);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x01, 15, 15);
 		break;
 
 	case 5:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x2d);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x2d);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual   = rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x02, 11, 11);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual   = rtpcs_sds_read_bits(sds, 0x2e, 0x02, 11, 11);
 		break;
 
 	default:
@@ -1185,26 +1202,25 @@ static void rtpcs_930x_sds_rxcal_dcvs_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
 	dcvs_list[1] = dcvs_coef_bin;
 }
 
-static void rtpcs_930x_sds_rxcal_leq_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_leq_manual(struct rtpcs_serdes *sds,
 					    bool manual, u32 leq_gray)
 {
 	if (manual) {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x18, 15, 15, 0x1);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x16, 14, 10, leq_gray);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x18, 15, 15, 0x1);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x16, 14, 10, leq_gray);
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x18, 15, 15, 0x0);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x18, 15, 15, 0x0);
 		mdelay(100);
 	}
 }
 
-static void rtpcs_930x_sds_rxcal_leq_offset_manual(struct rtpcs_ctrl *ctrl,
-						   u32 sds_num, bool manual,
-						   u32 offset)
+static void rtpcs_930x_sds_rxcal_leq_offset_manual(struct rtpcs_serdes *sds,
+						   bool manual, u32 offset)
 {
 	if (manual) {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 6, 2, offset);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x17, 6, 2, offset);
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 6, 2, offset);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x17, 6, 2, offset);
 		mdelay(1);
 	}
 }
@@ -1236,26 +1252,27 @@ static u32 rtpcs_930x_sds_rxcal_gray_to_binary(u32 gray_code)
 	return leq_binary;
 }
 
-static u32 rtpcs_930x_sds_rxcal_leq_read(struct rtpcs_ctrl *ctrl, int sds_num)
+static u32 rtpcs_930x_sds_rxcal_leq_read(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 leq_gray, leq_bin;
 	bool leq_manual;
 
-	if (!(sds_num % 2))
-		rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+	if (sds == even_sds)
+		rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 	else
-		rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 	/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 
 	/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[0 1 x x x x] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x10);
+	rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x10);
 	mdelay(1);
 
 	/* ##LEQ Read Out */
-	leq_gray = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 7, 3);
-	leq_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x18, 15, 15);
+	leq_gray = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 7, 3);
+	leq_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x18, 15, 15);
 	leq_bin = rtpcs_930x_sds_rxcal_gray_to_binary(leq_gray);
 
 	pr_info("LEQ_gray: %u, LEQ_bin: %u", leq_gray, leq_bin);
@@ -1264,102 +1281,104 @@ static u32 rtpcs_930x_sds_rxcal_leq_read(struct rtpcs_ctrl *ctrl, int sds_num)
 	return leq_bin;
 }
 
-static void rtpcs_930x_sds_rxcal_vth_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_vth_manual(struct rtpcs_serdes *sds,
 					    bool manual, u32 vth_list[])
 {
 	if (manual) {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, 13, 13, 0x1);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x13,  5,  3, vth_list[0]);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x13,  2,  0, vth_list[1]);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x0f, 13, 13, 0x1);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x13,  5,  3, vth_list[0]);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x13,  2,  0, vth_list[1]);
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, 13, 13, 0x0);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x0f, 13, 13, 0x0);
 		mdelay(10);
 	}
 }
 
-static void rtpcs_930x_sds_rxcal_vth_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_vth_get(struct rtpcs_serdes *sds,
 					 u32 vth_list[])
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 vth_manual;
 
 	/* ##Page0x1F, Reg0x02[15 0], REG_DBGO_SEL=[0x002F]; */ /* Lane0 */
 	/* ##Page0x1F, Reg0x02[15 0], REG_DBGO_SEL=[0x0031]; */ /* Lane1 */
-	if (!(sds_num % 2))
-		rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+	if (sds == even_sds)
+		rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 	else
-		rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 	/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 	/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[1 0 x x x x] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x20);
+	rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x20);
 	/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 1 1 0 0] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0xc);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0xc);
 
 	mdelay(1);
 
 	/* ##VthP & VthN Read Out */
-	vth_list[0] = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 2, 0); /* v_thp set bin */
-	vth_list[1] = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 3); /* v_thn set bin */
+	vth_list[0] = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 2, 0); /* v_thp set bin */
+	vth_list[1] = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 3); /* v_thn set bin */
 
 	pr_info("vth_set_bin = %d", vth_list[0]);
 	pr_info("vth_set_bin = %d", vth_list[1]);
 
-	vth_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x0f, 13, 13);
+	vth_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x0f, 13, 13);
 	pr_info("Vth Maunal = %d", vth_manual);
 }
 
-static void rtpcs_930x_sds_rxcal_tap_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_tap_manual(struct rtpcs_serdes *sds,
 					    int tap_id, bool manual, u32 tap_list[])
 {
 	if (manual) {
 		switch (tap_id) {
 		case 0:
 			/* ##REG0_LOAD_IN_INIT[0]=1; REG0_TAP0_INIT[5:0]=Tap0_Value */
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x03, 5, 5, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x03, 4, 0, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x03, 5, 5, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x03, 4, 0, tap_list[1]);
 			break;
 		case 1:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x07, 6, 6, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x09, 11, 6, tap_list[1]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x07, 5, 5, tap_list[2]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x12, 5, 0, tap_list[3]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x21, 0x07, 6, 6, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x09, 11, 6, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x21, 0x07, 5, 5, tap_list[2]);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x12, 5, 0, tap_list[3]);
 			break;
 		case 2:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x09, 5, 5, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x09, 4, 0, tap_list[1]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0a, 11, 11, tap_list[2]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0a, 10, 6, tap_list[3]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x09, 5, 5, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x09, 4, 0, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 11, 11, tap_list[2]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 10, 6, tap_list[3]);
 			break;
 		case 3:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0a, 5, 5, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0a, 4, 0, tap_list[1]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x06, 5, 5, tap_list[2]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x06, 4, 0, tap_list[3]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 5, 5, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 4, 0, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x06, 5, 5, tap_list[2]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x06, 4, 0, tap_list[3]);
 			break;
 		case 4:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x01, 5, 5, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x01, 4, 0, tap_list[1]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x06, 11, 11, tap_list[2]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x06, 10, 6, tap_list[3]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x01, 5, 5, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x01, 4, 0, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x06, 11, 11, tap_list[2]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x06, 10, 6, tap_list[3]);
 			break;
 		default:
 			break;
 		}
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x0);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x0);
 		mdelay(10);
 	}
 }
 
-static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_serdes *sds,
 					 u32 tap_id, u32 tap_list[])
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 tap0_sign_out;
 	u32 tap0_coef_bin;
 	u32 tap_sign_out_even;
@@ -1368,23 +1387,23 @@ static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
 	u32 tap_coef_bin_odd;
 	bool tap_manual;
 
-	if (!(sds_num % 2))
-		rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+	if (sds == even_sds)
+		rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 	else
-		rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 	/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 	/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[1 0 x x x x] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x20);
+	rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x20);
 
 	if (!tap_id) {
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 0 0 0 1] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0);
 		/* ##Tap1 Even Read Out */
 		mdelay(1);
-		tap0_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 5);
-		tap0_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 4, 0);
+		tap0_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 5);
+		tap0_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 4, 0);
 
 		if (tap0_sign_out == 1)
 			pr_info("Tap0 Sign : -");
@@ -1396,21 +1415,21 @@ static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
 		tap_list[0] = tap0_sign_out;
 		tap_list[1] = tap0_coef_bin;
 
-		tap_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x0f, 7, 7);
+		tap_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x0f, 7, 7);
 		pr_info("tap0 manual = %u", tap_manual);
 	} else {
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 0 0 0 1] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, tap_id);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, tap_id);
 		mdelay(1);
 		/* ##Tap1 Even Read Out */
-		tap_sign_out_even = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 5);
-		tap_coef_bin_even = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 4, 0);
+		tap_sign_out_even = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 5);
+		tap_coef_bin_even = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 4, 0);
 
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 0 1 1 0] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, (tap_id + 5));
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, (tap_id + 5));
 		/* ##Tap1 Odd Read Out */
-		tap_sign_out_odd = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 5);
-		tap_coef_bin_odd = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 4, 0);
+		tap_sign_out_odd = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 5);
+		tap_coef_bin_odd = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 4, 0);
 
 		if (tap_sign_out_even == 1)
 			pr_info("Tap %u even sign: -", tap_id);
@@ -1431,82 +1450,82 @@ static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
 		tap_list[2] = tap_sign_out_odd;
 		tap_list[3] = tap_coef_bin_odd;
 
-		tap_manual = rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7);
+		tap_manual = rtpcs_sds_read_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7);
 		pr_info("tap %u manual = %d", tap_id, tap_manual);
 	}
 }
 
 __always_unused
-static void rtpcs_930x_sds_do_rx_calibration_1(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_do_rx_calibration_1(struct rtpcs_serdes *sds,
 					       phy_interface_t phy_mode)
 {
 	/* From both rtl9300_rxCaliConf_serdes_myParam and rtl9300_rxCaliConf_phy_myParam */
 	int tap0_init_val = 0x1f; /* Initial Decision Fed Equalizer 0 tap */
 	int vth_min       = 0x0;
 
-	pr_info("start_1.1.1 initial value for sds %d\n", sds);
-	rtpcs_sds_write(ctrl, sds, 6,  0, 0);
+	pr_info("start_1.1.1 initial value for sds %d\n", sds->id);
+	rtpcs_sds_write(sds, 6,  0, 0);
 
 	/* FGCAL */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x01, 14, 14, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1c, 10,  5, 0x20);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x02,  0,  0, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x01, 14, 14, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1c, 10,  5, 0x20);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x02,  0,  0, 0x01);
 
 	/* DCVS */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1e, 14, 11, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x01, 15, 15, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x02, 11, 11, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1c,  4,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1d, 15, 11, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1d, 10,  6, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1d,  5,  1, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x02, 10,  6, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x11,  4,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x00,  3,  0, 0x0f);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x04,  6,  6, 0x01);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x04,  7,  7, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 14, 11, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x01, 15, 15, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x02, 11, 11, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1c,  4,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 15, 11, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 10,  6, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1d,  5,  1, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x02, 10,  6, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x11,  4,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x00,  3,  0, 0x0f);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x04,  6,  6, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x04,  7,  7, 0x01);
 
 	/* LEQ (Long Term Equivalent signal level) */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x16, 14,  8, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x16, 14,  8, 0x00);
 
 	/* DFE (Decision Fed Equalizer) */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x03,  5,  0, tap0_init_val);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x09, 11,  6, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x09,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0a,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x01,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x12,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0a, 11,  6, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x06,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x01,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x03,  5,  0, tap0_init_val);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x09, 11,  6, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x09,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0a,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x01,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x12,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 11,  6, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x06,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x01,  5,  0, 0x00);
 
 	/* Vth */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x13,  5,  3, 0x07);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x13,  2,  0, 0x07);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x0b,  5,  3, vth_min);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x13,  5,  3, 0x07);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x13,  2,  0, 0x07);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x0b,  5,  3, vth_min);
 
 	pr_info("end_1.1.1 --\n");
 
 	pr_info("start_1.1.2 Load DFE init. value\n");
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0f, 13,  7, 0x7f);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0f, 13,  7, 0x7f);
 
 	pr_info("end_1.1.2\n");
 
 	pr_info("start_1.1.3 disable LEQ training,enable DFE clock\n");
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x17,  7,  7, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x17,  6,  2, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0c,  8,  8, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0b,  4,  4, 0x01);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x12, 14, 14, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x02, 15, 15, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x17,  7,  7, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x17,  6,  2, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0c,  8,  8, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0b,  4,  4, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x12, 14, 14, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x02, 15, 15, 0x00);
 
 	pr_info("end_1.1.3 --\n");
 
 	pr_info("start_1.1.4 offset cali setting\n");
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0f, 15, 14, 0x03);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0f, 15, 14, 0x03);
 
 	pr_info("end_1.1.4\n");
 
@@ -1517,76 +1536,74 @@ static void rtpcs_930x_sds_do_rx_calibration_1(struct rtpcs_ctrl *ctrl, int sds,
 	if (phy_mode == PHY_INTERFACE_MODE_10GBASER ||
 	    phy_mode == PHY_INTERFACE_MODE_1000BASEX ||
 	    phy_mode == PHY_INTERFACE_MODE_SGMII)
-		rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x16,  3,  2, 0x02);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x16,  3,  2, 0x02);
 	else
 		pr_err("%s not PHY-based or SerDes, implement DAC!\n", __func__);
 
 	/* No serdes, check for Aquantia PHYs */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x16,  3,  2, 0x02);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x16,  3,  2, 0x02);
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0f,  6,  0, 0x5f);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x05,  7,  2, 0x1f);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x19,  9,  5, 0x1f);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x0b, 15,  9, 0x3c);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0b,  1,  0, 0x03);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0f,  6,  0, 0x5f);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x05,  7,  2, 0x1f);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x19,  9,  5, 0x1f);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x0b, 15,  9, 0x3c);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0b,  1,  0, 0x03);
 
 	pr_info("end_1.1.5\n");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_2_1(struct rtpcs_ctrl *ctrl,
-						 u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_2_1(struct rtpcs_serdes *sds)
 {
 	pr_info("start_1.2.1 ForegroundOffsetCal_Manual\n");
 
 	/* Gray config endis to 1 */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x02,  2,  2, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x02,  2,  2, 0x01);
 
 	/* ForegroundOffsetCal_Manual(auto mode) */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x01, 14, 14, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x01, 14, 14, 0x00);
 
 	pr_info("end_1.2.1");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_2_2(struct rtpcs_ctrl *ctrl,
-						 int sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_2_2(struct rtpcs_serdes *sds)
 {
 	/* Force Rx-Run = 0 */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 8, 8, 0x0);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 8, 8, 0x0);
 
-	rtpcs_930x_sds_rx_reset(ctrl, sds_num, PHY_INTERFACE_MODE_10GBASER);
+	rtpcs_930x_sds_rx_reset(sds, PHY_INTERFACE_MODE_10GBASER);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_2_3(struct rtpcs_ctrl *ctrl,
-						 int sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_2_3(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 fgcal_binary, fgcal_gray;
 	u32 offset_range;
 
 	pr_info("start_1.2.3 Foreground Calibration\n");
 
 	while (1) {
-		if (!(sds_num % 2))
-			rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+		if (sds == even_sds)
+			rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 		else
-			rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+			rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 		/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 		/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[1 0 x x x x] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x20);
+		rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x20);
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 1 1 1 1] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0xf);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0xf);
 		/* ##FGCAL read gray */
-		fgcal_gray = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 0);
+		fgcal_gray = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 0);
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 1 1 1 0] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0xe);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0xe);
 		/* ##FGCAL read binary */
-		fgcal_binary = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 0);
+		fgcal_binary = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 0);
 
 		pr_info("%s: fgcal_gray: %d, fgcal_binary %d\n",
 			__func__, fgcal_gray, fgcal_binary);
 
-		offset_range = rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x15, 15, 14);
+		offset_range = rtpcs_sds_read_bits(sds, 0x2e, 0x15, 15, 14);
 
 		if (fgcal_binary <= 60 && fgcal_binary >= 3)
 			break;
@@ -1597,22 +1614,22 @@ static void rtpcs_930x_sds_do_rx_calibration_2_3(struct rtpcs_ctrl *ctrl,
 		}
 
 		offset_range++;
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 15, 14, offset_range);
-		rtpcs_930x_sds_do_rx_calibration_2_2(ctrl, sds_num);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x15, 15, 14, offset_range);
+		rtpcs_930x_sds_do_rx_calibration_2_2(sds);
 	}
 	pr_info("%s: end_1.2.3\n", __func__);
 }
 
 __always_unused
-static void rtpcs_930x_sds_do_rx_calibration_2(struct rtpcs_ctrl *ctrl, int sds)
+static void rtpcs_930x_sds_do_rx_calibration_2(struct rtpcs_serdes *sds)
 {
-	rtpcs_930x_sds_rx_reset(ctrl, sds, PHY_INTERFACE_MODE_10GBASER);
-	rtpcs_930x_sds_do_rx_calibration_2_1(ctrl, sds);
-	rtpcs_930x_sds_do_rx_calibration_2_2(ctrl, sds);
-	rtpcs_930x_sds_do_rx_calibration_2_3(ctrl, sds);
+	rtpcs_930x_sds_rx_reset(sds, PHY_INTERFACE_MODE_10GBASER);
+	rtpcs_930x_sds_do_rx_calibration_2_1(sds);
+	rtpcs_930x_sds_do_rx_calibration_2_2(sds);
+	rtpcs_930x_sds_do_rx_calibration_2_3(sds);
 }
 
-static void rtpcs_930x_sds_rxcal_3_1(struct rtpcs_ctrl *ctrl, int sds_num,
+static void rtpcs_930x_sds_rxcal_3_1(struct rtpcs_serdes *sds,
 				     phy_interface_t phy_mode)
 {
 	pr_info("start_1.3.1");
@@ -1621,15 +1638,15 @@ static void rtpcs_930x_sds_rxcal_3_1(struct rtpcs_ctrl *ctrl, int sds_num,
 	if (phy_mode != PHY_INTERFACE_MODE_10GBASER &&
 	    phy_mode != PHY_INTERFACE_MODE_1000BASEX &&
 	    phy_mode != PHY_INTERFACE_MODE_SGMII)
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0xc, 8, 8, 0);
+		rtpcs_sds_write_bits(sds, 0x2e, 0xc, 8, 8, 0);
 
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 7, 7, 0x0);
-	rtpcs_930x_sds_rxcal_leq_manual(ctrl, sds_num, false, 0);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x17, 7, 7, 0x0);
+	rtpcs_930x_sds_rxcal_leq_manual(sds, false, 0);
 
 	pr_info("end_1.3.1");
 }
 
-static void rtpcs_930x_sds_rxcal_3_2(struct rtpcs_ctrl *ctrl, int sds_num,
+static void rtpcs_930x_sds_rxcal_3_2(struct rtpcs_serdes *sds,
 				     phy_interface_t phy_mode)
 {
 	u32 sum10 = 0, avg10, int10;
@@ -1655,7 +1672,7 @@ static void rtpcs_930x_sds_rxcal_3_2(struct rtpcs_ctrl *ctrl, int sds_num,
 	pr_info("start_1.3.2");
 
 	for (i = 0; i < 10; i++) {
-		sum10 += rtpcs_930x_sds_rxcal_leq_read(ctrl, sds_num);
+		sum10 += rtpcs_930x_sds_rxcal_leq_read(sds);
 		mdelay(10);
 	}
 
@@ -1668,46 +1685,46 @@ static void rtpcs_930x_sds_rxcal_3_2(struct rtpcs_ctrl *ctrl, int sds_num,
 	    phy_mode == PHY_INTERFACE_MODE_1000BASEX ||
 	    phy_mode == PHY_INTERFACE_MODE_SGMII) {
 		if (dac_long_cable_offset) {
-			rtpcs_930x_sds_rxcal_leq_offset_manual(ctrl, sds_num, 1,
+			rtpcs_930x_sds_rxcal_leq_offset_manual(sds, 1,
 							       dac_long_cable_offset);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 7, 7,
+			rtpcs_sds_write_bits(sds, 0x2e, 0x17, 7, 7,
 					     eq_hold_enabled);
 			if (phy_mode == PHY_INTERFACE_MODE_10GBASER)
-				rtpcs_930x_sds_rxcal_leq_manual(ctrl, sds_num,
+				rtpcs_930x_sds_rxcal_leq_manual(sds,
 								true, avg10);
 		} else {
 			if (sum10 >= 5) {
-				rtpcs_930x_sds_rxcal_leq_offset_manual(ctrl, sds_num, 1, 3);
-				rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 7, 7, 0x1);
+				rtpcs_930x_sds_rxcal_leq_offset_manual(sds, 1, 3);
+				rtpcs_sds_write_bits(sds, 0x2e, 0x17, 7, 7, 0x1);
 				if (phy_mode == PHY_INTERFACE_MODE_10GBASER)
-					rtpcs_930x_sds_rxcal_leq_manual(ctrl, sds_num, true, avg10);
+					rtpcs_930x_sds_rxcal_leq_manual(sds, true, avg10);
 			} else {
-				rtpcs_930x_sds_rxcal_leq_offset_manual(ctrl, sds_num, 1, 0);
-				rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 7, 7, 0x1);
+				rtpcs_930x_sds_rxcal_leq_offset_manual(sds, 1, 0);
+				rtpcs_sds_write_bits(sds, 0x2e, 0x17, 7, 7, 0x1);
 				if (phy_mode == PHY_INTERFACE_MODE_10GBASER)
-					rtpcs_930x_sds_rxcal_leq_manual(ctrl, sds_num, true, avg10);
+					rtpcs_930x_sds_rxcal_leq_manual(sds, true, avg10);
 			}
 		}
 	}
 
-	pr_info("Sds:%u LEQ = %u", sds_num, rtpcs_930x_sds_rxcal_leq_read(ctrl, sds_num));
+	pr_info("Sds:%u LEQ = %u", sds->id, rtpcs_930x_sds_rxcal_leq_read(sds));
 
 	pr_info("end_1.3.2");
 }
 
 __always_unused
-static void rtpcs_930x_sds_do_rx_calibration_3(struct rtpcs_ctrl *ctrl, int sds_num,
+static void rtpcs_930x_sds_do_rx_calibration_3(struct rtpcs_serdes *sds,
 					       phy_interface_t phy_mode)
 {
-	rtpcs_930x_sds_rxcal_3_1(ctrl, sds_num, phy_mode);
+	rtpcs_930x_sds_rxcal_3_1(sds, phy_mode);
 
 	if (phy_mode == PHY_INTERFACE_MODE_10GBASER ||
 	    phy_mode == PHY_INTERFACE_MODE_1000BASEX ||
 	    phy_mode == PHY_INTERFACE_MODE_SGMII)
-		rtpcs_930x_sds_rxcal_3_2(ctrl, sds_num, phy_mode);
+		rtpcs_930x_sds_rxcal_3_2(sds, phy_mode);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_4_1(struct rtpcs_ctrl *ctrl, int sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_4_1(struct rtpcs_serdes *sds)
 {
 	u32 vth_list[2] = {0, 0};
 	u32 tap0_list[4] = {0, 0, 0, 0};
@@ -1715,38 +1732,38 @@ static void rtpcs_930x_sds_do_rx_calibration_4_1(struct rtpcs_ctrl *ctrl, int sd
 	pr_info("start_1.4.1");
 
 	/* ##1.4.1 */
-	rtpcs_930x_sds_rxcal_vth_manual(ctrl, sds_num, false, vth_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 0, false, tap0_list);
+	rtpcs_930x_sds_rxcal_vth_manual(sds, false, vth_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 0, false, tap0_list);
 	mdelay(200);
 
 	pr_info("end_1.4.1");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_4_2(struct rtpcs_ctrl *ctrl, u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_4_2(struct rtpcs_serdes *sds)
 {
 	u32 vth_list[2];
 	u32 tap_list[4];
 
 	pr_info("start_1.4.2");
 
-	rtpcs_930x_sds_rxcal_vth_get(ctrl, sds_num, vth_list);
-	rtpcs_930x_sds_rxcal_vth_manual(ctrl, sds_num, true, vth_list);
+	rtpcs_930x_sds_rxcal_vth_get(sds, vth_list);
+	rtpcs_930x_sds_rxcal_vth_manual(sds, true, vth_list);
 
 	mdelay(100);
 
-	rtpcs_930x_sds_rxcal_tap_get(ctrl, sds_num, 0, tap_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 0, true, tap_list);
+	rtpcs_930x_sds_rxcal_tap_get(sds, 0, tap_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 0, true, tap_list);
 
 	pr_info("end_1.4.2");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_4(struct rtpcs_ctrl *ctrl, u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_4(struct rtpcs_serdes *sds)
 {
-	rtpcs_930x_sds_do_rx_calibration_4_1(ctrl, sds_num);
-	rtpcs_930x_sds_do_rx_calibration_4_2(ctrl, sds_num);
+	rtpcs_930x_sds_do_rx_calibration_4_1(sds);
+	rtpcs_930x_sds_do_rx_calibration_4_2(sds);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_5_2(struct rtpcs_ctrl *ctrl, u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_5_2(struct rtpcs_serdes *sds)
 {
 	u32 tap1_list[4] = {0};
 	u32 tap2_list[4] = {0};
@@ -1755,64 +1772,64 @@ static void rtpcs_930x_sds_do_rx_calibration_5_2(struct rtpcs_ctrl *ctrl, u32 sd
 
 	pr_info("start_1.5.2");
 
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 1, false, tap1_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 2, false, tap2_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 3, false, tap3_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 4, false, tap4_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 1, false, tap1_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 2, false, tap2_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 3, false, tap3_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 4, false, tap4_list);
 
 	mdelay(30);
 
 	pr_info("end_1.5.2");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_5(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_do_rx_calibration_5(struct rtpcs_serdes *sds,
 					       phy_interface_t phy_mode)
 {
 	if (phy_mode == PHY_INTERFACE_MODE_10GBASER) /* dfeTap1_4Enable true */
-		rtpcs_930x_sds_do_rx_calibration_5_2(ctrl, sds_num);
+		rtpcs_930x_sds_do_rx_calibration_5_2(sds);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_dfe_disable(struct rtpcs_ctrl *ctrl, u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_dfe_disable(struct rtpcs_serdes *sds)
 {
 	u32 tap1_list[4] = {0};
 	u32 tap2_list[4] = {0};
 	u32 tap3_list[4] = {0};
 	u32 tap4_list[4] = {0};
 
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 1, true, tap1_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 2, true, tap2_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 3, true, tap3_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 4, true, tap4_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 1, true, tap1_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 2, true, tap2_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 3, true, tap3_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 4, true, tap4_list);
 
 	mdelay(10);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_do_rx_calibration(struct rtpcs_serdes *sds,
 					     phy_interface_t phy_mode)
 {
 	u32 latch_sts;
 
-	rtpcs_930x_sds_do_rx_calibration_1(ctrl, sds, phy_mode);
-	rtpcs_930x_sds_do_rx_calibration_2(ctrl, sds);
-	rtpcs_930x_sds_do_rx_calibration_4(ctrl, sds);
-	rtpcs_930x_sds_do_rx_calibration_5(ctrl, sds, phy_mode);
+	rtpcs_930x_sds_do_rx_calibration_1(sds, phy_mode);
+	rtpcs_930x_sds_do_rx_calibration_2(sds);
+	rtpcs_930x_sds_do_rx_calibration_4(sds);
+	rtpcs_930x_sds_do_rx_calibration_5(sds, phy_mode);
 	mdelay(20);
 
 	/* Do this only for 10GR mode, SDS active in mode 0x1a */
-	if (rtpcs_sds_read_bits(ctrl, sds, 0x1f, 9, 11, 7) == RTL930X_SDS_MODE_10GBASER) {
+	if (rtpcs_sds_read_bits(sds, 0x1f, 9, 11, 7) == RTL930X_SDS_MODE_10GBASER) {
 		pr_info("%s: SDS enabled\n", __func__);
-		latch_sts = rtpcs_sds_read_bits(ctrl, sds, 0x4, 1, 2, 2);
+		latch_sts = rtpcs_sds_read_bits(sds, 0x4, 1, 2, 2);
 		mdelay(1);
-		latch_sts = rtpcs_sds_read_bits(ctrl, sds, 0x4, 1, 2, 2);
+		latch_sts = rtpcs_sds_read_bits(sds, 0x4, 1, 2, 2);
 		if (latch_sts) {
-			rtpcs_930x_sds_do_rx_calibration_dfe_disable(ctrl, sds);
-			rtpcs_930x_sds_do_rx_calibration_4(ctrl, sds);
-			rtpcs_930x_sds_do_rx_calibration_5(ctrl, sds, phy_mode);
+			rtpcs_930x_sds_do_rx_calibration_dfe_disable(sds);
+			rtpcs_930x_sds_do_rx_calibration_4(sds);
+			rtpcs_930x_sds_do_rx_calibration_5(sds, phy_mode);
 		}
 	}
 }
 
-static int rtpcs_930x_sds_sym_err_reset(struct rtpcs_ctrl *ctrl, int sds_num,
+static int rtpcs_930x_sds_sym_err_reset(struct rtpcs_serdes *sds,
 					phy_interface_t phy_mode)
 {
 	switch (phy_mode) {
@@ -1821,16 +1838,16 @@ static int rtpcs_930x_sds_sym_err_reset(struct rtpcs_ctrl *ctrl, int sds_num,
 
 	case PHY_INTERFACE_MODE_10GBASER:
 		/* Read twice to clear */
-		rtpcs_sds_read(ctrl, sds_num, 5, 1);
-		rtpcs_sds_read(ctrl, sds_num, 5, 1);
+		rtpcs_sds_read(sds, 5, 1);
+		rtpcs_sds_read(sds, 5, 1);
 		break;
 
 	case PHY_INTERFACE_MODE_1000BASEX:
 	case PHY_INTERFACE_MODE_SGMII:
 	case PHY_INTERFACE_MODE_10G_QXGMII:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x1, 24, 2, 0, 0);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x1, 3, 15, 8, 0);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x1, 2, 15, 0, 0);
+		rtpcs_sds_write_bits(sds, 0x1, 24, 2, 0, 0);
+		rtpcs_sds_write_bits(sds, 0x1, 3, 15, 8, 0);
+		rtpcs_sds_write_bits(sds, 0x1, 2, 15, 0, 0);
 		break;
 
 	default:
@@ -1841,7 +1858,7 @@ static int rtpcs_930x_sds_sym_err_reset(struct rtpcs_ctrl *ctrl, int sds_num,
 	return 0;
 }
 
-static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_ctrl *ctrl, int sds_num,
+static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_serdes *sds,
 				      phy_interface_t phy_mode)
 {
 	u32 v = 0;
@@ -1854,7 +1871,7 @@ static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_ctrl *ctrl, int sds_num,
 	case PHY_INTERFACE_MODE_1000BASEX:
 	case PHY_INTERFACE_MODE_SGMII:
 	case PHY_INTERFACE_MODE_10GBASER:
-		v = rtpcs_sds_read(ctrl, sds_num, 5, 1);
+		v = rtpcs_sds_read(sds, 5, 1);
 		return v & 0xff;
 
 	default:
@@ -1864,18 +1881,18 @@ static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_ctrl *ctrl, int sds_num,
 	return v;
 }
 
-static int rtpcs_930x_sds_check_calibration(struct rtpcs_ctrl *ctrl, int sds_num,
+static int rtpcs_930x_sds_check_calibration(struct rtpcs_serdes *sds,
 					    phy_interface_t phy_mode)
 {
 	u32 errors1, errors2;
 
-	rtpcs_930x_sds_sym_err_reset(ctrl, sds_num, phy_mode);
-	rtpcs_930x_sds_sym_err_reset(ctrl, sds_num, phy_mode);
+	rtpcs_930x_sds_sym_err_reset(sds, phy_mode);
+	rtpcs_930x_sds_sym_err_reset(sds, phy_mode);
 
 	/* Count errors during 1ms */
-	errors1 = rtpcs_930x_sds_sym_err_get(ctrl, sds_num, phy_mode);
+	errors1 = rtpcs_930x_sds_sym_err_get(sds, phy_mode);
 	mdelay(1);
-	errors2 = rtpcs_930x_sds_sym_err_get(ctrl, sds_num, phy_mode);
+	errors2 = rtpcs_930x_sds_sym_err_get(sds, phy_mode);
 
 	switch (phy_mode) {
 	case PHY_INTERFACE_MODE_1000BASEX:
@@ -1901,44 +1918,46 @@ static int rtpcs_930x_sds_check_calibration(struct rtpcs_ctrl *ctrl, int sds_num
 	return 0;
 }
 
-static void rtpcs_930x_phy_enable_10g_1g(struct rtpcs_ctrl *ctrl, int sds_num)
+static void rtpcs_930x_phy_enable_10g_1g(struct rtpcs_serdes *sds)
 {
+
 	u32 v;
 
 	/* Enable 1GBit PHY */
-	v = rtpcs_sds_read(ctrl, sds_num, PHY_PAGE_2, MII_BMCR);
+	v = rtpcs_sds_read(sds, PHY_PAGE_2, MII_BMCR);
 	pr_info("%s 1gbit phy: %08x\n", __func__, v);
 	v &= ~BMCR_PDOWN;
-	rtpcs_sds_write(ctrl, sds_num, PHY_PAGE_2, MII_BMCR, v);
+	rtpcs_sds_write(sds, PHY_PAGE_2, MII_BMCR, v);
 	pr_info("%s 1gbit phy enabled: %08x\n", __func__, v);
 
 	/* Enable 10GBit PHY */
-	v = rtpcs_sds_read(ctrl, sds_num, PHY_PAGE_4, MII_BMCR);
+	v = rtpcs_sds_read(sds, PHY_PAGE_4, MII_BMCR);
 	pr_info("%s 10gbit phy: %08x\n", __func__, v);
 	v &= ~BMCR_PDOWN;
-	rtpcs_sds_write(ctrl, sds_num, PHY_PAGE_4, MII_BMCR, v);
+	rtpcs_sds_write(sds, PHY_PAGE_4, MII_BMCR, v);
 	pr_info("%s 10gbit phy after: %08x\n", __func__, v);
 
 	/* dal_longan_construct_mac_default_10gmedia_fiber */
-	v = rtpcs_sds_read(ctrl, sds_num, 0x1f, 11);
+	v = rtpcs_sds_read(sds, 0x1f, 11);
 	pr_info("%s set medium: %08x\n", __func__, v);
 	v |= BIT(1);
-	rtpcs_sds_write(ctrl, sds_num, 0x1f, 11, v);
+	rtpcs_sds_write(sds, 0x1f, 11, v);
 	pr_info("%s set medium after: %08x\n", __func__, v);
 }
 
-static int rtpcs_930x_sds_10g_idle(struct rtpcs_ctrl *ctrl, int sds_num)
+static int rtpcs_930x_sds_10g_idle(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	bool busy;
 	int i = 0;
 
 	do {
-		if (sds_num % 2) {
-			rtpcs_sds_write_bits(ctrl, sds_num - 1, 0x1f, 0x2, 15, 0, 53);
-			busy = !!rtpcs_sds_read_bits(ctrl, sds_num - 1, 0x1f, 0x14, 1, 1);
+		if (sds == even_sds) {
+			rtpcs_sds_write_bits(sds, 0x1f, 0x2, 15, 0, 53);
+			busy = !!rtpcs_sds_read_bits(sds, 0x1f, 0x14, 0, 0);
 		} else {
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x1f, 0x2, 15, 0, 53);
-			busy = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 0, 0);
+			rtpcs_sds_write_bits(even_sds, 0x1f, 0x2, 15, 0, 53);
+			busy = !!rtpcs_sds_read_bits(even_sds, 0x1f, 0x14, 1, 1);
 		}
 		i++;
 	} while (busy && i < 100);
@@ -1946,11 +1965,12 @@ static int rtpcs_930x_sds_10g_idle(struct rtpcs_ctrl *ctrl, int sds_num)
 	if (i < 100)
 		return 0;
 
-	pr_warn("%s WARNING: Waiting for RX idle timed out, SDS %d\n", __func__, sds_num);
+	pr_warn("%s WARNING: Waiting for RX idle timed out, SDS %d\n",
+		__func__, sds->id);
 	return -EIO;
 }
 
-static int rtpcs_930x_sds_set_polarity(struct rtpcs_ctrl *ctrl, u32 sds,
+static int rtpcs_930x_sds_set_polarity(struct rtpcs_serdes *sds,
 				       bool tx_inv, bool rx_inv)
 {
 	u8 rx_val = rx_inv ? 1 : 0;
@@ -1960,13 +1980,13 @@ static int rtpcs_930x_sds_set_polarity(struct rtpcs_ctrl *ctrl, u32 sds,
 
 	/* 10GR */
 	val = (tx_val << 1) | rx_val;
-	ret = rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x2, 14, 13, val);
+	ret = rtpcs_sds_write_bits(sds, 0x6, 0x2, 14, 13, val);
 	if (ret)
 		return ret;
 
 	/* 1G */
 	val = (rx_val << 1) | tx_val;
-	return rtpcs_sds_write_bits(ctrl, sds, 0x0, 0x0, 9, 8, val);
+	return rtpcs_sds_write_bits(sds, 0x0, 0x0, 9, 8, val);
 }
 
 static const sds_config rtpcs_930x_sds_cfg_10gr_even[] = {
@@ -2102,44 +2122,47 @@ static const sds_config rtpcs_930x_sds_cfg_10g_2500bx_odd[] = {
 	{0x2D, 0x13, 0x3C87}, {0x2D, 0x14, 0x1808},
 };
 
-static void rtpcs_930x_sds_usxgmii_config(struct rtpcs_ctrl *ctrl, int sds,
-					  int nway_en, u32 opcode, u32 am_period,
+static void rtpcs_930x_sds_usxgmii_config(struct rtpcs_serdes *sds, int nway_en,
+					  u32 opcode, u32 am_period,
 					  u32 all_am_markers, u32 an_table,
 					  u32 sync_bit)
 {
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x11, 0, 0, nway_en);
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x11, 1, 1, nway_en);
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x11, 2, 2, nway_en);
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x11, 3, 3, nway_en);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x12, 15, 0, am_period);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x13, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x13, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x14, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x14, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x15, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x15, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x16, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x16, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x17, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x17, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x18, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x18, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x10, 7, 0, opcode);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0xe, 10, 10, an_table);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x1d, 11, 10, sync_bit);
-}
-
-static void rtpcs_930x_sds_patch(struct rtpcs_ctrl *ctrl, int sds, phy_interface_t mode)
-{
-	const bool even_sds = ((sds & 1) == 0);
+	rtpcs_sds_write_bits(sds, 0x7, 0x11, 0, 0, nway_en);
+	rtpcs_sds_write_bits(sds, 0x7, 0x11, 1, 1, nway_en);
+	rtpcs_sds_write_bits(sds, 0x7, 0x11, 2, 2, nway_en);
+	rtpcs_sds_write_bits(sds, 0x7, 0x11, 3, 3, nway_en);
+	rtpcs_sds_write_bits(sds, 0x6, 0x12, 15, 0, am_period);
+	rtpcs_sds_write_bits(sds, 0x6, 0x13, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x13, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x14, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x14, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x15, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x15, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x16, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x16, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x17, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x17, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x18, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x18, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x7, 0x10, 7, 0, opcode);
+	rtpcs_sds_write_bits(sds, 0x6, 0xe, 10, 10, an_table);
+	rtpcs_sds_write_bits(sds, 0x6, 0x1d, 11, 10, sync_bit);
+}
+
+static void rtpcs_930x_sds_patch(struct rtpcs_serdes *sds, phy_interface_t mode)
+{
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	const sds_config *config;
+	bool is_even_sds;
 	size_t count;
 
+	is_even_sds = (sds == even_sds);
+
 	switch (mode) {
 	case PHY_INTERFACE_MODE_1000BASEX:
 	case PHY_INTERFACE_MODE_SGMII:
 	case PHY_INTERFACE_MODE_10GBASER:
-		if (even_sds) {
+		if (is_even_sds) {
 			config = rtpcs_930x_sds_cfg_10gr_even;
 			count = ARRAY_SIZE(rtpcs_930x_sds_cfg_10gr_even);
 		} else {
@@ -2149,7 +2172,7 @@ static void rtpcs_930x_sds_patch(struct rtpcs_ctrl *ctrl, int sds, phy_interface
 		break;
 
 	case PHY_INTERFACE_MODE_2500BASEX:
-		if (even_sds) {
+		if (is_even_sds) {
 			config = rtpcs_930x_sds_cfg_10g_2500bx_even;
 			count = ARRAY_SIZE(rtpcs_930x_sds_cfg_10g_2500bx_even);
 		} else {
@@ -2162,51 +2185,53 @@ static void rtpcs_930x_sds_patch(struct rtpcs_ctrl *ctrl, int sds, phy_interface
 		return;
 
 	default:
-		pr_warn("%s: unsupported mode %s on serdes %d\n", __func__, phy_modes(mode), sds);
+		pr_warn("%s: unsupported mode %s on serdes %d\n", __func__, phy_modes(mode),
+			sds->id);
 		return;
 	}
 
 	for (size_t i = 0; i < count; ++i)
-		rtpcs_sds_write(ctrl, sds, config[i].page, config[i].reg, config[i].data);
+		rtpcs_sds_write(sds, config[i].page, config[i].reg, config[i].data);
 
 	if (mode == PHY_INTERFACE_MODE_10G_QXGMII) {
 		/* Default configuration */
-		rtpcs_930x_sds_usxgmii_config(ctrl, sds, 1, 0xaa, 0x5078, 0, 1, 0x1);
+		rtpcs_930x_sds_usxgmii_config(sds, 1, 0xaa, 0x5078, 0, 1, 0x1);
 	}
 }
 
 __always_unused
-static int rtpcs_930x_sds_cmu_band_get(struct rtpcs_ctrl *ctrl, int sds)
+static int rtpcs_930x_sds_cmu_band_get(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
+	struct rtpcs_serdes *odd_sds = rtpcs_sds_get_odd(sds);
 	u32 page;
 	u32 en;
 	u32 cmu_band;
 
 /*	page = rtl9300_sds_cmu_page_get(sds); */
 	page = 0x25; /* 10GR and 1000BX */
-	sds = (sds % 2) ? (sds - 1) : (sds);
 
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x1c, 15, 15, 1);
-	rtpcs_sds_write_bits(ctrl, sds + 1, page, 0x1c, 15, 15, 1);
+	rtpcs_sds_write_bits(even_sds, page, 0x1c, 15, 15, 1);
+	rtpcs_sds_write_bits(odd_sds, page, 0x1c, 15, 15, 1);
 
-	en = rtpcs_sds_read_bits(ctrl, sds, page, 27, 1, 1);
+	en = rtpcs_sds_read_bits(even_sds, page, 27, 1, 1);
 	if (!en) { /* Auto mode */
-		rtpcs_sds_write(ctrl, sds, 0x1f, 0x02, 31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x02, 31);
 
-		cmu_band = rtpcs_sds_read_bits(ctrl, sds, 0x1f, 0x15, 5, 1);
+		cmu_band = rtpcs_sds_read_bits(even_sds, 0x1f, 0x15, 5, 1);
 	} else {
-		cmu_band = rtpcs_sds_read_bits(ctrl, sds, page, 30, 4, 0);
+		cmu_band = rtpcs_sds_read_bits(even_sds, page, 30, 4, 0);
 	}
 
 	return cmu_band;
 }
 
-static int rtpcs_930x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 				   phy_interface_t phy_mode)
 {
 	int calib_tries = 0;
 
-	if (sds < 0 || sds > 11)
+	if (sds->id < 0 || sds->id > 11)
 		return -EINVAL;
 
 	/* Rely on setup from U-boot for some modes, e.g. USXGMII */
@@ -2222,73 +2247,76 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 	}
 
 	/* Turn Off Serdes */
-	rtpcs_930x_sds_set(ctrl, sds, RTL930X_SDS_OFF);
+	rtpcs_930x_sds_set(sds, RTL930X_SDS_OFF);
 
 	/* Apply serdes patches */
-	rtpcs_930x_sds_patch(ctrl, sds, phy_mode);
+	rtpcs_930x_sds_patch(sds, phy_mode);
 
 	/* Maybe use dal_longan_sds_init */
 
 	/* dal_longan_construct_serdesConfig_init */ /* Serdes Construct */
-	rtpcs_930x_phy_enable_10g_1g(ctrl, sds);
+	rtpcs_930x_phy_enable_10g_1g(sds);
 
 	/* ----> dal_longan_sds_mode_set */
-	pr_info("%s: Configuring RTL9300 SERDES %d\n", __func__, sds);
+	pr_info("%s: Configuring RTL9300 SERDES %d\n", __func__, sds->id);
 
 	/* Set SDS polarity */
-	rtpcs_930x_sds_set_polarity(ctrl, sds, ctrl->tx_pol_inv[sds],
-				    ctrl->rx_pol_inv[sds]);
+	rtpcs_930x_sds_set_polarity(sds, sds->ctrl->tx_pol_inv[sds->id],
+				    sds->ctrl->rx_pol_inv[sds->id]);
 
 	/* Enable SDS in desired mode */
-	rtpcs_930x_sds_mode_set(ctrl, sds, phy_mode);
+	rtpcs_930x_sds_mode_set(sds, phy_mode);
 
 	/* Enable Fiber RX */
-	rtpcs_sds_write_bits(ctrl, sds, 0x20, 2, 12, 12, 0);
+	rtpcs_sds_write_bits(sds, 0x20, 2, 12, 12, 0);
 
 	/* Calibrate SerDes receiver in loopback mode */
-	rtpcs_930x_sds_10g_idle(ctrl, sds);
+	rtpcs_930x_sds_10g_idle(sds);
 	do {
-		rtpcs_930x_sds_do_rx_calibration(ctrl, sds, phy_mode);
+		rtpcs_930x_sds_do_rx_calibration(sds, phy_mode);
 		calib_tries++;
 		mdelay(50);
-	} while (rtpcs_930x_sds_check_calibration(ctrl, sds, phy_mode) && calib_tries < 3);
+	} while (rtpcs_930x_sds_check_calibration(sds, phy_mode) && calib_tries < 3);
 	if (calib_tries >= 3)
 		pr_warn("%s: SerDes RX calibration failed\n", __func__);
 
 	/* Leave loopback mode */
-	rtpcs_930x_sds_tx_config(ctrl, sds, phy_mode);
+	rtpcs_930x_sds_tx_config(sds, phy_mode);
 
 	return 0;
 }
 
 /* RTL931X */
 
-static void rtpcs_931x_sds_reset(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_ctrl *ctrl = sds->ctrl;
+	u32 sds_id = sds->id;
 	u32 o, v, o_mode;
-	int shift = ((sds & 0x3) << 3);
+	int shift = ((sds_id & 0x3) << 3);
 
 	/* TODO: We need to lock this! */
 
 	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &o);
-	v = o | BIT(sds);
+	v = o | BIT(sds_id);
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, v);
 
-	regmap_read(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2), &o_mode);
+	regmap_read(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), &o_mode);
 	v = BIT(7) | 0x1F;
-	regmap_write_bits(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2),
+	regmap_write_bits(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2),
 			  0xff << shift, v << shift);
-	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2), o_mode);
+	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), o_mode);
 
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, o);
 }
 
-static void rtpcs_931x_sds_disable(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_931x_sds_disable(struct rtpcs_serdes *sds)
 {
-	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + (sds >> 2) * 4, 0x9f);
+	regmap_write(sds->ctrl->map,
+		     RTL931X_SERDES_MODE_CTRL + (sds->id >> 2) * 4, 0x9f);
 }
 
-static void rtpcs_931x_sds_symerr_clear(struct rtpcs_ctrl *ctrl, u32 sds,
+static void rtpcs_931x_sds_symerr_clear(struct rtpcs_serdes *sds,
 					phy_interface_t mode)
 {
 	switch (mode) {
@@ -2296,21 +2324,21 @@ static void rtpcs_931x_sds_symerr_clear(struct rtpcs_ctrl *ctrl, u32 sds,
 		break;
 	case PHY_INTERFACE_MODE_XGMII:
 		for (int i = 0; i < 4; ++i) {
-			rtpcs_sds_write_bits(ctrl, sds, 0x41, 24,  2, 0, i);
-			rtpcs_sds_write_bits(ctrl, sds, 0x41,  3, 15, 8, 0x0);
-			rtpcs_sds_write_bits(ctrl, sds, 0x41,  2, 15, 0, 0x0);
+			rtpcs_sds_write_bits(sds, 0x41, 24,  2, 0, i);
+			rtpcs_sds_write_bits(sds, 0x41,  3, 15, 8, 0x0);
+			rtpcs_sds_write_bits(sds, 0x41,  2, 15, 0, 0x0);
 		}
 
 		for (int i = 0; i < 4; ++i) {
-			rtpcs_sds_write_bits(ctrl, sds, 0x81, 24,  2, 0, i);
-			rtpcs_sds_write_bits(ctrl, sds, 0x81,  3, 15, 8, 0x0);
-			rtpcs_sds_write_bits(ctrl, sds, 0x81,  2, 15, 0, 0x0);
+			rtpcs_sds_write_bits(sds, 0x81, 24,  2, 0, i);
+			rtpcs_sds_write_bits(sds, 0x81,  3, 15, 8, 0x0);
+			rtpcs_sds_write_bits(sds, 0x81,  2, 15, 0, 0x0);
 		}
 
-		rtpcs_sds_write_bits(ctrl, sds, 0x41, 0, 15, 0, 0x0);
-		rtpcs_sds_write_bits(ctrl, sds, 0x41, 1, 15, 8, 0x0);
-		rtpcs_sds_write_bits(ctrl, sds, 0x81, 0, 15, 0, 0x0);
-		rtpcs_sds_write_bits(ctrl, sds, 0x81, 1, 15, 8, 0x0);
+		rtpcs_sds_write_bits(sds, 0x41, 0, 15, 0, 0x0);
+		rtpcs_sds_write_bits(sds, 0x41, 1, 15, 8, 0x0);
+		rtpcs_sds_write_bits(sds, 0x81, 0, 15, 0, 0x0);
+		rtpcs_sds_write_bits(sds, 0x81, 1, 15, 8, 0x0);
 		break;
 	default:
 		break;
@@ -2318,22 +2346,22 @@ static void rtpcs_931x_sds_symerr_clear(struct rtpcs_ctrl *ctrl, u32 sds,
 }
 
 __always_unused
-static void rtpcs_931x_sds_fiber_disable(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_931x_sds_fiber_disable(struct rtpcs_serdes *sds)
 {
 	u32 v = 0x3F;
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x1F, 0x9, 11, 6, v);
+	rtpcs_sds_write_bits(sds, 0x1F, 0x9, 11, 6, v);
 }
 
-static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_ctrl *ctrl, u32 sds,
+static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 					  phy_interface_t mode)
 {
 	u32 val;
 
 	/* clear symbol error count before changing mode */
-	rtpcs_931x_sds_symerr_clear(ctrl, sds, mode);
+	rtpcs_931x_sds_symerr_clear(sds, mode);
 
-	rtpcs_931x_sds_disable(ctrl, sds);
+	rtpcs_931x_sds_disable(sds);
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_SGMII:
@@ -2361,7 +2389,7 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_ctrl *ctrl, u32 sds,
 	}
 
 	pr_info("%s writing analog SerDes Mode value %02x\n", __func__, val);
-	rtpcs_sds_write_bits(ctrl, sds, 0x1F, 0x9, 11, 6, val);
+	rtpcs_sds_write_bits(sds, 0x1F, 0x9, 11, 6, val);
 }
 
 static int rtpcs_931x_sds_cmu_page_get(phy_interface_t mode)
@@ -2389,14 +2417,14 @@ static int rtpcs_931x_sds_cmu_page_get(phy_interface_t mode)
 	return -1;
 }
 
-static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_ctrl *ctrl, u32 sds,
+static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_serdes *sds,
 					phy_interface_t mode, int chiptype)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int cmu_type = 0; /* Clock Management Unit */
 	u32 cmu_page = 0;
 	u32 frc_cmu_spd;
-	u32 evenSds;
-	u32 lane, frc_lc_mode_bitnum, frc_lc_mode_val_bitnum;
+	u32 frc_lc_mode_bitnum, frc_lc_mode_val_bitnum;
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_NA:
@@ -2437,16 +2465,14 @@ static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_ctrl *ctrl, u32 sds,
 		break;
 
 	default:
-		pr_info("SerDes %d mode is invalid\n", sds);
+		pr_info("SerDes %d mode is invalid\n", sds->id);
 		return;
 	}
 
 	if (cmu_type == 1)
 		cmu_page = rtpcs_931x_sds_cmu_page_get(mode);
 
-	lane = sds % 2;
-
-	if (!lane) {
+	if (sds == even_sds) { 
 		frc_lc_mode_bitnum = 4;
 		frc_lc_mode_val_bitnum = 5;
 	} else {
@@ -2454,47 +2480,46 @@ static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_ctrl *ctrl, u32 sds,
 		frc_lc_mode_val_bitnum = 7;
 	}
 
-	evenSds = sds - lane;
-
-	pr_info("%s: cmu_type %0d cmu_page %x frc_cmu_spd %d lane %d sds %d\n",
-		__func__, cmu_type, cmu_page, frc_cmu_spd, lane, sds);
+	pr_info("%s: cmu_type %0d cmu_page %x frc_cmu_spd %d even_sds %d sds %d\n",
+		__func__, cmu_type, cmu_page, frc_cmu_spd, even_sds->id,
+		sds->id);
 
 	if (cmu_type == 1) {
-		pr_info("%s A CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
-		rtpcs_sds_write_bits(ctrl, sds, cmu_page, 0x7, 15, 15, 0);
-		pr_info("%s B CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
+		pr_info("%s A CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
+		rtpcs_sds_write_bits(sds, cmu_page, 0x7, 15, 15, 0);
+		pr_info("%s B CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
 		if (chiptype)
-			rtpcs_sds_write_bits(ctrl, sds, cmu_page, 0xd, 14, 14, 0);
+			rtpcs_sds_write_bits(sds, cmu_page, 0xd, 14, 14, 0);
 
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, 3, 2, 0x3);
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, frc_lc_mode_bitnum, frc_lc_mode_bitnum, 1);
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, frc_lc_mode_val_bitnum, frc_lc_mode_val_bitnum, 0);
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, 12, 12, 1);
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, 15, 13, frc_cmu_spd);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, 3, 2, 0x3);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, frc_lc_mode_bitnum, frc_lc_mode_bitnum, 1);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, frc_lc_mode_val_bitnum, frc_lc_mode_val_bitnum, 0);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, 12, 12, 1);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, 15, 13, frc_cmu_spd);
 	}
 
-	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
+	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
 }
 
-static void rtpcs_931x_sds_rx_reset(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_931x_sds_rx_reset(struct rtpcs_serdes *sds)
 {
-	if (sds < 2)
+	if (sds->id < 2)
 		return;
 
-	rtpcs_sds_write(ctrl, sds, 0x2e, 0x12, 0x2740);
-	rtpcs_sds_write(ctrl, sds, 0x2f, 0x0, 0x0);
-	rtpcs_sds_write(ctrl, sds, 0x2f, 0x2, 0x2010);
-	rtpcs_sds_write(ctrl, sds, 0x20, 0x0, 0xc10);
+	rtpcs_sds_write(sds, 0x2e, 0x12, 0x2740);
+	rtpcs_sds_write(sds, 0x2f, 0x0, 0x0);
+	rtpcs_sds_write(sds, 0x2f, 0x2, 0x2010);
+	rtpcs_sds_write(sds, 0x20, 0x0, 0xc10);
 
-	rtpcs_sds_write(ctrl, sds, 0x2e, 0x12, 0x27c0);
-	rtpcs_sds_write(ctrl, sds, 0x2f, 0x0, 0xc000);
-	rtpcs_sds_write(ctrl, sds, 0x2f, 0x2, 0x6010);
-	rtpcs_sds_write(ctrl, sds, 0x20, 0x0, 0xc30);
+	rtpcs_sds_write(sds, 0x2e, 0x12, 0x27c0);
+	rtpcs_sds_write(sds, 0x2f, 0x0, 0xc000);
+	rtpcs_sds_write(sds, 0x2f, 0x2, 0x6010);
+	rtpcs_sds_write(sds, 0x20, 0x0, 0xc30);
 
 	mdelay(50);
 }
 
-static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_ctrl *ctrl, u32 sds,
+static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
 					phy_interface_t mode)
 {
 	u32 val;
@@ -2519,75 +2544,75 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_ctrl *ctrl, u32 sds,
 
 	val |= (1 << 7);
 
-	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2), val);
+	regmap_write(sds->ctrl->map,
+		     RTL931X_SERDES_MODE_CTRL + 4 * (sds->id >> 2), val);
 }
 
-static int rtpcs_931x_sds_cmu_band_set(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_931x_sds_cmu_band_set(struct rtpcs_serdes *sds,
 				       bool enable, u32 band,
 				       phy_interface_t mode)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int page = rtpcs_931x_sds_cmu_page_get(mode);
 
-	sds -= (sds % 2);
-	sds = sds & ~1;
 	page += 1;
 
 	if (enable) {
-		rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 13, 13, 0);
-		rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 11, 11, 0);
+		rtpcs_sds_write_bits(even_sds, page, 0x7, 13, 13, 0);
+		rtpcs_sds_write_bits(even_sds, page, 0x7, 11, 11, 0);
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 13, 13, 0);
-		rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 11, 11, 0);
+		rtpcs_sds_write_bits(even_sds, page, 0x7, 13, 13, 0);
+		rtpcs_sds_write_bits(even_sds, page, 0x7, 11, 11, 0);
 	}
 
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 4, 0, band);
+	rtpcs_sds_write_bits(even_sds, page, 0x7, 4, 0, band);
 
-	rtpcs_931x_sds_reset(ctrl, sds);
+	rtpcs_931x_sds_reset(even_sds);
 
 	return 0;
 }
 
-static int rtpcs_931x_sds_cmu_band_get(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_931x_sds_cmu_band_get(struct rtpcs_serdes *sds,
 				       phy_interface_t mode)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int page = rtpcs_931x_sds_cmu_page_get(mode);
 	u32 band;
 
-	sds -= (sds % 2);
 	page += 1;
-	rtpcs_sds_write(ctrl, sds, 0x1f, 0x02, 73);
+	rtpcs_sds_write(even_sds, 0x1f, 0x02, 73);
 
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x5, 15, 15, 1);
-	band = rtpcs_sds_read_bits(ctrl, sds, 0x1f, 0x15, 8, 3);
+	rtpcs_sds_write_bits(even_sds, page, 0x5, 15, 15, 1);
+	band = rtpcs_sds_read_bits(even_sds, 0x1f, 0x15, 8, 3);
 	pr_info("%s band is: %d\n", __func__, band);
 
 	return band;
 }
 
 __always_unused
-static int rtpcs_931x_sds_link_sts_get(struct rtpcs_ctrl *ctrl, u32 sds)
+static int rtpcs_931x_sds_link_sts_get(struct rtpcs_serdes *sds)
 {
 	u32 sts, sts1, latch_sts, latch_sts1;
 
 	if (0) {
-		sts = rtpcs_sds_read_bits(ctrl, sds, 0x41, 29, 8, 0);
-		sts1 = rtpcs_sds_read_bits(ctrl, sds, 0x81, 29, 8, 0);
-		latch_sts = rtpcs_sds_read_bits(ctrl, sds, 0x41, 30, 8, 0);
-		latch_sts1 = rtpcs_sds_read_bits(ctrl, sds, 0x81, 30, 8, 0);
+		sts = rtpcs_sds_read_bits(sds, 0x41, 29, 8, 0);
+		sts1 = rtpcs_sds_read_bits(sds, 0x81, 29, 8, 0);
+		latch_sts = rtpcs_sds_read_bits(sds, 0x41, 30, 8, 0);
+		latch_sts1 = rtpcs_sds_read_bits(sds, 0x81, 30, 8, 0);
 	} else {
-		sts = rtpcs_sds_read_bits(ctrl, sds, 0x5, 0, 12, 12);
-		latch_sts = rtpcs_sds_read_bits(ctrl, sds, 0x4, 1, 2, 2);
-		latch_sts1 = rtpcs_sds_read_bits(ctrl, sds, 0x42, 1, 2, 2);
-		sts1 = rtpcs_sds_read_bits(ctrl, sds, 0x42, 1, 2, 2);
+		sts = rtpcs_sds_read_bits(sds, 0x5, 0, 12, 12);
+		latch_sts = rtpcs_sds_read_bits(sds, 0x4, 1, 2, 2);
+		latch_sts1 = rtpcs_sds_read_bits(sds, 0x42, 1, 2, 2);
+		sts1 = rtpcs_sds_read_bits(sds, 0x42, 1, 2, 2);
 	}
 
 	pr_info("%s: serdes %d sts %d, sts1 %d, latch_sts %d, latch_sts1 %d\n", __func__,
-		sds, sts, sts1, latch_sts, latch_sts1);
+		sds->id, sts, sts1, latch_sts, latch_sts1);
 
 	return sts1;
 }
 
-static int rtpcs_931x_sds_set_polarity(struct rtpcs_ctrl *ctrl, u32 sds,
+static int rtpcs_931x_sds_set_polarity(struct rtpcs_serdes *sds,
 				       bool tx_inv, bool rx_inv)
 {
 	u8 rx_val = rx_inv ? 1 : 0;
@@ -2597,17 +2622,17 @@ static int rtpcs_931x_sds_set_polarity(struct rtpcs_ctrl *ctrl, u32 sds,
 
 	/* 10gr_*_inv */
 	val = (tx_val << 1) | rx_val;
-	ret = rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x2, 14, 13, val);
+	ret = rtpcs_sds_write_bits(sds, 0x6, 0x2, 14, 13, val);
 	if (ret)
 		return ret;
 
 	/* xsg_*_inv */
 	val = (rx_val << 1) | tx_val;
-	ret = rtpcs_sds_write_bits(ctrl, sds, 0x40, 0x0, 9, 8, val);
+	ret = rtpcs_sds_write_bits(sds, 0x40, 0x0, 9, 8, val);
 	if (ret)
 		return ret;
 
-	return rtpcs_sds_write_bits(ctrl, sds, 0x80, 0x0, 9, 8, val);
+	return rtpcs_sds_write_bits(sds, 0x80, 0x0, 9, 8, val);
 }
 
 static sds_config sds_config_10p3125g_type1[] = {
@@ -2634,7 +2659,7 @@ static sds_config sds_config_10p3125g_cmu_type1[] = {
 	{ 0x2F, 0x0F, 0xA470 }, { 0x2F, 0x10, 0x8000 }, { 0x2F, 0x11, 0x037B }
 };
 
-static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 				   phy_interface_t mode)
 {
 	u32 board_sds_tx_type1[] = {
@@ -2649,10 +2674,13 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 		0x0dc0, 0x01c0, 0x0200, 0x0180, 0x0160, 0x0123,
 		0x0123, 0x0163, 0x01a3, 0x01a0, 0x01c3, 0x09c3,
 	};
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
+	struct rtpcs_ctrl *ctrl = sds->ctrl;
 	u32 band, ori, model_info, val;
+	u32 sds_id = sds->id;
 	int chiptype = 0;
 
-	if (sds < 0 || sds > 13)
+	if (sds_id < 0 || sds_id > 13)
 		return -EINVAL;
 
 	/*
@@ -2667,21 +2695,21 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 	if (mode == PHY_INTERFACE_MODE_USXGMII)
 		return -ENOTSUPP;
 
-	pr_info("%s: set sds %d to mode %d\n", __func__, sds, mode);
-	val = rtpcs_sds_read_bits(ctrl, sds, 0x1F, 0x9, 11, 6);
+	pr_info("%s: set sds %d to mode %d\n", __func__, sds_id, mode);
+	val = rtpcs_sds_read_bits(sds, 0x1F, 0x9, 11, 6);
 
 	pr_info("%s: fibermode %08X stored mode 0x%x", __func__,
-		rtpcs_sds_read(ctrl, sds, 0x1f, 0x9), val);
+		rtpcs_sds_read(sds, 0x1f, 0x9), val);
 	pr_info("%s: SGMII mode %08X in 0x24 0x9", __func__,
-		rtpcs_sds_read(ctrl, sds, 0x24, 0x9));
+		rtpcs_sds_read(sds, 0x24, 0x9));
 	pr_info("%s: CMU mode %08X stored even SDS %d", __func__,
-		rtpcs_sds_read(ctrl, sds & ~1, 0x20, 0x12), sds & ~1);
-	pr_info("%s: serdes_mode_ctrl %08X", __func__,  RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2));
-	pr_info("%s CMU page 0x24 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x24, 0x7));
-	pr_info("%s CMU page 0x26 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x26, 0x7));
-	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
-	pr_info("%s XSG page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x40, 0xe));
-	pr_info("%s XSG2 page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x80, 0xe));
+		rtpcs_sds_read(even_sds, 0x20, 0x12), even_sds->id);
+	pr_info("%s: serdes_mode_ctrl %08X", __func__,  RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2));
+	pr_info("%s CMU page 0x24 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x24, 0x7));
+	pr_info("%s CMU page 0x26 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x26, 0x7));
+	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
+	pr_info("%s XSG page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(sds, 0x40, 0xe));
+	pr_info("%s XSG2 page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(sds, 0x80, 0xe));
 
 	regmap_read(ctrl->map, RTL93XX_MODEL_NAME_INFO, &model_info);
 	if ((model_info >> 4) & 0x1) {
@@ -2691,16 +2719,15 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 		pr_info("detected chiptype 0\n");
 	}
 
-	pr_info("%s: 2.5gbit %08X", __func__,
-		rtpcs_sds_read(ctrl, sds, 0x41, 0x14));
+	pr_info("%s: 2.5gbit %08X", __func__, rtpcs_sds_read(sds, 0x41, 0x14));
 
 	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &ori);
 	pr_info("%s: RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR 0x%08X\n", __func__, ori);
-	val = ori | (1 << sds);
+	val = ori | (1 << sds_id);
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
 
 	/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
-	band = rtpcs_931x_sds_cmu_band_get(ctrl, sds, mode);
+	band = rtpcs_931x_sds_cmu_band_get(sds, mode);
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_NA:
@@ -2710,129 +2737,126 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 
 		if (chiptype) {
 			/* fifo inv clk */
-			rtpcs_sds_write_bits(ctrl, sds, 0x41, 0x1, 7, 4, 0xf);
-			rtpcs_sds_write_bits(ctrl, sds, 0x41, 0x1, 3, 0, 0xf);
+			rtpcs_sds_write_bits(sds, 0x41, 0x1, 7, 4, 0xf);
+			rtpcs_sds_write_bits(sds, 0x41, 0x1, 3, 0, 0xf);
 
-			rtpcs_sds_write_bits(ctrl, sds, 0x81, 0x1, 7, 4, 0xf);
-			rtpcs_sds_write_bits(ctrl, sds, 0x81, 0x1, 3, 0, 0xf);
+			rtpcs_sds_write_bits(sds, 0x81, 0x1, 7, 4, 0xf);
+			rtpcs_sds_write_bits(sds, 0x81, 0x1, 3, 0, 0xf);
 		}
 
-		rtpcs_sds_write_bits(ctrl, sds, 0x40, 0xE, 12, 12, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x80, 0xE, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x40, 0xE, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x80, 0xE, 12, 12, 1);
 		break;
 
 	case PHY_INTERFACE_MODE_USXGMII: /* MII_USXGMII_10GSXGMII/10GDXGMII/10GQXGMII: */
 		u32 op_code = 0x6003;
-		u32 evenSds;
 
 		if (chiptype) {
-			rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x2, 12, 12, 1);
+			rtpcs_sds_write_bits(sds, 0x6, 0x2, 12, 12, 1);
 
 			for (int i = 0; i < sizeof(sds_config_10p3125g_type1) / sizeof(sds_config); ++i) {
-				rtpcs_sds_write(ctrl, sds,
+				rtpcs_sds_write(sds,
 						sds_config_10p3125g_type1[i].page - 0x4,
 						sds_config_10p3125g_type1[i].reg,
 						sds_config_10p3125g_type1[i].data);
 			}
 
-			evenSds = sds & ~1;
-
 			for (int i = 0; i < sizeof(sds_config_10p3125g_cmu_type1) / sizeof(sds_config); ++i) {
-				rtpcs_sds_write(ctrl, evenSds,
+				rtpcs_sds_write(even_sds,
 						sds_config_10p3125g_cmu_type1[i].page - 0x4,
 						sds_config_10p3125g_cmu_type1[i].reg,
 						sds_config_10p3125g_cmu_type1[i].data);
 			}
 
-			rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x2, 12, 12, 0);
+			rtpcs_sds_write_bits(sds, 0x6, 0x2, 12, 12, 0);
 		} else {
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0xd, 6, 0, 0x0);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0xd, 7, 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0xd, 6, 0, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0xd, 7, 7, 0x1);
 
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1c, 5, 0, 0x1E);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1d, 11, 0, 0x00);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1f, 11, 0, 0x00);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x0, 11, 0, 0x00);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x1, 11, 0, 0x00);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1c, 5, 0, 0x1E);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 11, 0, 0x00);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1f, 11, 0, 0x00);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x0, 11, 0, 0x00);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x1, 11, 0, 0x00);
 
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0xf, 12, 6, 0x7F);
-			rtpcs_sds_write(ctrl, sds, 0x2f, 0x12, 0xaaa);
+			rtpcs_sds_write_bits(sds, 0x2e, 0xf, 12, 6, 0x7F);
+			rtpcs_sds_write(sds, 0x2f, 0x12, 0xaaa);
 
-			rtpcs_931x_sds_rx_reset(ctrl, sds);
+			rtpcs_931x_sds_rx_reset(sds);
 
-			rtpcs_sds_write(ctrl, sds, 0x7, 0x10, op_code);
-			rtpcs_sds_write(ctrl, sds, 0x6, 0x1d, 0x0480);
-			rtpcs_sds_write(ctrl, sds, 0x6, 0xe, 0x0400);
+			rtpcs_sds_write(sds, 0x7, 0x10, op_code);
+			rtpcs_sds_write(sds, 0x6, 0x1d, 0x0480);
+			rtpcs_sds_write(sds, 0x6, 0xe, 0x0400);
 		}
 		break;
 
 	case PHY_INTERFACE_MODE_10GBASER: /* MII_10GR / MII_10GR1000BX_AUTO: */
 					  /* configure 10GR fiber mode=1 */
-		rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0xb, 1, 1, 1);
+		rtpcs_sds_write_bits(sds, 0x1f, 0xb, 1, 1, 1);
 
 		/* init fiber_1g */
-		rtpcs_sds_write_bits(ctrl, sds, 0x43, 0x13, 15, 14, 0);
+		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
 
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 12, 12, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 6, 6, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 13, 13, 0);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
 
 		/* init auto */
-		rtpcs_sds_write_bits(ctrl, sds, 0x1f, 13, 15, 0, 0x109e);
-		rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0x6, 14, 10, 0x8);
-		rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0x7, 10, 4, 0x7f);
+		rtpcs_sds_write_bits(sds, 0x1f, 13, 15, 0, 0x109e);
+		rtpcs_sds_write_bits(sds, 0x1f, 0x6, 14, 10, 0x8);
+		rtpcs_sds_write_bits(sds, 0x1f, 0x7, 10, 4, 0x7f);
 		break;
 
 	case PHY_INTERFACE_MODE_1000BASEX: /* MII_1000BX_FIBER */
-		rtpcs_sds_write_bits(ctrl, sds, 0x43, 0x13, 15, 14, 0);
+		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
 
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 12, 12, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 6, 6, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 13, 13, 0);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
 		break;
 
 	case PHY_INTERFACE_MODE_SGMII:
-		rtpcs_sds_write_bits(ctrl, sds, 0x24, 0x9, 15, 15, 0);
+		rtpcs_sds_write_bits(sds, 0x24, 0x9, 15, 15, 0);
 
 		/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
-		band = rtpcs_931x_sds_cmu_band_set(ctrl, sds, true, 62, PHY_INTERFACE_MODE_SGMII);
+		band = rtpcs_931x_sds_cmu_band_set(sds, true, 62, PHY_INTERFACE_MODE_SGMII);
 		break;
 
 	case PHY_INTERFACE_MODE_2500BASEX:
-		rtpcs_sds_write_bits(ctrl, sds, 0x41, 0x14, 8, 8, 1);
+		rtpcs_sds_write_bits(sds, 0x41, 0x14, 8, 8, 1);
 		break;
 
 	case PHY_INTERFACE_MODE_QSGMII:
 	default:
 		pr_info("%s: PHY mode %s not supported by SerDes %d\n",
-			__func__, phy_modes(mode), sds);
+			__func__, phy_modes(mode), sds_id);
 		return -ENOTSUPP;
 	}
 
-	rtpcs_931x_sds_cmu_type_set(ctrl, sds, mode, chiptype);
+	rtpcs_931x_sds_cmu_type_set(sds, mode, chiptype);
 
-	if (sds >= 2 && sds <= 13) {
+	if (sds_id >= 2 && sds_id <= 13) {
 		if (chiptype)
-			rtpcs_sds_write(ctrl, sds, 0x2E, 0x1, board_sds_tx_type1[sds - 2]);
+			rtpcs_sds_write(sds, 0x2E, 0x1, board_sds_tx_type1[sds_id - 2]);
 		else {
 			val = 0xa0000;
 			regmap_write(ctrl->map, RTL93XX_CHIP_INFO, val);
 			regmap_read(ctrl->map, RTL93XX_CHIP_INFO, &val);
 
 			if (val & BIT(28)) /* consider 9311 etc. RTL9313_CHIP_ID == HWP_CHIP_ID(unit)) */
-				rtpcs_sds_write(ctrl, sds, 0x2E, 0x1, board_sds_tx2[sds - 2]);
+				rtpcs_sds_write(sds, 0x2E, 0x1, board_sds_tx2[sds_id - 2]);
 			else
-				rtpcs_sds_write(ctrl, sds, 0x2E, 0x1, board_sds_tx[sds - 2]);
+				rtpcs_sds_write(sds, 0x2E, 0x1, board_sds_tx[sds_id - 2]);
 
 			val = 0;
 			regmap_write(ctrl->map, RTL93XX_CHIP_INFO, val);
 		}
 	}
 
-	rtpcs_931x_sds_set_polarity(ctrl, sds, ctrl->tx_pol_inv[sds],
-				    ctrl->rx_pol_inv[sds]);
+	rtpcs_931x_sds_set_polarity(sds, ctrl->tx_pol_inv[sds_id],
+				    ctrl->rx_pol_inv[sds_id]);
 
-	val = ori & ~BIT(sds);
+	val = ori & ~BIT(sds_id);
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
 	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &val);
 	pr_debug("%s: RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR 0x%08X\n", __func__, val);
@@ -2842,9 +2866,9 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 	    mode == PHY_INTERFACE_MODE_SGMII ||
 	    mode == PHY_INTERFACE_MODE_USXGMII) {
 		if (mode == PHY_INTERFACE_MODE_XGMII)
-			rtpcs_931x_sds_mii_mode_set(ctrl, sds, mode);
+			rtpcs_931x_sds_mii_mode_set(sds, mode);
 		else
-			rtpcs_931x_sds_fiber_mode_set(ctrl, sds, mode);
+			rtpcs_931x_sds_fiber_mode_set(sds, mode);
 	}
 
 	return 0;
@@ -2945,7 +2969,7 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	mutex_lock(&ctrl->lock);
 
 	if (ctrl->cfg->setup_serdes) {
-		ret = ctrl->cfg->setup_serdes(ctrl, link->sds->id, interface);
+		ret = ctrl->cfg->setup_serdes(link->sds, interface);
 		if (ret < 0)
 			goto out;
 	}
@@ -3001,7 +3025,7 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 		return ERR_PTR(-EINVAL);
 	if (sds_id >= ctrl->cfg->serdes_count)
 		return ERR_PTR(-EINVAL);
-	if (rtpcs_sds_read(ctrl, sds_id, 0, 0) < 0)
+	if (rtpcs_sds_read(&ctrl->serdes[sds_id], 0, 0) < 0)
 		return ERR_PTR(-EINVAL);
 
 	link = kzalloc(sizeof(*link), GFP_KERNEL);



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:43 -0500
Subject: [openwrt/openwrt]  realtek: pcs: switch to id from SerDes struct
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36301.1765888667.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4d9400f86bea9ea5587d920eb78b9825d796ea95

commit 4d9400f86bea9ea5587d920eb78b9825d796ea95
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 20:01:03 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c  | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 01b4b3af62..d2a70e65e4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -153,7 +153,6 @@ struct rtpcs_link {
 	struct rtpcs_ctrl *ctrl;
 	struct phylink_pcs pcs;
 	struct rtpcs_serdes *sds;
-	int sds_id;
 	int port;
 };
 
@@ -2920,7 +2919,7 @@ static void rtpcs_pcs_an_restart(struct phylink_pcs *pcs)
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 
 	dev_warn(ctrl->dev, "an_restart() for port %d and sds %d not yet implemented\n",
-		 link->port, link->sds_id);
+		 link->port, link->sds->id);
 }
 
 static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
@@ -2931,7 +2930,7 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 	int ret = 0;
 
-	if (link->sds_id < 0)
+	if (link->sds->id < 0)
 		return 0;
 
 	/*
@@ -2941,18 +2940,18 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	 */
 
 	dev_warn(ctrl->dev, "pcs_config(%s) for port %d and sds %d not yet fully implemented\n",
-		 phy_modes(interface), link->port, link->sds_id);
+		 phy_modes(interface), link->port, link->sds->id);
 
 	mutex_lock(&ctrl->lock);
 
 	if (ctrl->cfg->setup_serdes) {
-		ret = ctrl->cfg->setup_serdes(ctrl, link->sds_id, interface);
+		ret = ctrl->cfg->setup_serdes(ctrl, link->sds->id, interface);
 		if (ret < 0)
 			goto out;
 	}
 
 	if (ctrl->cfg->set_autoneg) {
-		ret = ctrl->cfg->set_autoneg(ctrl, link->sds_id, neg_mode);
+		ret = ctrl->cfg->set_autoneg(ctrl, link->sds->id, neg_mode);
 		if (ret < 0)
 			goto out;
 	}
@@ -3016,7 +3015,6 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	link->ctrl = ctrl;
 	link->port = port;
 	link->sds = &ctrl->serdes[sds_id];
-	link->sds_id = sds_id;
 	link->pcs.ops = ctrl->cfg->pcs_ops;
 	link->pcs.neg_mode = true;
 



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:39 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:39 -0500
Subject: [openwrt/openwrt]  realtek: pcs: use per-variant SerDes count
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36302.1765888667.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6cf33aacfe9d01903f1662795a28c5a7fc6e2fb7

commit 6cf33aacfe9d01903f1662795a28c5a7fc6e2fb7
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 09:10:55 2025 +0000

    realtek: pcs: use per-variant SerDes count
    
    Use a separate configuration field for the number of SerDes for each
    variant of the Realtek Otto family. Add this field to the config
    structure, assign it and use it during driver probe. This narrows
    possible error cases and is needed for upcoming extensions.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 1a87d0d112..7cc5bb1730 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -22,6 +22,7 @@
 #define RTPCS_SPEED_5000			6
 
 #define RTPCS_838X_CPU_PORT			28
+#define RTPCS_838X_SERDES_CNT			6
 #define RTPCS_838X_MAC_LINK_DUP_STS		0xa19c
 #define RTPCS_838X_MAC_LINK_SPD_STS		0xa190
 #define RTPCS_838X_MAC_LINK_STS			0xa188
@@ -29,6 +30,7 @@
 #define RTPCS_838X_MAC_TX_PAUSE_STS		0xa1a0
 
 #define RTPCS_839X_CPU_PORT			52
+#define RTPCS_839X_SERDES_CNT			14
 #define RTPCS_839X_MAC_LINK_DUP_STS		0x03b0
 #define RTPCS_839X_MAC_LINK_SPD_STS		0x03a0
 #define RTPCS_839X_MAC_LINK_STS			0x0390
@@ -38,6 +40,7 @@
 #define RTPCS_83XX_MAC_LINK_SPD_BITS		2
 
 #define RTPCS_930X_CPU_PORT			28
+#define RTPCS_930X_SERDES_CNT			12
 #define RTPCS_930X_MAC_LINK_DUP_STS		0xcb28
 #define RTPCS_930X_MAC_LINK_SPD_STS		0xcb18
 #define RTPCS_930X_MAC_LINK_STS			0xcb10
@@ -45,6 +48,7 @@
 #define RTPCS_930X_MAC_TX_PAUSE_STS		0xcb2c
 
 #define RTPCS_931X_CPU_PORT			56
+#define RTPCS_931X_SERDES_CNT			14
 #define RTPCS_931X_MAC_LINK_DUP_STS		0x0ef0
 #define RTPCS_931X_MAC_LINK_SPD_STS		0x0ed0
 #define RTPCS_931X_MAC_LINK_STS			0x0ec0
@@ -151,6 +155,8 @@ struct rtpcs_config {
 	int mac_link_sts;
 	int mac_rx_pause_sts;
 	int mac_tx_pause_sts;
+	u8 serdes_count;
+
 	const struct phylink_pcs_ops *pcs_ops;
 	int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
 	int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
@@ -3043,7 +3049,7 @@ static int rtpcs_probe(struct platform_device *pdev)
 		ret = of_property_read_u32(child, "reg", &sds);
 		if (ret)
 			return ret;
-		if (sds >= RTPCS_SDS_CNT)
+		if (sds >= ctrl->cfg->serdes_count)
 			return -EINVAL;
 
 		ctrl->rx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-rx");
@@ -3089,6 +3095,7 @@ static const struct rtpcs_config rtpcs_838x_cfg = {
 	.mac_link_sts		= RTPCS_838X_MAC_LINK_STS,
 	.mac_rx_pause_sts	= RTPCS_838X_MAC_RX_PAUSE_STS,
 	.mac_tx_pause_sts	= RTPCS_838X_MAC_TX_PAUSE_STS,
+	.serdes_count		= RTPCS_838X_SERDES_CNT,
 	.pcs_ops		= &rtpcs_838x_pcs_ops,
 	.init_serdes_common	= rtpcs_838x_init_serdes_common,
 	.setup_serdes		= rtpcs_838x_setup_serdes,
@@ -3108,6 +3115,7 @@ static const struct rtpcs_config rtpcs_839x_cfg = {
 	.mac_link_sts		= RTPCS_839X_MAC_LINK_STS,
 	.mac_rx_pause_sts	= RTPCS_839X_MAC_RX_PAUSE_STS,
 	.mac_tx_pause_sts	= RTPCS_839X_MAC_TX_PAUSE_STS,
+	.serdes_count		= RTPCS_839X_SERDES_CNT,
 	.pcs_ops		= &rtpcs_839x_pcs_ops,
 };
 
@@ -3125,6 +3133,7 @@ static const struct rtpcs_config rtpcs_930x_cfg = {
 	.mac_link_sts		= RTPCS_930X_MAC_LINK_STS,
 	.mac_rx_pause_sts	= RTPCS_930X_MAC_RX_PAUSE_STS,
 	.mac_tx_pause_sts	= RTPCS_930X_MAC_TX_PAUSE_STS,
+	.serdes_count		= RTPCS_930X_SERDES_CNT,
 	.pcs_ops		= &rtpcs_930x_pcs_ops,
 	.set_autoneg		= rtpcs_93xx_set_autoneg,
 	.setup_serdes		= rtpcs_930x_setup_serdes,
@@ -3144,6 +3153,7 @@ static const struct rtpcs_config rtpcs_931x_cfg = {
 	.mac_link_sts		= RTPCS_931X_MAC_LINK_STS,
 	.mac_rx_pause_sts	= RTPCS_931X_MAC_RX_PAUSE_STS,
 	.mac_tx_pause_sts	= RTPCS_931X_MAC_TX_PAUSE_STS,
+	.serdes_count		= RTPCS_931X_SERDES_CNT,
 	.pcs_ops		= &rtpcs_931x_pcs_ops,
 	.set_autoneg		= rtpcs_93xx_set_autoneg,
 	.setup_serdes		= rtpcs_931x_setup_serdes,



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:18 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl930x: drop unused and broken
 function
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36303.1765888701.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/96c86b2ff12fabc018bda459db636d605ecd7aa7

commit 96c86b2ff12fabc018bda459db636d605ecd7aa7
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Dec 12 20:05:52 2025 +0000

    realtek: pcs: rtl930x: drop unused and broken function
    
    Drop the unused and broken function rtpcs_930x_sds_clock_wait from the
    PCS driver. The proper working variant is already some lines above and
    called rtpcs_930x_sds_wait_clock_ready.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit decc4f6ba808fb8aa469cd4886ffeea1bb86bcda)
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c        | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 8368870b62..def6b445d4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -966,26 +966,6 @@ static void rtpcs_930x_sds_tx_config(struct rtpcs_ctrl *ctrl, int sds,
 	rtpcs_sds_write_bits(ctrl, sds, page, 0x18, 15, 12, impedance);
 }
 
-/* Wait for clock ready, this assumes the SerDes is in XGMII mode
- * timeout is in ms
- */
-__always_unused
-static int rtpcs_930x_sds_clock_wait(struct rtpcs_ctrl *ctrl, int timeout)
-{
-	u32 v;
-	unsigned long start = jiffies;
-	unsigned long end = start + (HZ / 1000) * timeout;
-
-	do {
-		rtpcs_sds_write_bits(ctrl, 2, 0x1f, 0x2, 15, 0, 53);
-		v = rtpcs_sds_read_bits(ctrl, 2, 0x1f, 20, 5, 4);
-		if (v == 3)
-			return 0;
-	} while (time_before(jiffies, end));
-
-	return 1;
-}
-
 __always_unused
 static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
 					     u32 dcvs_id, bool manual, u32 dvcs_list[])



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:22 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:22 -0500
Subject: [openwrt/openwrt]  realtek: pcs: add helpers for even, odd,
 neighbor SerDes
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36304.1765888703.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/01cfdb16103ae14e0525636ce4dfd062245cfb0b

commit 01cfdb16103ae14e0525636ce4dfd062245cfb0b
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 10:16:21 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 232c1fb14a072ee5c3c96ead43919ab5add526dd)
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c       | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 566e79962c..435a74af7c 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -239,6 +239,27 @@ static int rtpcs_sds_modify(struct rtpcs_ctrl *ctrl, int sds, int page, int regn
 				  mask, set);
 }
 
+__maybe_unused
+static struct rtpcs_serdes *rtpcs_sds_get_even(struct rtpcs_serdes *sds)
+{
+	u32 even_sds = sds->id & ~1;
+	return &sds->ctrl->serdes[even_sds];
+}
+
+__maybe_unused
+static struct rtpcs_serdes *rtpcs_sds_get_odd(struct rtpcs_serdes *sds)
+{
+	u32 odd_sds = sds->id | 1;
+	return &sds->ctrl->serdes[odd_sds];
+}
+
+__maybe_unused
+static struct rtpcs_serdes *rtpcs_sds_get_neighbor(struct rtpcs_serdes *sds)
+{
+	u32 nb_sds = sds->id ^ 1;
+	return &sds->ctrl->serdes[nb_sds];
+}
+
 static int rtpcs_regmap_read_bits(struct rtpcs_ctrl *ctrl, int base, int bithigh, int bitlow)
 {
 	int offset = base + (bitlow / 32) * 4;



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:24 -0500
Subject: [openwrt/openwrt]  realtek: pcs: switch to id from SerDes struct
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36305.1765888703.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/0fe7f97896724fefdfc019d784f723365c4e4046

commit 0fe7f97896724fefdfc019d784f723365c4e4046
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 20:01:03 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 4d9400f86bea9ea5587d920eb78b9825d796ea95)
---
 .../linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c  | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 01b4b3af62..d2a70e65e4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -153,7 +153,6 @@ struct rtpcs_link {
 	struct rtpcs_ctrl *ctrl;
 	struct phylink_pcs pcs;
 	struct rtpcs_serdes *sds;
-	int sds_id;
 	int port;
 };
 
@@ -2920,7 +2919,7 @@ static void rtpcs_pcs_an_restart(struct phylink_pcs *pcs)
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 
 	dev_warn(ctrl->dev, "an_restart() for port %d and sds %d not yet implemented\n",
-		 link->port, link->sds_id);
+		 link->port, link->sds->id);
 }
 
 static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
@@ -2931,7 +2930,7 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 	int ret = 0;
 
-	if (link->sds_id < 0)
+	if (link->sds->id < 0)
 		return 0;
 
 	/*
@@ -2941,18 +2940,18 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	 */
 
 	dev_warn(ctrl->dev, "pcs_config(%s) for port %d and sds %d not yet fully implemented\n",
-		 phy_modes(interface), link->port, link->sds_id);
+		 phy_modes(interface), link->port, link->sds->id);
 
 	mutex_lock(&ctrl->lock);
 
 	if (ctrl->cfg->setup_serdes) {
-		ret = ctrl->cfg->setup_serdes(ctrl, link->sds_id, interface);
+		ret = ctrl->cfg->setup_serdes(ctrl, link->sds->id, interface);
 		if (ret < 0)
 			goto out;
 	}
 
 	if (ctrl->cfg->set_autoneg) {
-		ret = ctrl->cfg->set_autoneg(ctrl, link->sds_id, neg_mode);
+		ret = ctrl->cfg->set_autoneg(ctrl, link->sds->id, neg_mode);
 		if (ret < 0)
 			goto out;
 	}
@@ -3016,7 +3015,6 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	link->ctrl = ctrl;
 	link->port = port;
 	link->sds = &ctrl->serdes[sds_id];
-	link->sds_id = sds_id;
 	link->pcs.ops = ctrl->cfg->pcs_ops;
 	link->pcs.neg_mode = true;
 



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:17 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:17 -0500
Subject: [openwrt/openwrt]  realtek: pcs: drop PCS creation without SerDes ref
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36308.1765888703.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/e989bf80a86147acb8444e13db5e298f55a2a728

commit e989bf80a86147acb8444e13db5e298f55a2a728
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Thu Dec 11 22:37:33 2025 +0000

    realtek: pcs: drop PCS creation without SerDes ref
    
    Since the beginning, the PCS driver had the ability to call its
    rtpcs_create without a reference to a valid PCS node. A comment in the
    code mentions that this is done for RTL838X and its built-in octa-PHY
    which is connected directly instead of via a SerDes. Further
    explanations are not provided.
    
    Drop this ability and make the rtpcs_create call in the dsa driver
    conditional. As the built-in PHY of RTL838X isn't attached to a SerDes,
    there is no obvious point of having the PCS driver in that chain. The
    ports are marked as internal and have no pcs-handle, thus no phylink_pcs
    instance should be created.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit a58e41e522bf5b273fa626e03546b92141731d9c)
---
 .../files-6.12/drivers/net/dsa/rtl83xx/common.c    | 14 +++++++-----
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 26 ++++++----------------
 2 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
index 85818391b5..787ceda834 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
@@ -331,12 +331,14 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
 			continue;
 		}
 
-		priv->pcs[pn] = rtpcs_create(priv->dev, pcs_node, pn);
-		if (IS_ERR(priv->pcs[pn])) {
-			dev_err(priv->dev, "port %u failed to create PCS instance: %ld\n",
-				pn, PTR_ERR(priv->pcs[pn]));
-			priv->pcs[pn] = NULL;
-			continue;
+		if (pcs_node) {
+			priv->pcs[pn] = rtpcs_create(priv->dev, pcs_node, pn);
+			if (IS_ERR(priv->pcs[pn])) {
+				dev_err(priv->dev, "port %u failed to create PCS instance: %ld\n",
+					pn, PTR_ERR(priv->pcs[pn]));
+				priv->pcs[pn] = NULL;
+				continue;
+			}
 		}
 
 		if (of_get_phy_mode(dn, &interface))
diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index e41c89e713..8368870b62 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2930,26 +2930,12 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	struct device_node *pcs_np;
 	struct rtpcs_ctrl *ctrl;
 	struct rtpcs_link *link;
-	int sds;
-
-	/*
-	 * RTL838x devices have a built-in octa port RTL8218B PHY that is not attached via
-	 * a SerDes. Allow to be called with an empty SerDes device node. In this case lookup
-	 * the parent/driver node directly.
-	 */
-	if (np) {
-		if (!of_device_is_available(np))
-			return ERR_PTR(-ENODEV);
-
-		if (of_property_read_u32(np, "reg", &sds))
-			return ERR_PTR(-EINVAL);
+	u32 sds;
 
-		pcs_np = of_get_parent(np);
-	} else {
-		pcs_np = of_find_compatible_node(NULL, NULL, "realtek,otto-pcs");
-		sds = -1;
-	}
+	if (!np || !of_device_is_available(np))
+		return ERR_PTR(-ENODEV);
 
+	pcs_np = of_get_parent(np);
 	if (!pcs_np)
 		return ERR_PTR(-ENODEV);
 
@@ -2972,7 +2958,9 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	if (port < 0 || port > ctrl->cfg->cpu_port)
 		return ERR_PTR(-EINVAL);
 
-	if (sds !=  -1 && rtpcs_sds_read(ctrl, sds, 0, 0) < 0)
+	if (of_property_read_u32(np, "reg", &sds))
+		return ERR_PTR(-EINVAL);
+	if (rtpcs_sds_read(ctrl, sds, 0, 0) < 0)
 		return ERR_PTR(-EINVAL);
 
 	link = kzalloc(sizeof(*link), GFP_KERNEL);



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:20 -0500
Subject: [openwrt/openwrt]  realtek: pcs: use per-variant SerDes count
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36309.1765888703.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/b9e5803d046cbc92bbd758debcc13b055c0def26

commit b9e5803d046cbc92bbd758debcc13b055c0def26
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 09:10:55 2025 +0000

    realtek: pcs: use per-variant SerDes count
    
    Use a separate configuration field for the number of SerDes for each
    variant of the Realtek Otto family. Add this field to the config
    structure, assign it and use it during driver probe. This narrows
    possible error cases and is needed for upcoming extensions.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 6cf33aacfe9d01903f1662795a28c5a7fc6e2fb7)
---
 .../linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 1a87d0d112..7cc5bb1730 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -22,6 +22,7 @@
 #define RTPCS_SPEED_5000			6
 
 #define RTPCS_838X_CPU_PORT			28
+#define RTPCS_838X_SERDES_CNT			6
 #define RTPCS_838X_MAC_LINK_DUP_STS		0xa19c
 #define RTPCS_838X_MAC_LINK_SPD_STS		0xa190
 #define RTPCS_838X_MAC_LINK_STS			0xa188
@@ -29,6 +30,7 @@
 #define RTPCS_838X_MAC_TX_PAUSE_STS		0xa1a0
 
 #define RTPCS_839X_CPU_PORT			52
+#define RTPCS_839X_SERDES_CNT			14
 #define RTPCS_839X_MAC_LINK_DUP_STS		0x03b0
 #define RTPCS_839X_MAC_LINK_SPD_STS		0x03a0
 #define RTPCS_839X_MAC_LINK_STS			0x0390
@@ -38,6 +40,7 @@
 #define RTPCS_83XX_MAC_LINK_SPD_BITS		2
 
 #define RTPCS_930X_CPU_PORT			28
+#define RTPCS_930X_SERDES_CNT			12
 #define RTPCS_930X_MAC_LINK_DUP_STS		0xcb28
 #define RTPCS_930X_MAC_LINK_SPD_STS		0xcb18
 #define RTPCS_930X_MAC_LINK_STS			0xcb10
@@ -45,6 +48,7 @@
 #define RTPCS_930X_MAC_TX_PAUSE_STS		0xcb2c
 
 #define RTPCS_931X_CPU_PORT			56
+#define RTPCS_931X_SERDES_CNT			14
 #define RTPCS_931X_MAC_LINK_DUP_STS		0x0ef0
 #define RTPCS_931X_MAC_LINK_SPD_STS		0x0ed0
 #define RTPCS_931X_MAC_LINK_STS			0x0ec0
@@ -151,6 +155,8 @@ struct rtpcs_config {
 	int mac_link_sts;
 	int mac_rx_pause_sts;
 	int mac_tx_pause_sts;
+	u8 serdes_count;
+
 	const struct phylink_pcs_ops *pcs_ops;
 	int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
 	int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
@@ -3043,7 +3049,7 @@ static int rtpcs_probe(struct platform_device *pdev)
 		ret = of_property_read_u32(child, "reg", &sds);
 		if (ret)
 			return ret;
-		if (sds >= RTPCS_SDS_CNT)
+		if (sds >= ctrl->cfg->serdes_count)
 			return -EINVAL;
 
 		ctrl->rx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-rx");
@@ -3089,6 +3095,7 @@ static const struct rtpcs_config rtpcs_838x_cfg = {
 	.mac_link_sts		= RTPCS_838X_MAC_LINK_STS,
 	.mac_rx_pause_sts	= RTPCS_838X_MAC_RX_PAUSE_STS,
 	.mac_tx_pause_sts	= RTPCS_838X_MAC_TX_PAUSE_STS,
+	.serdes_count		= RTPCS_838X_SERDES_CNT,
 	.pcs_ops		= &rtpcs_838x_pcs_ops,
 	.init_serdes_common	= rtpcs_838x_init_serdes_common,
 	.setup_serdes		= rtpcs_838x_setup_serdes,
@@ -3108,6 +3115,7 @@ static const struct rtpcs_config rtpcs_839x_cfg = {
 	.mac_link_sts		= RTPCS_839X_MAC_LINK_STS,
 	.mac_rx_pause_sts	= RTPCS_839X_MAC_RX_PAUSE_STS,
 	.mac_tx_pause_sts	= RTPCS_839X_MAC_TX_PAUSE_STS,
+	.serdes_count		= RTPCS_839X_SERDES_CNT,
 	.pcs_ops		= &rtpcs_839x_pcs_ops,
 };
 
@@ -3125,6 +3133,7 @@ static const struct rtpcs_config rtpcs_930x_cfg = {
 	.mac_link_sts		= RTPCS_930X_MAC_LINK_STS,
 	.mac_rx_pause_sts	= RTPCS_930X_MAC_RX_PAUSE_STS,
 	.mac_tx_pause_sts	= RTPCS_930X_MAC_TX_PAUSE_STS,
+	.serdes_count		= RTPCS_930X_SERDES_CNT,
 	.pcs_ops		= &rtpcs_930x_pcs_ops,
 	.set_autoneg		= rtpcs_93xx_set_autoneg,
 	.setup_serdes		= rtpcs_930x_setup_serdes,
@@ -3144,6 +3153,7 @@ static const struct rtpcs_config rtpcs_931x_cfg = {
 	.mac_link_sts		= RTPCS_931X_MAC_LINK_STS,
 	.mac_rx_pause_sts	= RTPCS_931X_MAC_RX_PAUSE_STS,
 	.mac_tx_pause_sts	= RTPCS_931X_MAC_TX_PAUSE_STS,
+	.serdes_count		= RTPCS_931X_SERDES_CNT,
 	.pcs_ops		= &rtpcs_931x_pcs_ops,
 	.set_autoneg		= rtpcs_93xx_set_autoneg,
 	.setup_serdes		= rtpcs_931x_setup_serdes,



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:19 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:19 -0500
Subject: [openwrt/openwrt]  realtek: pcs: add dedicated enum for SerDes modes
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36310.1765888703.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/d8b1a54c78f39ff7314d0237e2a463b3cf2b4b8c

commit d8b1a54c78f39ff7314d0237e2a463b3cf2b4b8c
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Thu Dec 11 19:17:26 2025 +0000

    realtek: pcs: add dedicated enum for SerDes modes
    
    The Realtek SerDes mode capabilities do not map 1:1 to the
    PHY_INTERFACE_MODE_* modes used in the kernel and passed to the PCS.
    For example, some PHY chips use the proprietary XSGMII mode for which
    there isn't an equivalent in the kernel, or HSGMII.
    
    In the past, this led to problems and confusion using kernel's XGMII to
    handle the XSGMII mode, and needed a downstream patch for HSGMII. They
    have been solved/worked around for now, but XSGMII is currently not
    implemented at all. And who knows what might come in the future.
    
    To make our life easier, introduce a dedicated internal representation
    of SerDes modes which differs from kernel's PHY_INTERFACE_MODE_*. This
    allows us to map "external" modes to different internal modes as needed
    instead of carrying the PHY_INTERFACE_MODE_* through the whole SerDes
    configuration code. The PCS driver needs to map PHY_INTERFACE_MODE_* to
    RTPCS_SDS_MODE_* in pcs_config, and the latter should be used as the
    only one.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit a4d6e10bf2561a39d9bb3c9e622531e8d5c9caf3)
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index def6b445d4..1a87d0d112 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -102,6 +102,29 @@
 #define RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR	(0x13F4)
 #define RTL931X_MAC_SERDES_MODE_CTRL(sds)	(0x136C + (((sds) << 2)))
 
+enum rtpcs_sds_mode {
+	RTPCS_SDS_MODE_OFF = 0,
+
+	/* fiber modes */
+	RTPCS_SDS_MODE_1000BASEX,
+	RTPCS_SDS_MODE_2500BASEX,
+	RTPCS_SDS_MODE_10GBASER,
+
+	/* mii modes */
+	RTPCS_SDS_MODE_SGMII,
+	RTPCS_SDS_MODE_HISGMII,
+	RTPCS_SDS_MODE_QSGMII,
+	RTPCS_SDS_MODE_QHSGMII,
+	RTPCS_SDS_MODE_XSGMII,
+
+	RTPCS_SDS_MODE_USXGMII_10GSXGMII,
+	RTPCS_SDS_MODE_USXGMII_10GDXGMII,
+	RTPCS_SDS_MODE_USXGMII_10GQXGMII,
+	RTPCS_SDS_MODE_USXGMII_5GSXGMII,
+	RTPCS_SDS_MODE_USXGMII_5GDXGMII,
+	RTPCS_SDS_MODE_USXGMII_2_5GSXGMII,
+};
+
 struct rtpcs_ctrl {
 	struct device *dev;
 	struct regmap *map;



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:23 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:23 -0500
Subject: [openwrt/openwrt]  realtek: pcs: assign SerDes reference upon PCS
 creation
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36311.1765888703.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/6f98353eecbebd2e7b8d18ab8582121cabc11dad

commit 6f98353eecbebd2e7b8d18ab8582121cabc11dad
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 10:29:56 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 69bbcc685b3c11719a1b2dbbc08aa02fba636455)
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 28 ++++++++++++----------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 435a74af7c..01b4b3af62 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -152,7 +152,8 @@ struct rtpcs_ctrl {
 struct rtpcs_link {
 	struct rtpcs_ctrl *ctrl;
 	struct phylink_pcs pcs;
-	int sds;
+	struct rtpcs_serdes *sds;
+	int sds_id;
 	int port;
 };
 
@@ -2919,7 +2920,7 @@ static void rtpcs_pcs_an_restart(struct phylink_pcs *pcs)
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 
 	dev_warn(ctrl->dev, "an_restart() for port %d and sds %d not yet implemented\n",
-		 link->port, link->sds);
+		 link->port, link->sds_id);
 }
 
 static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
@@ -2930,7 +2931,7 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 	int ret = 0;
 
-	if (link->sds < 0)
+	if (link->sds_id < 0)
 		return 0;
 
 	/*
@@ -2940,18 +2941,18 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	 */
 
 	dev_warn(ctrl->dev, "pcs_config(%s) for port %d and sds %d not yet fully implemented\n",
-		 phy_modes(interface), link->port, link->sds);
+		 phy_modes(interface), link->port, link->sds_id);
 
 	mutex_lock(&ctrl->lock);
 
 	if (ctrl->cfg->setup_serdes) {
-		ret = ctrl->cfg->setup_serdes(ctrl, link->sds, interface);
+		ret = ctrl->cfg->setup_serdes(ctrl, link->sds_id, interface);
 		if (ret < 0)
 			goto out;
 	}
 
 	if (ctrl->cfg->set_autoneg) {
-		ret = ctrl->cfg->set_autoneg(ctrl, link->sds, neg_mode);
+		ret = ctrl->cfg->set_autoneg(ctrl, link->sds_id, neg_mode);
 		if (ret < 0)
 			goto out;
 	}
@@ -2969,7 +2970,7 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	struct device_node *pcs_np;
 	struct rtpcs_ctrl *ctrl;
 	struct rtpcs_link *link;
-	u32 sds;
+	u32 sds_id;
 
 	if (!np || !of_device_is_available(np))
 		return ERR_PTR(-ENODEV);
@@ -2997,9 +2998,11 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	if (port < 0 || port > ctrl->cfg->cpu_port)
 		return ERR_PTR(-EINVAL);
 
-	if (of_property_read_u32(np, "reg", &sds))
+	if (of_property_read_u32(np, "reg", &sds_id))
+		return ERR_PTR(-EINVAL);
+	if (sds_id >= ctrl->cfg->serdes_count)
 		return ERR_PTR(-EINVAL);
-	if (rtpcs_sds_read(ctrl, sds, 0, 0) < 0)
+	if (rtpcs_sds_read(ctrl, sds_id, 0, 0) < 0)
 		return ERR_PTR(-EINVAL);
 
 	link = kzalloc(sizeof(*link), GFP_KERNEL);
@@ -3012,13 +3015,14 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 
 	link->ctrl = ctrl;
 	link->port = port;
-	link->sds = sds;
+	link->sds = &ctrl->serdes[sds_id];
+	link->sds_id = sds_id;
 	link->pcs.ops = ctrl->cfg->pcs_ops;
 	link->pcs.neg_mode = true;
 
 	ctrl->link[port] = link;
 
-	dev_dbg(ctrl->dev, "phylink_pcs created, port %d, sds %d\n", port, sds);
+	dev_dbg(ctrl->dev, "phylink_pcs created, port %d, sds %d\n", port, sds_id);
 
 	return &link->pcs;
 }
@@ -3086,7 +3090,7 @@ static int rtpcs_probe(struct platform_device *pdev)
 		ret = of_property_read_u32(child, "reg", &sds_id);
 		if (ret)
 			return ret;
-		if (sds >= ctrl->cfg->serdes_count)
+		if (sds_id >= ctrl->cfg->serdes_count)
 			return -EINVAL;
 
 		ctrl->rx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-rx");



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:26 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:26 -0500
Subject: [openwrt/openwrt]  realtek: pcs: make use of SerDes struct in
 set_autoneg
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36312.1765888703.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/d2a34744fe43ec9bc9f98b540f954b0ffd6984a0

commit d2a34744fe43ec9bc9f98b540f954b0ffd6984a0
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 20:12:13 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit d8dd8bd88f264d39f8c8c1cff056b4ec32a985bb)
---
 .../linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index a6a2a50f34..1158097801 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -168,7 +168,7 @@ struct rtpcs_config {
 
 	const struct phylink_pcs_ops *pcs_ops;
 	int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
-	int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
+	int (*set_autoneg)(struct rtpcs_serdes *sds, unsigned int neg_mode);
 	int (*setup_serdes)(struct rtpcs_serdes *sds, phy_interface_t mode);
 };
 
@@ -232,12 +232,12 @@ static int rtpcs_sds_write_bits(struct rtpcs_serdes *sds, int page,
 	return rtpcs_sds_write(sds, page, regnum, reg);
 }
 
-static int rtpcs_sds_modify(struct rtpcs_ctrl *ctrl, int sds, int page, int regnum,
+static int rtpcs_sds_modify(struct rtpcs_serdes *sds, int page, int regnum,
 			    u16 mask, u16 set)
 {
 	int mmd_regnum = rtpcs_sds_to_mmd(page, regnum);
 
-	return mdiobus_c45_modify(ctrl->bus, sds, MDIO_MMD_VEND1,
+	return mdiobus_c45_modify(sds->ctrl->bus, sds->id, MDIO_MMD_VEND1,
 				  mmd_regnum, mask, set);
 }
 
@@ -2975,7 +2975,7 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	}
 
 	if (ctrl->cfg->set_autoneg) {
-		ret = ctrl->cfg->set_autoneg(ctrl, link->sds->id, neg_mode);
+		ret = ctrl->cfg->set_autoneg(link->sds, neg_mode);
 		if (ret < 0)
 			goto out;
 	}
@@ -3136,12 +3136,11 @@ static int rtpcs_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rtpcs_93xx_set_autoneg(struct rtpcs_ctrl *ctrl, int sds,
-				  unsigned int neg_mode)
+static int rtpcs_93xx_set_autoneg(struct rtpcs_serdes *sds, unsigned int neg_mode)
 {
 	u16 bmcr = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED ? BMCR_ANENABLE : 0;
 
-	return rtpcs_sds_modify(ctrl, sds, 2, MII_BMCR, BMCR_ANENABLE, bmcr);
+	return rtpcs_sds_modify(sds, 2, MII_BMCR, BMCR_ANENABLE, bmcr);
 }
 
 static const struct phylink_pcs_ops rtpcs_838x_pcs_ops = {



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:21 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:21 -0500
Subject: [openwrt/openwrt]  realtek: pcs: add separate SerDes struct
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36315.1765888704.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/40201e7f73b41c9539ea79d6cad112d53f8ef935

commit 40201e7f73b41c9539ea79d6cad112d53f8ef935
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 10:12:35 2025 +0000

    realtek: pcs: add separate SerDes struct
    
    Add a separate structure for a SerDes. This is needed to appropriately
    store per-SerDes information, which in turn is needed for future work.
    Additionally, it's intended to reduce boilerplate and several
    inconsistencies.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 6b3f8fb16faf1e9c28b282340a112b2bcb06b0d3)
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 26 +++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 7cc5bb1730..566e79962c 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -129,11 +129,20 @@ enum rtpcs_sds_mode {
 	RTPCS_SDS_MODE_USXGMII_2_5GSXGMII,
 };
 
+struct rtpcs_ctrl;
+
+struct rtpcs_serdes {
+	struct rtpcs_ctrl *ctrl;
+	u8 id;
+	enum rtpcs_sds_mode mode;
+};
+
 struct rtpcs_ctrl {
 	struct device *dev;
 	struct regmap *map;
 	struct mii_bus *bus;
 	const struct rtpcs_config *cfg;
+	struct rtpcs_serdes serdes[RTPCS_SDS_CNT];
 	struct rtpcs_link *link[RTPCS_PORT_CNT];
 	bool rx_pol_inv[RTPCS_SDS_CNT];
 	bool tx_pol_inv[RTPCS_SDS_CNT];
@@ -3025,9 +3034,10 @@ static int rtpcs_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
 	struct device_node *child;
+	struct rtpcs_serdes *sds;
 	struct rtpcs_ctrl *ctrl;
-	u32 sds;
-	int ret;
+	u32 sds_id;
+	int i, ret;
 
 	ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
 	if (!ctrl)
@@ -3045,15 +3055,21 @@ static int rtpcs_probe(struct platform_device *pdev)
 	if (IS_ERR(ctrl->bus))
 		return PTR_ERR(ctrl->bus);
 
+	for (i = 0; i < ctrl->cfg->serdes_count; i++) {
+		sds = &ctrl->serdes[i];
+		sds->ctrl = ctrl;
+		sds->id = i;
+	}
+
 	for_each_child_of_node(dev->of_node, child) {
-		ret = of_property_read_u32(child, "reg", &sds);
+		ret = of_property_read_u32(child, "reg", &sds_id);
 		if (ret)
 			return ret;
 		if (sds >= ctrl->cfg->serdes_count)
 			return -EINVAL;
 
-		ctrl->rx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-rx");
-		ctrl->tx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-tx");
+		ctrl->rx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-rx");
+		ctrl->tx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-tx");
 	}
 
 	if (ctrl->cfg->init_serdes_common) {



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:25 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:25 -0500
Subject: [openwrt/openwrt]  realtek: pcs: make use of SerDes struct in SerDes
 setup
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36316.1765888707.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/cf03520c71873911c544f687f74e020626a17e2b

commit cf03520c71873911c544f687f74e020626a17e2b
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Thu Dec 11 21:42:38 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 1fccb0eb1636ad7c417a14c55e766cd97e875015)
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 1516 ++++++++++----------
 1 file changed, 770 insertions(+), 746 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index d2a70e65e4..a6a2a50f34 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -169,7 +169,7 @@ struct rtpcs_config {
 	const struct phylink_pcs_ops *pcs_ops;
 	int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
 	int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
-	int (*setup_serdes)(struct rtpcs_ctrl *ctrl, int sds, phy_interface_t mode);
+	int (*setup_serdes)(struct rtpcs_serdes *sds, phy_interface_t mode);
 };
 
 typedef struct {
@@ -183,14 +183,15 @@ static int rtpcs_sds_to_mmd(int sds_page, int sds_regnum)
 	return (sds_page << 8) + sds_regnum;
 }
 
-static int rtpcs_sds_read(struct rtpcs_ctrl *ctrl, int sds, int page, int regnum)
+static int rtpcs_sds_read(struct rtpcs_serdes *sds, int page, int regnum)
 {
 	int mmd_regnum = rtpcs_sds_to_mmd(page, regnum);
 
-	return mdiobus_c45_read(ctrl->bus, sds, MDIO_MMD_VEND1, mmd_regnum);
+	return mdiobus_c45_read(sds->ctrl->bus, sds->id, MDIO_MMD_VEND1,
+				mmd_regnum);
 }
 
-static int rtpcs_sds_read_bits(struct rtpcs_ctrl *ctrl, int sds, int page,
+static int rtpcs_sds_read_bits(struct rtpcs_serdes *sds, int page,
 			       int regnum, int bithigh, int bitlow)
 {
 	int mask, val;
@@ -198,21 +199,22 @@ static int rtpcs_sds_read_bits(struct rtpcs_ctrl *ctrl, int sds, int page,
 	WARN_ON(bithigh < bitlow);
 
 	mask = GENMASK(bithigh, bitlow);
-	val = rtpcs_sds_read(ctrl, sds, page, regnum);
+	val = rtpcs_sds_read(sds, page, regnum);
 	if (val < 0)
 		return val;
 
 	return (val & mask) >> bitlow;
 }
 
-static int rtpcs_sds_write(struct rtpcs_ctrl *ctrl, int sds, int page, int regnum, u16 value)
+static int rtpcs_sds_write(struct rtpcs_serdes *sds, int page, int regnum, u16 value)
 {
 	int mmd_regnum = rtpcs_sds_to_mmd(page, regnum);
 
-	return mdiobus_c45_write(ctrl->bus, sds, MDIO_MMD_VEND1, mmd_regnum, value);
+	return mdiobus_c45_write(sds->ctrl->bus, sds->id, MDIO_MMD_VEND1,
+				 mmd_regnum, value);
 }
 
-static int rtpcs_sds_write_bits(struct rtpcs_ctrl *ctrl, int sds, int page,
+static int rtpcs_sds_write_bits(struct rtpcs_serdes *sds, int page,
 				int regnum, int bithigh, int bitlow, u16 value)
 {
 	int mask, reg;
@@ -220,14 +222,14 @@ static int rtpcs_sds_write_bits(struct rtpcs_ctrl *ctrl, int sds, int page,
 	WARN_ON(bithigh < bitlow);
 
 	mask = GENMASK(bithigh, bitlow);
-	reg = rtpcs_sds_read(ctrl, sds, page, regnum);
+	reg = rtpcs_sds_read(sds, page, regnum);
 	if (reg < 0)
 		return reg;
 
 	reg = (reg & ~mask);
 	reg |= (value << bitlow) & mask;
 
-	return rtpcs_sds_write(ctrl, sds, page, regnum, reg);
+	return rtpcs_sds_write(sds, page, regnum, reg);
 }
 
 static int rtpcs_sds_modify(struct rtpcs_ctrl *ctrl, int sds, int page, int regnum,
@@ -235,25 +237,22 @@ static int rtpcs_sds_modify(struct rtpcs_ctrl *ctrl, int sds, int page, int regn
 {
 	int mmd_regnum = rtpcs_sds_to_mmd(page, regnum);
 
-	return mdiobus_c45_modify(ctrl->bus, sds, MDIO_MMD_VEND1, mmd_regnum,
-				  mask, set);
+	return mdiobus_c45_modify(ctrl->bus, sds, MDIO_MMD_VEND1,
+				  mmd_regnum, mask, set);
 }
 
-__maybe_unused
 static struct rtpcs_serdes *rtpcs_sds_get_even(struct rtpcs_serdes *sds)
 {
 	u32 even_sds = sds->id & ~1;
 	return &sds->ctrl->serdes[even_sds];
 }
 
-__maybe_unused
 static struct rtpcs_serdes *rtpcs_sds_get_odd(struct rtpcs_serdes *sds)
 {
 	u32 odd_sds = sds->id | 1;
 	return &sds->ctrl->serdes[odd_sds];
 }
 
-__maybe_unused
 static struct rtpcs_serdes *rtpcs_sds_get_neighbor(struct rtpcs_serdes *sds)
 {
 	u32 nb_sds = sds->id ^ 1;
@@ -282,129 +281,131 @@ static struct rtpcs_link *rtpcs_phylink_pcs_to_link(struct phylink_pcs *pcs)
 
 /* RTL838X */
 
+#define SDS(ctrl,n)	(&(ctrl)->serdes[n])
+
 static void rtpcs_838x_sds_patch_01_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 0, 1, 3, 0xf46f);
-	rtpcs_sds_write(ctrl, 0, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 1, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 0, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 1, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 0, 1, 17, 0xb7c9);
-	rtpcs_sds_write(ctrl, 1, 1, 11, 0x482);
-	rtpcs_sds_write(ctrl, 1, 1, 10, 0x80c7);
-	rtpcs_sds_write(ctrl, 0, 1, 18, 0xab8e);
-	rtpcs_sds_write(ctrl, 0, 1, 11, 0x482);
-	rtpcs_sds_write(ctrl, 0, 1, 19, 0x24ab);
-	rtpcs_sds_write(ctrl, 1, 1, 17, 0x4208);
-	rtpcs_sds_write(ctrl, 1, 1, 18, 0xc208);
-	rtpcs_sds_write(ctrl, 0, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 1, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 0, 1, 14, 0xfcc2);
-	rtpcs_sds_write(ctrl, 1, 1, 14, 0xfcc2);
-
-	rtpcs_sds_write(ctrl, 0, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 0, 1, 9, 0x8c64);
-
-	rtpcs_sds_write(ctrl, 1, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 1, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 3, 0xf46f);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 17, 0xb7c9);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 11, 0x482);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 10, 0x80c7);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 18, 0xab8e);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 11, 0x482);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 19, 0x24ab);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 17, 0x4208);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 18, 0xc208);
+	rtpcs_sds_write(SDS(ctrl, 0), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 1), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 14, 0xfcc2);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 14, 0xfcc2);
+
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 0), 1, 9, 0x8c64);
+
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 1), 1, 9, 0x8c64);
 }
 
 static void rtpcs_838x_sds_patch_23_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 2, 1, 3, 0xf46d);
-	rtpcs_sds_write(ctrl, 2, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 3, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 2, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 3, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 2, 1, 17, 0xb7c9);
-	rtpcs_sds_write(ctrl, 2, 1, 18, 0xab8e);
-	rtpcs_sds_write(ctrl, 2, 1, 11, 0x482);
-	rtpcs_sds_write(ctrl, 3, 1, 11, 0x482);
-	rtpcs_sds_write(ctrl, 2, 1, 19, 0x24ab);
-	rtpcs_sds_write(ctrl, 3, 1, 17, 0x4208);
-	rtpcs_sds_write(ctrl, 3, 1, 18, 0xc208);
-	rtpcs_sds_write(ctrl, 2, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 3, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 2, 1, 14, 0xfcc2);
-	rtpcs_sds_write(ctrl, 3, 1, 14, 0xfcc2);
-
-	rtpcs_sds_write(ctrl, 2, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 2, 1, 9, 0x8c64);
-
-	rtpcs_sds_write(ctrl, 3, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 3, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 3, 0xf46d);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 17, 0xb7c9);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 18, 0xab8e);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 11, 0x482);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 11, 0x482);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 19, 0x24ab);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 17, 0x4208);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 18, 0xc208);
+	rtpcs_sds_write(SDS(ctrl, 2), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 3), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 14, 0xfcc2);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 14, 0xfcc2);
+
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 2), 1, 9, 0x8c64);
+
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 3), 1, 9, 0x8c64);
 }
 
 static void rtpcs_838x_sds_patch_4_fiber_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 4, 1, 11, 0x1482);
-	rtpcs_sds_write(ctrl, 4, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 4, 1, 10, 0xc3);
-	rtpcs_sds_write(ctrl, 4, 1, 17, 0xb7c9);
-	rtpcs_sds_write(ctrl, 4, 1, 18, 0xab8e);
-	rtpcs_sds_write(ctrl, 4, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 4, 1, 14, 0xfcc2);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 11, 0x1482);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 10, 0xc3);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 17, 0xb7c9);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 18, 0xab8e);
+	rtpcs_sds_write(SDS(ctrl, 4), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 14, 0xfcc2);
 
-	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 9, 0x8c64);
 }
 
 static void rtpcs_838x_sds_patch_4_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 4, 1, 3, 0xf46d);
-	rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 4, 1, 11, 0x0482);
-	rtpcs_sds_write(ctrl, 4, 1, 6, 0x20d8);
-	rtpcs_sds_write(ctrl, 4, 1, 10, 0x58c7);
-	rtpcs_sds_write(ctrl, 4, 1, 17, 0xb7c9);
-	rtpcs_sds_write(ctrl, 4, 1, 18, 0xab8e);
-	rtpcs_sds_write(ctrl, 4, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 4, 1, 14, 0xfcc2);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 3, 0xf46d);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 11, 0x0482);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 6, 0x20d8);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 10, 0x58c7);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 17, 0xb7c9);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 18, 0xab8e);
+	rtpcs_sds_write(SDS(ctrl, 4), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 14, 0xfcc2);
 
-	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 4, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 4), 1, 9, 0x8c64);
 }
 
 static void rtpcs_838x_sds_patch_5_fiber_6275b(struct rtpcs_ctrl *ctrl)
 {
-	rtpcs_sds_write(ctrl, 5, 1, 2, 0x85fa);
-	rtpcs_sds_write(ctrl, 5, 1, 3, 0x00);
-	rtpcs_sds_write(ctrl, 5, 1, 4, 0xdccc);
-	rtpcs_sds_write(ctrl, 5, 1, 5, 0x00);
-	rtpcs_sds_write(ctrl, 5, 1, 6, 0x3600);
-	rtpcs_sds_write(ctrl, 5, 1, 7, 0x03);
-	rtpcs_sds_write(ctrl, 5, 1, 8, 0x79aa);
-	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
-	rtpcs_sds_write(ctrl, 5, 1, 10, 0xc3);
-	rtpcs_sds_write(ctrl, 5, 1, 11, 0x1482);
-	rtpcs_sds_write(ctrl, 5, 2, 24, 0x14aa);
-	rtpcs_sds_write(ctrl, 5, 2, 25, 0x303);
-	rtpcs_sds_write(ctrl, 5, 1, 14, 0xf002);
-	rtpcs_sds_write(ctrl, 5, 2, 27, 0x4bf);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 2, 0x85fa);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 3, 0x00);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 4, 0xdccc);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 5, 0x00);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 6, 0x3600);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 7, 0x03);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 8, 0x79aa);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 10, 0xc3);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 11, 0x1482);
+	rtpcs_sds_write(SDS(ctrl, 5), 2, 24, 0x14aa);
+	rtpcs_sds_write(SDS(ctrl, 5), 2, 25, 0x303);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 14, 0xf002);
+	rtpcs_sds_write(SDS(ctrl, 5), 2, 27, 0x4bf);
 
-	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8e64);
-	rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 9, 0x8e64);
+	rtpcs_sds_write(SDS(ctrl, 5), 1, 9, 0x8c64);
 }
 
-static void rtpcs_838x_sds_reset(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_838x_sds_reset(struct rtpcs_serdes *sds)
 {
-	rtpcs_sds_write_bits(ctrl, sds, 2, 0, 11, 11, 0x0);	/* FIB_REG0 CFG_FIB_PDOWN */
+	rtpcs_sds_write_bits(sds, 2, 0, 11, 11, 0x0);	/* FIB_REG0 CFG_FIB_PDOWN */
 
 	/* analog reset */
-	rtpcs_sds_write_bits(ctrl, sds, 0, 0, 1, 0, 0x0);	/* REG0 EN_RX/EN_TX */
-	rtpcs_sds_write_bits(ctrl, sds, 0, 0, 1, 0, 0x3);	/* REG0 EN_RX/EN_TX */
+	rtpcs_sds_write_bits(sds, 0, 0, 1, 0, 0x0);	/* REG0 EN_RX/EN_TX */
+	rtpcs_sds_write_bits(sds, 0, 0, 1, 0, 0x3);	/* REG0 EN_RX/EN_TX */
 
 	/* digital reset */
-	rtpcs_sds_write_bits(ctrl, sds, 0, 3, 6, 6, 0x1);	/* REG3 SOFT_RST */
-	rtpcs_sds_write_bits(ctrl, sds, 0, 3, 6, 6, 0x0);	/* REG3 SOFT_RST */
+	rtpcs_sds_write_bits(sds, 0, 3, 6, 6, 0x1);	/* REG3 SOFT_RST */
+	rtpcs_sds_write_bits(sds, 0, 3, 6, 6, 0x0);	/* REG3 SOFT_RST */
 
-	dev_info(ctrl->dev, "SerDes %d reset\n", sds);
+	dev_info(sds->ctrl->dev, "SerDes %d reset\n", sds->id);
 }
 
-static bool rtpcs_838x_sds_is_mode_supported(u32 sds, phy_interface_t mode)
+static bool rtpcs_838x_sds_is_mode_supported(struct rtpcs_serdes *sds, phy_interface_t mode)
 {
-	switch (sds) {
+	switch (sds->id) {
 	case 0 ... 3:
 		return mode == PHY_INTERFACE_MODE_QSGMII;
 	case 4:
@@ -419,23 +420,26 @@ static bool rtpcs_838x_sds_is_mode_supported(u32 sds, phy_interface_t mode)
 	}
 }
 
-static int rtpcs_838x_sds_power(struct rtpcs_ctrl *ctrl, u32 sds, bool power_on)
+static int rtpcs_838x_sds_power(struct rtpcs_serdes *sds, bool power_on)
 {
-	u8 val = power_on ? 0 : BIT(sds);
+	u8 sds_id = sds->id;
 	int ret;
+	u8 val;
+
+	val = power_on ? 0 : BIT(sds_id);
 
-	ret = regmap_write_bits(ctrl->map, RTPCS_838X_SDS_CFG_REG, BIT(sds), val);
+	ret = regmap_write_bits(sds->ctrl->map, RTPCS_838X_SDS_CFG_REG, BIT(sds_id), val);
 	if (ret)
 		return ret;
 
-	if (sds >= 4)
-		ret = regmap_write_bits(ctrl->map, RTPCS_838X_SDS_CFG_REG,
-					BIT(sds) << 2, val << 2); /* SDS*_PHY_MODE */
+	if (sds_id >= 4)
+		ret = regmap_write_bits(sds->ctrl->map, RTPCS_838X_SDS_CFG_REG,
+					BIT(sds_id) << 2, val << 2); /* SDS*_PHY_MODE */
 
 	return ret;
 }
 
-static int rtpcs_838x_sds_set_mode(struct rtpcs_ctrl *ctrl, u32 sds,
+static int rtpcs_838x_sds_set_mode(struct rtpcs_serdes *sds,
 				   phy_interface_t mode)
 {
 	u8 sds_mode_shift, int_mode_shift;
@@ -459,49 +463,52 @@ static int rtpcs_838x_sds_set_mode(struct rtpcs_ctrl *ctrl, u32 sds,
 	}
 
 	/* Configure SerDes module mode (all SDS 0-5) */
-	sds_mode_shift = (5 - sds) * 5;
-	regmap_write_bits(ctrl->map, RTPCS_838X_SDS_MODE_SEL,
+	sds_mode_shift = (5 - sds->id) * 5;
+	regmap_write_bits(sds->ctrl->map, RTPCS_838X_SDS_MODE_SEL,
 			  0x1f << sds_mode_shift, sds_mode_val << sds_mode_shift);
 
 	/* Configure MAC interface mode (only SDS 4-5) */
-	if (sds >= 4) {
-		int_mode_shift = (sds == 5) ? 3 : 0;
-		regmap_write_bits(ctrl->map, RTPCS_838X_INT_MODE_CTRL,
+	if (sds->id >= 4) {
+		int_mode_shift = (sds->id == 5) ? 3 : 0;
+		regmap_write_bits(sds->ctrl->map, RTPCS_838X_INT_MODE_CTRL,
 				  0x7 << int_mode_shift, int_mode_val << int_mode_shift);
 	}
 
 	return 0;
 }
 
-static int rtpcs_838x_sds_patch(struct rtpcs_ctrl *ctrl, u32 sds,
+static int rtpcs_838x_sds_patch(struct rtpcs_serdes *sds,
 				phy_interface_t mode)
 {
-	rtpcs_sds_write(ctrl, sds, 0, 1, 0xf00);
+	struct rtpcs_ctrl *ctrl = sds->ctrl;
+	u8 sds_id = sds->id;
+
+	rtpcs_sds_write(sds, 0, 1, 0xf00);
 	mdelay(1);
-	rtpcs_sds_write(ctrl, sds, 0, 2, 0x7060);
+	rtpcs_sds_write(sds, 0, 2, 0x7060);
 	mdelay(1);
 
-	if (sds >= 4) {
-		rtpcs_sds_write(ctrl, sds, 2, 30, 0x71e);
+	if (sds_id >= 4) {
+		rtpcs_sds_write(sds, 2, 30, 0x71e);
 		mdelay(1);
-		rtpcs_sds_write(ctrl, sds, 0, 4, 0x74d);
+		rtpcs_sds_write(sds, 0, 4, 0x74d);
 		mdelay(1);
 	}
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_1000BASEX:
-		if (sds == 4)
+		if (sds_id == 4)
 			rtpcs_838x_sds_patch_4_fiber_6275b(ctrl);
-		else if (sds == 5)
+		else if (sds_id == 5)
 			rtpcs_838x_sds_patch_5_fiber_6275b(ctrl);
 
 		break;
 	case PHY_INTERFACE_MODE_QSGMII:
-		if (sds == 0 || sds == 1)
+		if (sds_id == 0 || sds_id == 1)
 			rtpcs_838x_sds_patch_01_qsgmii_6275b(ctrl);
-		else if (sds == 2 || sds == 3)
+		else if (sds_id == 2 || sds_id == 3)
 			rtpcs_838x_sds_patch_23_qsgmii_6275b(ctrl);
-		else if (sds == 4)
+		else if (sds_id == 4)
 			rtpcs_838x_sds_patch_4_qsgmii_6275b(ctrl);
 
 		break;
@@ -532,33 +539,33 @@ static int rtpcs_838x_init_serdes_common(struct rtpcs_ctrl *ctrl)
 	return 0;
 }
 
-static int rtpcs_838x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_838x_setup_serdes(struct rtpcs_serdes *sds,
 				   phy_interface_t mode)
 {
 	int ret;
 
-	if (sds > 5)
+	if (sds->id > 5)
 		return -EINVAL;
 	if (!rtpcs_838x_sds_is_mode_supported(sds, mode))
 		return -EINVAL;
 
-	rtpcs_838x_sds_power(ctrl, sds, false);
+	rtpcs_838x_sds_power(sds, false);
 
 	/* take reset */
-	rtpcs_sds_write(ctrl, sds, 0x0, 0x0, 0xc00);
-	rtpcs_sds_write(ctrl, sds, 0x0, 0x3, 0x7146);
+	rtpcs_sds_write(sds, 0x0, 0x0, 0xc00);
+	rtpcs_sds_write(sds, 0x0, 0x3, 0x7146);
 
-	ret = rtpcs_838x_sds_set_mode(ctrl, sds, mode);
+	ret = rtpcs_838x_sds_set_mode(sds, mode);
 	if (ret)
 		return ret;
 
-	rtpcs_838x_sds_patch(ctrl, sds, mode);
-	rtpcs_838x_sds_reset(ctrl, sds);
+	rtpcs_838x_sds_patch(sds, mode);
+	rtpcs_838x_sds_reset(sds);
 	
 	/* release reset */
-	rtpcs_sds_write(ctrl, sds, 0, 3, 0x7106);
+	rtpcs_sds_write(sds, 0, 3, 0x7106);
 
-	rtpcs_838x_sds_power(ctrl, sds, true);
+	rtpcs_838x_sds_power(sds, true);
 	return 0;
 }
 
@@ -573,57 +580,63 @@ u16 rtpcs_930x_sds_submode_regs[] = { 0x1cc, 0x1cc, 0x2d8, 0x2d8, 0x2d8, 0x2d8,
 				      0x2d8, 0x2d8};
 u8  rtpcs_930x_sds_submode_lsb[]  = { 0, 5, 0, 5, 10, 15, 20, 25 };
 
-static void rtpcs_930x_sds_set(struct rtpcs_ctrl *ctrl, int sds_num, u32 mode)
+static void rtpcs_930x_sds_set(struct rtpcs_serdes *sds, u32 mode)
 {
+	u8 sds_id = sds->id;
+
 	pr_info("%s %d\n", __func__, mode);
-	if (sds_num < 0 || sds_num > 11) {
-		pr_err("Wrong SerDes number: %d\n", sds_num);
+	if (sds_id < 0 || sds_id > 11) {
+		pr_err("Wrong SerDes number: %d\n", sds_id);
 		return;
 	}
 
-	regmap_write_bits(ctrl->map, rtpcs_930x_sds_regs[sds_num],
-			  RTL930X_SDS_MASK << rtpcs_930x_sds_lsb[sds_num],
-			  mode << rtpcs_930x_sds_lsb[sds_num]);
+	regmap_write_bits(sds->ctrl->map, rtpcs_930x_sds_regs[sds_id],
+			  RTL930X_SDS_MASK << rtpcs_930x_sds_lsb[sds_id],
+			  mode << rtpcs_930x_sds_lsb[sds_id]);
 	mdelay(10);
 }
 
 __always_unused
-static u32 rtpcs_930x_sds_mode_get(struct rtpcs_ctrl *ctrl, int sds_num)
+static u32 rtpcs_930x_sds_mode_get(struct rtpcs_serdes *sds)
 {
+	u8 sds_id = sds->id;
 	u32 v;
 
-	if (sds_num < 0 || sds_num > 11) {
-		pr_err("Wrong SerDes number: %d\n", sds_num);
+	if (sds_id < 0 || sds_id > 11) {
+		pr_err("Wrong SerDes number: %d\n", sds_id);
 		return 0;
 	}
 
-	regmap_read(ctrl->map, rtpcs_930x_sds_regs[sds_num], &v);
-	v >>= rtpcs_930x_sds_lsb[sds_num];
+	regmap_read(sds->ctrl->map, rtpcs_930x_sds_regs[sds_id], &v);
+	v >>= rtpcs_930x_sds_lsb[sds_id];
 
 	return v & RTL930X_SDS_MASK;
 }
 
 __always_unused
-static u32 rtpcs_930x_sds_submode_get(struct rtpcs_ctrl *ctrl, int sds_num)
+static u32 rtpcs_930x_sds_submode_get(struct rtpcs_serdes *sds)
 {
+	u8 sds_id = sds->id;
 	u32 v;
 
-	if (sds_num < 2 || sds_num > 9) {
-		pr_err("%s: unsupported SerDes %d\n", __func__, sds_num);
+	if (sds_id < 2 || sds_id > 9) {
+		pr_err("%s: unsupported SerDes %d\n", __func__, sds_id);
 		return 0;
 	}
 
-	regmap_read(ctrl->map, rtpcs_930x_sds_submode_regs[sds_num], &v);
-	v >>= rtpcs_930x_sds_submode_lsb[sds_num];
+	regmap_read(sds->ctrl->map, rtpcs_930x_sds_submode_regs[sds_id], &v);
+	v >>= rtpcs_930x_sds_submode_lsb[sds_id];
 
 	return v & RTL930X_SDS_MASK;
 }
 
-static void rtpcs_930x_sds_submode_set(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_submode_set(struct rtpcs_serdes *sds,
 				       u32 submode)
 {
-	if (sds < 2 || sds > 9) {
-		pr_err("%s: submode unsupported on serdes %d\n", __func__, sds);
+	u8 sds_id = sds->id;
+
+	if (sds_id < 2 || sds_id > 9) {
+		pr_err("%s: submode unsupported on serdes %d\n", __func__, sds_id);
 		return;
 	}
 
@@ -632,12 +645,12 @@ static void rtpcs_930x_sds_submode_set(struct rtpcs_ctrl *ctrl, int sds,
 		pr_err("%s: unsupported submode 0x%x\n", __func__, submode);
 	}
 
-	regmap_write_bits(ctrl->map, rtpcs_930x_sds_submode_regs[sds - 2],
-			  RTL930X_SDS_MASK << rtpcs_930x_sds_submode_lsb[sds - 2],
-			  submode << rtpcs_930x_sds_submode_lsb[sds - 2]);
+	regmap_write_bits(sds->ctrl->map, rtpcs_930x_sds_submode_regs[sds_id - 2],
+			  RTL930X_SDS_MASK << rtpcs_930x_sds_submode_lsb[sds_id - 2],
+			  submode << rtpcs_930x_sds_submode_lsb[sds_id - 2]);
 }
 
-static void rtpcs_930x_sds_rx_reset(struct rtpcs_ctrl *ctrl, int sds_num,
+static void rtpcs_930x_sds_rx_reset(struct rtpcs_serdes *sds,
 				    phy_interface_t phy_if)
 {
 	int page = 0x2e; /* 10GR and USXGMII */
@@ -645,33 +658,33 @@ static void rtpcs_930x_sds_rx_reset(struct rtpcs_ctrl *ctrl, int sds_num,
 	if (phy_if == PHY_INTERFACE_MODE_1000BASEX)
 		page = 0x24;
 
-	rtpcs_sds_write_bits(ctrl, sds_num, page, 0x15, 4, 4, 0x1);
+	rtpcs_sds_write_bits(sds, page, 0x15, 4, 4, 0x1);
 	mdelay(5);
-	rtpcs_sds_write_bits(ctrl, sds_num, page, 0x15, 4, 4, 0x0);
+	rtpcs_sds_write_bits(sds, page, 0x15, 4, 4, 0x0);
 }
 
-static void rtpcs_930x_sds_get_pll_data(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_get_pll_data(struct rtpcs_serdes *sds,
 					int *pll, int *speed)
 {
-	int sbit, pbit = sds & 1 ? 6 : 4;
-	int base_sds = sds & ~1;
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
+	int sbit, pbit = (sds == even_sds) ? 4 : 6;
 
 	/*
 	 * PLL data is shared between adjacent SerDes in the even lane. Each SerDes defines
 	 * what PLL it needs (ring or LC) while the PLL itself stores the current speed.
 	 */
 
-	*pll = rtpcs_sds_read_bits(ctrl, base_sds, 0x20, 0x12, pbit + 1, pbit);
+	*pll = rtpcs_sds_read_bits(even_sds, 0x20, 0x12, pbit + 1, pbit);
 	sbit = *pll == RTSDS_930X_PLL_LC ? 8 : 12;
-	*speed = rtpcs_sds_read_bits(ctrl, base_sds, 0x20, 0x12, sbit + 3, sbit);
+	*speed = rtpcs_sds_read_bits(even_sds, 0x20, 0x12, sbit + 3, sbit);
 }
 
-static int rtpcs_930x_sds_set_pll_data(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_930x_sds_set_pll_data(struct rtpcs_serdes *sds,
 				       int pll, int speed)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int sbit = pll == RTSDS_930X_PLL_LC ? 8 : 12;
-	int pbit = sds & 1 ? 6 : 4;
-	int base_sds = sds & ~1;
+	int pbit = (sds == even_sds) ? 4 : 6;
 
 	if ((speed != RTSDS_930X_PLL_1000) &&
 	    (speed != RTSDS_930X_PLL_2500) &&
@@ -690,17 +703,17 @@ static int rtpcs_930x_sds_set_pll_data(struct rtpcs_ctrl *ctrl, int sds,
 	 * always activate both.
 	 */
 
-	rtpcs_sds_write_bits(ctrl, base_sds, 0x20, 0x12, 3, 0, 0xf);
-	rtpcs_sds_write_bits(ctrl, base_sds, 0x20, 0x12, pbit + 1, pbit, pll);
-	rtpcs_sds_write_bits(ctrl, base_sds, 0x20, 0x12, sbit + 3, sbit, speed);
+	rtpcs_sds_write_bits(even_sds, 0x20, 0x12, 3, 0, 0xf);
+	rtpcs_sds_write_bits(even_sds, 0x20, 0x12, pbit + 1, pbit, pll);
+	rtpcs_sds_write_bits(even_sds, 0x20, 0x12, sbit + 3, sbit, speed);
 
 	return 0;
 }
 
-static void rtpcs_930x_sds_reset_cmu(struct rtpcs_ctrl *ctrl, int sds)
+static void rtpcs_930x_sds_reset_cmu(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int reset_sequence[4] = { 3, 2, 3, 1 };
-	int base_sds = sds & ~1;
 	int pll, speed, i, bit;
 
 	/*
@@ -709,17 +722,18 @@ static void rtpcs_930x_sds_reset_cmu(struct rtpcs_ctrl *ctrl, int sds)
 	 * to flipping two bits in a special sequence.
 	 */
 
-	rtpcs_930x_sds_get_pll_data(ctrl, sds, &pll, &speed);
+	rtpcs_930x_sds_get_pll_data(sds, &pll, &speed);
 	bit = pll == RTSDS_930X_PLL_LC ? 2 : 0;
 
 	for (i = 0; i < ARRAY_SIZE(reset_sequence); i++)
-		rtpcs_sds_write_bits(ctrl, base_sds, 0x21, 0x0b, bit + 1, bit,
+		rtpcs_sds_write_bits(even_sds, 0x21, 0x0b, bit + 1, bit,
 				     reset_sequence[i]);
 }
 
-static int rtpcs_930x_sds_wait_clock_ready(struct rtpcs_ctrl *ctrl, int sds)
+static int rtpcs_930x_sds_wait_clock_ready(struct rtpcs_serdes *sds)
 {
-	int i, base_sds = sds & ~1, ready, ready_cnt = 0, bit = (sds & 1) + 4;
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
+	int i, ready, ready_cnt = 0, bit = (sds == even_sds) ? 4 : 5;
 
 	/*
 	 * While reconfiguring a SerDes it might take some time until its clock is in sync with
@@ -730,8 +744,8 @@ static int rtpcs_930x_sds_wait_clock_ready(struct rtpcs_ctrl *ctrl, int sds)
 	for (i = 0; i < 20; i++) {
 		usleep_range(10000, 15000);
 
-		rtpcs_sds_write(ctrl, base_sds, 0x1f, 0x02, 53);
-		ready = rtpcs_sds_read_bits(ctrl, base_sds, 0x1f, 0x14, bit, bit);
+		rtpcs_sds_write(even_sds, 0x1f, 0x02, 53);
+		ready = rtpcs_sds_read_bits(even_sds, 0x1f, 0x14, bit, bit);
 
 		ready_cnt = ready ? ready_cnt + 1 : 0;
 		if (ready_cnt >= 3)
@@ -741,51 +755,51 @@ static int rtpcs_930x_sds_wait_clock_ready(struct rtpcs_ctrl *ctrl, int sds)
 	return -EBUSY;
 }
 
-static int rtpcs_930x_sds_get_internal_mode(struct rtpcs_ctrl *ctrl, int sds)
+static int rtpcs_930x_sds_get_internal_mode(struct rtpcs_serdes *sds)
 {
-	return rtpcs_sds_read_bits(ctrl, sds, 0x1f, 0x09, 11, 7);
+	return rtpcs_sds_read_bits(sds, 0x1f, 0x09, 11, 7);
 }
 
-static void rtpcs_930x_sds_set_internal_mode(struct rtpcs_ctrl *ctrl, int sds,
-					     int mode)
+static void rtpcs_930x_sds_set_internal_mode(struct rtpcs_serdes *sds, int mode)
 {
-	rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0x09, 6, 6, 0x1); /* Force mode enable */
-	rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0x09, 11, 7, mode);
+	rtpcs_sds_write_bits(sds, 0x1f, 0x09, 6, 6, 0x1); /* Force mode enable */
+	rtpcs_sds_write_bits(sds, 0x1f, 0x09, 11, 7, mode);
 }
 
-static void rtpcs_930x_sds_set_power(struct rtpcs_ctrl *ctrl, int sds, bool on)
+static void rtpcs_930x_sds_set_power(struct rtpcs_serdes *sds, bool on)
 {
 	int power_down = on ? 0x0 : 0x3;
 	int rx_enable = on ? 0x3 : 0x1;
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x20, 0x00, 7, 6, power_down);
-	rtpcs_sds_write_bits(ctrl, sds, 0x20, 0x00, 5, 4, rx_enable);
+	rtpcs_sds_write_bits(sds, 0x20, 0x00, 7, 6, power_down);
+	rtpcs_sds_write_bits(sds, 0x20, 0x00, 5, 4, rx_enable);
 }
 
-static void rtpcs_930x_sds_reconfigure_pll(struct rtpcs_ctrl *ctrl, int sds, int pll)
+static void rtpcs_930x_sds_reconfigure_pll(struct rtpcs_serdes *sds, int pll)
 {
 	int mode, tmp, speed;
 
-	mode = rtpcs_930x_sds_get_internal_mode(ctrl, sds);
-	rtpcs_930x_sds_get_pll_data(ctrl, sds, &tmp, &speed);
+	mode = rtpcs_930x_sds_get_internal_mode(sds);
+	rtpcs_930x_sds_get_pll_data(sds, &tmp, &speed);
 
-	rtpcs_930x_sds_set_power(ctrl, sds, false);
-	rtpcs_930x_sds_set_internal_mode(ctrl, sds, RTL930X_SDS_OFF);
+	rtpcs_930x_sds_set_power(sds, false);
+	rtpcs_930x_sds_set_internal_mode(sds, RTL930X_SDS_OFF);
 
-	rtpcs_930x_sds_set_pll_data(ctrl, sds, pll, speed);
-	rtpcs_930x_sds_reset_cmu(ctrl, sds);
+	rtpcs_930x_sds_set_pll_data(sds, pll, speed);
+	rtpcs_930x_sds_reset_cmu(sds);
 
-	rtpcs_930x_sds_set_internal_mode(ctrl, sds, mode);
-	if (rtpcs_930x_sds_wait_clock_ready(ctrl, sds))
-		pr_err("%s: SDS %d could not sync clock\n", __func__, sds);
+	rtpcs_930x_sds_set_internal_mode(sds, mode);
+	if (rtpcs_930x_sds_wait_clock_ready(sds))
+		pr_err("%s: SDS %d could not sync clock\n", __func__, sds->id);
 
-	rtpcs_930x_sds_set_power(ctrl, sds, true);
+	rtpcs_930x_sds_set_power(sds, true);
 }
 
-static int rtpcs_930x_sds_config_pll(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_930x_sds_config_pll(struct rtpcs_serdes *sds,
 				     phy_interface_t interface)
 {
-	int neighbor_speed, neighbor_mode, neighbor_pll, neighbor = sds ^ 1;
+	struct rtpcs_serdes *nb_sds = rtpcs_sds_get_neighbor(sds);
+	int neighbor_speed, neighbor_mode, neighbor_pll;
 	bool speed_changed = true;
 	int pll, speed;
 
@@ -808,8 +822,8 @@ static int rtpcs_930x_sds_config_pll(struct rtpcs_ctrl *ctrl, int sds,
 	 * the state of a SerDes back to RTL930X_SDS_OFF is not (yet) implemented.
 	 */
 
-	neighbor_mode = rtpcs_930x_sds_get_internal_mode(ctrl, neighbor);
-	rtpcs_930x_sds_get_pll_data(ctrl, neighbor, &neighbor_pll, &neighbor_speed);
+	neighbor_mode = rtpcs_930x_sds_get_internal_mode(nb_sds);
+	rtpcs_930x_sds_get_pll_data(nb_sds, &neighbor_pll, &neighbor_speed);
 
 	if ((interface == PHY_INTERFACE_MODE_1000BASEX) ||
 	    (interface == PHY_INTERFACE_MODE_SGMII))
@@ -830,32 +844,32 @@ static int rtpcs_930x_sds_config_pll(struct rtpcs_ctrl *ctrl, int sds,
 		pll = RTSDS_930X_PLL_LC;
 	else if (speed == RTSDS_930X_PLL_10000) {
 		pr_info("%s: SDS %d needs LC PLL, reconfigure SDS %d to use ring PLL\n",
-			__func__, sds, neighbor);
-		rtpcs_930x_sds_reconfigure_pll(ctrl, neighbor, RTSDS_930X_PLL_RING);
+			__func__, sds->id, nb_sds->id);
+		rtpcs_930x_sds_reconfigure_pll(nb_sds, RTSDS_930X_PLL_RING);
 		pll = RTSDS_930X_PLL_LC;
 	} else
 		pll = RTSDS_930X_PLL_RING;
 
-	rtpcs_930x_sds_set_pll_data(ctrl, sds, pll, speed);
+	rtpcs_930x_sds_set_pll_data(sds, pll, speed);
 
 	if (speed_changed)
-		rtpcs_930x_sds_reset_cmu(ctrl, sds);
+		rtpcs_930x_sds_reset_cmu(sds);
 
-	pr_info("%s: SDS %d using %s PLL for %s\n", __func__, sds,
+	pr_info("%s: SDS %d using %s PLL for %s\n", __func__, sds->id,
 		pll == RTSDS_930X_PLL_LC ? "LC" : "ring", phy_modes(interface));
 
 	return 0;
 }
 
-static void rtpcs_930x_sds_reset_state_machine(struct rtpcs_ctrl *ctrl, int sds)
+static void rtpcs_930x_sds_reset_state_machine(struct rtpcs_serdes *sds)
 {
-	rtpcs_sds_write_bits(ctrl, sds, 0x06, 0x02, 12, 12, 0x01); /* SM_RESET bit */
+	rtpcs_sds_write_bits(sds, 0x06, 0x02, 12, 12, 0x01); /* SM_RESET bit */
 	usleep_range(10000, 20000);
-	rtpcs_sds_write_bits(ctrl, sds, 0x06, 0x02, 12, 12, 0x00);
+	rtpcs_sds_write_bits(sds, 0x06, 0x02, 12, 12, 0x00);
 	usleep_range(10000, 20000);
 }
 
-static int rtpcs_930x_sds_init_state_machine(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_930x_sds_init_state_machine(struct rtpcs_serdes *sds,
 					     phy_interface_t interface)
 {
 	int loopback, link, cnt = 20, ret = -EBUSY;
@@ -867,24 +881,24 @@ static int rtpcs_930x_sds_init_state_machine(struct rtpcs_ctrl *ctrl, int sds,
 	 * works properly for 10G. To verify operation readyness run a connection check via
 	 * loopback.
 	 */
-	loopback = rtpcs_sds_read_bits(ctrl, sds, 0x06, 0x01, 2, 2); /* CFG_AFE_LPK bit */
-	rtpcs_sds_write_bits(ctrl, sds, 0x06, 0x01, 2, 2, 0x01);
+	loopback = rtpcs_sds_read_bits(sds, 0x06, 0x01, 2, 2); /* CFG_AFE_LPK bit */
+	rtpcs_sds_write_bits(sds, 0x06, 0x01, 2, 2, 0x01);
 
 	while (cnt-- && ret) {
-		rtpcs_930x_sds_reset_state_machine(ctrl, sds);
-		link = rtpcs_sds_read_bits(ctrl, sds, 0x05, 0x00, 12, 12); /* 10G link state (latched) */
-		link = rtpcs_sds_read_bits(ctrl, sds, 0x05, 0x00, 12, 12);
+		rtpcs_930x_sds_reset_state_machine(sds);
+		link = rtpcs_sds_read_bits(sds, 0x05, 0x00, 12, 12); /* 10G link state (latched) */
+		link = rtpcs_sds_read_bits(sds, 0x05, 0x00, 12, 12);
 		if (link)
 			ret = 0;
 	}
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x06, 0x01, 2, 2, loopback);
-	rtpcs_930x_sds_reset_state_machine(ctrl, sds);
+	rtpcs_sds_write_bits(sds, 0x06, 0x01, 2, 2, loopback);
+	rtpcs_930x_sds_reset_state_machine(sds);
 
 	return ret;
 }
 
-static void rtpcs_930x_sds_force_mode(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_force_mode(struct rtpcs_serdes *sds,
 				      phy_interface_t interface)
 {
 	int mode;
@@ -913,38 +927,40 @@ static void rtpcs_930x_sds_force_mode(struct rtpcs_ctrl *ctrl, int sds,
 		mode = RTL930X_SDS_OFF;
 		break;
 	default:
-		pr_err("%s: SDS %d does not support %s\n", __func__, sds, phy_modes(interface));
+		pr_err("%s: SDS %d does not support %s\n", __func__,
+		       sds->id, phy_modes(interface));
 		return;
 	}
 
-	rtpcs_930x_sds_set_power(ctrl, sds, false);
-	rtpcs_930x_sds_set_internal_mode(ctrl, sds, RTL930X_SDS_OFF);
+	rtpcs_930x_sds_set_power(sds, false);
+	rtpcs_930x_sds_set_internal_mode(sds, RTL930X_SDS_OFF);
 	if (interface == PHY_INTERFACE_MODE_NA)
 		return;
 
-	if (rtpcs_930x_sds_config_pll(ctrl, sds, interface))
+	if (rtpcs_930x_sds_config_pll(sds, interface))
 		pr_err("%s: SDS %d could not configure PLL for %s\n", __func__,
-		       sds, phy_modes(interface));
+		       sds->id, phy_modes(interface));
 
-	rtpcs_930x_sds_set_internal_mode(ctrl, sds, mode);
-	if (rtpcs_930x_sds_wait_clock_ready(ctrl, sds))
-		pr_err("%s: SDS %d could not sync clock\n", __func__, sds);
+	rtpcs_930x_sds_set_internal_mode(sds, mode);
+	if (rtpcs_930x_sds_wait_clock_ready(sds))
+		pr_err("%s: SDS %d could not sync clock\n", __func__, sds->id);
 
-	if (rtpcs_930x_sds_init_state_machine(ctrl, sds, interface))
-		pr_err("%s: SDS %d could not reset state machine\n", __func__, sds);
+	if (rtpcs_930x_sds_init_state_machine(sds, interface))
+		pr_err("%s: SDS %d could not reset state machine\n", __func__,
+		       sds->id);
 
-	rtpcs_930x_sds_set_power(ctrl, sds, true);
-	rtpcs_930x_sds_rx_reset(ctrl, sds, interface);
+	rtpcs_930x_sds_set_power(sds, true);
+	rtpcs_930x_sds_rx_reset(sds, interface);
 }
 
-static void rtpcs_930x_sds_mode_set(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_mode_set(struct rtpcs_serdes *sds,
 				    phy_interface_t phy_mode)
 {
 	u32 mode;
 	u32 submode;
 
-	if (sds < 0 || sds > 11) {
-		pr_err("%s: invalid SerDes number: %d\n", __func__, sds);
+	if (sds->id < 0 || sds->id > 11) {
+		pr_err("%s: invalid SerDes number: %d\n", __func__, sds->id);
 		return;
 	}
 
@@ -953,7 +969,7 @@ static void rtpcs_930x_sds_mode_set(struct rtpcs_ctrl *ctrl, int sds,
 	case PHY_INTERFACE_MODE_1000BASEX:
 	case PHY_INTERFACE_MODE_2500BASEX:
 	case PHY_INTERFACE_MODE_10GBASER:
-		rtpcs_930x_sds_force_mode(ctrl, sds, phy_mode);
+		rtpcs_930x_sds_force_mode(sds, phy_mode);
 		return;
 	case PHY_INTERFACE_MODE_10G_QXGMII:
 		mode = RTL930X_SDS_MODE_USXGMII;
@@ -965,17 +981,17 @@ static void rtpcs_930x_sds_mode_set(struct rtpcs_ctrl *ctrl, int sds,
 	}
 
 	/* SerDes off first. */
-	rtpcs_930x_sds_set(ctrl, sds, RTL930X_SDS_OFF);
+	rtpcs_930x_sds_set(sds, RTL930X_SDS_OFF);
 
 	/* Set the mode. */
-	rtpcs_930x_sds_set(ctrl, sds, mode);
+	rtpcs_930x_sds_set(sds, mode);
 
 	/* Set the submode if needed. */
 	if (phy_mode == PHY_INTERFACE_MODE_10G_QXGMII)
-		rtpcs_930x_sds_submode_set(ctrl, sds, submode);
+		rtpcs_930x_sds_submode_set(sds, submode);
 }
 
-static void rtpcs_930x_sds_tx_config(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_tx_config(struct rtpcs_serdes *sds,
 				     phy_interface_t phy_if)
 {
 	/* parameters: rtl9303_80G_txParam_s2 */
@@ -1017,49 +1033,49 @@ static void rtpcs_930x_sds_tx_config(struct rtpcs_ctrl *ctrl, int sds,
 		return;
 	}
 
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x01, 15, 11, pre_amp);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x06,  4,  0, post_amp);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x07,  0,  0, pre_en);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x07,  3,  3, post_en);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x07,  8,  4, main_amp);
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x18, 15, 12, impedance);
+	rtpcs_sds_write_bits(sds, page, 0x01, 15, 11, pre_amp);
+	rtpcs_sds_write_bits(sds, page, 0x06,  4,  0, post_amp);
+	rtpcs_sds_write_bits(sds, page, 0x07,  0,  0, pre_en);
+	rtpcs_sds_write_bits(sds, page, 0x07,  3,  3, post_en);
+	rtpcs_sds_write_bits(sds, page, 0x07,  8,  4, main_amp);
+	rtpcs_sds_write_bits(sds, page, 0x18, 15, 12, impedance);
 }
 
 __always_unused
-static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_serdes *sds,
 					     u32 dcvs_id, bool manual, u32 dvcs_list[])
 {
 	if (manual) {
 		switch (dcvs_id) {
 		case 0:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 14, 14, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x03,  5,  5, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x03,  4,  0, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 14, 14, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x03,  5,  5, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x03,  4,  0, dvcs_list[1]);
 			break;
 		case 1:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 13, 13, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d, 15, 15, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d, 14, 11, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 13, 13, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 15, 15, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 14, 11, dvcs_list[1]);
 			break;
 		case 2:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 12, 12, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d, 10, 10, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d,  9,  6, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 12, 12, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 10, 10, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d,  9,  6, dvcs_list[1]);
 			break;
 		case 3:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 11, 11, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d,  5,  5, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1d,  4,  1, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 11, 11, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d,  5,  5, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d,  4,  1, dvcs_list[1]);
 			break;
 		case 4:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x01, 15, 15, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x11, 10, 10, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x11,  9,  6, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x01, 15, 15, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x11, 10, 10, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x11,  9,  6, dvcs_list[1]);
 			break;
 		case 5:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x02, 11, 11, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x11,  4,  4, dvcs_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x11,  3,  0, dvcs_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x02, 11, 11, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x11,  4,  4, dvcs_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x11,  3,  0, dvcs_list[1]);
 			break;
 		default:
 			break;
@@ -1067,22 +1083,22 @@ static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_ctrl *ctrl, u32 sds_nu
 	} else {
 		switch (dcvs_id) {
 		case 0:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 14, 14, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 14, 14, 0x0);
 			break;
 		case 1:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 13, 13, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 13, 13, 0x0);
 			break;
 		case 2:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 12, 12, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 12, 12, 0x0);
 			break;
 		case 3:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x1e, 11, 11, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 11, 11, 0x0);
 			break;
 		case 4:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x01, 15, 15, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x01, 15, 15, 0x0);
 			break;
 		case 5:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x02, 11, 11, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x02, 11, 11, 0x0);
 			break;
 		default:
 			break;
@@ -1092,81 +1108,82 @@ static void rtpcs_930x_sds_rxcal_dcvs_manual(struct rtpcs_ctrl *ctrl, u32 sds_nu
 }
 
 __always_unused
-static void rtpcs_930x_sds_rxcal_dcvs_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_dcvs_get(struct rtpcs_serdes *sds,
 					  u32 dcvs_id, u32 dcvs_list[])
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 dcvs_sign_out = 0, dcvs_coef_bin = 0;
 	bool dcvs_manual;
 
-	if (!(sds_num % 2))
-		rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+	if (sds == even_sds)
+		rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 	else
-		rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 	/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 
 	/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[1 0 x x x x] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x20);
+	rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x20);
 
 	switch (dcvs_id) {
 	case 0:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x22);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x22);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x1e, 14, 14);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x1e, 14, 14);
 		break;
 
 	case 1:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x23);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x23);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x1e, 13, 13);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x1e, 13, 13);
 		break;
 
 	case 2:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x24);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x24);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x1e, 12, 12);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x1e, 12, 12);
 		break;
 	case 3:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x25);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x25);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual   = rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x1e, 11, 11);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual   = rtpcs_sds_read_bits(sds, 0x2e, 0x1e, 11, 11);
 		break;
 
 	case 4:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x2c);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x2c);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x01, 15, 15);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x01, 15, 15);
 		break;
 
 	case 5:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0x2d);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0x2d);
 		mdelay(1);
 
 		/* ##DCVS0 Read Out */
-		dcvs_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  4,  4);
-		dcvs_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14,  3,  0);
-		dcvs_manual   = rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x02, 11, 11);
+		dcvs_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  4,  4);
+		dcvs_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14,  3,  0);
+		dcvs_manual   = rtpcs_sds_read_bits(sds, 0x2e, 0x02, 11, 11);
 		break;
 
 	default:
@@ -1185,26 +1202,25 @@ static void rtpcs_930x_sds_rxcal_dcvs_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
 	dcvs_list[1] = dcvs_coef_bin;
 }
 
-static void rtpcs_930x_sds_rxcal_leq_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_leq_manual(struct rtpcs_serdes *sds,
 					    bool manual, u32 leq_gray)
 {
 	if (manual) {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x18, 15, 15, 0x1);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x16, 14, 10, leq_gray);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x18, 15, 15, 0x1);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x16, 14, 10, leq_gray);
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x18, 15, 15, 0x0);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x18, 15, 15, 0x0);
 		mdelay(100);
 	}
 }
 
-static void rtpcs_930x_sds_rxcal_leq_offset_manual(struct rtpcs_ctrl *ctrl,
-						   u32 sds_num, bool manual,
-						   u32 offset)
+static void rtpcs_930x_sds_rxcal_leq_offset_manual(struct rtpcs_serdes *sds,
+						   bool manual, u32 offset)
 {
 	if (manual) {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 6, 2, offset);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x17, 6, 2, offset);
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 6, 2, offset);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x17, 6, 2, offset);
 		mdelay(1);
 	}
 }
@@ -1236,26 +1252,27 @@ static u32 rtpcs_930x_sds_rxcal_gray_to_binary(u32 gray_code)
 	return leq_binary;
 }
 
-static u32 rtpcs_930x_sds_rxcal_leq_read(struct rtpcs_ctrl *ctrl, int sds_num)
+static u32 rtpcs_930x_sds_rxcal_leq_read(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 leq_gray, leq_bin;
 	bool leq_manual;
 
-	if (!(sds_num % 2))
-		rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+	if (sds == even_sds)
+		rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 	else
-		rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 	/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 
 	/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[0 1 x x x x] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x10);
+	rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x10);
 	mdelay(1);
 
 	/* ##LEQ Read Out */
-	leq_gray = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 7, 3);
-	leq_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x18, 15, 15);
+	leq_gray = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 7, 3);
+	leq_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x18, 15, 15);
 	leq_bin = rtpcs_930x_sds_rxcal_gray_to_binary(leq_gray);
 
 	pr_info("LEQ_gray: %u, LEQ_bin: %u", leq_gray, leq_bin);
@@ -1264,102 +1281,104 @@ static u32 rtpcs_930x_sds_rxcal_leq_read(struct rtpcs_ctrl *ctrl, int sds_num)
 	return leq_bin;
 }
 
-static void rtpcs_930x_sds_rxcal_vth_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_vth_manual(struct rtpcs_serdes *sds,
 					    bool manual, u32 vth_list[])
 {
 	if (manual) {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, 13, 13, 0x1);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x13,  5,  3, vth_list[0]);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x13,  2,  0, vth_list[1]);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x0f, 13, 13, 0x1);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x13,  5,  3, vth_list[0]);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x13,  2,  0, vth_list[1]);
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, 13, 13, 0x0);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x0f, 13, 13, 0x0);
 		mdelay(10);
 	}
 }
 
-static void rtpcs_930x_sds_rxcal_vth_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_vth_get(struct rtpcs_serdes *sds,
 					 u32 vth_list[])
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 vth_manual;
 
 	/* ##Page0x1F, Reg0x02[15 0], REG_DBGO_SEL=[0x002F]; */ /* Lane0 */
 	/* ##Page0x1F, Reg0x02[15 0], REG_DBGO_SEL=[0x0031]; */ /* Lane1 */
-	if (!(sds_num % 2))
-		rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+	if (sds == even_sds)
+		rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 	else
-		rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 	/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 	/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[1 0 x x x x] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x20);
+	rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x20);
 	/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 1 1 0 0] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0xc);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0xc);
 
 	mdelay(1);
 
 	/* ##VthP & VthN Read Out */
-	vth_list[0] = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 2, 0); /* v_thp set bin */
-	vth_list[1] = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 3); /* v_thn set bin */
+	vth_list[0] = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 2, 0); /* v_thp set bin */
+	vth_list[1] = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 3); /* v_thn set bin */
 
 	pr_info("vth_set_bin = %d", vth_list[0]);
 	pr_info("vth_set_bin = %d", vth_list[1]);
 
-	vth_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x0f, 13, 13);
+	vth_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x0f, 13, 13);
 	pr_info("Vth Maunal = %d", vth_manual);
 }
 
-static void rtpcs_930x_sds_rxcal_tap_manual(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_tap_manual(struct rtpcs_serdes *sds,
 					    int tap_id, bool manual, u32 tap_list[])
 {
 	if (manual) {
 		switch (tap_id) {
 		case 0:
 			/* ##REG0_LOAD_IN_INIT[0]=1; REG0_TAP0_INIT[5:0]=Tap0_Value */
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x03, 5, 5, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x03, 4, 0, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x03, 5, 5, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x03, 4, 0, tap_list[1]);
 			break;
 		case 1:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x07, 6, 6, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x09, 11, 6, tap_list[1]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x07, 5, 5, tap_list[2]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x12, 5, 0, tap_list[3]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x21, 0x07, 6, 6, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x09, 11, 6, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x21, 0x07, 5, 5, tap_list[2]);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x12, 5, 0, tap_list[3]);
 			break;
 		case 2:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x09, 5, 5, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x09, 4, 0, tap_list[1]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0a, 11, 11, tap_list[2]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0a, 10, 6, tap_list[3]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x09, 5, 5, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x09, 4, 0, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 11, 11, tap_list[2]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 10, 6, tap_list[3]);
 			break;
 		case 3:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0a, 5, 5, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0a, 4, 0, tap_list[1]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x06, 5, 5, tap_list[2]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x06, 4, 0, tap_list[3]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 5, 5, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 4, 0, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x06, 5, 5, tap_list[2]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x06, 4, 0, tap_list[3]);
 			break;
 		case 4:
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x01, 5, 5, tap_list[0]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x01, 4, 0, tap_list[1]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x06, 11, 11, tap_list[2]);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x06, 10, 6, tap_list[3]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x01, 5, 5, tap_list[0]);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x01, 4, 0, tap_list[1]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x06, 11, 11, tap_list[2]);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x06, 10, 6, tap_list[3]);
 			break;
 		default:
 			break;
 		}
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x0);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7, 0x0);
 		mdelay(10);
 	}
 }
 
-static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_serdes *sds,
 					 u32 tap_id, u32 tap_list[])
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 tap0_sign_out;
 	u32 tap0_coef_bin;
 	u32 tap_sign_out_even;
@@ -1368,23 +1387,23 @@ static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
 	u32 tap_coef_bin_odd;
 	bool tap_manual;
 
-	if (!(sds_num % 2))
-		rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+	if (sds == even_sds)
+		rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 	else
-		rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 	/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 	/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[1 0 x x x x] */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x20);
+	rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x20);
 
 	if (!tap_id) {
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 0 0 0 1] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0);
 		/* ##Tap1 Even Read Out */
 		mdelay(1);
-		tap0_sign_out = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 5);
-		tap0_coef_bin = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 4, 0);
+		tap0_sign_out = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 5);
+		tap0_coef_bin = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 4, 0);
 
 		if (tap0_sign_out == 1)
 			pr_info("Tap0 Sign : -");
@@ -1396,21 +1415,21 @@ static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
 		tap_list[0] = tap0_sign_out;
 		tap_list[1] = tap0_coef_bin;
 
-		tap_manual = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x0f, 7, 7);
+		tap_manual = !!rtpcs_sds_read_bits(sds, 0x2e, 0x0f, 7, 7);
 		pr_info("tap0 manual = %u", tap_manual);
 	} else {
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 0 0 0 1] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, tap_id);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, tap_id);
 		mdelay(1);
 		/* ##Tap1 Even Read Out */
-		tap_sign_out_even = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 5);
-		tap_coef_bin_even = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 4, 0);
+		tap_sign_out_even = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 5);
+		tap_coef_bin_even = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 4, 0);
 
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 0 1 1 0] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, (tap_id + 5));
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, (tap_id + 5));
 		/* ##Tap1 Odd Read Out */
-		tap_sign_out_odd = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 5);
-		tap_coef_bin_odd = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 4, 0);
+		tap_sign_out_odd = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 5);
+		tap_coef_bin_odd = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 4, 0);
 
 		if (tap_sign_out_even == 1)
 			pr_info("Tap %u even sign: -", tap_id);
@@ -1431,82 +1450,82 @@ static void rtpcs_930x_sds_rxcal_tap_get(struct rtpcs_ctrl *ctrl, u32 sds_num,
 		tap_list[2] = tap_sign_out_odd;
 		tap_list[3] = tap_coef_bin_odd;
 
-		tap_manual = rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x0f, tap_id + 7, tap_id + 7);
+		tap_manual = rtpcs_sds_read_bits(sds, 0x2e, 0x0f, tap_id + 7, tap_id + 7);
 		pr_info("tap %u manual = %d", tap_id, tap_manual);
 	}
 }
 
 __always_unused
-static void rtpcs_930x_sds_do_rx_calibration_1(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_do_rx_calibration_1(struct rtpcs_serdes *sds,
 					       phy_interface_t phy_mode)
 {
 	/* From both rtl9300_rxCaliConf_serdes_myParam and rtl9300_rxCaliConf_phy_myParam */
 	int tap0_init_val = 0x1f; /* Initial Decision Fed Equalizer 0 tap */
 	int vth_min       = 0x0;
 
-	pr_info("start_1.1.1 initial value for sds %d\n", sds);
-	rtpcs_sds_write(ctrl, sds, 6,  0, 0);
+	pr_info("start_1.1.1 initial value for sds %d\n", sds->id);
+	rtpcs_sds_write(sds, 6,  0, 0);
 
 	/* FGCAL */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x01, 14, 14, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1c, 10,  5, 0x20);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x02,  0,  0, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x01, 14, 14, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1c, 10,  5, 0x20);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x02,  0,  0, 0x01);
 
 	/* DCVS */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1e, 14, 11, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x01, 15, 15, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x02, 11, 11, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1c,  4,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1d, 15, 11, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1d, 10,  6, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1d,  5,  1, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x02, 10,  6, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x11,  4,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x00,  3,  0, 0x0f);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x04,  6,  6, 0x01);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x04,  7,  7, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1e, 14, 11, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x01, 15, 15, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x02, 11, 11, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1c,  4,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 15, 11, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 10,  6, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x1d,  5,  1, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x02, 10,  6, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x11,  4,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x00,  3,  0, 0x0f);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x04,  6,  6, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x04,  7,  7, 0x01);
 
 	/* LEQ (Long Term Equivalent signal level) */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x16, 14,  8, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x16, 14,  8, 0x00);
 
 	/* DFE (Decision Fed Equalizer) */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x03,  5,  0, tap0_init_val);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x09, 11,  6, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x09,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0a,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x01,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x12,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0a, 11,  6, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x06,  5,  0, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x01,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x03,  5,  0, tap0_init_val);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x09, 11,  6, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x09,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0a,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x01,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x12,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0a, 11,  6, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x06,  5,  0, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x01,  5,  0, 0x00);
 
 	/* Vth */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x13,  5,  3, 0x07);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x13,  2,  0, 0x07);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x0b,  5,  3, vth_min);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x13,  5,  3, 0x07);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x13,  2,  0, 0x07);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x0b,  5,  3, vth_min);
 
 	pr_info("end_1.1.1 --\n");
 
 	pr_info("start_1.1.2 Load DFE init. value\n");
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0f, 13,  7, 0x7f);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0f, 13,  7, 0x7f);
 
 	pr_info("end_1.1.2\n");
 
 	pr_info("start_1.1.3 disable LEQ training,enable DFE clock\n");
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x17,  7,  7, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x17,  6,  2, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0c,  8,  8, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0b,  4,  4, 0x01);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x12, 14, 14, 0x00);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x02, 15, 15, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x17,  7,  7, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x17,  6,  2, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0c,  8,  8, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0b,  4,  4, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x12, 14, 14, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x02, 15, 15, 0x00);
 
 	pr_info("end_1.1.3 --\n");
 
 	pr_info("start_1.1.4 offset cali setting\n");
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0f, 15, 14, 0x03);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0f, 15, 14, 0x03);
 
 	pr_info("end_1.1.4\n");
 
@@ -1517,76 +1536,74 @@ static void rtpcs_930x_sds_do_rx_calibration_1(struct rtpcs_ctrl *ctrl, int sds,
 	if (phy_mode == PHY_INTERFACE_MODE_10GBASER ||
 	    phy_mode == PHY_INTERFACE_MODE_1000BASEX ||
 	    phy_mode == PHY_INTERFACE_MODE_SGMII)
-		rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x16,  3,  2, 0x02);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x16,  3,  2, 0x02);
 	else
 		pr_err("%s not PHY-based or SerDes, implement DAC!\n", __func__);
 
 	/* No serdes, check for Aquantia PHYs */
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x16,  3,  2, 0x02);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x16,  3,  2, 0x02);
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0f,  6,  0, 0x5f);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x05,  7,  2, 0x1f);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x19,  9,  5, 0x1f);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x0b, 15,  9, 0x3c);
-	rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x0b,  1,  0, 0x03);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0f,  6,  0, 0x5f);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x05,  7,  2, 0x1f);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x19,  9,  5, 0x1f);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x0b, 15,  9, 0x3c);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x0b,  1,  0, 0x03);
 
 	pr_info("end_1.1.5\n");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_2_1(struct rtpcs_ctrl *ctrl,
-						 u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_2_1(struct rtpcs_serdes *sds)
 {
 	pr_info("start_1.2.1 ForegroundOffsetCal_Manual\n");
 
 	/* Gray config endis to 1 */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x02,  2,  2, 0x01);
+	rtpcs_sds_write_bits(sds, 0x2f, 0x02,  2,  2, 0x01);
 
 	/* ForegroundOffsetCal_Manual(auto mode) */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x01, 14, 14, 0x00);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x01, 14, 14, 0x00);
 
 	pr_info("end_1.2.1");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_2_2(struct rtpcs_ctrl *ctrl,
-						 int sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_2_2(struct rtpcs_serdes *sds)
 {
 	/* Force Rx-Run = 0 */
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 8, 8, 0x0);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x15, 8, 8, 0x0);
 
-	rtpcs_930x_sds_rx_reset(ctrl, sds_num, PHY_INTERFACE_MODE_10GBASER);
+	rtpcs_930x_sds_rx_reset(sds, PHY_INTERFACE_MODE_10GBASER);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_2_3(struct rtpcs_ctrl *ctrl,
-						 int sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_2_3(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	u32 fgcal_binary, fgcal_gray;
 	u32 offset_range;
 
 	pr_info("start_1.2.3 Foreground Calibration\n");
 
 	while (1) {
-		if (!(sds_num % 2))
-			rtpcs_sds_write(ctrl, sds_num, 0x1f, 0x2, 0x2f);
+		if (sds == even_sds)
+			rtpcs_sds_write(sds, 0x1f, 0x2, 0x2f);
 		else
-			rtpcs_sds_write(ctrl, sds_num - 1, 0x1f, 0x2, 0x31);
+			rtpcs_sds_write(even_sds, 0x1f, 0x2, 0x31);
 
 		/* ##Page0x2E, Reg0x15[9], REG0_RX_EN_TEST=[1] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 9, 9, 0x1);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x15, 9, 9, 0x1);
 		/* ##Page0x21, Reg0x06[11 6], REG0_RX_DEBUG_SEL=[1 0 x x x x] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x21, 0x06, 11, 6, 0x20);
+		rtpcs_sds_write_bits(sds, 0x21, 0x06, 11, 6, 0x20);
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 1 1 1 1] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0xf);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0xf);
 		/* ##FGCAL read gray */
-		fgcal_gray = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 0);
+		fgcal_gray = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 0);
 		/* ##Page0x2F, Reg0x0C[5 0], REG0_COEF_SEL=[0 0 1 1 1 0] */
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2f, 0x0c, 5, 0, 0xe);
+		rtpcs_sds_write_bits(sds, 0x2f, 0x0c, 5, 0, 0xe);
 		/* ##FGCAL read binary */
-		fgcal_binary = rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 5, 0);
+		fgcal_binary = rtpcs_sds_read_bits(sds, 0x1f, 0x14, 5, 0);
 
 		pr_info("%s: fgcal_gray: %d, fgcal_binary %d\n",
 			__func__, fgcal_gray, fgcal_binary);
 
-		offset_range = rtpcs_sds_read_bits(ctrl, sds_num, 0x2e, 0x15, 15, 14);
+		offset_range = rtpcs_sds_read_bits(sds, 0x2e, 0x15, 15, 14);
 
 		if (fgcal_binary <= 60 && fgcal_binary >= 3)
 			break;
@@ -1597,22 +1614,22 @@ static void rtpcs_930x_sds_do_rx_calibration_2_3(struct rtpcs_ctrl *ctrl,
 		}
 
 		offset_range++;
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x15, 15, 14, offset_range);
-		rtpcs_930x_sds_do_rx_calibration_2_2(ctrl, sds_num);
+		rtpcs_sds_write_bits(sds, 0x2e, 0x15, 15, 14, offset_range);
+		rtpcs_930x_sds_do_rx_calibration_2_2(sds);
 	}
 	pr_info("%s: end_1.2.3\n", __func__);
 }
 
 __always_unused
-static void rtpcs_930x_sds_do_rx_calibration_2(struct rtpcs_ctrl *ctrl, int sds)
+static void rtpcs_930x_sds_do_rx_calibration_2(struct rtpcs_serdes *sds)
 {
-	rtpcs_930x_sds_rx_reset(ctrl, sds, PHY_INTERFACE_MODE_10GBASER);
-	rtpcs_930x_sds_do_rx_calibration_2_1(ctrl, sds);
-	rtpcs_930x_sds_do_rx_calibration_2_2(ctrl, sds);
-	rtpcs_930x_sds_do_rx_calibration_2_3(ctrl, sds);
+	rtpcs_930x_sds_rx_reset(sds, PHY_INTERFACE_MODE_10GBASER);
+	rtpcs_930x_sds_do_rx_calibration_2_1(sds);
+	rtpcs_930x_sds_do_rx_calibration_2_2(sds);
+	rtpcs_930x_sds_do_rx_calibration_2_3(sds);
 }
 
-static void rtpcs_930x_sds_rxcal_3_1(struct rtpcs_ctrl *ctrl, int sds_num,
+static void rtpcs_930x_sds_rxcal_3_1(struct rtpcs_serdes *sds,
 				     phy_interface_t phy_mode)
 {
 	pr_info("start_1.3.1");
@@ -1621,15 +1638,15 @@ static void rtpcs_930x_sds_rxcal_3_1(struct rtpcs_ctrl *ctrl, int sds_num,
 	if (phy_mode != PHY_INTERFACE_MODE_10GBASER &&
 	    phy_mode != PHY_INTERFACE_MODE_1000BASEX &&
 	    phy_mode != PHY_INTERFACE_MODE_SGMII)
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0xc, 8, 8, 0);
+		rtpcs_sds_write_bits(sds, 0x2e, 0xc, 8, 8, 0);
 
-	rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 7, 7, 0x0);
-	rtpcs_930x_sds_rxcal_leq_manual(ctrl, sds_num, false, 0);
+	rtpcs_sds_write_bits(sds, 0x2e, 0x17, 7, 7, 0x0);
+	rtpcs_930x_sds_rxcal_leq_manual(sds, false, 0);
 
 	pr_info("end_1.3.1");
 }
 
-static void rtpcs_930x_sds_rxcal_3_2(struct rtpcs_ctrl *ctrl, int sds_num,
+static void rtpcs_930x_sds_rxcal_3_2(struct rtpcs_serdes *sds,
 				     phy_interface_t phy_mode)
 {
 	u32 sum10 = 0, avg10, int10;
@@ -1655,7 +1672,7 @@ static void rtpcs_930x_sds_rxcal_3_2(struct rtpcs_ctrl *ctrl, int sds_num,
 	pr_info("start_1.3.2");
 
 	for (i = 0; i < 10; i++) {
-		sum10 += rtpcs_930x_sds_rxcal_leq_read(ctrl, sds_num);
+		sum10 += rtpcs_930x_sds_rxcal_leq_read(sds);
 		mdelay(10);
 	}
 
@@ -1668,46 +1685,46 @@ static void rtpcs_930x_sds_rxcal_3_2(struct rtpcs_ctrl *ctrl, int sds_num,
 	    phy_mode == PHY_INTERFACE_MODE_1000BASEX ||
 	    phy_mode == PHY_INTERFACE_MODE_SGMII) {
 		if (dac_long_cable_offset) {
-			rtpcs_930x_sds_rxcal_leq_offset_manual(ctrl, sds_num, 1,
+			rtpcs_930x_sds_rxcal_leq_offset_manual(sds, 1,
 							       dac_long_cable_offset);
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 7, 7,
+			rtpcs_sds_write_bits(sds, 0x2e, 0x17, 7, 7,
 					     eq_hold_enabled);
 			if (phy_mode == PHY_INTERFACE_MODE_10GBASER)
-				rtpcs_930x_sds_rxcal_leq_manual(ctrl, sds_num,
+				rtpcs_930x_sds_rxcal_leq_manual(sds,
 								true, avg10);
 		} else {
 			if (sum10 >= 5) {
-				rtpcs_930x_sds_rxcal_leq_offset_manual(ctrl, sds_num, 1, 3);
-				rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 7, 7, 0x1);
+				rtpcs_930x_sds_rxcal_leq_offset_manual(sds, 1, 3);
+				rtpcs_sds_write_bits(sds, 0x2e, 0x17, 7, 7, 0x1);
 				if (phy_mode == PHY_INTERFACE_MODE_10GBASER)
-					rtpcs_930x_sds_rxcal_leq_manual(ctrl, sds_num, true, avg10);
+					rtpcs_930x_sds_rxcal_leq_manual(sds, true, avg10);
 			} else {
-				rtpcs_930x_sds_rxcal_leq_offset_manual(ctrl, sds_num, 1, 0);
-				rtpcs_sds_write_bits(ctrl, sds_num, 0x2e, 0x17, 7, 7, 0x1);
+				rtpcs_930x_sds_rxcal_leq_offset_manual(sds, 1, 0);
+				rtpcs_sds_write_bits(sds, 0x2e, 0x17, 7, 7, 0x1);
 				if (phy_mode == PHY_INTERFACE_MODE_10GBASER)
-					rtpcs_930x_sds_rxcal_leq_manual(ctrl, sds_num, true, avg10);
+					rtpcs_930x_sds_rxcal_leq_manual(sds, true, avg10);
 			}
 		}
 	}
 
-	pr_info("Sds:%u LEQ = %u", sds_num, rtpcs_930x_sds_rxcal_leq_read(ctrl, sds_num));
+	pr_info("Sds:%u LEQ = %u", sds->id, rtpcs_930x_sds_rxcal_leq_read(sds));
 
 	pr_info("end_1.3.2");
 }
 
 __always_unused
-static void rtpcs_930x_sds_do_rx_calibration_3(struct rtpcs_ctrl *ctrl, int sds_num,
+static void rtpcs_930x_sds_do_rx_calibration_3(struct rtpcs_serdes *sds,
 					       phy_interface_t phy_mode)
 {
-	rtpcs_930x_sds_rxcal_3_1(ctrl, sds_num, phy_mode);
+	rtpcs_930x_sds_rxcal_3_1(sds, phy_mode);
 
 	if (phy_mode == PHY_INTERFACE_MODE_10GBASER ||
 	    phy_mode == PHY_INTERFACE_MODE_1000BASEX ||
 	    phy_mode == PHY_INTERFACE_MODE_SGMII)
-		rtpcs_930x_sds_rxcal_3_2(ctrl, sds_num, phy_mode);
+		rtpcs_930x_sds_rxcal_3_2(sds, phy_mode);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_4_1(struct rtpcs_ctrl *ctrl, int sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_4_1(struct rtpcs_serdes *sds)
 {
 	u32 vth_list[2] = {0, 0};
 	u32 tap0_list[4] = {0, 0, 0, 0};
@@ -1715,38 +1732,38 @@ static void rtpcs_930x_sds_do_rx_calibration_4_1(struct rtpcs_ctrl *ctrl, int sd
 	pr_info("start_1.4.1");
 
 	/* ##1.4.1 */
-	rtpcs_930x_sds_rxcal_vth_manual(ctrl, sds_num, false, vth_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 0, false, tap0_list);
+	rtpcs_930x_sds_rxcal_vth_manual(sds, false, vth_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 0, false, tap0_list);
 	mdelay(200);
 
 	pr_info("end_1.4.1");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_4_2(struct rtpcs_ctrl *ctrl, u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_4_2(struct rtpcs_serdes *sds)
 {
 	u32 vth_list[2];
 	u32 tap_list[4];
 
 	pr_info("start_1.4.2");
 
-	rtpcs_930x_sds_rxcal_vth_get(ctrl, sds_num, vth_list);
-	rtpcs_930x_sds_rxcal_vth_manual(ctrl, sds_num, true, vth_list);
+	rtpcs_930x_sds_rxcal_vth_get(sds, vth_list);
+	rtpcs_930x_sds_rxcal_vth_manual(sds, true, vth_list);
 
 	mdelay(100);
 
-	rtpcs_930x_sds_rxcal_tap_get(ctrl, sds_num, 0, tap_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 0, true, tap_list);
+	rtpcs_930x_sds_rxcal_tap_get(sds, 0, tap_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 0, true, tap_list);
 
 	pr_info("end_1.4.2");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_4(struct rtpcs_ctrl *ctrl, u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_4(struct rtpcs_serdes *sds)
 {
-	rtpcs_930x_sds_do_rx_calibration_4_1(ctrl, sds_num);
-	rtpcs_930x_sds_do_rx_calibration_4_2(ctrl, sds_num);
+	rtpcs_930x_sds_do_rx_calibration_4_1(sds);
+	rtpcs_930x_sds_do_rx_calibration_4_2(sds);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_5_2(struct rtpcs_ctrl *ctrl, u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_5_2(struct rtpcs_serdes *sds)
 {
 	u32 tap1_list[4] = {0};
 	u32 tap2_list[4] = {0};
@@ -1755,64 +1772,64 @@ static void rtpcs_930x_sds_do_rx_calibration_5_2(struct rtpcs_ctrl *ctrl, u32 sd
 
 	pr_info("start_1.5.2");
 
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 1, false, tap1_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 2, false, tap2_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 3, false, tap3_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 4, false, tap4_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 1, false, tap1_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 2, false, tap2_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 3, false, tap3_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 4, false, tap4_list);
 
 	mdelay(30);
 
 	pr_info("end_1.5.2");
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_5(struct rtpcs_ctrl *ctrl, u32 sds_num,
+static void rtpcs_930x_sds_do_rx_calibration_5(struct rtpcs_serdes *sds,
 					       phy_interface_t phy_mode)
 {
 	if (phy_mode == PHY_INTERFACE_MODE_10GBASER) /* dfeTap1_4Enable true */
-		rtpcs_930x_sds_do_rx_calibration_5_2(ctrl, sds_num);
+		rtpcs_930x_sds_do_rx_calibration_5_2(sds);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_dfe_disable(struct rtpcs_ctrl *ctrl, u32 sds_num)
+static void rtpcs_930x_sds_do_rx_calibration_dfe_disable(struct rtpcs_serdes *sds)
 {
 	u32 tap1_list[4] = {0};
 	u32 tap2_list[4] = {0};
 	u32 tap3_list[4] = {0};
 	u32 tap4_list[4] = {0};
 
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 1, true, tap1_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 2, true, tap2_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 3, true, tap3_list);
-	rtpcs_930x_sds_rxcal_tap_manual(ctrl, sds_num, 4, true, tap4_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 1, true, tap1_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 2, true, tap2_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 3, true, tap3_list);
+	rtpcs_930x_sds_rxcal_tap_manual(sds, 4, true, tap4_list);
 
 	mdelay(10);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration(struct rtpcs_ctrl *ctrl, int sds,
+static void rtpcs_930x_sds_do_rx_calibration(struct rtpcs_serdes *sds,
 					     phy_interface_t phy_mode)
 {
 	u32 latch_sts;
 
-	rtpcs_930x_sds_do_rx_calibration_1(ctrl, sds, phy_mode);
-	rtpcs_930x_sds_do_rx_calibration_2(ctrl, sds);
-	rtpcs_930x_sds_do_rx_calibration_4(ctrl, sds);
-	rtpcs_930x_sds_do_rx_calibration_5(ctrl, sds, phy_mode);
+	rtpcs_930x_sds_do_rx_calibration_1(sds, phy_mode);
+	rtpcs_930x_sds_do_rx_calibration_2(sds);
+	rtpcs_930x_sds_do_rx_calibration_4(sds);
+	rtpcs_930x_sds_do_rx_calibration_5(sds, phy_mode);
 	mdelay(20);
 
 	/* Do this only for 10GR mode, SDS active in mode 0x1a */
-	if (rtpcs_sds_read_bits(ctrl, sds, 0x1f, 9, 11, 7) == RTL930X_SDS_MODE_10GBASER) {
+	if (rtpcs_sds_read_bits(sds, 0x1f, 9, 11, 7) == RTL930X_SDS_MODE_10GBASER) {
 		pr_info("%s: SDS enabled\n", __func__);
-		latch_sts = rtpcs_sds_read_bits(ctrl, sds, 0x4, 1, 2, 2);
+		latch_sts = rtpcs_sds_read_bits(sds, 0x4, 1, 2, 2);
 		mdelay(1);
-		latch_sts = rtpcs_sds_read_bits(ctrl, sds, 0x4, 1, 2, 2);
+		latch_sts = rtpcs_sds_read_bits(sds, 0x4, 1, 2, 2);
 		if (latch_sts) {
-			rtpcs_930x_sds_do_rx_calibration_dfe_disable(ctrl, sds);
-			rtpcs_930x_sds_do_rx_calibration_4(ctrl, sds);
-			rtpcs_930x_sds_do_rx_calibration_5(ctrl, sds, phy_mode);
+			rtpcs_930x_sds_do_rx_calibration_dfe_disable(sds);
+			rtpcs_930x_sds_do_rx_calibration_4(sds);
+			rtpcs_930x_sds_do_rx_calibration_5(sds, phy_mode);
 		}
 	}
 }
 
-static int rtpcs_930x_sds_sym_err_reset(struct rtpcs_ctrl *ctrl, int sds_num,
+static int rtpcs_930x_sds_sym_err_reset(struct rtpcs_serdes *sds,
 					phy_interface_t phy_mode)
 {
 	switch (phy_mode) {
@@ -1821,16 +1838,16 @@ static int rtpcs_930x_sds_sym_err_reset(struct rtpcs_ctrl *ctrl, int sds_num,
 
 	case PHY_INTERFACE_MODE_10GBASER:
 		/* Read twice to clear */
-		rtpcs_sds_read(ctrl, sds_num, 5, 1);
-		rtpcs_sds_read(ctrl, sds_num, 5, 1);
+		rtpcs_sds_read(sds, 5, 1);
+		rtpcs_sds_read(sds, 5, 1);
 		break;
 
 	case PHY_INTERFACE_MODE_1000BASEX:
 	case PHY_INTERFACE_MODE_SGMII:
 	case PHY_INTERFACE_MODE_10G_QXGMII:
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x1, 24, 2, 0, 0);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x1, 3, 15, 8, 0);
-		rtpcs_sds_write_bits(ctrl, sds_num, 0x1, 2, 15, 0, 0);
+		rtpcs_sds_write_bits(sds, 0x1, 24, 2, 0, 0);
+		rtpcs_sds_write_bits(sds, 0x1, 3, 15, 8, 0);
+		rtpcs_sds_write_bits(sds, 0x1, 2, 15, 0, 0);
 		break;
 
 	default:
@@ -1841,7 +1858,7 @@ static int rtpcs_930x_sds_sym_err_reset(struct rtpcs_ctrl *ctrl, int sds_num,
 	return 0;
 }
 
-static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_ctrl *ctrl, int sds_num,
+static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_serdes *sds,
 				      phy_interface_t phy_mode)
 {
 	u32 v = 0;
@@ -1854,7 +1871,7 @@ static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_ctrl *ctrl, int sds_num,
 	case PHY_INTERFACE_MODE_1000BASEX:
 	case PHY_INTERFACE_MODE_SGMII:
 	case PHY_INTERFACE_MODE_10GBASER:
-		v = rtpcs_sds_read(ctrl, sds_num, 5, 1);
+		v = rtpcs_sds_read(sds, 5, 1);
 		return v & 0xff;
 
 	default:
@@ -1864,18 +1881,18 @@ static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_ctrl *ctrl, int sds_num,
 	return v;
 }
 
-static int rtpcs_930x_sds_check_calibration(struct rtpcs_ctrl *ctrl, int sds_num,
+static int rtpcs_930x_sds_check_calibration(struct rtpcs_serdes *sds,
 					    phy_interface_t phy_mode)
 {
 	u32 errors1, errors2;
 
-	rtpcs_930x_sds_sym_err_reset(ctrl, sds_num, phy_mode);
-	rtpcs_930x_sds_sym_err_reset(ctrl, sds_num, phy_mode);
+	rtpcs_930x_sds_sym_err_reset(sds, phy_mode);
+	rtpcs_930x_sds_sym_err_reset(sds, phy_mode);
 
 	/* Count errors during 1ms */
-	errors1 = rtpcs_930x_sds_sym_err_get(ctrl, sds_num, phy_mode);
+	errors1 = rtpcs_930x_sds_sym_err_get(sds, phy_mode);
 	mdelay(1);
-	errors2 = rtpcs_930x_sds_sym_err_get(ctrl, sds_num, phy_mode);
+	errors2 = rtpcs_930x_sds_sym_err_get(sds, phy_mode);
 
 	switch (phy_mode) {
 	case PHY_INTERFACE_MODE_1000BASEX:
@@ -1901,44 +1918,46 @@ static int rtpcs_930x_sds_check_calibration(struct rtpcs_ctrl *ctrl, int sds_num
 	return 0;
 }
 
-static void rtpcs_930x_phy_enable_10g_1g(struct rtpcs_ctrl *ctrl, int sds_num)
+static void rtpcs_930x_phy_enable_10g_1g(struct rtpcs_serdes *sds)
 {
+
 	u32 v;
 
 	/* Enable 1GBit PHY */
-	v = rtpcs_sds_read(ctrl, sds_num, PHY_PAGE_2, MII_BMCR);
+	v = rtpcs_sds_read(sds, PHY_PAGE_2, MII_BMCR);
 	pr_info("%s 1gbit phy: %08x\n", __func__, v);
 	v &= ~BMCR_PDOWN;
-	rtpcs_sds_write(ctrl, sds_num, PHY_PAGE_2, MII_BMCR, v);
+	rtpcs_sds_write(sds, PHY_PAGE_2, MII_BMCR, v);
 	pr_info("%s 1gbit phy enabled: %08x\n", __func__, v);
 
 	/* Enable 10GBit PHY */
-	v = rtpcs_sds_read(ctrl, sds_num, PHY_PAGE_4, MII_BMCR);
+	v = rtpcs_sds_read(sds, PHY_PAGE_4, MII_BMCR);
 	pr_info("%s 10gbit phy: %08x\n", __func__, v);
 	v &= ~BMCR_PDOWN;
-	rtpcs_sds_write(ctrl, sds_num, PHY_PAGE_4, MII_BMCR, v);
+	rtpcs_sds_write(sds, PHY_PAGE_4, MII_BMCR, v);
 	pr_info("%s 10gbit phy after: %08x\n", __func__, v);
 
 	/* dal_longan_construct_mac_default_10gmedia_fiber */
-	v = rtpcs_sds_read(ctrl, sds_num, 0x1f, 11);
+	v = rtpcs_sds_read(sds, 0x1f, 11);
 	pr_info("%s set medium: %08x\n", __func__, v);
 	v |= BIT(1);
-	rtpcs_sds_write(ctrl, sds_num, 0x1f, 11, v);
+	rtpcs_sds_write(sds, 0x1f, 11, v);
 	pr_info("%s set medium after: %08x\n", __func__, v);
 }
 
-static int rtpcs_930x_sds_10g_idle(struct rtpcs_ctrl *ctrl, int sds_num)
+static int rtpcs_930x_sds_10g_idle(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	bool busy;
 	int i = 0;
 
 	do {
-		if (sds_num % 2) {
-			rtpcs_sds_write_bits(ctrl, sds_num - 1, 0x1f, 0x2, 15, 0, 53);
-			busy = !!rtpcs_sds_read_bits(ctrl, sds_num - 1, 0x1f, 0x14, 1, 1);
+		if (sds == even_sds) {
+			rtpcs_sds_write_bits(sds, 0x1f, 0x2, 15, 0, 53);
+			busy = !!rtpcs_sds_read_bits(sds, 0x1f, 0x14, 0, 0);
 		} else {
-			rtpcs_sds_write_bits(ctrl, sds_num, 0x1f, 0x2, 15, 0, 53);
-			busy = !!rtpcs_sds_read_bits(ctrl, sds_num, 0x1f, 0x14, 0, 0);
+			rtpcs_sds_write_bits(even_sds, 0x1f, 0x2, 15, 0, 53);
+			busy = !!rtpcs_sds_read_bits(even_sds, 0x1f, 0x14, 1, 1);
 		}
 		i++;
 	} while (busy && i < 100);
@@ -1946,11 +1965,12 @@ static int rtpcs_930x_sds_10g_idle(struct rtpcs_ctrl *ctrl, int sds_num)
 	if (i < 100)
 		return 0;
 
-	pr_warn("%s WARNING: Waiting for RX idle timed out, SDS %d\n", __func__, sds_num);
+	pr_warn("%s WARNING: Waiting for RX idle timed out, SDS %d\n",
+		__func__, sds->id);
 	return -EIO;
 }
 
-static int rtpcs_930x_sds_set_polarity(struct rtpcs_ctrl *ctrl, u32 sds,
+static int rtpcs_930x_sds_set_polarity(struct rtpcs_serdes *sds,
 				       bool tx_inv, bool rx_inv)
 {
 	u8 rx_val = rx_inv ? 1 : 0;
@@ -1960,13 +1980,13 @@ static int rtpcs_930x_sds_set_polarity(struct rtpcs_ctrl *ctrl, u32 sds,
 
 	/* 10GR */
 	val = (tx_val << 1) | rx_val;
-	ret = rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x2, 14, 13, val);
+	ret = rtpcs_sds_write_bits(sds, 0x6, 0x2, 14, 13, val);
 	if (ret)
 		return ret;
 
 	/* 1G */
 	val = (rx_val << 1) | tx_val;
-	return rtpcs_sds_write_bits(ctrl, sds, 0x0, 0x0, 9, 8, val);
+	return rtpcs_sds_write_bits(sds, 0x0, 0x0, 9, 8, val);
 }
 
 static const sds_config rtpcs_930x_sds_cfg_10gr_even[] = {
@@ -2102,44 +2122,47 @@ static const sds_config rtpcs_930x_sds_cfg_10g_2500bx_odd[] = {
 	{0x2D, 0x13, 0x3C87}, {0x2D, 0x14, 0x1808},
 };
 
-static void rtpcs_930x_sds_usxgmii_config(struct rtpcs_ctrl *ctrl, int sds,
-					  int nway_en, u32 opcode, u32 am_period,
+static void rtpcs_930x_sds_usxgmii_config(struct rtpcs_serdes *sds, int nway_en,
+					  u32 opcode, u32 am_period,
 					  u32 all_am_markers, u32 an_table,
 					  u32 sync_bit)
 {
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x11, 0, 0, nway_en);
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x11, 1, 1, nway_en);
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x11, 2, 2, nway_en);
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x11, 3, 3, nway_en);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x12, 15, 0, am_period);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x13, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x13, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x14, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x14, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x15, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x15, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x16, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x16, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x17, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x17, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x18, 7,  0, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x18, 15, 8, all_am_markers);
-	rtpcs_sds_write_bits(ctrl, sds, 0x7, 0x10, 7, 0, opcode);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0xe, 10, 10, an_table);
-	rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x1d, 11, 10, sync_bit);
-}
-
-static void rtpcs_930x_sds_patch(struct rtpcs_ctrl *ctrl, int sds, phy_interface_t mode)
-{
-	const bool even_sds = ((sds & 1) == 0);
+	rtpcs_sds_write_bits(sds, 0x7, 0x11, 0, 0, nway_en);
+	rtpcs_sds_write_bits(sds, 0x7, 0x11, 1, 1, nway_en);
+	rtpcs_sds_write_bits(sds, 0x7, 0x11, 2, 2, nway_en);
+	rtpcs_sds_write_bits(sds, 0x7, 0x11, 3, 3, nway_en);
+	rtpcs_sds_write_bits(sds, 0x6, 0x12, 15, 0, am_period);
+	rtpcs_sds_write_bits(sds, 0x6, 0x13, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x13, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x14, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x14, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x15, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x15, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x16, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x16, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x17, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x17, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x18, 7,  0, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x6, 0x18, 15, 8, all_am_markers);
+	rtpcs_sds_write_bits(sds, 0x7, 0x10, 7, 0, opcode);
+	rtpcs_sds_write_bits(sds, 0x6, 0xe, 10, 10, an_table);
+	rtpcs_sds_write_bits(sds, 0x6, 0x1d, 11, 10, sync_bit);
+}
+
+static void rtpcs_930x_sds_patch(struct rtpcs_serdes *sds, phy_interface_t mode)
+{
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	const sds_config *config;
+	bool is_even_sds;
 	size_t count;
 
+	is_even_sds = (sds == even_sds);
+
 	switch (mode) {
 	case PHY_INTERFACE_MODE_1000BASEX:
 	case PHY_INTERFACE_MODE_SGMII:
 	case PHY_INTERFACE_MODE_10GBASER:
-		if (even_sds) {
+		if (is_even_sds) {
 			config = rtpcs_930x_sds_cfg_10gr_even;
 			count = ARRAY_SIZE(rtpcs_930x_sds_cfg_10gr_even);
 		} else {
@@ -2149,7 +2172,7 @@ static void rtpcs_930x_sds_patch(struct rtpcs_ctrl *ctrl, int sds, phy_interface
 		break;
 
 	case PHY_INTERFACE_MODE_2500BASEX:
-		if (even_sds) {
+		if (is_even_sds) {
 			config = rtpcs_930x_sds_cfg_10g_2500bx_even;
 			count = ARRAY_SIZE(rtpcs_930x_sds_cfg_10g_2500bx_even);
 		} else {
@@ -2162,51 +2185,53 @@ static void rtpcs_930x_sds_patch(struct rtpcs_ctrl *ctrl, int sds, phy_interface
 		return;
 
 	default:
-		pr_warn("%s: unsupported mode %s on serdes %d\n", __func__, phy_modes(mode), sds);
+		pr_warn("%s: unsupported mode %s on serdes %d\n", __func__, phy_modes(mode),
+			sds->id);
 		return;
 	}
 
 	for (size_t i = 0; i < count; ++i)
-		rtpcs_sds_write(ctrl, sds, config[i].page, config[i].reg, config[i].data);
+		rtpcs_sds_write(sds, config[i].page, config[i].reg, config[i].data);
 
 	if (mode == PHY_INTERFACE_MODE_10G_QXGMII) {
 		/* Default configuration */
-		rtpcs_930x_sds_usxgmii_config(ctrl, sds, 1, 0xaa, 0x5078, 0, 1, 0x1);
+		rtpcs_930x_sds_usxgmii_config(sds, 1, 0xaa, 0x5078, 0, 1, 0x1);
 	}
 }
 
 __always_unused
-static int rtpcs_930x_sds_cmu_band_get(struct rtpcs_ctrl *ctrl, int sds)
+static int rtpcs_930x_sds_cmu_band_get(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
+	struct rtpcs_serdes *odd_sds = rtpcs_sds_get_odd(sds);
 	u32 page;
 	u32 en;
 	u32 cmu_band;
 
 /*	page = rtl9300_sds_cmu_page_get(sds); */
 	page = 0x25; /* 10GR and 1000BX */
-	sds = (sds % 2) ? (sds - 1) : (sds);
 
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x1c, 15, 15, 1);
-	rtpcs_sds_write_bits(ctrl, sds + 1, page, 0x1c, 15, 15, 1);
+	rtpcs_sds_write_bits(even_sds, page, 0x1c, 15, 15, 1);
+	rtpcs_sds_write_bits(odd_sds, page, 0x1c, 15, 15, 1);
 
-	en = rtpcs_sds_read_bits(ctrl, sds, page, 27, 1, 1);
+	en = rtpcs_sds_read_bits(even_sds, page, 27, 1, 1);
 	if (!en) { /* Auto mode */
-		rtpcs_sds_write(ctrl, sds, 0x1f, 0x02, 31);
+		rtpcs_sds_write(even_sds, 0x1f, 0x02, 31);
 
-		cmu_band = rtpcs_sds_read_bits(ctrl, sds, 0x1f, 0x15, 5, 1);
+		cmu_band = rtpcs_sds_read_bits(even_sds, 0x1f, 0x15, 5, 1);
 	} else {
-		cmu_band = rtpcs_sds_read_bits(ctrl, sds, page, 30, 4, 0);
+		cmu_band = rtpcs_sds_read_bits(even_sds, page, 30, 4, 0);
 	}
 
 	return cmu_band;
 }
 
-static int rtpcs_930x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 				   phy_interface_t phy_mode)
 {
 	int calib_tries = 0;
 
-	if (sds < 0 || sds > 11)
+	if (sds->id < 0 || sds->id > 11)
 		return -EINVAL;
 
 	/* Rely on setup from U-boot for some modes, e.g. USXGMII */
@@ -2222,73 +2247,76 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 	}
 
 	/* Turn Off Serdes */
-	rtpcs_930x_sds_set(ctrl, sds, RTL930X_SDS_OFF);
+	rtpcs_930x_sds_set(sds, RTL930X_SDS_OFF);
 
 	/* Apply serdes patches */
-	rtpcs_930x_sds_patch(ctrl, sds, phy_mode);
+	rtpcs_930x_sds_patch(sds, phy_mode);
 
 	/* Maybe use dal_longan_sds_init */
 
 	/* dal_longan_construct_serdesConfig_init */ /* Serdes Construct */
-	rtpcs_930x_phy_enable_10g_1g(ctrl, sds);
+	rtpcs_930x_phy_enable_10g_1g(sds);
 
 	/* ----> dal_longan_sds_mode_set */
-	pr_info("%s: Configuring RTL9300 SERDES %d\n", __func__, sds);
+	pr_info("%s: Configuring RTL9300 SERDES %d\n", __func__, sds->id);
 
 	/* Set SDS polarity */
-	rtpcs_930x_sds_set_polarity(ctrl, sds, ctrl->tx_pol_inv[sds],
-				    ctrl->rx_pol_inv[sds]);
+	rtpcs_930x_sds_set_polarity(sds, sds->ctrl->tx_pol_inv[sds->id],
+				    sds->ctrl->rx_pol_inv[sds->id]);
 
 	/* Enable SDS in desired mode */
-	rtpcs_930x_sds_mode_set(ctrl, sds, phy_mode);
+	rtpcs_930x_sds_mode_set(sds, phy_mode);
 
 	/* Enable Fiber RX */
-	rtpcs_sds_write_bits(ctrl, sds, 0x20, 2, 12, 12, 0);
+	rtpcs_sds_write_bits(sds, 0x20, 2, 12, 12, 0);
 
 	/* Calibrate SerDes receiver in loopback mode */
-	rtpcs_930x_sds_10g_idle(ctrl, sds);
+	rtpcs_930x_sds_10g_idle(sds);
 	do {
-		rtpcs_930x_sds_do_rx_calibration(ctrl, sds, phy_mode);
+		rtpcs_930x_sds_do_rx_calibration(sds, phy_mode);
 		calib_tries++;
 		mdelay(50);
-	} while (rtpcs_930x_sds_check_calibration(ctrl, sds, phy_mode) && calib_tries < 3);
+	} while (rtpcs_930x_sds_check_calibration(sds, phy_mode) && calib_tries < 3);
 	if (calib_tries >= 3)
 		pr_warn("%s: SerDes RX calibration failed\n", __func__);
 
 	/* Leave loopback mode */
-	rtpcs_930x_sds_tx_config(ctrl, sds, phy_mode);
+	rtpcs_930x_sds_tx_config(sds, phy_mode);
 
 	return 0;
 }
 
 /* RTL931X */
 
-static void rtpcs_931x_sds_reset(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
 {
+	struct rtpcs_ctrl *ctrl = sds->ctrl;
+	u32 sds_id = sds->id;
 	u32 o, v, o_mode;
-	int shift = ((sds & 0x3) << 3);
+	int shift = ((sds_id & 0x3) << 3);
 
 	/* TODO: We need to lock this! */
 
 	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &o);
-	v = o | BIT(sds);
+	v = o | BIT(sds_id);
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, v);
 
-	regmap_read(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2), &o_mode);
+	regmap_read(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), &o_mode);
 	v = BIT(7) | 0x1F;
-	regmap_write_bits(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2),
+	regmap_write_bits(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2),
 			  0xff << shift, v << shift);
-	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2), o_mode);
+	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), o_mode);
 
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, o);
 }
 
-static void rtpcs_931x_sds_disable(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_931x_sds_disable(struct rtpcs_serdes *sds)
 {
-	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + (sds >> 2) * 4, 0x9f);
+	regmap_write(sds->ctrl->map,
+		     RTL931X_SERDES_MODE_CTRL + (sds->id >> 2) * 4, 0x9f);
 }
 
-static void rtpcs_931x_sds_symerr_clear(struct rtpcs_ctrl *ctrl, u32 sds,
+static void rtpcs_931x_sds_symerr_clear(struct rtpcs_serdes *sds,
 					phy_interface_t mode)
 {
 	switch (mode) {
@@ -2296,21 +2324,21 @@ static void rtpcs_931x_sds_symerr_clear(struct rtpcs_ctrl *ctrl, u32 sds,
 		break;
 	case PHY_INTERFACE_MODE_XGMII:
 		for (int i = 0; i < 4; ++i) {
-			rtpcs_sds_write_bits(ctrl, sds, 0x41, 24,  2, 0, i);
-			rtpcs_sds_write_bits(ctrl, sds, 0x41,  3, 15, 8, 0x0);
-			rtpcs_sds_write_bits(ctrl, sds, 0x41,  2, 15, 0, 0x0);
+			rtpcs_sds_write_bits(sds, 0x41, 24,  2, 0, i);
+			rtpcs_sds_write_bits(sds, 0x41,  3, 15, 8, 0x0);
+			rtpcs_sds_write_bits(sds, 0x41,  2, 15, 0, 0x0);
 		}
 
 		for (int i = 0; i < 4; ++i) {
-			rtpcs_sds_write_bits(ctrl, sds, 0x81, 24,  2, 0, i);
-			rtpcs_sds_write_bits(ctrl, sds, 0x81,  3, 15, 8, 0x0);
-			rtpcs_sds_write_bits(ctrl, sds, 0x81,  2, 15, 0, 0x0);
+			rtpcs_sds_write_bits(sds, 0x81, 24,  2, 0, i);
+			rtpcs_sds_write_bits(sds, 0x81,  3, 15, 8, 0x0);
+			rtpcs_sds_write_bits(sds, 0x81,  2, 15, 0, 0x0);
 		}
 
-		rtpcs_sds_write_bits(ctrl, sds, 0x41, 0, 15, 0, 0x0);
-		rtpcs_sds_write_bits(ctrl, sds, 0x41, 1, 15, 8, 0x0);
-		rtpcs_sds_write_bits(ctrl, sds, 0x81, 0, 15, 0, 0x0);
-		rtpcs_sds_write_bits(ctrl, sds, 0x81, 1, 15, 8, 0x0);
+		rtpcs_sds_write_bits(sds, 0x41, 0, 15, 0, 0x0);
+		rtpcs_sds_write_bits(sds, 0x41, 1, 15, 8, 0x0);
+		rtpcs_sds_write_bits(sds, 0x81, 0, 15, 0, 0x0);
+		rtpcs_sds_write_bits(sds, 0x81, 1, 15, 8, 0x0);
 		break;
 	default:
 		break;
@@ -2318,22 +2346,22 @@ static void rtpcs_931x_sds_symerr_clear(struct rtpcs_ctrl *ctrl, u32 sds,
 }
 
 __always_unused
-static void rtpcs_931x_sds_fiber_disable(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_931x_sds_fiber_disable(struct rtpcs_serdes *sds)
 {
 	u32 v = 0x3F;
 
-	rtpcs_sds_write_bits(ctrl, sds, 0x1F, 0x9, 11, 6, v);
+	rtpcs_sds_write_bits(sds, 0x1F, 0x9, 11, 6, v);
 }
 
-static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_ctrl *ctrl, u32 sds,
+static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 					  phy_interface_t mode)
 {
 	u32 val;
 
 	/* clear symbol error count before changing mode */
-	rtpcs_931x_sds_symerr_clear(ctrl, sds, mode);
+	rtpcs_931x_sds_symerr_clear(sds, mode);
 
-	rtpcs_931x_sds_disable(ctrl, sds);
+	rtpcs_931x_sds_disable(sds);
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_SGMII:
@@ -2361,7 +2389,7 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_ctrl *ctrl, u32 sds,
 	}
 
 	pr_info("%s writing analog SerDes Mode value %02x\n", __func__, val);
-	rtpcs_sds_write_bits(ctrl, sds, 0x1F, 0x9, 11, 6, val);
+	rtpcs_sds_write_bits(sds, 0x1F, 0x9, 11, 6, val);
 }
 
 static int rtpcs_931x_sds_cmu_page_get(phy_interface_t mode)
@@ -2389,14 +2417,14 @@ static int rtpcs_931x_sds_cmu_page_get(phy_interface_t mode)
 	return -1;
 }
 
-static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_ctrl *ctrl, u32 sds,
+static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_serdes *sds,
 					phy_interface_t mode, int chiptype)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int cmu_type = 0; /* Clock Management Unit */
 	u32 cmu_page = 0;
 	u32 frc_cmu_spd;
-	u32 evenSds;
-	u32 lane, frc_lc_mode_bitnum, frc_lc_mode_val_bitnum;
+	u32 frc_lc_mode_bitnum, frc_lc_mode_val_bitnum;
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_NA:
@@ -2437,16 +2465,14 @@ static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_ctrl *ctrl, u32 sds,
 		break;
 
 	default:
-		pr_info("SerDes %d mode is invalid\n", sds);
+		pr_info("SerDes %d mode is invalid\n", sds->id);
 		return;
 	}
 
 	if (cmu_type == 1)
 		cmu_page = rtpcs_931x_sds_cmu_page_get(mode);
 
-	lane = sds % 2;
-
-	if (!lane) {
+	if (sds == even_sds) { 
 		frc_lc_mode_bitnum = 4;
 		frc_lc_mode_val_bitnum = 5;
 	} else {
@@ -2454,47 +2480,46 @@ static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_ctrl *ctrl, u32 sds,
 		frc_lc_mode_val_bitnum = 7;
 	}
 
-	evenSds = sds - lane;
-
-	pr_info("%s: cmu_type %0d cmu_page %x frc_cmu_spd %d lane %d sds %d\n",
-		__func__, cmu_type, cmu_page, frc_cmu_spd, lane, sds);
+	pr_info("%s: cmu_type %0d cmu_page %x frc_cmu_spd %d even_sds %d sds %d\n",
+		__func__, cmu_type, cmu_page, frc_cmu_spd, even_sds->id,
+		sds->id);
 
 	if (cmu_type == 1) {
-		pr_info("%s A CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
-		rtpcs_sds_write_bits(ctrl, sds, cmu_page, 0x7, 15, 15, 0);
-		pr_info("%s B CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
+		pr_info("%s A CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
+		rtpcs_sds_write_bits(sds, cmu_page, 0x7, 15, 15, 0);
+		pr_info("%s B CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
 		if (chiptype)
-			rtpcs_sds_write_bits(ctrl, sds, cmu_page, 0xd, 14, 14, 0);
+			rtpcs_sds_write_bits(sds, cmu_page, 0xd, 14, 14, 0);
 
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, 3, 2, 0x3);
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, frc_lc_mode_bitnum, frc_lc_mode_bitnum, 1);
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, frc_lc_mode_val_bitnum, frc_lc_mode_val_bitnum, 0);
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, 12, 12, 1);
-		rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, 15, 13, frc_cmu_spd);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, 3, 2, 0x3);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, frc_lc_mode_bitnum, frc_lc_mode_bitnum, 1);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, frc_lc_mode_val_bitnum, frc_lc_mode_val_bitnum, 0);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, 12, 12, 1);
+		rtpcs_sds_write_bits(even_sds, 0x20, 0x12, 15, 13, frc_cmu_spd);
 	}
 
-	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
+	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
 }
 
-static void rtpcs_931x_sds_rx_reset(struct rtpcs_ctrl *ctrl, u32 sds)
+static void rtpcs_931x_sds_rx_reset(struct rtpcs_serdes *sds)
 {
-	if (sds < 2)
+	if (sds->id < 2)
 		return;
 
-	rtpcs_sds_write(ctrl, sds, 0x2e, 0x12, 0x2740);
-	rtpcs_sds_write(ctrl, sds, 0x2f, 0x0, 0x0);
-	rtpcs_sds_write(ctrl, sds, 0x2f, 0x2, 0x2010);
-	rtpcs_sds_write(ctrl, sds, 0x20, 0x0, 0xc10);
+	rtpcs_sds_write(sds, 0x2e, 0x12, 0x2740);
+	rtpcs_sds_write(sds, 0x2f, 0x0, 0x0);
+	rtpcs_sds_write(sds, 0x2f, 0x2, 0x2010);
+	rtpcs_sds_write(sds, 0x20, 0x0, 0xc10);
 
-	rtpcs_sds_write(ctrl, sds, 0x2e, 0x12, 0x27c0);
-	rtpcs_sds_write(ctrl, sds, 0x2f, 0x0, 0xc000);
-	rtpcs_sds_write(ctrl, sds, 0x2f, 0x2, 0x6010);
-	rtpcs_sds_write(ctrl, sds, 0x20, 0x0, 0xc30);
+	rtpcs_sds_write(sds, 0x2e, 0x12, 0x27c0);
+	rtpcs_sds_write(sds, 0x2f, 0x0, 0xc000);
+	rtpcs_sds_write(sds, 0x2f, 0x2, 0x6010);
+	rtpcs_sds_write(sds, 0x20, 0x0, 0xc30);
 
 	mdelay(50);
 }
 
-static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_ctrl *ctrl, u32 sds,
+static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
 					phy_interface_t mode)
 {
 	u32 val;
@@ -2519,75 +2544,75 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_ctrl *ctrl, u32 sds,
 
 	val |= (1 << 7);
 
-	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2), val);
+	regmap_write(sds->ctrl->map,
+		     RTL931X_SERDES_MODE_CTRL + 4 * (sds->id >> 2), val);
 }
 
-static int rtpcs_931x_sds_cmu_band_set(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_931x_sds_cmu_band_set(struct rtpcs_serdes *sds,
 				       bool enable, u32 band,
 				       phy_interface_t mode)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int page = rtpcs_931x_sds_cmu_page_get(mode);
 
-	sds -= (sds % 2);
-	sds = sds & ~1;
 	page += 1;
 
 	if (enable) {
-		rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 13, 13, 0);
-		rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 11, 11, 0);
+		rtpcs_sds_write_bits(even_sds, page, 0x7, 13, 13, 0);
+		rtpcs_sds_write_bits(even_sds, page, 0x7, 11, 11, 0);
 	} else {
-		rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 13, 13, 0);
-		rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 11, 11, 0);
+		rtpcs_sds_write_bits(even_sds, page, 0x7, 13, 13, 0);
+		rtpcs_sds_write_bits(even_sds, page, 0x7, 11, 11, 0);
 	}
 
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x7, 4, 0, band);
+	rtpcs_sds_write_bits(even_sds, page, 0x7, 4, 0, band);
 
-	rtpcs_931x_sds_reset(ctrl, sds);
+	rtpcs_931x_sds_reset(even_sds);
 
 	return 0;
 }
 
-static int rtpcs_931x_sds_cmu_band_get(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_931x_sds_cmu_band_get(struct rtpcs_serdes *sds,
 				       phy_interface_t mode)
 {
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	int page = rtpcs_931x_sds_cmu_page_get(mode);
 	u32 band;
 
-	sds -= (sds % 2);
 	page += 1;
-	rtpcs_sds_write(ctrl, sds, 0x1f, 0x02, 73);
+	rtpcs_sds_write(even_sds, 0x1f, 0x02, 73);
 
-	rtpcs_sds_write_bits(ctrl, sds, page, 0x5, 15, 15, 1);
-	band = rtpcs_sds_read_bits(ctrl, sds, 0x1f, 0x15, 8, 3);
+	rtpcs_sds_write_bits(even_sds, page, 0x5, 15, 15, 1);
+	band = rtpcs_sds_read_bits(even_sds, 0x1f, 0x15, 8, 3);
 	pr_info("%s band is: %d\n", __func__, band);
 
 	return band;
 }
 
 __always_unused
-static int rtpcs_931x_sds_link_sts_get(struct rtpcs_ctrl *ctrl, u32 sds)
+static int rtpcs_931x_sds_link_sts_get(struct rtpcs_serdes *sds)
 {
 	u32 sts, sts1, latch_sts, latch_sts1;
 
 	if (0) {
-		sts = rtpcs_sds_read_bits(ctrl, sds, 0x41, 29, 8, 0);
-		sts1 = rtpcs_sds_read_bits(ctrl, sds, 0x81, 29, 8, 0);
-		latch_sts = rtpcs_sds_read_bits(ctrl, sds, 0x41, 30, 8, 0);
-		latch_sts1 = rtpcs_sds_read_bits(ctrl, sds, 0x81, 30, 8, 0);
+		sts = rtpcs_sds_read_bits(sds, 0x41, 29, 8, 0);
+		sts1 = rtpcs_sds_read_bits(sds, 0x81, 29, 8, 0);
+		latch_sts = rtpcs_sds_read_bits(sds, 0x41, 30, 8, 0);
+		latch_sts1 = rtpcs_sds_read_bits(sds, 0x81, 30, 8, 0);
 	} else {
-		sts = rtpcs_sds_read_bits(ctrl, sds, 0x5, 0, 12, 12);
-		latch_sts = rtpcs_sds_read_bits(ctrl, sds, 0x4, 1, 2, 2);
-		latch_sts1 = rtpcs_sds_read_bits(ctrl, sds, 0x42, 1, 2, 2);
-		sts1 = rtpcs_sds_read_bits(ctrl, sds, 0x42, 1, 2, 2);
+		sts = rtpcs_sds_read_bits(sds, 0x5, 0, 12, 12);
+		latch_sts = rtpcs_sds_read_bits(sds, 0x4, 1, 2, 2);
+		latch_sts1 = rtpcs_sds_read_bits(sds, 0x42, 1, 2, 2);
+		sts1 = rtpcs_sds_read_bits(sds, 0x42, 1, 2, 2);
 	}
 
 	pr_info("%s: serdes %d sts %d, sts1 %d, latch_sts %d, latch_sts1 %d\n", __func__,
-		sds, sts, sts1, latch_sts, latch_sts1);
+		sds->id, sts, sts1, latch_sts, latch_sts1);
 
 	return sts1;
 }
 
-static int rtpcs_931x_sds_set_polarity(struct rtpcs_ctrl *ctrl, u32 sds,
+static int rtpcs_931x_sds_set_polarity(struct rtpcs_serdes *sds,
 				       bool tx_inv, bool rx_inv)
 {
 	u8 rx_val = rx_inv ? 1 : 0;
@@ -2597,17 +2622,17 @@ static int rtpcs_931x_sds_set_polarity(struct rtpcs_ctrl *ctrl, u32 sds,
 
 	/* 10gr_*_inv */
 	val = (tx_val << 1) | rx_val;
-	ret = rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x2, 14, 13, val);
+	ret = rtpcs_sds_write_bits(sds, 0x6, 0x2, 14, 13, val);
 	if (ret)
 		return ret;
 
 	/* xsg_*_inv */
 	val = (rx_val << 1) | tx_val;
-	ret = rtpcs_sds_write_bits(ctrl, sds, 0x40, 0x0, 9, 8, val);
+	ret = rtpcs_sds_write_bits(sds, 0x40, 0x0, 9, 8, val);
 	if (ret)
 		return ret;
 
-	return rtpcs_sds_write_bits(ctrl, sds, 0x80, 0x0, 9, 8, val);
+	return rtpcs_sds_write_bits(sds, 0x80, 0x0, 9, 8, val);
 }
 
 static sds_config sds_config_10p3125g_type1[] = {
@@ -2634,7 +2659,7 @@ static sds_config sds_config_10p3125g_cmu_type1[] = {
 	{ 0x2F, 0x0F, 0xA470 }, { 0x2F, 0x10, 0x8000 }, { 0x2F, 0x11, 0x037B }
 };
 
-static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
+static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 				   phy_interface_t mode)
 {
 	u32 board_sds_tx_type1[] = {
@@ -2649,10 +2674,13 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 		0x0dc0, 0x01c0, 0x0200, 0x0180, 0x0160, 0x0123,
 		0x0123, 0x0163, 0x01a3, 0x01a0, 0x01c3, 0x09c3,
 	};
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
+	struct rtpcs_ctrl *ctrl = sds->ctrl;
 	u32 band, ori, model_info, val;
+	u32 sds_id = sds->id;
 	int chiptype = 0;
 
-	if (sds < 0 || sds > 13)
+	if (sds_id < 0 || sds_id > 13)
 		return -EINVAL;
 
 	/*
@@ -2667,21 +2695,21 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 	if (mode == PHY_INTERFACE_MODE_USXGMII)
 		return -ENOTSUPP;
 
-	pr_info("%s: set sds %d to mode %d\n", __func__, sds, mode);
-	val = rtpcs_sds_read_bits(ctrl, sds, 0x1F, 0x9, 11, 6);
+	pr_info("%s: set sds %d to mode %d\n", __func__, sds_id, mode);
+	val = rtpcs_sds_read_bits(sds, 0x1F, 0x9, 11, 6);
 
 	pr_info("%s: fibermode %08X stored mode 0x%x", __func__,
-		rtpcs_sds_read(ctrl, sds, 0x1f, 0x9), val);
+		rtpcs_sds_read(sds, 0x1f, 0x9), val);
 	pr_info("%s: SGMII mode %08X in 0x24 0x9", __func__,
-		rtpcs_sds_read(ctrl, sds, 0x24, 0x9));
+		rtpcs_sds_read(sds, 0x24, 0x9));
 	pr_info("%s: CMU mode %08X stored even SDS %d", __func__,
-		rtpcs_sds_read(ctrl, sds & ~1, 0x20, 0x12), sds & ~1);
-	pr_info("%s: serdes_mode_ctrl %08X", __func__,  RTL931X_SERDES_MODE_CTRL + 4 * (sds >> 2));
-	pr_info("%s CMU page 0x24 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x24, 0x7));
-	pr_info("%s CMU page 0x26 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x26, 0x7));
-	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
-	pr_info("%s XSG page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x40, 0xe));
-	pr_info("%s XSG2 page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x80, 0xe));
+		rtpcs_sds_read(even_sds, 0x20, 0x12), even_sds->id);
+	pr_info("%s: serdes_mode_ctrl %08X", __func__,  RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2));
+	pr_info("%s CMU page 0x24 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x24, 0x7));
+	pr_info("%s CMU page 0x26 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x26, 0x7));
+	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
+	pr_info("%s XSG page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(sds, 0x40, 0xe));
+	pr_info("%s XSG2 page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(sds, 0x80, 0xe));
 
 	regmap_read(ctrl->map, RTL93XX_MODEL_NAME_INFO, &model_info);
 	if ((model_info >> 4) & 0x1) {
@@ -2691,16 +2719,15 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 		pr_info("detected chiptype 0\n");
 	}
 
-	pr_info("%s: 2.5gbit %08X", __func__,
-		rtpcs_sds_read(ctrl, sds, 0x41, 0x14));
+	pr_info("%s: 2.5gbit %08X", __func__, rtpcs_sds_read(sds, 0x41, 0x14));
 
 	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &ori);
 	pr_info("%s: RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR 0x%08X\n", __func__, ori);
-	val = ori | (1 << sds);
+	val = ori | (1 << sds_id);
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
 
 	/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
-	band = rtpcs_931x_sds_cmu_band_get(ctrl, sds, mode);
+	band = rtpcs_931x_sds_cmu_band_get(sds, mode);
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_NA:
@@ -2710,129 +2737,126 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 
 		if (chiptype) {
 			/* fifo inv clk */
-			rtpcs_sds_write_bits(ctrl, sds, 0x41, 0x1, 7, 4, 0xf);
-			rtpcs_sds_write_bits(ctrl, sds, 0x41, 0x1, 3, 0, 0xf);
+			rtpcs_sds_write_bits(sds, 0x41, 0x1, 7, 4, 0xf);
+			rtpcs_sds_write_bits(sds, 0x41, 0x1, 3, 0, 0xf);
 
-			rtpcs_sds_write_bits(ctrl, sds, 0x81, 0x1, 7, 4, 0xf);
-			rtpcs_sds_write_bits(ctrl, sds, 0x81, 0x1, 3, 0, 0xf);
+			rtpcs_sds_write_bits(sds, 0x81, 0x1, 7, 4, 0xf);
+			rtpcs_sds_write_bits(sds, 0x81, 0x1, 3, 0, 0xf);
 		}
 
-		rtpcs_sds_write_bits(ctrl, sds, 0x40, 0xE, 12, 12, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x80, 0xE, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x40, 0xE, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x80, 0xE, 12, 12, 1);
 		break;
 
 	case PHY_INTERFACE_MODE_USXGMII: /* MII_USXGMII_10GSXGMII/10GDXGMII/10GQXGMII: */
 		u32 op_code = 0x6003;
-		u32 evenSds;
 
 		if (chiptype) {
-			rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x2, 12, 12, 1);
+			rtpcs_sds_write_bits(sds, 0x6, 0x2, 12, 12, 1);
 
 			for (int i = 0; i < sizeof(sds_config_10p3125g_type1) / sizeof(sds_config); ++i) {
-				rtpcs_sds_write(ctrl, sds,
+				rtpcs_sds_write(sds,
 						sds_config_10p3125g_type1[i].page - 0x4,
 						sds_config_10p3125g_type1[i].reg,
 						sds_config_10p3125g_type1[i].data);
 			}
 
-			evenSds = sds & ~1;
-
 			for (int i = 0; i < sizeof(sds_config_10p3125g_cmu_type1) / sizeof(sds_config); ++i) {
-				rtpcs_sds_write(ctrl, evenSds,
+				rtpcs_sds_write(even_sds,
 						sds_config_10p3125g_cmu_type1[i].page - 0x4,
 						sds_config_10p3125g_cmu_type1[i].reg,
 						sds_config_10p3125g_cmu_type1[i].data);
 			}
 
-			rtpcs_sds_write_bits(ctrl, sds, 0x6, 0x2, 12, 12, 0);
+			rtpcs_sds_write_bits(sds, 0x6, 0x2, 12, 12, 0);
 		} else {
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0xd, 6, 0, 0x0);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0xd, 7, 7, 0x1);
+			rtpcs_sds_write_bits(sds, 0x2e, 0xd, 6, 0, 0x0);
+			rtpcs_sds_write_bits(sds, 0x2e, 0xd, 7, 7, 0x1);
 
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1c, 5, 0, 0x1E);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1d, 11, 0, 0x00);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0x1f, 11, 0, 0x00);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x0, 11, 0, 0x00);
-			rtpcs_sds_write_bits(ctrl, sds, 0x2f, 0x1, 11, 0, 0x00);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1c, 5, 0, 0x1E);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1d, 11, 0, 0x00);
+			rtpcs_sds_write_bits(sds, 0x2e, 0x1f, 11, 0, 0x00);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x0, 11, 0, 0x00);
+			rtpcs_sds_write_bits(sds, 0x2f, 0x1, 11, 0, 0x00);
 
-			rtpcs_sds_write_bits(ctrl, sds, 0x2e, 0xf, 12, 6, 0x7F);
-			rtpcs_sds_write(ctrl, sds, 0x2f, 0x12, 0xaaa);
+			rtpcs_sds_write_bits(sds, 0x2e, 0xf, 12, 6, 0x7F);
+			rtpcs_sds_write(sds, 0x2f, 0x12, 0xaaa);
 
-			rtpcs_931x_sds_rx_reset(ctrl, sds);
+			rtpcs_931x_sds_rx_reset(sds);
 
-			rtpcs_sds_write(ctrl, sds, 0x7, 0x10, op_code);
-			rtpcs_sds_write(ctrl, sds, 0x6, 0x1d, 0x0480);
-			rtpcs_sds_write(ctrl, sds, 0x6, 0xe, 0x0400);
+			rtpcs_sds_write(sds, 0x7, 0x10, op_code);
+			rtpcs_sds_write(sds, 0x6, 0x1d, 0x0480);
+			rtpcs_sds_write(sds, 0x6, 0xe, 0x0400);
 		}
 		break;
 
 	case PHY_INTERFACE_MODE_10GBASER: /* MII_10GR / MII_10GR1000BX_AUTO: */
 					  /* configure 10GR fiber mode=1 */
-		rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0xb, 1, 1, 1);
+		rtpcs_sds_write_bits(sds, 0x1f, 0xb, 1, 1, 1);
 
 		/* init fiber_1g */
-		rtpcs_sds_write_bits(ctrl, sds, 0x43, 0x13, 15, 14, 0);
+		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
 
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 12, 12, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 6, 6, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 13, 13, 0);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
 
 		/* init auto */
-		rtpcs_sds_write_bits(ctrl, sds, 0x1f, 13, 15, 0, 0x109e);
-		rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0x6, 14, 10, 0x8);
-		rtpcs_sds_write_bits(ctrl, sds, 0x1f, 0x7, 10, 4, 0x7f);
+		rtpcs_sds_write_bits(sds, 0x1f, 13, 15, 0, 0x109e);
+		rtpcs_sds_write_bits(sds, 0x1f, 0x6, 14, 10, 0x8);
+		rtpcs_sds_write_bits(sds, 0x1f, 0x7, 10, 4, 0x7f);
 		break;
 
 	case PHY_INTERFACE_MODE_1000BASEX: /* MII_1000BX_FIBER */
-		rtpcs_sds_write_bits(ctrl, sds, 0x43, 0x13, 15, 14, 0);
+		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
 
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 12, 12, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 6, 6, 1);
-		rtpcs_sds_write_bits(ctrl, sds, 0x42, 0x0, 13, 13, 0);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
 		break;
 
 	case PHY_INTERFACE_MODE_SGMII:
-		rtpcs_sds_write_bits(ctrl, sds, 0x24, 0x9, 15, 15, 0);
+		rtpcs_sds_write_bits(sds, 0x24, 0x9, 15, 15, 0);
 
 		/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
-		band = rtpcs_931x_sds_cmu_band_set(ctrl, sds, true, 62, PHY_INTERFACE_MODE_SGMII);
+		band = rtpcs_931x_sds_cmu_band_set(sds, true, 62, PHY_INTERFACE_MODE_SGMII);
 		break;
 
 	case PHY_INTERFACE_MODE_2500BASEX:
-		rtpcs_sds_write_bits(ctrl, sds, 0x41, 0x14, 8, 8, 1);
+		rtpcs_sds_write_bits(sds, 0x41, 0x14, 8, 8, 1);
 		break;
 
 	case PHY_INTERFACE_MODE_QSGMII:
 	default:
 		pr_info("%s: PHY mode %s not supported by SerDes %d\n",
-			__func__, phy_modes(mode), sds);
+			__func__, phy_modes(mode), sds_id);
 		return -ENOTSUPP;
 	}
 
-	rtpcs_931x_sds_cmu_type_set(ctrl, sds, mode, chiptype);
+	rtpcs_931x_sds_cmu_type_set(sds, mode, chiptype);
 
-	if (sds >= 2 && sds <= 13) {
+	if (sds_id >= 2 && sds_id <= 13) {
 		if (chiptype)
-			rtpcs_sds_write(ctrl, sds, 0x2E, 0x1, board_sds_tx_type1[sds - 2]);
+			rtpcs_sds_write(sds, 0x2E, 0x1, board_sds_tx_type1[sds_id - 2]);
 		else {
 			val = 0xa0000;
 			regmap_write(ctrl->map, RTL93XX_CHIP_INFO, val);
 			regmap_read(ctrl->map, RTL93XX_CHIP_INFO, &val);
 
 			if (val & BIT(28)) /* consider 9311 etc. RTL9313_CHIP_ID == HWP_CHIP_ID(unit)) */
-				rtpcs_sds_write(ctrl, sds, 0x2E, 0x1, board_sds_tx2[sds - 2]);
+				rtpcs_sds_write(sds, 0x2E, 0x1, board_sds_tx2[sds_id - 2]);
 			else
-				rtpcs_sds_write(ctrl, sds, 0x2E, 0x1, board_sds_tx[sds - 2]);
+				rtpcs_sds_write(sds, 0x2E, 0x1, board_sds_tx[sds_id - 2]);
 
 			val = 0;
 			regmap_write(ctrl->map, RTL93XX_CHIP_INFO, val);
 		}
 	}
 
-	rtpcs_931x_sds_set_polarity(ctrl, sds, ctrl->tx_pol_inv[sds],
-				    ctrl->rx_pol_inv[sds]);
+	rtpcs_931x_sds_set_polarity(sds, ctrl->tx_pol_inv[sds_id],
+				    ctrl->rx_pol_inv[sds_id]);
 
-	val = ori & ~BIT(sds);
+	val = ori & ~BIT(sds_id);
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
 	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &val);
 	pr_debug("%s: RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR 0x%08X\n", __func__, val);
@@ -2842,9 +2866,9 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 	    mode == PHY_INTERFACE_MODE_SGMII ||
 	    mode == PHY_INTERFACE_MODE_USXGMII) {
 		if (mode == PHY_INTERFACE_MODE_XGMII)
-			rtpcs_931x_sds_mii_mode_set(ctrl, sds, mode);
+			rtpcs_931x_sds_mii_mode_set(sds, mode);
 		else
-			rtpcs_931x_sds_fiber_mode_set(ctrl, sds, mode);
+			rtpcs_931x_sds_fiber_mode_set(sds, mode);
 	}
 
 	return 0;
@@ -2945,7 +2969,7 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	mutex_lock(&ctrl->lock);
 
 	if (ctrl->cfg->setup_serdes) {
-		ret = ctrl->cfg->setup_serdes(ctrl, link->sds->id, interface);
+		ret = ctrl->cfg->setup_serdes(link->sds, interface);
 		if (ret < 0)
 			goto out;
 	}
@@ -3001,7 +3025,7 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 		return ERR_PTR(-EINVAL);
 	if (sds_id >= ctrl->cfg->serdes_count)
 		return ERR_PTR(-EINVAL);
-	if (rtpcs_sds_read(ctrl, sds_id, 0, 0) < 0)
+	if (rtpcs_sds_read(&ctrl->serdes[sds_id], 0, 0) < 0)
 		return ERR_PTR(-EINVAL);
 
 	link = kzalloc(sizeof(*link), GFP_KERNEL);



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:46 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:46 -0500
Subject: [openwrt/openwrt]  realtek: pcs: drop unneeded SerDes number range
 checks
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36326.1765889856.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/18eea0548356454376ad3c60145446060325ace3

commit 18eea0548356454376ad3c60145446060325ace3
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 10:48:52 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 27 +---------------------
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 1158097801..7c0f737a67 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -544,8 +544,6 @@ static int rtpcs_838x_setup_serdes(struct rtpcs_serdes *sds,
 {
 	int ret;
 
-	if (sds->id > 5)
-		return -EINVAL;
 	if (!rtpcs_838x_sds_is_mode_supported(sds, mode))
 		return -EINVAL;
 
@@ -585,10 +583,6 @@ static void rtpcs_930x_sds_set(struct rtpcs_serdes *sds, u32 mode)
 	u8 sds_id = sds->id;
 
 	pr_info("%s %d\n", __func__, mode);
-	if (sds_id < 0 || sds_id > 11) {
-		pr_err("Wrong SerDes number: %d\n", sds_id);
-		return;
-	}
 
 	regmap_write_bits(sds->ctrl->map, rtpcs_930x_sds_regs[sds_id],
 			  RTL930X_SDS_MASK << rtpcs_930x_sds_lsb[sds_id],
@@ -602,11 +596,6 @@ static u32 rtpcs_930x_sds_mode_get(struct rtpcs_serdes *sds)
 	u8 sds_id = sds->id;
 	u32 v;
 
-	if (sds_id < 0 || sds_id > 11) {
-		pr_err("Wrong SerDes number: %d\n", sds_id);
-		return 0;
-	}
-
 	regmap_read(sds->ctrl->map, rtpcs_930x_sds_regs[sds_id], &v);
 	v >>= rtpcs_930x_sds_lsb[sds_id];
 
@@ -959,11 +948,6 @@ static void rtpcs_930x_sds_mode_set(struct rtpcs_serdes *sds,
 	u32 mode;
 	u32 submode;
 
-	if (sds->id < 0 || sds->id > 11) {
-		pr_err("%s: invalid SerDes number: %d\n", __func__, sds->id);
-		return;
-	}
-
 	switch (phy_mode) {
 	case PHY_INTERFACE_MODE_SGMII:
 	case PHY_INTERFACE_MODE_1000BASEX:
@@ -2231,9 +2215,6 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 {
 	int calib_tries = 0;
 
-	if (sds->id < 0 || sds->id > 11)
-		return -EINVAL;
-
 	/* Rely on setup from U-boot for some modes, e.g. USXGMII */
 	switch (phy_mode) {
 	case PHY_INTERFACE_MODE_1000BASEX:
@@ -2680,9 +2661,6 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 	u32 sds_id = sds->id;
 	int chiptype = 0;
 
-	if (sds_id < 0 || sds_id > 13)
-		return -EINVAL;
-
 	/*
 	 * TODO: USXGMII is currently the swiss army knife to declare 10G
 	 * multi port PHYs. Real devices use other modes instead. Especially
@@ -2835,7 +2813,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 
 	rtpcs_931x_sds_cmu_type_set(sds, mode, chiptype);
 
-	if (sds_id >= 2 && sds_id <= 13) {
+	if (sds_id >= 2) {
 		if (chiptype)
 			rtpcs_sds_write(sds, 0x2E, 0x1, board_sds_tx_type1[sds_id - 2]);
 		else {
@@ -2954,9 +2932,6 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 	int ret = 0;
 
-	if (link->sds->id < 0)
-		return 0;
-
 	/*
 	 * TODO: This (or copies of this) will be the central function for configuring the
 	 * link between PHY and SerDes. As of now a lot of the code is scattered throughout



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:27 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:27 -0500
Subject: [openwrt/openwrt]  realtek: pcs: drop unneeded SerDes number range
 checks
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36327.1765889860.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/4d86ac6401d3a55d14d3d2dd84d2d0d24ef33801

commit 4d86ac6401d3a55d14d3d2dd84d2d0d24ef33801
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 10:48:52 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 18eea0548356454376ad3c60145446060325ace3)
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 27 +---------------------
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 1158097801..7c0f737a67 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -544,8 +544,6 @@ static int rtpcs_838x_setup_serdes(struct rtpcs_serdes *sds,
 {
 	int ret;
 
-	if (sds->id > 5)
-		return -EINVAL;
 	if (!rtpcs_838x_sds_is_mode_supported(sds, mode))
 		return -EINVAL;
 
@@ -585,10 +583,6 @@ static void rtpcs_930x_sds_set(struct rtpcs_serdes *sds, u32 mode)
 	u8 sds_id = sds->id;
 
 	pr_info("%s %d\n", __func__, mode);
-	if (sds_id < 0 || sds_id > 11) {
-		pr_err("Wrong SerDes number: %d\n", sds_id);
-		return;
-	}
 
 	regmap_write_bits(sds->ctrl->map, rtpcs_930x_sds_regs[sds_id],
 			  RTL930X_SDS_MASK << rtpcs_930x_sds_lsb[sds_id],
@@ -602,11 +596,6 @@ static u32 rtpcs_930x_sds_mode_get(struct rtpcs_serdes *sds)
 	u8 sds_id = sds->id;
 	u32 v;
 
-	if (sds_id < 0 || sds_id > 11) {
-		pr_err("Wrong SerDes number: %d\n", sds_id);
-		return 0;
-	}
-
 	regmap_read(sds->ctrl->map, rtpcs_930x_sds_regs[sds_id], &v);
 	v >>= rtpcs_930x_sds_lsb[sds_id];
 
@@ -959,11 +948,6 @@ static void rtpcs_930x_sds_mode_set(struct rtpcs_serdes *sds,
 	u32 mode;
 	u32 submode;
 
-	if (sds->id < 0 || sds->id > 11) {
-		pr_err("%s: invalid SerDes number: %d\n", __func__, sds->id);
-		return;
-	}
-
 	switch (phy_mode) {
 	case PHY_INTERFACE_MODE_SGMII:
 	case PHY_INTERFACE_MODE_1000BASEX:
@@ -2231,9 +2215,6 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 {
 	int calib_tries = 0;
 
-	if (sds->id < 0 || sds->id > 11)
-		return -EINVAL;
-
 	/* Rely on setup from U-boot for some modes, e.g. USXGMII */
 	switch (phy_mode) {
 	case PHY_INTERFACE_MODE_1000BASEX:
@@ -2680,9 +2661,6 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 	u32 sds_id = sds->id;
 	int chiptype = 0;
 
-	if (sds_id < 0 || sds_id > 13)
-		return -EINVAL;
-
 	/*
 	 * TODO: USXGMII is currently the swiss army knife to declare 10G
 	 * multi port PHYs. Real devices use other modes instead. Especially
@@ -2835,7 +2813,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 
 	rtpcs_931x_sds_cmu_type_set(sds, mode, chiptype);
 
-	if (sds_id >= 2 && sds_id <= 13) {
+	if (sds_id >= 2) {
 		if (chiptype)
 			rtpcs_sds_write(sds, 0x2E, 0x1, board_sds_tx_type1[sds_id - 2]);
 		else {
@@ -2954,9 +2932,6 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 	int ret = 0;
 
-	if (link->sds->id < 0)
-		return 0;
-
 	/*
 	 * TODO: This (or copies of this) will be the central function for configuring the
 	 * link between PHY and SerDes. As of now a lot of the code is scattered throughout



From lede-commits at lists.infradead.org  Tue Dec 16 04:37:47 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:37:47 -0500
Subject: [openwrt/openwrt]  realtek: pcs: move polarity into SerDes struct
In-Reply-To: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
References: <176588865692.245409.11976921179579866336@git-01.infra.openwrt.org>
Message-ID: <mailman.36328.1765889863.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/56a71f3c82a5d2f39e7db1c1f76a64d2f04b8d87

commit 56a71f3c82a5d2f39e7db1c1f76a64d2f04b8d87
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Thu Dec 11 23:33:59 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c    | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 7c0f737a67..0a1d994da7 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -135,6 +135,9 @@ struct rtpcs_serdes {
 	struct rtpcs_ctrl *ctrl;
 	u8 id;
 	enum rtpcs_sds_mode mode;
+
+	bool rx_pol_inv;
+	bool tx_pol_inv;
 };
 
 struct rtpcs_ctrl {
@@ -144,8 +147,6 @@ struct rtpcs_ctrl {
 	const struct rtpcs_config *cfg;
 	struct rtpcs_serdes serdes[RTPCS_SDS_CNT];
 	struct rtpcs_link *link[RTPCS_PORT_CNT];
-	bool rx_pol_inv[RTPCS_SDS_CNT];
-	bool tx_pol_inv[RTPCS_SDS_CNT];
 	struct mutex lock;
 };
 
@@ -2242,8 +2243,7 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 	pr_info("%s: Configuring RTL9300 SERDES %d\n", __func__, sds->id);
 
 	/* Set SDS polarity */
-	rtpcs_930x_sds_set_polarity(sds, sds->ctrl->tx_pol_inv[sds->id],
-				    sds->ctrl->rx_pol_inv[sds->id]);
+	rtpcs_930x_sds_set_polarity(sds, sds->tx_pol_inv, sds->rx_pol_inv);
 
 	/* Enable SDS in desired mode */
 	rtpcs_930x_sds_mode_set(sds, phy_mode);
@@ -2831,8 +2831,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 		}
 	}
 
-	rtpcs_931x_sds_set_polarity(sds, ctrl->tx_pol_inv[sds_id],
-				    ctrl->rx_pol_inv[sds_id]);
+	rtpcs_931x_sds_set_polarity(sds, sds->tx_pol_inv, sds->rx_pol_inv);
 
 	val = ori & ~BIT(sds_id);
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
@@ -3090,8 +3089,9 @@ static int rtpcs_probe(struct platform_device *pdev)
 		if (sds_id >= ctrl->cfg->serdes_count)
 			return -EINVAL;
 
-		ctrl->rx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-rx");
-		ctrl->tx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-tx");
+		sds = &ctrl->serdes[sds_id];
+		sds->rx_pol_inv = of_property_read_bool(child, "realtek,pnswap-rx");
+		sds->tx_pol_inv = of_property_read_bool(child, "realtek,pnswap-tx");
 	}
 
 	if (ctrl->cfg->init_serdes_common) {



From lede-commits at lists.infradead.org  Tue Dec 16 04:38:28 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 07:38:28 -0500
Subject: [openwrt/openwrt]  realtek: pcs: move polarity into SerDes struct
In-Reply-To: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
References: <176588869779.247790.11706970979422856611@git-01.infra.openwrt.org>
Message-ID: <mailman.36329.1765889869.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/c870f163504a2c91f81cb5de68ddbb10bac03b55

commit c870f163504a2c91f81cb5de68ddbb10bac03b55
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Thu Dec 11 23:33:59 2025 +0000

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 56a71f3c82a5d2f39e7db1c1f76a64d2f04b8d87)
---
 .../realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c    | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 7c0f737a67..0a1d994da7 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -135,6 +135,9 @@ struct rtpcs_serdes {
 	struct rtpcs_ctrl *ctrl;
 	u8 id;
 	enum rtpcs_sds_mode mode;
+
+	bool rx_pol_inv;
+	bool tx_pol_inv;
 };
 
 struct rtpcs_ctrl {
@@ -144,8 +147,6 @@ struct rtpcs_ctrl {
 	const struct rtpcs_config *cfg;
 	struct rtpcs_serdes serdes[RTPCS_SDS_CNT];
 	struct rtpcs_link *link[RTPCS_PORT_CNT];
-	bool rx_pol_inv[RTPCS_SDS_CNT];
-	bool tx_pol_inv[RTPCS_SDS_CNT];
 	struct mutex lock;
 };
 
@@ -2242,8 +2243,7 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 	pr_info("%s: Configuring RTL9300 SERDES %d\n", __func__, sds->id);
 
 	/* Set SDS polarity */
-	rtpcs_930x_sds_set_polarity(sds, sds->ctrl->tx_pol_inv[sds->id],
-				    sds->ctrl->rx_pol_inv[sds->id]);
+	rtpcs_930x_sds_set_polarity(sds, sds->tx_pol_inv, sds->rx_pol_inv);
 
 	/* Enable SDS in desired mode */
 	rtpcs_930x_sds_mode_set(sds, phy_mode);
@@ -2831,8 +2831,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 		}
 	}
 
-	rtpcs_931x_sds_set_polarity(sds, ctrl->tx_pol_inv[sds_id],
-				    ctrl->rx_pol_inv[sds_id]);
+	rtpcs_931x_sds_set_polarity(sds, sds->tx_pol_inv, sds->rx_pol_inv);
 
 	val = ori & ~BIT(sds_id);
 	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
@@ -3090,8 +3089,9 @@ static int rtpcs_probe(struct platform_device *pdev)
 		if (sds_id >= ctrl->cfg->serdes_count)
 			return -EINVAL;
 
-		ctrl->rx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-rx");
-		ctrl->tx_pol_inv[sds_id] = of_property_read_bool(child, "realtek,pnswap-tx");
+		sds = &ctrl->serdes[sds_id];
+		sds->rx_pol_inv = of_property_read_bool(child, "realtek,pnswap-rx");
+		sds->tx_pol_inv = of_property_read_bool(child, "realtek,pnswap-tx");
 	}
 
 	if (ctrl->cfg->init_serdes_common) {



From lede-commits at lists.infradead.org  Tue Dec 16 05:02:02 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 08:02:02 -0500
Subject: [openwrt/openwrt]  realtek: mdio-serdes: use correct device table
 identifier
In-Reply-To: <176589012298.321012.14648902898025956497@git-01.infra.openwrt.org>
References: <176589012298.321012.14648902898025956497@git-01.infra.openwrt.org>
Message-ID: <mailman.36333.1765890127.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d519a3ee86c303989e253538461528c4818dc20e

commit d519a3ee86c303989e253538461528c4818dc20e
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Tue Dec 16 12:06:57 2025 +0000

    realtek: mdio-serdes: use correct device table identifier
    
    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] https://github.com/torvalds/linux/blob/7d0a66e4bb9081d75c82ec4957c50034cb0ea449/include/linux/module.h#L260
    [2] https://github.com/torvalds/linux/blob/adc218676eef25575469234709c2d87185ca223a/include/linux/module.h#L249
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21182
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 097fcc41b4..641a6196b9 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -528,7 +528,7 @@ static const struct of_device_id rtsds_of_match[] = {
 	},
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, rtsds_mdio_of_match);
+MODULE_DEVICE_TABLE(of, rtsds_of_match);
 
 static struct platform_driver rtsds_mdio_driver = {
 	.driver = {



From lede-commits at lists.infradead.org  Tue Dec 16 05:03:13 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 08:03:13 -0500
Subject: [openwrt/openwrt]  realtek: mdio-serdes: use correct device table
 identifier
In-Reply-To: <176589019355.325670.12084936396516109759@git-01.infra.openwrt.org>
References: <176589019355.325670.12084936396516109759@git-01.infra.openwrt.org>
Message-ID: <mailman.36336.1765890197.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/88ab3205fe474e71567701e19444a1a7edb81d71

commit 88ab3205fe474e71567701e19444a1a7edb81d71
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Tue Dec 16 12:06:57 2025 +0000

    realtek: mdio-serdes: use correct device table identifier
    
    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] https://github.com/torvalds/linux/blob/7d0a66e4bb9081d75c82ec4957c50034cb0ea449/include/linux/module.h#L260
    [2] https://github.com/torvalds/linux/blob/adc218676eef25575469234709c2d87185ca223a/include/linux/module.h#L249
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21182
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit d519a3ee86c303989e253538461528c4818dc20e)
---
 .../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 097fcc41b4..641a6196b9 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -528,7 +528,7 @@ static const struct of_device_id rtsds_of_match[] = {
 	},
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, rtsds_mdio_of_match);
+MODULE_DEVICE_TABLE(of, rtsds_of_match);
 
 static struct platform_driver rtsds_mdio_driver = {
 	.driver = {



From lede-commits at lists.infradead.org  Tue Dec 16 11:22:54 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 14:22:54 -0500
Subject: [openwrt/openwrt]  wifi-scripts: update phys after rename_phy_by_name
 call
In-Reply-To: <176591297439.1622893.18370040612841303572@git-01.infra.openwrt.org>
References: <176591297439.1622893.18370040612841303572@git-01.infra.openwrt.org>
Message-ID: <mailman.36537.1765912978.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e4d5e76af059d9c7fe295bbd144a39a77fbb5491

commit e4d5e76af059d9c7fe295bbd144a39a77fbb5491
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Mon Dec 15 19:11:24 2025 +0200

    wifi-scripts: update phys after rename_phy_by_name call
    
    This fixes a failed bring up of the radio on bootup
    if the model defines a rename of phy in its /etc/board.json.
    This specifically impacts Redmi AX6S and any router that does so
    in its /etc/board.json. The fix fortunately is simple, just update
    phy name in phys after rename.
    
    The entry that specifically causes this issue is the following:
    
    {
            <omitted>
            "wlan": {
                    "wl0": {
                            "path": "platform/18000000.wmac",
                            "info": {
                                    "antenna_rx": 15,
                                    "antenna_tx": 15,
                                    "bands": {
                                            "2G": {
                                                    "ht": true,
                                                    "max_width": 40,
                                                    "modes": [
                                                            "NOHT",
                                                            "HT20",
                                                            "HT40"
                                                    ],
                                                    "default_channel": 1
                                            }
                                    },
                                    "radios": [
                                    ]
                            }
                    },
            ...
    }
    
    The issue is that after rename, referenced phy in config is going to be
    wl0 but in phys array it is still phy0; and so it fails to find phy
    and does not bring up radio.
    
    Fixes: https://github.com/openwrt/openwrt/issues/20250
    Fixes: https://github.com/openwrt/openwrt/issues/20339
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/21175
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc b/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc
index 0ec8505670..7ecfd2d204 100644
--- a/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc
+++ b/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc
@@ -57,6 +57,11 @@ function rename_phy_by_name(phys, name, rename) {
 		wiphy: idx,
 		wiphy_name: name
 	});
+
+	let prev_idx = index(phys, prev_name);
+	if (prev_idx >= 0)
+		phys[prev_idx] = name;
+
 	return true;
 }
 



From lede-commits at lists.infradead.org  Tue Dec 16 11:23:32 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 14:23:32 -0500
Subject: [openwrt/openwrt]  wifi-scripts: update phys after rename_phy_by_name
 call
In-Reply-To: <176591301199.1624565.11502410603988574964@git-01.infra.openwrt.org>
References: <176591301199.1624565.11502410603988574964@git-01.infra.openwrt.org>
Message-ID: <mailman.36538.1765913016.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/c432647d180b0176ec806ee8d91f4252e20b350b

commit c432647d180b0176ec806ee8d91f4252e20b350b
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Mon Dec 15 19:11:24 2025 +0200

    wifi-scripts: update phys after rename_phy_by_name call
    
    This fixes a failed bring up of the radio on bootup
    if the model defines a rename of phy in its /etc/board.json.
    This specifically impacts Redmi AX6S and any router that does so
    in its /etc/board.json. The fix fortunately is simple, just update
    phy name in phys after rename.
    
    The entry that specifically causes this issue is the following:
    
    {
            <omitted>
            "wlan": {
                    "wl0": {
                            "path": "platform/18000000.wmac",
                            "info": {
                                    "antenna_rx": 15,
                                    "antenna_tx": 15,
                                    "bands": {
                                            "2G": {
                                                    "ht": true,
                                                    "max_width": 40,
                                                    "modes": [
                                                            "NOHT",
                                                            "HT20",
                                                            "HT40"
                                                    ],
                                                    "default_channel": 1
                                            }
                                    },
                                    "radios": [
                                    ]
                            }
                    },
            ...
    }
    
    The issue is that after rename, referenced phy in config is going to be
    wl0 but in phys array it is still phy0; and so it fails to find phy
    and does not bring up radio.
    
    Fixes: https://github.com/openwrt/openwrt/issues/20250
    Fixes: https://github.com/openwrt/openwrt/issues/20339
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/21175
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit e4d5e76af059d9c7fe295bbd144a39a77fbb5491)
---
 .../network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc b/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc
index 0ec8505670..7ecfd2d204 100644
--- a/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc
+++ b/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc
@@ -57,6 +57,11 @@ function rename_phy_by_name(phys, name, rename) {
 		wiphy: idx,
 		wiphy_name: name
 	});
+
+	let prev_idx = index(phys, prev_name);
+	if (prev_idx >= 0)
+		phys[prev_idx] = name;
+
 	return true;
 }
 



From lede-commits at lists.infradead.org  Tue Dec 16 15:10:21 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 18:10:21 -0500
Subject: [openwrt/openwrt]  uboot-sunxi: fix u-boot build
In-Reply-To: <176592662133.2174105.3337238572699982672@git-01.infra.openwrt.org>
References: <176592662133.2174105.3337238572699982672@git-01.infra.openwrt.org>
Message-ID: <mailman.36580.1765926625.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/86996634f0b4917ccd6106e9d60cd2fd9bd68c6e

commit 86996634f0b4917ccd6106e9d60cd2fd9bd68c6e
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Wed Dec 17 00:06:24 2025 +0100

    uboot-sunxi: fix u-boot build
    
    The u-boot target name has to match the u-boot configuration. Switch
    this back to the old names.
    
    Fixes: d871e95e7f83 ("sunxi: image: sync target profiles names with DT compatible")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/uboot-sunxi/Makefile | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
index 515d6d6a92..7cd061b03f 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -134,7 +134,7 @@ define U-Boot/Mele_M9
   BUILD_DEVICES:=mele_m9
 endef
 
-define U-Boot/a13-som
+define U-Boot/OLIMEX_A13_SOM
   BUILD_SUBTARGET:=cortexa8
   NAME:=Olimex A13 SOM
   BUILD_DEVICES:=olimex_a13-olinuxino
@@ -316,13 +316,13 @@ define U-Boot/pine64_plus
   ATF:=a64
 endef
 
-define U-Boot/bpi_m2_plus_h3
+define U-Boot/bananapi_m2_plus_h3
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Plus H3
   BUILD_DEVICES:=sinovoip_bpi-m2-plus
 endef
 
-define U-Boot/bpi_m3
+define U-Boot/Sinovoip_BPI_M3
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M3
   BUILD_DEVICES:=sinovoip_bpi-m3
@@ -382,19 +382,19 @@ define U-Boot/orangepi_zero3
   ATF:=h616
 endef
 
-define U-Boot/bpi_m2_ultra
+define U-Boot/Bananapi_M2_Ultra
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Ultra
   BUILD_DEVICES:=sinovoip_bpi-m2-ultra
 endef
 
-define U-Boot/bpi_m2_berry
+define U-Boot/bananapi_m2_berry
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Berry
   BUILD_DEVICES:=sinovoip_bpi-m2-berry
 endef
 
-define U-Boot/bpi_p2_zero
+define U-Boot/bananapi_p2_zero
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi P2 Zero
   BUILD_DEVICES:=sinovoip_bpi-p2-zero
@@ -406,25 +406,24 @@ UBOOT_TARGETS := \
 	a64-olinuxino-emmc \
 	A10-OLinuXino-Lime \
 	A13-OLinuXino \
-	a13-som \
 	A20-OLinuXino-Lime \
 	A20-OLinuXino-Lime2 \
 	A20-OLinuXino-Lime2-eMMC \
 	A20-OLinuXino_MICRO \
-	beelink_x2 \
-	bpi_m2_berry \
-	bpi_m2_plus_h3 \
-	bpi_m2_ultra \
-	bpi_m3 \
-	bpi_p2_zero \
+	bananapi_m2_plus_h3 \
 	Bananapi \
+	bananapi_m2_berry \
+	bananapi_p2_zero \
+	Bananapi_M2_Ultra \
 	Bananapro \
+	beelink_x2 \
 	Cubieboard \
 	Cubieboard2 \
 	Cubietruck \
 	Hummingbird_A31 \
 	Marsboard_A10 \
 	Mele_M9 \
+	OLIMEX_A13_SOM \
 	licheepi_nano \
 	LicheePi_Zero \
 	Linksprite_pcDuino \
@@ -454,6 +453,7 @@ UBOOT_TARGETS := \
 	pangolin \
 	popstick \
 	pine64_plus \
+	Sinovoip_BPI_M3 \
 	sopine_baseboard \
 	orangepi_zero_plus \
 	libretech_all_h3_cc_h5



From lede-commits at lists.infradead.org  Tue Dec 16 15:10:56 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 18:10:56 -0500
Subject: [openwrt/openwrt]  uboot-sunxi: fix u-boot build
In-Reply-To: <176592665672.2175378.9545104629715584134@git-01.infra.openwrt.org>
References: <176592665672.2175378.9545104629715584134@git-01.infra.openwrt.org>
Message-ID: <mailman.36581.1765926661.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/74247287ad4e472123aab78706ad857431cb8350

commit 74247287ad4e472123aab78706ad857431cb8350
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Wed Dec 17 00:06:24 2025 +0100

    uboot-sunxi: fix u-boot build
    
    The u-boot target name has to match the u-boot configuration. Switch
    this back to the old names.
    
    Fixes: d871e95e7f83 ("sunxi: image: sync target profiles names with DT compatible")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 86996634f0b4917ccd6106e9d60cd2fd9bd68c6e)
---
 package/boot/uboot-sunxi/Makefile | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
index 515d6d6a92..7cd061b03f 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -134,7 +134,7 @@ define U-Boot/Mele_M9
   BUILD_DEVICES:=mele_m9
 endef
 
-define U-Boot/a13-som
+define U-Boot/OLIMEX_A13_SOM
   BUILD_SUBTARGET:=cortexa8
   NAME:=Olimex A13 SOM
   BUILD_DEVICES:=olimex_a13-olinuxino
@@ -316,13 +316,13 @@ define U-Boot/pine64_plus
   ATF:=a64
 endef
 
-define U-Boot/bpi_m2_plus_h3
+define U-Boot/bananapi_m2_plus_h3
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Plus H3
   BUILD_DEVICES:=sinovoip_bpi-m2-plus
 endef
 
-define U-Boot/bpi_m3
+define U-Boot/Sinovoip_BPI_M3
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M3
   BUILD_DEVICES:=sinovoip_bpi-m3
@@ -382,19 +382,19 @@ define U-Boot/orangepi_zero3
   ATF:=h616
 endef
 
-define U-Boot/bpi_m2_ultra
+define U-Boot/Bananapi_M2_Ultra
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Ultra
   BUILD_DEVICES:=sinovoip_bpi-m2-ultra
 endef
 
-define U-Boot/bpi_m2_berry
+define U-Boot/bananapi_m2_berry
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi M2 Berry
   BUILD_DEVICES:=sinovoip_bpi-m2-berry
 endef
 
-define U-Boot/bpi_p2_zero
+define U-Boot/bananapi_p2_zero
   BUILD_SUBTARGET:=cortexa7
   NAME:=Bananapi P2 Zero
   BUILD_DEVICES:=sinovoip_bpi-p2-zero
@@ -406,25 +406,24 @@ UBOOT_TARGETS := \
 	a64-olinuxino-emmc \
 	A10-OLinuXino-Lime \
 	A13-OLinuXino \
-	a13-som \
 	A20-OLinuXino-Lime \
 	A20-OLinuXino-Lime2 \
 	A20-OLinuXino-Lime2-eMMC \
 	A20-OLinuXino_MICRO \
-	beelink_x2 \
-	bpi_m2_berry \
-	bpi_m2_plus_h3 \
-	bpi_m2_ultra \
-	bpi_m3 \
-	bpi_p2_zero \
+	bananapi_m2_plus_h3 \
 	Bananapi \
+	bananapi_m2_berry \
+	bananapi_p2_zero \
+	Bananapi_M2_Ultra \
 	Bananapro \
+	beelink_x2 \
 	Cubieboard \
 	Cubieboard2 \
 	Cubietruck \
 	Hummingbird_A31 \
 	Marsboard_A10 \
 	Mele_M9 \
+	OLIMEX_A13_SOM \
 	licheepi_nano \
 	LicheePi_Zero \
 	Linksprite_pcDuino \
@@ -454,6 +453,7 @@ UBOOT_TARGETS := \
 	pangolin \
 	popstick \
 	pine64_plus \
+	Sinovoip_BPI_M3 \
 	sopine_baseboard \
 	orangepi_zero_plus \
 	libretech_all_h3_cc_h5



From lede-commits at lists.infradead.org  Tue Dec 16 15:32:07 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 18:32:07 -0500
Subject: [openwrt/openwrt]  kernel: Fix boot of realtek rtl838x
In-Reply-To: <176592792640.2234665.11362323041409751167@git-01.infra.openwrt.org>
References: <176592792640.2234665.11362323041409751167@git-01.infra.openwrt.org>
Message-ID: <mailman.36586.1765927931.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0bfc66e7b50ef5d0653bc209a7d29ab8e3a7c6b2

commit 0bfc66e7b50ef5d0653bc209a7d29ab8e3a7c6b2
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 15 02:02:35 2025 +0100

    kernel: Fix boot of realtek rtl838x
    
    Revert two patches from upstream Linux:
    https://github.com/gregkh/linux/commit/135178e90aa43ad949534e1d6e376c4034942caa
    https://github.com/gregkh/linux/commit/63a93d1cd6077d79735f804f5a4957bfb240280c
    
    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 at hauke-m.de/T/#u
    
    Link: https://github.com/openwrt/openwrt/pull/21166
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21126
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch |  60 +++++++++
 ...-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch | 146 +++++++++++++++++++++
 2 files changed, 206 insertions(+)

diff --git a/target/linux/generic/pending-6.12/360-Revert-MIPS-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch b/target/linux/generic/pending-6.12/360-Revert-MIPS-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch
new file mode 100644
index 0000000000..522fccd8e2
--- /dev/null
+++ b/target/linux/generic/pending-6.12/360-Revert-MIPS-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch
@@ -0,0 +1,60 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Mon, 15 Dec 2025 01:45:07 +0100
+Subject: Revert "MIPS: mm: kmalloc tlb_vpn array to avoid stack overflow"
+
+This reverts commit 63a93d1cd6077d79735f804f5a4957bfb240280c.
+---
+ arch/mips/mm/tlb-r4k.c | 18 ++----------------
+ 1 file changed, 2 insertions(+), 16 deletions(-)
+
+--- a/arch/mips/mm/tlb-r4k.c
++++ b/arch/mips/mm/tlb-r4k.c
+@@ -12,7 +12,6 @@
+ #include <linux/init.h>
+ #include <linux/sched.h>
+ #include <linux/smp.h>
+-#include <linux/memblock.h>
+ #include <linux/mm.h>
+ #include <linux/hugetlb.h>
+ #include <linux/export.h>
+@@ -523,26 +522,17 @@ static int r4k_vpn_cmp(const void *a, co
+  * Initialise all TLB entries with unique values that do not clash with
+  * what we have been handed over and what we'll be using ourselves.
+  */
+-static void __ref r4k_tlb_uniquify(void)
++static void r4k_tlb_uniquify(void)
+ {
++	unsigned long tlb_vpns[1 << MIPS_CONF1_TLBS_SIZE];
+ 	int tlbsize = current_cpu_data.tlbsize;
+-	bool use_slab = slab_is_available();
+ 	int start = num_wired_entries();
+-	phys_addr_t tlb_vpn_size;
+-	unsigned long *tlb_vpns;
+ 	unsigned long vpn_mask;
+ 	int cnt, ent, idx, i;
+ 
+ 	vpn_mask = GENMASK(cpu_vmbits - 1, 13);
+ 	vpn_mask |= IS_ENABLED(CONFIG_64BIT) ? 3ULL << 62 : 1 << 31;
+ 
+-	tlb_vpn_size = tlbsize * sizeof(*tlb_vpns);
+-	tlb_vpns = (use_slab ?
+-		    kmalloc(tlb_vpn_size, GFP_KERNEL) :
+-		    memblock_alloc_raw(tlb_vpn_size, sizeof(*tlb_vpns)));
+-	if (WARN_ON(!tlb_vpns))
+-		return; /* Pray local_flush_tlb_all() is good enough. */
+-
+ 	htw_stop();
+ 
+ 	for (i = start, cnt = 0; i < tlbsize; i++, cnt++) {
+@@ -595,10 +585,6 @@ static void __ref r4k_tlb_uniquify(void)
+ 	tlbw_use_hazard();
+ 	htw_start();
+ 	flush_micro_tlb();
+-	if (use_slab)
+-		kfree(tlb_vpns);
+-	else
+-		memblock_free(tlb_vpns, tlb_vpn_size);
+ }
+ 
+ /*
diff --git a/target/linux/generic/pending-6.12/361-Revert-MIPS-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch b/target/linux/generic/pending-6.12/361-Revert-MIPS-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch
new file mode 100644
index 0000000000..826ed8efb2
--- /dev/null
+++ b/target/linux/generic/pending-6.12/361-Revert-MIPS-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch
@@ -0,0 +1,146 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Mon, 15 Dec 2025 01:45:20 +0100
+Subject: Revert "MIPS: mm: Prevent a TLB shutdown on initial uniquification"
+
+This reverts commit 135178e90aa43ad949534e1d6e376c4034942caa.
+---
+ arch/mips/mm/tlb-r4k.c | 100 +++++++++++++++--------------------------
+ 1 file changed, 37 insertions(+), 63 deletions(-)
+
+--- a/arch/mips/mm/tlb-r4k.c
++++ b/arch/mips/mm/tlb-r4k.c
+@@ -15,7 +15,6 @@
+ #include <linux/mm.h>
+ #include <linux/hugetlb.h>
+ #include <linux/export.h>
+-#include <linux/sort.h>
+ 
+ #include <asm/cpu.h>
+ #include <asm/cpu-type.h>
+@@ -509,79 +508,55 @@ static int __init set_ntlb(char *str)
+ 
+ __setup("ntlb=", set_ntlb);
+ 
+-
+-/* Comparison function for EntryHi VPN fields.  */
+-static int r4k_vpn_cmp(const void *a, const void *b)
+-{
+-	long v = *(unsigned long *)a - *(unsigned long *)b;
+-	int s = sizeof(long) > sizeof(int) ? sizeof(long) * 8 - 1: 0;
+-	return s ? (v != 0) | v >> s : v;
+-}
+-
+-/*
+- * Initialise all TLB entries with unique values that do not clash with
+- * what we have been handed over and what we'll be using ourselves.
+- */
++/* Initialise all TLB entries with unique values */
+ static void r4k_tlb_uniquify(void)
+ {
+-	unsigned long tlb_vpns[1 << MIPS_CONF1_TLBS_SIZE];
+-	int tlbsize = current_cpu_data.tlbsize;
+-	int start = num_wired_entries();
+-	unsigned long vpn_mask;
+-	int cnt, ent, idx, i;
+-
+-	vpn_mask = GENMASK(cpu_vmbits - 1, 13);
+-	vpn_mask |= IS_ENABLED(CONFIG_64BIT) ? 3ULL << 62 : 1 << 31;
++	int entry = num_wired_entries();
+ 
+ 	htw_stop();
++	write_c0_entrylo0(0);
++	write_c0_entrylo1(0);
+ 
+-	for (i = start, cnt = 0; i < tlbsize; i++, cnt++) {
+-		unsigned long vpn;
++	while (entry < current_cpu_data.tlbsize) {
++		unsigned long asid_mask = cpu_asid_mask(&current_cpu_data);
++		unsigned long asid = 0;
++		int idx;
+ 
+-		write_c0_index(i);
+-		mtc0_tlbr_hazard();
+-		tlb_read();
+-		tlb_read_hazard();
+-		vpn = read_c0_entryhi();
+-		vpn &= vpn_mask & PAGE_MASK;
+-		tlb_vpns[cnt] = vpn;
++		/* Skip wired MMID to make ginvt_mmid work */
++		if (cpu_has_mmid)
++			asid = MMID_KERNEL_WIRED + 1;
+ 
+-		/* Prevent any large pages from overlapping regular ones.  */
+-		write_c0_pagemask(read_c0_pagemask() & PM_DEFAULT_MASK);
++		/* Check for match before using UNIQUE_ENTRYHI */
++		do {
++			if (cpu_has_mmid) {
++				write_c0_memorymapid(asid);
++				write_c0_entryhi(UNIQUE_ENTRYHI(entry));
++			} else {
++				write_c0_entryhi(UNIQUE_ENTRYHI(entry) | asid);
++			}
++			mtc0_tlbw_hazard();
++			tlb_probe();
++			tlb_probe_hazard();
++			idx = read_c0_index();
++			/* No match or match is on current entry */
++			if (idx < 0 || idx == entry)
++				break;
++			/*
++			 * If we hit a match, we need to try again with
++			 * a different ASID.
++			 */
++			asid++;
++		} while (asid < asid_mask);
++
++		if (idx >= 0 && idx != entry)
++			panic("Unable to uniquify TLB entry %d", idx);
++
++		write_c0_index(entry);
+ 		mtc0_tlbw_hazard();
+ 		tlb_write_indexed();
+-		tlbw_use_hazard();
++		entry++;
+ 	}
+ 
+-	sort(tlb_vpns, cnt, sizeof(tlb_vpns[0]), r4k_vpn_cmp, NULL);
+-
+-	write_c0_pagemask(PM_DEFAULT_MASK);
+-	write_c0_entrylo0(0);
+-	write_c0_entrylo1(0);
+-
+-	idx = 0;
+-	ent = tlbsize;
+-	for (i = start; i < tlbsize; i++)
+-		while (1) {
+-			unsigned long entryhi, vpn;
+-
+-			entryhi = UNIQUE_ENTRYHI(ent);
+-			vpn = entryhi & vpn_mask & PAGE_MASK;
+-
+-			if (idx >= cnt || vpn < tlb_vpns[idx]) {
+-				write_c0_entryhi(entryhi);
+-				write_c0_index(i);
+-				mtc0_tlbw_hazard();
+-				tlb_write_indexed();
+-				ent++;
+-				break;
+-			} else if (vpn == tlb_vpns[idx]) {
+-				ent++;
+-			} else {
+-				idx++;
+-			}
+-		}
+-
+ 	tlbw_use_hazard();
+ 	htw_start();
+ 	flush_micro_tlb();
+@@ -627,7 +602,6 @@ static void r4k_tlb_configure(void)
+ 
+ 	/* From this point on the ARC firmware is dead.	 */
+ 	r4k_tlb_uniquify();
+-	local_flush_tlb_all();
+ 
+ 	/* Did I tell you that ARC SUCKS?  */
+ }



From lede-commits at lists.infradead.org  Tue Dec 16 15:32:06 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 18:32:06 -0500
Subject: [openwrt/openwrt]  kernel: bump 6.12 to 6.12.62
In-Reply-To: <176592792640.2234665.11362323041409751167@git-01.infra.openwrt.org>
References: <176592792640.2234665.11362323041409751167@git-01.infra.openwrt.org>
Message-ID: <mailman.36587.1765927933.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/97e9d7038e1421ec25bbb6567d2a017be60b086d

commit 97e9d7038e1421ec25bbb6567d2a017be60b086d
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Wed Dec 10 15:19:42 2025 -0500

    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 at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21126
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...-phy-Add-documentation-for-Airoha-AN7581-.patch |  2 +-
 ...oha-Add-support-for-Airoha-AN7581-USB-PHY.patch |  2 +-
 .../patches-6.12/901-snand-mtk-bmt-support.patch   |  6 +--
 ...pport-for-all-the-downstream-rpi-sound-ca.patch |  2 +-
 ...ent-xhci_fixup_endpoint-for-interval-adju.patch |  2 +-
 ...-device-quirks-for-Freeway-Airmouse-T3-an.patch |  2 +-
 ...0-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch |  6 +--
 .../950-0344-sdhci-Add-SD-Express-hook.patch       |  2 +-
 ...usb-dwc3-Set-DMA-and-coherent-masks-early.patch | 16 +++---
 ...hci-of-dwcmshc-define-sdio-timeout-clocks.patch | 18 +++----
 ...er-Look-up-preferred-fbdev-node-number-fr.patch |  4 +-
 ...-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch |  4 +-
 ...re-add-support-for-setting-NAK-enhancemen.patch |  4 +-
 ...dhci-of-dwcmshc-define-sdio-timeout-clock.patch |  2 +-
 ...fault-to-Intel-scheme-for-calculating-U1-.patch |  4 +-
 .../patches-6.12/901-nand-enable-en75-bbt.patch    |  2 +-
 .../patches-6.12/902-snand-mtk-bmt-support.patch   |  6 +--
 ...re-CS-deassertion-on-RX-only-transactions.patch | 59 ----------------------
 target/linux/generic/kernel-6.12                   |  4 +-
 ...lock-add-uImage.FIT-subimage-block-driver.patch |  2 +-
 .../701-staging-add-fsl_ppfe-driver.patch          |  4 +-
 .../patches-6.12/330-snand-mtk-bmt-support.patch   |  6 +--
 ...-drivers-spi-mem-Add-spi-calibration-hook.patch |  4 +-
 ...-spinand-Add-calibration-support-for-spin.patch |  2 +-
 .../960-asus-hack-u-boot-ignore-mtdparts.patch     |  4 +-
 ...mtd-nor-support-mtd-name-from-device-tree.patch |  4 +-
 ...mshc-Add-command-queue-support-for-rockch.patch | 16 +++---
 ...mshc-Fix-command-queue-support-for-RK3576.patch |  2 +-
 ...mshc-Disable-internal-clock-auto-gate-for.patch |  2 +-
 ...dwcmshc-reduce-CIT-for-better-performance.patch |  2 +-
 ...-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch |  2 +-
 ...et-starfive-Add-JH7100-audio-reset-driver.patch |  2 +-
 32 files changed, 70 insertions(+), 129 deletions(-)

diff --git a/target/linux/airoha/patches-6.12/220-05-dt-bindings-phy-Add-documentation-for-Airoha-AN7581-.patch b/target/linux/airoha/patches-6.12/220-05-dt-bindings-phy-Add-documentation-for-Airoha-AN7581-.patch
index 3fc0ba7dc7..20236571a0 100644
--- a/target/linux/airoha/patches-6.12/220-05-dt-bindings-phy-Add-documentation-for-Airoha-AN7581-.patch
+++ b/target/linux/airoha/patches-6.12/220-05-dt-bindings-phy-Add-documentation-for-Airoha-AN7581-.patch
@@ -111,7 +111,7 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -737,6 +737,13 @@ S:	Maintained
+@@ -745,6 +745,13 @@ S:	Maintained
  F:	Documentation/devicetree/bindings/spi/airoha,en7581-snand.yaml
  F:	drivers/spi/spi-airoha-snfi.c
  
diff --git a/target/linux/airoha/patches-6.12/220-07-phy-airoha-Add-support-for-Airoha-AN7581-USB-PHY.patch b/target/linux/airoha/patches-6.12/220-07-phy-airoha-Add-support-for-Airoha-AN7581-USB-PHY.patch
index bf106fa544..844e2b43cf 100644
--- a/target/linux/airoha/patches-6.12/220-07-phy-airoha-Add-support-for-Airoha-AN7581-USB-PHY.patch
+++ b/target/linux/airoha/patches-6.12/220-07-phy-airoha-Add-support-for-Airoha-AN7581-USB-PHY.patch
@@ -35,7 +35,7 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -742,6 +742,7 @@ M:	Christian Marangi <ansuelsmth at gmail.c
+@@ -750,6 +750,7 @@ M:	Christian Marangi <ansuelsmth at gmail.c
  L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
  S:	Maintained
  F:	Documentation/devicetree/bindings/phy/airoha,an7581-usb-phy.yaml
diff --git a/target/linux/airoha/patches-6.12/901-snand-mtk-bmt-support.patch b/target/linux/airoha/patches-6.12/901-snand-mtk-bmt-support.patch
index 02566032d4..540e3bf1c0 100644
--- a/target/linux/airoha/patches-6.12/901-snand-mtk-bmt-support.patch
+++ b/target/linux/airoha/patches-6.12/901-snand-mtk-bmt-support.patch
@@ -8,7 +8,7 @@
  
  static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
  {
-@@ -1575,6 +1576,7 @@ static int spinand_probe(struct spi_mem
+@@ -1577,6 +1578,7 @@ static int spinand_probe(struct spi_mem
  	if (ret)
  		return ret;
  
@@ -16,7 +16,7 @@
  	ret = mtd_device_register(mtd, NULL, 0);
  	if (ret)
  		goto err_spinand_cleanup;
-@@ -1582,6 +1584,7 @@ static int spinand_probe(struct spi_mem
+@@ -1584,6 +1586,7 @@ static int spinand_probe(struct spi_mem
  	return 0;
  
  err_spinand_cleanup:
@@ -24,7 +24,7 @@
  	spinand_cleanup(spinand);
  
  	return ret;
-@@ -1600,6 +1603,7 @@ static int spinand_remove(struct spi_mem
+@@ -1602,6 +1605,7 @@ static int spinand_remove(struct spi_mem
  	if (ret)
  		return ret;
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch b/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch
index c6ce4dd6db..61b880bb43 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch
@@ -18626,7 +18626,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  	 * For devices with more than one control interface, we assume the
 --- a/sound/usb/quirks.c
 +++ b/sound/usb/quirks.c
-@@ -2378,6 +2378,8 @@ static const struct usb_audio_quirk_flag
+@@ -2385,6 +2385,8 @@ static const struct usb_audio_quirk_flag
  		   QUIRK_FLAG_ALIGN_TRANSFER),
  	DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */
  		   QUIRK_FLAG_ALIGN_TRANSFER),
diff --git a/target/linux/bcm27xx/patches-6.12/950-0125-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-6.12/950-0125-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
index 0491be4369..88c67d2ba5 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0125-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0125-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
@@ -124,7 +124,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
   * non-error returns are a promise to giveback() the urb later
   * we drop ownership so next owner (or urb unlink) can get it
   */
-@@ -5386,6 +5489,7 @@ static const struct hc_driver xhci_hc_dr
+@@ -5387,6 +5490,7 @@ static const struct hc_driver xhci_hc_dr
  	.endpoint_reset =	xhci_endpoint_reset,
  	.check_bandwidth =	xhci_check_bandwidth,
  	.reset_bandwidth =	xhci_reset_bandwidth,
diff --git a/target/linux/bcm27xx/patches-6.12/950-0132-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-6.12/950-0132-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
index a834c5dcc3..1b1b8d7746 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0132-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0132-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
@@ -32,7 +32,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
  #define USB_VENDOR_ID_BELKIN		0x050d
  #define USB_DEVICE_ID_FLIP_KVM		0x3201
  
-@@ -1470,6 +1473,9 @@
+@@ -1471,6 +1474,9 @@
  #define USB_VENDOR_ID_XIAOMI		0x2717
  #define USB_DEVICE_ID_MI_SILENT_MOUSE	0x5014
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch b/target/linux/bcm27xx/patches-6.12/950-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch
index 9abbcd0bae..b99b85649a 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch
@@ -75,7 +75,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
 --- a/drivers/usb/host/xhci-ring.c
 +++ b/drivers/usb/host/xhci-ring.c
-@@ -3661,6 +3661,48 @@ static int xhci_align_td(struct xhci_hcd
+@@ -3666,6 +3666,48 @@ static int xhci_align_td(struct xhci_hcd
  	return 1;
  }
  
@@ -124,7 +124,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  /* This is very similar to what ehci-q.c qtd_fill() does */
  int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
  		struct urb *urb, int slot_id, unsigned int ep_index)
-@@ -3815,6 +3857,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
+@@ -3820,6 +3862,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
  	}
  
  	check_trb_math(urb, enqd_len);
@@ -133,7 +133,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
  			start_cycle, start_trb);
  	return 0;
-@@ -3963,6 +4007,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
+@@ -3968,6 +4012,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
  			/* Event on completion */
  			field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state);
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0344-sdhci-Add-SD-Express-hook.patch b/target/linux/bcm27xx/patches-6.12/950-0344-sdhci-Add-SD-Express-hook.patch
index 7fe2856c9f..ef89cdb217 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0344-sdhci-Add-SD-Express-hook.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0344-sdhci-Add-SD-Express-hook.patch
@@ -12,7 +12,7 @@ sdhci: remove PYA0_INTR_BUG quirk. Add quirks to disable some of the higher SDR
 
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -1236,7 +1236,11 @@ static const struct dwcmshc_pltfm_data s
+@@ -1241,7 +1241,11 @@ static const struct dwcmshc_pltfm_data s
  		.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
  			  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
  		.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
diff --git a/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch b/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
index e60f4e9232..97030141eb 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
@@ -212,7 +212,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	},
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -1319,6 +1319,24 @@ static void dwc3_config_threshold(struct
+@@ -1320,6 +1320,24 @@ static void dwc3_config_threshold(struct
  	}
  }
  
@@ -237,7 +237,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  /**
   * dwc3_core_init - Low-level initialization of DWC3 Core
   * @dwc: Pointer to our controller context structure
-@@ -1386,6 +1404,8 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1387,6 +1405,8 @@ static int dwc3_core_init(struct dwc3 *d
  
  	dwc3_config_soc_bus(dwc);
  
@@ -246,7 +246,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	ret = dwc3_phy_power_on(dwc);
  	if (ret)
  		goto err_exit_phy;
-@@ -1490,6 +1510,24 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1491,6 +1511,24 @@ static int dwc3_core_init(struct dwc3 *d
  		dwc3_writel(dwc->regs, DWC3_LLUCTL, reg);
  	}
  
@@ -271,7 +271,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	return 0;
  
  err_power_off_phy:
-@@ -1675,6 +1713,7 @@ static void dwc3_get_properties(struct d
+@@ -1676,6 +1714,7 @@ static void dwc3_get_properties(struct d
  	u8			tx_thr_num_pkt_prd = 0;
  	u8			tx_max_burst_prd = 0;
  	u8			tx_fifo_resize_max_num;
@@ -279,7 +279,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  
  	/* default to highest possible threshold */
  	lpm_nyet_threshold = 0xf;
-@@ -1695,6 +1734,9 @@ static void dwc3_get_properties(struct d
+@@ -1696,6 +1735,9 @@ static void dwc3_get_properties(struct d
  	 */
  	tx_fifo_resize_max_num = 6;
  
@@ -289,7 +289,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	dwc->maximum_speed = usb_get_maximum_speed(dev);
  	dwc->max_ssp_rate = usb_get_maximum_ssp_rate(dev);
  	dwc->dr_mode = usb_get_dr_mode(dev);
-@@ -1809,6 +1851,9 @@ static void dwc3_get_properties(struct d
+@@ -1810,6 +1852,9 @@ static void dwc3_get_properties(struct d
  	dwc->dis_split_quirk = device_property_read_bool(dev,
  				"snps,dis-split-quirk");
  
@@ -299,7 +299,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	dwc->lpm_nyet_threshold = lpm_nyet_threshold;
  	dwc->tx_de_emphasis = tx_de_emphasis;
  
-@@ -1826,6 +1871,8 @@ static void dwc3_get_properties(struct d
+@@ -1827,6 +1872,8 @@ static void dwc3_get_properties(struct d
  	dwc->tx_thr_num_pkt_prd = tx_thr_num_pkt_prd;
  	dwc->tx_max_burst_prd = tx_max_burst_prd;
  
@@ -308,7 +308,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	dwc->tx_fifo_resize_max_num = tx_fifo_resize_max_num;
  }
  
-@@ -2184,6 +2231,12 @@ static int dwc3_probe(struct platform_de
+@@ -2185,6 +2232,12 @@ static int dwc3_probe(struct platform_de
  	if (IS_ERR(dwc->usb_psy))
  		return dev_err_probe(dev, PTR_ERR(dwc->usb_psy), "couldn't get usb power supply\n");
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch b/target/linux/bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch
index 9cf0c1ad16..ebdb57af0a 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch
@@ -30,8 +30,8 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	int vendor_specific_area1; /* P_VENDOR_SPECIFIC_AREA1 reg */
  	int vendor_specific_area2; /* P_VENDOR_SPECIFIC_AREA2 reg */
  
-@@ -289,6 +290,17 @@ static void dwcmshc_adma_write_desc(stru
- 	sdhci_adma_write_desc(host, desc, addr, len, cmd);
+@@ -302,6 +303,17 @@ static void dwcmshc_reset(struct sdhci_h
+ 		sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS);
  }
  
 +static void dwcmshc_set_clock(struct sdhci_host *host, unsigned int clock)
@@ -48,7 +48,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  static unsigned int dwcmshc_get_max_clock(struct sdhci_host *host)
  {
  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
-@@ -1138,10 +1150,11 @@ static int sg2042_init(struct device *de
+@@ -1143,10 +1155,11 @@ static int sg2042_init(struct device *de
  }
  
  static const struct sdhci_ops sdhci_dwcmshc_ops = {
@@ -58,10 +58,10 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	.set_uhs_signaling	= dwcmshc_set_uhs_signaling,
  	.get_max_clock		= dwcmshc_get_max_clock,
 +	.get_timeout_clock	= sdhci_pltfm_clk_get_timeout_clock,
- 	.reset			= sdhci_reset,
+ 	.reset			= dwcmshc_reset,
  	.adma_write_desc	= dwcmshc_adma_write_desc,
  	.irq			= dwcmshc_cqe_irq_handler,
-@@ -1214,8 +1227,10 @@ static const struct sdhci_ops sdhci_dwcm
+@@ -1219,8 +1232,10 @@ static const struct sdhci_ops sdhci_dwcm
  static const struct dwcmshc_pltfm_data sdhci_dwcmshc_pdata = {
  	.pdata = {
  		.ops = &sdhci_dwcmshc_ops,
@@ -74,7 +74,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	},
  };
  
-@@ -1230,6 +1245,15 @@ static const struct dwcmshc_pltfm_data s
+@@ -1235,6 +1250,15 @@ static const struct dwcmshc_pltfm_data s
  };
  #endif
  
@@ -90,7 +90,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  static const struct dwcmshc_pltfm_data sdhci_dwcmshc_rk35xx_pdata = {
  	.pdata = {
  		.ops = &sdhci_dwcmshc_rk35xx_ops,
-@@ -1353,6 +1377,10 @@ dsbl_cqe_caps:
+@@ -1358,6 +1382,10 @@ dsbl_cqe_caps:
  
  static const struct of_device_id sdhci_dwcmshc_dt_ids[] = {
  	{
@@ -101,7 +101,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		.compatible = "rockchip,rk3588-dwcmshc",
  		.data = &sdhci_dwcmshc_rk35xx_pdata,
  	},
-@@ -1445,13 +1473,32 @@ static int dwcmshc_probe(struct platform
+@@ -1450,13 +1478,32 @@ static int dwcmshc_probe(struct platform
  		priv->bus_clk = devm_clk_get(dev, "bus");
  		if (!IS_ERR(priv->bus_clk))
  			clk_prepare_enable(priv->bus_clk);
@@ -134,7 +134,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  
  	priv->vendor_specific_area1 =
  		sdhci_readl(host, DWCMSHC_P_VENDOR_AREA1) & DWCMSHC_AREA1_MASK;
-@@ -1511,6 +1558,7 @@ err_rpm:
+@@ -1516,6 +1563,7 @@ err_rpm:
  	pm_runtime_put_noidle(dev);
  err_clk:
  	clk_disable_unprepare(pltfm_host->clk);
diff --git a/target/linux/bcm27xx/patches-6.12/950-0393-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch b/target/linux/bcm27xx/patches-6.12/950-0393-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch
index 3d059f253a..a563c222b1 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0393-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0393-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch
@@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
 
 --- a/drivers/gpu/drm/drm_fb_helper.c
 +++ b/drivers/gpu/drm/drm_fb_helper.c
-@@ -1803,7 +1803,7 @@ __drm_fb_helper_initial_config_and_unloc
+@@ -1797,7 +1797,7 @@ __drm_fb_helper_initial_config_and_unloc
  	struct drm_device *dev = fb_helper->dev;
  	struct fb_info *info;
  	unsigned int width, height;
@@ -28,7 +28,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  
  	width = dev->mode_config.max_width;
  	height = dev->mode_config.max_height;
-@@ -1831,6 +1831,15 @@ __drm_fb_helper_initial_config_and_unloc
+@@ -1825,6 +1825,15 @@ __drm_fb_helper_initial_config_and_unloc
  	 * register the fbdev emulation instance in kernel_fb_helper_list. */
  	mutex_unlock(&fb_helper->lock);
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0413-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch b/target/linux/bcm27xx/patches-6.12/950-0413-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch
index 80046cc195..f8e80fc4d0 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0413-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0413-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch
@@ -16,7 +16,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
 
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -1485,6 +1485,9 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1486,6 +1486,9 @@ static int dwc3_core_init(struct dwc3 *d
  		if (dwc->parkmode_disable_hs_quirk)
  			reg |= DWC3_GUCTL1_PARKMODE_DISABLE_HS;
  
@@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		if (DWC3_VER_IS_WITHIN(DWC3, 290A, ANY)) {
  			if (dwc->maximum_speed == USB_SPEED_FULL ||
  			    dwc->maximum_speed == USB_SPEED_HIGH)
-@@ -1831,6 +1834,8 @@ static void dwc3_get_properties(struct d
+@@ -1832,6 +1835,8 @@ static void dwc3_get_properties(struct d
  				"snps,parkmode-disable-ss-quirk");
  	dwc->parkmode_disable_hs_quirk = device_property_read_bool(dev,
  				"snps,parkmode-disable-hs-quirk");
diff --git a/target/linux/bcm27xx/patches-6.12/950-0524-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch b/target/linux/bcm27xx/patches-6.12/950-0524-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch
index 666c391c4f..92cb7e9481 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0524-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0524-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch
@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
 
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -1479,6 +1479,12 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1480,6 +1480,12 @@ static int dwc3_core_init(struct dwc3 *d
  		if (dwc->dis_tx_ipgap_linecheck_quirk)
  			reg |= DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS;
  
@@ -35,7 +35,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		if (dwc->parkmode_disable_ss_quirk)
  			reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS;
  
-@@ -1830,6 +1836,10 @@ static void dwc3_get_properties(struct d
+@@ -1831,6 +1837,10 @@ static void dwc3_get_properties(struct d
  				"snps,resume-hs-terminations");
  	dwc->ulpi_ext_vbus_drv = device_property_read_bool(dev,
  				"snps,ulpi-ext-vbus-drv");
diff --git a/target/linux/bcm27xx/patches-6.12/950-0947-fixup-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clock.patch b/target/linux/bcm27xx/patches-6.12/950-0947-fixup-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clock.patch
index 809ab256f4..727815eb9f 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0947-fixup-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clock.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0947-fixup-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clock.patch
@@ -19,7 +19,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -1245,13 +1245,15 @@ static const struct dwcmshc_pltfm_data s
+@@ -1250,13 +1250,15 @@ static const struct dwcmshc_pltfm_data s
  };
  #endif
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0950-usb-xhci-default-to-Intel-scheme-for-calculating-U1-.patch b/target/linux/bcm27xx/patches-6.12/950-0950-usb-xhci-default-to-Intel-scheme-for-calculating-U1-.patch
index 33f8ca71ad..cdd429ba01 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0950-usb-xhci-default-to-Intel-scheme-for-calculating-U1-.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0950-usb-xhci-default-to-Intel-scheme-for-calculating-U1-.patch
@@ -40,7 +40,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  static bool td_on_ring(struct xhci_td *td, struct xhci_ring *ring)
  {
  	struct xhci_segment *seg;
-@@ -4791,7 +4795,7 @@ static u16 xhci_calculate_u1_timeout(str
+@@ -4792,7 +4796,7 @@ static u16 xhci_calculate_u1_timeout(str
  		}
  	}
  
@@ -49,7 +49,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		timeout_ns = xhci_calculate_intel_u1_timeout(udev, desc);
  	else
  		timeout_ns = udev->u1_params.sel;
-@@ -4855,7 +4859,7 @@ static u16 xhci_calculate_u2_timeout(str
+@@ -4856,7 +4860,7 @@ static u16 xhci_calculate_u2_timeout(str
  		}
  	}
  
diff --git a/target/linux/econet/patches-6.12/901-nand-enable-en75-bbt.patch b/target/linux/econet/patches-6.12/901-nand-enable-en75-bbt.patch
index 4b6f2d9e4f..67c7c9ba6a 100644
--- a/target/linux/econet/patches-6.12/901-nand-enable-en75-bbt.patch
+++ b/target/linux/econet/patches-6.12/901-nand-enable-en75-bbt.patch
@@ -29,7 +29,7 @@ Signed-off-by: Caleb James DeLisle <cjd at cjdns.fr>
  {
 --- a/drivers/mtd/nand/mtk_bmt.c
 +++ b/drivers/mtd/nand/mtk_bmt.c
-@@ -422,6 +422,8 @@ int mtk_bmt_attach(struct mtd_info *mtd)
+@@ -421,6 +421,8 @@ int mtk_bmt_attach(struct mtd_info *mtd)
  		bmtd.ops = &mtk_bmt_nmbm_ops;
  	else if (of_property_read_bool(np, "mediatek,bbt"))
  		bmtd.ops = &mtk_bmt_bbt_ops;
diff --git a/target/linux/econet/patches-6.12/902-snand-mtk-bmt-support.patch b/target/linux/econet/patches-6.12/902-snand-mtk-bmt-support.patch
index 02566032d4..540e3bf1c0 100644
--- a/target/linux/econet/patches-6.12/902-snand-mtk-bmt-support.patch
+++ b/target/linux/econet/patches-6.12/902-snand-mtk-bmt-support.patch
@@ -8,7 +8,7 @@
  
  static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
  {
-@@ -1575,6 +1576,7 @@ static int spinand_probe(struct spi_mem
+@@ -1577,6 +1578,7 @@ static int spinand_probe(struct spi_mem
  	if (ret)
  		return ret;
  
@@ -16,7 +16,7 @@
  	ret = mtd_device_register(mtd, NULL, 0);
  	if (ret)
  		goto err_spinand_cleanup;
-@@ -1582,6 +1584,7 @@ static int spinand_probe(struct spi_mem
+@@ -1584,6 +1586,7 @@ static int spinand_probe(struct spi_mem
  	return 0;
  
  err_spinand_cleanup:
@@ -24,7 +24,7 @@
  	spinand_cleanup(spinand);
  
  	return ret;
-@@ -1600,6 +1603,7 @@ static int spinand_remove(struct spi_mem
+@@ -1602,6 +1605,7 @@ static int spinand_remove(struct spi_mem
  	if (ret)
  		return ret;
  
diff --git a/target/linux/generic/backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch b/target/linux/generic/backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch
deleted file mode 100644
index 6a8889ee3c..0000000000
--- a/target/linux/generic/backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From fd9862f726aedbc2f29a29916cabed7bcf5cadb6 Mon Sep 17 00:00:00 2001
-From: Hang Zhou <929513338 at qq.com>
-Date: Mon, 17 Nov 2025 01:08:35 +1100
-Subject: [PATCH] spi: bcm63xx: fix premature CS deassertion on RX-only
- transactions
-
-On BCM6358 (and also observed on BCM6368) the controller appears to
-only generate as many SPI clocks as bytes that have been written into
-the TX FIFO. For RX-only transfers the driver programs the transfer
-length in SPI_MSG_CTL but does not write anything into the FIFO, so
-chip select is deasserted early and the RX transfer segment is never
-fully clocked in.
-
-A concrete failing case is a three-transfer MAC address read from
-SPI-NOR:
-  - TX 0x03 (read command)
-  - TX 3-byte address
-  - RX 6 bytes (MAC)
-
-In contrast, a two-transfer JEDEC-ID read (0x9f + 6-byte RX) works
-because the driver uses prepend_len and writes dummy bytes into the
-TX FIFO for the RX part.
-
-Fix this by writing 0xff dummy bytes into the TX FIFO for RX-only
-segments so that the number of bytes written to the FIFO matches the
-total message length seen by the controller.
-
-Fixes: b17de076062a ("spi/bcm63xx: work around inability to keep CS up")
-
-Signed-off-by: Hang Zhou <929513338 at qq.com>
-Link: https://patch.msgid.link/tencent_7AC88FCB3076489A4A7E6C2163DF1ACF8D06 at qq.com
-Signed-off-by: Mark Brown <broonie at kernel.org>
----
- drivers/spi/spi-bcm63xx.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
---- a/drivers/spi/spi-bcm63xx.c
-+++ b/drivers/spi/spi-bcm63xx.c
-@@ -247,6 +247,20 @@ static int bcm63xx_txrx_bufs(struct spi_
- 
- 		if (t->rx_buf) {
- 			do_rx = true;
-+
-+			/*
-+			 * In certain hardware implementations, there appears to be a
-+			 * hidden accumulator that tracks the number of bytes written into
-+			 * the hardware FIFO, and this accumulator overrides the length in
-+			 * the SPI_MSG_CTL register.
-+			 *
-+			 * Therefore, for read-only transfers, we need to write some dummy
-+			 * value into the FIFO to keep the accumulator tracking the correct
-+			 * length.
-+			 */
-+			if (!t->tx_buf)
-+				memset_io(bs->tx_io + len, 0xFF, t->len);
-+
- 			/* prepend is half-duplex write only */
- 			if (t == first)
- 				prepend_len = 0;
diff --git a/target/linux/generic/kernel-6.12 b/target/linux/generic/kernel-6.12
index 73c2f33a10..0a9808b6be 100644
--- a/target/linux/generic/kernel-6.12
+++ b/target/linux/generic/kernel-6.12
@@ -1,2 +1,2 @@
-LINUX_VERSION-6.12 = .60
-LINUX_KERNEL_HASH-6.12.60 = a63096b2147411d683cecbf87622bb2ff4885bac2b3641d3d4f10250c89cdcf8
+LINUX_VERSION-6.12 = .62
+LINUX_KERNEL_HASH-6.12.62 = 13e2c685ac8fab5dd992dd105732554dae514aef350c2a8c7418e7b74eb62c13
diff --git a/target/linux/generic/pending-6.12/510-block-add-uImage.FIT-subimage-block-driver.patch b/target/linux/generic/pending-6.12/510-block-add-uImage.FIT-subimage-block-driver.patch
index c3d246c5ee..21615160a9 100644
--- a/target/linux/generic/pending-6.12/510-block-add-uImage.FIT-subimage-block-driver.patch
+++ b/target/linux/generic/pending-6.12/510-block-add-uImage.FIT-subimage-block-driver.patch
@@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -23668,6 +23668,12 @@ F:	Documentation/filesystems/ubifs-authe
+@@ -23663,6 +23663,12 @@ F:	Documentation/filesystems/ubifs-authe
  F:	Documentation/filesystems/ubifs.rst
  F:	fs/ubifs/
  
diff --git a/target/linux/layerscape/patches-6.12/701-staging-add-fsl_ppfe-driver.patch b/target/linux/layerscape/patches-6.12/701-staging-add-fsl_ppfe-driver.patch
index 04efc15270..44797dc7bf 100644
--- a/target/linux/layerscape/patches-6.12/701-staging-add-fsl_ppfe-driver.patch
+++ b/target/linux/layerscape/patches-6.12/701-staging-add-fsl_ppfe-driver.patch
@@ -962,7 +962,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong at nxp.com>
  L:	linux-spi at vger.kernel.org
 --- a/drivers/staging/Kconfig
 +++ b/drivers/staging/Kconfig
-@@ -64,4 +64,6 @@ source "drivers/staging/fieldbus/Kconfig
+@@ -62,4 +62,6 @@ source "drivers/staging/fieldbus/Kconfig
  
  source "drivers/staging/vme_user/Kconfig"
  
@@ -971,7 +971,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong at nxp.com>
  endif # STAGING
 --- a/drivers/staging/Makefile
 +++ b/drivers/staging/Makefile
-@@ -21,3 +21,4 @@ obj-$(CONFIG_GREYBUS)		+= greybus/
+@@ -20,3 +20,4 @@ obj-$(CONFIG_GREYBUS)		+= greybus/
  obj-$(CONFIG_BCM2835_VCHIQ)	+= vc04_services/
  obj-$(CONFIG_XIL_AXIS_FIFO)	+= axis-fifo/
  obj-$(CONFIG_FIELDBUS_DEV)     += fieldbus/
diff --git a/target/linux/mediatek/patches-6.12/330-snand-mtk-bmt-support.patch b/target/linux/mediatek/patches-6.12/330-snand-mtk-bmt-support.patch
index 02566032d4..540e3bf1c0 100644
--- a/target/linux/mediatek/patches-6.12/330-snand-mtk-bmt-support.patch
+++ b/target/linux/mediatek/patches-6.12/330-snand-mtk-bmt-support.patch
@@ -8,7 +8,7 @@
  
  static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
  {
-@@ -1575,6 +1576,7 @@ static int spinand_probe(struct spi_mem
+@@ -1577,6 +1578,7 @@ static int spinand_probe(struct spi_mem
  	if (ret)
  		return ret;
  
@@ -16,7 +16,7 @@
  	ret = mtd_device_register(mtd, NULL, 0);
  	if (ret)
  		goto err_spinand_cleanup;
-@@ -1582,6 +1584,7 @@ static int spinand_probe(struct spi_mem
+@@ -1584,6 +1586,7 @@ static int spinand_probe(struct spi_mem
  	return 0;
  
  err_spinand_cleanup:
@@ -24,7 +24,7 @@
  	spinand_cleanup(spinand);
  
  	return ret;
-@@ -1600,6 +1603,7 @@ static int spinand_remove(struct spi_mem
+@@ -1602,6 +1605,7 @@ static int spinand_remove(struct spi_mem
  	if (ret)
  		return ret;
  
diff --git a/target/linux/mediatek/patches-6.12/433-drivers-spi-mem-Add-spi-calibration-hook.patch b/target/linux/mediatek/patches-6.12/433-drivers-spi-mem-Add-spi-calibration-hook.patch
index e8377f5c4c..731d911296 100644
--- a/target/linux/mediatek/patches-6.12/433-drivers-spi-mem-Add-spi-calibration-hook.patch
+++ b/target/linux/mediatek/patches-6.12/433-drivers-spi-mem-Add-spi-calibration-hook.patch
@@ -11,7 +11,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang at mediatek.com>
 
 --- a/drivers/spi/spi-mem.c
 +++ b/drivers/spi/spi-mem.c
-@@ -466,6 +466,14 @@ int spi_mem_exec_op(struct spi_mem *mem,
+@@ -486,6 +486,14 @@ int spi_mem_exec_op(struct spi_mem *mem,
  }
  EXPORT_SYMBOL_GPL(spi_mem_exec_op);
  
@@ -28,7 +28,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang at mediatek.com>
   *			upper layer if necessary
 --- a/include/linux/spi/spi-mem.h
 +++ b/include/linux/spi/spi-mem.h
-@@ -372,6 +372,10 @@ bool spi_mem_supports_op(struct spi_mem
+@@ -390,6 +390,10 @@ bool spi_mem_supports_op(struct spi_mem
  int spi_mem_exec_op(struct spi_mem *mem,
  		    const struct spi_mem_op *op);
  
diff --git a/target/linux/mediatek/patches-6.12/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch b/target/linux/mediatek/patches-6.12/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch
index c33931ebc7..64c059c1f2 100644
--- a/target/linux/mediatek/patches-6.12/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch
+++ b/target/linux/mediatek/patches-6.12/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch
@@ -68,7 +68,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang at mediatek.com>
  static int spinand_id_detect(struct spinand_device *spinand)
  {
  	u8 *id = spinand->id.data;
-@@ -1452,6 +1502,10 @@ static int spinand_init(struct spinand_d
+@@ -1454,6 +1504,10 @@ static int spinand_init(struct spinand_d
  	if (!spinand->scratchbuf)
  		return -ENOMEM;
  
diff --git a/target/linux/mediatek/patches-6.12/960-asus-hack-u-boot-ignore-mtdparts.patch b/target/linux/mediatek/patches-6.12/960-asus-hack-u-boot-ignore-mtdparts.patch
index 70ff4dd5b6..4f50d32aa2 100644
--- a/target/linux/mediatek/patches-6.12/960-asus-hack-u-boot-ignore-mtdparts.patch
+++ b/target/linux/mediatek/patches-6.12/960-asus-hack-u-boot-ignore-mtdparts.patch
@@ -29,7 +29,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/mtd/nand/spi/core.c
 +++ b/drivers/mtd/nand/spi/core.c
-@@ -1669,6 +1669,7 @@ static int spinand_remove(struct spi_mem
+@@ -1671,6 +1671,7 @@ static int spinand_remove(struct spi_mem
  
  static const struct spi_device_id spinand_ids[] = {
  	{ .name = "spi-nand" },
@@ -37,7 +37,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  	{ /* sentinel */ },
  };
  MODULE_DEVICE_TABLE(spi, spinand_ids);
-@@ -1676,6 +1677,7 @@ MODULE_DEVICE_TABLE(spi, spinand_ids);
+@@ -1678,6 +1679,7 @@ MODULE_DEVICE_TABLE(spi, spinand_ids);
  #ifdef CONFIG_OF
  static const struct of_device_id spinand_of_ids[] = {
  	{ .compatible = "spi-nand" },
diff --git a/target/linux/pistachio/patches-6.12/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-6.12/401-mtd-nor-support-mtd-name-from-device-tree.patch
index af773a64eb..99a942e077 100644
--- a/target/linux/pistachio/patches-6.12/401-mtd-nor-support-mtd-name-from-device-tree.patch
+++ b/target/linux/pistachio/patches-6.12/401-mtd-nor-support-mtd-name-from-device-tree.patch
@@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
 
 --- a/drivers/spi/spi-mem.c
 +++ b/drivers/spi/spi-mem.c
-@@ -893,7 +893,9 @@ static int spi_mem_probe(struct spi_devi
+@@ -930,7 +930,9 @@ static int spi_mem_probe(struct spi_devi
  {
  	struct spi_mem_driver *memdrv = to_spi_mem_drv(spi->dev.driver);
  	struct spi_controller *ctlr = spi->controller;
@@ -20,7 +20,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
  
  	mem = devm_kzalloc(&spi->dev, sizeof(*mem), GFP_KERNEL);
  	if (!mem)
-@@ -901,10 +903,15 @@ static int spi_mem_probe(struct spi_devi
+@@ -938,10 +940,15 @@ static int spi_mem_probe(struct spi_devi
  
  	mem->spi = spi;
  
diff --git a/target/linux/rockchip/patches-6.12/037-04-v6.19-mmc-sdhci-of-dwcmshc-Add-command-queue-support-for-rockch.patch b/target/linux/rockchip/patches-6.12/037-04-v6.19-mmc-sdhci-of-dwcmshc-Add-command-queue-support-for-rockch.patch
index e7b1c466c1..74e5a8e20b 100644
--- a/target/linux/rockchip/patches-6.12/037-04-v6.19-mmc-sdhci-of-dwcmshc-Add-command-queue-support-for-rockch.patch
+++ b/target/linux/rockchip/patches-6.12/037-04-v6.19-mmc-sdhci-of-dwcmshc-Add-command-queue-support-for-rockch.patch
@@ -48,7 +48,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  	int (*init)(struct device *dev, struct sdhci_host *host, struct dwcmshc_priv *dwc_priv);
  	void (*postinit)(struct sdhci_host *host, struct dwcmshc_priv *dwc_priv);
  };
-@@ -603,6 +607,68 @@ static void dwcmshc_cqhci_dumpregs(struc
+@@ -616,6 +620,68 @@ static void dwcmshc_cqhci_dumpregs(struc
  	sdhci_dumpregs(mmc_priv(mmc));
  }
  
@@ -117,7 +117,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  static void dwcmshc_rk3568_set_clock(struct sdhci_host *host, unsigned int clock)
  {
  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
-@@ -721,6 +787,10 @@ static void rk35xx_sdhci_reset(struct sd
+@@ -734,6 +800,10 @@ static void rk35xx_sdhci_reset(struct sd
  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
  	struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
  	struct rk35xx_priv *priv = dwc_priv->priv;
@@ -128,7 +128,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  
  	if (mask & SDHCI_RESET_ALL && priv->reset) {
  		reset_control_assert(priv->reset);
-@@ -729,6 +799,9 @@ static void rk35xx_sdhci_reset(struct sd
+@@ -742,6 +812,9 @@ static void rk35xx_sdhci_reset(struct sd
  	}
  
  	sdhci_reset(host, mask);
@@ -138,7 +138,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  }
  
  static int dwcmshc_rk35xx_init(struct device *dev, struct sdhci_host *host,
-@@ -1230,6 +1303,15 @@ static const struct dwcmshc_pltfm_data s
+@@ -1235,6 +1308,15 @@ static const struct dwcmshc_pltfm_data s
  };
  #endif
  
@@ -154,7 +154,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  static const struct dwcmshc_pltfm_data sdhci_dwcmshc_rk35xx_pdata = {
  	.pdata = {
  		.ops = &sdhci_dwcmshc_rk35xx_ops,
-@@ -1238,6 +1320,7 @@ static const struct dwcmshc_pltfm_data s
+@@ -1243,6 +1325,7 @@ static const struct dwcmshc_pltfm_data s
  		.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
  			   SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
  	},
@@ -162,7 +162,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  	.init = dwcmshc_rk35xx_init,
  	.postinit = dwcmshc_rk35xx_postinit,
  };
-@@ -1287,7 +1370,8 @@ static const struct cqhci_host_ops dwcms
+@@ -1292,7 +1375,8 @@ static const struct cqhci_host_ops dwcms
  	.set_tran_desc	= dwcmshc_set_tran_desc,
  };
  
@@ -172,7 +172,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  {
  	struct cqhci_host *cq_host;
  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
-@@ -1317,7 +1401,10 @@ static void dwcmshc_cqhci_init(struct sd
+@@ -1322,7 +1406,10 @@ static void dwcmshc_cqhci_init(struct sd
  	}
  
  	cq_host->mmio = host->ioaddr + priv->vendor_specific_area2;
@@ -184,7 +184,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  
  	/* Enable using of 128-bit task descriptors */
  	dma64 = host->flags & SDHCI_USE_64_BIT_DMA;
-@@ -1486,7 +1573,7 @@ static int dwcmshc_probe(struct platform
+@@ -1491,7 +1578,7 @@ static int dwcmshc_probe(struct platform
  		priv->vendor_specific_area2 =
  			sdhci_readw(host, DWCMSHC_P_VENDOR_AREA2);
  
diff --git a/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch b/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch
index c4d9689507..3dd29ffefb 100644
--- a/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch
+++ b/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch
@@ -45,7 +45,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
 
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -1333,6 +1333,7 @@ static const struct dwcmshc_pltfm_data s
+@@ -1338,6 +1338,7 @@ static const struct dwcmshc_pltfm_data s
  		.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
  			   SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
  	},
diff --git a/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch b/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch
index d8a0ed8d14..45db5c1175 100644
--- a/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch
+++ b/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch
@@ -27,7 +27,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
 
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -696,10 +696,11 @@ static void dwcmshc_rk3568_set_clock(str
+@@ -709,10 +709,11 @@ static void dwcmshc_rk3568_set_clock(str
  
  	sdhci_set_clock(host, clock);
  
diff --git a/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch b/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch
index 90647d96c3..55833022ac 100644
--- a/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch
+++ b/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch
@@ -30,7 +30,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  #define CQHCI_SSC2			0x44
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -614,6 +614,11 @@ static void rk35xx_sdhci_cqe_pre_enable(
+@@ -627,6 +627,11 @@ static void rk35xx_sdhci_cqe_pre_enable(
  	struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
  	u32 reg;
  
diff --git a/target/linux/siflower/patches-6.12/016-spi-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch b/target/linux/siflower/patches-6.12/016-spi-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch
index f37f9c8d3a..1aabc0afce 100644
--- a/target/linux/siflower/patches-6.12/016-spi-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch
+++ b/target/linux/siflower/patches-6.12/016-spi-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch
@@ -18,7 +18,7 @@ Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>
 
 --- a/drivers/spi/spi-mem.c
 +++ b/drivers/spi/spi-mem.c
-@@ -368,13 +368,19 @@ int spi_mem_exec_op(struct spi_mem *mem,
+@@ -384,13 +384,19 @@ int spi_mem_exec_op(struct spi_mem *mem,
  	if (!spi_mem_internal_supports_op(mem, op))
  		return -EOPNOTSUPP;
  
diff --git a/target/linux/starfive/patches-6.12/1007-reset-starfive-Add-JH7100-audio-reset-driver.patch b/target/linux/starfive/patches-6.12/1007-reset-starfive-Add-JH7100-audio-reset-driver.patch
index f5d71ff66f..bf4362f923 100644
--- a/target/linux/starfive/patches-6.12/1007-reset-starfive-Add-JH7100-audio-reset-driver.patch
+++ b/target/linux/starfive/patches-6.12/1007-reset-starfive-Add-JH7100-audio-reset-driver.patch
@@ -20,7 +20,7 @@ Signed-off-by: Emil Renner Berthing <kernel at esmil.dk>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -22070,7 +22070,7 @@ STARFIVE JH71X0 RESET CONTROLLER DRIVERS
+@@ -22065,7 +22065,7 @@ STARFIVE JH71X0 RESET CONTROLLER DRIVERS
  M:	Emil Renner Berthing <kernel at esmil.dk>
  M:	Hal Feng <hal.feng at starfivetech.com>
  S:	Maintained



From lede-commits at lists.infradead.org  Tue Dec 16 15:32:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 18:32:45 -0500
Subject: [openwrt/openwrt]  kernel: Fix boot of realtek rtl838x
In-Reply-To: <176592796495.2235932.6762948717185408026@git-01.infra.openwrt.org>
References: <176592796495.2235932.6762948717185408026@git-01.infra.openwrt.org>
Message-ID: <mailman.36590.1765927969.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/fe1b06f7257b49dc0b2046b785e46a27de2cd4fb

commit fe1b06f7257b49dc0b2046b785e46a27de2cd4fb
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Dec 15 02:02:35 2025 +0100

    kernel: Fix boot of realtek rtl838x
    
    Revert two patches from upstream Linux:
    https://github.com/gregkh/linux/commit/135178e90aa43ad949534e1d6e376c4034942caa
    https://github.com/gregkh/linux/commit/63a93d1cd6077d79735f804f5a4957bfb240280c
    
    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 at hauke-m.de/T/#u
    
    Link: https://github.com/openwrt/openwrt/pull/21166
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21126
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 0bfc66e7b50ef5d0653bc209a7d29ab8e3a7c6b2)
---
 ...-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch |  60 +++++++++
 ...-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch | 146 +++++++++++++++++++++
 2 files changed, 206 insertions(+)

diff --git a/target/linux/generic/pending-6.12/360-Revert-MIPS-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch b/target/linux/generic/pending-6.12/360-Revert-MIPS-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch
new file mode 100644
index 0000000000..522fccd8e2
--- /dev/null
+++ b/target/linux/generic/pending-6.12/360-Revert-MIPS-mm-kmalloc-tlb_vpn-array-to-avoid-stack-.patch
@@ -0,0 +1,60 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Mon, 15 Dec 2025 01:45:07 +0100
+Subject: Revert "MIPS: mm: kmalloc tlb_vpn array to avoid stack overflow"
+
+This reverts commit 63a93d1cd6077d79735f804f5a4957bfb240280c.
+---
+ arch/mips/mm/tlb-r4k.c | 18 ++----------------
+ 1 file changed, 2 insertions(+), 16 deletions(-)
+
+--- a/arch/mips/mm/tlb-r4k.c
++++ b/arch/mips/mm/tlb-r4k.c
+@@ -12,7 +12,6 @@
+ #include <linux/init.h>
+ #include <linux/sched.h>
+ #include <linux/smp.h>
+-#include <linux/memblock.h>
+ #include <linux/mm.h>
+ #include <linux/hugetlb.h>
+ #include <linux/export.h>
+@@ -523,26 +522,17 @@ static int r4k_vpn_cmp(const void *a, co
+  * Initialise all TLB entries with unique values that do not clash with
+  * what we have been handed over and what we'll be using ourselves.
+  */
+-static void __ref r4k_tlb_uniquify(void)
++static void r4k_tlb_uniquify(void)
+ {
++	unsigned long tlb_vpns[1 << MIPS_CONF1_TLBS_SIZE];
+ 	int tlbsize = current_cpu_data.tlbsize;
+-	bool use_slab = slab_is_available();
+ 	int start = num_wired_entries();
+-	phys_addr_t tlb_vpn_size;
+-	unsigned long *tlb_vpns;
+ 	unsigned long vpn_mask;
+ 	int cnt, ent, idx, i;
+ 
+ 	vpn_mask = GENMASK(cpu_vmbits - 1, 13);
+ 	vpn_mask |= IS_ENABLED(CONFIG_64BIT) ? 3ULL << 62 : 1 << 31;
+ 
+-	tlb_vpn_size = tlbsize * sizeof(*tlb_vpns);
+-	tlb_vpns = (use_slab ?
+-		    kmalloc(tlb_vpn_size, GFP_KERNEL) :
+-		    memblock_alloc_raw(tlb_vpn_size, sizeof(*tlb_vpns)));
+-	if (WARN_ON(!tlb_vpns))
+-		return; /* Pray local_flush_tlb_all() is good enough. */
+-
+ 	htw_stop();
+ 
+ 	for (i = start, cnt = 0; i < tlbsize; i++, cnt++) {
+@@ -595,10 +585,6 @@ static void __ref r4k_tlb_uniquify(void)
+ 	tlbw_use_hazard();
+ 	htw_start();
+ 	flush_micro_tlb();
+-	if (use_slab)
+-		kfree(tlb_vpns);
+-	else
+-		memblock_free(tlb_vpns, tlb_vpn_size);
+ }
+ 
+ /*
diff --git a/target/linux/generic/pending-6.12/361-Revert-MIPS-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch b/target/linux/generic/pending-6.12/361-Revert-MIPS-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch
new file mode 100644
index 0000000000..826ed8efb2
--- /dev/null
+++ b/target/linux/generic/pending-6.12/361-Revert-MIPS-mm-Prevent-a-TLB-shutdown-on-initial-uni.patch
@@ -0,0 +1,146 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Mon, 15 Dec 2025 01:45:20 +0100
+Subject: Revert "MIPS: mm: Prevent a TLB shutdown on initial uniquification"
+
+This reverts commit 135178e90aa43ad949534e1d6e376c4034942caa.
+---
+ arch/mips/mm/tlb-r4k.c | 100 +++++++++++++++--------------------------
+ 1 file changed, 37 insertions(+), 63 deletions(-)
+
+--- a/arch/mips/mm/tlb-r4k.c
++++ b/arch/mips/mm/tlb-r4k.c
+@@ -15,7 +15,6 @@
+ #include <linux/mm.h>
+ #include <linux/hugetlb.h>
+ #include <linux/export.h>
+-#include <linux/sort.h>
+ 
+ #include <asm/cpu.h>
+ #include <asm/cpu-type.h>
+@@ -509,79 +508,55 @@ static int __init set_ntlb(char *str)
+ 
+ __setup("ntlb=", set_ntlb);
+ 
+-
+-/* Comparison function for EntryHi VPN fields.  */
+-static int r4k_vpn_cmp(const void *a, const void *b)
+-{
+-	long v = *(unsigned long *)a - *(unsigned long *)b;
+-	int s = sizeof(long) > sizeof(int) ? sizeof(long) * 8 - 1: 0;
+-	return s ? (v != 0) | v >> s : v;
+-}
+-
+-/*
+- * Initialise all TLB entries with unique values that do not clash with
+- * what we have been handed over and what we'll be using ourselves.
+- */
++/* Initialise all TLB entries with unique values */
+ static void r4k_tlb_uniquify(void)
+ {
+-	unsigned long tlb_vpns[1 << MIPS_CONF1_TLBS_SIZE];
+-	int tlbsize = current_cpu_data.tlbsize;
+-	int start = num_wired_entries();
+-	unsigned long vpn_mask;
+-	int cnt, ent, idx, i;
+-
+-	vpn_mask = GENMASK(cpu_vmbits - 1, 13);
+-	vpn_mask |= IS_ENABLED(CONFIG_64BIT) ? 3ULL << 62 : 1 << 31;
++	int entry = num_wired_entries();
+ 
+ 	htw_stop();
++	write_c0_entrylo0(0);
++	write_c0_entrylo1(0);
+ 
+-	for (i = start, cnt = 0; i < tlbsize; i++, cnt++) {
+-		unsigned long vpn;
++	while (entry < current_cpu_data.tlbsize) {
++		unsigned long asid_mask = cpu_asid_mask(&current_cpu_data);
++		unsigned long asid = 0;
++		int idx;
+ 
+-		write_c0_index(i);
+-		mtc0_tlbr_hazard();
+-		tlb_read();
+-		tlb_read_hazard();
+-		vpn = read_c0_entryhi();
+-		vpn &= vpn_mask & PAGE_MASK;
+-		tlb_vpns[cnt] = vpn;
++		/* Skip wired MMID to make ginvt_mmid work */
++		if (cpu_has_mmid)
++			asid = MMID_KERNEL_WIRED + 1;
+ 
+-		/* Prevent any large pages from overlapping regular ones.  */
+-		write_c0_pagemask(read_c0_pagemask() & PM_DEFAULT_MASK);
++		/* Check for match before using UNIQUE_ENTRYHI */
++		do {
++			if (cpu_has_mmid) {
++				write_c0_memorymapid(asid);
++				write_c0_entryhi(UNIQUE_ENTRYHI(entry));
++			} else {
++				write_c0_entryhi(UNIQUE_ENTRYHI(entry) | asid);
++			}
++			mtc0_tlbw_hazard();
++			tlb_probe();
++			tlb_probe_hazard();
++			idx = read_c0_index();
++			/* No match or match is on current entry */
++			if (idx < 0 || idx == entry)
++				break;
++			/*
++			 * If we hit a match, we need to try again with
++			 * a different ASID.
++			 */
++			asid++;
++		} while (asid < asid_mask);
++
++		if (idx >= 0 && idx != entry)
++			panic("Unable to uniquify TLB entry %d", idx);
++
++		write_c0_index(entry);
+ 		mtc0_tlbw_hazard();
+ 		tlb_write_indexed();
+-		tlbw_use_hazard();
++		entry++;
+ 	}
+ 
+-	sort(tlb_vpns, cnt, sizeof(tlb_vpns[0]), r4k_vpn_cmp, NULL);
+-
+-	write_c0_pagemask(PM_DEFAULT_MASK);
+-	write_c0_entrylo0(0);
+-	write_c0_entrylo1(0);
+-
+-	idx = 0;
+-	ent = tlbsize;
+-	for (i = start; i < tlbsize; i++)
+-		while (1) {
+-			unsigned long entryhi, vpn;
+-
+-			entryhi = UNIQUE_ENTRYHI(ent);
+-			vpn = entryhi & vpn_mask & PAGE_MASK;
+-
+-			if (idx >= cnt || vpn < tlb_vpns[idx]) {
+-				write_c0_entryhi(entryhi);
+-				write_c0_index(i);
+-				mtc0_tlbw_hazard();
+-				tlb_write_indexed();
+-				ent++;
+-				break;
+-			} else if (vpn == tlb_vpns[idx]) {
+-				ent++;
+-			} else {
+-				idx++;
+-			}
+-		}
+-
+ 	tlbw_use_hazard();
+ 	htw_start();
+ 	flush_micro_tlb();
+@@ -627,7 +602,6 @@ static void r4k_tlb_configure(void)
+ 
+ 	/* From this point on the ARC firmware is dead.	 */
+ 	r4k_tlb_uniquify();
+-	local_flush_tlb_all();
+ 
+ 	/* Did I tell you that ARC SUCKS?  */
+ }



From lede-commits at lists.infradead.org  Tue Dec 16 15:32:44 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 18:32:44 -0500
Subject: [openwrt/openwrt]  kernel: bump 6.12 to 6.12.62
In-Reply-To: <176592796495.2235932.6762948717185408026@git-01.infra.openwrt.org>
References: <176592796495.2235932.6762948717185408026@git-01.infra.openwrt.org>
Message-ID: <mailman.36591.1765927970.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/0669972095cb7b451101f185730024c2208e92bf

commit 0669972095cb7b451101f185730024c2208e92bf
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Wed Dec 10 15:19:42 2025 -0500

    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 at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21126
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 97e9d7038e1421ec25bbb6567d2a017be60b086d)
---
 ...-phy-Add-documentation-for-Airoha-AN7581-.patch |  2 +-
 ...oha-Add-support-for-Airoha-AN7581-USB-PHY.patch |  2 +-
 .../patches-6.12/901-snand-mtk-bmt-support.patch   |  6 +--
 ...pport-for-all-the-downstream-rpi-sound-ca.patch |  2 +-
 ...ent-xhci_fixup_endpoint-for-interval-adju.patch |  2 +-
 ...-device-quirks-for-Freeway-Airmouse-T3-an.patch |  2 +-
 ...0-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch |  6 +--
 .../950-0344-sdhci-Add-SD-Express-hook.patch       |  2 +-
 ...usb-dwc3-Set-DMA-and-coherent-masks-early.patch | 16 +++---
 ...hci-of-dwcmshc-define-sdio-timeout-clocks.patch | 18 +++----
 ...er-Look-up-preferred-fbdev-node-number-fr.patch |  4 +-
 ...-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch |  4 +-
 ...re-add-support-for-setting-NAK-enhancemen.patch |  4 +-
 ...dhci-of-dwcmshc-define-sdio-timeout-clock.patch |  2 +-
 ...fault-to-Intel-scheme-for-calculating-U1-.patch |  4 +-
 .../patches-6.12/901-nand-enable-en75-bbt.patch    |  2 +-
 .../patches-6.12/902-snand-mtk-bmt-support.patch   |  6 +--
 ...re-CS-deassertion-on-RX-only-transactions.patch | 59 ----------------------
 target/linux/generic/kernel-6.12                   |  4 +-
 ...lock-add-uImage.FIT-subimage-block-driver.patch |  2 +-
 .../701-staging-add-fsl_ppfe-driver.patch          |  4 +-
 .../patches-6.12/330-snand-mtk-bmt-support.patch   |  6 +--
 ...-drivers-spi-mem-Add-spi-calibration-hook.patch |  4 +-
 ...-spinand-Add-calibration-support-for-spin.patch |  2 +-
 .../960-asus-hack-u-boot-ignore-mtdparts.patch     |  4 +-
 ...mtd-nor-support-mtd-name-from-device-tree.patch |  4 +-
 ...mshc-Add-command-queue-support-for-rockch.patch | 16 +++---
 ...mshc-Fix-command-queue-support-for-RK3576.patch |  2 +-
 ...mshc-Disable-internal-clock-auto-gate-for.patch |  2 +-
 ...dwcmshc-reduce-CIT-for-better-performance.patch |  2 +-
 ...-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch |  2 +-
 ...et-starfive-Add-JH7100-audio-reset-driver.patch |  2 +-
 32 files changed, 70 insertions(+), 129 deletions(-)

diff --git a/target/linux/airoha/patches-6.12/220-05-dt-bindings-phy-Add-documentation-for-Airoha-AN7581-.patch b/target/linux/airoha/patches-6.12/220-05-dt-bindings-phy-Add-documentation-for-Airoha-AN7581-.patch
index 3fc0ba7dc7..20236571a0 100644
--- a/target/linux/airoha/patches-6.12/220-05-dt-bindings-phy-Add-documentation-for-Airoha-AN7581-.patch
+++ b/target/linux/airoha/patches-6.12/220-05-dt-bindings-phy-Add-documentation-for-Airoha-AN7581-.patch
@@ -111,7 +111,7 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -737,6 +737,13 @@ S:	Maintained
+@@ -745,6 +745,13 @@ S:	Maintained
  F:	Documentation/devicetree/bindings/spi/airoha,en7581-snand.yaml
  F:	drivers/spi/spi-airoha-snfi.c
  
diff --git a/target/linux/airoha/patches-6.12/220-07-phy-airoha-Add-support-for-Airoha-AN7581-USB-PHY.patch b/target/linux/airoha/patches-6.12/220-07-phy-airoha-Add-support-for-Airoha-AN7581-USB-PHY.patch
index bf106fa544..844e2b43cf 100644
--- a/target/linux/airoha/patches-6.12/220-07-phy-airoha-Add-support-for-Airoha-AN7581-USB-PHY.patch
+++ b/target/linux/airoha/patches-6.12/220-07-phy-airoha-Add-support-for-Airoha-AN7581-USB-PHY.patch
@@ -35,7 +35,7 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -742,6 +742,7 @@ M:	Christian Marangi <ansuelsmth at gmail.c
+@@ -750,6 +750,7 @@ M:	Christian Marangi <ansuelsmth at gmail.c
  L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
  S:	Maintained
  F:	Documentation/devicetree/bindings/phy/airoha,an7581-usb-phy.yaml
diff --git a/target/linux/airoha/patches-6.12/901-snand-mtk-bmt-support.patch b/target/linux/airoha/patches-6.12/901-snand-mtk-bmt-support.patch
index 02566032d4..540e3bf1c0 100644
--- a/target/linux/airoha/patches-6.12/901-snand-mtk-bmt-support.patch
+++ b/target/linux/airoha/patches-6.12/901-snand-mtk-bmt-support.patch
@@ -8,7 +8,7 @@
  
  static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
  {
-@@ -1575,6 +1576,7 @@ static int spinand_probe(struct spi_mem
+@@ -1577,6 +1578,7 @@ static int spinand_probe(struct spi_mem
  	if (ret)
  		return ret;
  
@@ -16,7 +16,7 @@
  	ret = mtd_device_register(mtd, NULL, 0);
  	if (ret)
  		goto err_spinand_cleanup;
-@@ -1582,6 +1584,7 @@ static int spinand_probe(struct spi_mem
+@@ -1584,6 +1586,7 @@ static int spinand_probe(struct spi_mem
  	return 0;
  
  err_spinand_cleanup:
@@ -24,7 +24,7 @@
  	spinand_cleanup(spinand);
  
  	return ret;
-@@ -1600,6 +1603,7 @@ static int spinand_remove(struct spi_mem
+@@ -1602,6 +1605,7 @@ static int spinand_remove(struct spi_mem
  	if (ret)
  		return ret;
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch b/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch
index c6ce4dd6db..61b880bb43 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch
@@ -18626,7 +18626,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  	 * For devices with more than one control interface, we assume the
 --- a/sound/usb/quirks.c
 +++ b/sound/usb/quirks.c
-@@ -2378,6 +2378,8 @@ static const struct usb_audio_quirk_flag
+@@ -2385,6 +2385,8 @@ static const struct usb_audio_quirk_flag
  		   QUIRK_FLAG_ALIGN_TRANSFER),
  	DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */
  		   QUIRK_FLAG_ALIGN_TRANSFER),
diff --git a/target/linux/bcm27xx/patches-6.12/950-0125-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-6.12/950-0125-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
index 0491be4369..88c67d2ba5 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0125-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0125-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
@@ -124,7 +124,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
   * non-error returns are a promise to giveback() the urb later
   * we drop ownership so next owner (or urb unlink) can get it
   */
-@@ -5386,6 +5489,7 @@ static const struct hc_driver xhci_hc_dr
+@@ -5387,6 +5490,7 @@ static const struct hc_driver xhci_hc_dr
  	.endpoint_reset =	xhci_endpoint_reset,
  	.check_bandwidth =	xhci_check_bandwidth,
  	.reset_bandwidth =	xhci_reset_bandwidth,
diff --git a/target/linux/bcm27xx/patches-6.12/950-0132-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-6.12/950-0132-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
index a834c5dcc3..1b1b8d7746 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0132-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0132-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
@@ -32,7 +32,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
  #define USB_VENDOR_ID_BELKIN		0x050d
  #define USB_DEVICE_ID_FLIP_KVM		0x3201
  
-@@ -1470,6 +1473,9 @@
+@@ -1471,6 +1474,9 @@
  #define USB_VENDOR_ID_XIAOMI		0x2717
  #define USB_DEVICE_ID_MI_SILENT_MOUSE	0x5014
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch b/target/linux/bcm27xx/patches-6.12/950-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch
index 9abbcd0bae..b99b85649a 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0335-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch
@@ -75,7 +75,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
 --- a/drivers/usb/host/xhci-ring.c
 +++ b/drivers/usb/host/xhci-ring.c
-@@ -3661,6 +3661,48 @@ static int xhci_align_td(struct xhci_hcd
+@@ -3666,6 +3666,48 @@ static int xhci_align_td(struct xhci_hcd
  	return 1;
  }
  
@@ -124,7 +124,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  /* This is very similar to what ehci-q.c qtd_fill() does */
  int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
  		struct urb *urb, int slot_id, unsigned int ep_index)
-@@ -3815,6 +3857,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
+@@ -3820,6 +3862,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
  	}
  
  	check_trb_math(urb, enqd_len);
@@ -133,7 +133,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
  			start_cycle, start_trb);
  	return 0;
-@@ -3963,6 +4007,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
+@@ -3968,6 +4012,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
  			/* Event on completion */
  			field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state);
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0344-sdhci-Add-SD-Express-hook.patch b/target/linux/bcm27xx/patches-6.12/950-0344-sdhci-Add-SD-Express-hook.patch
index 7fe2856c9f..ef89cdb217 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0344-sdhci-Add-SD-Express-hook.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0344-sdhci-Add-SD-Express-hook.patch
@@ -12,7 +12,7 @@ sdhci: remove PYA0_INTR_BUG quirk. Add quirks to disable some of the higher SDR
 
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -1236,7 +1236,11 @@ static const struct dwcmshc_pltfm_data s
+@@ -1241,7 +1241,11 @@ static const struct dwcmshc_pltfm_data s
  		.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
  			  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
  		.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
diff --git a/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch b/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
index e60f4e9232..97030141eb 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
@@ -212,7 +212,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	},
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -1319,6 +1319,24 @@ static void dwc3_config_threshold(struct
+@@ -1320,6 +1320,24 @@ static void dwc3_config_threshold(struct
  	}
  }
  
@@ -237,7 +237,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  /**
   * dwc3_core_init - Low-level initialization of DWC3 Core
   * @dwc: Pointer to our controller context structure
-@@ -1386,6 +1404,8 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1387,6 +1405,8 @@ static int dwc3_core_init(struct dwc3 *d
  
  	dwc3_config_soc_bus(dwc);
  
@@ -246,7 +246,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	ret = dwc3_phy_power_on(dwc);
  	if (ret)
  		goto err_exit_phy;
-@@ -1490,6 +1510,24 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1491,6 +1511,24 @@ static int dwc3_core_init(struct dwc3 *d
  		dwc3_writel(dwc->regs, DWC3_LLUCTL, reg);
  	}
  
@@ -271,7 +271,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	return 0;
  
  err_power_off_phy:
-@@ -1675,6 +1713,7 @@ static void dwc3_get_properties(struct d
+@@ -1676,6 +1714,7 @@ static void dwc3_get_properties(struct d
  	u8			tx_thr_num_pkt_prd = 0;
  	u8			tx_max_burst_prd = 0;
  	u8			tx_fifo_resize_max_num;
@@ -279,7 +279,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  
  	/* default to highest possible threshold */
  	lpm_nyet_threshold = 0xf;
-@@ -1695,6 +1734,9 @@ static void dwc3_get_properties(struct d
+@@ -1696,6 +1735,9 @@ static void dwc3_get_properties(struct d
  	 */
  	tx_fifo_resize_max_num = 6;
  
@@ -289,7 +289,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	dwc->maximum_speed = usb_get_maximum_speed(dev);
  	dwc->max_ssp_rate = usb_get_maximum_ssp_rate(dev);
  	dwc->dr_mode = usb_get_dr_mode(dev);
-@@ -1809,6 +1851,9 @@ static void dwc3_get_properties(struct d
+@@ -1810,6 +1852,9 @@ static void dwc3_get_properties(struct d
  	dwc->dis_split_quirk = device_property_read_bool(dev,
  				"snps,dis-split-quirk");
  
@@ -299,7 +299,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	dwc->lpm_nyet_threshold = lpm_nyet_threshold;
  	dwc->tx_de_emphasis = tx_de_emphasis;
  
-@@ -1826,6 +1871,8 @@ static void dwc3_get_properties(struct d
+@@ -1827,6 +1872,8 @@ static void dwc3_get_properties(struct d
  	dwc->tx_thr_num_pkt_prd = tx_thr_num_pkt_prd;
  	dwc->tx_max_burst_prd = tx_max_burst_prd;
  
@@ -308,7 +308,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	dwc->tx_fifo_resize_max_num = tx_fifo_resize_max_num;
  }
  
-@@ -2184,6 +2231,12 @@ static int dwc3_probe(struct platform_de
+@@ -2185,6 +2232,12 @@ static int dwc3_probe(struct platform_de
  	if (IS_ERR(dwc->usb_psy))
  		return dev_err_probe(dev, PTR_ERR(dwc->usb_psy), "couldn't get usb power supply\n");
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch b/target/linux/bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch
index 9cf0c1ad16..ebdb57af0a 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch
@@ -30,8 +30,8 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	int vendor_specific_area1; /* P_VENDOR_SPECIFIC_AREA1 reg */
  	int vendor_specific_area2; /* P_VENDOR_SPECIFIC_AREA2 reg */
  
-@@ -289,6 +290,17 @@ static void dwcmshc_adma_write_desc(stru
- 	sdhci_adma_write_desc(host, desc, addr, len, cmd);
+@@ -302,6 +303,17 @@ static void dwcmshc_reset(struct sdhci_h
+ 		sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS);
  }
  
 +static void dwcmshc_set_clock(struct sdhci_host *host, unsigned int clock)
@@ -48,7 +48,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  static unsigned int dwcmshc_get_max_clock(struct sdhci_host *host)
  {
  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
-@@ -1138,10 +1150,11 @@ static int sg2042_init(struct device *de
+@@ -1143,10 +1155,11 @@ static int sg2042_init(struct device *de
  }
  
  static const struct sdhci_ops sdhci_dwcmshc_ops = {
@@ -58,10 +58,10 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	.set_uhs_signaling	= dwcmshc_set_uhs_signaling,
  	.get_max_clock		= dwcmshc_get_max_clock,
 +	.get_timeout_clock	= sdhci_pltfm_clk_get_timeout_clock,
- 	.reset			= sdhci_reset,
+ 	.reset			= dwcmshc_reset,
  	.adma_write_desc	= dwcmshc_adma_write_desc,
  	.irq			= dwcmshc_cqe_irq_handler,
-@@ -1214,8 +1227,10 @@ static const struct sdhci_ops sdhci_dwcm
+@@ -1219,8 +1232,10 @@ static const struct sdhci_ops sdhci_dwcm
  static const struct dwcmshc_pltfm_data sdhci_dwcmshc_pdata = {
  	.pdata = {
  		.ops = &sdhci_dwcmshc_ops,
@@ -74,7 +74,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  	},
  };
  
-@@ -1230,6 +1245,15 @@ static const struct dwcmshc_pltfm_data s
+@@ -1235,6 +1250,15 @@ static const struct dwcmshc_pltfm_data s
  };
  #endif
  
@@ -90,7 +90,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  static const struct dwcmshc_pltfm_data sdhci_dwcmshc_rk35xx_pdata = {
  	.pdata = {
  		.ops = &sdhci_dwcmshc_rk35xx_ops,
-@@ -1353,6 +1377,10 @@ dsbl_cqe_caps:
+@@ -1358,6 +1382,10 @@ dsbl_cqe_caps:
  
  static const struct of_device_id sdhci_dwcmshc_dt_ids[] = {
  	{
@@ -101,7 +101,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		.compatible = "rockchip,rk3588-dwcmshc",
  		.data = &sdhci_dwcmshc_rk35xx_pdata,
  	},
-@@ -1445,13 +1473,32 @@ static int dwcmshc_probe(struct platform
+@@ -1450,13 +1478,32 @@ static int dwcmshc_probe(struct platform
  		priv->bus_clk = devm_clk_get(dev, "bus");
  		if (!IS_ERR(priv->bus_clk))
  			clk_prepare_enable(priv->bus_clk);
@@ -134,7 +134,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  
  	priv->vendor_specific_area1 =
  		sdhci_readl(host, DWCMSHC_P_VENDOR_AREA1) & DWCMSHC_AREA1_MASK;
-@@ -1511,6 +1558,7 @@ err_rpm:
+@@ -1516,6 +1563,7 @@ err_rpm:
  	pm_runtime_put_noidle(dev);
  err_clk:
  	clk_disable_unprepare(pltfm_host->clk);
diff --git a/target/linux/bcm27xx/patches-6.12/950-0393-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch b/target/linux/bcm27xx/patches-6.12/950-0393-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch
index 3d059f253a..a563c222b1 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0393-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0393-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch
@@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
 
 --- a/drivers/gpu/drm/drm_fb_helper.c
 +++ b/drivers/gpu/drm/drm_fb_helper.c
-@@ -1803,7 +1803,7 @@ __drm_fb_helper_initial_config_and_unloc
+@@ -1797,7 +1797,7 @@ __drm_fb_helper_initial_config_and_unloc
  	struct drm_device *dev = fb_helper->dev;
  	struct fb_info *info;
  	unsigned int width, height;
@@ -28,7 +28,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  
  	width = dev->mode_config.max_width;
  	height = dev->mode_config.max_height;
-@@ -1831,6 +1831,15 @@ __drm_fb_helper_initial_config_and_unloc
+@@ -1825,6 +1825,15 @@ __drm_fb_helper_initial_config_and_unloc
  	 * register the fbdev emulation instance in kernel_fb_helper_list. */
  	mutex_unlock(&fb_helper->lock);
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0413-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch b/target/linux/bcm27xx/patches-6.12/950-0413-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch
index 80046cc195..f8e80fc4d0 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0413-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0413-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch
@@ -16,7 +16,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
 
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -1485,6 +1485,9 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1486,6 +1486,9 @@ static int dwc3_core_init(struct dwc3 *d
  		if (dwc->parkmode_disable_hs_quirk)
  			reg |= DWC3_GUCTL1_PARKMODE_DISABLE_HS;
  
@@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		if (DWC3_VER_IS_WITHIN(DWC3, 290A, ANY)) {
  			if (dwc->maximum_speed == USB_SPEED_FULL ||
  			    dwc->maximum_speed == USB_SPEED_HIGH)
-@@ -1831,6 +1834,8 @@ static void dwc3_get_properties(struct d
+@@ -1832,6 +1835,8 @@ static void dwc3_get_properties(struct d
  				"snps,parkmode-disable-ss-quirk");
  	dwc->parkmode_disable_hs_quirk = device_property_read_bool(dev,
  				"snps,parkmode-disable-hs-quirk");
diff --git a/target/linux/bcm27xx/patches-6.12/950-0524-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch b/target/linux/bcm27xx/patches-6.12/950-0524-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch
index 666c391c4f..92cb7e9481 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0524-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0524-usb-dwc3-core-add-support-for-setting-NAK-enhancemen.patch
@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
 
 --- a/drivers/usb/dwc3/core.c
 +++ b/drivers/usb/dwc3/core.c
-@@ -1479,6 +1479,12 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -1480,6 +1480,12 @@ static int dwc3_core_init(struct dwc3 *d
  		if (dwc->dis_tx_ipgap_linecheck_quirk)
  			reg |= DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS;
  
@@ -35,7 +35,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		if (dwc->parkmode_disable_ss_quirk)
  			reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS;
  
-@@ -1830,6 +1836,10 @@ static void dwc3_get_properties(struct d
+@@ -1831,6 +1837,10 @@ static void dwc3_get_properties(struct d
  				"snps,resume-hs-terminations");
  	dwc->ulpi_ext_vbus_drv = device_property_read_bool(dev,
  				"snps,ulpi-ext-vbus-drv");
diff --git a/target/linux/bcm27xx/patches-6.12/950-0947-fixup-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clock.patch b/target/linux/bcm27xx/patches-6.12/950-0947-fixup-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clock.patch
index 809ab256f4..727815eb9f 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0947-fixup-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clock.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0947-fixup-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clock.patch
@@ -19,7 +19,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -1245,13 +1245,15 @@ static const struct dwcmshc_pltfm_data s
+@@ -1250,13 +1250,15 @@ static const struct dwcmshc_pltfm_data s
  };
  #endif
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0950-usb-xhci-default-to-Intel-scheme-for-calculating-U1-.patch b/target/linux/bcm27xx/patches-6.12/950-0950-usb-xhci-default-to-Intel-scheme-for-calculating-U1-.patch
index 33f8ca71ad..cdd429ba01 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0950-usb-xhci-default-to-Intel-scheme-for-calculating-U1-.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0950-usb-xhci-default-to-Intel-scheme-for-calculating-U1-.patch
@@ -40,7 +40,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  static bool td_on_ring(struct xhci_td *td, struct xhci_ring *ring)
  {
  	struct xhci_segment *seg;
-@@ -4791,7 +4795,7 @@ static u16 xhci_calculate_u1_timeout(str
+@@ -4792,7 +4796,7 @@ static u16 xhci_calculate_u1_timeout(str
  		}
  	}
  
@@ -49,7 +49,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  		timeout_ns = xhci_calculate_intel_u1_timeout(udev, desc);
  	else
  		timeout_ns = udev->u1_params.sel;
-@@ -4855,7 +4859,7 @@ static u16 xhci_calculate_u2_timeout(str
+@@ -4856,7 +4860,7 @@ static u16 xhci_calculate_u2_timeout(str
  		}
  	}
  
diff --git a/target/linux/econet/patches-6.12/901-nand-enable-en75-bbt.patch b/target/linux/econet/patches-6.12/901-nand-enable-en75-bbt.patch
index 4b6f2d9e4f..67c7c9ba6a 100644
--- a/target/linux/econet/patches-6.12/901-nand-enable-en75-bbt.patch
+++ b/target/linux/econet/patches-6.12/901-nand-enable-en75-bbt.patch
@@ -29,7 +29,7 @@ Signed-off-by: Caleb James DeLisle <cjd at cjdns.fr>
  {
 --- a/drivers/mtd/nand/mtk_bmt.c
 +++ b/drivers/mtd/nand/mtk_bmt.c
-@@ -422,6 +422,8 @@ int mtk_bmt_attach(struct mtd_info *mtd)
+@@ -421,6 +421,8 @@ int mtk_bmt_attach(struct mtd_info *mtd)
  		bmtd.ops = &mtk_bmt_nmbm_ops;
  	else if (of_property_read_bool(np, "mediatek,bbt"))
  		bmtd.ops = &mtk_bmt_bbt_ops;
diff --git a/target/linux/econet/patches-6.12/902-snand-mtk-bmt-support.patch b/target/linux/econet/patches-6.12/902-snand-mtk-bmt-support.patch
index 02566032d4..540e3bf1c0 100644
--- a/target/linux/econet/patches-6.12/902-snand-mtk-bmt-support.patch
+++ b/target/linux/econet/patches-6.12/902-snand-mtk-bmt-support.patch
@@ -8,7 +8,7 @@
  
  static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
  {
-@@ -1575,6 +1576,7 @@ static int spinand_probe(struct spi_mem
+@@ -1577,6 +1578,7 @@ static int spinand_probe(struct spi_mem
  	if (ret)
  		return ret;
  
@@ -16,7 +16,7 @@
  	ret = mtd_device_register(mtd, NULL, 0);
  	if (ret)
  		goto err_spinand_cleanup;
-@@ -1582,6 +1584,7 @@ static int spinand_probe(struct spi_mem
+@@ -1584,6 +1586,7 @@ static int spinand_probe(struct spi_mem
  	return 0;
  
  err_spinand_cleanup:
@@ -24,7 +24,7 @@
  	spinand_cleanup(spinand);
  
  	return ret;
-@@ -1600,6 +1603,7 @@ static int spinand_remove(struct spi_mem
+@@ -1602,6 +1605,7 @@ static int spinand_remove(struct spi_mem
  	if (ret)
  		return ret;
  
diff --git a/target/linux/generic/backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch b/target/linux/generic/backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch
deleted file mode 100644
index 6a8889ee3c..0000000000
--- a/target/linux/generic/backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From fd9862f726aedbc2f29a29916cabed7bcf5cadb6 Mon Sep 17 00:00:00 2001
-From: Hang Zhou <929513338 at qq.com>
-Date: Mon, 17 Nov 2025 01:08:35 +1100
-Subject: [PATCH] spi: bcm63xx: fix premature CS deassertion on RX-only
- transactions
-
-On BCM6358 (and also observed on BCM6368) the controller appears to
-only generate as many SPI clocks as bytes that have been written into
-the TX FIFO. For RX-only transfers the driver programs the transfer
-length in SPI_MSG_CTL but does not write anything into the FIFO, so
-chip select is deasserted early and the RX transfer segment is never
-fully clocked in.
-
-A concrete failing case is a three-transfer MAC address read from
-SPI-NOR:
-  - TX 0x03 (read command)
-  - TX 3-byte address
-  - RX 6 bytes (MAC)
-
-In contrast, a two-transfer JEDEC-ID read (0x9f + 6-byte RX) works
-because the driver uses prepend_len and writes dummy bytes into the
-TX FIFO for the RX part.
-
-Fix this by writing 0xff dummy bytes into the TX FIFO for RX-only
-segments so that the number of bytes written to the FIFO matches the
-total message length seen by the controller.
-
-Fixes: b17de076062a ("spi/bcm63xx: work around inability to keep CS up")
-
-Signed-off-by: Hang Zhou <929513338 at qq.com>
-Link: https://patch.msgid.link/tencent_7AC88FCB3076489A4A7E6C2163DF1ACF8D06 at qq.com
-Signed-off-by: Mark Brown <broonie at kernel.org>
----
- drivers/spi/spi-bcm63xx.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
---- a/drivers/spi/spi-bcm63xx.c
-+++ b/drivers/spi/spi-bcm63xx.c
-@@ -247,6 +247,20 @@ static int bcm63xx_txrx_bufs(struct spi_
- 
- 		if (t->rx_buf) {
- 			do_rx = true;
-+
-+			/*
-+			 * In certain hardware implementations, there appears to be a
-+			 * hidden accumulator that tracks the number of bytes written into
-+			 * the hardware FIFO, and this accumulator overrides the length in
-+			 * the SPI_MSG_CTL register.
-+			 *
-+			 * Therefore, for read-only transfers, we need to write some dummy
-+			 * value into the FIFO to keep the accumulator tracking the correct
-+			 * length.
-+			 */
-+			if (!t->tx_buf)
-+				memset_io(bs->tx_io + len, 0xFF, t->len);
-+
- 			/* prepend is half-duplex write only */
- 			if (t == first)
- 				prepend_len = 0;
diff --git a/target/linux/generic/kernel-6.12 b/target/linux/generic/kernel-6.12
index 73c2f33a10..0a9808b6be 100644
--- a/target/linux/generic/kernel-6.12
+++ b/target/linux/generic/kernel-6.12
@@ -1,2 +1,2 @@
-LINUX_VERSION-6.12 = .60
-LINUX_KERNEL_HASH-6.12.60 = a63096b2147411d683cecbf87622bb2ff4885bac2b3641d3d4f10250c89cdcf8
+LINUX_VERSION-6.12 = .62
+LINUX_KERNEL_HASH-6.12.62 = 13e2c685ac8fab5dd992dd105732554dae514aef350c2a8c7418e7b74eb62c13
diff --git a/target/linux/generic/pending-6.12/510-block-add-uImage.FIT-subimage-block-driver.patch b/target/linux/generic/pending-6.12/510-block-add-uImage.FIT-subimage-block-driver.patch
index c3d246c5ee..21615160a9 100644
--- a/target/linux/generic/pending-6.12/510-block-add-uImage.FIT-subimage-block-driver.patch
+++ b/target/linux/generic/pending-6.12/510-block-add-uImage.FIT-subimage-block-driver.patch
@@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -23668,6 +23668,12 @@ F:	Documentation/filesystems/ubifs-authe
+@@ -23663,6 +23663,12 @@ F:	Documentation/filesystems/ubifs-authe
  F:	Documentation/filesystems/ubifs.rst
  F:	fs/ubifs/
  
diff --git a/target/linux/layerscape/patches-6.12/701-staging-add-fsl_ppfe-driver.patch b/target/linux/layerscape/patches-6.12/701-staging-add-fsl_ppfe-driver.patch
index 04efc15270..44797dc7bf 100644
--- a/target/linux/layerscape/patches-6.12/701-staging-add-fsl_ppfe-driver.patch
+++ b/target/linux/layerscape/patches-6.12/701-staging-add-fsl_ppfe-driver.patch
@@ -962,7 +962,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong at nxp.com>
  L:	linux-spi at vger.kernel.org
 --- a/drivers/staging/Kconfig
 +++ b/drivers/staging/Kconfig
-@@ -64,4 +64,6 @@ source "drivers/staging/fieldbus/Kconfig
+@@ -62,4 +62,6 @@ source "drivers/staging/fieldbus/Kconfig
  
  source "drivers/staging/vme_user/Kconfig"
  
@@ -971,7 +971,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong at nxp.com>
  endif # STAGING
 --- a/drivers/staging/Makefile
 +++ b/drivers/staging/Makefile
-@@ -21,3 +21,4 @@ obj-$(CONFIG_GREYBUS)		+= greybus/
+@@ -20,3 +20,4 @@ obj-$(CONFIG_GREYBUS)		+= greybus/
  obj-$(CONFIG_BCM2835_VCHIQ)	+= vc04_services/
  obj-$(CONFIG_XIL_AXIS_FIFO)	+= axis-fifo/
  obj-$(CONFIG_FIELDBUS_DEV)     += fieldbus/
diff --git a/target/linux/mediatek/patches-6.12/330-snand-mtk-bmt-support.patch b/target/linux/mediatek/patches-6.12/330-snand-mtk-bmt-support.patch
index 02566032d4..540e3bf1c0 100644
--- a/target/linux/mediatek/patches-6.12/330-snand-mtk-bmt-support.patch
+++ b/target/linux/mediatek/patches-6.12/330-snand-mtk-bmt-support.patch
@@ -8,7 +8,7 @@
  
  static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
  {
-@@ -1575,6 +1576,7 @@ static int spinand_probe(struct spi_mem
+@@ -1577,6 +1578,7 @@ static int spinand_probe(struct spi_mem
  	if (ret)
  		return ret;
  
@@ -16,7 +16,7 @@
  	ret = mtd_device_register(mtd, NULL, 0);
  	if (ret)
  		goto err_spinand_cleanup;
-@@ -1582,6 +1584,7 @@ static int spinand_probe(struct spi_mem
+@@ -1584,6 +1586,7 @@ static int spinand_probe(struct spi_mem
  	return 0;
  
  err_spinand_cleanup:
@@ -24,7 +24,7 @@
  	spinand_cleanup(spinand);
  
  	return ret;
-@@ -1600,6 +1603,7 @@ static int spinand_remove(struct spi_mem
+@@ -1602,6 +1605,7 @@ static int spinand_remove(struct spi_mem
  	if (ret)
  		return ret;
  
diff --git a/target/linux/mediatek/patches-6.12/433-drivers-spi-mem-Add-spi-calibration-hook.patch b/target/linux/mediatek/patches-6.12/433-drivers-spi-mem-Add-spi-calibration-hook.patch
index e8377f5c4c..731d911296 100644
--- a/target/linux/mediatek/patches-6.12/433-drivers-spi-mem-Add-spi-calibration-hook.patch
+++ b/target/linux/mediatek/patches-6.12/433-drivers-spi-mem-Add-spi-calibration-hook.patch
@@ -11,7 +11,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang at mediatek.com>
 
 --- a/drivers/spi/spi-mem.c
 +++ b/drivers/spi/spi-mem.c
-@@ -466,6 +466,14 @@ int spi_mem_exec_op(struct spi_mem *mem,
+@@ -486,6 +486,14 @@ int spi_mem_exec_op(struct spi_mem *mem,
  }
  EXPORT_SYMBOL_GPL(spi_mem_exec_op);
  
@@ -28,7 +28,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang at mediatek.com>
   *			upper layer if necessary
 --- a/include/linux/spi/spi-mem.h
 +++ b/include/linux/spi/spi-mem.h
-@@ -372,6 +372,10 @@ bool spi_mem_supports_op(struct spi_mem
+@@ -390,6 +390,10 @@ bool spi_mem_supports_op(struct spi_mem
  int spi_mem_exec_op(struct spi_mem *mem,
  		    const struct spi_mem_op *op);
  
diff --git a/target/linux/mediatek/patches-6.12/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch b/target/linux/mediatek/patches-6.12/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch
index c33931ebc7..64c059c1f2 100644
--- a/target/linux/mediatek/patches-6.12/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch
+++ b/target/linux/mediatek/patches-6.12/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch
@@ -68,7 +68,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang at mediatek.com>
  static int spinand_id_detect(struct spinand_device *spinand)
  {
  	u8 *id = spinand->id.data;
-@@ -1452,6 +1502,10 @@ static int spinand_init(struct spinand_d
+@@ -1454,6 +1504,10 @@ static int spinand_init(struct spinand_d
  	if (!spinand->scratchbuf)
  		return -ENOMEM;
  
diff --git a/target/linux/mediatek/patches-6.12/960-asus-hack-u-boot-ignore-mtdparts.patch b/target/linux/mediatek/patches-6.12/960-asus-hack-u-boot-ignore-mtdparts.patch
index 70ff4dd5b6..4f50d32aa2 100644
--- a/target/linux/mediatek/patches-6.12/960-asus-hack-u-boot-ignore-mtdparts.patch
+++ b/target/linux/mediatek/patches-6.12/960-asus-hack-u-boot-ignore-mtdparts.patch
@@ -29,7 +29,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/mtd/nand/spi/core.c
 +++ b/drivers/mtd/nand/spi/core.c
-@@ -1669,6 +1669,7 @@ static int spinand_remove(struct spi_mem
+@@ -1671,6 +1671,7 @@ static int spinand_remove(struct spi_mem
  
  static const struct spi_device_id spinand_ids[] = {
  	{ .name = "spi-nand" },
@@ -37,7 +37,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  	{ /* sentinel */ },
  };
  MODULE_DEVICE_TABLE(spi, spinand_ids);
-@@ -1676,6 +1677,7 @@ MODULE_DEVICE_TABLE(spi, spinand_ids);
+@@ -1678,6 +1679,7 @@ MODULE_DEVICE_TABLE(spi, spinand_ids);
  #ifdef CONFIG_OF
  static const struct of_device_id spinand_of_ids[] = {
  	{ .compatible = "spi-nand" },
diff --git a/target/linux/pistachio/patches-6.12/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-6.12/401-mtd-nor-support-mtd-name-from-device-tree.patch
index af773a64eb..99a942e077 100644
--- a/target/linux/pistachio/patches-6.12/401-mtd-nor-support-mtd-name-from-device-tree.patch
+++ b/target/linux/pistachio/patches-6.12/401-mtd-nor-support-mtd-name-from-device-tree.patch
@@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
 
 --- a/drivers/spi/spi-mem.c
 +++ b/drivers/spi/spi-mem.c
-@@ -893,7 +893,9 @@ static int spi_mem_probe(struct spi_devi
+@@ -930,7 +930,9 @@ static int spi_mem_probe(struct spi_devi
  {
  	struct spi_mem_driver *memdrv = to_spi_mem_drv(spi->dev.driver);
  	struct spi_controller *ctlr = spi->controller;
@@ -20,7 +20,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
  
  	mem = devm_kzalloc(&spi->dev, sizeof(*mem), GFP_KERNEL);
  	if (!mem)
-@@ -901,10 +903,15 @@ static int spi_mem_probe(struct spi_devi
+@@ -938,10 +940,15 @@ static int spi_mem_probe(struct spi_devi
  
  	mem->spi = spi;
  
diff --git a/target/linux/rockchip/patches-6.12/037-04-v6.19-mmc-sdhci-of-dwcmshc-Add-command-queue-support-for-rockch.patch b/target/linux/rockchip/patches-6.12/037-04-v6.19-mmc-sdhci-of-dwcmshc-Add-command-queue-support-for-rockch.patch
index e7b1c466c1..74e5a8e20b 100644
--- a/target/linux/rockchip/patches-6.12/037-04-v6.19-mmc-sdhci-of-dwcmshc-Add-command-queue-support-for-rockch.patch
+++ b/target/linux/rockchip/patches-6.12/037-04-v6.19-mmc-sdhci-of-dwcmshc-Add-command-queue-support-for-rockch.patch
@@ -48,7 +48,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  	int (*init)(struct device *dev, struct sdhci_host *host, struct dwcmshc_priv *dwc_priv);
  	void (*postinit)(struct sdhci_host *host, struct dwcmshc_priv *dwc_priv);
  };
-@@ -603,6 +607,68 @@ static void dwcmshc_cqhci_dumpregs(struc
+@@ -616,6 +620,68 @@ static void dwcmshc_cqhci_dumpregs(struc
  	sdhci_dumpregs(mmc_priv(mmc));
  }
  
@@ -117,7 +117,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  static void dwcmshc_rk3568_set_clock(struct sdhci_host *host, unsigned int clock)
  {
  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
-@@ -721,6 +787,10 @@ static void rk35xx_sdhci_reset(struct sd
+@@ -734,6 +800,10 @@ static void rk35xx_sdhci_reset(struct sd
  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
  	struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
  	struct rk35xx_priv *priv = dwc_priv->priv;
@@ -128,7 +128,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  
  	if (mask & SDHCI_RESET_ALL && priv->reset) {
  		reset_control_assert(priv->reset);
-@@ -729,6 +799,9 @@ static void rk35xx_sdhci_reset(struct sd
+@@ -742,6 +812,9 @@ static void rk35xx_sdhci_reset(struct sd
  	}
  
  	sdhci_reset(host, mask);
@@ -138,7 +138,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  }
  
  static int dwcmshc_rk35xx_init(struct device *dev, struct sdhci_host *host,
-@@ -1230,6 +1303,15 @@ static const struct dwcmshc_pltfm_data s
+@@ -1235,6 +1308,15 @@ static const struct dwcmshc_pltfm_data s
  };
  #endif
  
@@ -154,7 +154,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  static const struct dwcmshc_pltfm_data sdhci_dwcmshc_rk35xx_pdata = {
  	.pdata = {
  		.ops = &sdhci_dwcmshc_rk35xx_ops,
-@@ -1238,6 +1320,7 @@ static const struct dwcmshc_pltfm_data s
+@@ -1243,6 +1325,7 @@ static const struct dwcmshc_pltfm_data s
  		.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
  			   SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
  	},
@@ -162,7 +162,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  	.init = dwcmshc_rk35xx_init,
  	.postinit = dwcmshc_rk35xx_postinit,
  };
-@@ -1287,7 +1370,8 @@ static const struct cqhci_host_ops dwcms
+@@ -1292,7 +1375,8 @@ static const struct cqhci_host_ops dwcms
  	.set_tran_desc	= dwcmshc_set_tran_desc,
  };
  
@@ -172,7 +172,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  {
  	struct cqhci_host *cq_host;
  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
-@@ -1317,7 +1401,10 @@ static void dwcmshc_cqhci_init(struct sd
+@@ -1322,7 +1406,10 @@ static void dwcmshc_cqhci_init(struct sd
  	}
  
  	cq_host->mmio = host->ioaddr + priv->vendor_specific_area2;
@@ -184,7 +184,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  
  	/* Enable using of 128-bit task descriptors */
  	dma64 = host->flags & SDHCI_USE_64_BIT_DMA;
-@@ -1486,7 +1573,7 @@ static int dwcmshc_probe(struct platform
+@@ -1491,7 +1578,7 @@ static int dwcmshc_probe(struct platform
  		priv->vendor_specific_area2 =
  			sdhci_readw(host, DWCMSHC_P_VENDOR_AREA2);
  
diff --git a/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch b/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch
index c4d9689507..3dd29ffefb 100644
--- a/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch
+++ b/target/linux/rockchip/patches-6.12/037-05-v6.19-mmc-sdhci-of-dwcmshc-Fix-command-queue-support-for-RK3576.patch
@@ -45,7 +45,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
 
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -1333,6 +1333,7 @@ static const struct dwcmshc_pltfm_data s
+@@ -1338,6 +1338,7 @@ static const struct dwcmshc_pltfm_data s
  		.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
  			   SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
  	},
diff --git a/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch b/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch
index d8a0ed8d14..45db5c1175 100644
--- a/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch
+++ b/target/linux/rockchip/patches-6.12/037-06-v6.19-mmc-sdhci-of-dwcmshc-Disable-internal-clock-auto-gate-for.patch
@@ -27,7 +27,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
 
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -696,10 +696,11 @@ static void dwcmshc_rk3568_set_clock(str
+@@ -709,10 +709,11 @@ static void dwcmshc_rk3568_set_clock(str
  
  	sdhci_set_clock(host, clock);
  
diff --git a/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch b/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch
index 90647d96c3..55833022ac 100644
--- a/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch
+++ b/target/linux/rockchip/patches-6.12/037-07-v6.19-mmc-sdhci-of-dwcmshc-reduce-CIT-for-better-performance.patch
@@ -30,7 +30,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
  #define CQHCI_SSC2			0x44
 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
 +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
-@@ -614,6 +614,11 @@ static void rk35xx_sdhci_cqe_pre_enable(
+@@ -627,6 +627,11 @@ static void rk35xx_sdhci_cqe_pre_enable(
  	struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
  	u32 reg;
  
diff --git a/target/linux/siflower/patches-6.12/016-spi-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch b/target/linux/siflower/patches-6.12/016-spi-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch
index f37f9c8d3a..1aabc0afce 100644
--- a/target/linux/siflower/patches-6.12/016-spi-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch
+++ b/target/linux/siflower/patches-6.12/016-spi-spi-mem-allow-gpio-cs-in-spi_mem_exec_op.patch
@@ -18,7 +18,7 @@ Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>
 
 --- a/drivers/spi/spi-mem.c
 +++ b/drivers/spi/spi-mem.c
-@@ -368,13 +368,19 @@ int spi_mem_exec_op(struct spi_mem *mem,
+@@ -384,13 +384,19 @@ int spi_mem_exec_op(struct spi_mem *mem,
  	if (!spi_mem_internal_supports_op(mem, op))
  		return -EOPNOTSUPP;
  
diff --git a/target/linux/starfive/patches-6.12/1007-reset-starfive-Add-JH7100-audio-reset-driver.patch b/target/linux/starfive/patches-6.12/1007-reset-starfive-Add-JH7100-audio-reset-driver.patch
index f5d71ff66f..bf4362f923 100644
--- a/target/linux/starfive/patches-6.12/1007-reset-starfive-Add-JH7100-audio-reset-driver.patch
+++ b/target/linux/starfive/patches-6.12/1007-reset-starfive-Add-JH7100-audio-reset-driver.patch
@@ -20,7 +20,7 @@ Signed-off-by: Emil Renner Berthing <kernel at esmil.dk>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -22070,7 +22070,7 @@ STARFIVE JH71X0 RESET CONTROLLER DRIVERS
+@@ -22065,7 +22065,7 @@ STARFIVE JH71X0 RESET CONTROLLER DRIVERS
  M:	Emil Renner Berthing <kernel at esmil.dk>
  M:	Hal Feng <hal.feng at starfivetech.com>
  S:	Maintained



From lede-commits at lists.infradead.org  Tue Dec 16 19:58:21 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 22:58:21 -0500
Subject: [openwrt/openwrt]  dropbear: bump to 2025.89 (CVE-2025-14282,
 CVE-2019-6111)
In-Reply-To: <176594390196.3196694.11662213239140497081@git-01.infra.openwrt.org>
References: <176594390196.3196694.11662213239140497081@git-01.infra.openwrt.org>
Message-ID: <mailman.36636.1765943907.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/70a4da1cebc87fc7b3cfa3f634b5bdf3db12ccd5

commit 70a4da1cebc87fc7b3cfa3f634b5bdf3db12ccd5
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Tue Dec 16 16:42:19 2025 +0000

    dropbear: bump to 2025.89 (CVE-2025-14282, CVE-2019-6111)
    
    - Security: Avoid privilege escalation via unix stream forwarding in Dropbear
      server. Other programs on a system may authenticate unix sockets via
      SO_PEERCRED, which would be root user for Dropbear forwarded connections,
      allowing root privilege escalation.
      Reported by Turistu, and thanks for advice on the fix.
      This is tracked as CVE-2025-14282, and affects 2024.84 to 2025.88.
    
      It is fixed by dropping privileges of the dropbear process after
      authentication. Unix stream sockets are now disallowed when a
      forced command is used, either with authorized_key restrictions or
      "dropbear -c command".
    
      In previous affected releases running with "dropbear -j" (will also disable
      TCP fowarding) or building with localoptions.h/distrooptions.h
      "#define DROPBEAR_SVR_LOCALSTREAMFWD 0" is a mitigation.
    
    - Security: Include scp fix for CVE-2019-6111. This allowed
      a malicious server to overwrite arbitrary local files.
      The missing fix was reported by Ashish Kunwar.
    
    - Server dropping privileges post-auth is enabled by default. This requires
      setresgid() support, so some platforms such as netbsd or macos will have to
      disable DROPBEAR_SVR_DROP_PRIVS in localoptions.h. Unix stream forwarding is
      not available if DROPBEAR_SVR_DROP_PRIVS is disabled.
    
      Remote server TCP socket forwarding will now use OS privileged port
      restrictions rather than having a fixed "allow >=1024 for non-root" rule.
    
      A future release may implement privilege dropping for netbsd/macos.
    
    - Fix a regression in 2025.87 when RSA and DSS are not built. This would lead
      to a crash at startup with bad_bufptr().
      Reported by Dani Schmitt and Sebastian Priebe.
    
    - Don't limit channel window to 500MB. That is could cause stuck connections
      if peers advise a large window and don't send an increment within 500MB.
      Affects SSH.NET https://github.com/sshnet/SSH.NET/issues/1671
      Reported by Rob Hague.
    
    - Ignore -g -s when passwords arent enabled. Patch from Norbert Lange.
      Ignore -m (disable MOTD), -j/-k (tcp forwarding) when not enabled.
    
    - Report SIGBUS and SIGTRAP signals. Patch from Lo?c Mangeonjean.
    
    - Fix incorrect server auth delay. Was meant to be 250-350ms, it was actually
      150-350ms or possibly negative (zero). Reported by pickaxprograms.
    
    - Fix building without public key options. Thanks to Konstantin Demin
    
    - Fix building with proxycmd but without netcat. Thanks to Konstantin Demin
    
    - Fix incorrect path documentation for distrooptions, thanks to Todd Zullinger
    
    - Fix SO_REUSEADDR for TCP tests, reported by vt-alt.
    
    Dropped:
    
     * 050-dropbear-multihop-fix.patch as its included in the release 5cc0127000db5f
     * 051-fix-pubkey-options.patch as its included in the release 1d4c4a542cd5df
     * 052-fix-missing-depends-for-sntrup761x25519-sha512.patch as its included
       in the release 1a2c1e649a1824
     * 053-Don-t-limit-channel-window-to-500MB.patch as its included in the release a8610f7b98ad
    
    Manually rebased:
    
     * 110-change_user.patch
    
    Fixes: CVE-2025-14282, CVE-2019-6111
    Reviewed-by: Hauke Mehrtens <hauke at hauke-m.de>
    Reviewed-by: Konstantin Demin <rockdrilla at gmail.com>
    Tested-by: Konstantin Demin <rockdrilla at gmail.com> [mediatek/filogic (GL.iNet GL-MT6000)]
    Link: https://github.com/openwrt/openwrt/pull/21186
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 package/network/services/dropbear/Makefile         |  6 +-
 .../patches/050-dropbear-multihop-fix.patch        | 70 ----------------------
 .../dropbear/patches/051-fix-pubkey-options.patch  | 47 ---------------
 ...issing-depends-for-sntrup761x25519-sha512.patch | 24 --------
 .../053-Don-t-limit-channel-window-to-500MB.patch  | 65 --------------------
 .../dropbear/patches/110-change_user.patch         | 11 +++-
 .../dropbear/patches/900-configure-hardening.patch |  2 +-
 .../dropbear/patches/901-bundled-libs-cflags.patch |  2 +-
 8 files changed, 13 insertions(+), 214 deletions(-)

diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile
index 59aff2f7cf..457f099fdd 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dropbear
-PKG_VERSION:=2025.88
-PKG_RELEASE:=4
+PKG_VERSION:=2025.89
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
 	https://matt.ucc.asn.au/dropbear/releases/ \
 	https://dropbear.nl/mirror/releases/
-PKG_HASH:=783f50ea27b17c16da89578fafdb6decfa44bb8f6590e5698a4e4d3672dc53d4
+PKG_HASH:=0d1f7ca711cfc336dc8a85e672cab9cfd8223a02fe2da0a4a7aeb58c9e113634
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE
diff --git a/package/network/services/dropbear/patches/050-dropbear-multihop-fix.patch b/package/network/services/dropbear/patches/050-dropbear-multihop-fix.patch
deleted file mode 100644
index d8d6ff18c9..0000000000
--- a/package/network/services/dropbear/patches/050-dropbear-multihop-fix.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 5cc0127000db5f7567b54d0495fb91a8e452fe09 Mon Sep 17 00:00:00 2001
-From: Konstantin Demin <rockdrilla at gmail.com>
-Date: Fri, 9 May 2025 22:39:35 +0300
-Subject: Fix proxycmd without netcat
-
-fixes e5a0ef27c2 "Execute multihop commands directly, no shell"
-
-Signed-off-by: Konstantin Demin <rockdrilla at gmail.com>
-Forwarded: https://github.com/mkj/dropbear/pull/363
----
- src/cli-main.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
---- a/src/cli-main.c
-+++ b/src/cli-main.c
-@@ -77,7 +77,11 @@ int main(int argc, char ** argv) {
- 	}
- 
- #if DROPBEAR_CLI_PROXYCMD
--	if (cli_opts.proxycmd || cli_opts.proxyexec) {
-+	if (cli_opts.proxycmd
-+#if DROPBEAR_CLI_MULTIHOP
-+		|| cli_opts.proxyexec
-+#endif
-+	) {
- 		cli_proxy_cmd(&sock_in, &sock_out, &proxy_cmd_pid);
- 		if (signal(SIGINT, kill_proxy_sighandler) == SIG_ERR ||
- 			signal(SIGTERM, kill_proxy_sighandler) == SIG_ERR ||
-@@ -110,11 +114,13 @@ static void shell_proxy_cmd(const void *
- 	dropbear_exit("Failed to run '%s'\n", cmd);
- }
- 
-+#if DROPBEAR_CLI_MULTIHOP
- static void exec_proxy_cmd(const void *unused) {
- 	(void)unused;
- 	run_command(cli_opts.proxyexec[0], cli_opts.proxyexec, ses.maxfd);
- 	dropbear_exit("Failed to run '%s'\n", cli_opts.proxyexec[0]);
- }
-+#endif
- 
- static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) {
- 	char * cmd_arg = NULL;
-@@ -145,9 +151,11 @@ static void cli_proxy_cmd(int *sock_in,
- 		cmd_arg = m_malloc(shell_cmdlen);
- 		snprintf(cmd_arg, shell_cmdlen, "exec %s", cli_opts.proxycmd);
- 		exec_fn = shell_proxy_cmd;
-+#if DROPBEAR_CLI_MULTIHOP
- 	} else {
- 		/* No shell */
- 		exec_fn = exec_proxy_cmd;
-+#endif
- 	}
- 
- 	ret = spawn_command(exec_fn, cmd_arg, sock_out, sock_in, NULL, pid_out);
-@@ -159,6 +167,7 @@ static void cli_proxy_cmd(int *sock_in,
- cleanup:
- 	m_free(cli_opts.proxycmd);
- 	m_free(cmd_arg);
-+#if DROPBEAR_CLI_MULTIHOP
- 	if (cli_opts.proxyexec) {
- 		char **a = NULL;
- 		for (a = cli_opts.proxyexec; *a; a++) {
-@@ -166,6 +175,7 @@ cleanup:
- 		}
- 		m_free(cli_opts.proxyexec);
- 	}
-+#endif
- }
- 
- static void kill_proxy_sighandler(int UNUSED(signo)) {
diff --git a/package/network/services/dropbear/patches/051-fix-pubkey-options.patch b/package/network/services/dropbear/patches/051-fix-pubkey-options.patch
deleted file mode 100644
index ce0a524657..0000000000
--- a/package/network/services/dropbear/patches/051-fix-pubkey-options.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 91877a0337f432fd29bb1041be5599ea706e5de6 Mon Sep 17 00:00:00 2001
-From: Konstantin Demin <rockdrilla at gmail.com>
-Date: Thu, 31 Jul 2025 14:13:35 +0300
-Subject: fix build without pubkey options
-
-fixes:
-- 98ef42a856 "Don't set pubkey_info directly in checkpubkey_line"
-- 62ea53c1e5 "Implement no-touch-required and verify-requred for authorized_keys file"
-
-Signed-off-by: Konstantin Demin <rockdrilla at gmail.com>
-Forwarded: https://github.com/mkj/dropbear/pull/374
----
- src/svr-authpubkey.c | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
---- a/src/svr-authpubkey.c
-+++ b/src/svr-authpubkey.c
-@@ -186,12 +186,14 @@ void svr_auth_pubkey(int valid_user) {
- 
- #if DROPBEAR_SK_ECDSA || DROPBEAR_SK_ED25519
- 	key->sk_flags_mask = SSH_SK_USER_PRESENCE_REQD;
-+#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
- 	if (ses.authstate.pubkey_options && ses.authstate.pubkey_options->no_touch_required_flag) {
- 		key->sk_flags_mask &= ~SSH_SK_USER_PRESENCE_REQD;
- 	}
- 	if (ses.authstate.pubkey_options && ses.authstate.pubkey_options->verify_required_flag) {
- 		key->sk_flags_mask |= SSH_SK_USER_VERIFICATION_REQD;
- 	}
-+#endif /* DROPBEAR_SVR_PUBKEY_OPTIONS */
- #endif
- 
- 	/* create the data which has been signed - this a string containing
-@@ -513,7 +515,13 @@ static int checkpubkey(const char* keyal
- 		line_num++;
- 
- 		ret = checkpubkey_line(line, line_num, filename, keyalgo, keyalgolen,
--			keyblob, keybloblen, &ses.authstate.pubkey_info);
-+			keyblob, keybloblen,
-+#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
-+			&ses.authstate.pubkey_info
-+#else
-+			NULL
-+#endif
-+		);
- 		if (ret == DROPBEAR_SUCCESS) {
- 			break;
- 		}
diff --git a/package/network/services/dropbear/patches/052-fix-missing-depends-for-sntrup761x25519-sha512.patch b/package/network/services/dropbear/patches/052-fix-missing-depends-for-sntrup761x25519-sha512.patch
deleted file mode 100644
index 82edb7cd72..0000000000
--- a/package/network/services/dropbear/patches/052-fix-missing-depends-for-sntrup761x25519-sha512.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4bc1e18948d0918bcb1338a5f1e7856478abf985 Mon Sep 17 00:00:00 2001
-From: Konstantin Demin <rockdrilla at gmail.com>
-Date: Fri, 8 Aug 2025 10:02:44 +0300
-Subject: fix missing depends for sntrup761x25519-sha512
-
-fixes 440b7b5c4f "Add sntrup761x25519-sha512 post-quantum key exchange"
-
-Signed-off-by: Konstantin Demin <rockdrilla at gmail.com>
-Forwarded: https://github.com/mkj/dropbear/pull/375
----
- src/sysoptions.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/sysoptions.h
-+++ b/src/sysoptions.h
-@@ -207,7 +207,7 @@
- /* LTC SHA384 depends on SHA512 */
- #define DROPBEAR_SHA512 ((DROPBEAR_SHA2_512_HMAC) || (DROPBEAR_ECC_521) \
- 			|| (DROPBEAR_SHA384) || (DROPBEAR_DH_GROUP16) \
--			|| (DROPBEAR_ED25519))
-+			|| (DROPBEAR_ED25519) || (DROPBEAR_SNTRUP761))
- 
- #define DROPBEAR_DH_GROUP14 ((DROPBEAR_DH_GROUP14_SHA256) || (DROPBEAR_DH_GROUP14_SHA1))
- 
diff --git a/package/network/services/dropbear/patches/053-Don-t-limit-channel-window-to-500MB.patch b/package/network/services/dropbear/patches/053-Don-t-limit-channel-window-to-500MB.patch
deleted file mode 100644
index eb9ab1cc21..0000000000
--- a/package/network/services/dropbear/patches/053-Don-t-limit-channel-window-to-500MB.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From a8610f7b98ad4b33ab723602863d60d462fa5af2 Mon Sep 17 00:00:00 2001
-From: Matt Johnston <matt at ucc.asn.au>
-Date: Sun, 10 Aug 2025 19:46:01 +0800
-Subject: Don't limit channel window to 500MB
-
-Previously the channel window and increments were limited to 500MB.
-That is incorrect and causes stuck connections if peers advertise
-a large window, then don't send an increment within the first 500MB.
-
-That's seen with SSH.NET https://github.com/sshnet/SSH.NET/issues/1671
----
- src/common-channel.c | 17 ++++++++++-------
- src/sysoptions.h     |  3 ---
- 2 files changed, 10 insertions(+), 10 deletions(-)
-
---- a/src/common-channel.c
-+++ b/src/common-channel.c
-@@ -858,17 +858,21 @@ void common_recv_msg_channel_data(struct Channel *channel, int fd,
- void recv_msg_channel_window_adjust() {
- 
- 	struct Channel * channel;
--	unsigned int incr;
-+	unsigned int incr, newwin;
- 	
- 	channel = getchannel();
- 	
- 	incr = buf_getint(ses.payload);
--	TRACE(("received window increment %d", incr))
--	incr = MIN(incr, TRANS_MAX_WIN_INCR);
-+	TRACE(("received window increment %u", incr))
- 	
--	channel->transwindow += incr;
--	channel->transwindow = MIN(channel->transwindow, TRANS_MAX_WINDOW);
--
-+	newwin = channel->transwindow + incr;
-+	if (newwin < channel->transwindow) {
-+		/* Integer overflow, clamp it at maximum.
-+		 * Behaviour may be unexpected, senders MUST NOT overflow per rfc4254. */
-+		TRACE(("overflow window, prev %u", channel->transwindow));
-+		newwin = 0xffffffff;
-+	}
-+	channel->transwindow = newwin;
- }
- 
- /* Increment the incoming data window for a channel, and let the remote
-@@ -906,7 +910,6 @@ void recv_msg_channel_open() {
- 
- 	remotechan = buf_getint(ses.payload);
- 	transwindow = buf_getint(ses.payload);
--	transwindow = MIN(transwindow, TRANS_MAX_WINDOW);
- 	transmaxpacket = buf_getint(ses.payload);
- 	transmaxpacket = MIN(transmaxpacket, TRANS_MAX_PAYLOAD_LEN);
- 
---- a/src/sysoptions.h
-+++ b/src/sysoptions.h
-@@ -243,9 +243,6 @@
- #define RECV_MAX_PACKET_LEN (MAX(35000, ((RECV_MAX_PAYLOAD_LEN)+100)))
- 
- /* for channel code */
--#define TRANS_MAX_WINDOW 500000000 /* 500MB is sufficient, stopping overflow */
--#define TRANS_MAX_WIN_INCR 500000000 /* overflow prevention */
--
- #define RECV_WINDOWEXTEND (opts.recv_window / 3) /* We send a "window extend" every
- 								RECV_WINDOWEXTEND bytes */
- #define MAX_RECV_WINDOW (10*1024*1024) /* 10 MB should be enough */
diff --git a/package/network/services/dropbear/patches/110-change_user.patch b/package/network/services/dropbear/patches/110-change_user.patch
index 9ef8f0cfbc..3e8c736a67 100644
--- a/package/network/services/dropbear/patches/110-change_user.patch
+++ b/package/network/services/dropbear/patches/110-change_user.patch
@@ -1,6 +1,6 @@
---- a/src/svr-chansession.c
-+++ b/src/svr-chansession.c
-@@ -984,12 +984,12 @@ static void execchild(const void *user_d
+--- a/src/svr-auth.c
++++ b/src/svr-auth.c
+@@ -510,9 +510,9 @@ void svr_switch_user(void) {
  	/* We can only change uid/gid as root ... */
  	if (getuid() == 0) {
  
@@ -11,6 +11,11 @@
 +						ses.authstate.pw_gid) < 0))) {
  			dropbear_exit("Error changing user group");
  		}
+ 
+@@ -534,7 +534,7 @@ void svr_switch_user(void) {
+ 		}
+ #endif
+ 
 -		if (setuid(ses.authstate.pw_uid) < 0) {
 +		if ((ses.authstate.pw_uid != 0) && (setuid(ses.authstate.pw_uid) < 0)) {
  			dropbear_exit("Error changing user");
diff --git a/package/network/services/dropbear/patches/900-configure-hardening.patch b/package/network/services/dropbear/patches/900-configure-hardening.patch
index 746694f48d..74cf2ba05d 100644
--- a/package/network/services/dropbear/patches/900-configure-hardening.patch
+++ b/package/network/services/dropbear/patches/900-configure-hardening.patch
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -86,54 +86,6 @@ AC_ARG_ENABLE(harden,
+@@ -80,54 +80,6 @@ AC_ARG_ENABLE(harden,
  
  if test "$hardenbuild" -eq 1; then
  	AC_MSG_NOTICE(Checking for available hardened build flags:)
diff --git a/package/network/services/dropbear/patches/901-bundled-libs-cflags.patch b/package/network/services/dropbear/patches/901-bundled-libs-cflags.patch
index 4da01c9edb..2bb35ea5a5 100644
--- a/package/network/services/dropbear/patches/901-bundled-libs-cflags.patch
+++ b/package/network/services/dropbear/patches/901-bundled-libs-cflags.patch
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -44,11 +44,8 @@ fi
+@@ -38,11 +38,8 @@ fi
  # LTM_CFLAGS is given to ./configure by the user, 
  # DROPBEAR_LTM_CFLAGS is substituted in the LTM Makefile.in
  DROPBEAR_LTM_CFLAGS="$LTM_CFLAGS"



From lede-commits at lists.infradead.org  Tue Dec 16 20:00:06 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 16 Dec 2025 23:00:06 -0500
Subject: [openwrt/openwrt]  dropbear: bump to 2025.89 (CVE-2025-14282,
 CVE-2019-6111)
In-Reply-To: <176594400676.3203744.16385398590895956123@git-01.infra.openwrt.org>
References: <176594400676.3203744.16385398590895956123@git-01.infra.openwrt.org>
Message-ID: <mailman.36637.1765944014.2093109.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/fe635c56acc7ae26978ce419e2fc50eb02699828

commit fe635c56acc7ae26978ce419e2fc50eb02699828
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Tue Dec 16 16:42:19 2025 +0000

    dropbear: bump to 2025.89 (CVE-2025-14282, CVE-2019-6111)
    
    - Security: Avoid privilege escalation via unix stream forwarding in Dropbear
      server. Other programs on a system may authenticate unix sockets via
      SO_PEERCRED, which would be root user for Dropbear forwarded connections,
      allowing root privilege escalation.
      Reported by Turistu, and thanks for advice on the fix.
      This is tracked as CVE-2025-14282, and affects 2024.84 to 2025.88.
    
      It is fixed by dropping privileges of the dropbear process after
      authentication. Unix stream sockets are now disallowed when a
      forced command is used, either with authorized_key restrictions or
      "dropbear -c command".
    
      In previous affected releases running with "dropbear -j" (will also disable
      TCP fowarding) or building with localoptions.h/distrooptions.h
      "#define DROPBEAR_SVR_LOCALSTREAMFWD 0" is a mitigation.
    
    - Security: Include scp fix for CVE-2019-6111. This allowed
      a malicious server to overwrite arbitrary local files.
      The missing fix was reported by Ashish Kunwar.
    
    - Server dropping privileges post-auth is enabled by default. This requires
      setresgid() support, so some platforms such as netbsd or macos will have to
      disable DROPBEAR_SVR_DROP_PRIVS in localoptions.h. Unix stream forwarding is
      not available if DROPBEAR_SVR_DROP_PRIVS is disabled.
    
      Remote server TCP socket forwarding will now use OS privileged port
      restrictions rather than having a fixed "allow >=1024 for non-root" rule.
    
      A future release may implement privilege dropping for netbsd/macos.
    
    - Fix a regression in 2025.87 when RSA and DSS are not built. This would lead
      to a crash at startup with bad_bufptr().
      Reported by Dani Schmitt and Sebastian Priebe.
    
    - Don't limit channel window to 500MB. That is could cause stuck connections
      if peers advise a large window and don't send an increment within 500MB.
      Affects SSH.NET https://github.com/sshnet/SSH.NET/issues/1671
      Reported by Rob Hague.
    
    - Ignore -g -s when passwords arent enabled. Patch from Norbert Lange.
      Ignore -m (disable MOTD), -j/-k (tcp forwarding) when not enabled.
    
    - Report SIGBUS and SIGTRAP signals. Patch from Lo?c Mangeonjean.
    
    - Fix incorrect server auth delay. Was meant to be 250-350ms, it was actually
      150-350ms or possibly negative (zero). Reported by pickaxprograms.
    
    - Fix building without public key options. Thanks to Konstantin Demin
    
    - Fix building with proxycmd but without netcat. Thanks to Konstantin Demin
    
    - Fix incorrect path documentation for distrooptions, thanks to Todd Zullinger
    
    - Fix SO_REUSEADDR for TCP tests, reported by vt-alt.
    
    Dropped:
    
     * 050-dropbear-multihop-fix.patch as its included in the release 5cc0127000db5f
     * 051-fix-pubkey-options.patch as its included in the release 1d4c4a542cd5df
     * 052-fix-missing-depends-for-sntrup761x25519-sha512.patch as its included
       in the release 1a2c1e649a1824
     * 053-Don-t-limit-channel-window-to-500MB.patch as its included in the release a8610f7b98ad
    
    Manually rebased:
    
     * 110-change_user.patch
    
    Fixes: CVE-2025-14282, CVE-2019-6111
    Reviewed-by: Hauke Mehrtens <hauke at hauke-m.de>
    Reviewed-by: Konstantin Demin <rockdrilla at gmail.com>
    Tested-by: Konstantin Demin <rockdrilla at gmail.com> [mediatek/filogic (GL.iNet GL-MT6000)]
    Link: https://github.com/openwrt/openwrt/pull/21186
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
    (cherry picked from commit 70a4da1cebc87fc7b3cfa3f634b5bdf3db12ccd5)
---
 package/network/services/dropbear/Makefile         |  6 +-
 .../patches/050-dropbear-multihop-fix.patch        | 70 ----------------------
 .../dropbear/patches/051-fix-pubkey-options.patch  | 47 ---------------
 ...issing-depends-for-sntrup761x25519-sha512.patch | 24 --------
 .../053-Don-t-limit-channel-window-to-500MB.patch  | 65 --------------------
 .../dropbear/patches/110-change_user.patch         | 11 +++-
 .../dropbear/patches/900-configure-hardening.patch |  2 +-
 .../dropbear/patches/901-bundled-libs-cflags.patch |  2 +-
 8 files changed, 13 insertions(+), 214 deletions(-)

diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile
index 59aff2f7cf..457f099fdd 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dropbear
-PKG_VERSION:=2025.88
-PKG_RELEASE:=4
+PKG_VERSION:=2025.89
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
 	https://matt.ucc.asn.au/dropbear/releases/ \
 	https://dropbear.nl/mirror/releases/
-PKG_HASH:=783f50ea27b17c16da89578fafdb6decfa44bb8f6590e5698a4e4d3672dc53d4
+PKG_HASH:=0d1f7ca711cfc336dc8a85e672cab9cfd8223a02fe2da0a4a7aeb58c9e113634
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE
diff --git a/package/network/services/dropbear/patches/050-dropbear-multihop-fix.patch b/package/network/services/dropbear/patches/050-dropbear-multihop-fix.patch
deleted file mode 100644
index d8d6ff18c9..0000000000
--- a/package/network/services/dropbear/patches/050-dropbear-multihop-fix.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 5cc0127000db5f7567b54d0495fb91a8e452fe09 Mon Sep 17 00:00:00 2001
-From: Konstantin Demin <rockdrilla at gmail.com>
-Date: Fri, 9 May 2025 22:39:35 +0300
-Subject: Fix proxycmd without netcat
-
-fixes e5a0ef27c2 "Execute multihop commands directly, no shell"
-
-Signed-off-by: Konstantin Demin <rockdrilla at gmail.com>
-Forwarded: https://github.com/mkj/dropbear/pull/363
----
- src/cli-main.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
---- a/src/cli-main.c
-+++ b/src/cli-main.c
-@@ -77,7 +77,11 @@ int main(int argc, char ** argv) {
- 	}
- 
- #if DROPBEAR_CLI_PROXYCMD
--	if (cli_opts.proxycmd || cli_opts.proxyexec) {
-+	if (cli_opts.proxycmd
-+#if DROPBEAR_CLI_MULTIHOP
-+		|| cli_opts.proxyexec
-+#endif
-+	) {
- 		cli_proxy_cmd(&sock_in, &sock_out, &proxy_cmd_pid);
- 		if (signal(SIGINT, kill_proxy_sighandler) == SIG_ERR ||
- 			signal(SIGTERM, kill_proxy_sighandler) == SIG_ERR ||
-@@ -110,11 +114,13 @@ static void shell_proxy_cmd(const void *
- 	dropbear_exit("Failed to run '%s'\n", cmd);
- }
- 
-+#if DROPBEAR_CLI_MULTIHOP
- static void exec_proxy_cmd(const void *unused) {
- 	(void)unused;
- 	run_command(cli_opts.proxyexec[0], cli_opts.proxyexec, ses.maxfd);
- 	dropbear_exit("Failed to run '%s'\n", cli_opts.proxyexec[0]);
- }
-+#endif
- 
- static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) {
- 	char * cmd_arg = NULL;
-@@ -145,9 +151,11 @@ static void cli_proxy_cmd(int *sock_in,
- 		cmd_arg = m_malloc(shell_cmdlen);
- 		snprintf(cmd_arg, shell_cmdlen, "exec %s", cli_opts.proxycmd);
- 		exec_fn = shell_proxy_cmd;
-+#if DROPBEAR_CLI_MULTIHOP
- 	} else {
- 		/* No shell */
- 		exec_fn = exec_proxy_cmd;
-+#endif
- 	}
- 
- 	ret = spawn_command(exec_fn, cmd_arg, sock_out, sock_in, NULL, pid_out);
-@@ -159,6 +167,7 @@ static void cli_proxy_cmd(int *sock_in,
- cleanup:
- 	m_free(cli_opts.proxycmd);
- 	m_free(cmd_arg);
-+#if DROPBEAR_CLI_MULTIHOP
- 	if (cli_opts.proxyexec) {
- 		char **a = NULL;
- 		for (a = cli_opts.proxyexec; *a; a++) {
-@@ -166,6 +175,7 @@ cleanup:
- 		}
- 		m_free(cli_opts.proxyexec);
- 	}
-+#endif
- }
- 
- static void kill_proxy_sighandler(int UNUSED(signo)) {
diff --git a/package/network/services/dropbear/patches/051-fix-pubkey-options.patch b/package/network/services/dropbear/patches/051-fix-pubkey-options.patch
deleted file mode 100644
index ce0a524657..0000000000
--- a/package/network/services/dropbear/patches/051-fix-pubkey-options.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 91877a0337f432fd29bb1041be5599ea706e5de6 Mon Sep 17 00:00:00 2001
-From: Konstantin Demin <rockdrilla at gmail.com>
-Date: Thu, 31 Jul 2025 14:13:35 +0300
-Subject: fix build without pubkey options
-
-fixes:
-- 98ef42a856 "Don't set pubkey_info directly in checkpubkey_line"
-- 62ea53c1e5 "Implement no-touch-required and verify-requred for authorized_keys file"
-
-Signed-off-by: Konstantin Demin <rockdrilla at gmail.com>
-Forwarded: https://github.com/mkj/dropbear/pull/374
----
- src/svr-authpubkey.c | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
---- a/src/svr-authpubkey.c
-+++ b/src/svr-authpubkey.c
-@@ -186,12 +186,14 @@ void svr_auth_pubkey(int valid_user) {
- 
- #if DROPBEAR_SK_ECDSA || DROPBEAR_SK_ED25519
- 	key->sk_flags_mask = SSH_SK_USER_PRESENCE_REQD;
-+#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
- 	if (ses.authstate.pubkey_options && ses.authstate.pubkey_options->no_touch_required_flag) {
- 		key->sk_flags_mask &= ~SSH_SK_USER_PRESENCE_REQD;
- 	}
- 	if (ses.authstate.pubkey_options && ses.authstate.pubkey_options->verify_required_flag) {
- 		key->sk_flags_mask |= SSH_SK_USER_VERIFICATION_REQD;
- 	}
-+#endif /* DROPBEAR_SVR_PUBKEY_OPTIONS */
- #endif
- 
- 	/* create the data which has been signed - this a string containing
-@@ -513,7 +515,13 @@ static int checkpubkey(const char* keyal
- 		line_num++;
- 
- 		ret = checkpubkey_line(line, line_num, filename, keyalgo, keyalgolen,
--			keyblob, keybloblen, &ses.authstate.pubkey_info);
-+			keyblob, keybloblen,
-+#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
-+			&ses.authstate.pubkey_info
-+#else
-+			NULL
-+#endif
-+		);
- 		if (ret == DROPBEAR_SUCCESS) {
- 			break;
- 		}
diff --git a/package/network/services/dropbear/patches/052-fix-missing-depends-for-sntrup761x25519-sha512.patch b/package/network/services/dropbear/patches/052-fix-missing-depends-for-sntrup761x25519-sha512.patch
deleted file mode 100644
index 82edb7cd72..0000000000
--- a/package/network/services/dropbear/patches/052-fix-missing-depends-for-sntrup761x25519-sha512.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4bc1e18948d0918bcb1338a5f1e7856478abf985 Mon Sep 17 00:00:00 2001
-From: Konstantin Demin <rockdrilla at gmail.com>
-Date: Fri, 8 Aug 2025 10:02:44 +0300
-Subject: fix missing depends for sntrup761x25519-sha512
-
-fixes 440b7b5c4f "Add sntrup761x25519-sha512 post-quantum key exchange"
-
-Signed-off-by: Konstantin Demin <rockdrilla at gmail.com>
-Forwarded: https://github.com/mkj/dropbear/pull/375
----
- src/sysoptions.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/sysoptions.h
-+++ b/src/sysoptions.h
-@@ -207,7 +207,7 @@
- /* LTC SHA384 depends on SHA512 */
- #define DROPBEAR_SHA512 ((DROPBEAR_SHA2_512_HMAC) || (DROPBEAR_ECC_521) \
- 			|| (DROPBEAR_SHA384) || (DROPBEAR_DH_GROUP16) \
--			|| (DROPBEAR_ED25519))
-+			|| (DROPBEAR_ED25519) || (DROPBEAR_SNTRUP761))
- 
- #define DROPBEAR_DH_GROUP14 ((DROPBEAR_DH_GROUP14_SHA256) || (DROPBEAR_DH_GROUP14_SHA1))
- 
diff --git a/package/network/services/dropbear/patches/053-Don-t-limit-channel-window-to-500MB.patch b/package/network/services/dropbear/patches/053-Don-t-limit-channel-window-to-500MB.patch
deleted file mode 100644
index eb9ab1cc21..0000000000
--- a/package/network/services/dropbear/patches/053-Don-t-limit-channel-window-to-500MB.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From a8610f7b98ad4b33ab723602863d60d462fa5af2 Mon Sep 17 00:00:00 2001
-From: Matt Johnston <matt at ucc.asn.au>
-Date: Sun, 10 Aug 2025 19:46:01 +0800
-Subject: Don't limit channel window to 500MB
-
-Previously the channel window and increments were limited to 500MB.
-That is incorrect and causes stuck connections if peers advertise
-a large window, then don't send an increment within the first 500MB.
-
-That's seen with SSH.NET https://github.com/sshnet/SSH.NET/issues/1671
----
- src/common-channel.c | 17 ++++++++++-------
- src/sysoptions.h     |  3 ---
- 2 files changed, 10 insertions(+), 10 deletions(-)
-
---- a/src/common-channel.c
-+++ b/src/common-channel.c
-@@ -858,17 +858,21 @@ void common_recv_msg_channel_data(struct Channel *channel, int fd,
- void recv_msg_channel_window_adjust() {
- 
- 	struct Channel * channel;
--	unsigned int incr;
-+	unsigned int incr, newwin;
- 	
- 	channel = getchannel();
- 	
- 	incr = buf_getint(ses.payload);
--	TRACE(("received window increment %d", incr))
--	incr = MIN(incr, TRANS_MAX_WIN_INCR);
-+	TRACE(("received window increment %u", incr))
- 	
--	channel->transwindow += incr;
--	channel->transwindow = MIN(channel->transwindow, TRANS_MAX_WINDOW);
--
-+	newwin = channel->transwindow + incr;
-+	if (newwin < channel->transwindow) {
-+		/* Integer overflow, clamp it at maximum.
-+		 * Behaviour may be unexpected, senders MUST NOT overflow per rfc4254. */
-+		TRACE(("overflow window, prev %u", channel->transwindow));
-+		newwin = 0xffffffff;
-+	}
-+	channel->transwindow = newwin;
- }
- 
- /* Increment the incoming data window for a channel, and let the remote
-@@ -906,7 +910,6 @@ void recv_msg_channel_open() {
- 
- 	remotechan = buf_getint(ses.payload);
- 	transwindow = buf_getint(ses.payload);
--	transwindow = MIN(transwindow, TRANS_MAX_WINDOW);
- 	transmaxpacket = buf_getint(ses.payload);
- 	transmaxpacket = MIN(transmaxpacket, TRANS_MAX_PAYLOAD_LEN);
- 
---- a/src/sysoptions.h
-+++ b/src/sysoptions.h
-@@ -243,9 +243,6 @@
- #define RECV_MAX_PACKET_LEN (MAX(35000, ((RECV_MAX_PAYLOAD_LEN)+100)))
- 
- /* for channel code */
--#define TRANS_MAX_WINDOW 500000000 /* 500MB is sufficient, stopping overflow */
--#define TRANS_MAX_WIN_INCR 500000000 /* overflow prevention */
--
- #define RECV_WINDOWEXTEND (opts.recv_window / 3) /* We send a "window extend" every
- 								RECV_WINDOWEXTEND bytes */
- #define MAX_RECV_WINDOW (10*1024*1024) /* 10 MB should be enough */
diff --git a/package/network/services/dropbear/patches/110-change_user.patch b/package/network/services/dropbear/patches/110-change_user.patch
index 9ef8f0cfbc..3e8c736a67 100644
--- a/package/network/services/dropbear/patches/110-change_user.patch
+++ b/package/network/services/dropbear/patches/110-change_user.patch
@@ -1,6 +1,6 @@
---- a/src/svr-chansession.c
-+++ b/src/svr-chansession.c
-@@ -984,12 +984,12 @@ static void execchild(const void *user_d
+--- a/src/svr-auth.c
++++ b/src/svr-auth.c
+@@ -510,9 +510,9 @@ void svr_switch_user(void) {
  	/* We can only change uid/gid as root ... */
  	if (getuid() == 0) {
  
@@ -11,6 +11,11 @@
 +						ses.authstate.pw_gid) < 0))) {
  			dropbear_exit("Error changing user group");
  		}
+ 
+@@ -534,7 +534,7 @@ void svr_switch_user(void) {
+ 		}
+ #endif
+ 
 -		if (setuid(ses.authstate.pw_uid) < 0) {
 +		if ((ses.authstate.pw_uid != 0) && (setuid(ses.authstate.pw_uid) < 0)) {
  			dropbear_exit("Error changing user");
diff --git a/package/network/services/dropbear/patches/900-configure-hardening.patch b/package/network/services/dropbear/patches/900-configure-hardening.patch
index 746694f48d..74cf2ba05d 100644
--- a/package/network/services/dropbear/patches/900-configure-hardening.patch
+++ b/package/network/services/dropbear/patches/900-configure-hardening.patch
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -86,54 +86,6 @@ AC_ARG_ENABLE(harden,
+@@ -80,54 +80,6 @@ AC_ARG_ENABLE(harden,
  
  if test "$hardenbuild" -eq 1; then
  	AC_MSG_NOTICE(Checking for available hardened build flags:)
diff --git a/package/network/services/dropbear/patches/901-bundled-libs-cflags.patch b/package/network/services/dropbear/patches/901-bundled-libs-cflags.patch
index 4da01c9edb..2bb35ea5a5 100644
--- a/package/network/services/dropbear/patches/901-bundled-libs-cflags.patch
+++ b/package/network/services/dropbear/patches/901-bundled-libs-cflags.patch
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -44,11 +44,8 @@ fi
+@@ -38,11 +38,8 @@ fi
  # LTM_CFLAGS is given to ./configure by the user, 
  # DROPBEAR_LTM_CFLAGS is substituted in the LTM Makefile.in
  DROPBEAR_LTM_CFLAGS="$LTM_CFLAGS"



From lede-commits at lists.infradead.org  Wed Dec 17 12:20:28 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 15:20:28 -0500
Subject: [openwrt/openwrt]  dropbear: backport security fixes
In-Reply-To: <176600282863.2578788.16788145227757023970@git-01.infra.openwrt.org>
References: <176600282863.2578788.16788145227757023970@git-01.infra.openwrt.org>
Message-ID: <mailman.36974.1766002860.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/0f52a05723988633882d6c52122009ce11f8956b

commit 0f52a05723988633882d6c52122009ce11f8956b
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Wed Dec 17 00:41:30 2025 +0100

    dropbear: backport security fixes
    
    This fixes the following security problems:
    CVE-2025-14282: Avoid privilege escalation via unix stream forwarding in Dropbear server.
    CVE-2019-6111: This allowed a malicious server to overwrite arbitrary local files.
    
    This backports two upstream merged PRs:
    https://github.com/mkj/dropbear/pull/391
    https://github.com/mkj/dropbear/pull/394
    and this upstream commit:
    https://github.com/mkj/dropbear/commit/48a17cff6aa104b8e806ddb2191f83f1024060f1
    
    Link: https://github.com/openwrt/openwrt/pull/21192
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/services/dropbear/Makefile         |   2 +-
 ...Drop-privileges-after-user-authentication.patch | 262 +++++++++++++++++++++
 .../002-Remove-return-code-from-login_login.patch  |  91 +++++++
 ...utmp-saved-group-when-dropping-privileges.patch | 260 ++++++++++++++++++++
 .../004-Limit-rekey-to-current-hostkey-type.patch  |  64 +++++
 .../005-Restore-seteuid-for-authorized_keys.patch  |  41 ++++
 .../patches/006-scp-CVE-2019-6111-fix.patch        | 153 ++++++++++++
 .../dropbear/patches/110-change_user.patch         |  11 +-
 8 files changed, 880 insertions(+), 4 deletions(-)

diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile
index e13b6c2145..dd54c5bc25 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dropbear
 PKG_VERSION:=2024.86
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
diff --git a/package/network/services/dropbear/patches/001-Drop-privileges-after-user-authentication.patch b/package/network/services/dropbear/patches/001-Drop-privileges-after-user-authentication.patch
new file mode 100644
index 0000000000..66830ee81d
--- /dev/null
+++ b/package/network/services/dropbear/patches/001-Drop-privileges-after-user-authentication.patch
@@ -0,0 +1,262 @@
+From 61cfbc66aefcb047534210713f3aac097100e5f5 Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt at ucc.asn.au>
+Date: Tue, 9 Dec 2025 15:08:06 +0900
+Subject: Drop privileges after user authentication
+
+Instead of switching user privileges after forking to a shell, switch
+to the user immediately upon successful authentication.
+
+This will require further commits to fix utmp and hostkey handling.
+
+The DROPBEAR_SVR_DROP_PRIVS configuration option controls this
+behaviour.  This should generally be enabled, but can be set to 0 for
+incompatible platforms.  In future it may become non-optional, those
+platforms should be investigated.
+
+Most uses of DROPBEAR_SVR_MULTIUSER have been replaced by
+!DROPBEAR_SVR_DROP_PRIVS.
+
+(cherry picked from commit e0251be2354e1a5c6eccfc2cf4b64243625dafcc)
+---
+ .github/workflows/build.yml |  2 ++
+ src/auth.h                  |  1 +
+ src/default_options.h       |  6 +++++
+ src/svr-agentfwd.c          | 14 ++++++++----
+ src/svr-auth.c              | 45 +++++++++++++++++++++++++++++++++++++
+ src/svr-authpubkey.c        |  6 +++--
+ src/svr-chansession.c       | 26 ++-------------------
+ src/sysoptions.h            |  3 +++
+ 8 files changed, 73 insertions(+), 30 deletions(-)
+
+--- a/.github/workflows/build.yml
++++ b/.github/workflows/build.yml
+@@ -217,6 +217,8 @@ jobs:
+           echo "#define DROPBEAR_SVR_PASSWORD_AUTH 0" >> localoptions.h
+           # 1 second timeout is too short
+           sed -i "s/DEFAULT_IDLE_TIMEOUT 1/DEFAULT_IDLE_TIMEOUT 99/" localoptions.h
++          # DROPBEAR_SVR_DROP_PRIVS is on by default, turn it off
++          echo "#define DROPBEAR_SVR_DROP_PRIVS 0" >> localoptions.h
+ 
+       - name: make
+         run: |
+--- a/src/auth.h
++++ b/src/auth.h
+@@ -40,6 +40,7 @@ void send_msg_userauth_banner(const buff
+ void svr_auth_password(int valid_user);
+ void svr_auth_pubkey(int valid_user);
+ void svr_auth_pam(int valid_user);
++void svr_switch_user(void);
+ 
+ #if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
+ int svr_pubkey_allows_agentfwd(void);
+--- a/src/default_options.h
++++ b/src/default_options.h
+@@ -297,6 +297,12 @@ group1 in Dropbear server too */
+ /* -T server option overrides */
+ #define MAX_AUTH_TRIES 10
+ 
++/* Change server process to user privileges after authentication. */
++#ifndef DROPBEAR_SVR_DROP_PRIVS
++/* Default is enabled. Should only be disabled if platforms are incompatible */
++#define DROPBEAR_SVR_DROP_PRIVS DROPBEAR_SVR_MULTIUSER
++#endif
++
+ /* Delay introduced before closing an unauthenticated session (seconds).
+    Disabled by default, can be set to say 30 seconds to reduce the speed
+    of password brute forcing. Note that there is a risk of denial of
+--- a/src/svr-agentfwd.c
++++ b/src/svr-agentfwd.c
+@@ -151,7 +151,7 @@ void svr_agentcleanup(struct ChanSess *
+ 
+ 	if (chansess->agentfile != NULL && chansess->agentdir != NULL) {
+ 
+-#if DROPBEAR_SVR_MULTIUSER
++#if !DROPBEAR_SVR_DROP_PRIVS
+ 		/* Remove the dir as the user. That way they can't cause problems except
+ 		 * for themselves */
+ 		uid = getuid();
+@@ -160,6 +160,9 @@ void svr_agentcleanup(struct ChanSess *
+ 			(seteuid(ses.authstate.pw_uid)) < 0) {
+ 			dropbear_exit("Failed to set euid");
+ 		}
++#else
++		(void)uid;
++		(void)gid;
+ #endif
+ 
+ 		/* 2 for "/" and "\0" */
+@@ -172,7 +175,7 @@ void svr_agentcleanup(struct ChanSess *
+ 
+ 		rmdir(chansess->agentdir);
+ 
+-#if DROPBEAR_SVR_MULTIUSER
++#if !DROPBEAR_SVR_DROP_PRIVS
+ 		if ((seteuid(uid)) < 0 ||
+ 			(setegid(gid)) < 0) {
+ 			dropbear_exit("Failed to revert euid");
+@@ -219,7 +222,7 @@ static int bindagent(int fd, struct Chan
+ 	gid_t gid;
+ 	int ret = DROPBEAR_FAILURE;
+ 
+-#if DROPBEAR_SVR_MULTIUSER
++#if !DROPBEAR_SVR_DROP_PRIVS
+ 	/* drop to user privs to make the dir/file */
+ 	uid = getuid();
+ 	gid = getgid();
+@@ -227,6 +230,9 @@ static int bindagent(int fd, struct Chan
+ 		(seteuid(ses.authstate.pw_uid)) < 0) {
+ 		dropbear_exit("Failed to set euid");
+ 	}
++#else
++		(void)uid;
++		(void)gid;
+ #endif
+ 
+ 	memset((void*)&addr, 0x0, sizeof(addr));
+@@ -267,7 +273,7 @@ bindsocket:
+ 
+ 
+ out:
+-#if DROPBEAR_SVR_MULTIUSER
++#if !DROPBEAR_SVR_DROP_PRIVS
+ 	if ((seteuid(uid)) < 0 ||
+ 		(setegid(gid)) < 0) {
+ 		dropbear_exit("Failed to revert euid");
+--- a/src/svr-auth.c
++++ b/src/svr-auth.c
+@@ -456,12 +456,22 @@ void send_msg_userauth_success() {
+ 	/* authdone must be set after encrypt_packet() for 
+ 	 * delayed-zlib mode */
+ 	ses.authstate.authdone = 1;
++
++#if DROPBEAR_DROP_PRIVS
++	svr_switch_user();
++#endif
+ 	ses.connect_time = 0;
+ 
+ 
++#if DROPBEAR_DROP_PRIVS
++	/* If running as the user, we can rely on the OS
++	 * to limit allowed ports */
++	ses.allowprivport = 1;
++#else
+ 	if (ses.authstate.pw_uid == 0) {
+ 		ses.allowprivport = 1;
+ 	}
++#endif
+ 
+ 	/* Remove from the list of pre-auth sockets. Should be m_close(), since if
+ 	 * we fail, we might end up leaking connection slots, and disallow new
+@@ -471,3 +481,38 @@ void send_msg_userauth_success() {
+ 	TRACE(("leave send_msg_userauth_success"))
+ 
+ }
++
++/* Switch to the ses.authstate user.
++ * Fails if not running as root and the user differs.
++ *
++ * This may be called either after authentication, or 
++ * after shell/command fork if DROPBEAR_SVR_DROP_PRIVS is unset.
++ */
++void svr_switch_user(void) {
++	assert(ses.authstate.authdone);
++
++	/* We can only change uid/gid as root ... */
++	if (getuid() == 0) {
++
++		if ((setgid(ses.authstate.pw_gid) < 0) ||
++			(initgroups(ses.authstate.pw_name, 
++						ses.authstate.pw_gid) < 0)) {
++			dropbear_exit("Error changing user group");
++		}
++		if (setuid(ses.authstate.pw_uid) < 0) {
++			dropbear_exit("Error changing user");
++		}
++	} else {
++		/* ... but if the daemon is the same uid as the requested uid, we don't
++		 * need to */
++
++		/* XXX - there is a minor issue here, in that if there are multiple
++		 * usernames with the same uid, but differing groups, then the
++		 * differing groups won't be set (as with initgroups()). The solution
++		 * is for the sysadmin not to give out the UID twice */
++		if (getuid() != ses.authstate.pw_uid) {
++			dropbear_exit("Couldn't	change user as non-root");
++		}
++	}
++}
++
+--- a/src/svr-authpubkey.c
++++ b/src/svr-authpubkey.c
+@@ -444,12 +444,14 @@ static int checkpubkey(const char* keyal
+ 	buffer * line = NULL;
+ 	unsigned int len;
+ 	int line_num;
++#if !DROPBEAR_SVR_DROP_PRIVS
+ 	uid_t origuid;
+ 	gid_t origgid;
++#endif
+ 
+ 	TRACE(("enter checkpubkey"))
+ 
+-#if DROPBEAR_SVR_MULTIUSER
++#if !DROPBEAR_SVR_DROP_PRIVS
+ 	/* access the file as the authenticating user. */
+ 	origuid = getuid();
+ 	origgid = getgid();
+@@ -476,7 +478,7 @@ static int checkpubkey(const char* keyal
+ 			TRACE(("checkpubkey: failed opening %s: %s", filename, strerror(errno)))
+ 		}
+ 	}
+-#if DROPBEAR_SVR_MULTIUSER
++#if !DROPBEAR_SVR_DROP_PRIVS
+ 	if ((seteuid(origuid)) < 0 ||
+ 		(setegid(origgid)) < 0) {
+ 		dropbear_exit("Failed to revert euid");
+--- a/src/svr-chansession.c
++++ b/src/svr-chansession.c
+@@ -980,30 +980,8 @@ static void execchild(const void *user_d
+ #endif /* DEBUG_VALGRIND */
+ 	}
+ 
+-#if DROPBEAR_SVR_MULTIUSER
+-	/* We can only change uid/gid as root ... */
+-	if (getuid() == 0) {
+-
+-		if ((setgid(ses.authstate.pw_gid) < 0) ||
+-			(initgroups(ses.authstate.pw_name, 
+-						ses.authstate.pw_gid) < 0)) {
+-			dropbear_exit("Error changing user group");
+-		}
+-		if (setuid(ses.authstate.pw_uid) < 0) {
+-			dropbear_exit("Error changing user");
+-		}
+-	} else {
+-		/* ... but if the daemon is the same uid as the requested uid, we don't
+-		 * need to */
+-
+-		/* XXX - there is a minor issue here, in that if there are multiple
+-		 * usernames with the same uid, but differing groups, then the
+-		 * differing groups won't be set (as with initgroups()). The solution
+-		 * is for the sysadmin not to give out the UID twice */
+-		if (getuid() != ses.authstate.pw_uid) {
+-			dropbear_exit("Couldn't	change user as non-root");
+-		}
+-	}
++#if !DROPBEAR_SVR_DROP_PRIVS
++	svr_switch_user();
+ #endif
+ 
+ 	/* set env vars */
+--- a/src/sysoptions.h
++++ b/src/sysoptions.h
+@@ -403,6 +403,9 @@
+ #define DROPBEAR_MULTI 0
+ #endif
+ 
++#if !DROPBEAR_SVR_MULTIUSER && DROPBEAR_SVR_DROP_PRIVS
++#error DROPBEAR_SVR_DROP_PRIVS needs DROPBEAR_SVR_MULTIUSER
++#endif
+ /* Fuzzing expects all key types to be enabled */
+ #if DROPBEAR_FUZZ
+ #if defined(DROPBEAR_DSS)
diff --git a/package/network/services/dropbear/patches/002-Remove-return-code-from-login_login.patch b/package/network/services/dropbear/patches/002-Remove-return-code-from-login_login.patch
new file mode 100644
index 0000000000..9692d16d71
--- /dev/null
+++ b/package/network/services/dropbear/patches/002-Remove-return-code-from-login_login.patch
@@ -0,0 +1,91 @@
+From febe8493782965b05025b016091a8bffa5d03563 Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt at ucc.asn.au>
+Date: Tue, 9 Dec 2025 09:04:04 +0900
+Subject: Remove return code from login_login
+
+Previously this was always 0, so not useful.
+
+(cherry picked from commit b47fe5df58f0b459bb49accdd8cb961d969209fb)
+---
+ src/loginrec.c | 19 +++++--------------
+ src/loginrec.h |  6 +++---
+ 2 files changed, 8 insertions(+), 17 deletions(-)
+
+--- a/src/loginrec.c
++++ b/src/loginrec.c
+@@ -193,32 +193,24 @@ int wtmpx_get_entry(struct logininfo *li
+  *
+  * Call with a pointer to a struct logininfo initialised with
+  * login_init_entry() or login_alloc_entry()
+- *
+- * Returns:
+- *  >0 if successful
+- *  0  on failure (will use OpenSSH's logging facilities for diagnostics)
+  */
+-int
++void
+ login_login (struct logininfo *li)
+ {
+ 	li->type = LTYPE_LOGIN;
+-	return login_write(li);
++	login_write(li);
+ }
+ 
+ 
+ /* login_logout(struct logininfo *)     - Record a logout
+  *
+  * Call as with login_login()
+- *
+- * Returns:
+- *  >0 if successful
+- *  0  on failure (will use OpenSSH's logging facilities for diagnostics)
+  */
+-int
++void
+ login_logout(struct logininfo *li)
+ {
+ 	li->type = LTYPE_LOGOUT;
+-	return login_write(li);
++	login_write(li);
+ }
+ 
+ 
+@@ -309,7 +301,7 @@ login_set_current_time(struct logininfo
+  ** login_write: Call low-level recording functions based on autoconf
+  ** results
+  **/
+-int
++void
+ login_write (struct logininfo *li)
+ {
+ #ifndef HAVE_CYGWIN
+@@ -340,7 +332,6 @@ login_write (struct logininfo *li)
+ #ifdef USE_WTMPX
+ 	wtmpx_write_entry(li);
+ #endif
+-	return 0;
+ }
+ 
+ #ifdef LOGIN_NEEDS_UTMPX
+--- a/src/loginrec.h
++++ b/src/loginrec.h
+@@ -161,8 +161,8 @@ int login_init_entry(struct logininfo *l
+ void login_set_current_time(struct logininfo *li);
+ 
+ /* record the entry */
+-int login_login (struct logininfo *li);
+-int login_logout(struct logininfo *li);
++void login_login (struct logininfo *li);
++void login_logout(struct logininfo *li);
+ #ifdef LOGIN_NEEDS_UTMPX
+ int login_utmp_only(struct logininfo *li);
+ #endif
+@@ -170,7 +170,7 @@ int login_utmp_only(struct logininfo *li
+ /** End of public functions */
+ 
+ /* record the entry */
+-int login_write (struct logininfo *li);
++void login_write (struct logininfo *li);
+ int login_log_entry(struct logininfo *li);
+ 
+ /* produce various forms of the line filename */
diff --git a/package/network/services/dropbear/patches/003-Retain-utmp-saved-group-when-dropping-privileges.patch b/package/network/services/dropbear/patches/003-Retain-utmp-saved-group-when-dropping-privileges.patch
new file mode 100644
index 0000000000..99c9dc5b7a
--- /dev/null
+++ b/package/network/services/dropbear/patches/003-Retain-utmp-saved-group-when-dropping-privileges.patch
@@ -0,0 +1,260 @@
+From b20e7823a0c6a4480aa473e0a46d3ccab4b9b102 Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt at ucc.asn.au>
+Date: Tue, 9 Dec 2025 09:05:30 +0900
+Subject: Retain utmp saved group when dropping privileges
+
+utmp is required to record logout. The saved group
+is reset by the OS for the executed user shell.
+
+This requires setresgid() function which is not available on all
+platforms. Notable platforms are netbsd and macos. Those platforms will
+have to set DROPBEAR_SVR_DROP_PRIVS 0 unless an alternative approach is
+found.
+
+(cherry picked from commit 73e4e70ea8e6b890c3918b52bb2e647313a09faa)
+---
+ .github/workflows/build.yml |  6 ++++
+ configure                   |  7 +++++
+ configure.ac                |  1 +
+ src/auth.h                  |  2 ++
+ src/config.h.in             |  3 ++
+ src/loginrec.c              |  6 ----
+ src/session.h               |  6 ++++
+ src/svr-auth.c              | 61 +++++++++++++++++++++++++++++++++++--
+ src/svr-chansession.c       |  8 +++++
+ src/sysoptions.h            |  4 +++
+ 10 files changed, 96 insertions(+), 8 deletions(-)
+
+--- a/.github/workflows/build.yml
++++ b/.github/workflows/build.yml
+@@ -72,6 +72,9 @@ jobs:
+             # fails with:
+             # .../ranlib: file: libtomcrypt.a(cbc_setiv.o) has no symbols
+             ranlib: ranlib -no_warning_for_no_symbols
++            # macos doesn't have setresgid
++            localoptions: |
++              #define DROPBEAR_SVR_DROP_PRIVS 0
+ 
+           - name: macos 15
+             os: macos-15
+@@ -84,6 +87,9 @@ jobs:
+             # fails with:
+             # .../ranlib: file: libtomcrypt.a(cbc_setiv.o) has no symbols
+             ranlib: ranlib -no_warning_for_no_symbols
++            # macos doesn't have setresgid
++            localoptions: |
++              #define DROPBEAR_SVR_DROP_PRIVS 0
+ 
+           # Check that debug code doesn't bitrot
+           - name: DEBUG_TRACE
+--- a/configure
++++ b/configure
+@@ -7597,6 +7597,13 @@ then :
+ 
+ fi
+ 
++ac_fn_c_check_func "$LINENO" "setresgid" "ac_cv_func_setresgid"
++if test "x$ac_cv_func_setresgid" = xyes
++then :
++  printf "%s\n" "#define HAVE_SETRESGID 1" >>confdefs.h
++
++fi
++
+ 
+ # POSIX monotonic time
+ ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
+--- a/configure.ac
++++ b/configure.ac
+@@ -545,6 +545,7 @@ AC_CHECK_FUNCS(utmpname)
+ AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
+ AC_CHECK_FUNCS(setutxent utmpxname)
+ AC_CHECK_FUNCS(logout updwtmp logwtmp)
++AC_CHECK_FUNCS(setresgid)
+ 
+ # POSIX monotonic time
+ AC_CHECK_FUNCS(clock_gettime)
+--- a/src/auth.h
++++ b/src/auth.h
+@@ -41,6 +41,8 @@ void svr_auth_password(int valid_user);
+ void svr_auth_pubkey(int valid_user);
+ void svr_auth_pam(int valid_user);
+ void svr_switch_user(void);
++void svr_raise_gid_utmp(void);
++void svr_restore_gid(void);
+ 
+ #if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
+ int svr_pubkey_allows_agentfwd(void);
+--- a/src/config.h.in
++++ b/src/config.h.in
+@@ -222,6 +222,9 @@
+ /* Define to 1 if you have the <security/pam_appl.h> header file. */
+ #undef HAVE_SECURITY_PAM_APPL_H
+ 
++/* Define to 1 if you have the `setresgid' function. */
++#undef HAVE_SETRESGID
++
+ /* Define to 1 if you have the `setutent' function. */
+ #undef HAVE_SETUTENT
+ 
+--- a/src/loginrec.c
++++ b/src/loginrec.c
+@@ -304,12 +304,6 @@ login_set_current_time(struct logininfo
+ void
+ login_write (struct logininfo *li)
+ {
+-#ifndef HAVE_CYGWIN
+-	if ((int)geteuid() != 0) {
+-	  return 1;
+-	}
+-#endif
+-
+ 	/* set the timestamp */
+ 	login_set_current_time(li);
+ #ifdef USE_LOGIN
+--- a/src/session.h
++++ b/src/session.h
+@@ -271,6 +271,12 @@ struct serversession {
+ 	/* The instance created by the plugin_new function */
+ 	struct PluginInstance *plugin_instance;
+ #endif
++
++#if DROPBEAR_SVR_DROP_PRIVS
++	/* Set to 1 when utmp_gid is valid */
++	int have_utmp_gid;
++	gid_t utmp_gid;
++#endif
+ };
+ 
+ typedef enum {
+--- a/src/svr-auth.c
++++ b/src/svr-auth.c
+@@ -457,13 +457,14 @@ void send_msg_userauth_success() {
+ 	 * delayed-zlib mode */
+ 	ses.authstate.authdone = 1;
+ 
+-#if DROPBEAR_DROP_PRIVS
++#if DROPBEAR_SVR_DROP_PRIVS
++	/* Drop privileges as soon as authentication has happened. */
+ 	svr_switch_user();
+ #endif
+ 	ses.connect_time = 0;
+ 
+ 
+-#if DROPBEAR_DROP_PRIVS
++#if DROPBEAR_SVR_DROP_PRIVS
+ 	/* If running as the user, we can rely on the OS
+ 	 * to limit allowed ports */
+ 	ses.allowprivport = 1;
+@@ -482,6 +483,20 @@ void send_msg_userauth_success() {
+ 
+ }
+ 
++#if DROPBEAR_SVR_DROP_PRIVS
++/* Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
++static int utmp_gid(gid_t *ret_gid) {
++	struct group *utmp_gr = getgrnam("utmp");
++	if (!utmp_gr) {
++		TRACE(("No utmp group"));
++		return DROPBEAR_FAILURE;
++	}
++
++	*ret_gid = utmp_gr->gr_gid;
++	return DROPBEAR_SUCCESS;
++}
++#endif
++
+ /* Switch to the ses.authstate user.
+  * Fails if not running as root and the user differs.
+  *
+@@ -499,6 +514,25 @@ void svr_switch_user(void) {
+ 						ses.authstate.pw_gid) < 0)) {
+ 			dropbear_exit("Error changing user group");
+ 		}
++
++#if DROPBEAR_SVR_DROP_PRIVS
++		/* Retain utmp saved group so that wtmp/utmp can be written */
++		int ret = utmp_gid(&svr_ses.utmp_gid);
++		if (ret == DROPBEAR_SUCCESS) {
++			/* Set saved gid to utmp so that it can be
++			 * restored for login_logout() etc. This saved
++			 * group is cleared by the OS on execve() */
++			int rc = setresgid(-1, -1, svr_ses.utmp_gid);
++			if (rc == 0) {
++				svr_ses.have_utmp_gid = 1;
++			} else {
++				/* Will not attempt to switch to utmp gid.
++				 * login() etc may fail. */
++				TRACE(("utmp setresgid failed"));
++			}
++		}
++#endif
++
+ 		if (setuid(ses.authstate.pw_uid) < 0) {
+ 			dropbear_exit("Error changing user");
+ 		}
+@@ -516,3 +550,26 @@ void svr_switch_user(void) {
+ 	}
+ }
+ 
++void svr_raise_gid_utmp(void) {
++#if DROPBEAR_SVR_DROP_PRIVS
++	if (!svr_ses.have_utmp_gid) {
++		return;
++	}
++
++	if (setegid(svr_ses.utmp_gid) != 0) {
++		dropbear_log(LOG_WARNING, "failed setegid");
++	}
++#endif
++}
++
++void svr_restore_gid(void) {
++#if DROPBEAR_SVR_DROP_PRIVS
++	if (!svr_ses.have_utmp_gid) {
++		return;
++	}
++
++	if (setegid(getgid()) != 0) {
++		dropbear_log(LOG_WARNING, "failed setegid");
++	}
++#endif
++}
+--- a/src/svr-chansession.c
++++ b/src/svr-chansession.c
+@@ -326,7 +326,11 @@ static void cleanupchansess(const struct
+ 	if (chansess->tty) {
+ 		/* write the utmp/wtmp login record */
+ 		li = chansess_login_alloc(chansess);
++
++		svr_raise_gid_utmp();
+ 		login_logout(li);
++		svr_restore_gid();
++
+ 		login_free_entry(li);
+ 
+ 		pty_release(chansess->tty);
+@@ -847,7 +851,11 @@ static int ptycommand(struct Channel *ch
+ 		 * terminal used for stdout with the dup2 above, otherwise
+ 		 * the wtmp login will not be recorded */
+ 		li = chansess_login_alloc(chansess);
++
++		svr_raise_gid_utmp();
+ 		login_login(li);
++		svr_restore_gid();
++
+ 		login_free_entry(li);
+ 
+ 		/* Can now dup2 stderr. Messages from login_login() have gone
+--- a/src/sysoptions.h
++++ b/src/sysoptions.h
+@@ -318,6 +318,10 @@
+ 	#error "At least one hostkey or public-key algorithm must be enabled; RSA is recommended."
+ #endif
+ 
++#if DROPBEAR_SVR_DROP_PRIVS && !defined(HAVE_SETRESGID)
++	#error "DROPBEAR_SVR_DROP_PRIVS requires setresgid()."
++#endif
++
+ /* Source for randomness. This must be able to provide hundreds of bytes per SSH
+  * connection without blocking. */
+ #ifndef DROPBEAR_URANDOM_DEV
diff --git a/package/network/services/dropbear/patches/004-Limit-rekey-to-current-hostkey-type.patch b/package/network/services/dropbear/patches/004-Limit-rekey-to-current-hostkey-type.patch
new file mode 100644
index 0000000000..f5e455595b
--- /dev/null
+++ b/package/network/services/dropbear/patches/004-Limit-rekey-to-current-hostkey-type.patch
@@ -0,0 +1,64 @@
+From ae7f99902161237542f2c71089ff68b8f694006b Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt at ucc.asn.au>
+Date: Tue, 9 Dec 2025 09:08:37 +0900
+Subject: Limit rekey to current hostkey type
+
+During rekey dropbear process may be running with user privileges, that
+can't write a new hostkey when auto-generating keys.
+Only offer the original hostkey when rekeying, also for non-autogenerate
+case.
+
+(cherry picked from commit a4043dac4e0e0237255200603672ddb0122017a4)
+---
+ src/runopts.h     |  1 +
+ src/svr-kex.c     |  8 ++++++++
+ src/svr-runopts.c | 11 +++++++++++
+ 3 files changed, 20 insertions(+)
+
+--- a/src/runopts.h
++++ b/src/runopts.h
+@@ -66,6 +66,7 @@ extern runopts opts;
+ int readhostkey(const char * filename, sign_key * hostkey,
+ 	enum signkey_type *type);
+ void load_all_hostkeys(void);
++void disable_sig_except(enum signature_type sig_type);
+ 
+ typedef struct svr_runopts {
+ 
+--- a/src/svr-kex.c
++++ b/src/svr-kex.c
+@@ -96,6 +96,14 @@ void recv_msg_kexdh_init() {
+ 	}
+ #endif
+ 
++	if (!ses.kexstate.donesecondkex) {
++		/* Disable other signature types.
++		 * During future rekeying, privileges may have been dropped
++		 * so other keys won't be loadable.
++		 * This must occur after send_msg_ext_info() which uses the hostkey list */
++		disable_sig_except(ses.newkeys->algo_signature);
++	}
++
+ 	ses.requirenext = SSH_MSG_NEWKEYS;
+ 	TRACE(("leave recv_msg_kexdh_init"))
+ }
+--- a/src/svr-runopts.c
++++ b/src/svr-runopts.c
+@@ -502,6 +502,17 @@ static void disablekey(enum signature_ty
+ 	}
+ }
+ 
++void disable_sig_except(enum signature_type allow_type) {
++	int i;
++	TRACE(("Disabling other sigs except %d", allow_type));
++	for (i = 0; sigalgs[i].name != NULL; i++) {
++		enum signature_type sig_type = sigalgs[i].val;
++		if (sig_type != allow_type) {
++			sigalgs[i].usable = 0;
++		}
++	}
++}
++
+ static void loadhostkey_helper(const char *name, void** src, void** dst, int fatal_duplicate) {
+ 	if (*dst) {
+ 		if (fatal_duplicate) {
diff --git a/package/network/services/dropbear/patches/005-Restore-seteuid-for-authorized_keys.patch b/package/network/services/dropbear/patches/005-Restore-seteuid-for-authorized_keys.patch
new file mode 100644
index 0000000000..bef5948fb0
--- /dev/null
+++ b/package/network/services/dropbear/patches/005-Restore-seteuid-for-authorized_keys.patch
@@ -0,0 +1,41 @@
+From 3e487854fcf09a5ef57a620ebe606f586a6efdc3 Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt at ucc.asn.au>
+Date: Fri, 12 Dec 2025 12:31:40 +0900
+Subject: Restore seteuid for authorized_keys
+
+Authorized_keys reading is pre-authentication so should not be
+modified in the post-auth drop-privilege change.
+
+Fixes: e0251be2354e ("Drop privileges after user authentication")
+(cherry picked from commit d193731630a62482855b450daa1d5a5e13a90125)
+---
+ src/svr-authpubkey.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/src/svr-authpubkey.c
++++ b/src/svr-authpubkey.c
+@@ -444,14 +444,12 @@ static int checkpubkey(const char* keyal
+ 	buffer * line = NULL;
+ 	unsigned int len;
+ 	int line_num;
+-#if !DROPBEAR_SVR_DROP_PRIVS
+ 	uid_t origuid;
+ 	gid_t origgid;
+-#endif
+ 
+ 	TRACE(("enter checkpubkey"))
+ 
+-#if !DROPBEAR_SVR_DROP_PRIVS
++#if DROPBEAR_SVR_MULTIUSER
+ 	/* access the file as the authenticating user. */
+ 	origuid = getuid();
+ 	origgid = getgid();
+@@ -478,7 +476,7 @@ static int checkpubkey(const char* keyal
+ 			TRACE(("checkpubkey: failed opening %s: %s", filename, strerror(errno)))
+ 		}
+ 	}
+-#if !DROPBEAR_SVR_DROP_PRIVS
++#if DROPBEAR_SVR_MULTIUSER
+ 	if ((seteuid(origuid)) < 0 ||
+ 		(setegid(origgid)) < 0) {
+ 		dropbear_exit("Failed to revert euid");
diff --git a/package/network/services/dropbear/patches/006-scp-CVE-2019-6111-fix.patch b/package/network/services/dropbear/patches/006-scp-CVE-2019-6111-fix.patch
new file mode 100644
index 0000000000..5cbcbd96ba
--- /dev/null
+++ b/package/network/services/dropbear/patches/006-scp-CVE-2019-6111-fix.patch
@@ -0,0 +1,153 @@
+From 5938a084b0aad887c0f7fa62bf3644d029e4d47d Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt at ucc.asn.au>
+Date: Tue, 9 Dec 2025 22:59:19 +0900
+Subject: scp CVE-2019-6111 fix
+
+Cherry-pick from OpenSSH portable
+
+391ffc4b9d31 ("upstream: check in scp client that filenames sent during")
+
+upstream: check in scp client that filenames sent during
+
+remote->local directory copies satisfy the wildcard specified by the user.
+
+This checking provides some protection against a malicious server
+sending unexpected filenames, but it comes at a risk of rejecting wanted
+files due to differences between client and server wildcard expansion rules.
+
+For this reason, this also adds a new -T flag to disable the check.
+
+reported by Harry Sintonen
+fix approach suggested by markus@;
+has been in snaps for ~1wk courtesy deraadt@
+
+(cherry picked from commit 48a17cff6aa104b8e806ddb2191f83f1024060f1)
+---
+ src/scp.c | 38 +++++++++++++++++++++++++++++---------
+ 1 file changed, 29 insertions(+), 9 deletions(-)
+
+--- a/src/scp.c
++++ b/src/scp.c
+@@ -76,6 +76,8 @@
+ #include "includes.h"
+ /*RCSID("$OpenBSD: scp.c,v 1.130 2006/01/31 10:35:43 djm Exp $");*/
+ 
++#include <fnmatch.h>
++
+ #include "atomicio.h"
+ #include "compat.h"
+ #include "scpmisc.h"
+@@ -291,14 +293,14 @@ void verifydir(char *);
+ 
+ uid_t userid;
+ int errs, remin, remout;
+-int pflag, iamremote, iamrecursive, targetshouldbedirectory;
++int Tflag, pflag, iamremote, iamrecursive, targetshouldbedirectory;
+ 
+ #define	CMDNEEDS	64
+ char cmd[CMDNEEDS];		/* must hold "rcp -r -p -d\0" */
+ 
+ int response(void);
+ void rsource(char *, struct stat *);
+-void sink(int, char *[]);
++void sink(int, char *[], const char *);
+ void source(int, char *[]);
+ void tolocal(int, char *[]);
+ void toremote(char *, int, char *[]);
+@@ -325,8 +327,8 @@ main(int argc, char **argv)
+ 	args.list = NULL;
+ 	addargs(&args, "%s", ssh_program);
+ 
+-	fflag = tflag = 0;
+-	while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q1246S:o:F:")) != -1)
++	fflag = Tflag = tflag = 0;
++	while ((ch = getopt(argc, argv, "dfl:prtTvBCc:i:P:q1246S:o:F:")) != -1)
+ 		switch (ch) {
+ 		/* User-visible flags. */
+ 		case '1':
+@@ -389,9 +391,12 @@ main(int argc, char **argv)
+ 			setmode(0, O_BINARY);
+ #endif
+ 			break;
++		case 'T':
++			Tflag = 1;
++			break;
+ 		default:
+ 			usage();
+-		}
++	}
+ 	argc -= optind;
+ 	argv += optind;
+ 
+@@ -409,7 +414,7 @@ main(int argc, char **argv)
+ 	}
+ 	if (tflag) {
+ 		/* Receive data. */
+-		sink(argc, argv);
++		sink(argc, argv, NULL);
+ 		exit(errs != 0);
+ 	}
+ 	if (argc < 2)
+@@ -589,7 +594,7 @@ tolocal(int argc, char **argv)
+ 			continue;
+ 		}
+ 		xfree(bp);
+-		sink(1, argv + argc - 1);
++		sink(1, argv + argc - 1, src);
+ 		(void) close(remin);
+ 		remin = remout = -1;
+ 	}
+@@ -822,7 +827,7 @@ bwlimit(int amount)
+ }
+ 
+ void
+-sink(int argc, char **argv)
++sink(int argc, char **argv, const char *src)
+ {
+ 	static BUF buffer;
+ 	struct stat stb;
+@@ -836,6 +841,7 @@ sink(int argc, char **argv)
+ 	off_t size, statbytes;
+ 	int setimes, targisdir, wrerrno = 0;
+ 	char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];
++	char *src_copy = NULL, *restrict_pattern = NULL;
+ 	struct timeval tv[2];
+ 
+ #define	atime	tv[0]
+@@ -857,6 +863,17 @@ sink(int argc, char **argv)
+ 	(void) atomicio(vwrite, remout, "", 1);
+ 	if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode))
+ 		targisdir = 1;
++	if (src != NULL && !iamrecursive && !Tflag) {
++		/*
++		 * Prepare to try to restrict incoming filenames to match
++		 * the requested destination file glob.
++		 */
++		if ((src_copy = strdup(src)) == NULL)
++			fatal("strdup failed");
++		if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) {
++			*restrict_pattern++ = '\0';
++		}
++	}
+ 	for (first = 1;; first = 0) {
+ 		cp = buf;
+ 		if (atomicio(read, remin, cp, 1) != 1)
+@@ -939,6 +956,9 @@ sink(int argc, char **argv)
+ 			run_err("error: unexpected filename: %s", cp);
+ 			exit(1);
+ 		}
++		if (restrict_pattern != NULL &&
++		    fnmatch(restrict_pattern, cp, 0) != 0)
++			SCREWUP("filename does not match request");
+ 		if (targisdir) {
+ 			static char *namebuf = NULL;
+ 			static size_t cursize = 0;
+@@ -977,7 +997,7 @@ sink(int argc, char **argv)
+ 					goto bad;
+ 			}
+ 			vect[0] = xstrdup(np);
+-			sink(1, vect);
++			sink(1, vect, src);
+ 			if (setimes) {
+ 				setimes = 0;
+ 				if (utimes(vect[0], tv) < 0)
diff --git a/package/network/services/dropbear/patches/110-change_user.patch b/package/network/services/dropbear/patches/110-change_user.patch
index 9ef8f0cfbc..5fbcd663bc 100644
--- a/package/network/services/dropbear/patches/110-change_user.patch
+++ b/package/network/services/dropbear/patches/110-change_user.patch
@@ -1,6 +1,6 @@
---- a/src/svr-chansession.c
-+++ b/src/svr-chansession.c
-@@ -984,12 +984,12 @@ static void execchild(const void *user_d
+--- a/src/svr-auth.c
++++ b/src/svr-auth.c
+@@ -509,9 +509,9 @@ void svr_switch_user(void) {
  	/* We can only change uid/gid as root ... */
  	if (getuid() == 0) {
  
@@ -11,6 +11,11 @@
 +						ses.authstate.pw_gid) < 0))) {
  			dropbear_exit("Error changing user group");
  		}
+ 
+@@ -533,7 +533,7 @@ void svr_switch_user(void) {
+ 		}
+ #endif
+ 
 -		if (setuid(ses.authstate.pw_uid) < 0) {
 +		if ((ses.authstate.pw_uid != 0) && (setuid(ses.authstate.pw_uid) < 0)) {
  			dropbear_exit("Error changing user");



From lede-commits at lists.infradead.org  Wed Dec 17 12:25:58 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 15:25:58 -0500
Subject: [openwrt/openwrt]  linux-firmware: intel: bump BE200 wifi firmware
In-Reply-To: <176600315806.2602799.15502216747199683113@git-01.infra.openwrt.org>
References: <176600315806.2602799.15502216747199683113@git-01.infra.openwrt.org>
Message-ID: <mailman.36977.1766003162.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7bfe7788b1d587b9f92940d0d5a21f78648b6b85

commit 7bfe7788b1d587b9f92940d0d5a21f78648b6b85
Author: Janusz Dziedzic <janusz.dziedzic at gmail.com>
AuthorDate: Tue Dec 16 17:15:03 2025 +0000

    linux-firmware: intel: bump BE200 wifi firmware
    
    Latest backports require newer firmware (bump to 101).
    https://github.com/torvalds/linux/commit/8788f6b3c664c83441039a453a0ec9cd27bf4859
    
    Signed-off-by: Janusz Dziedzic <janusz.dziedzic at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21194
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/firmware/linux-firmware/intel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk
index 052e32cde4..faf8fc43d5 100644
--- a/package/firmware/linux-firmware/intel.mk
+++ b/package/firmware/linux-firmware/intel.mk
@@ -219,7 +219,7 @@ $(eval $(call BuildPackage,iwlwifi-firmware-ax411))
 Package/iwlwifi-firmware-be200 = $(call Package/firmware-default,Intel BE200 firmware)
 define Package/iwlwifi-firmware-be200/install
 	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel/iwlwifi/iwlwifi-gl-c0-fm-c0-98.ucode $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel/iwlwifi/iwlwifi-gl-c0-fm-c0-101.ucode $(1)/lib/firmware
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel/iwlwifi/iwlwifi-gl-c0-fm-c0.pnvm $(1)/lib/firmware
 endef
 $(eval $(call BuildPackage,iwlwifi-firmware-be200))



From lede-commits at lists.infradead.org  Wed Dec 17 12:26:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 15:26:38 -0500
Subject: [openwrt/openwrt]  linux-firmware: intel: bump BE200 wifi firmware
In-Reply-To: <176600319813.2606580.4384837100991614795@git-01.infra.openwrt.org>
References: <176600319813.2606580.4384837100991614795@git-01.infra.openwrt.org>
Message-ID: <mailman.36978.1766003201.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/131071cd268d48b2e7309f3c99c983b7977e77e1

commit 131071cd268d48b2e7309f3c99c983b7977e77e1
Author: Janusz Dziedzic <janusz.dziedzic at gmail.com>
AuthorDate: Tue Dec 16 17:15:03 2025 +0000

    linux-firmware: intel: bump BE200 wifi firmware
    
    Latest backports require newer firmware (bump to 101).
    https://github.com/torvalds/linux/commit/8788f6b3c664c83441039a453a0ec9cd27bf4859
    
    Signed-off-by: Janusz Dziedzic <janusz.dziedzic at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21194
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 7bfe7788b1d587b9f92940d0d5a21f78648b6b85)
---
 package/firmware/linux-firmware/intel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk
index 052e32cde4..faf8fc43d5 100644
--- a/package/firmware/linux-firmware/intel.mk
+++ b/package/firmware/linux-firmware/intel.mk
@@ -219,7 +219,7 @@ $(eval $(call BuildPackage,iwlwifi-firmware-ax411))
 Package/iwlwifi-firmware-be200 = $(call Package/firmware-default,Intel BE200 firmware)
 define Package/iwlwifi-firmware-be200/install
 	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel/iwlwifi/iwlwifi-gl-c0-fm-c0-98.ucode $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel/iwlwifi/iwlwifi-gl-c0-fm-c0-101.ucode $(1)/lib/firmware
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel/iwlwifi/iwlwifi-gl-c0-fm-c0.pnvm $(1)/lib/firmware
 endef
 $(eval $(call BuildPackage,iwlwifi-firmware-be200))



From lede-commits at lists.infradead.org  Wed Dec 17 13:07:12 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 16:07:12 -0500
Subject: [openwrt/openwrt]  vrx518_tc: fix rx_len_adj
In-Reply-To: <176600563242.2750600.17083792657253271366@git-01.infra.openwrt.org>
References: <176600563242.2750600.17083792657253271366@git-01.infra.openwrt.org>
Message-ID: <mailman.36989.1766005637.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/487178f8b003bf2e06b9f989b46f8b5c36181910

commit 487178f8b003bf2e06b9f989b46f8b5c36181910
Author: Markus Petri <devel at isjunk.org>
AuthorDate: Thu Dec 4 21:28:51 2025 +0100

    vrx518_tc: fix rx_len_adj
    
    Fix rx_len_adj to avoid leaking the ethernet FCS into the actual frame
    data in single line mode (the default)
    
    Fixes: https://github.com/openwrt/openwrt/issues/20983
    Signed-off-by: Markus Petri <devel at isjunk.org>
    Link: https://github.com/openwrt/openwrt/pull/21045
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch b/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch
new file mode 100644
index 0000000000..855da162c3
--- /dev/null
+++ b/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch
@@ -0,0 +1,14 @@
+Fixes leaking the ethernet FCS into the frame payload on the RX
+path.
+
+--- a/dcdp/ptm_tc.c
++++ b/dcdp/ptm_tc.c
+@@ -923,7 +923,7 @@ static void ptm_fw_init(struct ptm_ep_pr
+ 	rx_gitf_cfg.rx_inserted_bytes_1h = 0;
+ 	rx_gitf_cfg.rx_inserted_bytes_2l = 0;
+ 	rx_gitf_cfg.rx_inserted_bytes_2h = 0;
+-	rx_gitf_cfg.rx_len_adj		= -2;
++	rx_gitf_cfg.rx_len_adj		= is_bonding ? -2 : -6;
+ 	for (i = 0; i < 4; i++) {
+ 		dst_addr = __RX_GIF0_CFG_STATS_CFG +
+ 			(i * DW_SZ(rx_gitf_cfg));



From lede-commits at lists.infradead.org  Wed Dec 17 13:07:52 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 16:07:52 -0500
Subject: [openwrt/openwrt]  vrx518_tc: fix rx_len_adj
In-Reply-To: <176600567252.2752649.2677527747059162780@git-01.infra.openwrt.org>
References: <176600567252.2752649.2677527747059162780@git-01.infra.openwrt.org>
Message-ID: <mailman.36990.1766005677.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/da669004efe3192dd9fca51043b4f03263dfcbd8

commit da669004efe3192dd9fca51043b4f03263dfcbd8
Author: Markus Petri <devel at isjunk.org>
AuthorDate: Thu Dec 4 21:28:51 2025 +0100

    vrx518_tc: fix rx_len_adj
    
    Fix rx_len_adj to avoid leaking the ethernet FCS into the actual frame
    data in single line mode (the default)
    
    Fixes: https://github.com/openwrt/openwrt/issues/20983
    Signed-off-by: Markus Petri <devel at isjunk.org>
    Link: https://github.com/openwrt/openwrt/pull/21045
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 487178f8b003bf2e06b9f989b46f8b5c36181910)
---
 .../vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch b/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch
new file mode 100644
index 0000000000..855da162c3
--- /dev/null
+++ b/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch
@@ -0,0 +1,14 @@
+Fixes leaking the ethernet FCS into the frame payload on the RX
+path.
+
+--- a/dcdp/ptm_tc.c
++++ b/dcdp/ptm_tc.c
+@@ -923,7 +923,7 @@ static void ptm_fw_init(struct ptm_ep_pr
+ 	rx_gitf_cfg.rx_inserted_bytes_1h = 0;
+ 	rx_gitf_cfg.rx_inserted_bytes_2l = 0;
+ 	rx_gitf_cfg.rx_inserted_bytes_2h = 0;
+-	rx_gitf_cfg.rx_len_adj		= -2;
++	rx_gitf_cfg.rx_len_adj		= is_bonding ? -2 : -6;
+ 	for (i = 0; i < 4; i++) {
+ 		dst_addr = __RX_GIF0_CFG_STATS_CFG +
+ 			(i * DW_SZ(rx_gitf_cfg));



From lede-commits at lists.infradead.org  Wed Dec 17 13:09:23 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 16:09:23 -0500
Subject: [openwrt/openwrt]  vrx518_tc: fix rx_len_adj
In-Reply-To: <176600576269.2759266.10222149927926680275@git-01.infra.openwrt.org>
References: <176600576269.2759266.10222149927926680275@git-01.infra.openwrt.org>
Message-ID: <mailman.36991.1766005767.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/d9c5716d1d75e652d57b42a514b20145a24eee18

commit d9c5716d1d75e652d57b42a514b20145a24eee18
Author: Markus Petri <devel at isjunk.org>
AuthorDate: Thu Dec 4 21:28:51 2025 +0100

    vrx518_tc: fix rx_len_adj
    
    Fix rx_len_adj to avoid leaking the ethernet FCS into the actual frame
    data in single line mode (the default)
    
    Fixes: https://github.com/openwrt/openwrt/issues/20983
    Signed-off-by: Markus Petri <devel at isjunk.org>
    Link: https://github.com/openwrt/openwrt/pull/21045
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 487178f8b003bf2e06b9f989b46f8b5c36181910)
---
 .../vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch b/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch
new file mode 100644
index 0000000000..855da162c3
--- /dev/null
+++ b/package/kernel/lantiq/vrx518_tc/patches/208-dcdp-ptm_tc-fix-rx_len_adj.patch
@@ -0,0 +1,14 @@
+Fixes leaking the ethernet FCS into the frame payload on the RX
+path.
+
+--- a/dcdp/ptm_tc.c
++++ b/dcdp/ptm_tc.c
+@@ -923,7 +923,7 @@ static void ptm_fw_init(struct ptm_ep_pr
+ 	rx_gitf_cfg.rx_inserted_bytes_1h = 0;
+ 	rx_gitf_cfg.rx_inserted_bytes_2l = 0;
+ 	rx_gitf_cfg.rx_inserted_bytes_2h = 0;
+-	rx_gitf_cfg.rx_len_adj		= -2;
++	rx_gitf_cfg.rx_len_adj		= is_bonding ? -2 : -6;
+ 	for (i = 0; i < 4; i++) {
+ 		dst_addr = __RX_GIF0_CFG_STATS_CFG +
+ 			(i * DW_SZ(rx_gitf_cfg));



From lede-commits at lists.infradead.org  Wed Dec 17 13:09:22 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 16:09:22 -0500
Subject: [openwrt/openwrt]  wireless-regdb: Update to version 2025.10.07
In-Reply-To: <176600576269.2759266.10222149927926680275@git-01.infra.openwrt.org>
References: <176600576269.2759266.10222149927926680275@git-01.infra.openwrt.org>
Message-ID: <mailman.36992.1766005767.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/e382fc552a5afaa18e98b8971cf515c1e7ef5248

commit e382fc552a5afaa18e98b8971cf515c1e7ef5248
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Oct 25 22:44:22 2025 +0200

    wireless-regdb: Update to version 2025.10.07
    
    e51d568 wireless-regdb: update regulatory rules for Botswana (BW) for 2022
    5afc632 wireless-regdb: update regulatory rules for Sint Marteen (SX) for 2018
    b484a31 wireless-regdb: Update regulatory info including bandwidth for Costa Rica (CR) for 2023
    39e5e04 wireless-regdb: Permit lower 6 GHz band for Kazakhstan (KZ)
    a827d3a wireless-regdb: update regulatory database based on preceding changes
    
    Link: https://github.com/openwrt/openwrt/pull/20544
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit b4a8ba2e88681af12287eea2d18c4f7de25e280e)
---
 package/firmware/wireless-regdb/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile
index d45c95e5e3..25382eb656 100644
--- a/package/firmware/wireless-regdb/Makefile
+++ b/package/firmware/wireless-regdb/Makefile
@@ -1,14 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wireless-regdb
-PKG_VERSION:=2025.07.10
+PKG_VERSION:=2025.10.07
 PKG_RELEASE:=1
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
-PKG_HASH:=a8340bcdcd1b5db6c79149879d122b170f3bb075381718d4f429ad831a6fa28d
+PKG_HASH:=d4c872a44154604c869f5851f7d21d818d492835d370af7f58de8847973801c3
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 



From lede-commits at lists.infradead.org  Wed Dec 17 14:35:07 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 17:35:07 -0500
Subject: [openwrt/openwrt]  odhcpd: update to Git HEAD (2025-12-14)
In-Reply-To: <176601090753.3065103.5722428002710721943@git-01.infra.openwrt.org>
References: <176601090753.3065103.5722428002710721943@git-01.infra.openwrt.org>
Message-ID: <mailman.37005.1766010913.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3b58539817a99dc940cd2bb337ad61896a291aa9

commit 3b58539817a99dc940cd2bb337ad61896a291aa9
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Wed Dec 17 15:52:37 2025 +0100

    odhcpd: update to Git HEAD (2025-12-14)
    
    1450e1e2b7ff odhcpd: remove fallback DNS search domain
    5b0e5c412f6c router: remove some log spam in send_router_advert()
    eddd0f8f0d00 router: improve send_router_advert()
    35f0e05a16a0 config: add default value for dhcpv6_pd_min_len
    62113d007a6a config: allow minimum PD len up to 64
    03c1468355c0 Revert "router: optimize duplicated PIO comparison"
    6b88c314a59e statefiles: don't consider no hostname as broken
    
    https://github.com/openwrt/odhcpd/compare/cf51aeb93220...1450e1e2b7ff
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/services/odhcpd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 71bbb70616..1af2902012 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=b69961edb0de3d2d0c4a7c883fba264c88fd158328ce0e8f42c634e164679fb9
-PKG_SOURCE_DATE:=2025-12-13
-PKG_SOURCE_VERSION:=cf51aeb93220672d54d0d0f3707710bf544801e2
+PKG_MIRROR_HASH:=e0abad1ad2b835491a07350ebb883ec7d805fe2bba011b3037ecb9b98613f0a0
+PKG_SOURCE_DATE:=2025-12-14
+PKG_SOURCE_VERSION:=1450e1e2b7ff24268dd055795548ba813e55da56
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Wed Dec 17 14:35:39 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 17:35:39 -0500
Subject: [openwrt/openwrt]  odhcp6c: update to Git HEAD (2025-12-17)
In-Reply-To: <176601093942.3066723.5144523338449525516@git-01.infra.openwrt.org>
References: <176601093942.3066723.5144523338449525516@git-01.infra.openwrt.org>
Message-ID: <mailman.37006.1766010943.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/41a1874c700dc0bbf300b5a14abf3ebb90d99859

commit 41a1874c700dc0bbf300b5a14abf3ebb90d99859
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Wed Dec 17 15:09:38 2025 +0100

    odhcp6c: update to Git HEAD (2025-12-17)
    
    02e783c2f68c dhcpv6: fix NA/PD=try when NA/PD aren't provided
    0f64e66b92ba odhcp6c: fix "-S" usage
    13805fce5aa6 odhcp6c: reset res variable on INIT state
    
    https://github.com/openwrt/odhcp6c/compare/5212a1019d75...02e783c2f68c
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index e36e51d6b6..83d972071a 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
-PKG_SOURCE_DATE:=2025-12-09
-PKG_SOURCE_VERSION:=5212a1019d75db47a03c95c12e385e4625dda3d0
-PKG_MIRROR_HASH:=9c6501ea995c685e4e1b65ae74cbaecb6f787a493fdd5f8d3d095aeb0466b418
+PKG_SOURCE_DATE:=2025-12-17
+PKG_SOURCE_VERSION:=02e783c2f68c2ee16e1bed43369fa3029e32f70d
+PKG_MIRROR_HASH:=448258e0c816ac2a3935ab6bc346f6441752457027e7c8c1a669b16dd0ae9858
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Wed Dec 17 14:38:10 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 17:38:10 -0500
Subject: [openwrt/openwrt]  odhcp6c: update to 25.12 Git HEAD (2025-12-17)
In-Reply-To: <176601109014.3073286.10593362833914173171@git-01.infra.openwrt.org>
References: <176601109014.3073286.10593362833914173171@git-01.infra.openwrt.org>
Message-ID: <mailman.37007.1766011094.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/68e2095a8b1809c4ce5d45b1d88f4222b9da8bd5

commit 68e2095a8b1809c4ce5d45b1d88f4222b9da8bd5
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Wed Dec 17 15:28:40 2025 +0100

    odhcp6c: update to 25.12 Git HEAD (2025-12-17)
    
    2582843959a7 dhcpv6: fix NA/PD=try when NA/PD aren't provided
    db6bec98ead1 odhcp6c: fix "-S" usage
    b9ab6b6abc64 odhcp6c: reset res variable on INIT state
    
    https://github.com/openwrt/odhcp6c/compare/5212a1019d75...2582843959a7
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index e36e51d6b6..78f3d5ceb6 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
-PKG_SOURCE_DATE:=2025-12-09
-PKG_SOURCE_VERSION:=5212a1019d75db47a03c95c12e385e4625dda3d0
-PKG_MIRROR_HASH:=9c6501ea995c685e4e1b65ae74cbaecb6f787a493fdd5f8d3d095aeb0466b418
+PKG_SOURCE_DATE:=2025-12-17
+PKG_SOURCE_VERSION:=2582843959a7fdfd962a3f005cbd09475ed186bb
+PKG_MIRROR_HASH:=fca98c3d3d02a5e97b99eb3ccb75671afd8774c8193d22ee1318587b6d9ee138
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Wed Dec 17 14:54:04 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 17 Dec 2025 17:54:04 -0500
Subject: [openwrt/openwrt]  odhcpd: update to 25.12 Git HEAD (2025-12-14)
In-Reply-To: <176601204496.3115710.11591342944726159563@git-01.infra.openwrt.org>
References: <176601204496.3115710.11591342944726159563@git-01.infra.openwrt.org>
Message-ID: <mailman.37008.1766012052.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/f1984e2e5a6e3652ad635ecab3016f2f6868a5b3

commit f1984e2e5a6e3652ad635ecab3016f2f6868a5b3
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Wed Dec 17 15:47:16 2025 +0100

    odhcpd: update to 25.12 Git HEAD (2025-12-14)
    
    cb1b8770b782 config: add default value for dhcpv6_pd_min_len
    20eb94d02dfe config: allow minimum PD len up to 64
    7ebd96083971 Revert "router: optimize duplicated PIO comparison"
    90ae6fc6e478 statefiles: don't consider no hostname as broken
    
    https://github.com/openwrt/odhcpd/compare/1ff1328a4fc1...cb1b8770b782
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/services/odhcpd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index b97ee8c09e..0202cb8b22 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=0a9cc90d242e98bbb93c8cf3274ace9ba005028f2cdb1ad0b4ddfbf66e4b1f27
-PKG_SOURCE_DATE:=2025-12-13
-PKG_SOURCE_VERSION:=1ff1328a4fc1baca2e0040fe84ca4664dbca69d7
+PKG_MIRROR_HASH:=3acdeb092de361da90b4cc3ddfb77d2f2091cdbe482a2675fc82564303e41208
+PKG_SOURCE_DATE:=2025-12-14
+PKG_SOURCE_VERSION:=cb1b8770b7827d888e1c49b52ca219db0d7f0fd8
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Thu Dec 18 09:58:49 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 18 Dec 2025 12:58:49 -0500
Subject: [openwrt/openwrt]  odhcp6c: update to 25.12 Git HEAD (2025-12-18)
In-Reply-To: <176608072916.3033876.1418367447140495653@git-01.infra.openwrt.org>
References: <176608072916.3033876.1418367447140495653@git-01.infra.openwrt.org>
Message-ID: <mailman.37405.1766080733.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/988902fa9ad3687c1fee14e3e4a6c7b2b3732b53

commit 988902fa9ad3687c1fee14e3e4a6c7b2b3732b53
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Dec 18 18:56:35 2025 +0100

    odhcp6c: update to 25.12 Git HEAD (2025-12-18)
    
    5ab3203875ad dhcpv6: use stable IAID for IA_NA
    29922b7fb497 odhcp6c: avoid clearing CLIENT_ID
    
    https://github.com/openwrt/odhcp6c/compare/2582843959a7...5ab3203875ad
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 78f3d5ceb6..952831e47a 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
-PKG_SOURCE_DATE:=2025-12-17
-PKG_SOURCE_VERSION:=2582843959a7fdfd962a3f005cbd09475ed186bb
-PKG_MIRROR_HASH:=fca98c3d3d02a5e97b99eb3ccb75671afd8774c8193d22ee1318587b6d9ee138
+PKG_SOURCE_DATE:=2025-12-18
+PKG_SOURCE_VERSION:=5ab3203875ad938ea85f6d0ceebdff113c355656
+PKG_MIRROR_HASH:=4de69fe364be2d302329cdc86d4d93820e73c82f00d788a536cf947076a4ded3
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Thu Dec 18 10:20:11 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 18 Dec 2025 13:20:11 -0500
Subject: [openwrt/openwrt]  bcm53xx: add support for ASUS RT-AC3200 and ASUS
 RT-AC5300
In-Reply-To: <176608201125.3099597.10386429533729582573@git-01.infra.openwrt.org>
References: <176608201125.3099597.10386429533729582573@git-01.infra.openwrt.org>
Message-ID: <mailman.37414.1766082015.2093109.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4284d56568d575435b63d8f711cf25ac627a7dcb

commit 4284d56568d575435b63d8f711cf25ac627a7dcb
Author: Chester A. Unal <chester.a.unal at arinc9.com>
AuthorDate: Sun Apr 7 12:24:57 2024 +0200

    bcm53xx: add support for ASUS RT-AC3200 and ASUS RT-AC5300
    
    ASUS RT-AC3200 and ASUS RT-AC5300 are AC3200 and AC5300 routers,
    respectively, featuring 5 Ethernet ports over the integrated Broadcom
    switch.
    
    ASUS RT-AC3200 hardware info:
    * Processor: Broadcom BCM4709A0 dual-core @ 1.0 GHz
    * Switch: BCM53012 in BCM4709A0
    * DDR3 RAM: 256 MB
    * Flash: 128 MB
    * 2.4GHz: BCM43602 3x3 single chip 802.11b/g/n SoC
    * 5GHz: BCM43602 3x3 two chips 802.11a/n/ac SoC
    * Ports: 4 LAN Ports, 1 WAN Port
    
    ASUS RT-AC5300 hardware info:
    * Processor: Broadcom BCM4709C0 dual-core @ 1.4 GHz
    * Switch: BCM53012 in BCM4709C0
    * DDR3 RAM: 512 MB
    * Flash: 128 MB
    * 2.4GHz: BCM4366 4x4 single chip 802.11b/g/n SoC
    * 5GHz: BCM4366 4x4 two chips 802.11a/n/ac SoC
    * Ports: 4 LAN Ports, 1 WAN Port
    
    Flashing instructions:
    * Boot to CFE Recovery Mode by holding the reset button while power-on.
    * Connect to the router with an ethernet cable.
    * Set IPv4 address of the computer to 192.168.1.2 subnet 255.255.255.0.
    * Head to http://192.168.1.1.
    * Reset NVRAM.
    * Upload the OpenWrt image.
    
    CFE bootloader may reject flashing the image due to image integrity check.
    In that case, follow the instructions below.
    
    * Rename the OpenWrt image as firmware.trx.
    * Run a TFTP server and make it serve the firmware.trx file.
    * Run the URL below on a browser or curl.
      http://192.168.1.1/do.htm?cmd=flash+-noheader+192.168.1.2:firmware.trx+flash0.trx
    
    Signed-off-by: Chester A. Unal <chester.a.unal at arinc9.com>
---
 target/linux/bcm53xx/image/Makefile | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index 17ccdeb275..a348883024 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -176,6 +176,22 @@ define Device/asus_rt-ac3100
 endef
 TARGET_DEVICES += asus_rt-ac3100
 
+define Device/asus_rt-ac3200
+  $(call Device/asus)
+  DEVICE_MODEL := RT-AC3200
+  DEVICE_PACKAGES := $(BRCMFMAC_43602A1) $(USB3_PACKAGES)
+  ASUS_PRODUCTID := RT-AC3200
+endef
+TARGET_DEVICES += asus_rt-ac3200
+
+define Device/asus_rt-ac5300
+  $(call Device/asus)
+  DEVICE_MODEL := RT-AC5300
+  DEVICE_PACKAGES := $(BRCMFMAC_4366C0) $(USB3_PACKAGES)
+  ASUS_PRODUCTID := RT-AC5300
+endef
+TARGET_DEVICES += asus_rt-ac5300
+
 define Device/asus_rt-ac56u
   $(call Device/asus)
   DEVICE_MODEL := RT-AC56U



From lede-commits at lists.infradead.org  Thu Dec 18 10:20:12 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 18 Dec 2025 13:20:12 -0500
Subject: [openwrt/openwrt]  packages: nvram: add asus,rt-ac{3200,5300} to
 set_wireless_led_behaviour
In-Reply-To: <176608201125.3099597.10386429533729582573@git-01.infra.openwrt.org>
References: <176608201125.3099597.10386429533729582573@git-01.infra.openwrt.org>
Message-ID: <mailman.37417.1766082016.2093109.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/64b6293eb7b0b7dc7b9778e5d1fc16074dea2afc

commit 64b6293eb7b0b7dc7b9778e5d1fc16074dea2afc
Author: Chester A. Unal <chester.a.unal at arinc9.com>
AuthorDate: Mon Apr 8 11:36:58 2024 +0300

    packages: nvram: add asus,rt-ac{3200,5300} to set_wireless_led_behaviour
    
    Add ASUS RT-AC3200 and ASUS RT-AC5300 to the set wireless LED behaviour
    quirk. ASUS RT-AC3200's wireless chip is different than ASUS RT-AC5300's,
    the environment variables for it are 0:ledbh10 and 1:ledbh10.
    
    Signed-off-by: Chester A. Unal <chester.a.unal at arinc9.com>
---
 package/utils/nvram/Makefile                 |  2 +-
 package/utils/nvram/files/nvram-bcm53xx.init | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/package/utils/nvram/Makefile b/package/utils/nvram/Makefile
index 8547bfa2d6..ef65ae0cc2 100644
--- a/package/utils/nvram/Makefile
+++ b/package/utils/nvram/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nvram
-PKG_RELEASE:=12
+PKG_RELEASE:=13
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/package/utils/nvram/files/nvram-bcm53xx.init b/package/utils/nvram/files/nvram-bcm53xx.init
index f47c944897..d17d301c45 100755
--- a/package/utils/nvram/files/nvram-bcm53xx.init
+++ b/package/utils/nvram/files/nvram-bcm53xx.init
@@ -19,16 +19,23 @@ clear_partialboots() {
 
 set_wireless_led_behaviour() {
 	# set Broadcom wireless LED behaviour for both radios
-	# 0:ledbh9 -> Behaviour of 2.4GHz LED
-	# 1:ledbh9 -> Behaviour of 5GHz LED
+	# 0:ledbh9 -> Behaviour of 2.4GHz LED of Broadcom BCM4366
+	# 1:ledbh9 -> Behaviour of 5GHz LED of Broadcom BCM4366
+	# 0:ledbh10 -> Behaviour of 2.4GHz LED of Broadcom BCM43602
+	# 1:ledbh10 -> Behaviour of 5GHz LED of Broadcom BCM43602
 	# 0x7 makes the wireless LEDs on, when radios are enabled, and blink when there's activity
 
 	case $(board_name) in
 		asus,rt-ac3100|\
+		asus,rt-ac5300|\
 		asus,rt-ac88u)
 			COMMIT=1
 			nvram set 0:ledbh9=0x7 set 1:ledbh9=0x7
 			;;
+		asus,rt-ac3200)
+			COMMIT=1
+			nvram set 0:ledbh10=0x7 set 1:ledbh10=0x7
+			;;
 	esac
 }
 



From lede-commits at lists.infradead.org  Thu Dec 18 10:20:13 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 18 Dec 2025 13:20:13 -0500
Subject: [openwrt/openwrt]  packages: nvram: add set_bcm43602_variables quirk
 for ASUS RT-AC3200
In-Reply-To: <176608201125.3099597.10386429533729582573@git-01.infra.openwrt.org>
References: <176608201125.3099597.10386429533729582573@git-01.infra.openwrt.org>
Message-ID: <mailman.37418.1766082016.2093109.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cd2ad6c464690440adefb519a1b101865afba5ee

commit cd2ad6c464690440adefb519a1b101865afba5ee
Author: Chester A. Unal <chester.a.unal at arinc9.com>
AuthorDate: Thu Sep 11 10:45:32 2025 +0100

    packages: nvram: add set_bcm43602_variables quirk for ASUS RT-AC3200
    
    Broadcom BCM43602 needs certain NVRAM variables to be set to function. Add
    a quirk for it and add ASUS RT-AC3200 which has got Broadcom BCM43602 to
    the quirk. Thanks to Tom Brautaset for finding the needed variables.
    
    Signed-off-by: Chester A. Unal <chester.a.unal at arinc9.com>
---
 package/utils/nvram/Makefile                 |  2 +-
 package/utils/nvram/files/nvram-bcm53xx.init | 33 ++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/package/utils/nvram/Makefile b/package/utils/nvram/Makefile
index ef65ae0cc2..5430c97dc1 100644
--- a/package/utils/nvram/Makefile
+++ b/package/utils/nvram/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nvram
-PKG_RELEASE:=13
+PKG_RELEASE:=14
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/package/utils/nvram/files/nvram-bcm53xx.init b/package/utils/nvram/files/nvram-bcm53xx.init
index d17d301c45..c97c493557 100755
--- a/package/utils/nvram/files/nvram-bcm53xx.init
+++ b/package/utils/nvram/files/nvram-bcm53xx.init
@@ -39,11 +39,44 @@ set_wireless_led_behaviour() {
 	esac
 }
 
+set_bcm43602_variables() {
+	# set variables needed for Broadcom BCM43602
+
+	case $(board_name) in
+		asus,rt-ac3200)
+			COMMIT=1
+
+			# radio 0 (5 GHz)
+			nvram set devpath0=pcie/1/3
+			nvram set 0:devpath0=sb/1/
+			nvram set 0:devid=0x43bc
+			nvram set 0:sromrev=11
+			nvram set 0:boardflags=0x30040000
+
+			# radio 1 (2.4 GHz)
+			nvram set devpath1=pcie/1/4
+			nvram set 1:devpath1=sb/1/
+			nvram set 1:devid=0x43bb
+			nvram set 1:boardrev=0x1421
+			nvram set 1:sromrev=11
+			nvram set 1:boardflags=0x20001000
+
+			# radio 2 (5 GHz)
+			nvram set devpath2=pcie/2/1
+			nvram set 2:devpath2=sb/1/
+			nvram set 2:devid=0x43bc
+			nvram set 2:sromrev=11
+			nvram set 2:boardflags=0x30040000
+			;;
+	esac
+}
+
 boot() {
 	. /lib/functions.sh
 
 	clear_partialboots
 	set_wireless_led_behaviour
+	set_bcm43602_variables
 
 	[ "$COMMIT" = "1" ] && nvram commit
 }



From lede-commits at lists.infradead.org  Thu Dec 18 12:23:10 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 18 Dec 2025 15:23:10 -0500
Subject: [openwrt/openwrt]  odhcp6c: update to Git HEAD (2025-12-18)
In-Reply-To: <176608939073.3517078.4113278198447195124@git-01.infra.openwrt.org>
References: <176608939073.3517078.4113278198447195124@git-01.infra.openwrt.org>
Message-ID: <mailman.37482.1766089422.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/740f5dc175d7a2745ca7f50f2d25aa5e3380c60f

commit 740f5dc175d7a2745ca7f50f2d25aa5e3380c60f
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Dec 18 18:52:47 2025 +0100

    odhcp6c: update to Git HEAD (2025-12-18)
    
    9a4d6fe802d2 dhcpv6: use stable IAID for IA_NA
    d99528f7a91a odhcp6c: avoid clearing CLIENT_ID
    
    https://github.com/openwrt/odhcp6c/compare/02e783c2f68c...9a4d6fe802d2
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 83d972071a..ecc6ff11cc 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
-PKG_SOURCE_DATE:=2025-12-17
-PKG_SOURCE_VERSION:=02e783c2f68c2ee16e1bed43369fa3029e32f70d
-PKG_MIRROR_HASH:=448258e0c816ac2a3935ab6bc346f6441752457027e7c8c1a669b16dd0ae9858
+PKG_SOURCE_DATE:=2025-12-18
+PKG_SOURCE_VERSION:=9a4d6fe802d21e4fc1b84f7d55b5c3c23e71d6ba
+PKG_MIRROR_HASH:=0be95faccad6b4c9107fc7819526f11b59eedc09454c8dcb0435450ff3afbf77
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Thu Dec 18 12:24:30 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 18 Dec 2025 15:24:30 -0500
Subject: [openwrt/openwrt]  odhcpd: update to Git HEAD (2025-12-18)
In-Reply-To: <176608947084.3523506.16860679865152522578@git-01.infra.openwrt.org>
References: <176608947084.3523506.16860679865152522578@git-01.infra.openwrt.org>
Message-ID: <mailman.37483.1766089474.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/caef0a839a80749b7a125f09cb26814980fb7202

commit caef0a839a80749b7a125f09cb26814980fb7202
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Dec 18 18:30:56 2025 +0100

    odhcpd: update to Git HEAD (2025-12-18)
    
    3fda5f8b121b dhcpv6-ia: reconfigure message length bug fix
    6152cf5dab49 all: remove dead code
    
    https://github.com/openwrt/odhcpd/compare/1450e1e2b7ff...3fda5f8b121b
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/services/odhcpd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 1af2902012..1a165c8c9d 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=e0abad1ad2b835491a07350ebb883ec7d805fe2bba011b3037ecb9b98613f0a0
-PKG_SOURCE_DATE:=2025-12-14
-PKG_SOURCE_VERSION:=1450e1e2b7ff24268dd055795548ba813e55da56
+PKG_MIRROR_HASH:=059c93e48b74880882d80c590d1aa221c849c54814379396c634e5b1c2ccfac4
+PKG_SOURCE_DATE:=2025-12-18
+PKG_SOURCE_VERSION:=3fda5f8b121bf58f8ef8e797fe6bfd7f4f340653
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Thu Dec 18 12:26:30 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 18 Dec 2025 15:26:30 -0500
Subject: [openwrt/openwrt]  odhcpd: update to 25.12 Git HEAD (2025-12-18)
In-Reply-To: <176608959054.3533240.6526480384221422671@git-01.infra.openwrt.org>
References: <176608959054.3533240.6526480384221422671@git-01.infra.openwrt.org>
Message-ID: <mailman.37484.1766089594.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/9e9b05130c2c67dc7dc0765208e1d84b73e03ee4

commit 9e9b05130c2c67dc7dc0765208e1d84b73e03ee4
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Dec 18 18:34:27 2025 +0100

    odhcpd: update to 25.12 Git HEAD (2025-12-18)
    
    0779ee287db5 dhcpv6-ia: reconfigure message length bug fix
    d69896b0ac7c all: remove dead code
    3f6b3b4b9f8a odhcpd: remove fallback DNS search domain
    ff3f72fdd01d router: remove some log spam in send_router_advert()
    c1cc541e1065 router: improve send_router_advert()
    901851b883da router: Modify relayed RA PIO P flag according to interface policy
    179429ba477d router: Modify relayed RA PIO A flags according to interface policy
    
    https://github.com/openwrt/odhcpd/compare/cb1b8770b782...0779ee287db5
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/services/odhcpd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 0202cb8b22..58cec3bf48 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=3acdeb092de361da90b4cc3ddfb77d2f2091cdbe482a2675fc82564303e41208
-PKG_SOURCE_DATE:=2025-12-14
-PKG_SOURCE_VERSION:=cb1b8770b7827d888e1c49b52ca219db0d7f0fd8
+PKG_MIRROR_HASH:=e91eb780beb2f6e501ed35fd03d7b529400d72eba766f16f901103e44b1b6a35
+PKG_SOURCE_DATE:=2025-12-18
+PKG_SOURCE_VERSION:=0779ee287db5ddb209ae057295a8db0e0a3da4fb
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Thu Dec 18 12:44:33 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 18 Dec 2025 15:44:33 -0500
Subject: [openwrt/openwrt]  OpenWrt v24.10.5: adjust config defaults
In-Reply-To: <176609067357.3612483.10303703891498091437@git-01.infra.openwrt.org>
References: <176609067357.3612483.10303703891498091437@git-01.infra.openwrt.org>
Message-ID: <mailman.37495.1766090678.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/4f7e6e554be2aef6a55be36f9f954d56705eb2ee

commit 4f7e6e554be2aef6a55be36f9f954d56705eb2ee
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Thu Dec 18 21:39:34 2025 +0100

    OpenWrt v24.10.5: adjust config defaults
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 feeds.conf.default                 | 8 ++++----
 include/version.mk                 | 6 +++---
 package/base-files/image-config.in | 4 ++--
 version                            | 1 +
 version.date                       | 1 +
 5 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index 581de056c4..6ecfb632aa 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,4 +1,4 @@
-src-git packages https://git.openwrt.org/feed/packages.git;openwrt-24.10
-src-git luci https://git.openwrt.org/project/luci.git;openwrt-24.10
-src-git routing https://git.openwrt.org/feed/routing.git;openwrt-24.10
-src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-24.10
+src-git packages https://git.openwrt.org/feed/packages.git^953b6d47b4e9f0ad3c39547c6d3f9a828f10e206
+src-git luci https://git.openwrt.org/project/luci.git^d88390be4ec9722cb427fee03368fc8c8582627d
+src-git routing https://git.openwrt.org/feed/routing.git^178a40d321d6c11f18528f34777f4e24ce62b19a
+src-git telephony https://git.openwrt.org/feed/telephony.git^92892fa285360b8981f62bf4e0a097e6449e7e33
diff --git a/include/version.mk b/include/version.mk
index a6ebe58779..90cfa76bce 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10-SNAPSHOT)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.5)
 
 VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r29087-d9c5716d1d)
 
 VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10-SNAPSHOT)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.5)
 
 VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index 80db993d46..cff98b426c 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -190,7 +190,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "https://downloads.openwrt.org/releases/24.10-SNAPSHOT"
+		default "https://downloads.openwrt.org/releases/24.10.5"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -266,7 +266,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default y
+		default n
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
new file mode 100644
index 0000000000..4c09a7d50c
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+r29087-d9c5716d1d
diff --git a/version.date b/version.date
new file mode 100644
index 0000000000..6b018de5d1
--- /dev/null
+++ b/version.date
@@ -0,0 +1 @@
+1766005702



From lede-commits at lists.infradead.org  Thu Dec 18 12:44:34 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 18 Dec 2025 15:44:34 -0500
Subject: [openwrt/openwrt]  OpenWrt v24.10.5: revert to branch defaults
In-Reply-To: <176609067357.3612483.10303703891498091437@git-01.infra.openwrt.org>
References: <176609067357.3612483.10303703891498091437@git-01.infra.openwrt.org>
Message-ID: <mailman.37496.1766090678.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/4919ffd4f715fb31efd3e5aa28571e873200d03a

commit 4919ffd4f715fb31efd3e5aa28571e873200d03a
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Thu Dec 18 21:39:37 2025 +0100

    OpenWrt v24.10.5: revert to branch defaults
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 feeds.conf.default                 | 8 ++++----
 include/version.mk                 | 6 +++---
 package/base-files/image-config.in | 4 ++--
 version                            | 1 -
 version.date                       | 1 -
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index 6ecfb632aa..581de056c4 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,4 +1,4 @@
-src-git packages https://git.openwrt.org/feed/packages.git^953b6d47b4e9f0ad3c39547c6d3f9a828f10e206
-src-git luci https://git.openwrt.org/project/luci.git^d88390be4ec9722cb427fee03368fc8c8582627d
-src-git routing https://git.openwrt.org/feed/routing.git^178a40d321d6c11f18528f34777f4e24ce62b19a
-src-git telephony https://git.openwrt.org/feed/telephony.git^92892fa285360b8981f62bf4e0a097e6449e7e33
+src-git packages https://git.openwrt.org/feed/packages.git;openwrt-24.10
+src-git luci https://git.openwrt.org/project/luci.git;openwrt-24.10
+src-git routing https://git.openwrt.org/feed/routing.git;openwrt-24.10
+src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-24.10
diff --git a/include/version.mk b/include/version.mk
index 90cfa76bce..a6ebe58779 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.5)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10-SNAPSHOT)
 
 VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r29087-d9c5716d1d)
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
 
 VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.5)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10-SNAPSHOT)
 
 VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index cff98b426c..80db993d46 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -190,7 +190,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "https://downloads.openwrt.org/releases/24.10.5"
+		default "https://downloads.openwrt.org/releases/24.10-SNAPSHOT"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -266,7 +266,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default n
+		default y
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
deleted file mode 100644
index 4c09a7d50c..0000000000
--- a/version
+++ /dev/null
@@ -1 +0,0 @@
-r29087-d9c5716d1d
diff --git a/version.date b/version.date
deleted file mode 100644
index 6b018de5d1..0000000000
--- a/version.date
+++ /dev/null
@@ -1 +0,0 @@
-1766005702



From lede-commits at lists.infradead.org  Fri Dec 19 15:31:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 19 Dec 2025 18:31:43 -0500
Subject: [openwrt/openwrt]  OpenWrt v25.12.0-rc1: revert to branch defaults
In-Reply-To: <176618710232.711323.13198089679437199873@git-01.infra.openwrt.org>
References: <176618710232.711323.13198089679437199873@git-01.infra.openwrt.org>
Message-ID: <mailman.38015.1766187108.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/02f9e71dd2261d178f74ac93bff9d6eba216096c

commit 02f9e71dd2261d178f74ac93bff9d6eba216096c
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Dec 20 00:20:16 2025 +0100

    OpenWrt v25.12.0-rc1: revert to branch defaults
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 feeds.conf.default                 | 10 +++++-----
 include/version.mk                 |  6 +++---
 package/base-files/image-config.in |  4 ++--
 version                            |  1 -
 version.date                       |  1 -
 5 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index 012766079a..c28e51d2b2 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,5 +1,5 @@
-src-git packages https://git.openwrt.org/feed/packages.git^15884df50a89f522279451d04925f2d4467d16df
-src-git luci https://git.openwrt.org/project/luci.git^946f77ac26de60b4f5209d4d33cf2bc0ef08f878
-src-git routing https://git.openwrt.org/feed/routing.git^b43e4ac560ccbafba21dc3ab0dbe57afc07e7b88
-src-git telephony https://git.openwrt.org/feed/telephony.git^40dcae69ef7f68352203ba0dd5b4f05c5d833d15
-src-git video https://github.com/openwrt/video.git^094bf58da6682f895255a35a84349a79dab4bf95
+src-git packages https://git.openwrt.org/feed/packages.git;openwrt-25.12
+src-git luci https://git.openwrt.org/project/luci.git;openwrt-25.12
+src-git routing https://git.openwrt.org/feed/routing.git;openwrt-25.12
+src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-25.12
+src-git video https://github.com/openwrt/video.git;openwrt-25.12
diff --git a/include/version.mk b/include/version.mk
index e08f48f2d1..0f0d8b0312 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -27,13 +27,13 @@ PKG_CONFIG_DEPENDS += \
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),25.12.0-rc1)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),25.12-SNAPSHOT)
 
 VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r32353-9e9b05130c)
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
 
 VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/25.12.0-rc1)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/25.12-SNAPSHOT)
 
 VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index 73560fbc97..5c3e157846 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -198,7 +198,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "https://downloads.openwrt.org/releases/25.12.0-rc1"
+		default "https://downloads.openwrt.org/releases/25.12-SNAPSHOT"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -280,7 +280,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default n
+		default y
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
deleted file mode 100644
index 66b1da7559..0000000000
--- a/version
+++ /dev/null
@@ -1 +0,0 @@
-r32353-9e9b05130c
diff --git a/version.date b/version.date
deleted file mode 100644
index a59997d4fc..0000000000
--- a/version.date
+++ /dev/null
@@ -1 +0,0 @@
-1766089549



From lede-commits at lists.infradead.org  Fri Dec 19 15:31:42 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 19 Dec 2025 18:31:42 -0500
Subject: [openwrt/openwrt]  OpenWrt v25.12.0-rc1: adjust config defaults
In-Reply-To: <176618710232.711323.13198089679437199873@git-01.infra.openwrt.org>
References: <176618710232.711323.13198089679437199873@git-01.infra.openwrt.org>
Message-ID: <mailman.38016.1766187108.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/b1a74b1cde0dd9b4c07bb5ba7020f94967912f2d

commit b1a74b1cde0dd9b4c07bb5ba7020f94967912f2d
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Dec 20 00:20:13 2025 +0100

    OpenWrt v25.12.0-rc1: adjust config defaults
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 feeds.conf.default                 | 10 +++++-----
 include/version.mk                 |  6 +++---
 package/base-files/image-config.in |  4 ++--
 version                            |  1 +
 version.date                       |  1 +
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index c28e51d2b2..012766079a 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,5 +1,5 @@
-src-git packages https://git.openwrt.org/feed/packages.git;openwrt-25.12
-src-git luci https://git.openwrt.org/project/luci.git;openwrt-25.12
-src-git routing https://git.openwrt.org/feed/routing.git;openwrt-25.12
-src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-25.12
-src-git video https://github.com/openwrt/video.git;openwrt-25.12
+src-git packages https://git.openwrt.org/feed/packages.git^15884df50a89f522279451d04925f2d4467d16df
+src-git luci https://git.openwrt.org/project/luci.git^946f77ac26de60b4f5209d4d33cf2bc0ef08f878
+src-git routing https://git.openwrt.org/feed/routing.git^b43e4ac560ccbafba21dc3ab0dbe57afc07e7b88
+src-git telephony https://git.openwrt.org/feed/telephony.git^40dcae69ef7f68352203ba0dd5b4f05c5d833d15
+src-git video https://github.com/openwrt/video.git^094bf58da6682f895255a35a84349a79dab4bf95
diff --git a/include/version.mk b/include/version.mk
index 0f0d8b0312..e08f48f2d1 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -27,13 +27,13 @@ PKG_CONFIG_DEPENDS += \
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),25.12-SNAPSHOT)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),25.12.0-rc1)
 
 VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r32353-9e9b05130c)
 
 VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/25.12-SNAPSHOT)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/25.12.0-rc1)
 
 VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index 5c3e157846..73560fbc97 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -198,7 +198,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "https://downloads.openwrt.org/releases/25.12-SNAPSHOT"
+		default "https://downloads.openwrt.org/releases/25.12.0-rc1"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -280,7 +280,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default y
+		default n
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
new file mode 100644
index 0000000000..66b1da7559
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+r32353-9e9b05130c
diff --git a/version.date b/version.date
new file mode 100644
index 0000000000..a59997d4fc
--- /dev/null
+++ b/version.date
@@ -0,0 +1 @@
+1766089549



From lede-commits at lists.infradead.org  Sat Dec 20 02:06:50 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 20 Dec 2025 05:06:50 -0500
Subject: [openwrt/openwrt]  build: avoid errors during release candidate
 kernel packaging
In-Reply-To: <176622521038.2813947.2841810808166951116@git-01.infra.openwrt.org>
References: <176622521038.2813947.2841810808166951116@git-01.infra.openwrt.org>
Message-ID: <mailman.38057.1766225215.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d34cef823e103240516f01a54a3f01a09d9f36ed

commit d34cef823e103240516f01a54a3f01a09d9f36ed
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Fri Dec 19 07:34:54 2025 +0100

    build: avoid errors during release candidate kernel packaging
    
    The build system allows to use Linux release candidate kernels (-rcX).
    For this a target/linux/generic/kernel-6.XY as follows is needed:
    
    LINUX_VERSION-6.XY = -rc1
    LINUX_KERNEL_HASH-6.XY-rc1 = 18ba6ebd72f46b881e0d73e390b2888b7b43...
    
    Sadly the builds fail with a packaging error.
    
    fakeroot /home/openwrt/openwrt/openwrt/staging_dir/host/bin/apk
    mkpkg --info "name:kernel" --info "version:6.15-rc1~c4bf...1f6-r1"
    ERROR: info field 'version' has invalid value: package version is invalid
    
    The apk metadata specification reads:
    
    "... Currently the APK version specification is as follows:
    number{.number}...{letter}{_suffix{number}}...{~hash}{-r#} ...
    Optionally one or more _suffix{number} components can follow.
    The list of valid suffixes (and their sorting order) is: alpha,
    beta, pre, rc, <no suffix>, cvs, svn, git, hg, p."
    
    Given that the kernel uses "-rcX" naming scheme and apk requires
    "_rcX" instead, simply translate the dash to an underscore for
    these builds.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21214
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 include/kernel.mk             | 4 ++--
 package/Makefile              | 2 +-
 package/kernel/linux/Makefile | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index 6ef766388a..7d09e90656 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -213,8 +213,8 @@ define KernelPackage
     SECTION:=kernel
     CATEGORY:=Kernel modules
     DESCRIPTION:=$(DESCRIPTION)
-    EXTRA_DEPENDS:=kernel (=$(LINUX_VERSION)~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE))
-    VERSION:=$(LINUX_VERSION)$(if $(PKG_VERSION),.$(PKG_VERSION))-r$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
+    EXTRA_DEPENDS:=kernel (=$(subst -rc,_rc,$(LINUX_VERSION))~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE))
+    VERSION:=$(subst -rc,_rc,$(LINUX_VERSION))$(if $(PKG_VERSION),.$(PKG_VERSION))-r$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
     PKGFLAGS:=$(PKGFLAGS)
     $(call KernelPackage/$(1))
     $(call KernelPackage/$(1)/$(BOARD))
diff --git a/package/Makefile b/package/Makefile
index 097ee17151..0fd3a5e8c8 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -105,7 +105,7 @@ ifneq ($(CONFIG_USE_APK),)
 		$$(cat $(TMP_DIR)/apk_install_list) \
 			"base-files=$(shell cat $(TMP_DIR)/base-files.version)" \
 			"libc=$(shell cat $(TMP_DIR)/libc.version)" \
-			"kernel=$(shell cat $(TMP_DIR)/kernel.version)"
+			"kernel=$(subst -rc,_rc,$(shell cat $(TMP_DIR)/kernel.version))"
 
 	rm -rf $(TARGET_DIR)/run
 else
diff --git a/package/kernel/linux/Makefile b/package/kernel/linux/Makefile
index 5ceb78d128..2f4124b704 100644
--- a/package/kernel/linux/Makefile
+++ b/package/kernel/linux/Makefile
@@ -53,7 +53,7 @@ define Package/kernel
   CATEGORY:=Kernel
   DEFAULT:=y
   TITLE:=Virtual kernel package
-  VERSION:=$(LINUX_VERSION)~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE)
+  VERSION:=$(subst -rc,_rc,$(LINUX_VERSION))~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE)
   URL:=http://www.kernel.org/
   PKG_FLAGS:=nonshared
 endef



From lede-commits at lists.infradead.org  Sat Dec 20 06:10:14 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 20 Dec 2025 09:10:14 -0500
Subject: [openwrt/openwrt]  comgt-ncm: fix setting ip[46]table and MTU
In-Reply-To: <176623981470.3615870.17887471322535351964@git-01.infra.openwrt.org>
References: <176623981470.3615870.17887471322535351964@git-01.infra.openwrt.org>
Message-ID: <mailman.38068.1766239820.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b289edd84b3849ce6819e9eb078ab2f3e32f306f

commit b289edd84b3849ce6819e9eb078ab2f3e32f306f
Author: Alexander Patrakov <patrakov at gmail.com>
AuthorDate: Sun Sep 28 03:59:41 2025 +0800

    comgt-ncm: fix setting ip[46]table and MTU
    
    The ncm proto handler ignored ip4table, ip6table, and mtu settings.
    
    The fix is based on the existing code in the mbim proto handler.
    
    Fixes: #20216.
    Signed-off-by: Alexander Patrakov <patrakov at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20217
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/utils/comgt/files/ncm.sh | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh
index a986973838..9cb5b1e662 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -22,6 +22,7 @@ proto_ncm_init_config() {
 	proto_config_add_boolean sourcefilter
 	proto_config_add_boolean delegate
 	proto_config_add_int profile
+	proto_config_add_int mtu
 	proto_config_add_defaults
 }
 
@@ -30,8 +31,8 @@ proto_ncm_setup() {
 
 	local connect context_type devname devpath finalize ifpath initialize manufacturer setmode
 
-	local delegate sourcefilter $PROTO_DEFAULT_OPTIONS
-	json_get_vars delegate sourcefilter $PROTO_DEFAULT_OPTIONS
+	local delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS
+	json_get_vars delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS
 
 	local apn auth delay device ifname mode password pdptype pincode profile username
 	json_get_vars apn auth delay device ifname mode password pdptype pincode profile username
@@ -192,9 +193,9 @@ proto_ncm_setup() {
 		json_add_string ifname "@$interface"
 		json_add_string proto "dhcp"
 		proto_add_dynamic_defaults
-		[ -n "$zone" ] && {
-			json_add_string zone "$zone"
-		}
+		[ -n "$zone" ] && json_add_string zone "$zone"
+		[ -n "$ip4table" ] && json_add_string ip4table "$ip4table"
+
 		json_close_object
 		ubus call network add_dynamic "$(json_dump)"
 	}
@@ -208,13 +209,18 @@ proto_ncm_setup() {
 		[ "$delegate" = "0" ] && json_add_boolean delegate "0"
 		[ "$sourcefilter" = "0" ] && json_add_boolean sourcefilter "0"
 		proto_add_dynamic_defaults
-		[ -n "$zone" ] && {
-			json_add_string zone "$zone"
-		}
+		[ -n "$zone" ] && json_add_string zone "$zone"
+		[ -n "$ip6table" ] && json_add_string ip6table "$ip6table"
+
 		json_close_object
 		ubus call network add_dynamic "$(json_dump)"
 	}
 
+	[ -n "$mtu" -a "$mtu" != 0 ] && {
+		echo "Setting MTU of $ifname to $mtu"
+		/sbin/ip link set dev $ifname mtu $mtu
+	}
+
 	[ -n "$finalize" ] && {
 		eval COMMAND="$finalize" gcom -d "$device" -s /etc/gcom/runcommand.gcom || {
 			echo "Failed to configure modem"



From lede-commits at lists.infradead.org  Sat Dec 20 09:00:37 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 20 Dec 2025 12:00:37 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: TP-Link Archer AX80 v1 (EU)
 support
In-Reply-To: <176625003766.53961.3510245348761640682@git-01.infra.openwrt.org>
References: <176625003766.53961.3510245348761640682@git-01.infra.openwrt.org>
Message-ID: <mailman.38097.1766250043.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6bfb30539407f2f63abca8e538c856828ca00711

commit 6bfb30539407f2f63abca8e538c856828ca00711
Author: Emre Yavuzalp <emreyavuzalp2 at gmail.com>
AuthorDate: Sun Nov 30 18:53:51 2025 +0300

    mediatek: filogic: TP-Link Archer AX80 v1 (EU) support
    
    Device specification
    
    SoC Type: MediaTek MT7986B, Cortex-A53, 64-bit 1.6GHz Quad Core
    RAM: ESMT M15T4G16256 (512MB)
    Flash: ESMT F50L1G41LB (128 MB)
    Ethernet: MediaTek MT7531AE + 2.5GbE MaxLinear GPY211C0VC (SLNW8)
    Ethernet: 1x2.5Gbe (WAN/LAN 2.5Gbps), 4xGbE (WAN/LAN 1Gbps, LAN1, LAN2, LAN3)
    WLAN 2g: MediaTek MT7975
    WLAN 5g: MediaTek MT7975
    LEDs: All White(probably)
    
    Buttons: 4 (Reset,ledswitch,wps,wlan),
    USB ports: 1 (USB 3.0)
    Power: 12 VDC, 2.0 A
    Connector: Barrel
    Bootloader: Main U-Boot - U-Boot 2022.01-rc4. Additionally, both UBI
    slots contain "seconduboot" (also U-Boot 2022.01-rc4)
    Serial console (UART)
    
                                V
    +-------+-------+-------+-------+
    | +3.3V |  GND  |  TX   |  RX   |
    +---+---+-------+-------+-------+
        |
        +--- Don't connect
    
    CPU BLOCK HERE                                                         LAN PORTS HERE
    
    Installation (UART)
    Note: There might be methods without UART possible soon.
    Place OpenWrt initramfs image on tftp server with IP 192.168.1.2
    
    Attach UART, switch on the router and interrupt the boot process by pressing 'Ctrl-C'
    
    Load and run OpenWrt initramfs image:
    
          tftpboot initramfs-kernel.bin
          bootm
    
    !!Attention!! is very important! After entering OpenWrt, please set / update the environment variables:
    
    fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit"
    fw_setenv mtdids "spi-nand0=spi-nand0"
    fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data),8M(mali_data)"
    fw_setenv tp_boot_idx 0
    
    Run 'sysupgrade -n' with the sysupgrade OpenWrt image from console or Luci WebUI.
    
    Recovery
    
    Press Reset button and power on the router
    Navigate to U-Boot recovery web server (192.168.1.1) and upload the OEM firmware
    
    Stock layout
    
    0x000000000000-0x000000200000 : "boot"
    0x000000200000-0x000000300000 : "u-boot-env"
    0x000000300000-0x000003500000 : "ubi0"
    0x000003500000-0x000006700000 : "ubi1"
    0x000006700000-0x000006f00000 : "userconfig"
    0x000006f00000-0x000007300000 : "tp_data"
    0x000007300000-0x000007B00000 : "mali_data"
    
    ubi0/ubi1 format
    U-Boot at boot checks that all volumes are in place:
    
    +-------------------------------+
    | Volume Name: uboot Vol ID: 0|
    | Volume Name: kernel Vol ID: 1|
    | Volume Name: rootfs Vol ID: 2|
    +-------------------------------+
    MAC addresses
    +---------+-------------------+-----------+
    | label | 00:eb:xx:xx:xx:be | label |
    | LAN | 00:eb:xx:xx:xx:be | label |
    | WAN | 00:eb:xx:xx:xx:bf | label+1 |
    | WLAN 2g | 00:eb:xx:xx:xx:be | label |
    | WLAN 5g | 00:eb:xx:xx:xx:bd | label-1 |
    +---------+-------------------+-----------+
    label MAC address was found in UBI partition "tp_data", file "default-mac".
    OEM wireless eeprom is also there (file "MT7986_EEPROM.bin").
    
    Signed-off-by: Emre Yavuzalp <emreyavuzalp2 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20630
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../uboot-envtools/files/mediatek_filogic          |   1 +
 .../dts/mt7986b-tplink-archer-ax80-v1-eu.dts       | 333 +++++++++++++++++++++
 .../filogic/base-files/etc/board.d/01_leds         |   3 +
 .../filogic/base-files/etc/board.d/02_network      |   4 +-
 .../etc/hotplug.d/firmware/11-mt76-caldata         |   1 +
 .../etc/hotplug.d/ieee80211/11_fix_wifi_mac        |   1 +
 .../base-files/lib/preinit/09_mount_cfg_part       |   1 +
 .../base-files/lib/preinit/10_fix_eth_mac.sh       |   1 +
 .../filogic/base-files/lib/upgrade/platform.sh     |   1 +
 target/linux/mediatek/image/filogic.mk             |  18 +-
 10 files changed, 362 insertions(+), 2 deletions(-)

diff --git a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
index 379609c1af..2dfa68c697 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
+++ b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
@@ -134,6 +134,7 @@ teltonika,rutc50)
 	ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
 	;;
 tplink,archer-ax80-v1|\
+tplink,archer-ax80-v1-eu|\
 tplink,be450)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "8"
 	;;
diff --git a/target/linux/mediatek/dts/mt7986b-tplink-archer-ax80-v1-eu.dts b/target/linux/mediatek/dts/mt7986b-tplink-archer-ax80-v1-eu.dts
new file mode 100644
index 0000000000..c7c790060b
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7986b-tplink-archer-ax80-v1-eu.dts
@@ -0,0 +1,333 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/mt65xx.h>
+
+#include "mt7986b.dtsi"
+
+/ {
+	compatible = "tplink,archer-ax80-v1-eu", "mediatek,mt7986b";
+	model = "TP-Link Archer AX80 v1 (EU)";
+	
+	aliases {
+		serial0 = &uart0;
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+	
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+	
+	memory at 40000000 {
+		reg = <0 0x40000000 0 0x20000000>;
+		device_type = "memory";
+	};
+	
+	leds {
+		compatible = "gpio-leds";
+		
+		led_power: power {
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_POWER;
+			gpios = <&pio 15 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+		
+		wlan2g {
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_WLAN_2GHZ;
+			gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "phy0tpt";
+		};
+		
+		wlan5g {
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_WLAN_5GHZ;
+			gpios = <&pio 12 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+		
+		internet_white {
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_WAN_ONLINE;
+			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+		};
+		
+		internet_orange {
+			color = <LED_COLOR_ID_ORANGE>;
+			function = LED_FUNCTION_WAN;
+			gpios = <&pio 19 GPIO_ACTIVE_LOW>;
+		};
+		
+		lan {
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_LAN;
+			gpios = <&pio 16 GPIO_ACTIVE_HIGH>;
+		};
+		
+		usb {
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_DISK;
+			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+			trigger-sources = <&ssusb>;
+			linux,default-trigger = "usbport";
+		};
+		
+		wps {
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_WPS;
+			gpios = <&pio 18 GPIO_ACTIVE_LOW>;
+		};
+	};
+	
+	keys {
+		compatible = "gpio-keys";
+		
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+		};
+		
+		wps {
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&pio 14 GPIO_ACTIVE_LOW>;
+		};
+		
+		wifi {
+			label = "wlan";
+			linux,code = <KEY_WLAN>;
+			gpios = <&pio 20 GPIO_ACTIVE_LOW>;
+		};
+	};
+	
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+	
+	reg_5v: regulator-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+};
+
+&auxadc {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&eth {
+	status = "okay";
+	
+	gmac0: mac at 0 {
+		compatible = "mediatek,eth-mac";
+		reg = <0>;
+		phy-mode = "2500base-x";
+		fixed-link {
+			speed = <2500>;
+			full-duplex;
+		};
+	};
+	
+	mac at 1 {
+		compatible = "mediatek,eth-mac";
+		reg = <1>;
+		phy-mode = "2500base-x";
+		phy-handle = <&phy6>;
+	};
+	
+	mdio-bus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reset-delay-us = <1500000>;
+		reset-post-delay-us = <1000000>;		
+		reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+		phy6: phy at 6 {
+			compatible = "ethernet-phy-ieee802.3-c45";
+			reg = <6>;
+		};
+		
+		switch at 1f {
+			compatible = "mediatek,mt7531";
+			reg = <31>;
+			reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
+			interrupt-controller;
+			#interrupt-cells = <1>;
+			interrupt-parent = <&pio>;
+			interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
+			
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				port at 0 {
+					reg = <1>;
+					label = "lan0";
+				};
+				port at 1 {
+					reg = <2>;
+					label = "lan1";
+				};
+				port at 2 {
+					reg = <3>;
+					label = "lan2";
+				};
+				port at 3 {
+					reg = <4>;
+					label = "lan3";
+				};
+				port at 6 {
+					reg = <6>;
+					label = "cpu";
+					ethernet = <&gmac0>;
+					phy-mode = "2500base-x";
+					fixed-link {
+						speed = <2500>;
+						full-duplex;
+					};
+				};
+			};
+		};
+	};
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi_flash_pins>;
+	status = "okay";
+	
+	flash at 0 {
+		compatible = "spi-nand";
+		reg = <0>;
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+		spi-cal-enable;
+		spi-cal-mode = "read-data";
+		
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			
+			partition at 0 {
+				label = "boot";
+				reg = <0x0 0x200000>;
+				read-only;
+			};
+			
+			partition at 200000 {
+				label = "u-boot-env";
+				reg = <0x200000 0x100000>;
+			};
+			
+			partition at 300000 {
+				label = "ubi0";
+				reg = <0x300000 0x3200000>;
+			};
+			
+			partition at 3500000 {
+				label = "ubi1";
+				reg = <0x3500000 0x3200000>;
+			};
+			
+			partition at 6700000 {
+				label = "userconfig";
+				reg = <0x6700000 0x800000>;
+			};
+			
+			partition at 6f00000 {
+				label = "tp_data";
+				reg = <0x6f00000 0x400000>;
+				read-only;
+			};
+			
+			partition at 7300000 {
+				label = "mali_data";
+				reg = <0x7300000 0x800000>;
+			};
+		};
+	};
+};
+
+&pio {
+	spi_flash_pins: spi-flash-pins-33-to-38 {
+		mux {
+			function = "spi";
+			groups = "spi0", "spi0_wp_hold";
+		};
+		conf-pu {
+			pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-disable; /* bias-disable */
+		};
+		conf-pd {
+			pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-disable; /* bias-disable */
+		};
+	};
+	
+	wf_2g_5g_pins: wf_2g_5g-pins {
+		mux {
+			function = "wifi";
+			groups = "wf_2g", "wf_5g";
+		};
+		conf {
+			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
+			"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
+			"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
+			"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
+			"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
+			"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
+			"WF1_TOP_CLK", "WF1_TOP_DATA";
+			drive-strength = <MTK_DRIVE_4mA>;
+		};
+	};
+};
+
+&trng {
+	status = "okay";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&ssusb {
+	vusb33-supply = <&reg_3p3v>;
+	vbus-supply = <&reg_5v>;
+	status = "okay";
+};
+
+&usb_phy {
+	status = "okay";
+};
+
+&watchdog {
+	status = "okay";
+};
+
+&wifi {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&wf_2g_5g_pins>;
+};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
index 25256fd323..3ee6967f09 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
@@ -248,6 +248,9 @@ teltonika,rutc50)
 totolink,x6000r)
 	ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx"
 	;;
+tplink,archer-ax80-v1-eu)
+	ucidef_set_led_netdev "lan" "LAN" "white:lan" "br-lan" "link tx rx"
+	;;
 tplink,be450)
 	ucidef_set_led_netdev "br-lan" "lan" "blue:lan" "br-lan" "link tx rx"
 	ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan-2ghz" "phy0.0-ap0"
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index 6c61966fc4..cb35353f3a 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -173,7 +173,8 @@ mediatek_setup_interfaces()
 	wavlink,wl-wn586x3b)
 		ucidef_set_interfaces_lan_wan "lan1 lan2" eth1
 		;;
-	tplink,archer-ax80-v1)
+	tplink,archer-ax80-v1|\
+	tplink,archer-ax80-v1-eu)
 		ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" eth1
 		;;
 	tplink,be450)
@@ -236,6 +237,7 @@ mediatek_setup_macs()
 		;;
 	mercusys,mr90x-v1|\
 	tplink,archer-ax80-v1|\
+	tplink,archer-ax80-v1-eu|\
 	tplink,re6000xd)
 		label_mac=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
 		lan_mac=$label_mac
diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
index 324c0f2834..e5d0e3f6b4 100644
--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
@@ -22,6 +22,7 @@ case "$FIRMWARE" in
 "mediatek/mt7986_eeprom_mt7975_dual.bin")
 	case "$board" in
 	mercusys,mr90x-v1|\
+	tplink,archer-ax80-v1-eu|\
 	tplink,re6000xd)
 		ln -sf /tmp/tp_data/MT7986_EEPROM.bin \
 			/lib/firmware/$FIRMWARE
diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
index 02c223393f..1feeb6a435 100644
--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
@@ -159,6 +159,7 @@ case "$board" in
 		;;
 	mercusys,mr90x-v1|\
 	tplink,archer-ax80-v1|\
+	tplink,archer-ax80-v1-eu|\
 	tplink,be450|\
 	tplink,re6000xd)
 		addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part b/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part
index fd9b045f1a..1acbd62511 100644
--- a/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part
+++ b/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part
@@ -17,6 +17,7 @@ preinit_mount_cfg_part() {
 	mercusys,mr85x|\
 	mercusys,mr90x-v1|\
 	tplink,archer-ax80-v1|\
+	tplink,archer-ax80-v1-eu|\
 	tplink,be450|\
 	tplink,re6000xd)
 		mount_ubi_part "tp_data" "tp_data"
diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh
index 917b995c9f..0d4c165e48 100644
--- a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh
@@ -40,6 +40,7 @@ preinit_set_mac_address() {
 		;;
 	mercusys,mr90x-v1|\
 	tplink,archer-ax80-v1|\
+	tplink,archer-ax80-v1-eu|\
 	tplink,re6000xd)
 		addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
 		ip link set dev eth1 address "$(macaddr_add $addr 1)"
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
old mode 100755
new mode 100644
index 199ef8b1d7..c7d6e9b39b
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -189,6 +189,7 @@ platform_do_upgrade() {
 	mercusys,mr85x|\
 	mercusys,mr90x-v1|\
 	tplink,archer-ax80-v1|\
+	tplink,archer-ax80-v1-eu|\
 	tplink,be450|\
 	tplink,re6000xd)
 		CI_UBIPART="ubi0"
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 490fb69afa..1c44948cf2 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -2476,7 +2476,8 @@ TARGET_DEVICES += totolink_x6000r
 
 define Device/tplink_archer-ax80-v1
   DEVICE_VENDOR := TP-Link
-  DEVICE_MODEL := Archer AX80V1
+  DEVICE_MODEL := Archer AX80
+  DEVICE_VARIANT := v1
   DEVICE_DTS := mt7986a-tplink-archer-ax80-v1
   DEVICE_DTS_DIR := ../dts
   DEVICE_PACKAGES := kmod-leds-lp5523 kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
@@ -2488,6 +2489,21 @@ define Device/tplink_archer-ax80-v1
 endef
 TARGET_DEVICES += tplink_archer-ax80-v1
 
+define Device/tplink_archer-ax80-v1-eu
+  DEVICE_VENDOR := TP-Link
+  DEVICE_MODEL := Archer AX80
+  DEVICE_VARIANT := v1 (EU)
+  DEVICE_DTS := mt7986b-tplink-archer-ax80-v1-eu
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  IMAGE_SIZE := 51200k
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += tplink_archer-ax80-v1-eu
+
 define Device/tplink_be450
   DEVICE_VENDOR := TP-Link
   DEVICE_MODEL := BE450



From lede-commits at lists.infradead.org  Sat Dec 20 09:33:40 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 20 Dec 2025 12:33:40 -0500
Subject: [openwrt/openwrt]  kernel: add option for USB FunctionFS gadget
In-Reply-To: <176625202065.171991.6081373271438271631@git-01.infra.openwrt.org>
References: <176625202065.171991.6081373271438271631@git-01.infra.openwrt.org>
Message-ID: <mailman.38100.1766252026.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/22a69dfa4a9a04833aaac62b9f0a7814571b9e07

commit 22a69dfa4a9a04833aaac62b9f0a7814571b9e07
Author: Dominic Germain <dominic at germain.cc>
AuthorDate: Fri Dec 19 09:46:57 2025 -0500

    kernel: add option for USB FunctionFS gadget
    
    Add menuconfig option 'kmod-usb-gadget-fs' for the USB FunctionFS gadget
    module
    
    OpenWRT is perfect for USB gadgets that are network-enabled, since it
    provides everything needed to easily manage the device. Having support
    for the FunctionFS gadget enables the use of any custom USB devices
    that does not have a specific module, like Media Transfer Protocol.
    
    Signed-off-by: Dominic Germain <dominic at germain.cc>
    Link: https://github.com/openwrt/openwrt/pull/21207
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/linux/modules/usb.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index d484c3a8f8..7d99933725 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -154,6 +154,24 @@ endef
 
 $(eval $(call KernelPackage,usb-gadget-hid))
 
+define KernelPackage/usb-gadget-fs
+  TITLE:=USB FunctionFS Gadget Support
+  KCONFIG:=CONFIG_USB_FUNCTIONFS \
+    CONFIG_USB_FUNCTIONFS_ETH=n \
+    CONFIG_USB_FUNCTIONFS_RNDIS=n
+  FILES:= \
+	  $(LINUX_DIR)/drivers/usb/gadget/legacy/g_ffs.ko \
+	  $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_fs.ko
+  AUTOLOAD:=$(call AutoLoad,52,usb_f_fs)
+  $(call AddDepends/usbgadget,+kmod-usb-lib-composite +kmod-dma-buf)
+endef
+
+define KernelPackage/usb-gadget-fs/description
+  Kernel support for USB FunctionFS Gadget.
+endef
+
+$(eval $(call KernelPackage,usb-gadget-fs))
+
 define KernelPackage/usb-gadget-ehci-debug
   TITLE:=USB EHCI debug port Gadget support
   KCONFIG:=\



From lede-commits at lists.infradead.org  Sun Dec 21 11:19:06 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 21 Dec 2025 14:19:06 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: use MT/s as DDR
 speed unit
In-Reply-To: <176634474630.1549239.8423936159068682353@git-01.infra.openwrt.org>
References: <176634474630.1549239.8423936159068682353@git-01.infra.openwrt.org>
Message-ID: <mailman.38190.1766344752.2093109.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/79dac8f57c75858a277bceed00216091ba7e84fa

commit 79dac8f57c75858a277bceed00216091ba7e84fa
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Thu Dec 11 19:16:56 2025 +0800

    arm-trusted-firmware-mediatek: use MT/s as DDR speed unit
    
    Usually we do not use MHz to describe the DDR transmission rate. In
    fact, the clock frequency of the DDR3-1866 is only 933 MHz. MT/s is
    a more commonly used unit.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
---
 package/boot/arm-trusted-firmware-mediatek/Makefile | 12 ++++++------
 package/boot/uboot-mediatek/Makefile                |  8 ++++----
 target/linux/mediatek/image/filogic.mk              |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index 3ce3b582fb..4082bc294b 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -211,8 +211,8 @@ define Trusted-Firmware-A/mt7981-emmc-ddr3
   DDR_TYPE:=ddr3
 endef
 
-define Trusted-Firmware-A/mt7981-emmc-ddr3-1866mhz
-  NAME:=MediaTek MT7981 (eMMC, DDR3 1866 MHz)
+define Trusted-Firmware-A/mt7981-emmc-ddr3-1866
+  NAME:=MediaTek MT7981 (eMMC, DDR3 1866 MT/s)
   BOOT_DEVICE:=emmc
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7981
@@ -244,8 +244,8 @@ define Trusted-Firmware-A/mt7981-spim-nand-ddr3
   DDR_TYPE:=ddr3
 endef
 
-define Trusted-Firmware-A/mt7981-spim-nand-ddr3-1866mhz
-  NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR3 1866 MHz)
+define Trusted-Firmware-A/mt7981-spim-nand-ddr3-1866
+  NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR3 1866 MT/s)
   BOOT_DEVICE:=spim-nand
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7981
@@ -652,13 +652,13 @@ TFA_TARGETS:= \
 	mt7622-sdmmc-2ddr \
 	mt7981-ram-ddr3 \
 	mt7981-emmc-ddr3 \
-	mt7981-emmc-ddr3-1866mhz \
+	mt7981-emmc-ddr3-1866 \
 	mt7981-nor-ddr3 \
 	mt7981-nor-ddr4 \
 	mt7981-sdmmc-ddr3 \
 	mt7981-snand-ddr3 \
 	mt7981-spim-nand-ddr3 \
-	mt7981-spim-nand-ddr3-1866mhz \
+	mt7981-spim-nand-ddr3-1866 \
 	mt7981-spim-nand-ubi-ddr4 \
 	mt7981-ram-ddr4 \
 	mt7981-emmc-ddr4 \
diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile
index 2431d4fd96..4f3e049014 100644
--- a/package/boot/uboot-mediatek/Makefile
+++ b/package/boot/uboot-mediatek/Makefile
@@ -251,8 +251,8 @@ define U-Boot/mt7981_cmcc_rax3000m-emmc-ddr3
   UBOOT_IMAGE:=u-boot.fip
   BL2_BOOTDEV:=emmc
   BL2_SOC:=mt7981
-  BL2_DDRTYPE:=ddr3-1866mhz
-  DEPENDS:=+trusted-firmware-a-mt7981-emmc-ddr3-1866mhz
+  BL2_DDRTYPE:=ddr3-1866
+  DEPENDS:=+trusted-firmware-a-mt7981-emmc-ddr3-1866
 endef
 
 define U-Boot/mt7981_cmcc_rax3000m-emmc-ddr4
@@ -275,8 +275,8 @@ define U-Boot/mt7981_cmcc_rax3000m-nand-ddr3
   UBOOT_IMAGE:=u-boot.fip
   BL2_BOOTDEV:=spim-nand
   BL2_SOC:=mt7981
-  BL2_DDRTYPE:=ddr3-1866mhz
-  DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3-1866mhz
+  BL2_DDRTYPE:=ddr3-1866
+  DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3-1866
 endef
 
 define U-Boot/mt7981_cmcc_rax3000m-nand-ddr4
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 1c44948cf2..64e378997b 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -851,11 +851,11 @@ define Device/cmcc_rax3000m
 	nand-ddr4-bl31-uboot.fip nand-ddr4-preloader.bin
   ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
   ARTIFACT/emmc-ddr3-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-emmc-ddr3
-  ARTIFACT/emmc-ddr3-preloader.bin  := mt7981-bl2 emmc-ddr3-1866mhz
+  ARTIFACT/emmc-ddr3-preloader.bin  := mt7981-bl2 emmc-ddr3-1866
   ARTIFACT/emmc-ddr4-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-emmc-ddr4
   ARTIFACT/emmc-ddr4-preloader.bin  := mt7981-bl2 emmc-ddr4
   ARTIFACT/nand-ddr3-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-nand-ddr3
-  ARTIFACT/nand-ddr3-preloader.bin  := mt7981-bl2 spim-nand-ddr3-1866mhz
+  ARTIFACT/nand-ddr3-preloader.bin  := mt7981-bl2 spim-nand-ddr3-1866
   ARTIFACT/nand-ddr4-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-nand-ddr4
   ARTIFACT/nand-ddr4-preloader.bin  := mt7981-bl2 spim-nand-ddr4
 endef



From lede-commits at lists.infradead.org  Sun Dec 21 11:42:10 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 21 Dec 2025 14:42:10 -0500
Subject: [openwrt/openwrt]  mvebu: enable tickless idle
In-Reply-To: <176634613062.1620820.9366372897835886842@git-01.infra.openwrt.org>
References: <176634613062.1620820.9366372897835886842@git-01.infra.openwrt.org>
Message-ID: <mailman.38191.1766346135.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c13f299918702799e883fc330521bed4b7da0bd3

commit c13f299918702799e883fc330521bed4b7da0bd3
Author: Qingfang Deng <dqfext at gmail.com>
AuthorDate: Fri Dec 12 10:53:11 2025 +0800

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21136
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/mvebu/config-6.12 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/linux/mvebu/config-6.12 b/target/linux/mvebu/config-6.12
index 62bdda2734..ef1c628abc 100644
--- a/target/linux/mvebu/config-6.12
+++ b/target/linux/mvebu/config-6.12
@@ -88,7 +88,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 CONFIG_CPU_FREQ_STAT=y
 CONFIG_CPU_HAS_ASID=y
 CONFIG_CPU_IDLE=y
-CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
 CONFIG_CPU_MITIGATIONS=y
 CONFIG_CPU_PABRT_V7=y
 CONFIG_CPU_PJ4B=y
@@ -213,7 +213,6 @@ CONFIG_HWBM=y
 CONFIG_HWMON=y
 CONFIG_HW_RANDOM=y
 CONFIG_HZ_FIXED=0
-CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
@@ -298,6 +297,8 @@ CONFIG_NET_SELFTESTS=y
 CONFIG_NET_XGRESS=y
 CONFIG_NLS=y
 CONFIG_NOP_USB_XCEIV=y
+CONFIG_NO_HZ_COMMON=y
+CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=4
 CONFIG_NVMEM=y
 CONFIG_NVMEM_LAYOUTS=y



From lede-commits at lists.infradead.org  Sun Dec 21 11:49:26 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 21 Dec 2025 14:49:26 -0500
Subject: [openwrt/openwrt]  tools/xz: update to 5.8.2
In-Reply-To: <176634656673.1640504.17845543565330117979@git-01.infra.openwrt.org>
References: <176634656673.1640504.17845543565330117979@git-01.infra.openwrt.org>
Message-ID: <mailman.38192.1766346571.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/def7548867741206f6788d55e58d7417d859e106

commit def7548867741206f6788d55e58d7417d859e106
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Thu Dec 18 21:26:36 2025 +0800

    tools/xz: update to 5.8.2
    
    Release Notes:
    https://github.com/tukaani-project/xz/releases/tag/v5.8.2
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21208
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 tools/xz/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/xz/Makefile b/tools/xz/Makefile
index a370408ca0..d17cdb47af 100644
--- a/tools/xz/Makefile
+++ b/tools/xz/Makefile
@@ -7,13 +7,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xz
-PKG_VERSION:=5.8.1
+PKG_VERSION:=5.8.2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/tukaani-project/xz/releases/download/v$(PKG_VERSION) \
 		@SF/lzmautils \
 		http://tukaani.org/xz
-PKG_HASH:=5965c692c4c8800cd4b33ce6d0f6ac9ac9d6ab227b17c512b6561bce4f08d47e
+PKG_HASH:=60345d7c0b9c8d7ffa469e96898c300def3669f5047fc76219b819340839f3d8
 PKG_CPE_ID:=cpe:/a:tukaani:xz
 
 HOST_BUILD_PARALLEL:=1



From lede-commits at lists.infradead.org  Mon Dec 22 01:33:48 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 22 Dec 2025 04:33:48 -0500
Subject: [openwrt/openwrt]  mediatek: fix pwn fan settings for sinovoip bpi-r3
 (v3)
In-Reply-To: <176639602875.509839.10607831974439872093@git-01.infra.openwrt.org>
References: <176639602875.509839.10607831974439872093@git-01.infra.openwrt.org>
Message-ID: <mailman.38274.1766396035.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/095151b2354752be6b4be81e6b22b65227c59746

commit 095151b2354752be6b4be81e6b22b65227c59746
Author: Mikhail Kshevetskiy <mikhail.kshevetskiy at gmail.com>
AuthorDate: Fri Nov 22 01:29:06 2024 +0300

    mediatek: fix pwn fan settings for sinovoip bpi-r3 (v3)
    
    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/17130
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 ...ediatek-mt7986-bpi-r3-Change-fan-PWM-valu.patch | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/target/linux/mediatek/patches-6.12/061-v6.19-arm64-dts-mediatek-mt7986-bpi-r3-Change-fan-PWM-valu.patch b/target/linux/mediatek/patches-6.12/061-v6.19-arm64-dts-mediatek-mt7986-bpi-r3-Change-fan-PWM-valu.patch
new file mode 100644
index 0000000000..4b27031d11
--- /dev/null
+++ b/target/linux/mediatek/patches-6.12/061-v6.19-arm64-dts-mediatek-mt7986-bpi-r3-Change-fan-PWM-valu.patch
@@ -0,0 +1,72 @@
+From 5f271fe1365b63f67fc384ca8d50d473d09de0d1 Mon Sep 17 00:00:00 2001
+From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Date: Tue, 3 Dec 2024 07:33:55 +0300
+Subject: [PATCH] arm64: dts: mediatek: mt7986-bpi-r3: Change fan PWM value for
+ mid speed
+
+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
+  -----------------------------------------------------------------
+
+Thus only cpu-active-high and cpu-active-low modes are usable.
+I think this is wrong.
+
+This patch fixes cpu-active-medium settings for bpi-r3 board.
+
+I know, the patch is not ideal as it can break pwm fan for some users.
+Likely this is the only official mt7986-bpi-r3 heatsink+fan solution
+available on the market.
+
+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
+  =====================
+
+Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Acked-by: Frank Wunderlich <frank-w at public-files.de>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+
+---
+Changes from v1 to v2:
+ * improve patch description
+
+Changes from v2 to v3:
+ * added question to Frank Wunderlich
+
+Changes from v3 to v4:
+ * Acked by Frank Wunderlich
+---
+ arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
++++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+@@ -42,7 +42,7 @@
+ 		compatible = "pwm-fan";
+ 		#cooling-cells = <2>;
+ 		/* cooling level (0, 1, 2) - pwm inverted */
+-		cooling-levels = <255 96 0>;
++		cooling-levels = <255 40 0>;
+ 		pwms = <&pwm 0 10000>;
+ 		status = "okay";
+ 	};



From lede-commits at lists.infradead.org  Mon Dec 22 01:34:25 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 22 Dec 2025 04:34:25 -0500
Subject: [openwrt/openwrt]  mediatek: fix pwn fan settings for sinovoip bpi-r3
 (v3)
In-Reply-To: <176639606574.515770.10332102369198064240@git-01.infra.openwrt.org>
References: <176639606574.515770.10332102369198064240@git-01.infra.openwrt.org>
Message-ID: <mailman.38275.1766396070.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/623e329a52055af22f640d0c21ef666461c9ac5c

commit 623e329a52055af22f640d0c21ef666461c9ac5c
Author: Mikhail Kshevetskiy <mikhail.kshevetskiy at gmail.com>
AuthorDate: Fri Nov 22 01:29:06 2024 +0300

    mediatek: fix pwn fan settings for sinovoip bpi-r3 (v3)
    
    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/17130
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 095151b2354752be6b4be81e6b22b65227c59746)
---
 ...ediatek-mt7986-bpi-r3-Change-fan-PWM-valu.patch | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/target/linux/mediatek/patches-6.12/061-v6.19-arm64-dts-mediatek-mt7986-bpi-r3-Change-fan-PWM-valu.patch b/target/linux/mediatek/patches-6.12/061-v6.19-arm64-dts-mediatek-mt7986-bpi-r3-Change-fan-PWM-valu.patch
new file mode 100644
index 0000000000..4b27031d11
--- /dev/null
+++ b/target/linux/mediatek/patches-6.12/061-v6.19-arm64-dts-mediatek-mt7986-bpi-r3-Change-fan-PWM-valu.patch
@@ -0,0 +1,72 @@
+From 5f271fe1365b63f67fc384ca8d50d473d09de0d1 Mon Sep 17 00:00:00 2001
+From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Date: Tue, 3 Dec 2024 07:33:55 +0300
+Subject: [PATCH] arm64: dts: mediatek: mt7986-bpi-r3: Change fan PWM value for
+ mid speed
+
+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
+  -----------------------------------------------------------------
+
+Thus only cpu-active-high and cpu-active-low modes are usable.
+I think this is wrong.
+
+This patch fixes cpu-active-medium settings for bpi-r3 board.
+
+I know, the patch is not ideal as it can break pwm fan for some users.
+Likely this is the only official mt7986-bpi-r3 heatsink+fan solution
+available on the market.
+
+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
+  =====================
+
+Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Acked-by: Frank Wunderlich <frank-w at public-files.de>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+
+---
+Changes from v1 to v2:
+ * improve patch description
+
+Changes from v2 to v3:
+ * added question to Frank Wunderlich
+
+Changes from v3 to v4:
+ * Acked by Frank Wunderlich
+---
+ arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
++++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+@@ -42,7 +42,7 @@
+ 		compatible = "pwm-fan";
+ 		#cooling-cells = <2>;
+ 		/* cooling level (0, 1, 2) - pwm inverted */
+-		cooling-levels = <255 96 0>;
++		cooling-levels = <255 40 0>;
+ 		pwms = <&pwm 0 10000>;
+ 		status = "okay";
+ 	};



From lede-commits at lists.infradead.org  Mon Dec 22 01:44:49 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 22 Dec 2025 04:44:49 -0500
Subject: [openwrt/openwrt]  build: fix apk packaging and ABI-versioning
In-Reply-To: <176639668997.578585.11309509820135285834@git-01.infra.openwrt.org>
References: <176639668997.578585.11309509820135285834@git-01.infra.openwrt.org>
Message-ID: <mailman.38292.1766396707.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/18029977f65e11bafaad501399ad42a66d3baa10

commit 18029977f65e11bafaad501399ad42a66d3baa10
Author: George Sapkin <george at sapk.in>
AuthorDate: Thu Nov 20 01:50:03 2025 +0200

    build: fix apk packaging and ABI-versioning
    
    The updated logic for the APK dependencies and provides is as follows:
    
    - If ABI version is defined:
      - package is named `package_name-ABI_version`
      - package implicitly provides
        `package_name-ABI_version=package_version`
        this implies that only one version of a package per ABI can be
        installed at the same time
      - additionally provide `package_name` so multiple packages can be
        looked up by its base name
      - for each `provides`, provide `provide-ABI_version=package_version`
        this implies that only one version of a provide can be installed at
        the same time
    
    - else if ABI version is _not_ defined
      - package is named `package_name`
      - package implicitly provides `package_name=package_version`
        this implies that only one version of a package can be installed at
        the same time
      - if `alternatives` is defined
        - for each `provides`, provide `provide`
          this implies that multiple versions of a provide can be installed
          at the same time
      - else if `alternatives` is _not_ defined
        - for each `provides`, provide `provide=package_version`
          this implies that only one version of a provide can be installed
          at the same time
    
    Both cases a package can be looked up by its base name.
    
    ABI version `alternatives`, `conffiles`, `conffiles_static`, `list` and
    `rusers` files so multiple versions of the same ABI package can be
    installed side by side, and so they don't overwrite each other's
    packaging files.
    
    ABI version `EXTRA_DEPENDS` so dependencies can be correctly looked up
    using the existing OpenWrt semantics without the ABI specified. This is
    needed since ABI-versioned libraries no longer provide
    `package_name=package_version`, so that they can be installed side by
    side.
    
    Remove duplicate dependencies when `EXTRA_DEPENDS` specifies a versioned
    one that is already in `DEPENDS`.
    
    ABI is defined
    ------------------------------------------------------------------------
    
    `libsqlite3` has `PROVIDES` set to `libfake` and has two different ABI
    versions installed. `libfake` is just an example to demonstrate the
    mechanics, as the library can already be depended upon using e.g.
    `libsqlite3-0=3.51.0-r1`. Note the ABI-versioned lists.
    
    ```
    root at OpenWrt:/tmp# apk add --allow-untrusted ./libsqlite3-0-3.51.0-r1.apk
    (1/1) Installing libsqlite3-0 (3.51.0-r1)
    libsqlite3-0-3.51.0-r1.post-install: Executing script...
    OK: 22 MiB in 157 packages
    
    root at OpenWrt:/tmp# apk add --allow-untrusted ./libsqlite3-1-4.00.0-r1.apk
    (1/1) Installing libsqlite3-1 (4.00.0-r1)
    libsqlite3-1-4.00.0-r1.post-install: Executing script...
    OK: 23 MiB in 158 packages
    
    root at OpenWrt:/tmp# apk query --fields name,version,contents,provides libsqlite3-0 libsqlite3-1
    Name: libsqlite3-0
    Version: 3.51.0-r2
    Provides: libfake-0=3.51.0-r2 libsqlite3
    Contents:
      lib/apk/packages/libsqlite3-0.list
      usr/lib/libsqlite3.so.0
      usr/lib/libsqlite3.so.3.51.0
    
    Name: libsqlite3-1
    Version: 4.00.0-r1
    Provides: libfake-1=4.00.0-r1 libsqlite3
    Contents:
      lib/apk/packages/libsqlite3-1.list
      usr/lib/libsqlite3.so.1
      usr/lib/libsqlite3.so.4.00.0
    
    root at OpenWrt:/tmp# ls -lh /usr/lib/libsqlite3.so.*
    lrwxrwxrwx    1 root     root          20 Nov 20 00:23 /usr/lib/libsqlite3.so.0 -> libsqlite3.so.3.51.0
    lrwxrwxrwx    1 root     root          20 Nov 20 00:27 /usr/lib/libsqlite3.so.1 -> libsqlite3.so.4.00.0
    -rwxr-xr-x    1 root     root        1.0M Nov  6 18:19 /usr/lib/libsqlite3.so.3.51.0
    -rwxr-xr-x    1 root     root        1.0M Nov  6 18:19 /usr/lib/libsqlite3.so.4.00.0
    ```
    
    ABI is not defined
    ------------------------------------------------------------------------
    
    Both `avahi-dbus-daemon` and `avahi-nodbus-daemon` provide `avahi-daemon`,
    but have no ABI specified. This results in `avahi-daemon=0.8-r11` provides
    for both packages and only one being able to be installed at the same time:
    
    ```
    root at OpenWrt:/tmp# apk add --allow-untrusted ./avahi-nodbus-daemon-0.8-r11.apk
    (1/4) Installing libavahi-nodbus-support (0.8-r10)
    libavahi-nodbus-support-0.8-r10.post-install: Executing script...
    (2/4) Installing libdaemon (0.14-r5)
    libdaemon-0.14-r5.post-install: Executing script...
    (3/4) Installing libexpat (2.7.3-r1)
    libexpat-2.7.3-r1.post-install: Executing script...
    (4/4) Installing avahi-nodbus-daemon (0.8-r11)
    avahi-nodbus-daemon-0.8-r11.post-install: Executing script...
    23 MiB in 160 packages
    
    root at OpenWrt:/tmp# apk query --fields provides avahi-nodbus-daemon
    Provides: avahi-daemon=0.8-r11
    
    root at OpenWrt:/tmp# apk add --allow-untrusted ./avahi-dbus-daemon-0.8-r11.apk
    ERROR: unable to select packages:
      avahi-dbus-daemon-0.8-r11:
        conflicts: avahi-nodbus-daemon-0.8-r11[avahi-daemon=0.8-r11]
        satisfies: world[avahi-dbus-daemon><Q1R111s+ke9Vf+eCxDHX2BZVUK54Q=]
      avahi-nodbus-daemon-0.8-r11:
        conflicts: avahi-dbus-daemon-0.8-r11[avahi-daemon=0.8-r11]
        satisfies: world[avahi-nodbus-daemon><Q1BAu7nLI2MgRabpveLTGO2ksQz7E=]
    ```
    
    Provides and alternatives
    ------------------------------------------------------------------------
    
    Both `uclient-fetch` and `wget-nossl` provide `wget` and specify
    alternatives, so provides are not versioned and both packages can be
    installed at the same time:
    
    ```
    root at OpenWrt:/tmp# apk query --fields name,version,contents,provides uclient-fetch wget-nossl
    Name: uclient-fetch
    Version: 2025.10.03~dc909ca7-r1
    Provides: wget
    Contents:
      bin/uclient-fetch
      lib/apk/packages/uclient-fetch.alternatives
      lib/apk/packages/uclient-fetch.list
    
    Name: wget-nossl
    Version: 1.25.0-r1
    Provides: gnu-wget wget
    Contents:
      lib/apk/packages/wget-nossl.alternatives
      lib/apk/packages/wget-nossl.list
      usr/libexec/wget-nossl
    
    ```
    
    Fixes: https://github.com/openwrt/openwrt/issues/20582
    Fixes: https://github.com/openwrt/openwrt/issues/20802
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/20819
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 include/package-pack.mk | 79 +++++++++++++++++++++++++++++++++++--------------
 1 file changed, 57 insertions(+), 22 deletions(-)

diff --git a/include/package-pack.mk b/include/package-pack.mk
index c989fdb116..980fe29f69 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -199,11 +199,49 @@ endif
 	$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
 	touch $$@
 
-    Package/$(1)/DEPENDS := $$(call mergelist,$$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep))))
+    Package/$(1)/DEPENDS := $$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep)))
     ifneq ($$(EXTRA_DEPENDS),)
-      Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
+      ifeq ($(CONFIG_USE_APK),)
+        Package/$(1)/DEPENDS := $$(call mergelist,$$(Package/$(1)/DEPENDS))
+        Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
+      else
+        _SEP := __COMMA_SEP__
+        _SPACE := __SPACE_SEP__
+        _DEPENDS := $$(Package/$(1)/DEPENDS)
+        _EXTRA_DEPENDS_ABI :=
+        _DEP_ITEMS := $$(subst $$(_SEP),$$(space),$$(subst $$(space),$$(_SPACE),$$(subst $$(comma),$$(_SEP),$$(EXTRA_DEPENDS))))
+
+        $$(foreach dep,$$(_DEP_ITEMS), \
+          $$(eval _CUR_DEP := $$(subst $$(_SPACE),$$(space),$$(strip $$(dep)))) \
+          $$(eval _PKG_NAME := $$(word 1,$$(_CUR_DEP))) \
+          $$(if $$(findstring $$(paren_left), $$(_PKG_NAME)), \
+            $$(error "Unsupported extra dependency format: no space before '(': $$(_CUR_DEP)")) \
+          ) \
+          $$(eval _ABI_SUFFIX := $$(call GetABISuffix,$$(_PKG_NAME))) \
+          $$(eval _PKG_NAME_ABI := $$(_PKG_NAME)$$(_ABI_SUFFIX)) \
+          $$(eval _VERSION_CONSTRAINT := $$(word 2,$$(_CUR_DEP))) \
+          $$(if $$(_VERSION_CONSTRAINT), \
+            $$(eval _EXTRA_DEP := $$(_PKG_NAME_ABI) $$(_VERSION_CONSTRAINT)), \
+            $$(error "Extra dependencies must have version constraints. $$(_PKG_NAME) seems to be unversioned.") \
+          ) \
+          $$(if $$(_EXTRA_DEPENDS_ABI), \
+            $$(eval _EXTRA_DEPENDS_ABI := $$(_EXTRA_DEPENDS_ABI)$$(comma)$$(_EXTRA_DEP)), \
+            $$(eval _EXTRA_DEPENDS_ABI := $$(_EXTRA_DEP)) \
+          ) \
+          $$(if $$(_DEPENDS), \
+            $$(eval _DEPENDS := $$(filter-out $$(_PKG_NAME_ABI),$$(_DEPENDS))) \
+          ) \
+        )
+
+        _DEPENDS := $$(call mergelist,$$(_DEPENDS))
+        Package/$(1)/DEPENDS := $$(_EXTRA_DEPENDS_ABI)$$(if $$(_DEPENDS),$$(comma) $$(_DEPENDS))
+      endif
+    else
+      Package/$(1)/DEPENDS := $$(call mergelist,$$(Package/$(1)/DEPENDS))
     endif
 
+    $$(info $(1) fused dependencies: $$(Package/$(1)/DEPENDS))
+
 $(_define) Package/$(1)/CONTROL
 Package: $(1)$$(ABIV_$(1))
 Version: $(VERSION)
@@ -320,7 +358,7 @@ else
 		echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
 		echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
 		echo 'export root="$$$${IPKG_INSTROOT}"'; \
-		echo 'export pkgname="$(1)"'; \
+		echo 'export pkgname="$(1)$$(ABIV_$(1))"'; \
 		echo "add_group_and_user"; \
 		echo "default_postinst"; \
 		[ ! -f $$(ADIR_$(1))/postinst-pkg ] || sed -z 's/^\s*#!/#!/' "$$(ADIR_$(1))/postinst-pkg"; \
@@ -345,34 +383,34 @@ else
 		echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
 		echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
 		echo 'export root="$$$${IPKG_INSTROOT}"'; \
-		echo 'export pkgname="$(1)"'; \
+		echo 'export pkgname="$(1)$$(ABIV_$(1))"'; \
 		echo "default_prerm"; \
 		[ ! -f $$(ADIR_$(1))/prerm-pkg ] || sed -z 's/^\s*#!/#!/' "$$(ADIR_$(1))/prerm-pkg"; \
 	) > $$(ADIR_$(1))/pre-deinstall;
 
 	[ ! -f $$(ADIR_$(1))/postrm ] || sed -zi 's/^\s*#!/#!/' "$$(ADIR_$(1))/postrm";
 
-	if [ -n "$(USERID)" ]; then echo $(USERID) > $$(IDIR_$(1))/lib/apk/packages/$(1).rusers; fi;
-	if [ -n "$(ALTERNATIVES)" ]; then echo $(ALTERNATIVES) > $$(IDIR_$(1))/lib/apk/packages/$(1).alternatives; fi;
-	(cd $$(IDIR_$(1)) && find . -type f,l -printf "/%P\n" | sort > $(TMP_DIR)/$(1).list && mv $(TMP_DIR)/$(1).list $$(IDIR_$(1))/lib/apk/packages/$(1).list)
+	if [ -n "$(USERID)" ]; then echo $(USERID) > $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).rusers; fi;
+	if [ -n "$(ALTERNATIVES)" ]; then echo $(ALTERNATIVES) > $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).alternatives; fi;
+	(cd $$(IDIR_$(1)) && find . -type f,l -printf "/%P\n" | sort > $(TMP_DIR)/$(1).list && mv $(TMP_DIR)/$(1).list $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).list)
 	# Move conffiles to IDIR and build conffiles_static with csums
 	if [ -f $$(ADIR_$(1))/conffiles ]; then \
-		mv -f $$(ADIR_$(1))/conffiles $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles; \
-		for file in $$$$(cat $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles); do \
+		mv -f $$(ADIR_$(1))/conffiles $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles; \
+		for file in $$$$(cat $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles); do \
 			[ -f $$(IDIR_$(1))/$$$$file ] || continue; \
 			csum=$$$$($(MKHASH) sha256 $$(IDIR_$(1))/$$$$file); \
-			echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles_static; \
+			echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles_static; \
 		done; \
 	fi
 
 	# Some package (base-files) manually append stuff to conffiles
 	# Append stuff from it and delete the CONTROL directory since everything else should be migrated
 	if [ -f $$(IDIR_$(1))/CONTROL/conffiles ]; then \
-		echo $$$$(IDIR_$(1))/CONTROL/conffiles >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles; \
+		echo $$$$(IDIR_$(1))/CONTROL/conffiles >> $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles; \
 		for file in $$$$(cat $$(IDIR_$(1))/CONTROL/conffiles); do \
 			[ -f $$(IDIR_$(1))/$$$$file ] || continue; \
 			csum=$$$$($(MKHASH) sha256 $$(IDIR_$(1))/$$$$file); \
-			echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles_static; \
+			echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles_static; \
 		done; \
 		rm -rf $$(IDIR_$(1))/CONTROL/conffiles; \
 	fi
@@ -394,16 +432,13 @@ else
 	  --info "origin:$(SOURCE)" \
 	  --info "url:$(URL)" \
 	  --info "maintainer:$(MAINTAINER)" \
-	  --info "provides:$$(foreach prov,\
-			$$(filter-out $(1)$$(ABIV_$(1)), \
-			$(PROVIDES)$$(if $$(ABIV_$(1)), \
-				$(1)=$(VERSION) $(foreach provide, \
-					$(PROVIDES), \
-					$(provide)$$(ABIV_$(1))=$(VERSION) \
-				) \
-			) \
-		), \
-		$$(prov) )" \
+	  --info "provides:$$(if $$(ABIV_$(1)), \
+	    $(1) $(foreach provide,$(PROVIDES), $(provide)$$(ABIV_$(1))=$(VERSION)), \
+	    $(if $(ALTERNATIVES), \
+	      $(PROVIDES), \
+	      $(foreach provide,$(PROVIDES), $(provide)=$(VERSION)) \
+	    ) \
+	  )" \
 	  $(if $(DEFAULT_VARIANT),--info "provider-priority:100",$(if $(PROVIDES),--info "provider-priority:1")) \
 	  $$(APK_SCRIPTS_$(1)) \
 	  --info "depends:$$(foreach depends,$$(subst $$(comma),$$(space),$$(subst $$(space),,$$(subst $$(paren_right),,$$(subst $$(paren_left),,$$(Package/$(1)/DEPENDS))))),$$(depends))" \



From lede-commits at lists.infradead.org  Mon Dec 22 07:09:49 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 22 Dec 2025 10:09:49 -0500
Subject: [openwrt/openwrt]  mediatek: fix pwn fan settings for sinovoip bpi-r3
 (v3)
In-Reply-To: <176641618945.3489123.14195746912452039013@git-01.infra.openwrt.org>
References: <176641618945.3489123.14195746912452039013@git-01.infra.openwrt.org>
Message-ID: <mailman.38372.1766416194.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/2916275a3d6cdda8bbc9decb5fd4df5e89a425a1

commit 2916275a3d6cdda8bbc9decb5fd4df5e89a425a1
Author: Mikhail Kshevetskiy <mikhail.kshevetskiy at gmail.com>
AuthorDate: Fri Nov 22 01:29:06 2024 +0300

    mediatek: fix pwn fan settings for sinovoip bpi-r3 (v3)
    
    backport upstream commit 095151b235 (mediatek: fix pwn fan settings for
    sinovoip bpi-r3 (v3))
    
    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21252
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 ...7-dts-mt7986a-bpi-r3-Change-fan-PWM-value.patch | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/target/linux/mediatek/patches-6.6/197-dts-mt7986a-bpi-r3-Change-fan-PWM-value.patch b/target/linux/mediatek/patches-6.6/197-dts-mt7986a-bpi-r3-Change-fan-PWM-value.patch
new file mode 100644
index 0000000000..d74ebc10cd
--- /dev/null
+++ b/target/linux/mediatek/patches-6.6/197-dts-mt7986a-bpi-r3-Change-fan-PWM-value.patch
@@ -0,0 +1,72 @@
+From 5f271fe1365b63f67fc384ca8d50d473d09de0d1 Mon Sep 17 00:00:00 2001
+From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Date: Tue, 3 Dec 2024 07:33:55 +0300
+Subject: [PATCH] arm64: dts: mediatek: mt7986-bpi-r3: Change fan PWM value for
+ mid speed
+
+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
+  -----------------------------------------------------------------
+
+Thus only cpu-active-high and cpu-active-low modes are usable.
+I think this is wrong.
+
+This patch fixes cpu-active-medium settings for bpi-r3 board.
+
+I know, the patch is not ideal as it can break pwm fan for some users.
+Likely this is the only official mt7986-bpi-r3 heatsink+fan solution
+available on the market.
+
+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
+  =====================
+
+Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Acked-by: Frank Wunderlich <frank-w at public-files.de>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+
+---
+Changes from v1 to v2:
+ * improve patch description
+
+Changes from v2 to v3:
+ * added question to Frank Wunderlich
+
+Changes from v3 to v4:
+ * Acked by Frank Wunderlich
+---
+ arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
++++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+@@ -46,7 +46,7 @@
+ 		compatible = "pwm-fan";
+ 		#cooling-cells = <2>;
+ 		/* cooling level (0, 1, 2) - pwm inverted */
+-		cooling-levels = <255 96 0>;
++		cooling-levels = <255 40 0>;
+ 		pwms = <&pwm 0 10000>;
+ 		status = "okay";
+ 	};



From lede-commits at lists.infradead.org  Mon Dec 22 09:50:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 22 Dec 2025 12:50:38 -0500
Subject: [openwrt/openwrt]  ath79: fix build of big images for TP RE355v1,
 RE450v1 & v2
In-Reply-To: <176642583879.1245086.1857265479591262905@git-01.infra.openwrt.org>
References: <176642583879.1245086.1857265479591262905@git-01.infra.openwrt.org>
Message-ID: <mailman.38399.1766425844.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/bdbb4bdfa030add96abef59b43adadf1050d678d

commit bdbb4bdfa030add96abef59b43adadf1050d678d
Author: Radek Dost?l <rd at radekdostal.com>
AuthorDate: Sun Dec 14 10:37:06 2025 +0100

    ath79: fix build of big images for TP RE355v1, RE450v1 & v2
    
    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
    ebd5e5fb5359 ("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 e768731dc8e9 ("ath79: switch TP-Link RE355 v1, RE450 v1 and
    RE450 v2 to mtd-concat").
    
    Signed-off-by: Radek Dost?l <rd at radekdostal.com>
    Link: https://github.com/openwrt/openwrt/pull/21158
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ath79/image/tiny-tp-link.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk
index 7e61eb96af..7dda526008 100644
--- a/target/linux/ath79/image/tiny-tp-link.mk
+++ b/target/linux/ath79/image/tiny-tp-link.mk
@@ -9,6 +9,7 @@ define Device/tplink_rex5x-v1
   DEVICE_COMPAT_VERSION := 2.0
   DEVICE_COMPAT_MESSAGE := Partition layout has changed compared to older versions by utilizing unused flash. \
     Upgrade via sysupgrade mechanism (-F) will only work if flashed image still fits to the size of old partition (6016 KiB).
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
 endef
 
 define Device/tplink_re355-v1
@@ -40,6 +41,7 @@ define Device/tplink_re450-v2
   DEVICE_COMPAT_VERSION := 2.0
   DEVICE_COMPAT_MESSAGE := Partition layout has changed compared to older versions by utilizing unused flash. \
     Upgrade via sysupgrade mechanism (-F) will only work if flashed image still fits to the size of old partition (6016 KiB).
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
   TPLINK_BOARD_ID := RE450-V2
   LOADER_TYPE := elf
 endef



From lede-commits at lists.infradead.org  Mon Dec 22 09:52:17 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 22 Dec 2025 12:52:17 -0500
Subject: [openwrt/openwrt]  ath79: fix build of big images for TP RE355v1,
 RE450v1 & v2
In-Reply-To: <176642593780.1257381.11277130212450295517@git-01.infra.openwrt.org>
References: <176642593780.1257381.11277130212450295517@git-01.infra.openwrt.org>
Message-ID: <mailman.38400.1766425942.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/c3cf33f98bbe1bf4394e331e84da6481788338c1

commit c3cf33f98bbe1bf4394e331e84da6481788338c1
Author: Radek Dost?l <rd at radekdostal.com>
AuthorDate: Sun Dec 14 10:37:06 2025 +0100

    ath79: fix build of big images for TP RE355v1, RE450v1 & v2
    
    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
    ebd5e5fb5359 ("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 e768731dc8e9 ("ath79: switch TP-Link RE355 v1, RE450 v1 and
    RE450 v2 to mtd-concat").
    
    Signed-off-by: Radek Dost?l <rd at radekdostal.com>
    Link: https://github.com/openwrt/openwrt/pull/21158
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit bdbb4bdfa030add96abef59b43adadf1050d678d)
---
 target/linux/ath79/image/tiny-tp-link.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk
index 7e61eb96af..7dda526008 100644
--- a/target/linux/ath79/image/tiny-tp-link.mk
+++ b/target/linux/ath79/image/tiny-tp-link.mk
@@ -9,6 +9,7 @@ define Device/tplink_rex5x-v1
   DEVICE_COMPAT_VERSION := 2.0
   DEVICE_COMPAT_MESSAGE := Partition layout has changed compared to older versions by utilizing unused flash. \
     Upgrade via sysupgrade mechanism (-F) will only work if flashed image still fits to the size of old partition (6016 KiB).
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
 endef
 
 define Device/tplink_re355-v1
@@ -40,6 +41,7 @@ define Device/tplink_re450-v2
   DEVICE_COMPAT_VERSION := 2.0
   DEVICE_COMPAT_MESSAGE := Partition layout has changed compared to older versions by utilizing unused flash. \
     Upgrade via sysupgrade mechanism (-F) will only work if flashed image still fits to the size of old partition (6016 KiB).
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
   TPLINK_BOARD_ID := RE450-V2
   LOADER_TYPE := elf
 endef



From lede-commits at lists.infradead.org  Mon Dec 22 15:27:19 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 22 Dec 2025 18:27:19 -0500
Subject: [openwrt/openwrt]  realtek: image: add rt-loader-no-uimage recipe
In-Reply-To: <176644603883.3923602.11363601475829454352@git-01.infra.openwrt.org>
References: <176644603883.3923602.11363601475829454352@git-01.infra.openwrt.org>
Message-ID: <mailman.38428.1766446045.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/74b5a63cf954219289e35a00d70eb09355b5d5ec

commit 74b5a63cf954219289e35a00d70eb09355b5d5ec
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Mon Dec 22 09:57:52 2025 +0000

    realtek: image: add rt-loader-no-uimage recipe
    
    Add a new recipe 'rt-loader-no-uimage' that passes the kernel load
    address to rt-loader, causing it to use that instead of it's initial run
    address.
    
    The usual behavior is fine for uImages where the load address is
    predefined in the header, U-boot loads the image to that address and
    then runs it, rt-loader just takes over that address. For non-uImage
    instead, the address is tightly coupled to where the image has been
    transferred during serial or TFTP upload. This may not be possible on
    several devices. Passing a separate kernel load address to rt-loader
    decouples that and avoids taking the pain to change the load address of
    the kernel itself.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21248
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/image/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile
index 786dd12710..db1776340e 100644
--- a/target/linux/realtek/image/Makefile
+++ b/target/linux/realtek/image/Makefile
@@ -30,6 +30,13 @@ define Build/rt-loader
 	mv "$@.new" "$@"
 endef
 
+define Build/rt-loader-no-uimage
+        $(MAKE) all clean -C rt-loader CROSS_COMPILE="$(TARGET_CROSS)" \
+                KERNEL_ADDR="$(KERNEL_LOADADDR)" KERNEL_IMG_IN="$@" \
+                KERNEL_IMG_OUT="$@.new" BUILD_DIR="$@.build"
+        mv "$@.new" "$@"
+endef
+
 define Build/zyxel-vers
        ( echo VERS;\
        for hw in $(ZYXEL_VERS); do\



From lede-commits at lists.infradead.org  Mon Dec 22 15:27:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 22 Dec 2025 18:27:18 -0500
Subject: [openwrt/openwrt]  realtek: rt-loader: allow arbitrary kernel load
 address
In-Reply-To: <176644603883.3923602.11363601475829454352@git-01.infra.openwrt.org>
References: <176644603883.3923602.11363601475829454352@git-01.infra.openwrt.org>
Message-ID: <mailman.38429.1766446045.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b1c1b713f004a74a0138c6f67851c39ce1038112

commit b1c1b713f004a74a0138c6f67851c39ce1038112
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sun Dec 21 23:13:10 2025 +0000

    realtek: rt-loader: allow arbitrary kernel load address
    
    rt-loader currently has two operation modes, piggy-backed and
    standalone. In standalone mode, the kernel load address is read from the
    uImage in flash. In piggy-backed mode, rt-loader instead uses its
    initial run address (aka run address during first run) as the kernel
    load address. This is safe and works fine for all devices either using
    U-boot or having no issue uploading an image to the default kernel load
    address 0x80100000.
    
    To extend usecases, allow to specify a kernel load address when
    building rt-loader. In this case, rt-loader uses this address instead of
    the address inferred at runtime.
    
    On certain Zyxel devices, this allows to upload and boot an rt-loader
    piggy-backed image to an alternate address but keep the default kernel
    load address of 0x80100000. BootExt on these devices occupies memory
    above and will crash during transfer when this address is used as upload
    location. Using this extension, the image can be uploaded to e.g.
    0x80300000 and rt-loader will use 0x80100000 as the final load address.
    This avoid taking the pain the adjust the load address of the kernel
    itself.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21248
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/image/rt-loader/Makefile   | 19 ++++++++++++++++++-
 target/linux/realtek/image/rt-loader/src/main.c |  3 +++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/target/linux/realtek/image/rt-loader/Makefile b/target/linux/realtek/image/rt-loader/Makefile
index a21394420b..198506bce8 100644
--- a/target/linux/realtek/image/rt-loader/Makefile
+++ b/target/linux/realtek/image/rt-loader/Makefile
@@ -7,9 +7,15 @@
 #
 # KERNEL_IMG_IN:	The filename of an LZMA compressed kernel. If given the loader
 #			and the kernel will be concatenated (piggy back loading).
-# FLASH_ADDR:		The kernel address in the ROM. If given, the loeader will be
+# FLASH_ADDR:		The kernel address in the ROM. If given, the loader will be
 #			created standalone and search a LZMA compressed uImage on the
 #			target device starting from this address.
+# KERNEL_ADDR:		The to-be-used kernel load address to which rt-loader will load
+# 			the kernel and execute it. If not given, rt-loader will use its
+# 			initial run address for this (which is the uImage load address
+# 			when using U-boot images) For non-uImage, this uses an arbitrary
+# 			load address which is independent of rt-loader's initial run
+# 			address.
 # KERNEL_IMG_OUT:	The filename of the kernel image with the rt-loader prepended.
 #			If not given it will be created as image.bin into the BUILD_DIR.
 # BUILD_DIR:		The temporary build dir. If not given it will be set to "build".
@@ -27,6 +33,12 @@
 #   mv "$@.new" "$@"
 # endef
 #
+# define Build/rt-loader-non-uImage
+#   $(MAKE) all clean -C rt-loader CROSS_COMPILE="$(TARGET_CROSS)" \
+#           KERNEL_ADDR="$(KERNEL_LOADADDR)" KERNEL_IMG_IN="$@" \
+#           KERNEL_IMG_OUT="$@.new" BUILD_DIR="$@.build"
+#   mv "$@.new" "$@"
+#
 # define Build/rt-loader-standalone
 #   $(MAKE) all clean -C rt-loader CROSS_COMPILE="$(TARGET_CROSS)" \
 #	    FLASH_ADDR=$(FLASH_ADDR) KERNEL_IMG_OUT="$@.new" BUILD_DIR="$@.build"
@@ -48,10 +60,14 @@
 #   KERNEL/rt-loader := rt-loader-standalone
 #   KERNEL := kernel-bin | append-dtb | rt-compress | uImage lzma
 # endef
+#
 
 FLASH_ADDR_NONE	:= 0x0
 FLASH_ADDR	?= $(FLASH_ADDR_NONE)
 
+KERNEL_ADDR_NONE := 0x0
+KERNEL_ADDR 	?= $(KERNEL_ADDR_NONE)
+
 CC		:= $(CROSS_COMPILE)gcc
 LD		:= $(CROSS_COMPILE)ld
 OBJCOPY		:= $(CROSS_COMPILE)objcopy
@@ -59,6 +75,7 @@ OBJDUMP		:= $(CROSS_COMPILE)objdump
 
 CFLAGS		= -fpic -mabicalls -O2 -fno-builtin-printf -Iinclude
 CFLAGS		+= -DFLASH_ADDR=$(FLASH_ADDR)
+CFLAGS		+= -DKERNEL_ADDR=$(KERNEL_ADDR)
 
 ASFLAGS		= -fpic -msoft-float -Iinclude
 
diff --git a/target/linux/realtek/image/rt-loader/src/main.c b/target/linux/realtek/image/rt-loader/src/main.c
index acdd782ffd..6ea301159f 100644
--- a/target/linux/realtek/image/rt-loader/src/main.c
+++ b/target/linux/realtek/image/rt-loader/src/main.c
@@ -168,6 +168,7 @@ void main(unsigned long reg_a0, unsigned long reg_a1,
 	  unsigned long reg_a2, unsigned long reg_a3)
 {
 	void *flash_start = (void *)FLASH_ADDR; /* from makefile */
+	void *kernel_addr = (void *)KERNEL_ADDR; /* from makefile */
 	entry_func_t fn;
 
 	/*
@@ -188,6 +189,8 @@ void main(unsigned long reg_a0, unsigned long reg_a1,
 	 */
 	if (flash_start)
 		load_kernel(flash_start);
+	else if (kernel_addr)
+		_kernel_load_addr = kernel_addr;
 
 	/*
 	 * Finally extract the attached kernel image to the load address. This is



From lede-commits at lists.infradead.org  Tue Dec 23 06:38:08 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 09:38:08 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: Add support ASUS RT-AX57M
In-Reply-To: <176650068827.1913293.1683065596009374809@git-01.infra.openwrt.org>
References: <176650068827.1913293.1683065596009374809@git-01.infra.openwrt.org>
Message-ID: <mailman.38805.1766500694.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/114b5c2063576d0ce1944d3308280f2ecd72e969

commit 114b5c2063576d0ce1944d3308280f2ecd72e969
Author: Garrett Mesmer <garrettmesm at gmail.com>
AuthorDate: Tue Jul 8 12:50:14 2025 +0300

    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 at gmail.com>
    Co-authored-by: Oleg S <remittor at gmail.com>
    Signed-off-by: Oleg S <remittor at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20491
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../linux/mediatek/dts/mt7981b-asus-rt-ax57m.dts   | 334 +++++++++++++++++++++
 .../filogic/base-files/etc/board.d/01_leds         |   1 +
 .../etc/hotplug.d/ieee80211/11_fix_wifi_mac        |   1 +
 .../filogic/base-files/lib/upgrade/platform.sh     |   2 +
 target/linux/mediatek/image/filogic.mk             |  31 ++
 5 files changed, 369 insertions(+)

diff --git a/target/linux/mediatek/dts/mt7981b-asus-rt-ax57m.dts b/target/linux/mediatek/dts/mt7981b-asus-rt-ax57m.dts
new file mode 100644
index 0000000000..2a5f544f2c
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-asus-rt-ax57m.dts
@@ -0,0 +1,334 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7981b.dtsi"
+/ {
+	model = "ASUS RT-AX57M";
+	compatible = "asus,rt-ax57m", "mediatek,mt7981";
+
+	aliases {
+		serial0 = &uart0;
+		label-mac-device = &gmac0;
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-override = "";
+	};
+
+	memory at 40000000 {
+		reg = <0 0x40000000 0 0x10000000>;
+		device_type = "memory";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 4 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		wan-blue {
+			function = LED_FUNCTION_WAN;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 5 GPIO_ACTIVE_LOW>;
+		};
+
+		wan-red {
+			function = LED_FUNCTION_WAN;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+		};
+
+		lan {
+			function = LED_FUNCTION_LAN;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+		};		
+
+		wlan24 {
+			function = LED_FUNCTION_WLAN_2GHZ;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		wlan5 {
+			function = LED_FUNCTION_WLAN_5GHZ;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+	};
+
+	timer {
+		clock-frequency = <13000000>;
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&eth {
+	status = "okay";
+
+	gmac0: mac at 0 {
+		/* LAN */
+		compatible = "mediatek,eth-mac";
+		reg = <0>;
+		nvmem-cells = <&macaddr_factory_4>;
+		nvmem-cell-names = "mac-address";
+		phy-mode = "2500base-x";
+
+		fixed-link {
+			speed = <2500>;
+			full-duplex;
+			pause;
+		};
+	};
+
+	mdio: mdio-bus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		switch at 1f {
+			compatible = "mediatek,mt7531";
+			reg = <31>;
+			reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port at 0 {
+					reg = <0>;
+					label = "lan4";
+				};
+
+				port at 1 {
+					reg = <1>;
+					label = "lan3";
+				};
+
+				port at 2 {
+					reg = <2>;
+					label = "lan2";
+				};
+
+				port at 3 {
+					reg = <3>;
+					label = "lan1";
+				};
+
+				port at 4 {
+					reg = <4>;
+					label = "wan";
+				};
+
+				port at 6 {
+					reg = <6>;
+					label = "cpu";
+					ethernet = <&gmac0>;
+					phy-mode = "2500base-x";
+
+					fixed-link {
+						speed = <2500>;
+						full-duplex;
+						pause;
+					};
+				};
+			};
+		};
+	};
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_flash_pins>;
+	status = "okay";
+
+	spi_nand_flash: flash at 0 {
+		compatible = "u-boot-dont-touch-spi-nand";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0>;
+
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+
+		/*
+		 * ASUS bootloader tries to replace the partitions defined in
+		 * Device Tree and by that also deletes all additional properties
+		 * needed for UBI and NVMEM-on-UBI.
+		 * Prevent this from happening by tricking the loader to delete and
+		 * replace a bait node instead (works with older bootloaders).
+		 */
+		partitions: dummy {
+			compatible = "u-boot-dummy-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				reg = <0x0 0x0>;
+				label = "remove_me";
+			};
+		};
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				reg = <0x0 0x400000>;
+				label = "bootloader";
+				read-only;
+			};
+
+			partition at 400000 {
+				compatible = "linux,ubi";
+				reg = <0x400000 0x7c00000>;
+				label = "UBI_DEV";
+
+				volumes {
+					ubi_factory: ubi-volume-factory {
+						volname = "Factory";
+					};
+				};
+			};
+		};
+	};
+};
+
+&ubi_factory {
+	nvmem-layout {
+		compatible = "fixed-layout";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		eeprom_factory_0: eeprom at 0 {
+			reg = <0x0 0x1000>;
+		};
+
+		macaddr_factory_4: macaddr at 4 {
+			reg = <0x4 0x6>;
+		};
+
+		precal_factory_1010: precal at 1010 {
+			reg = <0x1010 0x6f010>;
+		};		
+	};
+};
+
+&pio {
+	i2c_pins: i2c-pins-g0 {
+		mux {
+			function = "i2c";
+			groups = "i2c0_0";
+		};
+	};
+
+	pcm_pins: pcm-pins-g0 {
+		mux {
+			function = "pcm";
+			groups = "pcm";
+		};
+	};
+
+	pwm0_pin: pwm0-pin-g0 {
+		mux {
+			function = "pwm";
+			groups = "pwm0_0";
+		};
+	};
+
+	pwm1_pin: pwm1-pin-g1 {
+		mux {
+			function = "pwm";
+			groups = "pwm1_1";
+		};
+	};
+
+	pwm2_pin: pwm2-pin {
+		mux {
+			function = "pwm";
+			groups = "pwm2";
+		};
+	};
+
+	spi0_flash_pins: spi0-pins {
+		mux {
+			function = "spi";
+			groups = "spi0", "spi0_wp_hold";
+		};
+
+		conf-pu {
+			pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
+		};
+
+		conf-pd {
+			pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
+		};
+	};
+
+	spic_pins: spi1-pins {
+		mux {
+			function = "spi";
+			groups = "spi1_1";
+		};
+	};
+
+	uart1_pins: uart1-pins-g1 {
+		mux {
+			function = "uart";
+			groups = "uart1_1";
+		};
+	};
+
+	uart2_pins: uart2-pins-g1 {
+		mux {
+			function = "uart";
+			groups = "uart2_1";
+		};
+	};
+};
+
+&watchdog {
+	status = "okay";
+};
+
+&wifi {
+	nvmem-cells = <&eeprom_factory_0>, <&precal_factory_1010>;
+	nvmem-cell-names = "eeprom", "precal";
+
+	status = "okay";
+};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
index 3ee6967f09..bb8283a3d0 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
@@ -21,6 +21,7 @@ acer,predator-w6x-ubootmod)
 	ucidef_set_led_netdev "wan" "wan" "rgb:status" "eth1"
 	;;
 asus,rt-ax52|\
+asus,rt-ax57m|\
 snr,snr-cpe-ax2)
 	ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "link tx rx"
 	;;
diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
index 1feeb6a435..8ced69c152 100644
--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
@@ -44,6 +44,7 @@ case "$board" in
 			/sys${DEVPATH}/macaddress
 		;;
 	asus,rt-ax52|\
+	asus,rt-ax57m|\
 	asus,tuf-ax4200|\
 	asus,tuf-ax4200q|\
 	asus,tuf-ax6000)
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index c7d6e9b39b..8ebbc7326b 100644
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -141,6 +141,7 @@ platform_do_upgrade() {
 		emmc_do_upgrade "$1"
 		;;
 	asus,rt-ax52|\
+	asus,rt-ax57m|\
 	asus,rt-ax59u|\
 	asus,tuf-ax4200|\
 	asus,tuf-ax4200q|\
@@ -369,6 +370,7 @@ platform_pre_upgrade() {
 
 	case "$board" in
 	asus,rt-ax52|\
+	asus,rt-ax57m|\
 	asus,rt-ax59u|\
 	asus,tuf-ax4200|\
 	asus,tuf-ax4200q|\
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 64e378997b..8c344f6789 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -392,6 +392,37 @@ endif
 endef
 TARGET_DEVICES += asus_rt-ax52
 
+define Device/asus_rt-ax57m
+  DEVICE_VENDOR := ASUS
+  DEVICE_MODEL := RT-AX57M
+  DEVICE_ALT0_VENDOR := ASUS
+  DEVICE_ALT0_MODEL := RT-AX54HP
+  DEVICE_ALT0_VARIANT := V2
+  DEVICE_ALT1_VENDOR := ASUS
+  DEVICE_ALT1_MODEL := RT-AX1800HP
+  DEVICE_ALT1_VARIANT := V2
+  DEVICE_ALT2_VENDOR := ASUS
+  DEVICE_ALT2_MODEL := RT-AX1800S
+  DEVICE_ALT2_VARIANT := V2
+  DEVICE_ALT3_VENDOR := ASUS
+  DEVICE_ALT3_MODEL := RT-AX3000S
+  DEVICE_DTS := mt7981b-asus-rt-ax57m
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+  IMAGES := sysupgrade.bin
+  KERNEL := kernel-bin | lzma | \
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+  KERNEL_INITRAMFS := kernel-bin | lzma | \
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb  with-initrd | pad-to 64k
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ifeq ($(IB),)
+  ARTIFACTS := initramfs.trx
+  ARTIFACT/initramfs.trx := append-image-stage initramfs-kernel.bin | \
+	uImage none | asus-trx -v 3 -n $$(DEVICE_MODEL)
+endif
+endef
+TARGET_DEVICES += asus_rt-ax57m
+
 define Device/asus_rt-ax59u
   DEVICE_VENDOR := ASUS
   DEVICE_MODEL := RT-AX59U



From lede-commits at lists.infradead.org  Tue Dec 23 06:52:14 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 09:52:14 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: asus,rt-ax57m: remove unused
 pinctrl groups
In-Reply-To: <176650153419.2005769.11424321989440457151@git-01.infra.openwrt.org>
References: <176650153419.2005769.11424321989440457151@git-01.infra.openwrt.org>
Message-ID: <mailman.38811.1766501538.2093109.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f79a2a57f518fbf644903016f617ee40108ac0e9

commit f79a2a57f518fbf644903016f617ee40108ac0e9
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Tue Dec 23 14:49:48 2025 +0000

    mediatek: filogic: asus,rt-ax57m: remove unused pinctrl groups
    
    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 at makrotopia.org>
---
 .../linux/mediatek/dts/mt7981b-asus-rt-ax57m.dts   | 56 ----------------------
 1 file changed, 56 deletions(-)

diff --git a/target/linux/mediatek/dts/mt7981b-asus-rt-ax57m.dts b/target/linux/mediatek/dts/mt7981b-asus-rt-ax57m.dts
index 2a5f544f2c..c3644a68eb 100644
--- a/target/linux/mediatek/dts/mt7981b-asus-rt-ax57m.dts
+++ b/target/linux/mediatek/dts/mt7981b-asus-rt-ax57m.dts
@@ -246,41 +246,6 @@
 };
 
 &pio {
-	i2c_pins: i2c-pins-g0 {
-		mux {
-			function = "i2c";
-			groups = "i2c0_0";
-		};
-	};
-
-	pcm_pins: pcm-pins-g0 {
-		mux {
-			function = "pcm";
-			groups = "pcm";
-		};
-	};
-
-	pwm0_pin: pwm0-pin-g0 {
-		mux {
-			function = "pwm";
-			groups = "pwm0_0";
-		};
-	};
-
-	pwm1_pin: pwm1-pin-g1 {
-		mux {
-			function = "pwm";
-			groups = "pwm1_1";
-		};
-	};
-
-	pwm2_pin: pwm2-pin {
-		mux {
-			function = "pwm";
-			groups = "pwm2";
-		};
-	};
-
 	spi0_flash_pins: spi0-pins {
 		mux {
 			function = "spi";
@@ -299,27 +264,6 @@
 			bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
 		};
 	};
-
-	spic_pins: spi1-pins {
-		mux {
-			function = "spi";
-			groups = "spi1_1";
-		};
-	};
-
-	uart1_pins: uart1-pins-g1 {
-		mux {
-			function = "uart";
-			groups = "uart1_1";
-		};
-	};
-
-	uart2_pins: uart2-pins-g1 {
-		mux {
-			function = "uart";
-			groups = "uart2_1";
-		};
-	};
 };
 
 &watchdog {



From lede-commits at lists.infradead.org  Tue Dec 23 08:50:26 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 11:50:26 -0500
Subject: [openwrt/openwrt]  realtek: phy: reorganize package handling
In-Reply-To: <176650862641.3755553.7200903346068068161@git-01.infra.openwrt.org>
References: <176650862641.3755553.7200903346068068161@git-01.infra.openwrt.org>
Message-ID: <mailman.38848.1766508632.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/53dfb3e2e8e9726a6c2540932a7b5ebe3c36fd84

commit 53dfb3e2e8e9726a6c2540932a7b5ebe3c36fd84
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Wed Dec 17 20:07:36 2025 +0100

    realtek: phy: reorganize package handling
    
    With kernel 6.18 the package shared structure will be hidden from
    the phy drivers. Workaround that in advance by providing a shared
    private structure that covers all information that is needed for
    normal operation.
    
    For further simplification provide a new join() function that takes
    care of a consistent initialization.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21204
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/phy/rtl83xx-phy.c       | 65 +++++++++++++++-------
 1 file changed, 45 insertions(+), 20 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
index 3281c5d7ad..a4e19bf399 100644
--- a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
+++ b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
@@ -53,13 +53,51 @@ extern struct rtl83xx_soc_info soc_info;
 #define RTL821X_MEDIA_PAGE_FIBRE	3
 #define RTL821X_MEDIA_PAGE_INTERNAL	8
 
+#define RTL821X_JOIN_FIRST		0
+#define RTL821X_JOIN_LAST		1
+#define RTL821X_JOIN_OTHER		2
+
 static const struct firmware rtl838x_8380_fw;
 static const struct firmware rtl838x_8214fc_fw;
 static const struct firmware rtl838x_8218b_fw;
 
+struct rtl821x_shared_priv {
+	int base_addr;
+	int ports;
+};
+
+/* TODO: for kernel 6.18 drop this function and use it from phy_package library instead */
+static void *phy_package_get_priv(struct phy_device *phydev)
+{
+	return phydev->shared->priv;
+}
+
+static int rtl821x_package_join(struct phy_device *phydev, int ports)
+{
+	struct rtl821x_shared_priv *shared_priv;
+	int base_addr = phydev->mdio.addr & ~(ports - 1);
+
+	devm_phy_package_join(&phydev->mdio.dev, phydev, base_addr,
+			      sizeof(struct rtl821x_shared_priv));
+
+	shared_priv = phy_package_get_priv(phydev);
+	shared_priv->base_addr = base_addr;
+	shared_priv->ports++;
+
+	if (shared_priv->ports == 1)
+		return RTL821X_JOIN_FIRST;
+
+	if (shared_priv->ports == ports)
+		return RTL821X_JOIN_LAST;
+
+	return RTL821X_JOIN_OTHER;
+}
+
 static inline struct phy_device *get_package_phy(struct phy_device *phydev, int port)
 {
-	return mdiobus_get_phy(phydev->mdio.bus, phydev->shared->base_addr + port);
+	struct rtl821x_shared_priv *shared_priv = phy_package_get_priv(phydev);
+
+	return mdiobus_get_phy(phydev->mdio.bus, shared_priv->base_addr + port);
 }
 
 static inline struct phy_device *get_base_phy(struct phy_device *phydev)
@@ -839,11 +877,9 @@ static const struct sfp_upstream_ops rtl8214fc_sfp_ops = {
 
 static int rtl8214fc_phy_probe(struct phy_device *phydev)
 {
-	int base_addr = phydev->mdio.addr & ~3;
 	int ret = 0;
 
-	devm_phy_package_join(&phydev->mdio.dev, phydev, base_addr, 0);
-	if (phydev->mdio.addr == base_addr + 3) {
+	if (rtl821x_package_join(phydev, 4) == RTL821X_JOIN_LAST) {
 		if (soc_info.family == RTL8380_FAMILY_ID)
 			ret = rtl8380_configure_rtl8214fc(get_base_phy(phydev));
 		if (ret)
@@ -855,10 +891,7 @@ static int rtl8214fc_phy_probe(struct phy_device *phydev)
 
 static int rtl8214c_phy_probe(struct phy_device *phydev)
 {
-	int base_addr = phydev->mdio.addr & ~3;
-
-	devm_phy_package_join(&phydev->mdio.dev, phydev, base_addr, 0);
-	if (phydev->mdio.addr == base_addr + 3)
+	if (rtl821x_package_join(phydev, 4) == RTL821X_JOIN_LAST)
 		return rtl8380_configure_rtl8214c(get_base_phy(phydev));
 
 	return 0;
@@ -866,10 +899,7 @@ static int rtl8214c_phy_probe(struct phy_device *phydev)
 
 static int rtl8218b_ext_phy_probe(struct phy_device *phydev)
 {
-	int base_addr = phydev->mdio.addr & ~7;
-
-	devm_phy_package_join(&phydev->mdio.dev, phydev, base_addr, 0);
-	if (phydev->mdio.addr == base_addr + 7) {
+	if (rtl821x_package_join(phydev, 8) == RTL821X_JOIN_LAST) {
 		if (soc_info.family == RTL8380_FAMILY_ID)
 			return rtl8380_configure_ext_rtl8218b(get_base_phy(phydev));
 	}
@@ -879,15 +909,12 @@ static int rtl8218b_ext_phy_probe(struct phy_device *phydev)
 
 static int rtl8218b_int_phy_probe(struct phy_device *phydev)
 {
-	int base_addr = phydev->mdio.addr & ~7;
-
 	if (soc_info.family != RTL8380_FAMILY_ID)
 		return -ENODEV;
-	if (base_addr >= 24)
+	if (phydev->mdio.addr >= 24)
 		return -ENODEV;
 
-	devm_phy_package_join(&phydev->mdio.dev, phydev, base_addr, 0);
-	if (phydev->mdio.addr == base_addr + 7)
+	if (rtl821x_package_join(phydev, 8) == RTL821X_JOIN_LAST)
 		return rtl8380_configure_int_rtl8218b(get_base_phy(phydev));
 
 	return 0;
@@ -895,9 +922,7 @@ static int rtl8218b_int_phy_probe(struct phy_device *phydev)
 
 static int rtl8218x_phy_probe(struct phy_device *phydev)
 {
-	int base_addr = phydev->mdio.addr & ~7;
-
-	devm_phy_package_join(&phydev->mdio.dev, phydev, base_addr, 0);
+	rtl821x_package_join(phydev, 8);
 
 	return 0;
 }



From lede-commits at lists.infradead.org  Tue Dec 23 09:00:19 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:00:19 -0500
Subject: [openwrt/openwrt]  realtek: ethernet: drop devm_request_mem_region()
In-Reply-To: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
References: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
Message-ID: <mailman.38851.1766509223.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/48305ccccee9aa439f106c1881b053e9e32b9067

commit 48305ccccee9aa439f106c1881b053e9e32b9067
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 16 13:28:56 2025 +0100

    realtek: ethernet: drop devm_request_mem_region()
    
    The ethernet driver currently "requests" the memory region of the
    ethernet device according to the DTS settings. This is wrong in
    two ways:
    
    - The DTS uses arbitrary regions out of the switchcore memory
    - The variable is afterwards overwritten by DMA allocation
    
    Drop it.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21183
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/ethernet/rtl838x_eth.c      | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index b30c74b5d6..eb110840e8 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -1647,7 +1647,6 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 	struct net_device *dev;
 	struct device_node *dn = pdev->dev.of_node;
 	struct rtl838x_eth_priv *priv;
-	struct resource *res, *mem;
 	phy_interface_t phy_mode;
 	struct phylink *phylink;
 	u8 mac_addr[ETH_ALEN];
@@ -1674,23 +1673,6 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 	SET_NETDEV_DEV(dev, &pdev->dev);
 	priv = netdev_priv(dev);
 
-	/* obtain buffer memory space */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res) {
-		mem = devm_request_mem_region(&pdev->dev, res->start,
-					      resource_size(res), res->name);
-		if (!mem) {
-			dev_err(&pdev->dev, "cannot request memory space\n");
-			return -ENXIO;
-		}
-
-		dev->mem_start = mem->start;
-		dev->mem_end   = mem->end;
-	} else {
-		dev_err(&pdev->dev, "cannot request IO resource\n");
-		return -ENXIO;
-	}
-
 	/* Allocate buffer memory */
 	priv->membase = dmam_alloc_coherent(&pdev->dev, rxrings * rxringlen * RING_BUFFER +
 					    sizeof(struct ring_b) + sizeof(struct notify_b),



From lede-commits at lists.infradead.org  Tue Dec 23 09:00:21 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:00:21 -0500
Subject: [openwrt/openwrt]  realtek: ethernet: provide soc family in register
 config
In-Reply-To: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
References: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
Message-ID: <mailman.38852.1766509224.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/bbafac0816d46b4868a3360469483dfd271c046b

commit bbafac0816d46b4868a3360469483dfd271c046b
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 16 10:58:22 2025 +0100

    realtek: ethernet: provide soc family in register config
    
    The ethernet driver currently determines the family from the soc_info
    structure. To avoid the dependency add the family to the local register
    structure.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21183
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c | 4 ++++
 target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index eb110840e8..c475036958 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -448,6 +448,7 @@ static irqreturn_t rtl93xx_net_irq(int irq, void *dev_id)
 }
 
 static const struct rtl838x_eth_reg rtl838x_reg = {
+	.family_id = RTL8380_FAMILY_ID,
 	.net_irq = rtl83xx_net_irq,
 	.mac_port_ctrl = rtl838x_mac_port_ctrl,
 	.dma_if_intr_sts = RTL838X_DMA_IF_INTR_STS,
@@ -473,6 +474,7 @@ static const struct rtl838x_eth_reg rtl838x_reg = {
 };
 
 static const struct rtl838x_eth_reg rtl839x_reg = {
+	.family_id = RTL8390_FAMILY_ID,
 	.net_irq = rtl83xx_net_irq,
 	.mac_port_ctrl = rtl839x_mac_port_ctrl,
 	.dma_if_intr_sts = RTL839X_DMA_IF_INTR_STS,
@@ -498,6 +500,7 @@ static const struct rtl838x_eth_reg rtl839x_reg = {
 };
 
 static const struct rtl838x_eth_reg rtl930x_reg = {
+	.family_id = RTL9300_FAMILY_ID,
 	.net_irq = rtl93xx_net_irq,
 	.mac_port_ctrl = rtl930x_mac_port_ctrl,
 	.dma_if_intr_rx_runout_sts = RTL930X_DMA_IF_INTR_RX_RUNOUT_STS,
@@ -529,6 +532,7 @@ static const struct rtl838x_eth_reg rtl930x_reg = {
 };
 
 static const struct rtl838x_eth_reg rtl931x_reg = {
+	.family_id = RTL9310_FAMILY_ID,
 	.net_irq = rtl93xx_net_irq,
 	.mac_port_ctrl = rtl931x_mac_port_ctrl,
 	.dma_if_intr_rx_runout_sts = RTL931X_DMA_IF_INTR_RX_RUNOUT_STS,
diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
index 54de5ff9b0..9b94140ca9 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
@@ -436,6 +436,7 @@ struct p_hdr;
 struct dsa_tag;
 
 struct rtl838x_eth_reg {
+	int family_id;
 	irqreturn_t (*net_irq)(int irq, void *dev_id);
 	int (*mac_port_ctrl)(int port);
 	int dma_if_intr_sts;



From lede-commits at lists.infradead.org  Tue Dec 23 09:00:22 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:00:22 -0500
Subject: [openwrt/openwrt]  realtek: ethernet: switch to
 device_get_match_data()
In-Reply-To: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
References: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
Message-ID: <mailman.38853.1766509224.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/abb11b542f4dde3960f561ab4a11b95fae4a70f6

commit abb11b542f4dde3960f561ab4a11b95fae4a70f6
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 16 11:19:52 2025 +0100

    realtek: ethernet: switch to device_get_match_data()
    
    Now that the register configuration contains the family data derive it
    from the DTS via device_get_match_data().
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21183
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/ethernet/rtl838x_eth.c  | 32 +++++++++++++++-------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index c475036958..0508be11e3 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -1651,6 +1651,7 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 	struct net_device *dev;
 	struct device_node *dn = pdev->dev.of_node;
 	struct rtl838x_eth_priv *priv;
+	const struct rtl838x_eth_reg *matchdata;
 	phy_interface_t phy_mode;
 	struct phylink *phylink;
 	u8 mac_addr[ETH_ALEN];
@@ -1665,8 +1666,10 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	rxrings = (soc_info.family == RTL8380_FAMILY_ID
-			|| soc_info.family == RTL8390_FAMILY_ID) ? 8 : 32;
+	matchdata = (const struct rtl838x_eth_reg *)device_get_match_data(&pdev->dev);
+
+	rxrings = (matchdata->family_id == RTL8380_FAMILY_ID ||
+		   matchdata->family_id == RTL8390_FAMILY_ID) ? 8 : 32;
 	rxrings = rxrings > MAX_RXRINGS ? MAX_RXRINGS : rxrings;
 	rxringlen = MAX_ENTRIES / rxrings;
 	rxringlen = rxringlen > MAX_RXLEN ? MAX_RXLEN : rxringlen;
@@ -1676,6 +1679,7 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	SET_NETDEV_DEV(dev, &pdev->dev);
 	priv = netdev_priv(dev);
+	priv->r = matchdata;
 
 	/* Allocate buffer memory */
 	priv->membase = dmam_alloc_coherent(&pdev->dev, rxrings * rxringlen * RING_BUFFER +
@@ -1711,22 +1715,18 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 	switch (priv->family_id) {
 	case RTL8380_FAMILY_ID:
 		priv->cpu_port = RTL838X_CPU_PORT;
-		priv->r = &rtl838x_reg;
 		dev->netdev_ops = &rtl838x_eth_netdev_ops;
 		break;
 	case RTL8390_FAMILY_ID:
 		priv->cpu_port = RTL839X_CPU_PORT;
-		priv->r = &rtl839x_reg;
 		dev->netdev_ops = &rtl839x_eth_netdev_ops;
 		break;
 	case RTL9300_FAMILY_ID:
 		priv->cpu_port = RTL930X_CPU_PORT;
-		priv->r = &rtl930x_reg;
 		dev->netdev_ops = &rtl930x_eth_netdev_ops;
 		break;
 	case RTL9310_FAMILY_ID:
 		priv->cpu_port = RTL931X_CPU_PORT;
-		priv->r = &rtl931x_reg;
 		dev->netdev_ops = &rtl931x_eth_netdev_ops;
 		rtl931x_chip_init(priv);
 		break;
@@ -1842,10 +1842,22 @@ static void rtl838x_eth_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id rtl838x_eth_of_ids[] = {
-	{ .compatible = "realtek,rtl8380-eth" },
-	{ .compatible = "realtek,rtl8392-eth" },
-	{ .compatible = "realtek,rtl9301-eth" },
-	{ .compatible = "realtek,rtl9311-eth" },
+	{
+		.compatible = "realtek,rtl8380-eth",
+		.data = &rtl838x_reg,
+	},
+	{
+		.compatible = "realtek,rtl8392-eth",
+		.data = &rtl839x_reg,
+	},
+	{
+		.compatible = "realtek,rtl9301-eth",
+		.data = &rtl930x_reg,
+	},
+	{
+		.compatible = "realtek,rtl9311-eth",
+		.data = &rtl931x_reg,
+	},
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rtl838x_eth_of_ids);



From lede-commits at lists.infradead.org  Tue Dec 23 09:00:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:00:20 -0500
Subject: [openwrt/openwrt]  realtek: ethernet: relocate ethernet below
 switchcore in DTS
In-Reply-To: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
References: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
Message-ID: <mailman.38854.1766509224.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/20a25b9ffac228c05ba0b5fb0d524a8b013897c9

commit 20a25b9ffac228c05ba0b5fb0d524a8b013897c9
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 16 10:03:03 2025 +0100

    realtek: ethernet: relocate ethernet below switchcore in DTS
    
    The ethernet driver uses registers in the switchcore range.
    Rearrange the DTS nodes accordingly. This allows to make use
    of regmap with syscon_node_to_regmap(np->parent) later.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21183
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/dts/rtl838x.dtsi | 27 +++++++++++++--------------
 target/linux/realtek/dts/rtl839x.dtsi | 28 +++++++++++++---------------
 target/linux/realtek/dts/rtl930x.dtsi | 28 +++++++++++++---------------
 target/linux/realtek/dts/rtl931x.dtsi | 34 ++++++++++++++++------------------
 4 files changed, 55 insertions(+), 62 deletions(-)

diff --git a/target/linux/realtek/dts/rtl838x.dtsi b/target/linux/realtek/dts/rtl838x.dtsi
index 7af572aefc..8930476d9e 100644
--- a/target/linux/realtek/dts/rtl838x.dtsi
+++ b/target/linux/realtek/dts/rtl838x.dtsi
@@ -205,6 +205,19 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 
+		ethernet0: ethernet {
+			compatible = "realtek,rtl8380-eth";
+			interrupt-parent = <&intc>;
+			interrupts = <24 3>;
+			#interrupt-cells = <1>;
+			phy-mode = "internal";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
+
 		mdio_ctrl: mdio-controller {
 			compatible = "realtek,rtl8380-mdio", "realtek,otto-mdio";
 			#address-cells = <1>;
@@ -333,20 +346,6 @@
 		};
 	};
 
-	ethernet0: ethernet at 1b00a300 {
-		compatible = "realtek,rtl8380-eth";
-		reg = <0x1b00a300 0x100>;
-		interrupt-parent = <&intc>;
-		interrupts = <24 3>;
-		#interrupt-cells = <1>;
-		phy-mode = "internal";
-
-		fixed-link {
-			speed = <1000>;
-			full-duplex;
-		};
-	};
-
 	sram0: sram at 9f000000 {
 		compatible = "mmio-sram";
 		reg = <0x9f000000 0x10000>;
diff --git a/target/linux/realtek/dts/rtl839x.dtsi b/target/linux/realtek/dts/rtl839x.dtsi
index 7b6eeae1b1..c1acf66f60 100644
--- a/target/linux/realtek/dts/rtl839x.dtsi
+++ b/target/linux/realtek/dts/rtl839x.dtsi
@@ -213,6 +213,19 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 
+		ethernet0: ethernet {
+			compatible = "realtek,rtl8392-eth";
+			interrupt-parent = <&intc>;
+			interrupts = <24 3>;
+			#interrupt-cells = <1>;
+			phy-mode = "internal";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
+
 		mdio_ctrl: mdio-controller {
 			compatible = "realtek,rtl8392-mdio", "realtek,otto-mdio";
 			#address-cells = <1>;
@@ -334,21 +347,6 @@
 		};
 	};
 
-	ethernet0: ethernet at 1b00a300 {
-		compatible = "realtek,rtl8392-eth";
-		reg = <0x1b00a300 0x100>;
-
-		interrupt-parent = <&intc>;
-		interrupts = <24 3>;
-
-		phy-mode = "internal";
-
-		fixed-link {
-			speed = <1000>;
-			full-duplex;
-		};
-	};
-
 	sram0: sram at 9f000000 {
 		compatible = "mmio-sram";
 		reg = <0x9f000000 0x18000>;
diff --git a/target/linux/realtek/dts/rtl930x.dtsi b/target/linux/realtek/dts/rtl930x.dtsi
index 4a5dd2e17a..e8e61c287f 100644
--- a/target/linux/realtek/dts/rtl930x.dtsi
+++ b/target/linux/realtek/dts/rtl930x.dtsi
@@ -170,6 +170,19 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 
+		ethernet0: ethernet {
+			compatible = "realtek,rtl9301-eth";
+			interrupt-parent = <&intc>;
+			interrupts = <24 3>;
+			#interrupt-cells = <1>;
+			phy-mode = "internal";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
+
 		i2c_mst1: i2c at 36c {
 			compatible = "realtek,rtl9301-i2c";
 			reg = <0x36c 0x18>;
@@ -330,21 +343,6 @@
 		};
 	};
 
-	ethernet0: ethernet at 1b00a300 {
-		compatible = "realtek,rtl9301-eth";
-		reg = <0x1b00a300 0x100>;
-
-		interrupt-parent = <&intc>;
-		interrupts = <24 3>;
-
-		phy-mode = "internal";
-
-		fixed-link {
-			speed = <1000>;
-			full-duplex;
-		};
-	};
-
 	switch0: switch at 1b000000 {
 		compatible = "realtek,rtl83xx-switch";
 		status = "okay";
diff --git a/target/linux/realtek/dts/rtl931x.dtsi b/target/linux/realtek/dts/rtl931x.dtsi
index 6173f912b9..6655879524 100644
--- a/target/linux/realtek/dts/rtl931x.dtsi
+++ b/target/linux/realtek/dts/rtl931x.dtsi
@@ -200,6 +200,22 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 
+		ethernet0: ethernet {
+			compatible = "realtek,rtl9311-eth";
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SHARED 16 IRQ_TYPE_LEVEL_HIGH>;
+			#interrupt-cells = <3>;
+			phy-mode = "internal";
+
+			pinctrl-0 = <&pinmux_disable_ext_cpu>;
+			pinctrl-names = "default";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
+
 		i2c_mst1: i2c at 100c {
 			compatible = "realtek,rtl9310-i2c";
 			reg = <0x100c 0x18>;
@@ -389,24 +405,6 @@
 		};
 	};
 
-	ethernet0: ethernet at 1b00a300 {
-		status = "okay";
-		compatible = "realtek,rtl9311-eth";
-		reg = <0x1b00a300 0x100>;
-		interrupt-parent = <&gic>;
-		#interrupt-cells = <3>;
-		interrupts = <GIC_SHARED 16 IRQ_TYPE_LEVEL_HIGH>;
-		phy-mode = "internal";
-
-		pinctrl-0 = <&pinmux_disable_ext_cpu>;
-		pinctrl-names = "default";
-
-		fixed-link {
-			speed = <1000>;
-			full-duplex;
-		};
-	};
-
 	switch0: switch at 1b000000 {
 		compatible = "realtek,rtl83xx-switch";
 		status = "okay";



From lede-commits at lists.infradead.org  Tue Dec 23 09:00:23 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:00:23 -0500
Subject: [openwrt/openwrt]  realtek: ethernet: switch to new family_id
 location
In-Reply-To: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
References: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
Message-ID: <mailman.38857.1766509224.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e8dba8fb170f67d2a3d7a4874d336bc2831efc88

commit e8dba8fb170f67d2a3d7a4874d336bc2831efc88
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 16 11:23:58 2025 +0100

    realtek: ethernet: switch to new family_id location
    
    family_id is now part of the register set and automatically assigned
    during initialization. Make use of it. This is basically a conversion
    from priv->family_id to priv->r->family_id.
    
    While we are here convert some hard coded family ids to their proper
    defines.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21183
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/ethernet/rtl838x_eth.c  | 68 +++++++++++-----------
 1 file changed, 33 insertions(+), 35 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index 0508be11e3..26d6e72e41 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -194,7 +194,6 @@ struct rtl838x_eth_priv {
 	struct phylink_config phylink_config;
 	struct phylink_pcs pcs;
 	u16 id;
-	u16 family_id;
 	const struct rtl838x_eth_reg *r;
 	u8 cpu_port;
 	u32 lastEvent;
@@ -568,12 +567,12 @@ static void rtl838x_hw_reset(struct rtl838x_eth_priv *priv)
 	u32 int_saved, nbuf;
 	u32 reset_mask;
 
-	pr_info("RESETTING %x, CPU_PORT %d\n", priv->family_id, priv->cpu_port);
+	pr_info("RESETTING %x, CPU_PORT %d\n", priv->r->family_id, priv->cpu_port);
 	sw_w32_mask(0x3, 0, priv->r->mac_port_ctrl(priv->cpu_port));
 	mdelay(100);
 
 	/* Disable and clear interrupts */
-	if (priv->family_id == RTL9300_FAMILY_ID || priv->family_id == RTL9310_FAMILY_ID) {
+	if (priv->r->family_id == RTL9300_FAMILY_ID || priv->r->family_id == RTL9310_FAMILY_ID) {
 		sw_w32(0x00000000, priv->r->dma_if_intr_rx_runout_msk);
 		sw_w32(0xffffffff, priv->r->dma_if_intr_rx_runout_sts);
 		sw_w32(0x00000000, priv->r->dma_if_intr_rx_done_msk);
@@ -585,7 +584,7 @@ static void rtl838x_hw_reset(struct rtl838x_eth_priv *priv)
 		sw_w32(0xffffffff, priv->r->dma_if_intr_sts);
 	}
 
-	if (priv->family_id == RTL8390_FAMILY_ID) {
+	if (priv->r->family_id == RTL8390_FAMILY_ID) {
 		/* Preserve L2 notification and NBUF settings */
 		int_saved = sw_r32(priv->r->dma_if_intr_msk);
 		nbuf = sw_r32(RTL839X_DMA_IF_NBUF_BASE_DESC_ADDR_CTRL);
@@ -599,7 +598,7 @@ static void rtl838x_hw_reset(struct rtl838x_eth_priv *priv)
 	}
 
 	/* Reset NIC (SW_NIC_RST) and queues (SW_Q_RST) */
-	if (priv->family_id == RTL9300_FAMILY_ID || priv->family_id == RTL9310_FAMILY_ID)
+	if (priv->r->family_id == RTL9300_FAMILY_ID || priv->r->family_id == RTL9310_FAMILY_ID)
 		reset_mask = 0x6;
 	else
 		reset_mask = 0xc;
@@ -612,11 +611,11 @@ static void rtl838x_hw_reset(struct rtl838x_eth_priv *priv)
 	mdelay(100);
 
 	/* Setup Head of Line */
-	if (priv->family_id == RTL8380_FAMILY_ID)
+	if (priv->r->family_id == RTL8380_FAMILY_ID)
 		sw_w32(0, RTL838X_DMA_IF_RX_RING_SIZE);  /* Disabled on RTL8380 */
-	if (priv->family_id == RTL8390_FAMILY_ID)
+	if (priv->r->family_id == RTL8390_FAMILY_ID)
 		sw_w32(0xffffffff, RTL839X_DMA_IF_RX_RING_CNTR);
-	if (priv->family_id == RTL9300_FAMILY_ID || priv->family_id == RTL9310_FAMILY_ID) {
+	if (priv->r->family_id == RTL9300_FAMILY_ID || priv->r->family_id == RTL9310_FAMILY_ID) {
 		for (int i = 0; i < priv->rxrings; i++) {
 			int pos = (i % 3) * 10;
 
@@ -627,7 +626,7 @@ static void rtl838x_hw_reset(struct rtl838x_eth_priv *priv)
 	}
 
 	/* Re-enable link change interrupt */
-	if (priv->family_id == RTL8390_FAMILY_ID) {
+	if (priv->r->family_id == RTL8390_FAMILY_ID) {
 		sw_w32(0xffffffff, RTL839X_ISR_PORT_LINK_STS_CHG);
 		sw_w32(0xffffffff, RTL839X_ISR_PORT_LINK_STS_CHG + 4);
 		sw_w32(0xffffffff, RTL839X_IMR_PORT_LINK_STS_CHG);
@@ -729,12 +728,12 @@ static void rtl93xx_hw_en_rxtx(struct rtl838x_eth_priv *priv)
 	/* Restart TX/RX to CPU port, enable CRC checking */
 	sw_w32_mask(0x0, 0x3 | BIT(4), priv->r->mac_port_ctrl(priv->cpu_port));
 
-	if (priv->family_id == RTL9300_FAMILY_ID)
+	if (priv->r->family_id == RTL9300_FAMILY_ID)
 		sw_w32_mask(0, BIT(priv->cpu_port), RTL930X_L2_UNKN_UC_FLD_PMSK);
 	else
 		sw_w32_mask(0, BIT(priv->cpu_port), RTL931X_L2_UNKN_UC_FLD_PMSK);
 
-	if (priv->family_id == RTL9300_FAMILY_ID)
+	if (priv->r->family_id == RTL9300_FAMILY_ID)
 		sw_w32(0x217, priv->r->mac_force_mode_ctrl + priv->cpu_port * 4);
 	else
 		sw_w32(0x2a1d, priv->r->mac_force_mode_ctrl + priv->cpu_port * 4);
@@ -811,7 +810,7 @@ static int rtl838x_eth_open(struct net_device *ndev)
 	spin_lock_irqsave(&priv->lock, flags);
 	rtl838x_hw_reset(priv);
 	rtl838x_setup_ring_buffer(priv, ring);
-	if (priv->family_id == RTL8390_FAMILY_ID) {
+	if (priv->r->family_id == RTL8390_FAMILY_ID) {
 		rtl839x_setup_notify_ring_buffer(priv);
 		/* Make sure the ring structure is visible to the ASIC */
 		mb();
@@ -824,7 +823,7 @@ static int rtl838x_eth_open(struct net_device *ndev)
 	for (int i = 0; i < priv->rxrings; i++)
 		napi_enable(&priv->rx_qs[i].napi);
 
-	switch (priv->family_id) {
+	switch (priv->r->family_id) {
 	case RTL8380_FAMILY_ID:
 		rtl838x_hw_en_rxtx(priv);
 		/* Trap IGMP/MLD traffic to CPU-Port */
@@ -869,35 +868,35 @@ static int rtl838x_eth_open(struct net_device *ndev)
 
 static void rtl838x_hw_stop(struct rtl838x_eth_priv *priv)
 {
-	u32 force_mac = priv->family_id == RTL8380_FAMILY_ID ? 0x6192C : 0x75;
-	u32 clear_irq = priv->family_id == RTL8380_FAMILY_ID ? 0x000fffff : 0x007fffff;
+	u32 force_mac = priv->r->family_id == RTL8380_FAMILY_ID ? 0x6192C : 0x75;
+	u32 clear_irq = priv->r->family_id == RTL8380_FAMILY_ID ? 0x000fffff : 0x007fffff;
 
 	/* Disable RX/TX from/to CPU-port */
 	sw_w32_mask(0x3, 0, priv->r->mac_port_ctrl(priv->cpu_port));
 
 	/* Disable traffic */
-	if (priv->family_id == RTL9300_FAMILY_ID || priv->family_id == RTL9310_FAMILY_ID)
+	if (priv->r->family_id == RTL9300_FAMILY_ID || priv->r->family_id == RTL9310_FAMILY_ID)
 		sw_w32_mask(RX_EN_93XX | TX_EN_93XX, 0, priv->r->dma_if_ctrl);
 	else
 		sw_w32_mask(RX_EN | TX_EN, 0, priv->r->dma_if_ctrl);
 	mdelay(200); /* Test, whether this is needed */
 
 	/* Block all ports */
-	if (priv->family_id == RTL8380_FAMILY_ID) {
+	if (priv->r->family_id == RTL8380_FAMILY_ID) {
 		sw_w32(0x03000000, RTL838X_TBL_ACCESS_DATA_0(0));
 		sw_w32(0x00000000, RTL838X_TBL_ACCESS_DATA_0(1));
 		sw_w32(1 << 15 | 2 << 12, RTL838X_TBL_ACCESS_CTRL_0);
 	}
 
 	/* Flush L2 address cache */
-	if (priv->family_id == RTL8380_FAMILY_ID) {
+	if (priv->r->family_id == RTL8380_FAMILY_ID) {
 		/* Disable FAST_AGE_OUT otherwise flush will hang */
 		sw_w32_mask(BIT(23), 0, RTL838X_L2_CTRL_1);
 		for (int i = 0; i <= priv->cpu_port; i++) {
 			sw_w32(BIT(26) | BIT(23) | i << 5, priv->r->l2_tbl_flush_ctrl);
 			do { } while (sw_r32(priv->r->l2_tbl_flush_ctrl) & BIT(26));
 		}
-	} else if (priv->family_id == RTL8390_FAMILY_ID) {
+	} else if (priv->r->family_id == RTL8390_FAMILY_ID) {
 		for (int i = 0; i <= priv->cpu_port; i++) {
 			sw_w32(BIT(28) | BIT(25) | i << 5, priv->r->l2_tbl_flush_ctrl);
 			do { } while (sw_r32(priv->r->l2_tbl_flush_ctrl) & BIT(28));
@@ -906,16 +905,16 @@ static void rtl838x_hw_stop(struct rtl838x_eth_priv *priv)
 	/* TODO: L2 flush register is 64 bit on RTL931X and 930X */
 
 	/* CPU-Port: Link down */
-	if (priv->family_id == RTL8380_FAMILY_ID || priv->family_id == RTL8390_FAMILY_ID)
+	if (priv->r->family_id == RTL8380_FAMILY_ID || priv->r->family_id == RTL8390_FAMILY_ID)
 		sw_w32(force_mac, priv->r->mac_force_mode_ctrl + priv->cpu_port * 4);
-	else if (priv->family_id == RTL9300_FAMILY_ID)
+	else if (priv->r->family_id == RTL9300_FAMILY_ID)
 		sw_w32_mask(0x3, 0, priv->r->mac_force_mode_ctrl + priv->cpu_port * 4);
-	else if (priv->family_id == RTL9310_FAMILY_ID)
+	else if (priv->r->family_id == RTL9310_FAMILY_ID)
 		sw_w32_mask(BIT(0) | BIT(9), 0, priv->r->mac_force_mode_ctrl + priv->cpu_port * 4);
 	mdelay(100);
 
 	/* Disable all TX/RX interrupts */
-	if (priv->family_id == RTL9300_FAMILY_ID || priv->family_id == RTL9310_FAMILY_ID) {
+	if (priv->r->family_id == RTL9300_FAMILY_ID || priv->r->family_id == RTL9310_FAMILY_ID) {
 		sw_w32(0x00000000, priv->r->dma_if_intr_rx_runout_msk);
 		sw_w32(0xffffffff, priv->r->dma_if_intr_rx_runout_sts);
 		sw_w32(0x00000000, priv->r->dma_if_intr_rx_done_msk);
@@ -1086,7 +1085,7 @@ static int rtl838x_eth_tx(struct sk_buff *skb, struct net_device *dev)
 		h->size = len;
 		h->len = len;
 		/* On RTL8380 SoCs, small packet lengths being sent need adjustments */
-		if (priv->family_id == RTL8380_FAMILY_ID) {
+		if (priv->r->family_id == RTL8380_FAMILY_ID) {
 			if (len < ETH_ZLEN - 4)
 				h->len -= 4;
 		}
@@ -1103,7 +1102,7 @@ static int rtl838x_eth_tx(struct sk_buff *skb, struct net_device *dev)
 		ring->tx_r[q][ring->c_tx[q]] |= 1;
 
 		/* Before starting TX, prevent a Lextra bus bug on RTL8380 SoCs */
-		if (priv->family_id == RTL8380_FAMILY_ID) {
+		if (priv->r->family_id == RTL8380_FAMILY_ID) {
 			for (int i = 0; i < 10; i++) {
 				u32 val = sw_r32(priv->r->dma_if_ctrl);
 
@@ -1113,7 +1112,7 @@ static int rtl838x_eth_tx(struct sk_buff *skb, struct net_device *dev)
 		}
 
 		/* Tell switch to send data */
-		if (priv->family_id == RTL9310_FAMILY_ID || priv->family_id == RTL9300_FAMILY_ID) {
+		if (priv->r->family_id == RTL9310_FAMILY_ID || priv->r->family_id == RTL9300_FAMILY_ID) {
 			/* Ring ID q == 0: Low priority, Ring ID = 1: High prio queue */
 			if (!q)
 				sw_w32_mask(0, BIT(2), priv->r->dma_if_ctrl);
@@ -1205,7 +1204,7 @@ static int rtl838x_hw_receive(struct net_device *dev, int r, int budget)
 		skb = netdev_alloc_skb_ip_align(dev, len);
 		if (likely(skb)) {
 			/* BUG: Prevent bug on RTL838x SoCs */
-			if (priv->family_id == RTL8380_FAMILY_ID) {
+			if (priv->r->family_id == RTL8380_FAMILY_ID) {
 				sw_w32(0xffffffff, priv->r->dma_if_rx_ring_size(0));
 				for (int i = 0; i < priv->rxrings; i++) {
 					unsigned int val;
@@ -1290,7 +1289,7 @@ static int rtl838x_poll_rx(struct napi_struct *napi, int budget)
 	if (work_done < budget && napi_complete_done(napi, work_done)) {
 		/* Re-enable rx interrupts */
 		spin_lock_irqsave(&priv->lock, flags);
-		if (priv->family_id == RTL9300_FAMILY_ID || priv->family_id == RTL9310_FAMILY_ID)
+		if (priv->r->family_id == RTL9300_FAMILY_ID || priv->r->family_id == RTL9310_FAMILY_ID)
 			sw_w32_mask(0, RTL93XX_DMA_IF_INTR_RX_MASK(ring), priv->r->dma_if_intr_rx_done_msk);
 		else
 			sw_w32_mask(0, RTL83XX_DMA_IF_INTR_RX_MASK(ring), priv->r->dma_if_intr_msk);
@@ -1316,7 +1315,7 @@ static void rtl838x_pcs_an_restart(struct phylink_pcs *pcs)
 	struct rtl838x_eth_priv *priv = container_of(pcs, struct rtl838x_eth_priv, pcs);
 
 	/* This works only on RTL838x chips */
-	if (priv->family_id != RTL8380_FAMILY_ID)
+	if (priv->r->family_id != RTL8380_FAMILY_ID)
 		return;
 
 	pr_debug("In %s\n", __func__);
@@ -1414,7 +1413,7 @@ static void rtl838x_set_mac_hw(struct net_device *dev, u8 *mac)
 	sw_w32((mac[0] << 8) | mac[1], priv->r->mac);
 	sw_w32((mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | mac[5], priv->r->mac + 4);
 
-	if (priv->family_id == RTL8380_FAMILY_ID) {
+	if (priv->r->family_id == RTL8380_FAMILY_ID) {
 		/* 2 more registers, ALE/MAC block */
 		sw_w32((mac[0] << 8) | mac[1], RTL838X_MAC_ALE);
 		sw_w32((mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | mac[5],
@@ -1452,11 +1451,11 @@ static int rtl8390_init_mac(struct rtl838x_eth_priv *priv)
 
 static int rtl8380_init_mac(struct rtl838x_eth_priv *priv)
 {
-	if (priv->family_id == 0x8390)
+	if (priv->r->family_id == RTL8390_FAMILY_ID)
 		return rtl8390_init_mac(priv);
 
 	/* At present we do not know how to set up EEE on any other SoC than RTL8380 */
-	if (priv->family_id != 0x8380)
+	if (priv->r->family_id != RTL8380_FAMILY_ID)
 		return 0;
 
 	pr_info("%s\n", __func__);
@@ -1703,16 +1702,15 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 	dev->hw_features = NETIF_F_RXCSUM;
 
 	priv->id = soc_info.id;
-	priv->family_id = soc_info.family;
 	if (priv->id) {
 		pr_info("Found SoC ID: %4x: %s, family %x\n",
-			priv->id, soc_info.name, priv->family_id);
+			priv->id, soc_info.name, priv->r->family_id);
 	} else {
 		pr_err("Unknown chip id (%04x)\n", priv->id);
 		return -ENODEV;
 	}
 
-	switch (priv->family_id) {
+	switch (priv->r->family_id) {
 	case RTL8380_FAMILY_ID:
 		priv->cpu_port = RTL838X_CPU_PORT;
 		dev->netdev_ops = &rtl838x_eth_netdev_ops;



From lede-commits at lists.infradead.org  Tue Dec 23 09:00:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:00:18 -0500
Subject: [openwrt/openwrt]  realtek: ethernet: split ethernet compatibles
In-Reply-To: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
References: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
Message-ID: <mailman.38858.1766509227.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b8f4fb2f3d143ecf2364024e69b417ab1c7f6700

commit b8f4fb2f3d143ecf2364024e69b417ab1c7f6700
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 16 09:41:37 2025 +0100

    realtek: ethernet: split ethernet compatibles
    
    The Realtek Otto ethernet driver currently uses a single compatible
    for all different models. Split this into the the four well known
    subtargets. This allows to get rid of the central mach/soc include
    later.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21183
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/dts/rtl838x.dtsi                              | 2 +-
 target/linux/realtek/dts/rtl839x.dtsi                              | 2 +-
 target/linux/realtek/dts/rtl930x.dtsi                              | 2 +-
 target/linux/realtek/dts/rtl931x.dtsi                              | 2 +-
 target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c | 5 ++++-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/target/linux/realtek/dts/rtl838x.dtsi b/target/linux/realtek/dts/rtl838x.dtsi
index 6a872bcb0f..7af572aefc 100644
--- a/target/linux/realtek/dts/rtl838x.dtsi
+++ b/target/linux/realtek/dts/rtl838x.dtsi
@@ -334,7 +334,7 @@
 	};
 
 	ethernet0: ethernet at 1b00a300 {
-		compatible = "realtek,rtl838x-eth";
+		compatible = "realtek,rtl8380-eth";
 		reg = <0x1b00a300 0x100>;
 		interrupt-parent = <&intc>;
 		interrupts = <24 3>;
diff --git a/target/linux/realtek/dts/rtl839x.dtsi b/target/linux/realtek/dts/rtl839x.dtsi
index 5e92c5071d..7b6eeae1b1 100644
--- a/target/linux/realtek/dts/rtl839x.dtsi
+++ b/target/linux/realtek/dts/rtl839x.dtsi
@@ -335,7 +335,7 @@
 	};
 
 	ethernet0: ethernet at 1b00a300 {
-		compatible = "realtek,rtl838x-eth";
+		compatible = "realtek,rtl8392-eth";
 		reg = <0x1b00a300 0x100>;
 
 		interrupt-parent = <&intc>;
diff --git a/target/linux/realtek/dts/rtl930x.dtsi b/target/linux/realtek/dts/rtl930x.dtsi
index f358f50417..4a5dd2e17a 100644
--- a/target/linux/realtek/dts/rtl930x.dtsi
+++ b/target/linux/realtek/dts/rtl930x.dtsi
@@ -331,7 +331,7 @@
 	};
 
 	ethernet0: ethernet at 1b00a300 {
-		compatible = "realtek,rtl838x-eth";
+		compatible = "realtek,rtl9301-eth";
 		reg = <0x1b00a300 0x100>;
 
 		interrupt-parent = <&intc>;
diff --git a/target/linux/realtek/dts/rtl931x.dtsi b/target/linux/realtek/dts/rtl931x.dtsi
index d754ebd5a7..6173f912b9 100644
--- a/target/linux/realtek/dts/rtl931x.dtsi
+++ b/target/linux/realtek/dts/rtl931x.dtsi
@@ -391,7 +391,7 @@
 
 	ethernet0: ethernet at 1b00a300 {
 		status = "okay";
-		compatible = "realtek,rtl838x-eth";
+		compatible = "realtek,rtl9311-eth";
 		reg = <0x1b00a300 0x100>;
 		interrupt-parent = <&gic>;
 		#interrupt-cells = <3>;
diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index 59ae4fbb24..b30c74b5d6 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -1856,7 +1856,10 @@ static void rtl838x_eth_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id rtl838x_eth_of_ids[] = {
-	{ .compatible = "realtek,rtl838x-eth"},
+	{ .compatible = "realtek,rtl8380-eth" },
+	{ .compatible = "realtek,rtl8392-eth" },
+	{ .compatible = "realtek,rtl9301-eth" },
+	{ .compatible = "realtek,rtl9311-eth" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rtl838x_eth_of_ids);



From lede-commits at lists.infradead.org  Tue Dec 23 09:00:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:00:24 -0500
Subject: [openwrt/openwrt]  realtek: ethernet: decouple from soc_info
In-Reply-To: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
References: <176650921884.4103371.14438968140158297@git-01.infra.openwrt.org>
Message-ID: <mailman.38859.1766509228.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/68422b59aedaf7e06214391737cb63f6a7938b6f

commit 68422b59aedaf7e06214391737cb63f6a7938b6f
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 16 11:29:04 2025 +0100

    realtek: ethernet: decouple from soc_info
    
    The ethernet driver gets all the data from the DTS now. No need
    to access the shared soc_info structure any longer.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21183
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/ethernet/rtl838x_eth.c        | 16 ++--------------
 .../files-6.12/drivers/net/ethernet/rtl838x_eth.h        |  3 ---
 2 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index 26d6e72e41..0684f6c4d7 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -193,7 +193,6 @@ struct rtl838x_eth_priv {
 	struct phylink *phylink;
 	struct phylink_config phylink_config;
 	struct phylink_pcs pcs;
-	u16 id;
 	const struct rtl838x_eth_reg *r;
 	u8 cpu_port;
 	u32 lastEvent;
@@ -1464,14 +1463,10 @@ static int rtl8380_init_mac(struct rtl838x_eth_priv *priv)
 	sw_w32(0x5001417, RTL838X_EEE_TX_TIMER_GELITE_CTRL);
 
 	/* Init VLAN. TODO: Understand what is being done, here */
-	if (priv->id == 0x8382) {
+	if (priv->r->family_id == RTL8380_FAMILY_ID) {
 		for (int i = 0; i <= 28; i++)
 			sw_w32(0, 0xd57c + i * 0x80);
 	}
-	if (priv->id == 0x8380) {
-		for (int i = 8; i <= 28; i++)
-			sw_w32(0, 0xd57c + i * 0x80);
-	}
 
 	return 0;
 }
@@ -1701,14 +1696,7 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
 	dev->features = NETIF_F_RXCSUM | NETIF_F_HW_CSUM;
 	dev->hw_features = NETIF_F_RXCSUM;
 
-	priv->id = soc_info.id;
-	if (priv->id) {
-		pr_info("Found SoC ID: %4x: %s, family %x\n",
-			priv->id, soc_info.name, priv->r->family_id);
-	} else {
-		pr_err("Unknown chip id (%04x)\n", priv->id);
-		return -ENODEV;
-	}
+	pr_info("Found SoC family %x\n", priv->r->family_id);
 
 	switch (priv->r->family_id) {
 	case RTL8380_FAMILY_ID:
diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
index 9b94140ca9..835bd742b4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
@@ -469,7 +469,4 @@ struct rtl838x_eth_reg {
 	bool (*decode_tag)(struct p_hdr *h, struct dsa_tag *tag);
 };
 
-/* TODO actually from arch/mips/rtl838x/prom.c */
-extern struct rtl83xx_soc_info soc_info;
-
 #endif /* _RTL838X_ETH_H */



From lede-commits at lists.infradead.org  Tue Dec 23 09:04:39 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:04:39 -0500
Subject: [openwrt/openwrt]  strace: update to 6.18
In-Reply-To: <176650947904.57413.8358825518232771964@git-01.infra.openwrt.org>
References: <176650947904.57413.8358825518232771964@git-01.infra.openwrt.org>
Message-ID: <mailman.38860.1766509485.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/539352352a33063c45395766a3867663f162417c

commit 539352352a33063c45395766a3867663f162417c
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Wed Dec 17 15:46:11 2025 -0500

    strace: update to 6.18
    
    Release Notes:
    - https://github.com/strace/strace/releases/tag/v6.18
    
    Note this updated is needed in order to fix a build failure with
    the 6.18 kernel.
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21206
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/devel/strace/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile
index 36fcde8429..edf500fecf 100644
--- a/package/devel/strace/Makefile
+++ b/package/devel/strace/Makefile
@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=strace
-PKG_VERSION:=6.17
+PKG_VERSION:=6.18
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
-PKG_HASH:=0a7c7bedc7efc076f3242a0310af2ae63c292a36dd4236f079e88a93e98cb9c0
+PKG_HASH:=0ad5dcba973a69e779650ef1cb335b12ee60716fc7326609895bd33e6d2a7325
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_LICENSE:=LGPL-2.1-or-later



From lede-commits at lists.infradead.org  Tue Dec 23 09:07:08 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:07:08 -0500
Subject: [openwrt/openwrt]  cryptodev-linux: add backport to build for 6.18
In-Reply-To: <176650962882.151636.445064036210073929@git-01.infra.openwrt.org>
References: <176650962882.151636.445064036210073929@git-01.infra.openwrt.org>
Message-ID: <mailman.38863.1766509632.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/045007c24ccf6026441f3b6dc9902055174a3a2e

commit 045007c24ccf6026441f3b6dc9902055174a3a2e
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Tue Dec 16 16:42:12 2025 -0500

    cryptodev-linux: add backport to build for 6.18
    
    Add https://github.com/cryptodev-linux/cryptodev-linux/commit/08644db02d43478f802755903212f5ee506af73b
    to allow builds against the 6.18 series of kernels.
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21190
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/cryptodev-linux/Makefile            |  2 +-
 .../patches/002-Fix-build-for-Linux-6.18-rc1.patch | 49 ++++++++++++++++++++++
 2 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/package/kernel/cryptodev-linux/Makefile b/package/kernel/cryptodev-linux/Makefile
index 303c136a35..fb79d4c89b 100644
--- a/package/kernel/cryptodev-linux/Makefile
+++ b/package/kernel/cryptodev-linux/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=cryptodev-linux
 PKG_VERSION:=1.14
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/$(PKG_NAME)-$(PKG_VERSION)?
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/package/kernel/cryptodev-linux/patches/002-Fix-build-for-Linux-6.18-rc1.patch b/package/kernel/cryptodev-linux/patches/002-Fix-build-for-Linux-6.18-rc1.patch
new file mode 100644
index 0000000000..4cdb0e30f6
--- /dev/null
+++ b/package/kernel/cryptodev-linux/patches/002-Fix-build-for-Linux-6.18-rc1.patch
@@ -0,0 +1,49 @@
+From 08644db02d43478f802755903212f5ee506af73b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram at gmail.com>
+Date: Sat, 6 Sep 2025 20:36:38 +0000
+Subject: [PATCH] Fix build for Linux 6.18-rc1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's no longer required to use nth_page() when iterating pages within a
+single scatterlist entry.
+
+Note I believe this code path in `sg_advance` is currently unreachable:
+It is only called from `get_userbuf_srtp`, passing in a scatterlist
+copied from one created by `__get_userbuf`, which only generates
+entries such that `sg->offset + sg->length <= PAGE_SIZE`.
+On the other hand, this code path in `sg_advance` requires that
+`sg->offset + sg->length > sg->offset + consumed >= PAGE_SIZE`.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f8f03eb5f0f91fddc9bb8563c7e82bd7d3ba1dd0
+          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce00897b94bc5c62fab962625efcf1ab824d3688
+
+Signed-off-by: Joan Bruguera Mic? <joanbrugueram at gmail.com>
+---
+ util.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/util.c
++++ b/util.c
+@@ -21,6 +21,7 @@
+ 
+ #include <crypto/scatterwalk.h>
+ #include <linux/scatterlist.h>
++#include <linux/version.h>
+ #include "util.h"
+ 
+ /* These were taken from Maxim Levitsky's patch to lkml.
+@@ -44,8 +45,12 @@ struct scatterlist *sg_advance(struct sc
+ 	sg->length -= consumed;
+ 
+ 	if (sg->offset >= PAGE_SIZE) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 18, 0))
++		struct page *page = sg_page(sg) + (sg->offset / PAGE_SIZE);
++#else
+ 		struct page *page =
+ 			nth_page(sg_page(sg), sg->offset / PAGE_SIZE);
++#endif
+ 		sg_set_page(sg, page, sg->length, sg->offset % PAGE_SIZE);
+ 	}
+ 



From lede-commits at lists.infradead.org  Tue Dec 23 09:24:22 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:24:22 -0500
Subject: [openwrt/openwrt]  kernel: rtl836x: change missing mdio node log
 level to info
In-Reply-To: <176651066196.714738.12490673144265754855@git-01.infra.openwrt.org>
References: <176651066196.714738.12490673144265754855@git-01.infra.openwrt.org>
Message-ID: <mailman.38872.1766510666.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f8af185ec539df7af1cf29e1a1df2c15e4cb73a2

commit f8af185ec539df7af1cf29e1a1df2c15e4cb73a2
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Sat Dec 13 00:40:41 2025 +0800

    kernel: rtl836x: change missing mdio node log level to info
    
    mdio node is optional for the rtl836x switch. Some devices use GPIO to
    control the switch chip. Missing mdio is a normal behavior.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21143
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/generic/files/drivers/net/phy/rtl8366_smi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
index f043b2b875..f4879a827b 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
@@ -1489,7 +1489,7 @@ static int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi
 
 	mdio_node = of_parse_phandle(np, "mii-bus", 0);
 	if (!mdio_node) {
-		dev_err(&pdev->dev, "cannot find mdio node phandle");
+		dev_info(&pdev->dev, "cannot find mdio node phandle");
 		goto try_gpio;
 	}
 



From lede-commits at lists.infradead.org  Tue Dec 23 09:24:21 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:24:21 -0500
Subject: [openwrt/openwrt]  kernel: rtl836x: directly defer probe when mdio is
 missing
In-Reply-To: <176651066196.714738.12490673144265754855@git-01.infra.openwrt.org>
References: <176651066196.714738.12490673144265754855@git-01.infra.openwrt.org>
Message-ID: <mailman.38873.1766510666.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/52924bf19444bbb6c047725399b993c9a1092558

commit 52924bf19444bbb6c047725399b993c9a1092558
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Mon Dec 15 19:37:03 2025 +0800

    kernel: rtl836x: directly defer probe when mdio is missing
    
    If the switch is directly controlled by the mdio bus, we must ensure
    that the mdio bus is ready instead of trying GPIO simulated bus.
    
    Fixes: d4ac26ec4920 ("kernel: rtl8366-smi: add Realtek switch management via mii-bus")
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21143
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/generic/files/drivers/net/phy/rtl8366_smi.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
index 905283b0c2..f043b2b875 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
@@ -1497,7 +1497,7 @@ static int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi
 	if (!smi->ext_mbus) {
 		dev_info(&pdev->dev,
 			"cannot find mdio bus from bus handle (yet)");
-		goto try_gpio;
+		return -EPROBE_DEFER;
 	}
 
 	if (of_property_read_u32(np, "phy-id", &smi->phy_id))
@@ -1507,12 +1507,8 @@ static int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi
 
 try_gpio:
 	if (!gpio_is_valid(sck) || !gpio_is_valid(sda)) {
-		if (!mdio_node) {
-			dev_err(&pdev->dev, "gpios missing in devictree\n");
-			return -EINVAL;
-		} else {
-			return -EPROBE_DEFER;
-		}
+		dev_err(&pdev->dev, "gpios missing in devictree\n");
+		return -EINVAL;
 	}
 
 	smi->gpio_sda = sda;



From lede-commits at lists.infradead.org  Tue Dec 23 09:24:23 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:24:23 -0500
Subject: [openwrt/openwrt]  kernel: rtl836x: convert to gpiod API
In-Reply-To: <176651066196.714738.12490673144265754855@git-01.infra.openwrt.org>
References: <176651066196.714738.12490673144265754855@git-01.infra.openwrt.org>
Message-ID: <mailman.38874.1766510667.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f36e9e9888d44e662da1045778e855129ce4dec0

commit f36e9e9888d44e662da1045778e855129ce4dec0
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Fri Dec 12 21:39:40 2025 +0800

    kernel: rtl836x: convert to gpiod API
    
    This is the recommended way for the OF based platform.
    
    Tested-on TP-Link TL-WR2543N with RTL8367 switch:
    ```
    root at OpenWrt:~# dmesg |grep -i rtl
    [    7.941126] rtl8367 rtl8367: cannot find mdio node phandle
    [    7.947562] rtl8367 rtl8367: RTL8367R ver. 0 chip found
    [    9.056830] rtl8367 rtl8367: cpu_port:9, assigned to extif0
    root at OpenWrt:~# cat /sys/kernel/debug/gpio
    gpiochip0: GPIOs 512-529, parent: platform/18040000.gpio, 18040000.gpio:
     gpio-512 (                    |lime:status         ) out lo ACTIVE LOW
     gpio-513 (                    |rtl836x-sda         ) in  hi
     gpio-518 (                    |rtl836x-sck         ) in  lo
     gpio-520 (                    |lime:usb            ) out hi ACTIVE LOW
     gpio-523 (                    |reset               ) in  hi IRQ ACTIVE LOW
     gpio-524 (                    |wps                 ) in  hi IRQ ACTIVE LOW
    ```
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21143
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../generic/files/drivers/net/phy/rtl8366_smi.c    | 122 ++++++++-------------
 .../generic/files/drivers/net/phy/rtl8366_smi.h    |   4 +-
 2 files changed, 50 insertions(+), 76 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
index f4879a827b..aa8ef0bba2 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
@@ -12,11 +12,10 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/delay.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>
 #include <linux/of.h>
-#include <linux/of_gpio.h>
 #include <linux/version.h>
 #include <linux/of_mdio.h>
 #include <linux/platform_device.h>
@@ -39,86 +38,86 @@ static inline void rtl8366_smi_clk_delay(struct rtl8366_smi *smi)
 
 static void rtl8366_smi_start(struct rtl8366_smi *smi)
 {
-	unsigned int sda = smi->gpio_sda;
-	unsigned int sck = smi->gpio_sck;
+	struct gpio_desc *sda = smi->gpio_sda;
+	struct gpio_desc *sck = smi->gpio_sck;
 
 	/*
 	 * Set GPIO pins to output mode, with initial state:
 	 * SCK = 0, SDA = 1
 	 */
-	gpio_direction_output(sck, 0);
-	gpio_direction_output(sda, 1);
+	gpiod_direction_output_raw(sck, 0);
+	gpiod_direction_output_raw(sda, 1);
 	rtl8366_smi_clk_delay(smi);
 
 	/* CLK 1: 0 -> 1, 1 -> 0 */
-	gpio_set_value(sck, 1);
+	gpiod_set_raw_value(sck, 1);
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sck, 0);
+	gpiod_set_raw_value(sck, 0);
 	rtl8366_smi_clk_delay(smi);
 
 	/* CLK 2: */
-	gpio_set_value(sck, 1);
+	gpiod_set_raw_value(sck, 1);
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sda, 0);
+	gpiod_set_raw_value(sda, 0);
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sck, 0);
+	gpiod_set_raw_value(sck, 0);
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sda, 1);
+	gpiod_set_raw_value(sda, 1);
 }
 
 static void rtl8366_smi_stop(struct rtl8366_smi *smi)
 {
-	unsigned int sda = smi->gpio_sda;
-	unsigned int sck = smi->gpio_sck;
+	struct gpio_desc *sda = smi->gpio_sda;
+	struct gpio_desc *sck = smi->gpio_sck;
 
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sda, 0);
-	gpio_set_value(sck, 1);
+	gpiod_set_raw_value(sda, 0);
+	gpiod_set_raw_value(sck, 1);
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sda, 1);
+	gpiod_set_raw_value(sda, 1);
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sck, 1);
+	gpiod_set_raw_value(sck, 1);
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sck, 0);
+	gpiod_set_raw_value(sck, 0);
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sck, 1);
+	gpiod_set_raw_value(sck, 1);
 
 	/* add a click */
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sck, 0);
+	gpiod_set_raw_value(sck, 0);
 	rtl8366_smi_clk_delay(smi);
-	gpio_set_value(sck, 1);
+	gpiod_set_raw_value(sck, 1);
 
 	/* set GPIO pins to input mode */
-	gpio_direction_input(sda);
-	gpio_direction_input(sck);
+	gpiod_direction_input(sda);
+	gpiod_direction_input(sck);
 }
 
 static void rtl8366_smi_write_bits(struct rtl8366_smi *smi, u32 data, u32 len)
 {
-	unsigned int sda = smi->gpio_sda;
-	unsigned int sck = smi->gpio_sck;
+	struct gpio_desc *sda = smi->gpio_sda;
+	struct gpio_desc *sck = smi->gpio_sck;
 
 	for (; len > 0; len--) {
 		rtl8366_smi_clk_delay(smi);
 
 		/* prepare data */
-		gpio_set_value(sda, !!(data & ( 1 << (len - 1))));
+		gpiod_set_raw_value(sda, !!(data & (1 << (len - 1))));
 		rtl8366_smi_clk_delay(smi);
 
 		/* clocking */
-		gpio_set_value(sck, 1);
+		gpiod_set_raw_value(sck, 1);
 		rtl8366_smi_clk_delay(smi);
-		gpio_set_value(sck, 0);
+		gpiod_set_raw_value(sck, 0);
 	}
 }
 
 static void rtl8366_smi_read_bits(struct rtl8366_smi *smi, u32 len, u32 *data)
 {
-	unsigned int sda = smi->gpio_sda;
-	unsigned int sck = smi->gpio_sck;
+	struct gpio_desc *sda = smi->gpio_sda;
+	struct gpio_desc *sck = smi->gpio_sck;
 
-	gpio_direction_input(sda);
+	gpiod_direction_input(sda);
 
 	for (*data = 0; len > 0; len--) {
 		u32 u;
@@ -126,15 +125,15 @@ static void rtl8366_smi_read_bits(struct rtl8366_smi *smi, u32 len, u32 *data)
 		rtl8366_smi_clk_delay(smi);
 
 		/* clocking */
-		gpio_set_value(sck, 1);
+		gpiod_set_raw_value(sck, 1);
 		rtl8366_smi_clk_delay(smi);
-		u = !!gpio_get_value(sda);
-		gpio_set_value(sck, 0);
+		u = !!gpiod_get_raw_value(sda);
+		gpiod_set_raw_value(sck, 0);
 
 		*data |= (u << (len - 1));
 	}
 
-	gpio_direction_output(sda, 0);
+	gpiod_direction_output_raw(sda, 0);
 }
 
 static int rtl8366_smi_wait_for_ack(struct rtl8366_smi *smi)
@@ -1360,24 +1359,6 @@ EXPORT_SYMBOL_GPL(rtl8366_smi_alloc);
 
 static int __rtl8366_smi_init(struct rtl8366_smi *smi, const char *name)
 {
-	int err;
-
-	if (!smi->ext_mbus) {
-		err = gpio_request(smi->gpio_sda, name);
-		if (err) {
-			printk(KERN_ERR "rtl8366_smi: gpio_request failed for %u, err=%d\n",
-				smi->gpio_sda, err);
-			goto err_out;
-		}
-
-		err = gpio_request(smi->gpio_sck, name);
-		if (err) {
-			printk(KERN_ERR "rtl8366_smi: gpio_request failed for %u, err=%d\n",
-				smi->gpio_sck, err);
-			goto err_free_sda;
-		}
-	}
-
 	spin_lock_init(&smi->lock);
 
 	/* start the switch */
@@ -1387,22 +1368,12 @@ static int __rtl8366_smi_init(struct rtl8366_smi *smi, const char *name)
 	}
 
 	return 0;
-
- err_free_sda:
-	gpio_free(smi->gpio_sda);
- err_out:
-	return err;
 }
 
 static void __rtl8366_smi_cleanup(struct rtl8366_smi *smi)
 {
 	if (smi->hw_reset)
 		smi->hw_reset(smi, true);
-
-	if (!smi->ext_mbus) {
-		gpio_free(smi->gpio_sck);
-		gpio_free(smi->gpio_sda);
-	}
 }
 
 int rtl8366_smi_init(struct rtl8366_smi *smi)
@@ -1416,10 +1387,7 @@ int rtl8366_smi_init(struct rtl8366_smi *smi)
 	if (err)
 		goto err_out;
 
-	if (!smi->ext_mbus)
-		dev_info(smi->parent, "using GPIO pins %u (SDA) and %u (SCK)\n",
-			 smi->gpio_sda, smi->gpio_sck);
-	else
+	if (smi->ext_mbus)
 		dev_info(smi->parent, "using MDIO bus '%s'\n", smi->ext_mbus->name);
 
 	err = smi->ops->detect(smi);
@@ -1482,8 +1450,7 @@ static void rtl8366_smi_reset(struct rtl8366_smi *smi, bool active)
 
 static int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
 {
-	int sck = of_get_named_gpio(pdev->dev.of_node, "gpio-sck", 0);
-	int sda = of_get_named_gpio(pdev->dev.of_node, "gpio-sda", 0);
+	struct gpio_desc *sck, *sda;
 	struct device_node *np = pdev->dev.of_node;
 	struct device_node *mdio_node;
 
@@ -1506,10 +1473,17 @@ static int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi
 	return 0;
 
 try_gpio:
-	if (!gpio_is_valid(sck) || !gpio_is_valid(sda)) {
-		dev_err(&pdev->dev, "gpios missing in devictree\n");
-		return -EINVAL;
-	}
+	sck = devm_gpiod_get(&pdev->dev, "sck", GPIOD_IN);
+	if (IS_ERR(sck))
+		return dev_err_probe(&pdev->dev, PTR_ERR(sck),
+				     "failed to request sck-gpio\n");
+	gpiod_set_consumer_name(sck, "rtl836x-sck");
+
+	sda = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN);
+	if (IS_ERR(sda))
+		return dev_err_probe(&pdev->dev, PTR_ERR(sda),
+				     "failed to request sda-gpio\n");
+	gpiod_set_consumer_name(sda, "rtl836x-sda");
 
 	smi->gpio_sda = sda;
 	smi->gpio_sck = sck;
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h
index 2608240bb0..9592d4b6f4 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h
@@ -44,8 +44,8 @@ struct rtl8366_mib_counter {
 
 struct rtl8366_smi {
 	struct device		*parent;
-	unsigned int		gpio_sda;
-	unsigned int		gpio_sck;
+	struct gpio_desc	*gpio_sda;
+	struct gpio_desc	*gpio_sck;
 	void			(*hw_reset)(struct rtl8366_smi *smi, bool active);
 	unsigned int		clk_delay;	/* ns */
 	u8			cmd_read;



From lede-commits at lists.infradead.org  Tue Dec 23 09:24:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:24:24 -0500
Subject: [openwrt/openwrt]  treewide: dts: update rtl836x switch sck/sda gpio
 properties
In-Reply-To: <176651066196.714738.12490673144265754855@git-01.infra.openwrt.org>
References: <176651066196.714738.12490673144265754855@git-01.infra.openwrt.org>
Message-ID: <mailman.38875.1766510667.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/dbf2cf1f004654ec71d1b26aad0fb8778d1fd637

commit dbf2cf1f004654ec71d1b26aad0fb8778d1fd637
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Fri Dec 12 21:43:39 2025 +0800

    treewide: dts: update rtl836x switch sck/sda gpio properties
    
    Rename them to follow the rtl836x driver gpiod changes.
    
    Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21143
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts                    | 4 ++--
 target/linux/ath79/dts/ar7161_netgear_wndr.dtsi                       | 4 ++--
 target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts                 | 4 ++--
 target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts                 | 4 ++--
 target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi              | 4 ++--
 target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts               | 4 ++--
 .../lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi   | 4 ++--
 target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts                | 4 ++--
 target/linux/ramips/dts/rt2880_asus_rt-n15.dts                        | 4 ++--
 target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts                  | 4 ++--
 target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts               | 4 ++--
 target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts                  | 4 ++--
 target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts                  | 4 ++--
 target/linux/ramips/dts/rt3052_sitecom_wl-351.dts                     | 4 ++--
 target/linux/ramips/dts/rt3662_asus_rt-n56u.dts                       | 4 ++--
 target/linux/ramips/dts/rt3662_dlink_dir-645.dts                      | 4 ++--
 target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts                   | 4 ++--
 target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts                 | 4 ++--
 target/linux/ramips/dts/rt3883_belkin_f9k1109v1.dts                   | 4 ++--
 19 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
index 0363f0e49b..4b0bf87093 100644
--- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
+++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
@@ -76,8 +76,8 @@
 
 	rtl8366s {
 		compatible = "realtek,rtl8366s";
-		gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
 		realtek,initvals = <0x06 0x0108>;
 
 		mdio-bus {
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi
index 0afa989ee3..de55c08570 100644
--- a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi
@@ -101,8 +101,8 @@
 	rtl8366s {
 		compatible = "realtek,rtl8366s";
 
-		gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
 
 		mdio-bus {
 			#address-cells = <1>;
diff --git a/target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts b/target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts
index c704b062f1..71d7811277 100644
--- a/target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts
+++ b/target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts
@@ -46,8 +46,8 @@
 
 	rtl8366s {
 		compatible = "realtek,rtl8366s";
-		gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
 		realtek,initvals = <0x06 0x0108>;
 
 		mdio-bus {
diff --git a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
index 744971c6f8..69152c66f1 100644
--- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
+++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
@@ -76,8 +76,8 @@
 
 	rtl8367 {
 		compatible = "realtek,rtl8367";
-		gpio-sda = <&gpio 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio 6 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
 		realtek,extif = <9 1 0 1 1 1 1 1 1 2>;
 
 		mdio-bus {
diff --git a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi
index 474d0fa80f..c3108e2123 100644
--- a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi
+++ b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi
@@ -192,8 +192,8 @@
 	switch: switch {
 		status = "disabled";
 
-		gpio-sda = <&gpio 19 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio 20 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
 
 		mdio-bus {
 			status = "okay";
diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts
index 847d4d4c47..e392771ce8 100644
--- a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts
+++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts
@@ -68,8 +68,8 @@
 
 	rtl8366rb {
 		compatible = "realtek,rtl8366rb";
-		gpio-sda = <&gpio 18 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio 19 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
 
 		resets = <&rst 8>;
 		reset-names = "switch";
diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi
index edf79f6c45..dc8bc08331 100644
--- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi
+++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi
@@ -27,8 +27,8 @@
 
 	rtl8366rb {
 		compatible = "realtek,rtl8366rb";
-		gpio-sda = <&gpio 35 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio 37 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio 37 GPIO_ACTIVE_HIGH>;
 
 		realtek,initvals = <
 			0x0000 0x0830
diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts
index 19b1538241..57f1636b37 100644
--- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts
+++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts
@@ -75,8 +75,8 @@
 
 	rtl8367rb {
 		compatible = "realtek,rtl8367b";
-		gpio-sda = <&gpio0 22 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 23 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
 		realtek,extif = <6 1 0 1 1 1 1 1 1 2>;
 	};
 };
diff --git a/target/linux/ramips/dts/rt2880_asus_rt-n15.dts b/target/linux/ramips/dts/rt2880_asus_rt-n15.dts
index 7306c458ff..f2314ea53e 100644
--- a/target/linux/ramips/dts/rt2880_asus_rt-n15.dts
+++ b/target/linux/ramips/dts/rt2880_asus_rt-n15.dts
@@ -70,8 +70,8 @@
 
 	rtl8366s {
 		compatible = "realtek,rtl8366s";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 	};
 
 	keys {
diff --git a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts
index 014dca2c48..b17976b63a 100644
--- a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts
+++ b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts
@@ -67,8 +67,8 @@
 
 	rtl8366s {
 		compatible = "realtek,rtl8366s";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 
 		realtek,initvals = <
 			0x0242 0x02BF
diff --git a/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts b/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts
index dee4c6b981..7d79232fbd 100644
--- a/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts
+++ b/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts
@@ -69,8 +69,8 @@
 
 	rtl8366s {
 		compatible = "realtek,rtl8366s";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 	};
 
 	keys {
diff --git a/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts b/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts
index 05f6edce2a..0b9d5f9921 100644
--- a/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts
+++ b/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts
@@ -62,8 +62,8 @@
 
 	rtl8366s {
 		compatible = "realtek,rtl8366s";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 	};
 
 	keys {
diff --git a/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts b/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts
index 0119737af1..680f507e95 100644
--- a/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts
+++ b/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts
@@ -65,8 +65,8 @@
 
 	rtl8366rb {
 		compatible = "realtek,rtl8366rb";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 	};
 
 	leds {
diff --git a/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts b/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts
index d1d68f6a5c..e2b9b62ac2 100644
--- a/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts
+++ b/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts
@@ -104,8 +104,8 @@
 
 	rtl8366rb {
 		compatible = "realtek,rtl8366rb";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 	};
 };
 
diff --git a/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts
index a456b45485..2489b78a37 100644
--- a/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts
+++ b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts
@@ -71,8 +71,8 @@
 
 	rtl8367 {
 		compatible = "realtek,rtl8367";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 		realtek,extif = <8 1 0 1 1 1 1 1 1 2>;
 	};
 
diff --git a/target/linux/ramips/dts/rt3662_dlink_dir-645.dts b/target/linux/ramips/dts/rt3662_dlink_dir-645.dts
index b765c6b800..755bc63afd 100644
--- a/target/linux/ramips/dts/rt3662_dlink_dir-645.dts
+++ b/target/linux/ramips/dts/rt3662_dlink_dir-645.dts
@@ -17,8 +17,8 @@
 
 	rtl8367b {
 		compatible = "realtek,rtl8367b";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 		realtek,extif = <6 1 0 1 1 1 1 1 1 2>;
 	};
 
diff --git a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts
index 8cfda7d244..a3871e8dc8 100644
--- a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts
+++ b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts
@@ -124,8 +124,8 @@
 
 	rtl8367 {
 		compatible = "realtek,rtl8367";
-		gpio-sda = <&gpio0 5 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 4 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
 		realtek,extif = <9 1 0 1 1 1 1 1 1 2>;
 	};
 
diff --git a/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts
index 921c48d59e..88e7f73200 100644
--- a/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts
+++ b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts
@@ -79,8 +79,8 @@
 
 	rtl8367 {
 		compatible = "realtek,rtl8367";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 		realtek,extif = <9 1 0 1 1 1 1 1 1 2>;
 	};
 
diff --git a/target/linux/ramips/dts/rt3883_belkin_f9k1109v1.dts b/target/linux/ramips/dts/rt3883_belkin_f9k1109v1.dts
index e469cacdb4..88f18d338d 100644
--- a/target/linux/ramips/dts/rt3883_belkin_f9k1109v1.dts
+++ b/target/linux/ramips/dts/rt3883_belkin_f9k1109v1.dts
@@ -75,8 +75,8 @@
 
 	rtl8367b {
 		compatible = "realtek,rtl8367b";
-		gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-		gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		sda-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+		sck-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
 		realtek,extif = <5 1 0 1 1 1 1 1 1 2>;
 	};
 };



From lede-commits at lists.infradead.org  Tue Dec 23 09:56:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:56:43 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: reorder modes in mode
 configuration
In-Reply-To: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
References: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
Message-ID: <mailman.38898.1766512602.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5334b41b00051912cbc7a1bf23eb681e467ac804

commit 5334b41b00051912cbc7a1bf23eb681e467ac804
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Mon Dec 15 18:45:54 2025 +0000

    realtek: pcs: rtl931x: reorder modes in mode configuration
    
    Reorder the modes within the switch statement in
    rtpcs_931x_sds_config_mode to have a proper and non-confusing order.
    Have fiber modes first and MII modes after, and sort all modes in
    ascending speed/capabilities order.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21184
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 73 +++++++++++-----------
 1 file changed, 36 insertions(+), 37 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 1ed8858ff1..347800de78 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2685,8 +2685,43 @@ static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
 	case RTPCS_SDS_MODE_OFF:
 		break;
 
-	case RTPCS_SDS_MODE_XSGMII:
+	case RTPCS_SDS_MODE_1000BASEX:
+		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
+
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
+		break;
+
+	case RTPCS_SDS_MODE_2500BASEX:
+		rtpcs_sds_write_bits(sds, 0x41, 0x14, 8, 8, 1);
+		break;
+
+	case RTPCS_SDS_MODE_10GBASER: /* 10GR1000BX_AUTO */
+		/* configure 10GR fiber mode=1 */
+		rtpcs_sds_write_bits(sds, 0x1f, 0xb, 1, 1, 1);
+
+		/* init fiber_1g */
+		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
 
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
+		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
+
+		/* init auto */
+		rtpcs_sds_write_bits(sds, 0x1f, 13, 15, 0, 0x109e);
+		rtpcs_sds_write_bits(sds, 0x1f, 0x6, 14, 10, 0x8);
+		rtpcs_sds_write_bits(sds, 0x1f, 0x7, 10, 4, 0x7f);
+		break;
+
+	case RTPCS_SDS_MODE_SGMII:
+		rtpcs_sds_write_bits(sds, 0x24, 0x9, 15, 15, 0);
+
+		/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
+		rtpcs_931x_sds_cmu_band_set(sds, true, 62, PHY_INTERFACE_MODE_SGMII);
+		break;
+
+	case RTPCS_SDS_MODE_XSGMII:
 		if (chiptype) {
 			/* fifo inv clk */
 			rtpcs_sds_write_bits(sds, 0x41, 0x1, 7, 4, 0xf);
@@ -2747,42 +2782,6 @@ static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
 		}
 		break;
 
-	case RTPCS_SDS_MODE_10GBASER: /* 10GR1000BX_AUTO */
-		/* configure 10GR fiber mode=1 */
-		rtpcs_sds_write_bits(sds, 0x1f, 0xb, 1, 1, 1);
-
-		/* init fiber_1g */
-		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
-
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
-
-		/* init auto */
-		rtpcs_sds_write_bits(sds, 0x1f, 13, 15, 0, 0x109e);
-		rtpcs_sds_write_bits(sds, 0x1f, 0x6, 14, 10, 0x8);
-		rtpcs_sds_write_bits(sds, 0x1f, 0x7, 10, 4, 0x7f);
-		break;
-
-	case RTPCS_SDS_MODE_1000BASEX:
-		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
-
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
-		break;
-
-	case RTPCS_SDS_MODE_SGMII:
-		rtpcs_sds_write_bits(sds, 0x24, 0x9, 15, 15, 0);
-
-		/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
-		rtpcs_931x_sds_cmu_band_set(sds, true, 62, PHY_INTERFACE_MODE_SGMII);
-		break;
-
-	case RTPCS_SDS_MODE_2500BASEX:
-		rtpcs_sds_write_bits(sds, 0x41, 0x14, 8, 8, 1);
-		break;
-
 	case RTPCS_SDS_MODE_QSGMII:
 	default:
 		return -ENOTSUPP;



From lede-commits at lists.infradead.org  Tue Dec 23 09:56:37 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:56:37 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rename SerDes mode field
In-Reply-To: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
References: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
Message-ID: <mailman.38899.1766512602.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1912f45b485d1dec0bc2781914f789bedd890c67

commit 1912f45b485d1dec0bc2781914f789bedd890c67
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Wed Dec 17 21:33:17 2025 +0000

    realtek: pcs: rename SerDes mode field
    
    Rename the mode field in rtpcs_serdes from 'mode' to 'hw_mode' to make
    clear what it actually is, to avoid confusion with the phy_interface_t
    'mode' usually passed to functions.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21184
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 0a1d994da7..cdc18c0505 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -134,7 +134,7 @@ struct rtpcs_ctrl;
 struct rtpcs_serdes {
 	struct rtpcs_ctrl *ctrl;
 	u8 id;
-	enum rtpcs_sds_mode mode;
+	enum rtpcs_sds_mode hw_mode;
 
 	bool rx_pol_inv;
 	bool tx_pol_inv;



From lede-commits at lists.infradead.org  Tue Dec 23 09:56:44 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:56:44 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: separate and reuse
 1000base-x config
In-Reply-To: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
References: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
Message-ID: <mailman.38900.1766512605.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7899dfa6ef716aabc4cda07822ffaf80e23f2a4f

commit 7899dfa6ef716aabc4cda07822ffaf80e23f2a4f
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sun Dec 14 11:54:15 2025 +0000

    realtek: pcs: rtl931x: separate and reuse 1000base-x config
    
    Move the configuration of 1000Base-X mode into its own function. This
    way, redundant code can be replaced by a single function call.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21184
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 347800de78..fde80b66ba 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2676,6 +2676,17 @@ static sds_config sds_config_10p3125g_cmu_type1[] = {
 	{ 0x2F, 0x0F, 0xA470 }, { 0x2F, 0x10, 0x8000 }, { 0x2F, 0x11, 0x037B }
 };
 
+static int rtpcs_931x_sds_config_fiber_1g(struct rtpcs_serdes *sds)
+{
+	rtpcs_sds_write_bits(sds, 0x43, 0x12, 15, 14, 0x0);
+
+	rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 0x1);
+	rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 0x1);
+	rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0x0);
+
+	return 0;
+}
+
 static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
 				      enum rtpcs_sds_mode hw_mode, int chiptype)
 {
@@ -2686,11 +2697,7 @@ static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
 		break;
 
 	case RTPCS_SDS_MODE_1000BASEX:
-		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
-
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
+		rtpcs_931x_sds_config_fiber_1g(sds);
 		break;
 
 	case RTPCS_SDS_MODE_2500BASEX:
@@ -2701,12 +2708,7 @@ static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
 		/* configure 10GR fiber mode=1 */
 		rtpcs_sds_write_bits(sds, 0x1f, 0xb, 1, 1, 1);
 
-		/* init fiber_1g */
-		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
-
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 6, 6, 1);
-		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
+		rtpcs_931x_sds_config_fiber_1g(sds);
 
 		/* init auto */
 		rtpcs_sds_write_bits(sds, 0x1f, 13, 15, 0, 0x109e);



From lede-commits at lists.infradead.org  Tue Dec 23 09:56:41 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:56:41 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: map interface mode to
 hardware mode
In-Reply-To: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
References: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
Message-ID: <mailman.38901.1766512605.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d7a184e3b1fbb7b6c039bfd6ff88be7c581409cd

commit d7a184e3b1fbb7b6c039bfd6ff88be7c581409cd
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Mon Dec 15 17:37:01 2025 +0000

    realtek: pcs: rtl931x: map interface mode to hardware mode
    
    The PCS driver is intended to use a dedicated hardware mode in the
    future because the hardware capabilities and modes of the SerDes do not
    align with the PHY_INTERFACE_MODE_* modes.
    
    For the beginning, use the previously introduced generic mode mapping
    in the SerDes setup and assign the determined hardware mode to the
    corresponding field of a SerDes instance. This allows parallel usage of
    both mode representations for the time being, until the phy_interface_t
    modes can be dropped from internal functions completely.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21184
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 535bded4c3..381d205d0d 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -278,7 +278,6 @@ static struct rtpcs_link *rtpcs_phylink_pcs_to_link(struct phylink_pcs *pcs)
 	return container_of(pcs, struct rtpcs_link, pcs);
 }
 
-__maybe_unused
 static int rtpcs_sds_determine_hw_mode(struct rtpcs_serdes *sds,
                                        phy_interface_t if_mode,
                                        enum rtpcs_sds_mode *hw_mode)
@@ -2805,6 +2804,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	struct rtpcs_ctrl *ctrl = sds->ctrl;
 	u32 band, ori, model_info, val;
+	enum rtpcs_sds_mode hw_mode;
 	u32 sds_id = sds->id;
 	int ret, chiptype = 0;
 
@@ -2854,6 +2854,13 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 	/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
 	band = rtpcs_931x_sds_cmu_band_get(sds, mode);
 
+	ret = rtpcs_sds_determine_hw_mode(sds, mode, &hw_mode);
+	if (ret < 0) {
+		dev_err(ctrl->dev, "SerDes %u doesn't support %s mode\n", sds_id,
+			phy_modes(mode));
+		return -ENOTSUPP;
+	}
+
 	ret = rtpcs_931x_sds_config_mode(sds, mode, chiptype);
 	if (ret < 0)
 		return ret;
@@ -2894,6 +2901,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 		else
 			rtpcs_931x_sds_fiber_mode_set(sds, mode);
 	}
+	sds->hw_mode = hw_mode;
 
 	return 0;
 }



From lede-commits at lists.infradead.org  Tue Dec 23 09:56:42 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:56:42 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: use hardware mode for
 configuration
In-Reply-To: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
References: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
Message-ID: <mailman.38902.1766512605.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6079228b110138621a61d32a8acb3b4fa1c2579f

commit 6079228b110138621a61d32a8acb3b4fa1c2579f
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Mon Dec 15 17:44:00 2025 +0000

    realtek: pcs: rtl931x: use hardware mode for configuration
    
    Pass the SerDes hardware mode to rtpcs_931x_sds_config_mode instead of
    the PHY_INTERFACE_MODE_* mode and use it. Replace matched modes
    accordingly.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21184
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 29 +++++++++++++---------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 381d205d0d..1ed8858ff1 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2677,15 +2677,15 @@ static sds_config sds_config_10p3125g_cmu_type1[] = {
 };
 
 static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
-				      phy_interface_t mode, int chiptype)
+				      enum rtpcs_sds_mode hw_mode, int chiptype)
 {
 	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 
-	switch (mode) {
-	case PHY_INTERFACE_MODE_NA:
+	switch (hw_mode) {
+	case RTPCS_SDS_MODE_OFF:
 		break;
 
-	case PHY_INTERFACE_MODE_XGMII: /* MII_XSGMII */
+	case RTPCS_SDS_MODE_XSGMII:
 
 		if (chiptype) {
 			/* fifo inv clk */
@@ -2700,7 +2700,12 @@ static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
 		rtpcs_sds_write_bits(sds, 0x80, 0xE, 12, 12, 1);
 		break;
 
-	case PHY_INTERFACE_MODE_USXGMII: /* MII_USXGMII_10GSXGMII/10GDXGMII/10GQXGMII: */
+	case RTPCS_SDS_MODE_USXGMII_10GSXGMII:
+	case RTPCS_SDS_MODE_USXGMII_10GDXGMII:
+	case RTPCS_SDS_MODE_USXGMII_10GQXGMII:
+	case RTPCS_SDS_MODE_USXGMII_5GSXGMII:
+	case RTPCS_SDS_MODE_USXGMII_5GDXGMII:
+	case RTPCS_SDS_MODE_USXGMII_2_5GSXGMII:
 		u32 op_code = 0x6003;
 
 		if (chiptype) {
@@ -2742,8 +2747,8 @@ static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
 		}
 		break;
 
-	case PHY_INTERFACE_MODE_10GBASER: /* MII_10GR / MII_10GR1000BX_AUTO: */
-					  /* configure 10GR fiber mode=1 */
+	case RTPCS_SDS_MODE_10GBASER: /* 10GR1000BX_AUTO */
+		/* configure 10GR fiber mode=1 */
 		rtpcs_sds_write_bits(sds, 0x1f, 0xb, 1, 1, 1);
 
 		/* init fiber_1g */
@@ -2759,7 +2764,7 @@ static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
 		rtpcs_sds_write_bits(sds, 0x1f, 0x7, 10, 4, 0x7f);
 		break;
 
-	case PHY_INTERFACE_MODE_1000BASEX: /* MII_1000BX_FIBER */
+	case RTPCS_SDS_MODE_1000BASEX:
 		rtpcs_sds_write_bits(sds, 0x43, 0x13, 15, 14, 0);
 
 		rtpcs_sds_write_bits(sds, 0x42, 0x0, 12, 12, 1);
@@ -2767,18 +2772,18 @@ static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
 		rtpcs_sds_write_bits(sds, 0x42, 0x0, 13, 13, 0);
 		break;
 
-	case PHY_INTERFACE_MODE_SGMII:
+	case RTPCS_SDS_MODE_SGMII:
 		rtpcs_sds_write_bits(sds, 0x24, 0x9, 15, 15, 0);
 
 		/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
 		rtpcs_931x_sds_cmu_band_set(sds, true, 62, PHY_INTERFACE_MODE_SGMII);
 		break;
 
-	case PHY_INTERFACE_MODE_2500BASEX:
+	case RTPCS_SDS_MODE_2500BASEX:
 		rtpcs_sds_write_bits(sds, 0x41, 0x14, 8, 8, 1);
 		break;
 
-	case PHY_INTERFACE_MODE_QSGMII:
+	case RTPCS_SDS_MODE_QSGMII:
 	default:
 		return -ENOTSUPP;
 	}
@@ -2861,7 +2866,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 		return -ENOTSUPP;
 	}
 
-	ret = rtpcs_931x_sds_config_mode(sds, mode, chiptype);
+	ret = rtpcs_931x_sds_config_mode(sds, hw_mode, chiptype);
 	if (ret < 0)
 		return ret;
 



From lede-commits at lists.infradead.org  Tue Dec 23 09:56:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:56:45 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: add helper for SerDes power
 up/down
In-Reply-To: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
References: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
Message-ID: <mailman.38905.1766512605.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b43f7bc9c21c291426852f3a499b4814f2b686d1

commit b43f7bc9c21c291426852f3a499b4814f2b686d1
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Mon Dec 15 19:41:16 2025 +0000

    realtek: pcs: rtl931x: add helper for SerDes power up/down
    
    Add a dedicated helper 'rtpcs_931x_sds_power' to power down/up a SerDes.
    Up to now, plain register writes to the corresponding register were used
    in several places and with slightly different syntax. Use the helper to
    replace the existing boilerplate code for powering on/off SerDes.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21184
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 29 +++++++++++-----------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index fde80b66ba..d2268ae76d 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2305,18 +2305,25 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 
 /* RTL931X */
 
+static int rtpcs_931x_sds_power(struct rtpcs_serdes *sds, bool power_on)
+{
+	u32 en_val = power_on ? 0 : BIT(sds->id);
+
+	return regmap_write_bits(sds->ctrl->map,
+				 RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR,
+				 BIT(sds->id), en_val);
+}
+
 static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
 {
 	struct rtpcs_ctrl *ctrl = sds->ctrl;
 	u32 sds_id = sds->id;
-	u32 o, v, o_mode;
+	u32 v, o_mode;
 	int shift = ((sds_id & 0x3) << 3);
 
 	/* TODO: We need to lock this! */
 
-	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &o);
-	v = o | BIT(sds_id);
-	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, v);
+	rtpcs_931x_sds_power(sds, false);
 
 	regmap_read(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), &o_mode);
 	v = BIT(7) | 0x1F;
@@ -2324,7 +2331,7 @@ static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
 			  0xff << shift, v << shift);
 	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), o_mode);
 
-	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, o);
+	rtpcs_931x_sds_power(sds, true);
 }
 
 static void rtpcs_931x_sds_disable(struct rtpcs_serdes *sds)
@@ -2809,8 +2816,8 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 	};
 	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 	struct rtpcs_ctrl *ctrl = sds->ctrl;
-	u32 band, ori, model_info, val;
 	enum rtpcs_sds_mode hw_mode;
+	u32 band, model_info, val;
 	u32 sds_id = sds->id;
 	int ret, chiptype = 0;
 
@@ -2852,10 +2859,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 
 	pr_info("%s: 2.5gbit %08X", __func__, rtpcs_sds_read(sds, 0x41, 0x14));
 
-	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &ori);
-	pr_info("%s: RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR 0x%08X\n", __func__, ori);
-	val = ori | (1 << sds_id);
-	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
+	rtpcs_931x_sds_power(sds, false);
 
 	/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
 	band = rtpcs_931x_sds_cmu_band_get(sds, mode);
@@ -2893,10 +2897,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 
 	rtpcs_931x_sds_set_polarity(sds, sds->tx_pol_inv, sds->rx_pol_inv);
 
-	val = ori & ~BIT(sds_id);
-	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
-	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &val);
-	pr_debug("%s: RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR 0x%08X\n", __func__, val);
+	rtpcs_931x_sds_power(sds, true);
 
 	if (mode == PHY_INTERFACE_MODE_XGMII ||
 	    mode == PHY_INTERFACE_MODE_QSGMII ||



From lede-commits at lists.infradead.org  Tue Dec 23 09:56:38 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:56:38 -0500
Subject: [openwrt/openwrt]  realtek: pcs: add mapping for SerDes hardware mode
In-Reply-To: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
References: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
Message-ID: <mailman.38906.1766512605.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0f176ef961585d28100ed98011eec9918aba3e51

commit 0f176ef961585d28100ed98011eec9918aba3e51
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Dec 19 10:11:06 2025 +0000

    realtek: pcs: add mapping for SerDes hardware mode
    
    Add a generic mapper for mapping the PHY_INTERFACE_MODE_* modes to the
    SerDes hardware modes RTPCS_SDS_MODE_*. This is to be used by all
    subtargets step-by-step and avoids having subtarget-specific code for
    that simple mapping.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21184
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index cdc18c0505..61f7339533 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -278,6 +278,43 @@ static struct rtpcs_link *rtpcs_phylink_pcs_to_link(struct phylink_pcs *pcs)
 	return container_of(pcs, struct rtpcs_link, pcs);
 }
 
+__maybe_unused
+static int rtpcs_sds_determine_hw_mode(struct rtpcs_serdes *sds,
+                                       phy_interface_t if_mode,
+                                       enum rtpcs_sds_mode *hw_mode)
+{
+	switch (if_mode) {
+	case PHY_INTERFACE_MODE_NA:
+		*hw_mode = RTPCS_SDS_MODE_OFF;
+		break;
+	case PHY_INTERFACE_MODE_1000BASEX:
+		*hw_mode = RTPCS_SDS_MODE_1000BASEX;
+		break;
+	case PHY_INTERFACE_MODE_2500BASEX:
+		*hw_mode = RTPCS_SDS_MODE_2500BASEX;
+		break;
+	case PHY_INTERFACE_MODE_10GBASER:
+		*hw_mode = RTPCS_SDS_MODE_10GBASER;
+		break;
+	case PHY_INTERFACE_MODE_SGMII:
+		*hw_mode = RTPCS_SDS_MODE_SGMII;
+		break;
+	case PHY_INTERFACE_MODE_QSGMII:
+		*hw_mode = RTPCS_SDS_MODE_QSGMII;
+		break;
+	case PHY_INTERFACE_MODE_USXGMII:
+		/* TODO: set this depending on number of links on SerDes */
+		*hw_mode = RTPCS_SDS_MODE_USXGMII_10GSXGMII;
+		break;
+	default:
+		return -ENOTSUPP;
+	}
+
+	/* TODO: check if the particular SerDes supports the mode */
+
+	return 0;
+}
+
 /* Variant-specific functions */
 
 /* RTL838X */



From lede-commits at lists.infradead.org  Tue Dec 23 09:56:40 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:56:40 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: move SerDes config out of
 setup
In-Reply-To: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
References: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
Message-ID: <mailman.38907.1766512605.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9856f6b0aa3250f83818d0860abe201de3f658fa

commit 9856f6b0aa3250f83818d0860abe201de3f658fa
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sun Dec 14 11:34:34 2025 +0000

    realtek: pcs: rtl931x: move SerDes config out of setup
    
    Slim the rtpcs_931x_setup_serdes entrypoint by moving the SerDes
    configuration sequences for the different SerDes modes into a dedicated
    function called rtpcs_931x_sds_config_mode. They form a logical block
    similar to what the SDK does and can be taken out to follow the
    'divide & conquer' principle.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21184
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 144 +++++++++++----------
 1 file changed, 77 insertions(+), 67 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 3e8e767d35..535bded4c3 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2677,72 +2677,10 @@ static sds_config sds_config_10p3125g_cmu_type1[] = {
 	{ 0x2F, 0x0F, 0xA470 }, { 0x2F, 0x10, 0x8000 }, { 0x2F, 0x11, 0x037B }
 };
 
-static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
-				   phy_interface_t mode)
+static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
+				      phy_interface_t mode, int chiptype)
 {
-	u32 board_sds_tx_type1[] = {
-		0x01c3, 0x01c3, 0x01c3, 0x01a3, 0x01a3, 0x01a3,
-		0x0143, 0x0143, 0x0143, 0x0143, 0x0163, 0x0163,
-	};
-	u32 board_sds_tx[] = {
-		0x1a00, 0x1a00, 0x0200, 0x0200, 0x0200, 0x0200,
-		0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01e3, 0x01e3
-	};
-	u32 board_sds_tx2[] = {
-		0x0dc0, 0x01c0, 0x0200, 0x0180, 0x0160, 0x0123,
-		0x0123, 0x0163, 0x01a3, 0x01a0, 0x01c3, 0x09c3,
-	};
 	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
-	struct rtpcs_ctrl *ctrl = sds->ctrl;
-	u32 band, ori, model_info, val;
-	u32 sds_id = sds->id;
-	int chiptype = 0;
-
-	/*
-	 * TODO: USXGMII is currently the swiss army knife to declare 10G
-	 * multi port PHYs. Real devices use other modes instead. Especially
-	 *
-	 * - RTL8224 is driven in 10G_QXGMII
-	 * - RTL8218D/E are driven in (Realtek proprietary) XSGMII (10G SGMII)
-	 *
-	 * For now disable all USXGMII SerDes handling and rely on U-Boot setup.
-	 */
-	if (mode == PHY_INTERFACE_MODE_USXGMII)
-		return 0;
-
-	pr_info("%s: set sds %d to mode %d\n", __func__, sds_id, mode);
-	val = rtpcs_sds_read_bits(sds, 0x1F, 0x9, 11, 6);
-
-	pr_info("%s: fibermode %08X stored mode 0x%x", __func__,
-		rtpcs_sds_read(sds, 0x1f, 0x9), val);
-	pr_info("%s: SGMII mode %08X in 0x24 0x9", __func__,
-		rtpcs_sds_read(sds, 0x24, 0x9));
-	pr_info("%s: CMU mode %08X stored even SDS %d", __func__,
-		rtpcs_sds_read(even_sds, 0x20, 0x12), even_sds->id);
-	pr_info("%s: serdes_mode_ctrl %08X", __func__,  RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2));
-	pr_info("%s CMU page 0x24 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x24, 0x7));
-	pr_info("%s CMU page 0x26 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x26, 0x7));
-	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
-	pr_info("%s XSG page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(sds, 0x40, 0xe));
-	pr_info("%s XSG2 page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(sds, 0x80, 0xe));
-
-	regmap_read(ctrl->map, RTL93XX_MODEL_NAME_INFO, &model_info);
-	if ((model_info >> 4) & 0x1) {
-		pr_info("detected chiptype 1\n");
-		chiptype = 1;
-	} else {
-		pr_info("detected chiptype 0\n");
-	}
-
-	pr_info("%s: 2.5gbit %08X", __func__, rtpcs_sds_read(sds, 0x41, 0x14));
-
-	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &ori);
-	pr_info("%s: RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR 0x%08X\n", __func__, ori);
-	val = ori | (1 << sds_id);
-	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
-
-	/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
-	band = rtpcs_931x_sds_cmu_band_get(sds, mode);
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_NA:
@@ -2834,7 +2772,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 		rtpcs_sds_write_bits(sds, 0x24, 0x9, 15, 15, 0);
 
 		/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
-		band = rtpcs_931x_sds_cmu_band_set(sds, true, 62, PHY_INTERFACE_MODE_SGMII);
+		rtpcs_931x_sds_cmu_band_set(sds, true, 62, PHY_INTERFACE_MODE_SGMII);
 		break;
 
 	case PHY_INTERFACE_MODE_2500BASEX:
@@ -2843,11 +2781,83 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 
 	case PHY_INTERFACE_MODE_QSGMII:
 	default:
-		pr_info("%s: PHY mode %s not supported by SerDes %d\n",
-			__func__, phy_modes(mode), sds_id);
 		return -ENOTSUPP;
 	}
 
+	return 0;
+}
+
+static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
+				   phy_interface_t mode)
+{
+	u32 board_sds_tx_type1[] = {
+		0x01c3, 0x01c3, 0x01c3, 0x01a3, 0x01a3, 0x01a3,
+		0x0143, 0x0143, 0x0143, 0x0143, 0x0163, 0x0163,
+	};
+	u32 board_sds_tx[] = {
+		0x1a00, 0x1a00, 0x0200, 0x0200, 0x0200, 0x0200,
+		0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01e3, 0x01e3
+	};
+	u32 board_sds_tx2[] = {
+		0x0dc0, 0x01c0, 0x0200, 0x0180, 0x0160, 0x0123,
+		0x0123, 0x0163, 0x01a3, 0x01a0, 0x01c3, 0x09c3,
+	};
+	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
+	struct rtpcs_ctrl *ctrl = sds->ctrl;
+	u32 band, ori, model_info, val;
+	u32 sds_id = sds->id;
+	int ret, chiptype = 0;
+
+	/*
+	 * TODO: USXGMII is currently the swiss army knife to declare 10G
+	 * multi port PHYs. Real devices use other modes instead. Especially
+	 *
+	 * - RTL8224 is driven in 10G_QXGMII
+	 * - RTL8218D/E are driven in (Realtek proprietary) XSGMII (10G SGMII)
+	 *
+	 * For now disable all USXGMII SerDes handling and rely on U-Boot setup.
+	 */
+	if (mode == PHY_INTERFACE_MODE_USXGMII)
+		return 0;
+
+	pr_info("%s: set sds %d to mode %d\n", __func__, sds_id, mode);
+	val = rtpcs_sds_read_bits(sds, 0x1F, 0x9, 11, 6);
+
+	pr_info("%s: fibermode %08X stored mode 0x%x", __func__,
+		rtpcs_sds_read(sds, 0x1f, 0x9), val);
+	pr_info("%s: SGMII mode %08X in 0x24 0x9", __func__,
+		rtpcs_sds_read(sds, 0x24, 0x9));
+	pr_info("%s: CMU mode %08X stored even SDS %d", __func__,
+		rtpcs_sds_read(even_sds, 0x20, 0x12), even_sds->id);
+	pr_info("%s: serdes_mode_ctrl %08X", __func__,  RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2));
+	pr_info("%s CMU page 0x24 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x24, 0x7));
+	pr_info("%s CMU page 0x26 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x26, 0x7));
+	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
+	pr_info("%s XSG page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(sds, 0x40, 0xe));
+	pr_info("%s XSG2 page 0x0 0xe %08x\n", __func__, rtpcs_sds_read(sds, 0x80, 0xe));
+
+	regmap_read(ctrl->map, RTL93XX_MODEL_NAME_INFO, &model_info);
+	if ((model_info >> 4) & 0x1) {
+		pr_info("detected chiptype 1\n");
+		chiptype = 1;
+	} else {
+		pr_info("detected chiptype 0\n");
+	}
+
+	pr_info("%s: 2.5gbit %08X", __func__, rtpcs_sds_read(sds, 0x41, 0x14));
+
+	regmap_read(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, &ori);
+	pr_info("%s: RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR 0x%08X\n", __func__, ori);
+	val = ori | (1 << sds_id);
+	regmap_write(ctrl->map, RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR, val);
+
+	/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
+	band = rtpcs_931x_sds_cmu_band_get(sds, mode);
+
+	ret = rtpcs_931x_sds_config_mode(sds, mode, chiptype);
+	if (ret < 0)
+		return ret;
+
 	rtpcs_931x_sds_cmu_type_set(sds, mode, chiptype);
 
 	if (sds_id >= 2) {



From lede-commits at lists.infradead.org  Tue Dec 23 09:56:39 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 23 Dec 2025 12:56:39 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: don't return error on
 USXGMII setup
In-Reply-To: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
References: <176651259762.1503830.8249251713455250668@git-01.infra.openwrt.org>
Message-ID: <mailman.38908.1766512608.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/93296c9e8555273a613a840d518fc0158747a0bf

commit 93296c9e8555273a613a840d518fc0158747a0bf
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Tue Nov 11 09:55:42 2025 +0000

    realtek: pcs: rtl931x: don't return error on USXGMII setup
    
    Configuring USXGMII on RTL931X was disable because it is not setup
    properly right now. Affected devices need to rely on U-boot setup for
    now. However, it is not the proper way to return an error in case we
    just want to skip USXGMII configuration. Thus, just return 0 in that
    case indicating it is properly configured.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21184
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 61f7339533..3e8e767d35 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2708,7 +2708,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 	 * For now disable all USXGMII SerDes handling and rely on U-Boot setup.
 	 */
 	if (mode == PHY_INTERFACE_MODE_USXGMII)
-		return -ENOTSUPP;
+		return 0;
 
 	pr_info("%s: set sds %d to mode %d\n", __func__, sds_id, mode);
 	val = rtpcs_sds_read_bits(sds, 0x1F, 0x9, 11, 6);



From lede-commits at lists.infradead.org  Wed Dec 24 01:05:55 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 04:05:55 -0500
Subject: [openwrt/openwrt]  build: fix missing PKG_INFO_DIR
In-Reply-To: <176656715563.1786072.10233573935078488699@git-01.infra.openwrt.org>
References: <176656715563.1786072.10233573935078488699@git-01.infra.openwrt.org>
Message-ID: <mailman.39096.1766567162.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/56bc4a0d894f18933c6de2b65a042d4f34f50cd9

commit 56bc4a0d894f18933c6de2b65a042d4f34f50cd9
Author: George Sapkin <george at sapk.in>
AuthorDate: Wed Dec 24 04:28:49 2025 +0200

    build: fix missing PKG_INFO_DIR
    
    If the first built package has an ABI, PKG_INFO_DIR might not exist, so
    ensure it does.
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21265
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 include/package-pack.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/package-pack.mk b/include/package-pack.mk
index 980fe29f69..b38000ca97 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -191,6 +191,7 @@ endif
     $(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
 	mkdir -p $(STAGING_DIR_ROOT)/stamp
 	$(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || { \
+		mkdir -p $(PKG_INFO_DIR); \
 		echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version; \
 		$(foreach pkg,$(filter-out $(1),$(PROVIDES)), \
 			cp $(PKG_INFO_DIR)/$(1).version $(PKG_INFO_DIR)/$(pkg).version; \



From lede-commits at lists.infradead.org  Wed Dec 24 01:05:56 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 04:05:56 -0500
Subject: [openwrt/openwrt]  toolchain: fix libgcc ABI for libc
In-Reply-To: <176656715563.1786072.10233573935078488699@git-01.infra.openwrt.org>
References: <176656715563.1786072.10233573935078488699@git-01.infra.openwrt.org>
Message-ID: <mailman.39097.1766567162.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5e32bfbf4bbe8fa4517f27d91d5f53177f7b836a

commit 5e32bfbf4bbe8fa4517f27d91d5f53177f7b836a
Author: George Sapkin <george at sapk.in>
AuthorDate: Wed Dec 24 04:32:01 2025 +0200

    toolchain: fix libgcc ABI for libc
    
    libc depends on knowing libgcc's ABI, so it needs to be evaluated first.
    Otherwise libc will depend on an ABI-less libgcc causing the rest of the
    toolchain to fail.
    
    Building package index...
    ERROR: unable to select packages:
      libgcc (virtual):
        note: please select one of the 'provided by'
              packages explicitly
        provided by: libgcc1
        required by: world[libgcc]
    
    Before:
    
    libc fused dependencies: libgcc
    libgcc fused dependencies:
    libatomic fused dependencies: libgcc1
    
    After:
    
    libgcc fused dependencies:
    libc fused dependencies: libgcc1
    libatomic fused dependencies: libgcc1
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21265
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/libs/toolchain/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile
index f73004bddd..f1f15eddc0 100644
--- a/package/libs/toolchain/Makefile
+++ b/package/libs/toolchain/Makefile
@@ -781,8 +781,9 @@ else
 
 endif
 
-$(eval $(call BuildPackage,libc))
 $(eval $(call BuildPackage,libgcc))
+# libc depends on knowing libgcc's ABI, so it needs to be evaluated first
+$(eval $(call BuildPackage,libc))
 $(eval $(call BuildPackage,libatomic))
 $(eval $(call BuildPackage,libquadmath))
 $(eval $(call BuildPackage,libstdcpp))



From lede-commits at lists.infradead.org  Wed Dec 24 01:36:35 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 04:36:35 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: remove ipq5018 and qcn6122
 wifi m3 fw
In-Reply-To: <176656899508.2030623.17865322272915135813@git-01.infra.openwrt.org>
References: <176656899508.2030623.17865322272915135813@git-01.infra.openwrt.org>
Message-ID: <mailman.39108.1766569000.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/423cda97f9e5152c6e9ad210d7a6b089d3664f28

commit 423cda97f9e5152c6e9ad210d7a6b089d3664f28
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Tue Dec 9 15:47:06 2025 +0400

    qualcommax: ipq50xx: remove ipq5018 and qcn6122 wifi m3 fw
    
    The current ath11k driver does not support loading m3 firmware for
    IPQ5018 and QCN6122 wifi. Although m3 firmware entries are specified
    in Q6 WCSS nodes, the driver actually skips loading them. Editing the
    driver to force loading m3 results in Q6 crashes and non-functioning
    wifi. As such, remove m3 firmware entries for all boards until there's
    proper support in the ath11k driver.
    
    Signed-off-by: George Moussalem <george.moussalem at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21110
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts    |   3 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-ax850.dts     |   3 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts    |   3 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts    |   3 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi  |   4 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts   |   3 +-
 ...-qcom-wcss-sec-add-split-firmware-support.patch | 102 ---------------------
 7 files changed, 6 insertions(+), 115 deletions(-)

diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts
index 4782101483..a0b94bd2f7 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts
@@ -572,8 +572,7 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
-			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts
index 592fc84c5b..0593c955e0 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts
@@ -399,8 +399,7 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
-			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts
index 77be190dc4..07fc612b2a 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts
@@ -321,8 +321,7 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
-			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts
index 2883a466f3..2dc77594c1 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts
@@ -168,8 +168,7 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
-			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi
index a59c6ceda3..ceb03b00a3 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi
@@ -12,9 +12,7 @@
 &q6v5_wcss {
 	compatible = "qcom,ipq5018-q6-mpd";
 
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
-			"ath11k/IPQ5018/hw1.0/m3_fw.mdt",
- 			"ath11k/QCN6122/hw1.0/m3_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
 
 	// IPQ5018
 	q6_wcss_pd1: pd-1 {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts
index 6ee86d6029..423a3f0535 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts
@@ -179,8 +179,7 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
-			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/patches-6.12/0808-remoteproc-qcom-wcss-sec-add-split-firmware-support.patch b/target/linux/qualcommax/patches-6.12/0808-remoteproc-qcom-wcss-sec-add-split-firmware-support.patch
deleted file mode 100644
index 29644e3fdb..0000000000
--- a/target/linux/qualcommax/patches-6.12/0808-remoteproc-qcom-wcss-sec-add-split-firmware-support.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-From: George Moussalem <george.moussalem at outlook.com>
-Date: Tue, 21 Oct 2025 15:26:31 +0400
-Subject: [PATCH] remoteproc: qcom: wcss-sec: add split firmware support
-
-The driver currently expects only one firmware file to be loaded as part
-of bringing up WCSS. For IPQ5018 and QCN6122, multiple firmware files are
-required, both the q6 and m3 firmware files. As such, add support for
-loading up to 3 firmware files.
-
-Signed-off-by: George Moussalem <george.moussalem at outlook.com>
----
---- a/drivers/remoteproc/qcom_q6v5_wcss_sec.c
-+++ b/drivers/remoteproc/qcom_q6v5_wcss_sec.c
-@@ -25,6 +25,8 @@
- 
- #define Q6_WAIT_TIMEOUT			(5 * HZ)
- 
-+#define MAX_FIRMWARE			3
-+
- struct wcss_sec {
- 	struct device *dev;
- 	struct qcom_rproc_glink glink_subdev;
-@@ -35,6 +37,7 @@ struct wcss_sec {
- 	void *mem_region;
- 	size_t mem_size;
- 	const struct wcss_data *desc;
-+	const char **firmware;
- 
- 	struct mbox_client mbox_client;
- 	struct mbox_chan *mbox_chan;
-@@ -137,7 +140,8 @@ static int wcss_sec_load(struct rproc *r
- {
- 	struct wcss_sec *wcss = rproc->priv;
- 	struct device *dev = wcss->dev;
--	int ret;
-+	const struct firmware *fw_hdl;
-+	int i, ret;
- 
- 	if (wcss->desc->use_tmelcom) {
- 		wcss->metadata = qcom_mdt_read_metadata(fw, &wcss->metadata_len,
-@@ -161,6 +165,28 @@ static int wcss_sec_load(struct rproc *r
- 				    wcss->mem_phys, wcss->mem_size, &wcss->mem_reloc);
- 		if (ret)
- 			return ret;
-+
-+		for (i = 1; i < MAX_FIRMWARE; i++) {
-+			if (!wcss->firmware[i])
-+				continue;
-+
-+			ret = request_firmware(&fw_hdl, wcss->firmware[i], dev);
-+
-+			if (ret)
-+				continue;
-+
-+			ret = qcom_mdt_load_no_init(dev, fw_hdl, wcss->firmware[i], 0,
-+						    wcss->mem_region, wcss->mem_phys,
-+						    wcss->mem_size, &wcss->mem_reloc);
-+
-+			release_firmware(fw_hdl);
-+
-+			if (ret) {
-+				dev_err(dev, "error %d loading firmware %s\n",
-+					ret, wcss->firmware[i]);
-+				return ret;
-+			}
-+		}
- 	}
- 
- 	qcom_pil_info_store("wcss", wcss->mem_phys, wcss->mem_size);
-@@ -291,17 +317,20 @@ static int wcss_sec_probe(struct platfor
- 	struct wcss_sec *wcss;
- 	struct clk *sleep_clk;
- 	struct clk *int_clk;
--	const char *fw_name = NULL;
-+	const char **firmware = NULL;
- 	const struct wcss_data *desc = of_device_get_match_data(&pdev->dev);
- 	int ret;
- 
--	ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
--				      &fw_name);
-+	firmware = devm_kcalloc(&pdev->dev, MAX_FIRMWARE,
-+				sizeof(*firmware), GFP_KERNEL);
-+
-+	ret = of_property_read_string_array(pdev->dev.of_node, "firmware-name",
-+					    firmware, MAX_FIRMWARE);
- 	if (ret < 0)
- 		return ret;
- 
- 	rproc = devm_rproc_alloc(&pdev->dev, desc->ss_name, &wcss_sec_ops,
--				 fw_name, sizeof(*wcss));
-+				 firmware[0], sizeof(*wcss));
- 	if (!rproc) {
- 		dev_err(&pdev->dev, "failed to allocate rproc\n");
- 		return -ENOMEM;
-@@ -310,6 +339,7 @@ static int wcss_sec_probe(struct platfor
- 	wcss = rproc->priv;
- 	wcss->dev = &pdev->dev;
- 	wcss->desc = desc;
-+	wcss->firmware = firmware;
- 
- 	ret = wcss_sec_alloc_memory_region(wcss);
- 	if (ret)



From lede-commits at lists.infradead.org  Wed Dec 24 01:42:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 04:42:45 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: move bootargs to Linksys
 board files
In-Reply-To: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
References: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
Message-ID: <mailman.39109.1766569368.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/606a87ec442736afe3ffed60c3572bbd1ae153aa

commit 606a87ec442736afe3ffed60c3572bbd1ae153aa
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Tue Dec 9 15:12:32 2025 +0400

    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 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21038
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts     | 5 +++++
 .../qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi   | 5 -----
 .../qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx2000.dts     | 5 +++++
 .../qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts     | 5 +++++
 .../qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts    | 5 +++++
 5 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts
index 07fc612b2a..8ff30ec436 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts
@@ -7,6 +7,11 @@
 	model = "Linksys MR5500";
 	compatible = "linksys,mr5500", "qcom,ipq5018";
 
+	chosen {
+		bootargs-append = " root=/dev/ubiblock0_0 coherent_pool=2M";
+		stdout-path = "serial0:115200n8";
+	};
+
 	gpio-leds {
 		compatible = "gpio-leds";
 
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
index 76c0384617..629f523c5d 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
@@ -15,11 +15,6 @@
 		serial0 = &blsp1_uart1;
 	};
 
-	chosen {
-		bootargs-append = " root=/dev/ubiblock0_0 coherent_pool=2M";
-		stdout-path = "serial0:115200n8";
-	};
-
 	keys {
 		compatible = "gpio-keys";
 		pinctrl-0 = <&button_pins>;
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx2000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx2000.dts
index f6b58d2cbc..428912332c 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx2000.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx2000.dts
@@ -7,6 +7,11 @@
 / {
 	model = "Linksys MX2000";
 	compatible = "linksys,mx2000", "qcom,ipq5018";
+
+	chosen {
+		bootargs-append = " root=/dev/ubiblock0_0 coherent_pool=2M";
+		stdout-path = "serial0:115200n8";
+	};
 };
 
 /*
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts
index 2dc77594c1..0ea27d3373 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts
@@ -6,6 +6,11 @@
 / {
 	model = "Linksys MX5500";
 	compatible = "linksys,mx5500", "qcom,ipq5018";
+
+	chosen {
+		bootargs-append = " root=/dev/ubiblock0_0 coherent_pool=2M";
+		stdout-path = "serial0:115200n8";
+	};
 };
 
 /*
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts
index 423a3f0535..90a87299a6 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts
@@ -6,6 +6,11 @@
 / {
 	model = "Linksys SPNMX56";
 	compatible = "linksys,spnmx56", "qcom,ipq5018";
+
+	chosen {
+		bootargs-append = " root=/dev/ubiblock0_0 coherent_pool=2M";
+		stdout-path = "serial0:115200n8";
+	};
 };
 
 /*



From lede-commits at lists.infradead.org  Wed Dec 24 01:42:47 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 04:42:47 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: upgrade SMEM dualboot Linksys
 devices
In-Reply-To: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
References: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
Message-ID: <mailman.39110.1766569370.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7d685825794a613f67543d0e00f31dca5d8163ba

commit 7d685825794a613f67543d0e00f31dca5d8163ba
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Thu Dec 4 09:20:00 2025 +0400

    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 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21038
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../ipq50xx/base-files/lib/upgrade/platform.sh     | 77 ++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
index 9d921f73b6..bbc6d8eb7f 100644
--- a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
@@ -1,3 +1,5 @@
+. /lib/functions/bootconfig.sh
+
 PART_NAME=firmware
 REQUIRE_IMAGE_METADATA=1
 
@@ -50,6 +52,81 @@ remove_oem_ubi_volume() {
 	fi
 }
 
+linksys_bootconfig_set_primaryboot() {
+	local partname=$1
+	local tempfile
+	local mtdidx
+
+	mtdidx=$(find_mtd_index "$partname")
+	[ ! "$mtdidx" ] && {
+		echo "cannot find mtd index for $partname"
+		return 1
+	}
+
+	# No need to cleanup as files in /tmp will be removed upon reboot
+	tempfile=/tmp/mtd"$mtdidx".bin
+	dd if=/dev/mtd"$mtdidx" of="$tempfile" bs=1 count=336 2>/dev/null
+	[ $? -ne 0 ] || [ ! -f "$tempfile" ]&& {
+		echo "failed to create a temp copy of /dev/mtd$mtdidx"
+		return 1
+	}
+
+	set_bootconfig_primaryboot "$tempfile" "0:HLOS" $2
+	[ $? -ne 0 ] && {
+		echo "failed to toggle primaryboot on 0:HLOS part"
+		return 1
+	}
+	
+	set_bootconfig_primaryboot "$tempfile" "rootfs" $2
+	[ $? -ne 0 ] && {
+		echo "failed to toggle primaryboot for rootfs part"
+		return 1
+	}
+
+	mtd write "$tempfile" /dev/mtd"$mtdidx" 2>/dev/null
+	[ $? -ne 0 ] && {
+		echo "failed to write temp copy back to /dev/mtd$mtdidx"
+		return 1
+	}
+}
+
+linksys_bootconfig_pre_upgrade() {
+	local setenv_script="/tmp/fw_env_upgrade"
+
+	CI_UBIPART="rootfs_1"
+	boot_part="$(fw_printenv -n boot_part)"
+	if [ -n "$UPGRADE_OPT_USE_CURR_PART" ]; then
+		CI_UBIPART="rootfs"
+	else
+		if [ "$boot_part" -eq "1" ]; then
+			echo "boot_part 2" >> $setenv_script
+			linksys_bootconfig_set_primaryboot "0:bootconfig" 1
+			linksys_bootconfig_set_primaryboot "0:bootconfig1" 1
+		else
+			echo "boot_part 1" >> $setenv_script
+			linksys_bootconfig_set_primaryboot "0:bootconfig" 0
+			linksys_bootconfig_set_primaryboot "0:bootconfig1" 0
+		fi
+	fi
+
+	boot_part_ready="$(fw_printenv -n boot_part_ready)"
+	if [ "$boot_part_ready" -ne "3" ]; then
+		echo "boot_part_ready 3" >> $setenv_script
+	fi
+
+	auto_recovery="$(fw_printenv -n auto_recovery)"
+	if [ "$auto_recovery" != "yes" ]; then
+		echo "auto_recovery yes" >> $setenv_script
+	fi
+
+	if [ -f "$setenv_script" ]; then
+		fw_setenv -s $setenv_script || {
+			echo "failed to update U-Boot environment"
+			return 1
+		}
+	fi
+}
+
 linksys_mx_pre_upgrade() {
 	local setenv_script="/tmp/fw_env_upgrade"
 



From lede-commits at lists.infradead.org  Wed Dec 24 01:42:48 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 04:42:48 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: add support for Linksys
 MX6200
In-Reply-To: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
References: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
Message-ID: <mailman.39113.1766569371.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d992d95b527e262ddf3a2b8042bbe7cf42991a27

commit d992d95b527e262ddf3a2b8042bbe7cf42991a27
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Mon Jun 2 15:21:36 2025 +0400

    qualcommax: ipq50xx: add support for Linksys MX6200
    
    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 at 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 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21038
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../uboot-envtools/files/qualcommax_ipq50xx        |   1 +
 package/firmware/ipq-wifi/Makefile                 |   2 +
 .../arch/arm64/boot/dts/qcom/ipq5018-mx6200.dts    | 128 +++++++++++++++++++++
 target/linux/qualcommax/image/ipq50xx.mk           |  18 +++
 .../ipq50xx/base-files/etc/board.d/02_network      |   1 +
 .../etc/hotplug.d/firmware/11-ath11k-caldata       |  25 ++++
 .../ipq50xx/base-files/etc/init.d/bootcount        |   1 +
 .../ipq50xx/base-files/lib/upgrade/platform.sh     |   5 +
 target/linux/qualcommax/ipq50xx/config-default     |   1 +
 9 files changed, 182 insertions(+)

diff --git a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx
index d4169fa663..d8542a9aac 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx
+++ b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx
@@ -19,6 +19,7 @@ glinet,gl-b3000)
 linksys,mr5500|\
 linksys,mx2000|\
 linksys,mx5500|\
+linksys,mx6200|\
 linksys,spnmx56)
 	ubootenv_add_mtd "u_env" "0x0" "0x40000" "0x20000"
 	;;
diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 1106de7fc4..a1a3e6a798 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -55,6 +55,7 @@ ALLWIFIBOARDS:= \
 	linksys_mx4200 \
 	linksys_mx5300 \
 	linksys_mx5500 \
+	linksys_mx6200 \
 	linksys_mx8500 \
 	linksys_spnmx56 \
 	linksys_whw03 \
@@ -235,6 +236,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_mx2000,Linksys MX2000))
 $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200))
 $(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300))
 $(eval $(call generate-ipq-wifi-package,linksys_mx5500,Linksys MX5500))
+$(eval $(call generate-ipq-wifi-package,linksys_mx6200,Linksys MX6200))
 $(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500))
 $(eval $(call generate-ipq-wifi-package,linksys_spnmx56,Linksys SPNMX56))
 $(eval $(call generate-ipq-wifi-package,linksys_whw03,Linksys WHW03))
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx6200.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx6200.dts
new file mode 100644
index 0000000000..250fe39075
--- /dev/null
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx6200.dts
@@ -0,0 +1,128 @@
+/dts-v1/;
+
+#include "ipq5018.dtsi"
+#include "ipq5018-mx-base.dtsi"
+#include "ipq5018-qcn6122.dtsi"
+
+/ {
+	model = "Linksys MX6200";
+	compatible = "linksys,mx6200", "qcom,ipq5018";
+
+	chosen {
+		bootargs-append = " root=/dev/ubiblock0_1 coherent_pool=2M";
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+/*
+* =================================================================
+*     _______________________             ____________
+*    |        IPQ5018        |           |            |
+*    | +------+   +--------+ |           | +--------+ |
+*    | | MAC0 |---| GE Phy |-+--- MDI ---+ | RJ45   | +
+*    | +------+   +--------+ |           | +--------+ |
+*    |                       |           |____________|
+*    |                       |            _______________________
+*    |                       |           |    MXL GPY115C Phy    |
+*    | +------+   +--------+ |           | +--------+   +------+ |
+*    | | MAC1 |---| Uniphy |-+-- SGMII---+ | Phy    |---| RJ45 | |
+*    | +------+   +--------+ |           | +--------+   +------+ |
+*    |_______________________|           |_______________________|
+*
+* =================================================================
+ */
+
+&switch {
+	status = "okay";
+
+	switch_mac_mode = <MAC_MODE_SGMII_CHANNEL0>;
+
+	qcom,port_phyinfo {
+		// MAC0 -> GE Phy -> MDI --> RJ45
+		port at 0 {
+			port_id = <1>;
+			mdiobus = <&mdio0>;
+			phy_address = <7>;
+		};
+
+		// MAC1 ---SGMII---> MaxLinear PHY -> RJ45
+		port at 1 {
+			port_id = <2>;
+			mdiobus = <&mdio1>;
+			phy_address = <15>;
+			port_mac_sel = "QGMAC_PORT";
+		};
+	};
+};
+
+// MAC0 ---MDI---> IPQ5018 GE PHY
+&dp1 {
+	status = "okay";
+
+	label = "lan";
+	phy-handle = <&ge_phy>;
+	nvmem-cells = <&hw_mac_addr 1>;
+	nvmem-cell-names = "mac-address";
+};
+
+// MAC1 ---SGMII---> MXL Phy
+&dp2 {
+	status = "okay";
+
+	label = "wan";
+	phy-handle = <&gpy115c>;
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio0 {
+	status = "okay";
+};
+
+&mdio1 {
+	status = "okay";
+
+	pinctrl-0 = <&mdio1_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&tlmm 24 GPIO_ACTIVE_LOW>;
+
+	// Maxlinear Ethernet GPY115C
+	gpy115c: ethernet-phy at f {
+		compatible = "ethernet-phy-id67c9.df10";
+		reg = <15>;
+	};
+};
+
+&q6_region {
+	reg = <0x0 0x4b000000 0x0 0x4d00000>;
+};
+
+&wifi {
+	status = "okay";
+
+	qcom,rproc = <&q6_wcss_pd1>;
+	qcom,ath11k-calibration-variant = "Linksys-MX6200";
+	qcom,ath11k-fw-memory-mode = <1>;
+	qcom,bdf-addr = <0x4c400000>;
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,rproc = <&q6_wcss_pd2>;
+	qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
+	qcom,ath11k-calibration-variant = "Linksys-MX6200-5G";
+	qcom,ath11k-fw-memory-mode = <1>;
+	qcom,m3-dump-addr = <0x4df00000>;
+};
+
+&wifi2 {
+	status = "okay";
+
+	qcom,rproc = <&q6_wcss_pd3>;
+	qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
+	qcom,ath11k-calibration-variant = "Linksys-MX6200-6G";
+	qcom,ath11k-fw-memory-mode = <1>;
+	qcom,bdf-addr = <0x4e500000>;
+	qcom,m3-dump-addr = <0x4f200000>;
+};
diff --git a/target/linux/qualcommax/image/ipq50xx.mk b/target/linux/qualcommax/image/ipq50xx.mk
index 6a6a50d6f7..be247c7df9 100644
--- a/target/linux/qualcommax/image/ipq50xx.mk
+++ b/target/linux/qualcommax/image/ipq50xx.mk
@@ -136,6 +136,24 @@ define Device/linksys_mx5500
 endef
 TARGET_DEVICES += linksys_mx5500
 
+define Device/linksys_mx6200
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := Linksys
+	DEVICE_MODEL := MX6200
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	DEVICE_DTS_CONFIG := config at mp03.5-c1
+	KERNEL_SIZE := 8192k
+	IMAGE_SIZE := 51200k
+	NAND_SIZE := 256m
+	SOC := ipq5018
+	IMAGE/factory.ubi := append-ubi | linksys-image type=$$$$(DEVICE_MODEL)
+	DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
+		ipq-wifi-linksys_mx6200
+endef
+TARGET_DEVICES += linksys_mx6200
+
 define Device/linksys_spnmx56
 	$(call Device/linksys_ipq50xx_mx_base)
 	DEVICE_MODEL := SPNMX56
diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network
index 05bed90e27..4bcd7dd5df 100644
--- a/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network
+++ b/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network
@@ -22,6 +22,7 @@ ipq50xx_setup_interfaces()
 	xiaomi,ax6000)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
 		;;
+	linksys,mx6200|\
 	yuncore,ax830|\
 	yuncore,ax850)
 		ucidef_set_interfaces_lan_wan "lan" "wan"
diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
index 6cd00bf53c..cf48022aea 100644
--- a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
+++ b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
@@ -31,6 +31,13 @@ case "$FIRMWARE" in
 		ath11k_remove_regdomain
 		ath11k_set_macflag
 		;;
+	linksys,mx6200)
+		caldata_extract "0:art" 0x1000 0x20000
+		label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+		ath11k_patch_mac $(macaddr_add $label_mac 2) 0
+		ath11k_remove_regdomain
+		ath11k_set_macflag
+		;;
 	xiaomi,ax6000)
 		caldata_extract "0:art" 0x1000 0x20000
 		;;
@@ -65,6 +72,13 @@ case "$FIRMWARE" in
 		ath11k_remove_regdomain
 		ath11k_set_macflag
 		;;
+	linksys,mx6200)
+		caldata_extract "0:art" 0x26800 0x20000
+		label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+		ath11k_patch_mac $(macaddr_add $label_mac 3) 0
+		ath11k_remove_regdomain
+		ath11k_set_macflag
+		;;
 	yuncore,ax830)
 		caldata_extract "0:ART" 0x4c000 0x20000
 		label_mac=$(mtd_get_mac_binary 0:ART 0)
@@ -74,6 +88,17 @@ case "$FIRMWARE" in
 		;;
 	esac
 	;;
+"ath11k/QCN6122/hw1.0/cal-ahb-b00b040.wifi.bin")
+	case "$board" in
+	linksys,mx6200)
+		caldata_extract "0:art" 0x4c000 0x20000
+		label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+		ath11k_patch_mac $(macaddr_add $label_mac 4) 0
+		ath11k_remove_regdomain
+		ath11k_set_macflag
+		;;
+	esac
+	;;
 "ath11k/QCN9074/hw1.0/cal-pci-0000:01:00.0.bin")
 	case "$board" in
 	linksys,mr5500|\
diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount b/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount
index 0e573a1407..efde13d43a 100755
--- a/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount
+++ b/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount
@@ -7,6 +7,7 @@ boot() {
 	linksys,mr5500|\
 	linksys,mx2000|\
 	linksys,mx5500|\
+	linksys,mx6200|\
 	linksys,spnmx56)
 		mtd resetbc s_env || true
 	;;
diff --git a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
index bbc6d8eb7f..24bacdb6b8 100644
--- a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
@@ -206,6 +206,11 @@ platform_do_upgrade() {
 		remove_oem_ubi_volume squashfs
 		nand_do_upgrade "$1"
 		;;
+	linksys,mx6200)
+		linksys_bootconfig_pre_upgrade "$1"
+		remove_oem_ubi_volume ubi_rootfs
+		nand_do_upgrade "$1"
+		;;
 	xiaomi,ax6000)
 		# Make sure that UART is enabled
 		fw_setenv boot_wait on
diff --git a/target/linux/qualcommax/ipq50xx/config-default b/target/linux/qualcommax/ipq50xx/config-default
index 97a342776a..33e5611af4 100644
--- a/target/linux/qualcommax/ipq50xx/config-default
+++ b/target/linux/qualcommax/ipq50xx/config-default
@@ -4,6 +4,7 @@ CONFIG_GRO_CELLS=y
 CONFIG_IPQ_CMN_PLL=y
 CONFIG_IPQ_GCC_5018=y
 CONFIG_LEDS_PWM=y
+CONFIG_MAXLINEAR_GPHY=y
 CONFIG_MTD_SPI_NAND=y
 CONFIG_NET_DEVLINK=y
 CONFIG_NET_DSA=y



From lede-commits at lists.infradead.org  Wed Dec 24 01:42:44 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 04:42:44 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: load Linksys partition tables
 from SMEM
In-Reply-To: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
References: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
Message-ID: <mailman.39114.1766569371.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/597a2d7d186c2672b9efa97b61e9ab9df948436e

commit 597a2d7d186c2672b9efa97b61e9ab9df948436e
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Tue Dec 9 15:04:56 2025 +0400

    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 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21038
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi  | 103 +--------------------
 .../etc/hotplug.d/firmware/11-ath11k-caldata       |   6 +-
 2 files changed, 5 insertions(+), 104 deletions(-)

diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
index a69385e17f..76c0384617 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
@@ -120,76 +120,10 @@
 		nand-bus-width = <8>;
 
 		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
+			compatible = "qcom,smem-part";
 
-			partition at 0 {
-				label = "0:SBL1";
-				reg = <0x00000000 0x80000>;
-				read-only;
-			};
-
-			partition at 80000 {
-				label = "0:MIBIB";
-				reg = <0x00080000 0x80000>;
-				read-only;
-			};
-
-			partition at 100000 {
-				label = "0:QSEE";
-				reg = <0x00100000 0x100000>;
-				read-only;
-			};
-
-			partition at 200000 {
-				label = "0:DEVCFG";
-				reg = <0x00200000 0x40000>;
-				read-only;
-			};
-
-			partition at 240000 {
-				label = "0:CDT";
-				reg = <0x00240000 0x40000>;
-				read-only;
-			};
-
-			partition at 280000 {
-				label = "0:APPSBLENV";
-				reg = <0x00280000 0x80000>;
-			};
-
-			partition at 300000 {
-				label = "0:APPSBL";
-				reg = <0x00300000 0x140000>;
-				read-only;
-			};
-
-			partition at 440000 {
-				label = "0:ART";
-				reg = <0x00440000 0x100000>;
-				read-only;
-			};
-
-			partition at 540000 {
-				label = "0:TRAINING";
-				reg = <0x00540000 0x80000>;
-				read-only;
-			};
-
-			partition at 5c0000 {
-				label = "u_env";
-				reg = <0x005c0000 0x80000>;
-			};
-
-			partition at 640000 {
-				label = "s_env";
-				reg = <0x00640000 0x40000>;
-			};
-
-			partition at 680000 {
+			partition-devinfo {
 				label = "devinfo";
-				reg = <0x00680000 0x40000>;
 				read-only;
 
 				nvmem-layout {
@@ -199,43 +133,10 @@
 
 					hw_mac_addr: hw_mac_addr {
 						compatible = "mac-base";
-
 						#nvmem-cell-cells = <1>;
 					};
 				};
 			};
-
-			partition at 6c0000 {
-				label = "kernel";
-				reg = <0x006c0000 0x5200000>;
-			};
-
-			partition at ec0000 {
-				label = "rootfs";
-				reg = <0x0ec0000 0x4a00000>;
-			};
-
-			partition at 58c0000 {
-				label = "alt_kernel";
-				reg = <0x058c0000 0x5200000>;
-			};
-
-			partition at 60c0000 {
-				label = "alt_rootfs";
-				reg = <0x060c0000 0x4a00000>;
-			};
-
-			partition at aac0000 {
-				label = "sysdiag";
-				reg = <0x0aac0000 0x200000>;
-				read-only;
-			};
-
-			partition at acc0000 {
-				label = "syscfg";
-				reg = <0x0acc0000 0x4400000>;
-				read-only;
-			};
 		};
 	};
 };
diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
index c34aadf7d4..6cd00bf53c 100644
--- a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
+++ b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
@@ -25,7 +25,7 @@ case "$FIRMWARE" in
 	linksys,mx2000|\
 	linksys,mx5500|\
 	linksys,spnmx56)
-		caldata_extract "0:ART" 0x1000 0x20000
+		caldata_extract "0:art" 0x1000 0x20000
 		label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
 		ath11k_patch_mac $(macaddr_add $label_mac 1) 0
 		ath11k_remove_regdomain
@@ -59,7 +59,7 @@ case "$FIRMWARE" in
 		ath11k_set_macflag
 		;;
 	linksys,mx2000)
-		caldata_extract "0:ART" 0x26800 0x20000
+		caldata_extract "0:art" 0x26800 0x20000
 		label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
 		ath11k_patch_mac $(macaddr_add $label_mac 2) 0
 		ath11k_remove_regdomain
@@ -79,7 +79,7 @@ case "$FIRMWARE" in
 	linksys,mr5500|\
 	linksys,mx5500|\
 	linksys,spnmx56)
-		caldata_extract "0:ART" 0x26800 0x20000
+		caldata_extract "0:art" 0x26800 0x20000
 		label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
 		ath11k_patch_mac $(macaddr_add $label_mac 2) 0
 		ath11k_remove_regdomain



From lede-commits at lists.infradead.org  Wed Dec 24 01:42:46 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 04:42:46 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: functions for bootconfig
 partition
In-Reply-To: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
References: <176656936436.2090964.11383069536043271393@git-01.infra.openwrt.org>
Message-ID: <mailman.39115.1766569371.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d02de1d35a37cdcb3890aef5cbddee598ff16a7d

commit d02de1d35a37cdcb3890aef5cbddee598ff16a7d
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Wed Dec 3 23:22:09 2025 +0400

    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 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21038
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../ipq50xx/base-files/lib/functions/bootconfig.sh | 177 +++++++++++++++++++++
 1 file changed, 177 insertions(+)

diff --git a/target/linux/qualcommax/ipq50xx/base-files/lib/functions/bootconfig.sh b/target/linux/qualcommax/ipq50xx/base-files/lib/functions/bootconfig.sh
new file mode 100644
index 0000000000..3632c6a25e
--- /dev/null
+++ b/target/linux/qualcommax/ipq50xx/base-files/lib/functions/bootconfig.sh
@@ -0,0 +1,177 @@
+. /lib/functions.sh
+
+PART_SIZE=20
+NAME_SIZE=16
+MAX_NUM_PARTS=16
+
+MAGIC_START_HEX="a0 a1 a2 a3"
+MAGIC_START_TRY_HEX="a1 a1 a2 a3"
+MAGIC_END_HEX="b0 b1 b2 b3"
+
+validate_bootconfig_magic() {
+	local file=$1
+	magic_start=$(hexdump -v -n 4 -e '4/1 "%02x "' "$file")
+	magic_end=$(hexdump -v -s 332 -n 4 -e '4/1 "%02x "' "$file")
+	
+	if [ "$magic_start" != "$MAGIC_START_HEX" ] && \
+	   [ "$magic_start" != "$MAGIC_START_TRY_HEX" ]; then
+		echo "Not a valid bootconfig file, start magic does not match" >&2
+		return 1
+	fi
+
+	if [ "$magic_end" != "$MAGIC_END_HEX" ]; then
+		echo "Not a valid bootconfig file, end magic does not match" >&2
+		return 1
+	fi
+	return 0
+}
+
+get_bootconfig_numparts() {
+	local file=$1
+	numpartshex=$(hexdump -v -s 8 -n 4 -e '4/1 "%02x "' "$file")
+	numparts=$(( 0x$(echo $numpartshex | awk '{print $4$3$2$1}') ))
+	echo ${numparts}
+}
+
+get_bootconfig_partidx() {
+	local file=$1
+	local partname=$2
+	local numparts=$(get_bootconfig_numparts "$file")
+
+	if [ -z "$numparts" ]; then
+		echo "Could not get number of partitions" >&2
+		return
+	fi
+
+	if [ $numparts -gt $MAX_NUM_PARTS ]; then
+		numparts=$MAX_NUM_PARTS
+	fi
+
+	for i in $(seq 0 $((numparts -1))); do
+		nameoffset=$((12 + i * $PART_SIZE))
+		nameraw=$(dd if="$file" bs=1 skip="$nameoffset" count=12 2>/dev/null)
+		name=${nameraw//S'\x00'/}
+		if [ "$partname" = "$name" ]; then
+			echo $i
+		fi
+	done
+}
+
+get_bootconfig_primaryboot() {
+	local file=$1
+	local partname=$2
+
+	local partidx=$(get_bootconfig_partidx "$file" "$partname")
+	if ! echo "$partidx" | grep -Eq '^[0-9]+$'; then
+		echo "Could not get partition index for $partname in $file" >&2
+		return
+	fi
+
+	if [ "$partidx" -ge 0 ] && [ "$partidx" -lt $MAX_NUM_PARTS ]; then
+		offset=$((12 + $partidx * $PART_SIZE + $NAME_SIZE))
+		primaryboothex=$(hexdump -v -s "$offset" -n 4 -e '4/1 "%02x "' $file)
+		primaryboot=$(( 0x$(echo $primaryboothex | awk '{print $4$3$2$1}') ))
+		echo $primaryboot
+	fi
+}
+
+_set_bootconfig_primaryboot() {
+	local file=$1
+	local partname=$2
+	local primaryboot=$3
+	local primaryboothex
+	local partidx
+	local primarybootoffset
+
+	partidx=$(get_bootconfig_partidx "$file" "$partname")
+	if ! echo "$partidx" | grep -Eq '^[0-9]+$'; then
+		echo "Could not get partition index for $2" >&2
+		return 1
+	fi
+	primarybootoffset=$((12 + $partidx * $PART_SIZE + $NAME_SIZE))
+
+	case "$primaryboot" in
+		0)
+			printf "\x00\x00\x00\x00" | dd of="$file" seek="$primarybootoffset" bs=1 count=4 conv=notrunc 2>/dev/null
+			;;
+		1)
+			printf "\x01\x00\x00\x00" | dd of="$file" seek="$primarybootoffset" bs=1 count=4 conv=notrunc 2>/dev/null
+			;;
+		*)
+			echo "invalid argument: primaryboot must be 0 or 1" >&2
+			return 1
+			;;
+	esac
+}
+
+set_bootconfig_primaryboot() {
+	local file=$1
+	local partname=$2
+	local primaryboot=$3
+
+	[ -z "$file" ] || [ -z "$partname" ] || [ -z "$primaryboot" ] && {
+		echo "usage: $0 <file> <partition name> <0|1>"
+		return 1
+	}
+
+	[ ! -e "$file" ] && {
+		echo "file $file not found" >&2
+		return 1
+	}
+
+	[ ! -w $file ] && {
+		echo "file $file not writable" >&2
+		return 1
+	}
+
+	validate_bootconfig_magic "$file"
+	[ $? -ne 0 ] && return 1
+
+	_set_bootconfig_primaryboot $file $partname $primaryboot
+	[ $? -ne 0 ] && return 1
+
+	return 0
+}
+
+toggle_bootconfig_primaryboot() {
+	local file=$1
+	local partname=$2
+	local primaryboot
+	
+	[ -z "$file" ] || [ -z "$partname" ] && {
+		echo "usage: $0 <file> <partition name>"
+		return 1
+	}
+
+	[ ! -e "$file" ] && {
+		echo "file $file not found" >&2
+		return 1
+	}
+
+	[ ! -w $file ] && {
+		echo "file $file not writable" >&2
+		return 1
+	}
+
+	validate_bootconfig_magic "$file"
+	[ $? -ne 0 ] && return 1
+	
+	primaryboot=$(get_bootconfig_primaryboot "$1" "$2")
+
+	case "$primaryboot" in
+		0)
+			_set_bootconfig_primaryboot "$1" "$2" 1
+			;;
+		1)
+			_set_bootconfig_primaryboot "$1" "$2" 0
+			;;
+		*)
+			echo "invalid value: primaryboot must be 0 or 1" >&2
+			return 1
+			;;
+	esac
+
+	[ $? -ne 0 ] && return 1
+
+	return 0
+}



From lede-commits at lists.infradead.org  Wed Dec 24 01:57:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 04:57:20 -0500
Subject: [openwrt/openwrt]  microchipsw: sync with DTS sent upstream
In-Reply-To: <176657024023.2256292.16951608038617347678@git-01.infra.openwrt.org>
References: <176657024023.2256292.16951608038617347678@git-01.infra.openwrt.org>
Message-ID: <mailman.39120.1766570244.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/bce8432bbdd2f9fe3631d15f56e4336bc04230fa

commit bce8432bbdd2f9fe3631d15f56e4336bc04230fa
Author: Robert Marko <robert.marko at sartura.hr>
AuthorDate: Tue Dec 23 14:08:26 2025 +0100

    microchipsw: sync with DTS sent upstream
    
    Sync the DTS with the version sent upstream, clock bindings also.
    
    Signed-off-by: Robert Marko <robert.marko at sartura.hr>
---
 .../microchipsw/dts/{lan969x.dtsi => lan9691.dtsi} | 110 +++++-----
 target/linux/microchipsw/dts/lan9696-ev23x71a.dts  | 235 +++++++++++----------
 ...de-dt-bindings-add-LAN969x-clock-bindings.patch |  12 +-
 3 files changed, 186 insertions(+), 171 deletions(-)

diff --git a/target/linux/microchipsw/dts/lan969x.dtsi b/target/linux/microchipsw/dts/lan9691.dtsi
similarity index 86%
rename from target/linux/microchipsw/dts/lan969x.dtsi
rename to target/linux/microchipsw/dts/lan9691.dtsi
index db364c9d24..69f9bfc89a 100644
--- a/target/linux/microchipsw/dts/lan969x.dtsi
+++ b/target/linux/microchipsw/dts/lan9691.dtsi
@@ -3,7 +3,7 @@
  * Copyright (c) 2025 Microchip Technology Inc. and its subsidiaries.
  */
 
-#include <dt-bindings/clock/microchip,lan969x.h>
+#include <dt-bindings/clock/microchip,lan9691.h>
 #include <dt-bindings/dma/at91.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mfd/at91-usart.h>
@@ -14,14 +14,9 @@
 	#size-cells = <1>;
 
 	model = "Microchip LAN969x";
-	compatible = "microchip,lan969x";
+	compatible = "microchip,lan9691";
 	interrupt-parent = <&gic>;
 
-	psci {
-		compatible = "arm,psci-1.0";
-		method = "smc";
-	};
-
 	clocks {
 		fx100_clk: fx100-clk {
 			compatible = "fixed-clock";
@@ -66,6 +61,11 @@
 		};
 	};
 
+	psci {
+		compatible = "arm,psci-1.0";
+		method = "smc";
+	};
+
 	pmu {
 		compatible = "arm,cortex-a53-pmu";
 		interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
@@ -105,18 +105,17 @@
 		};
 
 		flx0: flexcom at e0040000 {
-			compatible = "atmel,sama5d2-flexcom";
+			compatible = "microchip,lan9691-flexcom", "atmel,sama5d2-flexcom";
 			reg = <0xe0040000 0x100>;
+			ranges = <0x0 0xe0040000 0x800>;
 			clocks = <&clks GCK_ID_FLEXCOM0>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0x0 0xe0040000 0x800>;
 			status = "disabled";
 
 			usart0: serial at 200 {
-				compatible = "atmel,at91sam9260-usart";
+				compatible = "microchip,lan9691-usart", "atmel,at91sam9260-usart";
 				reg = <0x200 0x200>;
-				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
 				       <&dma AT91_XDMAC_DT_PERID(2)>;
@@ -124,11 +123,12 @@
 				clocks = <&fabric_clk>;
 				clock-names = "usart";
 				atmel,fifo-size = <32>;
+				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				status = "disabled";
 			};
 
 			spi0: spi at 400 {
-				compatible = "atmel,at91rm9200-spi";
+				compatible = "microchip,lan9691-spi", "atmel,at91rm9200-spi";
 				reg = <0x400 0x200>;
 				interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
@@ -136,14 +136,14 @@
 				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				clock-names = "spi_clk";
-				atmel,fifo-size = <32>;
 				#address-cells = <1>;
 				#size-cells = <0>;
+				atmel,fifo-size = <32>;
 				status = "disabled";
 			};
 
 			i2c0: i2c at 600 {
-				compatible = "microchip,sam9x60-i2c";
+				compatible = "microchip,lan9691-i2c", "microchip,sam9x60-i2c";
 				reg = <0x600 0x200>;
 				interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
@@ -157,18 +157,17 @@
 		};
 
 		flx1: flexcom at e0044000 {
-			compatible = "atmel,sama5d2-flexcom";
+			compatible = "microchip,lan9691-flexcom", "atmel,sama5d2-flexcom";
 			reg = <0xe0044000 0x100>;
+			ranges = <0x0 0xe0044000 0x800>;
 			clocks = <&clks GCK_ID_FLEXCOM1>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0x0 0xe0044000 0x800>;
 			status = "disabled";
 
 			usart1: serial at 200 {
-				compatible = "atmel,at91sam9260-usart";
+				compatible = "microchip,lan9691-usart", "atmel,at91sam9260-usart";
 				reg = <0x200 0x200>;
-				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
 				       <&dma AT91_XDMAC_DT_PERID(2)>;
@@ -176,11 +175,12 @@
 				clocks = <&fabric_clk>;
 				clock-names = "usart";
 				atmel,fifo-size = <32>;
+				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				status = "disabled";
 			};
 
 			spi1: spi at 400 {
-				compatible = "atmel,at91rm9200-spi";
+				compatible = "microchip,lan9691-spi", "atmel,at91rm9200-spi";
 				reg = <0x400 0x200>;
 				interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
@@ -188,14 +188,14 @@
 				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				clock-names = "spi_clk";
-				atmel,fifo-size = <32>;
 				#address-cells = <1>;
 				#size-cells = <0>;
+				atmel,fifo-size = <32>;
 				status = "disabled";
 			};
 
 			i2c1: i2c at 600 {
-				compatible = "microchip,sam9x60-i2c";
+				compatible = "microchip,lan9691-i2c", "microchip,sam9x60-i2c";
 				reg = <0x600 0x200>;
 				interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
@@ -209,14 +209,14 @@
 		};
 
 		trng: rng at e0048000 {
-			compatible = "atmel,at91sam9g45-trng";
+			compatible = "microchip,lan9691-trng", "atmel,at91sam9g45-trng";
 			reg = <0xe0048000 0x100>;
 			clocks = <&fabric_clk>;
 			status = "disabled";
 		};
 
 		aes: crypto at e004c000 {
-			compatible = "atmel,at91sam9g46-aes";
+			compatible = "microchip,lan9691-aes", "atmel,at91sam9g46-aes";
 			reg = <0xe004c000 0x100>;
 			interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
 			dmas = <&dma AT91_XDMAC_DT_PERID(12)>,
@@ -228,18 +228,17 @@
 		};
 
 		flx2: flexcom at e0060000 {
-			compatible = "atmel,sama5d2-flexcom";
+			compatible = "microchip,lan9691-flexcom", "atmel,sama5d2-flexcom";
 			reg = <0xe0060000 0x100>;
+			ranges = <0x0 0xe0060000 0x800>;
 			clocks = <&clks GCK_ID_FLEXCOM2>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0x0 0xe0060000 0x800>;
 			status = "disabled";
 
 			usart2: serial at 200 {
-				compatible = "atmel,at91sam9260-usart";
+				compatible = "microchip,lan9691-usart", "atmel,at91sam9260-usart";
 				reg = <0x200 0x200>;
-				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(7)>,
 				       <&dma AT91_XDMAC_DT_PERID(6)>;
@@ -247,11 +246,12 @@
 				clocks = <&fabric_clk>;
 				clock-names = "usart";
 				atmel,fifo-size = <32>;
+				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				status = "disabled";
 			};
 
 			spi2: spi at 400 {
-				compatible = "atmel,at91rm9200-spi";
+				compatible = "microchip,lan9691-spi", "atmel,at91rm9200-spi";
 				reg = <0x400 0x200>;
 				interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(7)>,
@@ -259,16 +259,19 @@
 				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				clock-names = "spi_clk";
-				atmel,fifo-size = <32>;
 				#address-cells = <1>;
 				#size-cells = <0>;
+				atmel,fifo-size = <32>;
 				status = "disabled";
 			};
 
 			i2c2: i2c at 600 {
-				compatible = "microchip,sam9x60-i2c";
+				compatible = "microchip,lan9691-i2c", "microchip,sam9x60-i2c";
 				reg = <0x600 0x200>;
 				interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+				dmas = <&dma AT91_XDMAC_DT_PERID(7)>,
+				       <&dma AT91_XDMAC_DT_PERID(6)>;
+				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				#address-cells = <1>;
 				#size-cells = <0>;
@@ -277,18 +280,17 @@
 		};
 
 		flx3: flexcom at e0064000 {
-			compatible = "atmel,sama5d2-flexcom";
+			compatible = "microchip,lan9691-flexcom", "atmel,sama5d2-flexcom";
 			reg = <0xe0064000 0x100>;
+			ranges = <0x0 0xe0064000 0x800>;
 			clocks = <&clks GCK_ID_FLEXCOM3>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0x0 0xe0064000 0x800>;
 			status = "disabled";
 
 			usart3: serial at 200 {
-				compatible = "atmel,at91sam9260-usart";
+				compatible = "microchip,lan9691-usart", "atmel,at91sam9260-usart";
 				reg = <0x200 0x200>;
-				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(9)>,
 				       <&dma AT91_XDMAC_DT_PERID(8)>;
@@ -296,11 +298,12 @@
 				clocks = <&fabric_clk>;
 				clock-names = "usart";
 				atmel,fifo-size = <32>;
+				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				status = "disabled";
 			};
 
 			spi3: spi at 400 {
-				compatible = "atmel,at91rm9200-spi";
+				compatible = "microchip,lan9691-spi", "atmel,at91rm9200-spi";
 				reg = <0x400 0x200>;
 				interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(9)>,
@@ -308,14 +311,14 @@
 				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				clock-names = "spi_clk";
-				atmel,fifo-size = <32>;
 				#address-cells = <1>;
 				#size-cells = <0>;
+				atmel,fifo-size = <32>;
 				status = "disabled";
 			};
 
 			i2c3: i2c at 600 {
-				compatible = "microchip,sam9x60-i2c";
+				compatible = "microchip,lan9691-i2c", "microchip,sam9x60-i2c";
 				reg = <0x600 0x200>;
 				interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(9)>,
@@ -329,7 +332,7 @@
 		};
 
 		dma: dma-controller at e0068000 {
-			compatible = "microchip,sama7g5-dma";
+			compatible = "microchip,lan9691-dma", "microchip,sama7g5-dma";
 			reg = <0xe0068000 0x1000>;
 			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
 			dma-channels = <16>;
@@ -339,7 +342,7 @@
 		};
 
 		sha: crypto at e006c000 {
-			compatible = "atmel,at91sam9g46-sha";
+			compatible = "microchip,lan9691-sha", "atmel,at91sam9g46-sha";
 			reg = <0xe006c000 0xec>;
 			interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
 			dmas = <&dma AT91_XDMAC_DT_PERID(14)>;
@@ -386,10 +389,10 @@
 
 		clks: clock-controller at e00c00b4 {
 			compatible = "microchip,lan9691-gck";
+			reg = <0xe00c00b4 0x30>, <0xe00c0308 0x4>;
 			#clock-cells = <1>;
 			clocks = <&cpu_clk>, <&ddr_clk>, <&fx100_clk>;
 			clock-names = "cpu", "ddr", "sys";
-			reg = <0xe00c00b4 0x30>, <0xe00c0308 0x4>;
 		};
 
 		qspi0: spi at e0804000 {
@@ -445,7 +448,8 @@
 		};
 
 		reset: reset-controller at e201000c {
-			compatible = "microchip,lan9691-switch-reset", "microchip,lan966x-switch-reset";
+			compatible = "microchip,lan9691-switch-reset",
+				     "microchip,lan966x-switch-reset";
 			reg = <0xe201000c 0x4>;
 			reg-names = "gcb";
 			#reset-cells = <1>;
@@ -465,25 +469,25 @@
 		};
 
 		mdio0: mdio at e20101a8 {
-			compatible = "mscc,ocelot-miim";
+			compatible = "microchip,lan9691-miim", "mscc,ocelot-miim";
+			reg = <0xe20101a8 0x24>;
 			#address-cells = <1>;
 			#size-cells = <0>;
-			reg = <0xe20101a8 0x24>;
 			clocks = <&fx100_clk>;
 			status = "disabled";
 		};
 
 		mdio1: mdio at e20101cc {
-			compatible = "mscc,ocelot-miim";
+			compatible = "microchip,lan9691-miim", "mscc,ocelot-miim";
+			reg = <0xe20101cc 0x24>;
 			#address-cells = <1>;
 			#size-cells = <0>;
-			reg = <0xe20101cc 0x24>;
 			clocks = <&fx100_clk>;
 			status = "disabled";
 		};
 
 		sgpio: gpio at e2010230 {
-			compatible = "microchip,sparx5-sgpio";
+			compatible = "microchip,lan9691-sgpio", "microchip,sparx5-sgpio";
 			reg = <0xe2010230 0x118>;
 			clocks = <&fx100_clk>;
 			resets = <&reset 0>;
@@ -493,7 +497,8 @@
 			status = "disabled";
 
 			sgpio_in: gpio at 0 {
-				compatible = "microchip,sparx5-sgpio-bank";
+				compatible = "microchip,lan9691-sgpio-bank",
+					     "microchip,sparx5-sgpio-bank";
 				reg = <0>;
 				gpio-controller;
 				#gpio-cells = <3>;
@@ -503,7 +508,8 @@
 			};
 
 			sgpio_out: gpio at 1 {
-				compatible = "microchip,sparx5-sgpio-bank";
+				compatible = "microchip,lan9691-sgpio-bank",
+					     "microchip,sparx5-sgpio-bank";
 				reg = <1>;
 				gpio-controller;
 				#gpio-cells = <3>;
@@ -511,7 +517,7 @@
 		};
 
 		tmon: hwmon at e2020100 {
-			compatible = "microchip,sparx5-temp";
+			compatible = "microchip,lan9691-temp", "microchip,sparx5-temp";
 			reg = <0xe2020100 0xc>;
 			clocks = <&fx100_clk>;
 			#thermal-sensor-cells = <0>;
@@ -519,19 +525,19 @@
 
 		serdes: serdes at e3410000 {
 			compatible = "microchip,lan9691-serdes";
+			reg = <0xe3410000 0x150000>;
 			#phy-cells = <1>;
 			clocks = <&fabric_clk>;
-			reg = <0xe3410000 0x150000>;
 		};
 
 		gic: interrupt-controller at e8c11000 {
 			compatible = "arm,gic-400";
-			#interrupt-cells = <3>;
-			interrupt-controller;
 			reg = <0xe8c11000 0x1000>, /* Distributor GICD_ */
 			      <0xe8c12000 0x2000>, /* CPU interface GICC_ */
 			      <0xe8c14000 0x2000>, /* Virt interface control */
 			      <0xe8c16000 0x2000>; /* Virt CPU interface */
+			#interrupt-cells = <3>;
+			interrupt-controller;
 			interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
 		};
 	};
diff --git a/target/linux/microchipsw/dts/lan9696-ev23x71a.dts b/target/linux/microchipsw/dts/lan9696-ev23x71a.dts
index 2ccc0345ac..a469da0385 100644
--- a/target/linux/microchipsw/dts/lan9696-ev23x71a.dts
+++ b/target/linux/microchipsw/dts/lan9696-ev23x71a.dts
@@ -1,19 +1,20 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+/*
+ * Copyright (c) 2025 Microchip Technology Inc. and its subsidiaries.
+ */
+
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
-#include "lan969x.dtsi"
+#include "lan9691.dtsi"
 
 / {
 	model = "Microchip EV23X71A";
-	compatible = "microchip,ev23x71a", "microchip,lan969x";
+	compatible = "microchip,ev23x71a", "microchip,lan9696", "microchip,lan9691";
 
 	aliases {
 		serial0 = &usart0;
-		led-boot = &led_status;
-		led-failsafe = &led_status;
-		led-running = &led_status;
-		led-upgrade = &led_status;
 	};
 
 	chosen {
@@ -32,11 +33,11 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		i2c-parent = <&i2c3>;
-
-		mux-gpios = <&sgpio_out 0 1 GPIO_ACTIVE_HIGH
-			     &sgpio_out 0 2 GPIO_ACTIVE_HIGH
-			     &sgpio_out 0 3 GPIO_ACTIVE_HIGH>;
 		idle-state = <0x8>;
+		mux-gpios = <&sgpio_out 0 1 GPIO_ACTIVE_HIGH>,
+			    <&sgpio_out 0 2 GPIO_ACTIVE_HIGH>,
+			    <&sgpio_out 0 3 GPIO_ACTIVE_HIGH>;
+		settle-time-us = <100>;
 
 		i2c_sfp0: i2c at 0 {
 			reg = <0x0>;
@@ -62,7 +63,7 @@
 	leds {
 		compatible = "gpio-leds";
 
-		led_status: led-status {
+		led-status {
 			color = <LED_COLOR_ID_GREEN>;
 			function = LED_FUNCTION_STATUS;
 			gpios = <&gpio 61 GPIO_ACTIVE_LOW>;
@@ -136,7 +137,6 @@
 	mux-controller {
 		compatible = "gpio-mux";
 		#mux-control-cells = <0>;
-
 		mux-gpios = <&sgpio_out 1 2 GPIO_ACTIVE_LOW>,
 			    <&sgpio_out 1 3 GPIO_ACTIVE_LOW>;
 	};
@@ -178,44 +178,6 @@
 	};
 };
 
-&flx0 {
-	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
-	status = "okay";
-};
-
-&usart0 {
-	pinctrl-0 = <&fc0_pins>;
-	pinctrl-names = "default";
-	status = "okay";
-};
-
-&flx2 {
-	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
-	status = "okay";
-};
-
-&spi2 {
-	pinctrl-0 = <&fc2_pins>;
-	pinctrl-names = "default";
-	cs-gpios = <&gpio 63 GPIO_ACTIVE_LOW>;
-	status = "okay";
-};
-
-&flx3 {
-	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
-	status = "okay";
-};
-
-&i2c3 {
-	pinctrl-0 = <&fc3_pins>;
-	pinctrl-names = "default";
-	i2c-analog-filter;
-	i2c-digital-filter;
-	i2c-digital-filter-width-ns = <35>;
-	i2c-sda-hold-time-ns = <1500>;
-	status = "okay";
-};
-
 &gpio {
 	emmc_sd_pins: emmc-sd-pins {
 		/* eMMC_SD - CMD, CLK, D0, D1, D2, D3, D4, D5, D6, D7, RSTN */
@@ -263,8 +225,8 @@
 
 	usb_ulpi_pins: usb-ulpi-pins {
 		pins = "GPIO_30", "GPIO_31", "GPIO_32", "GPIO_33",
-		"GPIO_34", "GPIO_35", "GPIO_36", "GPIO_37",
-		"GPIO_38", "GPIO_39", "GPIO_40", "GPIO_41";
+		       "GPIO_34", "GPIO_35", "GPIO_36", "GPIO_37",
+		       "GPIO_38", "GPIO_39", "GPIO_40", "GPIO_41";
 		function = "usb_ulpi";
 	};
 
@@ -294,36 +256,29 @@
 	};
 };
 
-&qspi0 {
+&flx0 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
 	status = "okay";
+};
 
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <100000000>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-		spi-tx-bus-width = <1>;
-		spi-rx-bus-width = <4>;
-		m25p,fast-read;
-	};
+&flx2 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
+	status = "okay";
 };
 
-&sdmmc0 {
-	pinctrl-0 = <&emmc_sd_pins>;
-	pinctrl-names = "default";
-	max-frequency = <100000000>;
-	bus-width = <8>;
-	mmc-ddr-1_8v;
-	mmc-hs200-1_8v;
-	non-removable;
-	disable-wp;
+&flx3 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 	status = "okay";
 };
 
-&tmon {
-	pinctrl-0 = <&fan_pins>;
+&i2c3 {
+	pinctrl-0 = <&fc3_pins>;
 	pinctrl-names = "default";
+	i2c-analog-filter;
+	i2c-digital-filter;
+	i2c-digital-filter-width-ns = <35>;
+	i2c-sda-hold-time-ns = <1500>;
+	status = "okay";
 };
 
 &mdio0 {
@@ -508,6 +463,43 @@
 	};
 };
 
+&otp {
+	nvmem-layout {
+		compatible = "microchip,otp-layout";
+
+		base_mac_address: base-mac-address {
+			#nvmem-cell-cells = <1>;
+		};
+	};
+};
+
+&qspi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <100000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		spi-tx-bus-width = <1>;
+		spi-rx-bus-width = <4>;
+		m25p,fast-read;
+	};
+};
+
+&sdmmc0 {
+	pinctrl-0 = <&emmc_sd_pins>;
+	pinctrl-names = "default";
+	max-frequency = <100000000>;
+	bus-width = <8>;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	non-removable;
+	disable-wp;
+	status = "okay";
+};
+
 &serdes {
 	status = "okay";
 };
@@ -515,7 +507,6 @@
 &sgpio {
 	pinctrl-0 = <&sgpio_pins>;
 	pinctrl-names = "default";
-
 	microchip,sgpio-port-ranges = <0 1>, <6 9>;
 	status = "okay";
 
@@ -527,261 +518,279 @@
 	};
 };
 
+&spi2 {
+	pinctrl-0 = <&fc2_pins>;
+	pinctrl-names = "default";
+	cs-gpios = <&gpio 63 GPIO_ACTIVE_LOW>;
+	status = "okay";
+};
+
 &switch {
 	pinctrl-0 = <&ptp_out_pins>, <&ptp_ext_pins>;
 	pinctrl-names = "default";
-
+	nvmem-cells = <&base_mac_address 0>;
+	nvmem-cell-names = "mac-address";
 	status = "okay";
+
 	ethernet-ports {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
 		port0: port at 0 {
 			reg = <0>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy4>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 0>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port1: port at 1 {
 			reg = <1>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy5>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 0>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port2: port at 2 {
 			reg = <2>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy6>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 0>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port3: port at 3 {
 			reg = <3>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy7>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 0>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port4: port at 4 {
 			reg = <4>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy8>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 1>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port5: port at 5 {
 			reg = <5>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy9>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 1>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port6: port at 6 {
 			reg = <6>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy10>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 1>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port7: port at 7 {
 			reg = <7>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy11>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 1>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port8: port at 8 {
 			reg = <8>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy12>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 2>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port9: port at 9 {
 			reg = <9>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy13>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 2>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port10: port at 10 {
 			reg = <10>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy14>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 2>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port11: port at 11 {
 			reg = <11>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy15>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 2>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port12: port at 12 {
 			reg = <12>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy16>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 3>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port13: port at 13 {
 			reg = <13>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy17>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 3>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port14: port at 14 {
 			reg = <14>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy18>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 3>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port15: port at 15 {
 			reg = <15>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy19>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 3>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port16: port at 16 {
 			reg = <16>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy20>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 4>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port17: port at 17 {
 			reg = <17>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy21>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 4>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port18: port at 18 {
 			reg = <18>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy22>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 4>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port19: port at 19 {
 			reg = <19>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy23>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 4>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port20: port at 20 {
 			reg = <20>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy24>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 5>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port21: port at 21 {
 			reg = <21>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy25>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 5>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port22: port at 22 {
 			reg = <22>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy26>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 5>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port23: port at 23 {
 			reg = <23>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy27>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 5>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port24: port at 24 {
 			reg = <24>;
-			microchip,bandwidth = <10000>;
 			phys = <&serdes 6>;
 			phy-mode = "10gbase-r";
 			sfp = <&sfp0>;
-			microchip,sd-sgpio = <24>;
 			managed = "in-band-status";
+			microchip,bandwidth = <10000>;
+			microchip,sd-sgpio = <24>;
 		};
 
 		port25: port at 25 {
 			reg = <25>;
-			microchip,bandwidth = <10000>;
 			phys = <&serdes 7>;
 			phy-mode = "10gbase-r";
 			sfp = <&sfp1>;
-			microchip,sd-sgpio = <28>;
 			managed = "in-band-status";
+			microchip,bandwidth = <10000>;
+			microchip,sd-sgpio = <28>;
 		};
 
 		port26: port at 26 {
 			reg = <26>;
-			microchip,bandwidth = <10000>;
 			phys = <&serdes 8>;
 			phy-mode = "10gbase-r";
 			sfp = <&sfp2>;
-			microchip,sd-sgpio = <32>;
 			managed = "in-band-status";
+			microchip,bandwidth = <10000>;
+			microchip,sd-sgpio = <32>;
 		};
 
 		port27: port at 27 {
 			reg = <27>;
-			microchip,bandwidth = <10000>;
 			phys = <&serdes 9>;
 			phy-mode = "10gbase-r";
 			sfp = <&sfp3>;
-			microchip,sd-sgpio = <36>;
 			managed = "in-band-status";
+			microchip,bandwidth = <10000>;
+			microchip,sd-sgpio = <36>;
 		};
 
 		port29: port at 29 {
 			reg = <29>;
-			microchip,bandwidth = <1000>;
 			phys = <&serdes 11>;
 			phy-handle = <&phy3>;
-			phy-mode = "rgmii";
-			rx-internal-delay-ps = <1000>;
-			tx-internal-delay-ps = <1000>;
+			phy-mode = "rgmii-id";
+			microchip,bandwidth = <1000>;
 		};
 	};
 };
 
-&usb {
+&tmon {
+	pinctrl-0 = <&fan_pins>;
+	pinctrl-names = "default";
+};
+
+&usart0 {
+	pinctrl-0 = <&fc0_pins>;
+	pinctrl-names = "default";
 	status = "okay";
+};
+
+&usb {
 	pinctrl-0 = <&usb_ulpi_pins>, <&usb_rst_pins>, <&usb_over_pins>, <&usb_power_pins>;
 	pinctrl-names = "default";
+	status = "okay";
 };
diff --git a/target/linux/microchipsw/patches-6.12/103-include-dt-bindings-add-LAN969x-clock-bindings.patch b/target/linux/microchipsw/patches-6.12/103-include-dt-bindings-add-LAN969x-clock-bindings.patch
index 591e0b01cb..9f2b4dd66a 100644
--- a/target/linux/microchipsw/patches-6.12/103-include-dt-bindings-add-LAN969x-clock-bindings.patch
+++ b/target/linux/microchipsw/patches-6.12/103-include-dt-bindings-add-LAN969x-clock-bindings.patch
@@ -1,4 +1,4 @@
-From 7dffd83ae4ae02a43d61b15af6edb199fcc7ebb3 Mon Sep 17 00:00:00 2001
+From 334fd8a6295e82c16b3120d29213ca02947d3ebb Mon Sep 17 00:00:00 2001
 From: Robert Marko <robert.marko at sartura.hr>
 Date: Tue, 5 Nov 2024 12:08:06 +0100
 Subject: [PATCH] include: dt-bindings: add LAN969x clock bindings
@@ -7,17 +7,17 @@ Add the required LAN969x clock bindings.
 
 Signed-off-by: Robert Marko <robert.marko at sartura.hr>
 ---
- include/dt-bindings/clock/microchip,lan969x.h | 24 +++++++++++++++++++
+ include/dt-bindings/clock/microchip,lan9691.h | 24 +++++++++++++++++++
  1 file changed, 24 insertions(+)
- create mode 100644 include/dt-bindings/clock/microchip,lan969x.h
+ create mode 100644 include/dt-bindings/clock/microchip,lan9691.h
 
 --- /dev/null
-+++ b/include/dt-bindings/clock/microchip,lan969x.h
++++ b/include/dt-bindings/clock/microchip,lan9691.h
 @@ -0,0 +1,24 @@
 +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
 +
-+#ifndef _DT_BINDINGS_CLK_LAN969X_H
-+#define _DT_BINDINGS_CLK_LAN969X_H
++#ifndef _DT_BINDINGS_CLK_LAN9691_H
++#define _DT_BINDINGS_CLK_LAN9691_H
 +
 +#define GCK_ID_QSPI0		0
 +#define GCK_ID_QSPI2		1



From lede-commits at lists.infradead.org  Wed Dec 24 02:04:34 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 05:04:34 -0500
Subject: [openwrt/openwrt]  microchipsw: sync with DTS sent upstream
In-Reply-To: <176657067453.2340924.17554037534330295641@git-01.infra.openwrt.org>
References: <176657067453.2340924.17554037534330295641@git-01.infra.openwrt.org>
Message-ID: <mailman.39121.1766570679.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/a4a2638590609cfcde235bfc89eac61695c881f4

commit a4a2638590609cfcde235bfc89eac61695c881f4
Author: Robert Marko <robert.marko at sartura.hr>
AuthorDate: Tue Dec 23 14:08:26 2025 +0100

    microchipsw: sync with DTS sent upstream
    
    Sync the DTS with the version sent upstream, clock bindings also.
    
    Signed-off-by: Robert Marko <robert.marko at sartura.hr>
    (cherry picked from commit bce8432bbdd2f9fe3631d15f56e4336bc04230fa)
---
 .../microchipsw/dts/{lan969x.dtsi => lan9691.dtsi} | 110 +++++-----
 target/linux/microchipsw/dts/lan9696-ev23x71a.dts  | 235 +++++++++++----------
 ...de-dt-bindings-add-LAN969x-clock-bindings.patch |  12 +-
 3 files changed, 186 insertions(+), 171 deletions(-)

diff --git a/target/linux/microchipsw/dts/lan969x.dtsi b/target/linux/microchipsw/dts/lan9691.dtsi
similarity index 86%
rename from target/linux/microchipsw/dts/lan969x.dtsi
rename to target/linux/microchipsw/dts/lan9691.dtsi
index db364c9d24..69f9bfc89a 100644
--- a/target/linux/microchipsw/dts/lan969x.dtsi
+++ b/target/linux/microchipsw/dts/lan9691.dtsi
@@ -3,7 +3,7 @@
  * Copyright (c) 2025 Microchip Technology Inc. and its subsidiaries.
  */
 
-#include <dt-bindings/clock/microchip,lan969x.h>
+#include <dt-bindings/clock/microchip,lan9691.h>
 #include <dt-bindings/dma/at91.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mfd/at91-usart.h>
@@ -14,14 +14,9 @@
 	#size-cells = <1>;
 
 	model = "Microchip LAN969x";
-	compatible = "microchip,lan969x";
+	compatible = "microchip,lan9691";
 	interrupt-parent = <&gic>;
 
-	psci {
-		compatible = "arm,psci-1.0";
-		method = "smc";
-	};
-
 	clocks {
 		fx100_clk: fx100-clk {
 			compatible = "fixed-clock";
@@ -66,6 +61,11 @@
 		};
 	};
 
+	psci {
+		compatible = "arm,psci-1.0";
+		method = "smc";
+	};
+
 	pmu {
 		compatible = "arm,cortex-a53-pmu";
 		interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
@@ -105,18 +105,17 @@
 		};
 
 		flx0: flexcom at e0040000 {
-			compatible = "atmel,sama5d2-flexcom";
+			compatible = "microchip,lan9691-flexcom", "atmel,sama5d2-flexcom";
 			reg = <0xe0040000 0x100>;
+			ranges = <0x0 0xe0040000 0x800>;
 			clocks = <&clks GCK_ID_FLEXCOM0>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0x0 0xe0040000 0x800>;
 			status = "disabled";
 
 			usart0: serial at 200 {
-				compatible = "atmel,at91sam9260-usart";
+				compatible = "microchip,lan9691-usart", "atmel,at91sam9260-usart";
 				reg = <0x200 0x200>;
-				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
 				       <&dma AT91_XDMAC_DT_PERID(2)>;
@@ -124,11 +123,12 @@
 				clocks = <&fabric_clk>;
 				clock-names = "usart";
 				atmel,fifo-size = <32>;
+				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				status = "disabled";
 			};
 
 			spi0: spi at 400 {
-				compatible = "atmel,at91rm9200-spi";
+				compatible = "microchip,lan9691-spi", "atmel,at91rm9200-spi";
 				reg = <0x400 0x200>;
 				interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
@@ -136,14 +136,14 @@
 				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				clock-names = "spi_clk";
-				atmel,fifo-size = <32>;
 				#address-cells = <1>;
 				#size-cells = <0>;
+				atmel,fifo-size = <32>;
 				status = "disabled";
 			};
 
 			i2c0: i2c at 600 {
-				compatible = "microchip,sam9x60-i2c";
+				compatible = "microchip,lan9691-i2c", "microchip,sam9x60-i2c";
 				reg = <0x600 0x200>;
 				interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
@@ -157,18 +157,17 @@
 		};
 
 		flx1: flexcom at e0044000 {
-			compatible = "atmel,sama5d2-flexcom";
+			compatible = "microchip,lan9691-flexcom", "atmel,sama5d2-flexcom";
 			reg = <0xe0044000 0x100>;
+			ranges = <0x0 0xe0044000 0x800>;
 			clocks = <&clks GCK_ID_FLEXCOM1>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0x0 0xe0044000 0x800>;
 			status = "disabled";
 
 			usart1: serial at 200 {
-				compatible = "atmel,at91sam9260-usart";
+				compatible = "microchip,lan9691-usart", "atmel,at91sam9260-usart";
 				reg = <0x200 0x200>;
-				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
 				       <&dma AT91_XDMAC_DT_PERID(2)>;
@@ -176,11 +175,12 @@
 				clocks = <&fabric_clk>;
 				clock-names = "usart";
 				atmel,fifo-size = <32>;
+				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				status = "disabled";
 			};
 
 			spi1: spi at 400 {
-				compatible = "atmel,at91rm9200-spi";
+				compatible = "microchip,lan9691-spi", "atmel,at91rm9200-spi";
 				reg = <0x400 0x200>;
 				interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
@@ -188,14 +188,14 @@
 				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				clock-names = "spi_clk";
-				atmel,fifo-size = <32>;
 				#address-cells = <1>;
 				#size-cells = <0>;
+				atmel,fifo-size = <32>;
 				status = "disabled";
 			};
 
 			i2c1: i2c at 600 {
-				compatible = "microchip,sam9x60-i2c";
+				compatible = "microchip,lan9691-i2c", "microchip,sam9x60-i2c";
 				reg = <0x600 0x200>;
 				interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(3)>,
@@ -209,14 +209,14 @@
 		};
 
 		trng: rng at e0048000 {
-			compatible = "atmel,at91sam9g45-trng";
+			compatible = "microchip,lan9691-trng", "atmel,at91sam9g45-trng";
 			reg = <0xe0048000 0x100>;
 			clocks = <&fabric_clk>;
 			status = "disabled";
 		};
 
 		aes: crypto at e004c000 {
-			compatible = "atmel,at91sam9g46-aes";
+			compatible = "microchip,lan9691-aes", "atmel,at91sam9g46-aes";
 			reg = <0xe004c000 0x100>;
 			interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
 			dmas = <&dma AT91_XDMAC_DT_PERID(12)>,
@@ -228,18 +228,17 @@
 		};
 
 		flx2: flexcom at e0060000 {
-			compatible = "atmel,sama5d2-flexcom";
+			compatible = "microchip,lan9691-flexcom", "atmel,sama5d2-flexcom";
 			reg = <0xe0060000 0x100>;
+			ranges = <0x0 0xe0060000 0x800>;
 			clocks = <&clks GCK_ID_FLEXCOM2>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0x0 0xe0060000 0x800>;
 			status = "disabled";
 
 			usart2: serial at 200 {
-				compatible = "atmel,at91sam9260-usart";
+				compatible = "microchip,lan9691-usart", "atmel,at91sam9260-usart";
 				reg = <0x200 0x200>;
-				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(7)>,
 				       <&dma AT91_XDMAC_DT_PERID(6)>;
@@ -247,11 +246,12 @@
 				clocks = <&fabric_clk>;
 				clock-names = "usart";
 				atmel,fifo-size = <32>;
+				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				status = "disabled";
 			};
 
 			spi2: spi at 400 {
-				compatible = "atmel,at91rm9200-spi";
+				compatible = "microchip,lan9691-spi", "atmel,at91rm9200-spi";
 				reg = <0x400 0x200>;
 				interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(7)>,
@@ -259,16 +259,19 @@
 				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				clock-names = "spi_clk";
-				atmel,fifo-size = <32>;
 				#address-cells = <1>;
 				#size-cells = <0>;
+				atmel,fifo-size = <32>;
 				status = "disabled";
 			};
 
 			i2c2: i2c at 600 {
-				compatible = "microchip,sam9x60-i2c";
+				compatible = "microchip,lan9691-i2c", "microchip,sam9x60-i2c";
 				reg = <0x600 0x200>;
 				interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+				dmas = <&dma AT91_XDMAC_DT_PERID(7)>,
+				       <&dma AT91_XDMAC_DT_PERID(6)>;
+				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				#address-cells = <1>;
 				#size-cells = <0>;
@@ -277,18 +280,17 @@
 		};
 
 		flx3: flexcom at e0064000 {
-			compatible = "atmel,sama5d2-flexcom";
+			compatible = "microchip,lan9691-flexcom", "atmel,sama5d2-flexcom";
 			reg = <0xe0064000 0x100>;
+			ranges = <0x0 0xe0064000 0x800>;
 			clocks = <&clks GCK_ID_FLEXCOM3>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0x0 0xe0064000 0x800>;
 			status = "disabled";
 
 			usart3: serial at 200 {
-				compatible = "atmel,at91sam9260-usart";
+				compatible = "microchip,lan9691-usart", "atmel,at91sam9260-usart";
 				reg = <0x200 0x200>;
-				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(9)>,
 				       <&dma AT91_XDMAC_DT_PERID(8)>;
@@ -296,11 +298,12 @@
 				clocks = <&fabric_clk>;
 				clock-names = "usart";
 				atmel,fifo-size = <32>;
+				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
 				status = "disabled";
 			};
 
 			spi3: spi at 400 {
-				compatible = "atmel,at91rm9200-spi";
+				compatible = "microchip,lan9691-spi", "atmel,at91rm9200-spi";
 				reg = <0x400 0x200>;
 				interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(9)>,
@@ -308,14 +311,14 @@
 				dma-names = "tx", "rx";
 				clocks = <&fabric_clk>;
 				clock-names = "spi_clk";
-				atmel,fifo-size = <32>;
 				#address-cells = <1>;
 				#size-cells = <0>;
+				atmel,fifo-size = <32>;
 				status = "disabled";
 			};
 
 			i2c3: i2c at 600 {
-				compatible = "microchip,sam9x60-i2c";
+				compatible = "microchip,lan9691-i2c", "microchip,sam9x60-i2c";
 				reg = <0x600 0x200>;
 				interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
 				dmas = <&dma AT91_XDMAC_DT_PERID(9)>,
@@ -329,7 +332,7 @@
 		};
 
 		dma: dma-controller at e0068000 {
-			compatible = "microchip,sama7g5-dma";
+			compatible = "microchip,lan9691-dma", "microchip,sama7g5-dma";
 			reg = <0xe0068000 0x1000>;
 			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
 			dma-channels = <16>;
@@ -339,7 +342,7 @@
 		};
 
 		sha: crypto at e006c000 {
-			compatible = "atmel,at91sam9g46-sha";
+			compatible = "microchip,lan9691-sha", "atmel,at91sam9g46-sha";
 			reg = <0xe006c000 0xec>;
 			interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
 			dmas = <&dma AT91_XDMAC_DT_PERID(14)>;
@@ -386,10 +389,10 @@
 
 		clks: clock-controller at e00c00b4 {
 			compatible = "microchip,lan9691-gck";
+			reg = <0xe00c00b4 0x30>, <0xe00c0308 0x4>;
 			#clock-cells = <1>;
 			clocks = <&cpu_clk>, <&ddr_clk>, <&fx100_clk>;
 			clock-names = "cpu", "ddr", "sys";
-			reg = <0xe00c00b4 0x30>, <0xe00c0308 0x4>;
 		};
 
 		qspi0: spi at e0804000 {
@@ -445,7 +448,8 @@
 		};
 
 		reset: reset-controller at e201000c {
-			compatible = "microchip,lan9691-switch-reset", "microchip,lan966x-switch-reset";
+			compatible = "microchip,lan9691-switch-reset",
+				     "microchip,lan966x-switch-reset";
 			reg = <0xe201000c 0x4>;
 			reg-names = "gcb";
 			#reset-cells = <1>;
@@ -465,25 +469,25 @@
 		};
 
 		mdio0: mdio at e20101a8 {
-			compatible = "mscc,ocelot-miim";
+			compatible = "microchip,lan9691-miim", "mscc,ocelot-miim";
+			reg = <0xe20101a8 0x24>;
 			#address-cells = <1>;
 			#size-cells = <0>;
-			reg = <0xe20101a8 0x24>;
 			clocks = <&fx100_clk>;
 			status = "disabled";
 		};
 
 		mdio1: mdio at e20101cc {
-			compatible = "mscc,ocelot-miim";
+			compatible = "microchip,lan9691-miim", "mscc,ocelot-miim";
+			reg = <0xe20101cc 0x24>;
 			#address-cells = <1>;
 			#size-cells = <0>;
-			reg = <0xe20101cc 0x24>;
 			clocks = <&fx100_clk>;
 			status = "disabled";
 		};
 
 		sgpio: gpio at e2010230 {
-			compatible = "microchip,sparx5-sgpio";
+			compatible = "microchip,lan9691-sgpio", "microchip,sparx5-sgpio";
 			reg = <0xe2010230 0x118>;
 			clocks = <&fx100_clk>;
 			resets = <&reset 0>;
@@ -493,7 +497,8 @@
 			status = "disabled";
 
 			sgpio_in: gpio at 0 {
-				compatible = "microchip,sparx5-sgpio-bank";
+				compatible = "microchip,lan9691-sgpio-bank",
+					     "microchip,sparx5-sgpio-bank";
 				reg = <0>;
 				gpio-controller;
 				#gpio-cells = <3>;
@@ -503,7 +508,8 @@
 			};
 
 			sgpio_out: gpio at 1 {
-				compatible = "microchip,sparx5-sgpio-bank";
+				compatible = "microchip,lan9691-sgpio-bank",
+					     "microchip,sparx5-sgpio-bank";
 				reg = <1>;
 				gpio-controller;
 				#gpio-cells = <3>;
@@ -511,7 +517,7 @@
 		};
 
 		tmon: hwmon at e2020100 {
-			compatible = "microchip,sparx5-temp";
+			compatible = "microchip,lan9691-temp", "microchip,sparx5-temp";
 			reg = <0xe2020100 0xc>;
 			clocks = <&fx100_clk>;
 			#thermal-sensor-cells = <0>;
@@ -519,19 +525,19 @@
 
 		serdes: serdes at e3410000 {
 			compatible = "microchip,lan9691-serdes";
+			reg = <0xe3410000 0x150000>;
 			#phy-cells = <1>;
 			clocks = <&fabric_clk>;
-			reg = <0xe3410000 0x150000>;
 		};
 
 		gic: interrupt-controller at e8c11000 {
 			compatible = "arm,gic-400";
-			#interrupt-cells = <3>;
-			interrupt-controller;
 			reg = <0xe8c11000 0x1000>, /* Distributor GICD_ */
 			      <0xe8c12000 0x2000>, /* CPU interface GICC_ */
 			      <0xe8c14000 0x2000>, /* Virt interface control */
 			      <0xe8c16000 0x2000>; /* Virt CPU interface */
+			#interrupt-cells = <3>;
+			interrupt-controller;
 			interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
 		};
 	};
diff --git a/target/linux/microchipsw/dts/lan9696-ev23x71a.dts b/target/linux/microchipsw/dts/lan9696-ev23x71a.dts
index 2ccc0345ac..a469da0385 100644
--- a/target/linux/microchipsw/dts/lan9696-ev23x71a.dts
+++ b/target/linux/microchipsw/dts/lan9696-ev23x71a.dts
@@ -1,19 +1,20 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+/*
+ * Copyright (c) 2025 Microchip Technology Inc. and its subsidiaries.
+ */
+
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
-#include "lan969x.dtsi"
+#include "lan9691.dtsi"
 
 / {
 	model = "Microchip EV23X71A";
-	compatible = "microchip,ev23x71a", "microchip,lan969x";
+	compatible = "microchip,ev23x71a", "microchip,lan9696", "microchip,lan9691";
 
 	aliases {
 		serial0 = &usart0;
-		led-boot = &led_status;
-		led-failsafe = &led_status;
-		led-running = &led_status;
-		led-upgrade = &led_status;
 	};
 
 	chosen {
@@ -32,11 +33,11 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		i2c-parent = <&i2c3>;
-
-		mux-gpios = <&sgpio_out 0 1 GPIO_ACTIVE_HIGH
-			     &sgpio_out 0 2 GPIO_ACTIVE_HIGH
-			     &sgpio_out 0 3 GPIO_ACTIVE_HIGH>;
 		idle-state = <0x8>;
+		mux-gpios = <&sgpio_out 0 1 GPIO_ACTIVE_HIGH>,
+			    <&sgpio_out 0 2 GPIO_ACTIVE_HIGH>,
+			    <&sgpio_out 0 3 GPIO_ACTIVE_HIGH>;
+		settle-time-us = <100>;
 
 		i2c_sfp0: i2c at 0 {
 			reg = <0x0>;
@@ -62,7 +63,7 @@
 	leds {
 		compatible = "gpio-leds";
 
-		led_status: led-status {
+		led-status {
 			color = <LED_COLOR_ID_GREEN>;
 			function = LED_FUNCTION_STATUS;
 			gpios = <&gpio 61 GPIO_ACTIVE_LOW>;
@@ -136,7 +137,6 @@
 	mux-controller {
 		compatible = "gpio-mux";
 		#mux-control-cells = <0>;
-
 		mux-gpios = <&sgpio_out 1 2 GPIO_ACTIVE_LOW>,
 			    <&sgpio_out 1 3 GPIO_ACTIVE_LOW>;
 	};
@@ -178,44 +178,6 @@
 	};
 };
 
-&flx0 {
-	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
-	status = "okay";
-};
-
-&usart0 {
-	pinctrl-0 = <&fc0_pins>;
-	pinctrl-names = "default";
-	status = "okay";
-};
-
-&flx2 {
-	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
-	status = "okay";
-};
-
-&spi2 {
-	pinctrl-0 = <&fc2_pins>;
-	pinctrl-names = "default";
-	cs-gpios = <&gpio 63 GPIO_ACTIVE_LOW>;
-	status = "okay";
-};
-
-&flx3 {
-	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
-	status = "okay";
-};
-
-&i2c3 {
-	pinctrl-0 = <&fc3_pins>;
-	pinctrl-names = "default";
-	i2c-analog-filter;
-	i2c-digital-filter;
-	i2c-digital-filter-width-ns = <35>;
-	i2c-sda-hold-time-ns = <1500>;
-	status = "okay";
-};
-
 &gpio {
 	emmc_sd_pins: emmc-sd-pins {
 		/* eMMC_SD - CMD, CLK, D0, D1, D2, D3, D4, D5, D6, D7, RSTN */
@@ -263,8 +225,8 @@
 
 	usb_ulpi_pins: usb-ulpi-pins {
 		pins = "GPIO_30", "GPIO_31", "GPIO_32", "GPIO_33",
-		"GPIO_34", "GPIO_35", "GPIO_36", "GPIO_37",
-		"GPIO_38", "GPIO_39", "GPIO_40", "GPIO_41";
+		       "GPIO_34", "GPIO_35", "GPIO_36", "GPIO_37",
+		       "GPIO_38", "GPIO_39", "GPIO_40", "GPIO_41";
 		function = "usb_ulpi";
 	};
 
@@ -294,36 +256,29 @@
 	};
 };
 
-&qspi0 {
+&flx0 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
 	status = "okay";
+};
 
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <100000000>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-		spi-tx-bus-width = <1>;
-		spi-rx-bus-width = <4>;
-		m25p,fast-read;
-	};
+&flx2 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
+	status = "okay";
 };
 
-&sdmmc0 {
-	pinctrl-0 = <&emmc_sd_pins>;
-	pinctrl-names = "default";
-	max-frequency = <100000000>;
-	bus-width = <8>;
-	mmc-ddr-1_8v;
-	mmc-hs200-1_8v;
-	non-removable;
-	disable-wp;
+&flx3 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 	status = "okay";
 };
 
-&tmon {
-	pinctrl-0 = <&fan_pins>;
+&i2c3 {
+	pinctrl-0 = <&fc3_pins>;
 	pinctrl-names = "default";
+	i2c-analog-filter;
+	i2c-digital-filter;
+	i2c-digital-filter-width-ns = <35>;
+	i2c-sda-hold-time-ns = <1500>;
+	status = "okay";
 };
 
 &mdio0 {
@@ -508,6 +463,43 @@
 	};
 };
 
+&otp {
+	nvmem-layout {
+		compatible = "microchip,otp-layout";
+
+		base_mac_address: base-mac-address {
+			#nvmem-cell-cells = <1>;
+		};
+	};
+};
+
+&qspi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <100000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		spi-tx-bus-width = <1>;
+		spi-rx-bus-width = <4>;
+		m25p,fast-read;
+	};
+};
+
+&sdmmc0 {
+	pinctrl-0 = <&emmc_sd_pins>;
+	pinctrl-names = "default";
+	max-frequency = <100000000>;
+	bus-width = <8>;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	non-removable;
+	disable-wp;
+	status = "okay";
+};
+
 &serdes {
 	status = "okay";
 };
@@ -515,7 +507,6 @@
 &sgpio {
 	pinctrl-0 = <&sgpio_pins>;
 	pinctrl-names = "default";
-
 	microchip,sgpio-port-ranges = <0 1>, <6 9>;
 	status = "okay";
 
@@ -527,261 +518,279 @@
 	};
 };
 
+&spi2 {
+	pinctrl-0 = <&fc2_pins>;
+	pinctrl-names = "default";
+	cs-gpios = <&gpio 63 GPIO_ACTIVE_LOW>;
+	status = "okay";
+};
+
 &switch {
 	pinctrl-0 = <&ptp_out_pins>, <&ptp_ext_pins>;
 	pinctrl-names = "default";
-
+	nvmem-cells = <&base_mac_address 0>;
+	nvmem-cell-names = "mac-address";
 	status = "okay";
+
 	ethernet-ports {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
 		port0: port at 0 {
 			reg = <0>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy4>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 0>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port1: port at 1 {
 			reg = <1>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy5>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 0>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port2: port at 2 {
 			reg = <2>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy6>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 0>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port3: port at 3 {
 			reg = <3>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy7>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 0>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port4: port at 4 {
 			reg = <4>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy8>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 1>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port5: port at 5 {
 			reg = <5>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy9>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 1>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port6: port at 6 {
 			reg = <6>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy10>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 1>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port7: port at 7 {
 			reg = <7>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy11>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 1>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port8: port at 8 {
 			reg = <8>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy12>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 2>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port9: port at 9 {
 			reg = <9>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy13>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 2>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port10: port at 10 {
 			reg = <10>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy14>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 2>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port11: port at 11 {
 			reg = <11>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy15>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 2>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port12: port at 12 {
 			reg = <12>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy16>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 3>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port13: port at 13 {
 			reg = <13>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy17>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 3>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port14: port at 14 {
 			reg = <14>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy18>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 3>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port15: port at 15 {
 			reg = <15>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy19>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 3>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port16: port at 16 {
 			reg = <16>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy20>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 4>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port17: port at 17 {
 			reg = <17>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy21>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 4>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port18: port at 18 {
 			reg = <18>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy22>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 4>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port19: port at 19 {
 			reg = <19>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy23>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 4>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port20: port at 20 {
 			reg = <20>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy24>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 5>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port21: port at 21 {
 			reg = <21>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy25>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 5>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port22: port at 22 {
 			reg = <22>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy26>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 5>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port23: port at 23 {
 			reg = <23>;
-			microchip,bandwidth = <1000>;
 			phy-handle = <&phy27>;
 			phy-mode = "qsgmii";
 			phys = <&serdes 5>;
+			microchip,bandwidth = <1000>;
 		};
 
 		port24: port at 24 {
 			reg = <24>;
-			microchip,bandwidth = <10000>;
 			phys = <&serdes 6>;
 			phy-mode = "10gbase-r";
 			sfp = <&sfp0>;
-			microchip,sd-sgpio = <24>;
 			managed = "in-band-status";
+			microchip,bandwidth = <10000>;
+			microchip,sd-sgpio = <24>;
 		};
 
 		port25: port at 25 {
 			reg = <25>;
-			microchip,bandwidth = <10000>;
 			phys = <&serdes 7>;
 			phy-mode = "10gbase-r";
 			sfp = <&sfp1>;
-			microchip,sd-sgpio = <28>;
 			managed = "in-band-status";
+			microchip,bandwidth = <10000>;
+			microchip,sd-sgpio = <28>;
 		};
 
 		port26: port at 26 {
 			reg = <26>;
-			microchip,bandwidth = <10000>;
 			phys = <&serdes 8>;
 			phy-mode = "10gbase-r";
 			sfp = <&sfp2>;
-			microchip,sd-sgpio = <32>;
 			managed = "in-band-status";
+			microchip,bandwidth = <10000>;
+			microchip,sd-sgpio = <32>;
 		};
 
 		port27: port at 27 {
 			reg = <27>;
-			microchip,bandwidth = <10000>;
 			phys = <&serdes 9>;
 			phy-mode = "10gbase-r";
 			sfp = <&sfp3>;
-			microchip,sd-sgpio = <36>;
 			managed = "in-band-status";
+			microchip,bandwidth = <10000>;
+			microchip,sd-sgpio = <36>;
 		};
 
 		port29: port at 29 {
 			reg = <29>;
-			microchip,bandwidth = <1000>;
 			phys = <&serdes 11>;
 			phy-handle = <&phy3>;
-			phy-mode = "rgmii";
-			rx-internal-delay-ps = <1000>;
-			tx-internal-delay-ps = <1000>;
+			phy-mode = "rgmii-id";
+			microchip,bandwidth = <1000>;
 		};
 	};
 };
 
-&usb {
+&tmon {
+	pinctrl-0 = <&fan_pins>;
+	pinctrl-names = "default";
+};
+
+&usart0 {
+	pinctrl-0 = <&fc0_pins>;
+	pinctrl-names = "default";
 	status = "okay";
+};
+
+&usb {
 	pinctrl-0 = <&usb_ulpi_pins>, <&usb_rst_pins>, <&usb_over_pins>, <&usb_power_pins>;
 	pinctrl-names = "default";
+	status = "okay";
 };
diff --git a/target/linux/microchipsw/patches-6.12/103-include-dt-bindings-add-LAN969x-clock-bindings.patch b/target/linux/microchipsw/patches-6.12/103-include-dt-bindings-add-LAN969x-clock-bindings.patch
index 591e0b01cb..9f2b4dd66a 100644
--- a/target/linux/microchipsw/patches-6.12/103-include-dt-bindings-add-LAN969x-clock-bindings.patch
+++ b/target/linux/microchipsw/patches-6.12/103-include-dt-bindings-add-LAN969x-clock-bindings.patch
@@ -1,4 +1,4 @@
-From 7dffd83ae4ae02a43d61b15af6edb199fcc7ebb3 Mon Sep 17 00:00:00 2001
+From 334fd8a6295e82c16b3120d29213ca02947d3ebb Mon Sep 17 00:00:00 2001
 From: Robert Marko <robert.marko at sartura.hr>
 Date: Tue, 5 Nov 2024 12:08:06 +0100
 Subject: [PATCH] include: dt-bindings: add LAN969x clock bindings
@@ -7,17 +7,17 @@ Add the required LAN969x clock bindings.
 
 Signed-off-by: Robert Marko <robert.marko at sartura.hr>
 ---
- include/dt-bindings/clock/microchip,lan969x.h | 24 +++++++++++++++++++
+ include/dt-bindings/clock/microchip,lan9691.h | 24 +++++++++++++++++++
  1 file changed, 24 insertions(+)
- create mode 100644 include/dt-bindings/clock/microchip,lan969x.h
+ create mode 100644 include/dt-bindings/clock/microchip,lan9691.h
 
 --- /dev/null
-+++ b/include/dt-bindings/clock/microchip,lan969x.h
++++ b/include/dt-bindings/clock/microchip,lan9691.h
 @@ -0,0 +1,24 @@
 +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
 +
-+#ifndef _DT_BINDINGS_CLK_LAN969X_H
-+#define _DT_BINDINGS_CLK_LAN969X_H
++#ifndef _DT_BINDINGS_CLK_LAN9691_H
++#define _DT_BINDINGS_CLK_LAN9691_H
 +
 +#define GCK_ID_QSPI0		0
 +#define GCK_ID_QSPI2		1



From lede-commits at lists.infradead.org  Wed Dec 24 03:44:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 06:44:18 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: fix reo2host-status interrupt
 vector
In-Reply-To: <176657665826.3494176.2423067209625478202@git-01.infra.openwrt.org>
References: <176657665826.3494176.2423067209625478202@git-01.infra.openwrt.org>
Message-ID: <mailman.39146.1766576663.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/501e54b6c2a5543b3890984ff128e004e96877ee

commit 501e54b6c2a5543b3890984ff128e004e96877ee
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Fri Dec 19 11:18:04 2025 +0400

    qualcommax: ipq50xx: fix reo2host-status interrupt vector
    
    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 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21271
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../932-wifi-ath11k-poll-reo-status-ipq5018.patch  | 164 ---------------------
 ...6-arm64-dts-qcom-ipq5018-add-wifi-support.patch |   4 +-
 2 files changed, 2 insertions(+), 166 deletions(-)

diff --git a/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch b/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch
deleted file mode 100644
index b83d8d31d9..0000000000
--- a/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-From d890c6d602307c9297df12c7d0287f9ffd26208b Mon Sep 17 00:00:00 2001
-From: Sriram R <srirrama at codeaurora.org>
-Date: Wed, 12 May 2021 19:21:09 +0530
-Subject: [PATCH] ath11k: poll reo status ring for IPQ5018
-
-Currently reo status interrupts are not received
-due to wrong mapping of the reo status interrupt
-line in IPQ5018.
-
-Hence, until the mapping is resolved in HW, use
-polling to reap the reo status ring. Rather than
-a period timer to reap the ring, the timer is
-triggered only on sending a reo command with
-status request.
-
-Without proper reaping of the ring, backpressure
-and ring full issues are seen in multi client test
-setups which leads to flooding the console with
-error messages reporting failure to send reo cmds.
-
-Can be reverted once HW solution is available.
-
-Signed-off-by: Sriram R <srirrama at codeaurora.org>
----
---- a/drivers/net/wireless/ath/ath11k/core.c
-+++ b/drivers/net/wireless/ath/ath11k/core.c
-@@ -729,6 +729,7 @@ static struct ath11k_hw_params ath11k_hw
- 		.support_fw_mac_sequence = false,
- 		.support_dual_stations = false,
- 		.pdev_suspend = false,
-+		.reo_status_poll = true,
- 	},
- 	{
- 		.name = "qca2066 hw2.1",
---- a/drivers/net/wireless/ath/ath11k/dp.c
-+++ b/drivers/net/wireless/ath/ath11k/dp.c
-@@ -350,12 +350,66 @@ void ath11k_dp_stop_shadow_timers(struct
- 	ath11k_dp_shadow_stop_timer(ab, &ab->dp.reo_cmd_timer);
- }
- 
-+static void ath11k_dp_handle_reo_status_timer(struct timer_list *timer)
-+{
-+	struct ath11k_dp *dp = from_timer(dp, timer, reo_status_timer);
-+	struct ath11k_base *ab = dp->ab;
-+
-+	spin_lock_bh(&dp->reo_cmd_lock);
-+	dp->reo_status_timer_running = false;
-+	spin_unlock_bh(&dp->reo_cmd_lock);
-+
-+	ath11k_dp_process_reo_status(ab);
-+}
-+
-+void ath11k_dp_start_reo_status_timer(struct ath11k_base *ab)
-+{
-+	struct ath11k_dp *dp = &ab->dp;
-+
-+	if (!ab->hw_params.reo_status_poll)
-+		return;
-+
-+	spin_lock_bh(&dp->reo_cmd_lock);
-+	if (dp->reo_status_timer_running) {
-+		spin_unlock_bh(&dp->reo_cmd_lock);
-+		return;
-+	}
-+	dp->reo_status_timer_running = true;
-+	spin_unlock_bh(&dp->reo_cmd_lock);
-+
-+	mod_timer(&dp->reo_status_timer, jiffies +
-+		  msecs_to_jiffies(ATH11K_REO_STATUS_POLL_TIMEOUT_MS));
-+}
-+
-+static void ath11k_dp_stop_reo_status_timer(struct ath11k_base *ab)
-+{
-+	struct ath11k_dp *dp = &ab->dp;
-+
-+	if (!ab->hw_params.reo_status_poll)
-+		return;
-+
-+	del_timer_sync(&dp->reo_status_timer);
-+	dp->reo_status_timer_running = false;
-+}
-+
-+static void ath11k_dp_init_reo_status_timer(struct ath11k_base *ab)
-+{
-+	struct ath11k_dp *dp = &ab->dp;
-+
-+	if (!ab->hw_params.reo_status_poll)
-+		return;
-+
-+	timer_setup(&dp->reo_status_timer,
-+		    ath11k_dp_handle_reo_status_timer, 0);
-+}
-+
- static void ath11k_dp_srng_common_cleanup(struct ath11k_base *ab)
- {
- 	struct ath11k_dp *dp = &ab->dp;
- 	int i;
- 
- 	ath11k_dp_stop_shadow_timers(ab);
-+	ath11k_dp_stop_reo_status_timer(ab);
- 	ath11k_dp_srng_cleanup(ab, &dp->wbm_desc_rel_ring);
- 	ath11k_dp_srng_cleanup(ab, &dp->tcl_cmd_ring);
- 	ath11k_dp_srng_cleanup(ab, &dp->tcl_status_ring);
-@@ -377,6 +431,8 @@ static int ath11k_dp_srng_common_setup(s
- 	int i, ret;
- 	u8 tcl_num, wbm_num;
- 
-+	ath11k_dp_init_reo_status_timer(ab);
-+
- 	ret = ath11k_dp_srng_setup(ab, &dp->wbm_desc_rel_ring,
- 				   HAL_SW2WBM_RELEASE, 0, 0,
- 				   DP_WBM_RELEASE_RING_SIZE);
---- a/drivers/net/wireless/ath/ath11k/dp.h
-+++ b/drivers/net/wireless/ath/ath11k/dp.h
-@@ -46,6 +46,8 @@ struct dp_rx_tid {
- #define DP_MON_PURGE_TIMEOUT_MS     100
- #define DP_MON_SERVICE_BUDGET       128
- 
-+#define ATH11K_REO_STATUS_POLL_TIMEOUT_MS 10
-+
- struct dp_reo_cache_flush_elem {
- 	struct list_head list;
- 	struct dp_rx_tid data;
-@@ -287,6 +289,10 @@ struct ath11k_dp {
- 	spinlock_t reo_cmd_lock;
- 	struct ath11k_hp_update_timer reo_cmd_timer;
- 	struct ath11k_hp_update_timer tx_ring_timer[DP_TCL_NUM_RING_MAX];
-+
-+	/* reo status timer and flags */
-+	struct timer_list reo_status_timer;
-+	bool reo_status_timer_running;
- };
- 
- /* HTT definitions */
-@@ -1690,5 +1696,6 @@ void ath11k_dp_shadow_init_timer(struct
- 				 struct ath11k_hp_update_timer *update_timer,
- 				 u32 interval, u32 ring_id);
- void ath11k_dp_stop_shadow_timers(struct ath11k_base *ab);
-+void ath11k_dp_start_reo_status_timer(struct ath11k_base *ab);
- 
- #endif
---- a/drivers/net/wireless/ath/ath11k/dp_tx.c
-+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
-@@ -788,6 +788,10 @@ int ath11k_dp_tx_send_reo_cmd(struct ath
- 	if (cmd_num == 0)
- 		return -EINVAL;
- 
-+	/* Trigger reo status polling if required */
-+	if (cmd->flag & HAL_REO_CMD_FLG_NEED_STATUS)
-+		ath11k_dp_start_reo_status_timer(ab);
-+
- 	if (!cb)
- 		return 0;
- 
---- a/drivers/net/wireless/ath/ath11k/hw.h
-+++ b/drivers/net/wireless/ath/ath11k/hw.h
-@@ -233,6 +233,7 @@ struct ath11k_hw_params {
- 	bool support_fw_mac_sequence;
- 	bool support_dual_stations;
- 	bool pdev_suspend;
-+	bool reo_status_poll;
- };
- 
- struct ath11k_hw_ops {
diff --git a/target/linux/qualcommax/patches-6.12/0816-arm64-dts-qcom-ipq5018-add-wifi-support.patch b/target/linux/qualcommax/patches-6.12/0816-arm64-dts-qcom-ipq5018-add-wifi-support.patch
index d3e5c58940..4d4b48d5af 100644
--- a/target/linux/qualcommax/patches-6.12/0816-arm64-dts-qcom-ipq5018-add-wifi-support.patch
+++ b/target/linux/qualcommax/patches-6.12/0816-arm64-dts-qcom-ipq5018-add-wifi-support.patch
@@ -45,7 +45,7 @@ Signed-off-by: George Moussalem <george.moussalem at outlook.com>
 +				     <GIC_SPI 309 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 310 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
-+				     <GIC_SPI 312 IRQ_TYPE_EDGE_RISING>,
++				     <GIC_SPI 334 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 313 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 314 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 315 IRQ_TYPE_EDGE_RISING>,
@@ -67,7 +67,7 @@ Signed-off-by: George Moussalem <george.moussalem at outlook.com>
 +				     <GIC_SPI 331 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 333 IRQ_TYPE_EDGE_RISING>,
-+				     <GIC_SPI 334 IRQ_TYPE_EDGE_RISING>,
++				     <GIC_SPI 312 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 335 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 336 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 337 IRQ_TYPE_EDGE_RISING>,



From lede-commits at lists.infradead.org  Wed Dec 24 04:07:04 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 07:07:04 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: fix reo2host-status interrupt
 vector
In-Reply-To: <176657802451.3677140.15898865493200358060@git-01.infra.openwrt.org>
References: <176657802451.3677140.15898865493200358060@git-01.infra.openwrt.org>
Message-ID: <mailman.39153.1766578034.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/2da39423ed90372cf9679ea11a5e9c3240bc2e47

commit 2da39423ed90372cf9679ea11a5e9c3240bc2e47
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Fri Dec 19 11:18:04 2025 +0400

    qualcommax: ipq50xx: fix reo2host-status interrupt vector
    
    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 at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/21272
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../932-wifi-ath11k-poll-reo-status-ipq5018.patch  | 164 ---------------------
 ...6-arm64-dts-qcom-ipq5018-add-wifi-support.patch |   4 +-
 2 files changed, 2 insertions(+), 166 deletions(-)

diff --git a/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch b/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch
deleted file mode 100644
index b83d8d31d9..0000000000
--- a/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-From d890c6d602307c9297df12c7d0287f9ffd26208b Mon Sep 17 00:00:00 2001
-From: Sriram R <srirrama at codeaurora.org>
-Date: Wed, 12 May 2021 19:21:09 +0530
-Subject: [PATCH] ath11k: poll reo status ring for IPQ5018
-
-Currently reo status interrupts are not received
-due to wrong mapping of the reo status interrupt
-line in IPQ5018.
-
-Hence, until the mapping is resolved in HW, use
-polling to reap the reo status ring. Rather than
-a period timer to reap the ring, the timer is
-triggered only on sending a reo command with
-status request.
-
-Without proper reaping of the ring, backpressure
-and ring full issues are seen in multi client test
-setups which leads to flooding the console with
-error messages reporting failure to send reo cmds.
-
-Can be reverted once HW solution is available.
-
-Signed-off-by: Sriram R <srirrama at codeaurora.org>
----
---- a/drivers/net/wireless/ath/ath11k/core.c
-+++ b/drivers/net/wireless/ath/ath11k/core.c
-@@ -729,6 +729,7 @@ static struct ath11k_hw_params ath11k_hw
- 		.support_fw_mac_sequence = false,
- 		.support_dual_stations = false,
- 		.pdev_suspend = false,
-+		.reo_status_poll = true,
- 	},
- 	{
- 		.name = "qca2066 hw2.1",
---- a/drivers/net/wireless/ath/ath11k/dp.c
-+++ b/drivers/net/wireless/ath/ath11k/dp.c
-@@ -350,12 +350,66 @@ void ath11k_dp_stop_shadow_timers(struct
- 	ath11k_dp_shadow_stop_timer(ab, &ab->dp.reo_cmd_timer);
- }
- 
-+static void ath11k_dp_handle_reo_status_timer(struct timer_list *timer)
-+{
-+	struct ath11k_dp *dp = from_timer(dp, timer, reo_status_timer);
-+	struct ath11k_base *ab = dp->ab;
-+
-+	spin_lock_bh(&dp->reo_cmd_lock);
-+	dp->reo_status_timer_running = false;
-+	spin_unlock_bh(&dp->reo_cmd_lock);
-+
-+	ath11k_dp_process_reo_status(ab);
-+}
-+
-+void ath11k_dp_start_reo_status_timer(struct ath11k_base *ab)
-+{
-+	struct ath11k_dp *dp = &ab->dp;
-+
-+	if (!ab->hw_params.reo_status_poll)
-+		return;
-+
-+	spin_lock_bh(&dp->reo_cmd_lock);
-+	if (dp->reo_status_timer_running) {
-+		spin_unlock_bh(&dp->reo_cmd_lock);
-+		return;
-+	}
-+	dp->reo_status_timer_running = true;
-+	spin_unlock_bh(&dp->reo_cmd_lock);
-+
-+	mod_timer(&dp->reo_status_timer, jiffies +
-+		  msecs_to_jiffies(ATH11K_REO_STATUS_POLL_TIMEOUT_MS));
-+}
-+
-+static void ath11k_dp_stop_reo_status_timer(struct ath11k_base *ab)
-+{
-+	struct ath11k_dp *dp = &ab->dp;
-+
-+	if (!ab->hw_params.reo_status_poll)
-+		return;
-+
-+	del_timer_sync(&dp->reo_status_timer);
-+	dp->reo_status_timer_running = false;
-+}
-+
-+static void ath11k_dp_init_reo_status_timer(struct ath11k_base *ab)
-+{
-+	struct ath11k_dp *dp = &ab->dp;
-+
-+	if (!ab->hw_params.reo_status_poll)
-+		return;
-+
-+	timer_setup(&dp->reo_status_timer,
-+		    ath11k_dp_handle_reo_status_timer, 0);
-+}
-+
- static void ath11k_dp_srng_common_cleanup(struct ath11k_base *ab)
- {
- 	struct ath11k_dp *dp = &ab->dp;
- 	int i;
- 
- 	ath11k_dp_stop_shadow_timers(ab);
-+	ath11k_dp_stop_reo_status_timer(ab);
- 	ath11k_dp_srng_cleanup(ab, &dp->wbm_desc_rel_ring);
- 	ath11k_dp_srng_cleanup(ab, &dp->tcl_cmd_ring);
- 	ath11k_dp_srng_cleanup(ab, &dp->tcl_status_ring);
-@@ -377,6 +431,8 @@ static int ath11k_dp_srng_common_setup(s
- 	int i, ret;
- 	u8 tcl_num, wbm_num;
- 
-+	ath11k_dp_init_reo_status_timer(ab);
-+
- 	ret = ath11k_dp_srng_setup(ab, &dp->wbm_desc_rel_ring,
- 				   HAL_SW2WBM_RELEASE, 0, 0,
- 				   DP_WBM_RELEASE_RING_SIZE);
---- a/drivers/net/wireless/ath/ath11k/dp.h
-+++ b/drivers/net/wireless/ath/ath11k/dp.h
-@@ -46,6 +46,8 @@ struct dp_rx_tid {
- #define DP_MON_PURGE_TIMEOUT_MS     100
- #define DP_MON_SERVICE_BUDGET       128
- 
-+#define ATH11K_REO_STATUS_POLL_TIMEOUT_MS 10
-+
- struct dp_reo_cache_flush_elem {
- 	struct list_head list;
- 	struct dp_rx_tid data;
-@@ -287,6 +289,10 @@ struct ath11k_dp {
- 	spinlock_t reo_cmd_lock;
- 	struct ath11k_hp_update_timer reo_cmd_timer;
- 	struct ath11k_hp_update_timer tx_ring_timer[DP_TCL_NUM_RING_MAX];
-+
-+	/* reo status timer and flags */
-+	struct timer_list reo_status_timer;
-+	bool reo_status_timer_running;
- };
- 
- /* HTT definitions */
-@@ -1690,5 +1696,6 @@ void ath11k_dp_shadow_init_timer(struct
- 				 struct ath11k_hp_update_timer *update_timer,
- 				 u32 interval, u32 ring_id);
- void ath11k_dp_stop_shadow_timers(struct ath11k_base *ab);
-+void ath11k_dp_start_reo_status_timer(struct ath11k_base *ab);
- 
- #endif
---- a/drivers/net/wireless/ath/ath11k/dp_tx.c
-+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
-@@ -788,6 +788,10 @@ int ath11k_dp_tx_send_reo_cmd(struct ath
- 	if (cmd_num == 0)
- 		return -EINVAL;
- 
-+	/* Trigger reo status polling if required */
-+	if (cmd->flag & HAL_REO_CMD_FLG_NEED_STATUS)
-+		ath11k_dp_start_reo_status_timer(ab);
-+
- 	if (!cb)
- 		return 0;
- 
---- a/drivers/net/wireless/ath/ath11k/hw.h
-+++ b/drivers/net/wireless/ath/ath11k/hw.h
-@@ -233,6 +233,7 @@ struct ath11k_hw_params {
- 	bool support_fw_mac_sequence;
- 	bool support_dual_stations;
- 	bool pdev_suspend;
-+	bool reo_status_poll;
- };
- 
- struct ath11k_hw_ops {
diff --git a/target/linux/qualcommax/patches-6.12/0816-arm64-dts-qcom-ipq5018-add-wifi-support.patch b/target/linux/qualcommax/patches-6.12/0816-arm64-dts-qcom-ipq5018-add-wifi-support.patch
index d3e5c58940..4d4b48d5af 100644
--- a/target/linux/qualcommax/patches-6.12/0816-arm64-dts-qcom-ipq5018-add-wifi-support.patch
+++ b/target/linux/qualcommax/patches-6.12/0816-arm64-dts-qcom-ipq5018-add-wifi-support.patch
@@ -45,7 +45,7 @@ Signed-off-by: George Moussalem <george.moussalem at outlook.com>
 +				     <GIC_SPI 309 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 310 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
-+				     <GIC_SPI 312 IRQ_TYPE_EDGE_RISING>,
++				     <GIC_SPI 334 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 313 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 314 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 315 IRQ_TYPE_EDGE_RISING>,
@@ -67,7 +67,7 @@ Signed-off-by: George Moussalem <george.moussalem at outlook.com>
 +				     <GIC_SPI 331 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 333 IRQ_TYPE_EDGE_RISING>,
-+				     <GIC_SPI 334 IRQ_TYPE_EDGE_RISING>,
++				     <GIC_SPI 312 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 335 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 336 IRQ_TYPE_EDGE_RISING>,
 +				     <GIC_SPI 337 IRQ_TYPE_EDGE_RISING>,



From lede-commits at lists.infradead.org  Wed Dec 24 10:39:58 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 13:39:58 -0500
Subject: [openwrt/openwrt]  build: fix missing PKG_INFO_DIR
In-Reply-To: <176660159785.2397758.17852393493365281812@git-01.infra.openwrt.org>
References: <176660159785.2397758.17852393493365281812@git-01.infra.openwrt.org>
Message-ID: <mailman.39239.1766601605.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/eaeae068cccf549acf2c296e7e1ad0e331def102

commit eaeae068cccf549acf2c296e7e1ad0e331def102
Author: George Sapkin <george at sapk.in>
AuthorDate: Wed Dec 24 04:28:49 2025 +0200

    build: fix missing PKG_INFO_DIR
    
    If the first built package has an ABI, PKG_INFO_DIR might not exist, so
    ensure it does.
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21265
    (cherry picked from commit 56bc4a0d894f18933c6de2b65a042d4f34f50cd9)
    Link: https://github.com/openwrt/openwrt/pull/21253
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 include/package-pack.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/package-pack.mk b/include/package-pack.mk
index 980fe29f69..b38000ca97 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -191,6 +191,7 @@ endif
     $(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
 	mkdir -p $(STAGING_DIR_ROOT)/stamp
 	$(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || { \
+		mkdir -p $(PKG_INFO_DIR); \
 		echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version; \
 		$(foreach pkg,$(filter-out $(1),$(PROVIDES)), \
 			cp $(PKG_INFO_DIR)/$(1).version $(PKG_INFO_DIR)/$(pkg).version; \



From lede-commits at lists.infradead.org  Wed Dec 24 10:39:57 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 13:39:57 -0500
Subject: [openwrt/openwrt]  build: fix apk packaging and ABI-versioning
In-Reply-To: <176660159785.2397758.17852393493365281812@git-01.infra.openwrt.org>
References: <176660159785.2397758.17852393493365281812@git-01.infra.openwrt.org>
Message-ID: <mailman.39240.1766601605.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/e0ea3d73d2cf4d72af107f1419aba3ce287c0080

commit e0ea3d73d2cf4d72af107f1419aba3ce287c0080
Author: George Sapkin <george at sapk.in>
AuthorDate: Thu Nov 20 01:50:03 2025 +0200

    build: fix apk packaging and ABI-versioning
    
    The updated logic for the APK dependencies and provides is as follows:
    
    - If ABI version is defined:
      - package is named `package_name-ABI_version`
      - package implicitly provides
        `package_name-ABI_version=package_version`
        this implies that only one version of a package per ABI can be
        installed at the same time
      - additionally provide `package_name` so multiple packages can be
        looked up by its base name
      - for each `provides`, provide `provide-ABI_version=package_version`
        this implies that only one version of a provide can be installed at
        the same time
    
    - else if ABI version is _not_ defined
      - package is named `package_name`
      - package implicitly provides `package_name=package_version`
        this implies that only one version of a package can be installed at
        the same time
      - if `alternatives` is defined
        - for each `provides`, provide `provide`
          this implies that multiple versions of a provide can be installed
          at the same time
      - else if `alternatives` is _not_ defined
        - for each `provides`, provide `provide=package_version`
          this implies that only one version of a provide can be installed
          at the same time
    
    Both cases a package can be looked up by its base name.
    
    ABI version `alternatives`, `conffiles`, `conffiles_static`, `list` and
    `rusers` files so multiple versions of the same ABI package can be
    installed side by side, and so they don't overwrite each other's
    packaging files.
    
    ABI version `EXTRA_DEPENDS` so dependencies can be correctly looked up
    using the existing OpenWrt semantics without the ABI specified. This is
    needed since ABI-versioned libraries no longer provide
    `package_name=package_version`, so that they can be installed side by
    side.
    
    Remove duplicate dependencies when `EXTRA_DEPENDS` specifies a versioned
    one that is already in `DEPENDS`.
    
    ABI is defined
    ------------------------------------------------------------------------
    
    `libsqlite3` has `PROVIDES` set to `libfake` and has two different ABI
    versions installed. `libfake` is just an example to demonstrate the
    mechanics, as the library can already be depended upon using e.g.
    `libsqlite3-0=3.51.0-r1`. Note the ABI-versioned lists.
    
    ```
    root at OpenWrt:/tmp# apk add --allow-untrusted ./libsqlite3-0-3.51.0-r1.apk
    (1/1) Installing libsqlite3-0 (3.51.0-r1)
    libsqlite3-0-3.51.0-r1.post-install: Executing script...
    OK: 22 MiB in 157 packages
    
    root at OpenWrt:/tmp# apk add --allow-untrusted ./libsqlite3-1-4.00.0-r1.apk
    (1/1) Installing libsqlite3-1 (4.00.0-r1)
    libsqlite3-1-4.00.0-r1.post-install: Executing script...
    OK: 23 MiB in 158 packages
    
    root at OpenWrt:/tmp# apk query --fields name,version,contents,provides libsqlite3-0 libsqlite3-1
    Name: libsqlite3-0
    Version: 3.51.0-r2
    Provides: libfake-0=3.51.0-r2 libsqlite3
    Contents:
      lib/apk/packages/libsqlite3-0.list
      usr/lib/libsqlite3.so.0
      usr/lib/libsqlite3.so.3.51.0
    
    Name: libsqlite3-1
    Version: 4.00.0-r1
    Provides: libfake-1=4.00.0-r1 libsqlite3
    Contents:
      lib/apk/packages/libsqlite3-1.list
      usr/lib/libsqlite3.so.1
      usr/lib/libsqlite3.so.4.00.0
    
    root at OpenWrt:/tmp# ls -lh /usr/lib/libsqlite3.so.*
    lrwxrwxrwx    1 root     root          20 Nov 20 00:23 /usr/lib/libsqlite3.so.0 -> libsqlite3.so.3.51.0
    lrwxrwxrwx    1 root     root          20 Nov 20 00:27 /usr/lib/libsqlite3.so.1 -> libsqlite3.so.4.00.0
    -rwxr-xr-x    1 root     root        1.0M Nov  6 18:19 /usr/lib/libsqlite3.so.3.51.0
    -rwxr-xr-x    1 root     root        1.0M Nov  6 18:19 /usr/lib/libsqlite3.so.4.00.0
    ```
    
    ABI is not defined
    ------------------------------------------------------------------------
    
    Both `avahi-dbus-daemon` and `avahi-nodbus-daemon` provide `avahi-daemon`,
    but have no ABI specified. This results in `avahi-daemon=0.8-r11` provides
    for both packages and only one being able to be installed at the same time:
    
    ```
    root at OpenWrt:/tmp# apk add --allow-untrusted ./avahi-nodbus-daemon-0.8-r11.apk
    (1/4) Installing libavahi-nodbus-support (0.8-r10)
    libavahi-nodbus-support-0.8-r10.post-install: Executing script...
    (2/4) Installing libdaemon (0.14-r5)
    libdaemon-0.14-r5.post-install: Executing script...
    (3/4) Installing libexpat (2.7.3-r1)
    libexpat-2.7.3-r1.post-install: Executing script...
    (4/4) Installing avahi-nodbus-daemon (0.8-r11)
    avahi-nodbus-daemon-0.8-r11.post-install: Executing script...
    23 MiB in 160 packages
    
    root at OpenWrt:/tmp# apk query --fields provides avahi-nodbus-daemon
    Provides: avahi-daemon=0.8-r11
    
    root at OpenWrt:/tmp# apk add --allow-untrusted ./avahi-dbus-daemon-0.8-r11.apk
    ERROR: unable to select packages:
      avahi-dbus-daemon-0.8-r11:
        conflicts: avahi-nodbus-daemon-0.8-r11[avahi-daemon=0.8-r11]
        satisfies: world[avahi-dbus-daemon><Q1R111s+ke9Vf+eCxDHX2BZVUK54Q=]
      avahi-nodbus-daemon-0.8-r11:
        conflicts: avahi-dbus-daemon-0.8-r11[avahi-daemon=0.8-r11]
        satisfies: world[avahi-nodbus-daemon><Q1BAu7nLI2MgRabpveLTGO2ksQz7E=]
    ```
    
    Provides and alternatives
    ------------------------------------------------------------------------
    
    Both `uclient-fetch` and `wget-nossl` provide `wget` and specify
    alternatives, so provides are not versioned and both packages can be
    installed at the same time:
    
    ```
    root at OpenWrt:/tmp# apk query --fields name,version,contents,provides uclient-fetch wget-nossl
    Name: uclient-fetch
    Version: 2025.10.03~dc909ca7-r1
    Provides: wget
    Contents:
      bin/uclient-fetch
      lib/apk/packages/uclient-fetch.alternatives
      lib/apk/packages/uclient-fetch.list
    
    Name: wget-nossl
    Version: 1.25.0-r1
    Provides: gnu-wget wget
    Contents:
      lib/apk/packages/wget-nossl.alternatives
      lib/apk/packages/wget-nossl.list
      usr/libexec/wget-nossl
    
    ```
    
    Fixes: https://github.com/openwrt/openwrt/issues/20582
    Fixes: https://github.com/openwrt/openwrt/issues/20802
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/20819
    (cherry picked from commit 18029977f65e11bafaad501399ad42a66d3baa10)
    Link: https://github.com/openwrt/openwrt/pull/21253
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 include/package-pack.mk | 79 +++++++++++++++++++++++++++++++++++--------------
 1 file changed, 57 insertions(+), 22 deletions(-)

diff --git a/include/package-pack.mk b/include/package-pack.mk
index c989fdb116..980fe29f69 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -199,11 +199,49 @@ endif
 	$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
 	touch $$@
 
-    Package/$(1)/DEPENDS := $$(call mergelist,$$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep))))
+    Package/$(1)/DEPENDS := $$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep)))
     ifneq ($$(EXTRA_DEPENDS),)
-      Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
+      ifeq ($(CONFIG_USE_APK),)
+        Package/$(1)/DEPENDS := $$(call mergelist,$$(Package/$(1)/DEPENDS))
+        Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
+      else
+        _SEP := __COMMA_SEP__
+        _SPACE := __SPACE_SEP__
+        _DEPENDS := $$(Package/$(1)/DEPENDS)
+        _EXTRA_DEPENDS_ABI :=
+        _DEP_ITEMS := $$(subst $$(_SEP),$$(space),$$(subst $$(space),$$(_SPACE),$$(subst $$(comma),$$(_SEP),$$(EXTRA_DEPENDS))))
+
+        $$(foreach dep,$$(_DEP_ITEMS), \
+          $$(eval _CUR_DEP := $$(subst $$(_SPACE),$$(space),$$(strip $$(dep)))) \
+          $$(eval _PKG_NAME := $$(word 1,$$(_CUR_DEP))) \
+          $$(if $$(findstring $$(paren_left), $$(_PKG_NAME)), \
+            $$(error "Unsupported extra dependency format: no space before '(': $$(_CUR_DEP)")) \
+          ) \
+          $$(eval _ABI_SUFFIX := $$(call GetABISuffix,$$(_PKG_NAME))) \
+          $$(eval _PKG_NAME_ABI := $$(_PKG_NAME)$$(_ABI_SUFFIX)) \
+          $$(eval _VERSION_CONSTRAINT := $$(word 2,$$(_CUR_DEP))) \
+          $$(if $$(_VERSION_CONSTRAINT), \
+            $$(eval _EXTRA_DEP := $$(_PKG_NAME_ABI) $$(_VERSION_CONSTRAINT)), \
+            $$(error "Extra dependencies must have version constraints. $$(_PKG_NAME) seems to be unversioned.") \
+          ) \
+          $$(if $$(_EXTRA_DEPENDS_ABI), \
+            $$(eval _EXTRA_DEPENDS_ABI := $$(_EXTRA_DEPENDS_ABI)$$(comma)$$(_EXTRA_DEP)), \
+            $$(eval _EXTRA_DEPENDS_ABI := $$(_EXTRA_DEP)) \
+          ) \
+          $$(if $$(_DEPENDS), \
+            $$(eval _DEPENDS := $$(filter-out $$(_PKG_NAME_ABI),$$(_DEPENDS))) \
+          ) \
+        )
+
+        _DEPENDS := $$(call mergelist,$$(_DEPENDS))
+        Package/$(1)/DEPENDS := $$(_EXTRA_DEPENDS_ABI)$$(if $$(_DEPENDS),$$(comma) $$(_DEPENDS))
+      endif
+    else
+      Package/$(1)/DEPENDS := $$(call mergelist,$$(Package/$(1)/DEPENDS))
     endif
 
+    $$(info $(1) fused dependencies: $$(Package/$(1)/DEPENDS))
+
 $(_define) Package/$(1)/CONTROL
 Package: $(1)$$(ABIV_$(1))
 Version: $(VERSION)
@@ -320,7 +358,7 @@ else
 		echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
 		echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
 		echo 'export root="$$$${IPKG_INSTROOT}"'; \
-		echo 'export pkgname="$(1)"'; \
+		echo 'export pkgname="$(1)$$(ABIV_$(1))"'; \
 		echo "add_group_and_user"; \
 		echo "default_postinst"; \
 		[ ! -f $$(ADIR_$(1))/postinst-pkg ] || sed -z 's/^\s*#!/#!/' "$$(ADIR_$(1))/postinst-pkg"; \
@@ -345,34 +383,34 @@ else
 		echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
 		echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
 		echo 'export root="$$$${IPKG_INSTROOT}"'; \
-		echo 'export pkgname="$(1)"'; \
+		echo 'export pkgname="$(1)$$(ABIV_$(1))"'; \
 		echo "default_prerm"; \
 		[ ! -f $$(ADIR_$(1))/prerm-pkg ] || sed -z 's/^\s*#!/#!/' "$$(ADIR_$(1))/prerm-pkg"; \
 	) > $$(ADIR_$(1))/pre-deinstall;
 
 	[ ! -f $$(ADIR_$(1))/postrm ] || sed -zi 's/^\s*#!/#!/' "$$(ADIR_$(1))/postrm";
 
-	if [ -n "$(USERID)" ]; then echo $(USERID) > $$(IDIR_$(1))/lib/apk/packages/$(1).rusers; fi;
-	if [ -n "$(ALTERNATIVES)" ]; then echo $(ALTERNATIVES) > $$(IDIR_$(1))/lib/apk/packages/$(1).alternatives; fi;
-	(cd $$(IDIR_$(1)) && find . -type f,l -printf "/%P\n" | sort > $(TMP_DIR)/$(1).list && mv $(TMP_DIR)/$(1).list $$(IDIR_$(1))/lib/apk/packages/$(1).list)
+	if [ -n "$(USERID)" ]; then echo $(USERID) > $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).rusers; fi;
+	if [ -n "$(ALTERNATIVES)" ]; then echo $(ALTERNATIVES) > $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).alternatives; fi;
+	(cd $$(IDIR_$(1)) && find . -type f,l -printf "/%P\n" | sort > $(TMP_DIR)/$(1).list && mv $(TMP_DIR)/$(1).list $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).list)
 	# Move conffiles to IDIR and build conffiles_static with csums
 	if [ -f $$(ADIR_$(1))/conffiles ]; then \
-		mv -f $$(ADIR_$(1))/conffiles $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles; \
-		for file in $$$$(cat $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles); do \
+		mv -f $$(ADIR_$(1))/conffiles $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles; \
+		for file in $$$$(cat $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles); do \
 			[ -f $$(IDIR_$(1))/$$$$file ] || continue; \
 			csum=$$$$($(MKHASH) sha256 $$(IDIR_$(1))/$$$$file); \
-			echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles_static; \
+			echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles_static; \
 		done; \
 	fi
 
 	# Some package (base-files) manually append stuff to conffiles
 	# Append stuff from it and delete the CONTROL directory since everything else should be migrated
 	if [ -f $$(IDIR_$(1))/CONTROL/conffiles ]; then \
-		echo $$$$(IDIR_$(1))/CONTROL/conffiles >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles; \
+		echo $$$$(IDIR_$(1))/CONTROL/conffiles >> $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles; \
 		for file in $$$$(cat $$(IDIR_$(1))/CONTROL/conffiles); do \
 			[ -f $$(IDIR_$(1))/$$$$file ] || continue; \
 			csum=$$$$($(MKHASH) sha256 $$(IDIR_$(1))/$$$$file); \
-			echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles_static; \
+			echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles_static; \
 		done; \
 		rm -rf $$(IDIR_$(1))/CONTROL/conffiles; \
 	fi
@@ -394,16 +432,13 @@ else
 	  --info "origin:$(SOURCE)" \
 	  --info "url:$(URL)" \
 	  --info "maintainer:$(MAINTAINER)" \
-	  --info "provides:$$(foreach prov,\
-			$$(filter-out $(1)$$(ABIV_$(1)), \
-			$(PROVIDES)$$(if $$(ABIV_$(1)), \
-				$(1)=$(VERSION) $(foreach provide, \
-					$(PROVIDES), \
-					$(provide)$$(ABIV_$(1))=$(VERSION) \
-				) \
-			) \
-		), \
-		$$(prov) )" \
+	  --info "provides:$$(if $$(ABIV_$(1)), \
+	    $(1) $(foreach provide,$(PROVIDES), $(provide)$$(ABIV_$(1))=$(VERSION)), \
+	    $(if $(ALTERNATIVES), \
+	      $(PROVIDES), \
+	      $(foreach provide,$(PROVIDES), $(provide)=$(VERSION)) \
+	    ) \
+	  )" \
 	  $(if $(DEFAULT_VARIANT),--info "provider-priority:100",$(if $(PROVIDES),--info "provider-priority:1")) \
 	  $$(APK_SCRIPTS_$(1)) \
 	  --info "depends:$$(foreach depends,$$(subst $$(comma),$$(space),$$(subst $$(space),,$$(subst $$(paren_right),,$$(subst $$(paren_left),,$$(Package/$(1)/DEPENDS))))),$$(depends))" \



From lede-commits at lists.infradead.org  Wed Dec 24 10:39:59 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 24 Dec 2025 13:39:59 -0500
Subject: [openwrt/openwrt]  toolchain: fix libgcc ABI for libc
In-Reply-To: <176660159785.2397758.17852393493365281812@git-01.infra.openwrt.org>
References: <176660159785.2397758.17852393493365281812@git-01.infra.openwrt.org>
Message-ID: <mailman.39243.1766601608.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/116083dd912db099ddb42f076999819e0baf3ff2

commit 116083dd912db099ddb42f076999819e0baf3ff2
Author: George Sapkin <george at sapk.in>
AuthorDate: Wed Dec 24 04:32:01 2025 +0200

    toolchain: fix libgcc ABI for libc
    
    libc depends on knowing libgcc's ABI, so it needs to be evaluated first.
    Otherwise libc will depend on an ABI-less libgcc causing the rest of the
    toolchain to fail.
    
    Building package index...
    ERROR: unable to select packages:
      libgcc (virtual):
        note: please select one of the 'provided by'
              packages explicitly
        provided by: libgcc1
        required by: world[libgcc]
    
    Before:
    
    libc fused dependencies: libgcc
    libgcc fused dependencies:
    libatomic fused dependencies: libgcc1
    
    After:
    
    libgcc fused dependencies:
    libc fused dependencies: libgcc1
    libatomic fused dependencies: libgcc1
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21265
    (cherry picked from commit 5e32bfbf4bbe8fa4517f27d91d5f53177f7b836a)
    Link: https://github.com/openwrt/openwrt/pull/21253
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/libs/toolchain/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile
index f73004bddd..f1f15eddc0 100644
--- a/package/libs/toolchain/Makefile
+++ b/package/libs/toolchain/Makefile
@@ -781,8 +781,9 @@ else
 
 endif
 
-$(eval $(call BuildPackage,libc))
 $(eval $(call BuildPackage,libgcc))
+# libc depends on knowing libgcc's ABI, so it needs to be evaluated first
+$(eval $(call BuildPackage,libc))
 $(eval $(call BuildPackage,libatomic))
 $(eval $(call BuildPackage,libquadmath))
 $(eval $(call BuildPackage,libstdcpp))



From lede-commits at lists.infradead.org  Thu Dec 25 03:44:23 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 25 Dec 2025 06:44:23 -0500
Subject: [openwrt/openwrt]  ipq-wifi: update to Git HEAD (2025-12-25)
In-Reply-To: <176666306393.2405290.1376437989204804645@git-01.infra.openwrt.org>
References: <176666306393.2405290.1376437989204804645@git-01.infra.openwrt.org>
Message-ID: <mailman.39321.1766663075.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3602a98f55b9024ae4aa00a23873b0b2f9fab019

commit 3602a98f55b9024ae4aa00a23873b0b2f9fab019
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Thu Dec 25 12:43:16 2025 +0100

    ipq-wifi: update to Git HEAD (2025-12-25)
    
    ed56ad0 qcn6122: Add BDF for Linksys MX6200
    1f83ec8 ipq5018: Add BDF for Linksys MX6200
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/firmware/ipq-wifi/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index a1a3e6a798..da6f29e29e 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -6,9 +6,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
-PKG_SOURCE_DATE:=2025-12-16
-PKG_SOURCE_VERSION:=10eddd6f1cbabd1972a71526d979033325f958c6
-PKG_MIRROR_HASH:=1fd55a5cf582f131a371d70de5919b7e54c6ecdc078991dd8a2d21469976c12f
+PKG_SOURCE_DATE:=2025-12-25
+PKG_SOURCE_VERSION:=ed56ad0574b2846ca4be2cd5226d8f82dc646650
+PKG_MIRROR_HASH:=77cc1b6be9c2c338aa0c24fc4b1b1eac0f23c5a98e59f01309da3cf05e5c8c8c
 PKG_FLAGS:=nonshared
 
 include $(INCLUDE_DIR)/package.mk



From lede-commits at lists.infradead.org  Thu Dec 25 07:24:57 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 25 Dec 2025 10:24:57 -0500
Subject: [openwrt/openwrt]  comgt-ncm: fix setting ip[46]table and MTU
In-Reply-To: <176667629785.3561523.10458142498999444737@git-01.infra.openwrt.org>
References: <176667629785.3561523.10458142498999444737@git-01.infra.openwrt.org>
Message-ID: <mailman.39328.1766676303.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/c8b98eab98a189ae17c2221067777739a39cd603

commit c8b98eab98a189ae17c2221067777739a39cd603
Author: Alexander Patrakov <patrakov at gmail.com>
AuthorDate: Sun Sep 28 03:59:41 2025 +0800

    comgt-ncm: fix setting ip[46]table and MTU
    
    The ncm proto handler ignored ip4table, ip6table, and mtu settings.
    
    The fix is based on the existing code in the mbim proto handler.
    
    Fixes: #20216.
    Signed-off-by: Alexander Patrakov <patrakov at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20217
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit b289edd84b3849ce6819e9eb078ab2f3e32f306f)
---
 package/network/utils/comgt/files/ncm.sh | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh
index a986973838..9cb5b1e662 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -22,6 +22,7 @@ proto_ncm_init_config() {
 	proto_config_add_boolean sourcefilter
 	proto_config_add_boolean delegate
 	proto_config_add_int profile
+	proto_config_add_int mtu
 	proto_config_add_defaults
 }
 
@@ -30,8 +31,8 @@ proto_ncm_setup() {
 
 	local connect context_type devname devpath finalize ifpath initialize manufacturer setmode
 
-	local delegate sourcefilter $PROTO_DEFAULT_OPTIONS
-	json_get_vars delegate sourcefilter $PROTO_DEFAULT_OPTIONS
+	local delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS
+	json_get_vars delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS
 
 	local apn auth delay device ifname mode password pdptype pincode profile username
 	json_get_vars apn auth delay device ifname mode password pdptype pincode profile username
@@ -192,9 +193,9 @@ proto_ncm_setup() {
 		json_add_string ifname "@$interface"
 		json_add_string proto "dhcp"
 		proto_add_dynamic_defaults
-		[ -n "$zone" ] && {
-			json_add_string zone "$zone"
-		}
+		[ -n "$zone" ] && json_add_string zone "$zone"
+		[ -n "$ip4table" ] && json_add_string ip4table "$ip4table"
+
 		json_close_object
 		ubus call network add_dynamic "$(json_dump)"
 	}
@@ -208,13 +209,18 @@ proto_ncm_setup() {
 		[ "$delegate" = "0" ] && json_add_boolean delegate "0"
 		[ "$sourcefilter" = "0" ] && json_add_boolean sourcefilter "0"
 		proto_add_dynamic_defaults
-		[ -n "$zone" ] && {
-			json_add_string zone "$zone"
-		}
+		[ -n "$zone" ] && json_add_string zone "$zone"
+		[ -n "$ip6table" ] && json_add_string ip6table "$ip6table"
+
 		json_close_object
 		ubus call network add_dynamic "$(json_dump)"
 	}
 
+	[ -n "$mtu" -a "$mtu" != 0 ] && {
+		echo "Setting MTU of $ifname to $mtu"
+		/sbin/ip link set dev $ifname mtu $mtu
+	}
+
 	[ -n "$finalize" ] && {
 		eval COMMAND="$finalize" gcom -d "$device" -s /etc/gcom/runcommand.gcom || {
 			echo "Failed to configure modem"



From lede-commits at lists.infradead.org  Thu Dec 25 07:24:58 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 25 Dec 2025 10:24:58 -0500
Subject: [openwrt/openwrt]  kernel: add option for USB FunctionFS gadget
In-Reply-To: <176667629785.3561523.10458142498999444737@git-01.infra.openwrt.org>
References: <176667629785.3561523.10458142498999444737@git-01.infra.openwrt.org>
Message-ID: <mailman.39329.1766676303.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/8bf13dcb36940f2d656ea8d24cbdf4320bee5e72

commit 8bf13dcb36940f2d656ea8d24cbdf4320bee5e72
Author: Dominic Germain <dominic at germain.cc>
AuthorDate: Fri Dec 19 09:46:57 2025 -0500

    kernel: add option for USB FunctionFS gadget
    
    Add menuconfig option 'kmod-usb-gadget-fs' for the USB FunctionFS gadget
    module
    
    OpenWRT is perfect for USB gadgets that are network-enabled, since it
    provides everything needed to easily manage the device. Having support
    for the FunctionFS gadget enables the use of any custom USB devices
    that does not have a specific module, like Media Transfer Protocol.
    
    Signed-off-by: Dominic Germain <dominic at germain.cc>
    Link: https://github.com/openwrt/openwrt/pull/21207
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 22a69dfa4a9a04833aaac62b9f0a7814571b9e07)
---
 package/kernel/linux/modules/usb.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index d484c3a8f8..7d99933725 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -154,6 +154,24 @@ endef
 
 $(eval $(call KernelPackage,usb-gadget-hid))
 
+define KernelPackage/usb-gadget-fs
+  TITLE:=USB FunctionFS Gadget Support
+  KCONFIG:=CONFIG_USB_FUNCTIONFS \
+    CONFIG_USB_FUNCTIONFS_ETH=n \
+    CONFIG_USB_FUNCTIONFS_RNDIS=n
+  FILES:= \
+	  $(LINUX_DIR)/drivers/usb/gadget/legacy/g_ffs.ko \
+	  $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_fs.ko
+  AUTOLOAD:=$(call AutoLoad,52,usb_f_fs)
+  $(call AddDepends/usbgadget,+kmod-usb-lib-composite +kmod-dma-buf)
+endef
+
+define KernelPackage/usb-gadget-fs/description
+  Kernel support for USB FunctionFS Gadget.
+endef
+
+$(eval $(call KernelPackage,usb-gadget-fs))
+
 define KernelPackage/usb-gadget-ehci-debug
   TITLE:=USB EHCI debug port Gadget support
   KCONFIG:=\



From lede-commits at lists.infradead.org  Thu Dec 25 08:10:49 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 25 Dec 2025 11:10:49 -0500
Subject: [openwrt/openwrt]  wifi-scripts: fix macaddr check in mac80211.uc
In-Reply-To: <176667904953.11915.4360410344363786832@git-01.infra.openwrt.org>
References: <176667904953.11915.4360410344363786832@git-01.infra.openwrt.org>
Message-ID: <mailman.39330.1766679057.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2ebcda1ea6b757864c4700e543a9767752ca766e

commit 2ebcda1ea6b757864c4700e543a9767752ca766e
Author: Harin Lee <me at harin.net>
AuthorDate: Thu Dec 25 04:15:25 2025 +0900

    wifi-scripts: fix macaddr check in mac80211.uc
    
    This fixes a simple logic error in the macaddr existence check in mac80211.uc.
    
    Signed-off-by: Harin Lee <me at harin.net>
    Link: https://github.com/openwrt/openwrt/pull/21277
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc b/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
index e82525e247..0b81fd65ec 100644
--- a/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
+++ b/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
@@ -20,7 +20,7 @@ function radio_exists(path, macaddr, phy, radio) {
 			continue;
 		if (radio != null && int(s.radio) != radio)
 			continue;
-		if (s.macaddr & lc(s.macaddr) == lc(macaddr))
+		if (s.macaddr && lc(s.macaddr) == lc(macaddr))
 			return true;
 		if (s.phy == phy)
 			return true;



From lede-commits at lists.infradead.org  Thu Dec 25 10:45:56 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 25 Dec 2025 13:45:56 -0500
Subject: [openwrt/openwrt]  wifi-scripts: add missing 802.11be type in
 hwmodelist
In-Reply-To: <176668835659.1529293.14235477677337414667@git-01.infra.openwrt.org>
References: <176668835659.1529293.14235477677337414667@git-01.infra.openwrt.org>
Message-ID: <mailman.39344.1766688366.2093109.lede-commits@lists.infradead.org>

nick pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/95112a493923c0cbda244e89388131c27bac0c4f

commit 95112a493923c0cbda244e89388131c27bac0c4f
Author: Elwin Huang <s09289728096 at gmail.com>
AuthorDate: Wed Dec 24 14:01:32 2025 +0800

    wifi-scripts: add missing 802.11be type in hwmodelist
    
    Add EHT* check so that the hwmode will display 802.11be capability correctly.
    
    Signed-off-by: Elwin Huang <s09289728096 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21267
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
index b2eb8cfd10..554ed71d3b 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
@@ -316,7 +316,7 @@ function dbm2quality(dbm) {
 }
 
 function hwmodelist(name) {
-	const mode = { 'HT*': 'n', 'VHT*': 'ac', 'HE*': 'ax' };
+	const mode = { 'HT*': 'n', 'VHT*': 'ac', 'HE*': 'ax', 'EHT*': 'be' };
 	let iface = ifaces[name];
 	let phy = board_data.wlan?.['phy' + iface.wiphy];
 	if (!phy || !iface.radio?.band)



From lede-commits at lists.infradead.org  Thu Dec 25 13:00:52 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 25 Dec 2025 16:00:52 -0500
Subject: [openwrt/openwrt]  wifi-scripts: ucode: fix wpa_supplicant mesh
In-Reply-To: <176669645253.2330778.4654346477746887259@git-01.infra.openwrt.org>
References: <176669645253.2330778.4654346477746887259@git-01.infra.openwrt.org>
Message-ID: <mailman.39354.1766696459.2093109.lede-commits@lists.infradead.org>

nick pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/00e6c18a930df22e2734c3bc5d9b1cca1e538e6b

commit 00e6c18a930df22e2734c3bc5d9b1cca1e538e6b
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Thu Dec 25 20:32:28 2025 +0100

    wifi-scripts: ucode: fix wpa_supplicant mesh
    
    Mesh interfaces may not define an encryption setting. This results in
    a ucode runtime error when parse_encryption() is called:
      Reference error: left-hand side expression is null
      In parse_encryption(), file /usr/share/ucode/wifi/iface.uc, line 20, byte 32:
        called from function setup_sta (/usr/share/ucode/wifi/supplicant.uc:59:31)
        called from function generate (/usr/share/ucode/wifi/supplicant.uc:243:41)
        called from function setup (./mac80211.sh:254:61)
        called from anonymous function (./mac80211.sh:342:14)
       `    config.auth_type = encryption[0] ?? 'none';`
        Near here ------------------------^
    
    Link: https://github.com/openwrt/openwrt/pull/21293
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc      | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
index dae22abd9d..942fef059a 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
@@ -4,6 +4,9 @@ import { append_value, log } from 'wifi.common';
 import * as fs from 'fs';
 
 export function parse_encryption(config, dev_config) {
+	if (!config.encryption)
+		return;
+
 	let encryption = split(config.encryption, '+', 2);
 
 	config.wpa = 0;



From lede-commits at lists.infradead.org  Thu Dec 25 13:40:49 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 25 Dec 2025 16:40:49 -0500
Subject: [openwrt/openwrt]  wifi-scripts: ucode: fix wpa_supplicant mesh
In-Reply-To: <176669884948.2549066.5487849324955572631@git-01.infra.openwrt.org>
References: <176669884948.2549066.5487849324955572631@git-01.infra.openwrt.org>
Message-ID: <mailman.39355.1766698854.2093109.lede-commits@lists.infradead.org>

nick pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/2acfd9f8ab12e4f353a0aa644d9adf89588b1f0f

commit 2acfd9f8ab12e4f353a0aa644d9adf89588b1f0f
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Thu Dec 25 20:32:28 2025 +0100

    wifi-scripts: ucode: fix wpa_supplicant mesh
    
    Mesh interfaces may not define an encryption setting. This results in
    a ucode runtime error when parse_encryption() is called:
      Reference error: left-hand side expression is null
      In parse_encryption(), file /usr/share/ucode/wifi/iface.uc, line 20, byte 32:
        called from function setup_sta (/usr/share/ucode/wifi/supplicant.uc:59:31)
        called from function generate (/usr/share/ucode/wifi/supplicant.uc:243:41)
        called from function setup (./mac80211.sh:254:61)
        called from anonymous function (./mac80211.sh:342:14)
       `    config.auth_type = encryption[0] ?? 'none';`
        Near here ------------------------^
    
    Link: https://github.com/openwrt/openwrt/pull/21293
    (cherry picked from commit 00e6c18a930df22e2734c3bc5d9b1cca1e538e6b)
    Link: https://github.com/openwrt/openwrt/pull/21295
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc      | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
index dae22abd9d..942fef059a 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
@@ -4,6 +4,9 @@ import { append_value, log } from 'wifi.common';
 import * as fs from 'fs';
 
 export function parse_encryption(config, dev_config) {
+	if (!config.encryption)
+		return;
+
 	let encryption = split(config.encryption, '+', 2);
 
 	config.wpa = 0;



From lede-commits at lists.infradead.org  Fri Dec 26 03:24:01 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 26 Dec 2025 06:24:01 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: remove cpufreq scaling
In-Reply-To: <176674824145.2327613.14328986228670772268@git-01.infra.openwrt.org>
References: <176674824145.2327613.14328986228670772268@git-01.infra.openwrt.org>
Message-ID: <mailman.39370.1766748248.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c1290fa48c3a48bccfaaae98ae5a5ae0b4ab2395

commit c1290fa48c3a48bccfaaae98ae5a5ae0b4ab2395
Author: Robert Senderek <robert.senderek at 10g.pl>
AuthorDate: Tue Dec 16 14:49:40 2025 +0100

    qualcommax: ipq50xx: remove cpufreq scaling
    
    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 at 10g.pl>
    Link: https://github.com/openwrt/openwrt/pull/21185
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 ...4-dts-qcom-ipq5018-remove-cpufreq-scaling.patch | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/target/linux/qualcommax/patches-6.12/0912-arm64-dts-qcom-ipq5018-remove-cpufreq-scaling.patch b/target/linux/qualcommax/patches-6.12/0912-arm64-dts-qcom-ipq5018-remove-cpufreq-scaling.patch
new file mode 100644
index 0000000000..f3e1644b22
--- /dev/null
+++ b/target/linux/qualcommax/patches-6.12/0912-arm64-dts-qcom-ipq5018-remove-cpufreq-scaling.patch
@@ -0,0 +1,28 @@
+From 08910d6f438475bafec40654ff1c3e722d34d809 Mon Sep 17 00:00:00 2001
+From: Robert Senderek <robert.senderek at 10g.pl>
+Date: Thu, 25 Dec 2025 12:14:46 +0100
+Subject: [PATCH] arm64: dts: qcom: ipq5018:  remove cpufreq scaling
+
+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 at 10g.pl>
+---
+ arch/arm64/boot/dts/qcom/ipq5018.dtsi | 6 ------
+ 1 file changed, 6 deletions(-)
+
+--- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
++++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
+@@ -94,12 +94,6 @@
+ 		compatible = "operating-points-v2";
+ 		opp-shared;
+ 
+-		opp-800000000 {
+-			opp-hz = /bits/ 64 <800000000>;
+-			opp-microvolt = <1100000>;
+-			clock-latency-ns = <200000>;
+-		};
+-
+ 		opp-1008000000 {
+ 			opp-hz = /bits/ 64 <1008000000>;
+ 			opp-microvolt = <1100000>;



From lede-commits at lists.infradead.org  Fri Dec 26 03:24:55 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 26 Dec 2025 06:24:55 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq50xx: remove cpufreq scaling
In-Reply-To: <176674829597.2330459.6370177763579082227@git-01.infra.openwrt.org>
References: <176674829597.2330459.6370177763579082227@git-01.infra.openwrt.org>
Message-ID: <mailman.39371.1766748300.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/400c1c5ea8cc75810d22ca4b043f2bd82d8b8d7e

commit 400c1c5ea8cc75810d22ca4b043f2bd82d8b8d7e
Author: Robert Senderek <robert.senderek at 10g.pl>
AuthorDate: Tue Dec 16 14:49:40 2025 +0100

    qualcommax: ipq50xx: remove cpufreq scaling
    
    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 at 10g.pl>
    Link: https://github.com/openwrt/openwrt/pull/21185
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit c1290fa48c3a48bccfaaae98ae5a5ae0b4ab2395)
---
 ...4-dts-qcom-ipq5018-remove-cpufreq-scaling.patch | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/target/linux/qualcommax/patches-6.12/0912-arm64-dts-qcom-ipq5018-remove-cpufreq-scaling.patch b/target/linux/qualcommax/patches-6.12/0912-arm64-dts-qcom-ipq5018-remove-cpufreq-scaling.patch
new file mode 100644
index 0000000000..f3e1644b22
--- /dev/null
+++ b/target/linux/qualcommax/patches-6.12/0912-arm64-dts-qcom-ipq5018-remove-cpufreq-scaling.patch
@@ -0,0 +1,28 @@
+From 08910d6f438475bafec40654ff1c3e722d34d809 Mon Sep 17 00:00:00 2001
+From: Robert Senderek <robert.senderek at 10g.pl>
+Date: Thu, 25 Dec 2025 12:14:46 +0100
+Subject: [PATCH] arm64: dts: qcom: ipq5018:  remove cpufreq scaling
+
+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 at 10g.pl>
+---
+ arch/arm64/boot/dts/qcom/ipq5018.dtsi | 6 ------
+ 1 file changed, 6 deletions(-)
+
+--- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
++++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
+@@ -94,12 +94,6 @@
+ 		compatible = "operating-points-v2";
+ 		opp-shared;
+ 
+-		opp-800000000 {
+-			opp-hz = /bits/ 64 <800000000>;
+-			opp-microvolt = <1100000>;
+-			clock-latency-ns = <200000>;
+-		};
+-
+ 		opp-1008000000 {
+ 			opp-hz = /bits/ 64 <1008000000>;
+ 			opp-microvolt = <1100000>;



From lede-commits at lists.infradead.org  Fri Dec 26 04:38:08 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 26 Dec 2025 07:38:08 -0500
Subject: [openwrt/openwrt]  ath79: Fix syntax error in 10_fix_wifi_mac
In-Reply-To: <176675268866.2867176.3091127623882916616@git-01.infra.openwrt.org>
References: <176675268866.2867176.3091127623882916616@git-01.infra.openwrt.org>
Message-ID: <mailman.39378.1766752697.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cb94962ac474de707302eb1eb7d7f6fc4c099b0d

commit cb94962ac474de707302eb1eb7d7f6fc4c099b0d
Author: Nick French <nickfrench at gmail.com>
AuthorDate: Thu Dec 25 09:53:37 2025 -0600

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21287
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac    | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index aaef2fc15f..0ef322e898 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -60,7 +60,6 @@ case "$board" in
 	extreme-networks,ws-ap3805i)
 		[ "$PHYNBR" -eq 0 ] && \
 			mtd_get_mac_ascii cfg1 RADIOADDR0 > /sys${DEVPATH}/macaddress
-		;;
 		[ "$PHYNBR" -eq 1 ] && \
 			mtd_get_mac_ascii cfg1 RADIOADDR1 > /sys${DEVPATH}/macaddress
 		;;
@@ -71,7 +70,6 @@ case "$board" in
 		# which would allow to patch the macaddress
 		[ "$PHYNBR" -eq 0 ] && \
 			macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
-		;;
 		[ "$PHYNBR" -eq 1 ] && \
 			macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 0 > /sys${DEVPATH}/macaddress
 		;;



From lede-commits at lists.infradead.org  Fri Dec 26 04:48:51 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 26 Dec 2025 07:48:51 -0500
Subject: [openwrt/openwrt]  ath79: Fix syntax error in 10_fix_wifi_mac
In-Reply-To: <176675333064.2945994.17231720602610582175@git-01.infra.openwrt.org>
References: <176675333064.2945994.17231720602610582175@git-01.infra.openwrt.org>
Message-ID: <mailman.39379.1766753335.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/e7d89ac0ea242c259ca4af0eadc4b1241703ea76

commit e7d89ac0ea242c259ca4af0eadc4b1241703ea76
Author: Nick French <nickfrench at gmail.com>
AuthorDate: Thu Dec 25 09:53:37 2025 -0600

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21287
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit cb94962ac474de707302eb1eb7d7f6fc4c099b0d)
---
 .../ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac    | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index aaef2fc15f..0ef322e898 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -60,7 +60,6 @@ case "$board" in
 	extreme-networks,ws-ap3805i)
 		[ "$PHYNBR" -eq 0 ] && \
 			mtd_get_mac_ascii cfg1 RADIOADDR0 > /sys${DEVPATH}/macaddress
-		;;
 		[ "$PHYNBR" -eq 1 ] && \
 			mtd_get_mac_ascii cfg1 RADIOADDR1 > /sys${DEVPATH}/macaddress
 		;;
@@ -71,7 +70,6 @@ case "$board" in
 		# which would allow to patch the macaddress
 		[ "$PHYNBR" -eq 0 ] && \
 			macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
-		;;
 		[ "$PHYNBR" -eq 1 ] && \
 			macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 0 > /sys${DEVPATH}/macaddress
 		;;



From lede-commits at lists.infradead.org  Fri Dec 26 04:48:50 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 26 Dec 2025 07:48:50 -0500
Subject: [openwrt/openwrt]  wifi-scripts: add missing 802.11be type in
 hwmodelist
In-Reply-To: <176675333064.2945994.17231720602610582175@git-01.infra.openwrt.org>
References: <176675333064.2945994.17231720602610582175@git-01.infra.openwrt.org>
Message-ID: <mailman.39382.1766753335.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/51aa6d184a046d50ec8a6890d0b8b0e9a6f261c5

commit 51aa6d184a046d50ec8a6890d0b8b0e9a6f261c5
Author: Elwin Huang <s09289728096 at gmail.com>
AuthorDate: Wed Dec 24 14:01:32 2025 +0800

    wifi-scripts: add missing 802.11be type in hwmodelist
    
    Add EHT* check so that the hwmode will display 802.11be capability correctly.
    
    Signed-off-by: Elwin Huang <s09289728096 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21267
    Signed-off-by: Nick Hainke <vincent at systemli.org>
    (cherry picked from commit 95112a493923c0cbda244e89388131c27bac0c4f)
---
 .../network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
index b2eb8cfd10..554ed71d3b 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc
@@ -316,7 +316,7 @@ function dbm2quality(dbm) {
 }
 
 function hwmodelist(name) {
-	const mode = { 'HT*': 'n', 'VHT*': 'ac', 'HE*': 'ax' };
+	const mode = { 'HT*': 'n', 'VHT*': 'ac', 'HE*': 'ax', 'EHT*': 'be' };
 	let iface = ifaces[name];
 	let phy = board_data.wlan?.['phy' + iface.wiphy];
 	if (!phy || !iface.radio?.band)



From lede-commits at lists.infradead.org  Fri Dec 26 04:57:14 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 26 Dec 2025 07:57:14 -0500
Subject: [openwrt/openwrt]  mediatek: add kmod-usb3 to default package set of
 WR3000P
In-Reply-To: <176675383408.3014648.7806722070857356686@git-01.infra.openwrt.org>
References: <176675383408.3014648.7806722070857356686@git-01.infra.openwrt.org>
Message-ID: <mailman.39383.1766753843.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9da57e2f828bc4a589b9a94e4cdf1b6ccdeb110e

commit 9da57e2f828bc4a589b9a94e4cdf1b6ccdeb110e
Author: Dmitry Mostovoy <dmitry.mostovoy at ceifx.com>
AuthorDate: Thu Dec 25 11:18:57 2025 +0300

    mediatek: add kmod-usb3 to default package set of WR3000P
    
    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: 04e9d154f209 ("mediatek: filogic: add support for Cudy WR3000P v1")
    Signed-off-by: Dmitry Mostovoy <dmitry.mostovoy at ceifx.com>
    Link: https://github.com/openwrt/openwrt/pull/21281
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mediatek/image/filogic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 8c344f6789..6e19507d05 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1227,7 +1227,7 @@ define Device/cudy_wr3000p-v1
   IMAGE_SIZE := 65536k
   KERNEL_IN_UBI := 1
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
 endef
 TARGET_DEVICES += cudy_wr3000p-v1
 



From lede-commits at lists.infradead.org  Fri Dec 26 04:58:00 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 26 Dec 2025 07:58:00 -0500
Subject: [openwrt/openwrt]  mediatek: add kmod-usb3 to default package set of
 WR3000P
In-Reply-To: <176675388070.3020087.12750852298333651105@git-01.infra.openwrt.org>
References: <176675388070.3020087.12750852298333651105@git-01.infra.openwrt.org>
Message-ID: <mailman.39384.1766753885.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/d23f61445135428065eea0bef340eb4bf242d5be

commit d23f61445135428065eea0bef340eb4bf242d5be
Author: Dmitry Mostovoy <dmitry.mostovoy at ceifx.com>
AuthorDate: Thu Dec 25 11:18:57 2025 +0300

    mediatek: add kmod-usb3 to default package set of WR3000P
    
    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: 04e9d154f209 ("mediatek: filogic: add support for Cudy WR3000P v1")
    Signed-off-by: Dmitry Mostovoy <dmitry.mostovoy at ceifx.com>
    Link: https://github.com/openwrt/openwrt/pull/21281
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 9da57e2f828bc4a589b9a94e4cdf1b6ccdeb110e)
---
 target/linux/mediatek/image/filogic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 490fb69afa..2e4a0b48a3 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1196,7 +1196,7 @@ define Device/cudy_wr3000p-v1
   IMAGE_SIZE := 65536k
   KERNEL_IN_UBI := 1
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
 endef
 TARGET_DEVICES += cudy_wr3000p-v1
 



From lede-commits at lists.infradead.org  Fri Dec 26 11:04:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 26 Dec 2025 14:04:45 -0500
Subject: [openwrt/openwrt]  base-files: fix default_postinst clearing luci
 cache
In-Reply-To: <176677588543.1044507.10376446489618180679@git-01.infra.openwrt.org>
References: <176677588543.1044507.10376446489618180679@git-01.infra.openwrt.org>
Message-ID: <mailman.39394.1766775891.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e9fd3facd041263dcc080748e0637ee99c517dd8

commit e9fd3facd041263dcc080748e0637ee99c517dd8
Author: Liangbin Lian <jjm2473 at gmail.com>
AuthorDate: Thu Dec 25 13:50:14 2025 +0800

    base-files: fix default_postinst clearing luci cache
    
    The path to the LuCI index cache file has changed to
    /tmp/luci-indexcache.*.json since OpenWrt 22.03.
    
    Update functions.sh to align with luci.mk.
    
    Signed-off-by: Liangbin Lian <jjm2473 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21280
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/base-files/files/lib/functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index c1aeea7b72..de19a5670b 100644
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -382,7 +382,7 @@ default_postinst() {
 			uci commit
 		fi
 
-		rm -f /tmp/luci-indexcache
+		rm -f /tmp/luci-indexcache.*
 	fi
 
 	if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then



From lede-commits at lists.infradead.org  Fri Dec 26 14:50:44 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 26 Dec 2025 17:50:44 -0500
Subject: [openwrt/openwrt]  mediatek: add support for Elecom WRC-G01
In-Reply-To: <176678944431.2857536.4134226593506475774@git-01.infra.openwrt.org>
References: <176678944431.2857536.4134226593506475774@git-01.infra.openwrt.org>
Message-ID: <mailman.39401.1766789450.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/436c9af039ee6dded975ec93a6d2787ba3842790

commit 436c9af039ee6dded975ec93a6d2787ba3842790
Author: Yuhei Amemiya <minihui at me.com>
AuthorDate: Sun Dec 21 15:03:20 2025 +0800

    mediatek: add support for Elecom WRC-G01
    
    Hardware is identical to WRC-X3200GST3.
    - SoC: MediaTek MT7622
    - RAM: 512MB
    - Flash: 128MB SPI-NAND
    
    The -W suffix in the retail name (WRC-G01-W) denotes the casing color
    and is omitted from the model name in the OpenWrt configuration to
    maintain consistency with other Elecom devices.
    
    Signed-off-by: Yuhei Amemiya <minihui at me.com>
    Link: https://github.com/openwrt/openwrt/pull/21238
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../linux/mediatek/dts/mt7622-elecom-wrc-g01.dts   |   9 +
 .../mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts   | 427 +--------------------
 ...00gst3.dts => mt7622-elecom-wrc-x3200gst3.dtsi} |   3 -
 target/linux/mediatek/image/mt7622.mk              |  25 +-
 .../mt7622/base-files/lib/upgrade/platform.sh      |   2 +
 5 files changed, 32 insertions(+), 434 deletions(-)

diff --git a/target/linux/mediatek/dts/mt7622-elecom-wrc-g01.dts b/target/linux/mediatek/dts/mt7622-elecom-wrc-g01.dts
new file mode 100644
index 0000000000..510487625a
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7622-elecom-wrc-g01.dts
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "mt7622-elecom-wrc-x3200gst3.dtsi"
+
+/ {
+	model = "ELECOM WRC-G01";
+	compatible = "elecom,wrc-g01", "mediatek,mt7622";
+};
diff --git a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts
index c78a6f4a07..3c75f99141 100644
--- a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts
+++ b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts
@@ -1,434 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /dts-v1/;
 
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/leds/common.h>
-#include <dt-bindings/pinctrl/mt65xx.h>
-
-#include "mt7622.dtsi"
-#include "mt6380.dtsi"
+#include "mt7622-elecom-wrc-x3200gst3.dtsi"
 
 / {
 	model = "ELECOM WRC-X3200GST3";
 	compatible = "elecom,wrc-x3200gst3", "mediatek,mt7622";
-
-	aliases {
-		serial0 = &uart0;
-		led-boot = &led_power_green;
-		led-failsafe = &led_power_red;
-		led-running = &led_power_green;
-		led-upgrade = &led_power_green;
-		label-mac-device = &wan;
-	};
-
-	chosen {
-		bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512";
-	};
-
-	memory at 40000000 {
-		reg = <0 0x40000000 0 0x1f000000>;
-		device_type = "memory";
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led-0 {
-			gpios = <&pio 47 GPIO_ACTIVE_HIGH>;
-			color = <LED_COLOR_ID_RED>;
-			function = LED_FUNCTION_WPS;
-		};
-
-		led_power_red: led-1 {
-			gpios = <&pio 48 GPIO_ACTIVE_HIGH>;
-			color = <LED_COLOR_ID_RED>;
-			function = LED_FUNCTION_POWER;
-			function-enumerator = <1>;
-		};
-
-		led_power_green: led-2 {
-			gpios = <&pio 49 GPIO_ACTIVE_HIGH>;
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_POWER;
-			function-enumerator = <2>;
-		};
-
-		led-3 {
-			gpios = <&pio 50 GPIO_ACTIVE_HIGH>;
-			color = <LED_COLOR_ID_BLUE>;
-			function = LED_FUNCTION_POWER;
-			function-enumerator = <3>;
-		};
-
-		led-4 {
-			gpios = <&pio 85 GPIO_ACTIVE_HIGH>;
-			color = <LED_COLOR_ID_WHITE>;
-			function = LED_FUNCTION_WLAN;
-			function-enumerator = <1>;
-			linux,default-trigger = "phy0tpt";
-		};
-
-		led-5 {
-			gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
-			color = <LED_COLOR_ID_WHITE>;
-			function = LED_FUNCTION_WLAN;
-			function-enumerator = <2>;
-			linux,default-trigger = "phy1radio";
-		};
-	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "reset";
-			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_RESTART>;
-		};
-
-		ap {
-			label = "ap";
-			gpios = <&pio 42 GPIO_ACTIVE_LOW>;
-			linux,code = <BTN_0>;
-			linux,input-type = <EV_SW>;
-		};
-
-		router {
-			label = "router";
-			gpios = <&pio 43 GPIO_ACTIVE_LOW>;
-			linux,code = <BTN_1>;
-			linux,input-type = <EV_SW>;
-		};
-
-		wps {
-			label = "wps";
-			gpios = <&pio 102 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_WPS_BUTTON>;
-		};
-	};
-};
-
-&cpu0 {
-	proc-supply = <&mt6380_vcpu_reg>;
-	sram-supply = <&mt6380_vm_reg>;
-};
-
-&cpu1 {
-	proc-supply = <&mt6380_vcpu_reg>;
-	sram-supply = <&mt6380_vm_reg>;
-};
-
-&pio {
-	eth_pins: eth-pins {
-		mux {
-			function = "eth";
-			groups = "mdc_mdio", "rgmii_via_gmac2";
-		};
-	};
-
-	pcie0_pins: pcie0-pins {
-		mux {
-			function = "pcie";
-			groups = "pcie0_pad_perst",
-				 "pcie0_1_waken",
-				 "pcie0_1_clkreq";
-		};
-	};
-
-	pmic_bus_pins: pmic-bus-pins {
-		mux {
-			function = "pmic";
-			groups = "pmic_bus";
-		};
-	};
-
-	pwm7_pins: pwm1-2-pins {
-		mux {
-			function = "pwm";
-			groups = "pwm_ch7_2";
-		};
-	};
-
-	/* Serial NAND is shared pin with SPI-NOR */
-	serial_nand_pins: serial-nand-pins {
-		mux {
-			function = "flash";
-			groups = "snfi";
-		};
-
-		conf-cmd-data {
-			pins = "SPI_WP", "SPI_HOLD", "SPI_MOSI",
-			       "SPI_MISO", "SPI_CS";
-			drive-strength = <MTK_DRIVE_16mA>;
-			bias-pull-up;
-		};
-
-		conf-clk {
-			pins = "SPI_CLK";
-			drive-strength = <MTK_DRIVE_16mA>;
-			bias-pull-down;
-		};
-	};
-
-	uart0_pins: uart0-pins {
-		mux {
-			function = "uart";
-			groups = "uart0_0_tx_rx" ;
-		};
-	};
-
-	watchdog_pins: watchdog-pins {
-		mux {
-			function = "watchdog";
-			groups = "watchdog";
-		};
-	};
-};
-
-&eth {
-	pinctrl-names = "default";
-	pinctrl-0 = <&eth_pins>;
-	status = "okay";
-
-	gmac0: mac at 0 {
-		compatible = "mediatek,eth-mac";
-		reg = <0>;
-
-		phy-connection-type = "2500base-x";
-
-		nvmem-cells = <&macaddr_factory_7fff4>;
-		nvmem-cell-names = "mac-address";
-
-		fixed-link {
-			speed = <2500>;
-			full-duplex;
-			pause;
-		};
-	};
-
-	mdio-bus {
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		switch at 1f {
-			compatible = "mediatek,mt7531";
-			reg = <31>;
-			interrupt-controller;
-			#interrupt-cells = <1>;
-			interrupt-parent = <&pio>;
-			interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
-			reset-gpios = <&pio 54 GPIO_ACTIVE_HIGH>;
-
-			ports {
-				#address-cells = <1>;
-				#size-cells = <0>;
-
-				wan: port at 0 {
-					reg = <0>;
-					label = "wan";
-
-					nvmem-cells = <&macaddr_factory_7fffa>;
-					nvmem-cell-names = "mac-address";
-				};
-
-				port at 1 {
-					reg = <1>;
-					label = "lan4";
-				};
-
-				port at 2 {
-					reg = <2>;
-					label = "lan3";
-				};
-
-				port at 3 {
-					reg = <3>;
-					label = "lan2";
-				};
-
-				port at 4 {
-					reg = <4>;
-					label = "lan1";
-				};
-
-				port at 6 {
-					reg = <6>;
-					ethernet = <&gmac0>;
-					phy-mode = "2500base-x";
-
-					fixed-link {
-						speed = <2500>;
-						full-duplex;
-						pause;
-					};
-				};
-			};
-		};
-	};
-};
-
-&bch {
-	status = "okay";
-};
-
-&snfi {
-	pinctrl-names = "default";
-	pinctrl-0 = <&serial_nand_pins>;
-	status = "okay";
-
-	flash at 0 {
-		compatible = "spi-nand";
-		reg = <0>;
-		spi-tx-bus-width = <4>;
-		spi-rx-bus-width = <4>;
-		nand-ecc-engine = <&snfi>;
-		mediatek,bmt-v2;
-		mediatek,bmt-table-size = <0x1000>;
-		mediatek,bmt-remap-range = <0x0 0x8c0000>,
-					   <0x1bc0000 0x30c0000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "Preloader";
-				reg = <0x0 0x80000>;
-				read-only;
-			};
-
-			partition at 80000 {
-				label = "ATF";
-				reg = <0x80000 0x40000>;
-				read-only;
-			};
-
-			partition at c0000 {
-				label = "u-boot";
-				reg = <0xc0000 0x80000>;
-				read-only;
-			};
-
-			partition at 140000 {
-				label = "u-boot-env";
-				reg = <0x140000 0x80000>;
-				read-only;
-			};
-
-			factory: partition at 1c0000 {
-				label = "factory";
-				reg = <0x1c0000 0x100000>;
-				read-only;
-
-				nvmem-layout {
-					compatible = "fixed-layout";
-					#address-cells = <1>;
-					#size-cells = <1>;
-
-					macaddr_factory_4: macaddr at 4 {
-						compatible = "mac-base";
-						reg = <0x4 0x6>;
-						#nvmem-cell-cells = <1>;
-					};
-
-					macaddr_factory_7fff4: macaddr at 7fff4 {
-						reg = <0x7fff4 0x6>;
-					};
-
-					macaddr_factory_7fffa: macaddr at 7fffa {
-						reg = <0x7fffa 0x6>;
-					};
-				};
-			};
-
-			partition at 2c0000 {
-				label = "kernel";
-				reg = <0x2c0000 0x600000>;
-			};
-
-			partition at 8c0000 {
-				label = "ubi";
-				reg = <0x8c0000 0x1300000>;
-			};
-
-			partition at 1bc0000 {
-				label = "tm_pattern";
-				reg = <0x1bc0000 0x500000>;
-				read-only;
-			};
-
-			partition at 20c0000 {
-				label = "tm_key";
-				reg = <0x20c0000 0x100000>;
-				read-only;
-			};
-
-			partition at 21c0000 {
-				label = "user_data";
-				reg = <0x21c0000 0xf00000>;
-				read-only;
-			};
-
-			partition at 30c0000 {
-				label = "reserved";
-				reg = <0x30c0000 0x4f40000>;
-				read-only;
-			};
-		};
-	};
-};
-
-&pcie0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pcie0_pins>;
-	status = "okay";
-};
-
-&slot0 {
-	status = "okay";
-
-	wifi at 0,0 {
-		compatible = "mediatek,mt76";
-		reg = <0x0000 0 0 0 0>;
-		mediatek,mtd-eeprom = <&factory 0x5000>;
-		ieee80211-freq-limit = <5000000 6000000>;
-		nvmem-cells = <&macaddr_factory_4 1>;
-		nvmem-cell-names = "mac-address";
-	};
-};
-
-&pwm {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pwm7_pins>;
-	status = "okay";
-};
-
-&pwrap {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pmic_bus_pins>;
-	status = "okay";
-};
-
-&rtc {
-	status = "disabled";
-};
-
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins>;
-	status = "okay";
-};
-
-&watchdog {
-	pinctrl-names = "default";
-	pinctrl-0 = <&watchdog_pins>;
-	status = "okay";
-};
-
-&wmac {
-	status = "okay";
-
-	mediatek,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dtsi
similarity index 98%
copy from target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts
copy to target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dtsi
index c78a6f4a07..6061943719 100644
--- a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts
+++ b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dtsi
@@ -10,9 +10,6 @@
 #include "mt6380.dtsi"
 
 / {
-	model = "ELECOM WRC-X3200GST3";
-	compatible = "elecom,wrc-x3200gst3", "mediatek,mt7622";
-
 	aliases {
 		serial0 = &uart0;
 		led-boot = &led_power_green;
diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk
index e45c064046..14d1330b36 100644
--- a/target/linux/mediatek/image/mt7622.mk
+++ b/target/linux/mediatek/image/mt7622.mk
@@ -213,10 +213,19 @@ define Device/elecom_wrc-2533gent
 endef
 TARGET_DEVICES += elecom_wrc-2533gent
 
-define Device/elecom_wrc-x3200gst3
+define Device/elecom_wrc-g01
+  $(Device/elecom_wrc-gst)
+  DEVICE_MODEL := WRC-G01
+  DEVICE_DTS := mt7622-elecom-wrc-g01
+  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \
+	append-ubi | check-size | \
+	elecom-wrc-gs-factory WRC-G01 0.00 -N | \
+	append-string MT7622_ELECOM_WRC-G01
+endef
+TARGET_DEVICES += elecom_wrc-g01
+
+define Device/elecom_wrc-gst
   DEVICE_VENDOR := ELECOM
-  DEVICE_MODEL := WRC-X3200GST3
-  DEVICE_DTS := mt7622-elecom-wrc-x3200gst3
   DEVICE_DTS_DIR := ../dts
   IMAGE_SIZE := 25600k
   KERNEL_SIZE := 6144k
@@ -224,12 +233,18 @@ define Device/elecom_wrc-x3200gst3
   PAGESIZE := 2048
   UBINIZE_OPTS := -E 5
   IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  DEVICE_PACKAGES := kmod-mt7915-firmware
+endef
+
+define Device/elecom_wrc-x3200gst3
+  $(Device/elecom_wrc-gst)
+  DEVICE_MODEL := WRC-X3200GST3
+  DEVICE_DTS := mt7622-elecom-wrc-x3200gst3
   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \
 	append-ubi | check-size | \
 	elecom-wrc-gs-factory WRC-X3200GST3 0.00 -N | \
 	append-string MT7622_ELECOM_WRC-X3200GST3
-  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  DEVICE_PACKAGES := kmod-mt7915-firmware
 endef
 TARGET_DEVICES += elecom_wrc-x3200gst3
 
diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
index 841397d4ef..471a8a127d 100755
--- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
@@ -20,6 +20,7 @@ platform_do_upgrade() {
 		;;
 	dlink,eagle-pro-ai-m32-a1|\
 	dlink,eagle-pro-ai-r32-a1|\
+	elecom,wrc-g01|\
 	elecom,wrc-x3200gst3|\
 	mediatek,mt7622-rfb1-ubi|\
 	netgear,wax206|\
@@ -60,6 +61,7 @@ platform_check_image() {
 		;;
 	dlink,eagle-pro-ai-m32-a1|\
 	dlink,eagle-pro-ai-r32-a1|\
+	elecom,wrc-g01|\
 	elecom,wrc-x3200gst3|\
 	mediatek,mt7622-rfb1-ubi|\
 	netgear,wax206|\



From lede-commits at lists.infradead.org  Sat Dec 27 02:19:13 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 05:19:13 -0500
Subject: [openwrt/openwrt]  wifi-scripts: fix wdev fallback for mesh
 interfaces
In-Reply-To: <176683075331.2564744.6977690627764909718@git-01.infra.openwrt.org>
References: <176683075331.2564744.6977690627764909718@git-01.infra.openwrt.org>
Message-ID: <mailman.39437.1766830757.2093109.lede-commits@lists.infradead.org>

nick pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a18ef412ae73b605a99c319e02bcff9a63b3bfa8

commit a18ef412ae73b605a99c319e02bcff9a63b3bfa8
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Thu Dec 25 18:41:10 2025 +0100

    wifi-scripts: fix wdev fallback for mesh interfaces
    
    The previous wdev.uc invocation failed for mesh interfaces.
    Rewrite it as a loop so the mesh interface is created correctly
    when no wpa_supplicant mesh support is installed.
    
    Link: https://github.com/openwrt/openwrt/pull/21291
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
index 8aba81436e..dcfdcd2cc8 100755
--- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
+++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
@@ -294,7 +294,15 @@ function setup() {
 	if (fs.access('/usr/sbin/hostapd', 'x'))
 		hostapd.setup(data);
 
-	system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${printf("%J", wdev_data)}' ${join(' ', active_ifnames)}`);
+	for (let ifname in active_ifnames) {
+		if (!wdev_data[ifname])
+			continue;
+
+		let if_config = {
+			[ifname]: wdev_data[ifname]
+		};
+		system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${if_config}'`);
+	}
 
 	if (length(supplicant_data) > 0)
 		supplicant.start(data);



From lede-commits at lists.infradead.org  Sat Dec 27 02:19:14 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 05:19:14 -0500
Subject: [openwrt/openwrt]  wifi-scripts: fix mcast_rate type (number,
 not array)
In-Reply-To: <176683075331.2564744.6977690627764909718@git-01.infra.openwrt.org>
References: <176683075331.2564744.6977690627764909718@git-01.infra.openwrt.org>
Message-ID: <mailman.39438.1766830758.2093109.lede-commits@lists.infradead.org>

nick pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a6eb3d9536b8f0290ab2191780c6d3559843aca9

commit a6eb3d9536b8f0290ab2191780c6d3559843aca9
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Fri Dec 26 18:35:01 2025 +0100

    wifi-scripts: fix mcast_rate type (number, not array)
    
    The multicast rate (mcast_rate) is defined as a single numeric value,
    not an array. The ucode scripts already expect a single number, and
    the OpenWrt documentation specifies this option as an integer [0].
    
    Adjust the wireless schema accordingly. This also fixes the wdev.uc
    call path for the iw fallback mesh setup.
    
    [0] - https://openwrt.org/docs/guide-user/network/wifi/basic
    
    Link: https://github.com/openwrt/openwrt/pull/21291
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../files-ucode/usr/share/schema/wireless.wifi-iface.json          | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json
index c246c8fa4f..f5507305bd 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json
@@ -605,11 +605,8 @@
 			"type": "boolean"
 		},
 		"mcast_rate": {
-			"description": "Allowed multicast rates",
-			"type": "array",
-			"items": {
-				"type": "number"
-			}
+			"description": "Allowed multicast rate",
+			"type": "number"
 		},
 		"mesh_auto_open_plinks": {
 			"type": "boolean"



From lede-commits at lists.infradead.org  Sat Dec 27 03:16:40 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 06:16:40 -0500
Subject: [openwrt/openwrt]  Revert "qualcommax: ipq50xx: remove ipq5018 and
 qcn6122 wifi m3 fw"
In-Reply-To: <176683420094.2861037.2193776390560595705@git-01.infra.openwrt.org>
References: <176683420094.2861037.2193776390560595705@git-01.infra.openwrt.org>
Message-ID: <mailman.39441.1766834206.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6a1f105e7276b098a82c1b6b06405b4c76478985

commit 6a1f105e7276b098a82c1b6b06405b4c76478985
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Sat Dec 27 12:16:15 2025 +0100

    Revert "qualcommax: ipq50xx: remove ipq5018 and qcn6122 wifi m3 fw"
    
    This reverts commit 423cda97f9e5152c6e9ad210d7a6b089d3664f28.
    
    It appears that this broke remoteproc on some devices, so revert for now.
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts    |   3 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-ax850.dts     |   3 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts    |   3 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts    |   3 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi  |   4 +-
 .../arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts   |   3 +-
 ...-qcom-wcss-sec-add-split-firmware-support.patch | 102 +++++++++++++++++++++
 7 files changed, 115 insertions(+), 6 deletions(-)

diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts
index a0b94bd2f7..4782101483 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax6000.dts
@@ -572,7 +572,8 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
+			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts
index 0593c955e0..592fc84c5b 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-ax850.dts
@@ -399,7 +399,8 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
+			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts
index 8ff30ec436..4c1f50938c 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mr5500.dts
@@ -326,7 +326,8 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
+			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts
index 0ea27d3373..73d232e05c 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx5500.dts
@@ -173,7 +173,8 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
+			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi
index ceb03b00a3..a59c6ceda3 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-qcn6122.dtsi
@@ -12,7 +12,9 @@
 &q6v5_wcss {
 	compatible = "qcom,ipq5018-q6-mpd";
 
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
+			"ath11k/IPQ5018/hw1.0/m3_fw.mdt",
+ 			"ath11k/QCN6122/hw1.0/m3_fw.mdt";
 
 	// IPQ5018
 	q6_wcss_pd1: pd-1 {
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts
index 90a87299a6..1dafa63414 100644
--- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts
@@ -184,7 +184,8 @@
 };
 
 &q6v5_wcss {
-	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
+	firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
+			"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
 };
 
 &wifi {
diff --git a/target/linux/qualcommax/patches-6.12/0808-remoteproc-qcom-wcss-sec-add-split-firmware-support.patch b/target/linux/qualcommax/patches-6.12/0808-remoteproc-qcom-wcss-sec-add-split-firmware-support.patch
new file mode 100644
index 0000000000..29644e3fdb
--- /dev/null
+++ b/target/linux/qualcommax/patches-6.12/0808-remoteproc-qcom-wcss-sec-add-split-firmware-support.patch
@@ -0,0 +1,102 @@
+From: George Moussalem <george.moussalem at outlook.com>
+Date: Tue, 21 Oct 2025 15:26:31 +0400
+Subject: [PATCH] remoteproc: qcom: wcss-sec: add split firmware support
+
+The driver currently expects only one firmware file to be loaded as part
+of bringing up WCSS. For IPQ5018 and QCN6122, multiple firmware files are
+required, both the q6 and m3 firmware files. As such, add support for
+loading up to 3 firmware files.
+
+Signed-off-by: George Moussalem <george.moussalem at outlook.com>
+---
+--- a/drivers/remoteproc/qcom_q6v5_wcss_sec.c
++++ b/drivers/remoteproc/qcom_q6v5_wcss_sec.c
+@@ -25,6 +25,8 @@
+ 
+ #define Q6_WAIT_TIMEOUT			(5 * HZ)
+ 
++#define MAX_FIRMWARE			3
++
+ struct wcss_sec {
+ 	struct device *dev;
+ 	struct qcom_rproc_glink glink_subdev;
+@@ -35,6 +37,7 @@ struct wcss_sec {
+ 	void *mem_region;
+ 	size_t mem_size;
+ 	const struct wcss_data *desc;
++	const char **firmware;
+ 
+ 	struct mbox_client mbox_client;
+ 	struct mbox_chan *mbox_chan;
+@@ -137,7 +140,8 @@ static int wcss_sec_load(struct rproc *r
+ {
+ 	struct wcss_sec *wcss = rproc->priv;
+ 	struct device *dev = wcss->dev;
+-	int ret;
++	const struct firmware *fw_hdl;
++	int i, ret;
+ 
+ 	if (wcss->desc->use_tmelcom) {
+ 		wcss->metadata = qcom_mdt_read_metadata(fw, &wcss->metadata_len,
+@@ -161,6 +165,28 @@ static int wcss_sec_load(struct rproc *r
+ 				    wcss->mem_phys, wcss->mem_size, &wcss->mem_reloc);
+ 		if (ret)
+ 			return ret;
++
++		for (i = 1; i < MAX_FIRMWARE; i++) {
++			if (!wcss->firmware[i])
++				continue;
++
++			ret = request_firmware(&fw_hdl, wcss->firmware[i], dev);
++
++			if (ret)
++				continue;
++
++			ret = qcom_mdt_load_no_init(dev, fw_hdl, wcss->firmware[i], 0,
++						    wcss->mem_region, wcss->mem_phys,
++						    wcss->mem_size, &wcss->mem_reloc);
++
++			release_firmware(fw_hdl);
++
++			if (ret) {
++				dev_err(dev, "error %d loading firmware %s\n",
++					ret, wcss->firmware[i]);
++				return ret;
++			}
++		}
+ 	}
+ 
+ 	qcom_pil_info_store("wcss", wcss->mem_phys, wcss->mem_size);
+@@ -291,17 +317,20 @@ static int wcss_sec_probe(struct platfor
+ 	struct wcss_sec *wcss;
+ 	struct clk *sleep_clk;
+ 	struct clk *int_clk;
+-	const char *fw_name = NULL;
++	const char **firmware = NULL;
+ 	const struct wcss_data *desc = of_device_get_match_data(&pdev->dev);
+ 	int ret;
+ 
+-	ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
+-				      &fw_name);
++	firmware = devm_kcalloc(&pdev->dev, MAX_FIRMWARE,
++				sizeof(*firmware), GFP_KERNEL);
++
++	ret = of_property_read_string_array(pdev->dev.of_node, "firmware-name",
++					    firmware, MAX_FIRMWARE);
+ 	if (ret < 0)
+ 		return ret;
+ 
+ 	rproc = devm_rproc_alloc(&pdev->dev, desc->ss_name, &wcss_sec_ops,
+-				 fw_name, sizeof(*wcss));
++				 firmware[0], sizeof(*wcss));
+ 	if (!rproc) {
+ 		dev_err(&pdev->dev, "failed to allocate rproc\n");
+ 		return -ENOMEM;
+@@ -310,6 +339,7 @@ static int wcss_sec_probe(struct platfor
+ 	wcss = rproc->priv;
+ 	wcss->dev = &pdev->dev;
+ 	wcss->desc = desc;
++	wcss->firmware = firmware;
+ 
+ 	ret = wcss_sec_alloc_memory_region(wcss);
+ 	if (ret)



From lede-commits at lists.infradead.org  Sat Dec 27 03:20:44 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 06:20:44 -0500
Subject: [openwrt/openwrt]  wifi-scripts: fix wdev fallback for mesh
 interfaces
In-Reply-To: <176683444405.2869157.11164335792120530078@git-01.infra.openwrt.org>
References: <176683444405.2869157.11164335792120530078@git-01.infra.openwrt.org>
Message-ID: <mailman.39444.1766834448.2093109.lede-commits@lists.infradead.org>

nick pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/a32c5c69dcf3d95ee0fafb415d2f4e152bf15469

commit a32c5c69dcf3d95ee0fafb415d2f4e152bf15469
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Thu Dec 25 18:41:10 2025 +0100

    wifi-scripts: fix wdev fallback for mesh interfaces
    
    The previous wdev.uc invocation failed for mesh interfaces.
    Rewrite it as a loop so the mesh interface is created correctly
    when no wpa_supplicant mesh support is installed.
    
    Link: https://github.com/openwrt/openwrt/pull/21291
    (cherry picked from commit a18ef412ae73b605a99c319e02bcff9a63b3bfa8)
    Link: https://github.com/openwrt/openwrt/pull/21301
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
index 8aba81436e..dcfdcd2cc8 100755
--- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
+++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
@@ -294,7 +294,15 @@ function setup() {
 	if (fs.access('/usr/sbin/hostapd', 'x'))
 		hostapd.setup(data);
 
-	system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${printf("%J", wdev_data)}' ${join(' ', active_ifnames)}`);
+	for (let ifname in active_ifnames) {
+		if (!wdev_data[ifname])
+			continue;
+
+		let if_config = {
+			[ifname]: wdev_data[ifname]
+		};
+		system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${if_config}'`);
+	}
 
 	if (length(supplicant_data) > 0)
 		supplicant.start(data);



From lede-commits at lists.infradead.org  Sat Dec 27 03:20:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 06:20:45 -0500
Subject: [openwrt/openwrt]  wifi-scripts: fix mcast_rate type (number,
 not array)
In-Reply-To: <176683444405.2869157.11164335792120530078@git-01.infra.openwrt.org>
References: <176683444405.2869157.11164335792120530078@git-01.infra.openwrt.org>
Message-ID: <mailman.39445.1766834448.2093109.lede-commits@lists.infradead.org>

nick pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/a06553be26152f40b3465001161d15535afda320

commit a06553be26152f40b3465001161d15535afda320
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Fri Dec 26 18:35:01 2025 +0100

    wifi-scripts: fix mcast_rate type (number, not array)
    
    The multicast rate (mcast_rate) is defined as a single numeric value,
    not an array. The ucode scripts already expect a single number, and
    the OpenWrt documentation specifies this option as an integer [0].
    
    Adjust the wireless schema accordingly. This also fixes the wdev.uc
    call path for the iw fallback mesh setup.
    
    [0] - https://openwrt.org/docs/guide-user/network/wifi/basic
    
    Link: https://github.com/openwrt/openwrt/pull/21291
    (cherry picked from commit a6eb3d9536b8f0290ab2191780c6d3559843aca9)
    Link: https://github.com/openwrt/openwrt/pull/21301
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../files-ucode/usr/share/schema/wireless.wifi-iface.json          | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json
index c246c8fa4f..f5507305bd 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json
@@ -605,11 +605,8 @@
 			"type": "boolean"
 		},
 		"mcast_rate": {
-			"description": "Allowed multicast rates",
-			"type": "array",
-			"items": {
-				"type": "number"
-			}
+			"description": "Allowed multicast rate",
+			"type": "number"
 		},
 		"mesh_auto_open_plinks": {
 			"type": "boolean"



From lede-commits at lists.infradead.org  Sat Dec 27 05:15:53 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 08:15:53 -0500
Subject: [openwrt/openwrt]  realtek: fix Linksys LGS328C dts memory definition
In-Reply-To: <176684135372.3621450.6964984459634654598@git-01.infra.openwrt.org>
References: <176684135372.3621450.6964984459634654598@git-01.infra.openwrt.org>
Message-ID: <mailman.39495.1766841360.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5d7470d4caab5c4c9b0d9e853d4681f2e7183c4e

commit 5d7470d4caab5c4c9b0d9e853d4681f2e7183c4e
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 23 21:29:46 2025 +0100

    realtek: fix Linksys LGS328C dts memory definition
    
    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 at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21262
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts              | 6 ++++++
 target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts              | 6 ++++++
 target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi | 6 ------
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts b/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts
index 33752ab6e5..d4eeb5ce0a 100644
--- a/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts
+++ b/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts
@@ -7,6 +7,12 @@
 / {
 	compatible = "linksys,lgs328c", "realtek,rtl9301-soc";
 	model = "Linksys LGS328C";
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>, /* 256 MiB lowmem */
+		      <0x20000000 0x10000000>; /* 256 MiB highmem */
+	};
 };
 
 &i2c_mst1 {
diff --git a/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts b/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts
index 9458a2a93f..7b86d8f484 100644
--- a/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts
+++ b/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts
@@ -7,6 +7,12 @@
 / {
 	compatible = "linksys,lgs352c", "realtek,rtl9311-soc";
 	model = "Linksys LGS352C";
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>, /* 256 MiB lowmem */
+		      <0x90000000 0x10000000>; /* 256 MiB highmem */
+	};
 };
 
 &i2c_mst1 {
diff --git a/target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi b/target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi
index f9c7c6d49d..61d972f6d3 100644
--- a/target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi
+++ b/target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi
@@ -43,12 +43,6 @@
 		};
 	};
 
-	memory at 0 {
-		device_type = "memory";
-		reg = <0x00000000 0x10000000>, /* 256 MiB lowmem */
-		      <0x90000000 0x10000000>; /* 256 MiB highmem */
-	};
-
 	sfp0: sfp-p49 {
 		compatible = "sff,sfp";
 		los-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;



From lede-commits at lists.infradead.org  Sat Dec 27 05:20:07 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 08:20:07 -0500
Subject: [openwrt/openwrt]  realtek: fix Linksys LGS328C dts memory definition
In-Reply-To: <176684160755.3658756.3810070864961910919@git-01.infra.openwrt.org>
References: <176684160755.3658756.3810070864961910919@git-01.infra.openwrt.org>
Message-ID: <mailman.39496.1766841612.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/380e5ea1f2a2fc158f5e438558dcbde90a975c4b

commit 380e5ea1f2a2fc158f5e438558dcbde90a975c4b
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 23 21:29:46 2025 +0100

    realtek: fix Linksys LGS328C dts memory definition
    
    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 at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21262
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 5d7470d4caab5c4c9b0d9e853d4681f2e7183c4e)
---
 target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts              | 6 ++++++
 target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts              | 6 ++++++
 target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi | 6 ------
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts b/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts
index 33752ab6e5..d4eeb5ce0a 100644
--- a/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts
+++ b/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts
@@ -7,6 +7,12 @@
 / {
 	compatible = "linksys,lgs328c", "realtek,rtl9301-soc";
 	model = "Linksys LGS328C";
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>, /* 256 MiB lowmem */
+		      <0x20000000 0x10000000>; /* 256 MiB highmem */
+	};
 };
 
 &i2c_mst1 {
diff --git a/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts b/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts
index 9458a2a93f..7b86d8f484 100644
--- a/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts
+++ b/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts
@@ -7,6 +7,12 @@
 / {
 	compatible = "linksys,lgs352c", "realtek,rtl9311-soc";
 	model = "Linksys LGS352C";
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>, /* 256 MiB lowmem */
+		      <0x90000000 0x10000000>; /* 256 MiB highmem */
+	};
 };
 
 &i2c_mst1 {
diff --git a/target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi b/target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi
index f9c7c6d49d..61d972f6d3 100644
--- a/target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi
+++ b/target/linux/realtek/dts/rtl93xx_linksys_lgs3xxc_nand_common.dtsi
@@ -43,12 +43,6 @@
 		};
 	};
 
-	memory at 0 {
-		device_type = "memory";
-		reg = <0x00000000 0x10000000>, /* 256 MiB lowmem */
-		      <0x90000000 0x10000000>; /* 256 MiB highmem */
-	};
-
 	sfp0: sfp-p49 {
 		compatible = "sff,sfp";
 		los-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;



From lede-commits at lists.infradead.org  Sat Dec 27 07:26:54 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 10:26:54 -0500
Subject: [openwrt/openwrt]  wifi-scripts: fix race in wireless interface
 creation
In-Reply-To: <176684921446.4080507.11581567529729514878@git-01.infra.openwrt.org>
References: <176684921446.4080507.11581567529729514878@git-01.infra.openwrt.org>
Message-ID: <mailman.39501.1766849219.2093109.lede-commits@lists.infradead.org>

nick pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2015a40c387119d56c290734f571c41878938e88

commit 2015a40c387119d56c290734f571c41878938e88
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sat Dec 27 13:43:47 2025 +0100

    wifi-scripts: fix race in wireless interface creation
    
    When wdev interfaces and hostapd interfaces are mixed, race conditions
    can occur. Sometimes all interfaces are started correctly, sometimes only
    the wdev interface and some of the hostapd interfaces, and sometimes only
    the wdev interface.
    
    Fix this by creating the wdev interfaces first, before processing
    wpa_supplicant or hostapd interfaces.
    
    Link: https://github.com/openwrt/openwrt/pull/21303
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
index dcfdcd2cc8..6230f90287 100755
--- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
+++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
@@ -288,12 +288,6 @@ function setup() {
 		wdev_data[v.config.ifname] = config;
 	}
 
-	if (fs.access('/usr/sbin/wpa_supplicant', 'x'))
-		supplicant.setup(supplicant_data, data);
-
-	if (fs.access('/usr/sbin/hostapd', 'x'))
-		hostapd.setup(data);
-
 	for (let ifname in active_ifnames) {
 		if (!wdev_data[ifname])
 			continue;
@@ -304,6 +298,12 @@ function setup() {
 		system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${if_config}'`);
 	}
 
+	if (fs.access('/usr/sbin/wpa_supplicant', 'x'))
+		supplicant.setup(supplicant_data, data);
+
+	if (fs.access('/usr/sbin/hostapd', 'x'))
+		hostapd.setup(data);
+
 	if (length(supplicant_data) > 0)
 		supplicant.start(data);
 



From lede-commits at lists.infradead.org  Sat Dec 27 07:28:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 10:28:45 -0500
Subject: [openwrt/openwrt]  wifi-scripts: fix race in wireless interface
 creation
In-Reply-To: <176684932536.4090480.7274120519231208036@git-01.infra.openwrt.org>
References: <176684932536.4090480.7274120519231208036@git-01.infra.openwrt.org>
Message-ID: <mailman.39502.1766849329.2093109.lede-commits@lists.infradead.org>

nick pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/571d716e694ebf5c4ca0255d1f86a24c9899f4cb

commit 571d716e694ebf5c4ca0255d1f86a24c9899f4cb
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sat Dec 27 13:43:47 2025 +0100

    wifi-scripts: fix race in wireless interface creation
    
    When wdev interfaces and hostapd interfaces are mixed, race conditions
    can occur. Sometimes all interfaces are started correctly, sometimes only
    the wdev interface and some of the hostapd interfaces, and sometimes only
    the wdev interface.
    
    Fix this by creating the wdev interfaces first, before processing
    wpa_supplicant or hostapd interfaces.
    
    Link: https://github.com/openwrt/openwrt/pull/21303
    Signed-off-by: Nick Hainke <vincent at systemli.org>
    (cherry picked from commit 2015a40c387119d56c290734f571c41878938e88)
---
 .../wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
index dcfdcd2cc8..6230f90287 100755
--- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
+++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
@@ -288,12 +288,6 @@ function setup() {
 		wdev_data[v.config.ifname] = config;
 	}
 
-	if (fs.access('/usr/sbin/wpa_supplicant', 'x'))
-		supplicant.setup(supplicant_data, data);
-
-	if (fs.access('/usr/sbin/hostapd', 'x'))
-		hostapd.setup(data);
-
 	for (let ifname in active_ifnames) {
 		if (!wdev_data[ifname])
 			continue;
@@ -304,6 +298,12 @@ function setup() {
 		system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${if_config}'`);
 	}
 
+	if (fs.access('/usr/sbin/wpa_supplicant', 'x'))
+		supplicant.setup(supplicant_data, data);
+
+	if (fs.access('/usr/sbin/hostapd', 'x'))
+		hostapd.setup(data);
+
 	if (length(supplicant_data) > 0)
 		supplicant.start(data);
 



From lede-commits at lists.infradead.org  Sat Dec 27 09:28:13 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 12:28:13 -0500
Subject: [openwrt/openwrt]  ath79: cf-ew71-v2: set label-mac-device to eth1
In-Reply-To: <176685649355.196444.6241892503092776707@git-01.infra.openwrt.org>
References: <176685649355.196444.6241892503092776707@git-01.infra.openwrt.org>
Message-ID: <mailman.39513.1766856500.2093109.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7f3537ee2cefbe90ff9408c5bf0c855186daa62b

commit 7f3537ee2cefbe90ff9408c5bf0c855186daa62b
Author: Florian Maurer <f.maurer at outlook.de>
AuthorDate: Tue Dec 16 16:12:08 2025 +0100

    ath79: cf-ew71-v2: set label-mac-device to eth1
    
    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 at outlook.de>
---
 target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
index 934cb19a58..a467e5e823 100644
--- a/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
+++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
@@ -15,6 +15,7 @@
 		led-boot = &led_wan;
 		led-failsafe = &led_wan;
 		led-upgrade = &led_wan;
+		label-mac-device = &eth1;
 	};
 
 	leds {



From lede-commits at lists.infradead.org  Sat Dec 27 09:29:45 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 12:29:45 -0500
Subject: [openwrt/openwrt]  ath79: cf-ew71-v2: set label-mac-device to eth1
In-Reply-To: <176685658509.200839.4250799604593593871@git-01.infra.openwrt.org>
References: <176685658509.200839.4250799604593593871@git-01.infra.openwrt.org>
Message-ID: <mailman.39514.1766856589.2093109.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/a9bc5059c2bff867c13fba1789cd04b245894d4f

commit a9bc5059c2bff867c13fba1789cd04b245894d4f
Author: Florian Maurer <f.maurer at outlook.de>
AuthorDate: Tue Dec 16 16:12:08 2025 +0100

    ath79: cf-ew71-v2: set label-mac-device to eth1
    
    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 at outlook.de>
    (cherry picked from commit 7f3537ee2cefbe90ff9408c5bf0c855186daa62b)
---
 target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
index 934cb19a58..a467e5e823 100644
--- a/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
+++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
@@ -15,6 +15,7 @@
 		led-boot = &led_wan;
 		led-failsafe = &led_wan;
 		led-upgrade = &led_wan;
+		label-mac-device = &eth1;
 	};
 
 	leds {



From lede-commits at lists.infradead.org  Sat Dec 27 09:30:32 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 27 Dec 2025 12:30:32 -0500
Subject: [openwrt/openwrt]  ath79: cf-ew71-v2: set label-mac-device to eth1
In-Reply-To: <176685663215.203315.17188688354957621327@git-01.infra.openwrt.org>
References: <176685663215.203315.17188688354957621327@git-01.infra.openwrt.org>
Message-ID: <mailman.39515.1766856637.2093109.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/b023a06cfb88ef9688a7f1c39b371a7129a85694

commit b023a06cfb88ef9688a7f1c39b371a7129a85694
Author: Florian Maurer <f.maurer at outlook.de>
AuthorDate: Tue Dec 16 16:12:08 2025 +0100

    ath79: cf-ew71-v2: set label-mac-device to eth1
    
    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 at outlook.de>
    (cherry picked from commit 7f3537ee2cefbe90ff9408c5bf0c855186daa62b)
---
 target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
index 0c1e301c51..532968e42c 100644
--- a/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
+++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
@@ -15,6 +15,7 @@
 		led-boot = &led_wan;
 		led-failsafe = &led_wan;
 		led-upgrade = &led_wan;
+		label-mac-device = &eth1;
 	};
 
 	leds {



From lede-commits at lists.infradead.org  Sun Dec 28 01:46:49 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 28 Dec 2025 04:46:49 -0500
Subject: [openwrt/openwrt]  kernel: r8101: fix build with linux v6.16+
In-Reply-To: <176691520929.2939336.9276504100200344998@git-01.infra.openwrt.org>
References: <176691520929.2939336.9276504100200344998@git-01.infra.openwrt.org>
Message-ID: <mailman.39525.1766915216.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/08a1cace9f06c9d13f0634c6dbf467d0edbde86c

commit 08a1cace9f06c9d13f0634c6dbf467d0edbde86c
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Sat Dec 27 12:12:30 2025 +0100

    kernel: r8101: fix build with linux v6.16+
    
    Fix r8101 module build with kernels >= v6.16.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/kernel/r8101/Makefile                      |  2 +-
 .../001-r8101-fix-build-with-kernels-6.16.patch    | 67 ++++++++++++++++++++++
 ...00-r8101-print-link-speed-and-duplex-mode.patch |  2 +-
 3 files changed, 69 insertions(+), 2 deletions(-)

diff --git a/package/kernel/r8101/Makefile b/package/kernel/r8101/Makefile
index 4b528036a2..f37e9acd0f 100644
--- a/package/kernel/r8101/Makefile
+++ b/package/kernel/r8101/Makefile
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=r8101
 PKG_VERSION:=1.039.00
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/openwrt/rtl8101/releases/download/$(PKG_VERSION)
diff --git a/package/kernel/r8101/patches/001-r8101-fix-build-with-kernels-6.16.patch b/package/kernel/r8101/patches/001-r8101-fix-build-with-kernels-6.16.patch
new file mode 100644
index 0000000000..ec2b6ce25f
--- /dev/null
+++ b/package/kernel/r8101/patches/001-r8101-fix-build-with-kernels-6.16.patch
@@ -0,0 +1,67 @@
+From 37bbdad26212b500f80d099e50b635c4ec387510 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari at gmail.com>
+Date: Sat, 27 Dec 2025 12:08:47 +0100
+Subject: [PATCH] r8101: fix build with kernels > 6.16
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
+---
+ src/r8101.h   | 5 +++++
+ src/r8101_n.c | 8 ++++----
+ 2 files changed, 9 insertions(+), 4 deletions(-)
+
+--- a/src/r8101.h
++++ b/src/r8101.h
+@@ -109,6 +109,12 @@ static inline void ether_addr_copy(u8 *d
+ }
+ #endif
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0)
++#define timer_container_of(var, callback_timer, timer_fieldname) \
++	from_timer(var, callback_timer, timer_fieldname)
++#define timer_delete_sync(timer) del_timer_sync(timer)
++#endif
++
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
+ #define setup_timer(_timer, _function, _data) \
+ do { \
+--- a/src/r8101_n.c
++++ b/src/r8101_n.c
+@@ -10163,7 +10163,7 @@ rtl8101_hw_phy_config(struct net_device
+ 
+ static inline void rtl8101_delete_link_timer(struct net_device *dev, struct timer_list *timer)
+ {
+-        del_timer_sync(timer);
++        timer_delete_sync(timer);
+ }
+ 
+ static inline void rtl8101_request_link_timer(struct net_device *dev)
+@@ -10181,7 +10181,7 @@ static inline void rtl8101_request_link_
+ 
+ static inline void rtl8101_delete_esd_timer(struct net_device *dev, struct timer_list *timer)
+ {
+-        del_timer_sync(timer);
++        timer_delete_sync(timer);
+ }
+ 
+ static inline void rtl8101_request_esd_timer(struct net_device *dev)
+@@ -11600,7 +11600,7 @@ rtl8101_esd_timer(struct timer_list *t)
+         struct rtl8101_private *tp = netdev_priv(dev);
+         struct timer_list *timer = &tp->esd_timer;
+ #else
+-        struct rtl8101_private *tp = from_timer(tp, t, esd_timer);
++        struct rtl8101_private *tp = timer_container_of(tp, t, esd_timer);
+         struct net_device *dev = tp->dev;
+         struct timer_list *timer = t;
+ #endif
+@@ -11776,7 +11776,7 @@ rtl8101_link_timer(struct timer_list *t)
+         struct rtl8101_private *tp = netdev_priv(dev);
+         struct timer_list *timer = &tp->link_timer;
+ #else
+-        struct rtl8101_private *tp = from_timer(tp, t, link_timer);
++        struct rtl8101_private *tp = timer_container_of(tp, t, link_timer);
+         struct net_device *dev = tp->dev;
+         struct timer_list *timer = t;
+ #endif
diff --git a/package/kernel/r8101/patches/200-r8101-print-link-speed-and-duplex-mode.patch b/package/kernel/r8101/patches/200-r8101-print-link-speed-and-duplex-mode.patch
index e112d14168..11b7c2d238 100644
--- a/package/kernel/r8101/patches/200-r8101-print-link-speed-and-duplex-mode.patch
+++ b/package/kernel/r8101/patches/200-r8101-print-link-speed-and-duplex-mode.patch
@@ -17,7 +17,7 @@ Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
 
 --- a/src/r8101.h
 +++ b/src/r8101.h
-@@ -1162,6 +1162,8 @@ enum RTL8101_register_content {
+@@ -1168,6 +1168,8 @@ enum RTL8101_register_content {
          LinkStatus = 0x02,
          FullDup = 0x01,
  



From lede-commits at lists.infradead.org  Sun Dec 28 03:45:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 28 Dec 2025 06:45:43 -0500
Subject: [openwrt/openwrt]  qualcommax: ipq60xx: enable dual-boot for 360v6
In-Reply-To: <176692234377.3224547.4044407989008103089@git-01.infra.openwrt.org>
References: <176692234377.3224547.4044407989008103089@git-01.infra.openwrt.org>
Message-ID: <mailman.39534.1766922353.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/fa3b9f514942aab672dc4473d218370970c221b3

commit fa3b9f514942aab672dc4473d218370970c221b3
Author: Zhenyu Qi <qzydustin at hotmail.com>
AuthorDate: Sat Dec 13 14:04:51 2025 -0700

    qualcommax: ipq60xx: enable dual-boot for 360v6
    
    Add dual-partition upgrade support for Qihoo 360v6 using the generic
    bootconfig.sh library. This enables safe system upgrades with automatic
    failover capability.
    
    The device uses Qualcomm's bootconfig structure to control A/B partition
    switching. The bootloader dynamically maps physical NAND partitions to
    logical MTD devices based on the bootconfig, ensuring firmware always
    writes to the inactive partition.
    
    Implementation details:
    - Use bootconfig.sh library (copied from ipq50xx) for bootconfig operations
    - Operate on 'rootfs' partition by name instead of hardcoded offset
    - Add magic header validation for safety
    - Remove OEM UBI volumes (wifi_fw and ubi_rootfs) before sysupgrade
    - Toggle bootconfig before removing OEM volumes
    
    Hardware details:
    - SoC: Qualcomm IPQ6000
    - Flash: NAND with dual rootfs partitions (mtd16/mtd17)
    - Bootconfig: controls slot selection via partition name lookup
    
    Installation:
    Standard sysupgrade process. After upgrade, the system will boot
    from the new partition while preserving the old system as backup.
    
    The OEM volume cleanup is necessary because these volumes are created
    by the stock firmware and are not automatically cleaned by the standard
    nand_upgrade_prepare_ubi() function, which only removes volumes named
    'kernel', 'rootfs', and 'rootfs_data'. Without this cleanup, the remaining
    OEM volumes consume available space, causing the creation of rootfs_data
    to fail during sysupgrade.
    
    Tested on Qihoo 360v6 running stock firmware and OpenWrt.
    
    Signed-off-by: Zhenyu Qi <qzydustin at hotmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21154
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../ipq60xx/base-files/lib/functions/bootconfig.sh | 177 +++++++++++++++++++++
 .../ipq60xx/base-files/lib/upgrade/platform.sh     |  47 +++++-
 2 files changed, 223 insertions(+), 1 deletion(-)

diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/functions/bootconfig.sh b/target/linux/qualcommax/ipq60xx/base-files/lib/functions/bootconfig.sh
new file mode 100644
index 0000000000..3632c6a25e
--- /dev/null
+++ b/target/linux/qualcommax/ipq60xx/base-files/lib/functions/bootconfig.sh
@@ -0,0 +1,177 @@
+. /lib/functions.sh
+
+PART_SIZE=20
+NAME_SIZE=16
+MAX_NUM_PARTS=16
+
+MAGIC_START_HEX="a0 a1 a2 a3"
+MAGIC_START_TRY_HEX="a1 a1 a2 a3"
+MAGIC_END_HEX="b0 b1 b2 b3"
+
+validate_bootconfig_magic() {
+	local file=$1
+	magic_start=$(hexdump -v -n 4 -e '4/1 "%02x "' "$file")
+	magic_end=$(hexdump -v -s 332 -n 4 -e '4/1 "%02x "' "$file")
+	
+	if [ "$magic_start" != "$MAGIC_START_HEX" ] && \
+	   [ "$magic_start" != "$MAGIC_START_TRY_HEX" ]; then
+		echo "Not a valid bootconfig file, start magic does not match" >&2
+		return 1
+	fi
+
+	if [ "$magic_end" != "$MAGIC_END_HEX" ]; then
+		echo "Not a valid bootconfig file, end magic does not match" >&2
+		return 1
+	fi
+	return 0
+}
+
+get_bootconfig_numparts() {
+	local file=$1
+	numpartshex=$(hexdump -v -s 8 -n 4 -e '4/1 "%02x "' "$file")
+	numparts=$(( 0x$(echo $numpartshex | awk '{print $4$3$2$1}') ))
+	echo ${numparts}
+}
+
+get_bootconfig_partidx() {
+	local file=$1
+	local partname=$2
+	local numparts=$(get_bootconfig_numparts "$file")
+
+	if [ -z "$numparts" ]; then
+		echo "Could not get number of partitions" >&2
+		return
+	fi
+
+	if [ $numparts -gt $MAX_NUM_PARTS ]; then
+		numparts=$MAX_NUM_PARTS
+	fi
+
+	for i in $(seq 0 $((numparts -1))); do
+		nameoffset=$((12 + i * $PART_SIZE))
+		nameraw=$(dd if="$file" bs=1 skip="$nameoffset" count=12 2>/dev/null)
+		name=${nameraw//S'\x00'/}
+		if [ "$partname" = "$name" ]; then
+			echo $i
+		fi
+	done
+}
+
+get_bootconfig_primaryboot() {
+	local file=$1
+	local partname=$2
+
+	local partidx=$(get_bootconfig_partidx "$file" "$partname")
+	if ! echo "$partidx" | grep -Eq '^[0-9]+$'; then
+		echo "Could not get partition index for $partname in $file" >&2
+		return
+	fi
+
+	if [ "$partidx" -ge 0 ] && [ "$partidx" -lt $MAX_NUM_PARTS ]; then
+		offset=$((12 + $partidx * $PART_SIZE + $NAME_SIZE))
+		primaryboothex=$(hexdump -v -s "$offset" -n 4 -e '4/1 "%02x "' $file)
+		primaryboot=$(( 0x$(echo $primaryboothex | awk '{print $4$3$2$1}') ))
+		echo $primaryboot
+	fi
+}
+
+_set_bootconfig_primaryboot() {
+	local file=$1
+	local partname=$2
+	local primaryboot=$3
+	local primaryboothex
+	local partidx
+	local primarybootoffset
+
+	partidx=$(get_bootconfig_partidx "$file" "$partname")
+	if ! echo "$partidx" | grep -Eq '^[0-9]+$'; then
+		echo "Could not get partition index for $2" >&2
+		return 1
+	fi
+	primarybootoffset=$((12 + $partidx * $PART_SIZE + $NAME_SIZE))
+
+	case "$primaryboot" in
+		0)
+			printf "\x00\x00\x00\x00" | dd of="$file" seek="$primarybootoffset" bs=1 count=4 conv=notrunc 2>/dev/null
+			;;
+		1)
+			printf "\x01\x00\x00\x00" | dd of="$file" seek="$primarybootoffset" bs=1 count=4 conv=notrunc 2>/dev/null
+			;;
+		*)
+			echo "invalid argument: primaryboot must be 0 or 1" >&2
+			return 1
+			;;
+	esac
+}
+
+set_bootconfig_primaryboot() {
+	local file=$1
+	local partname=$2
+	local primaryboot=$3
+
+	[ -z "$file" ] || [ -z "$partname" ] || [ -z "$primaryboot" ] && {
+		echo "usage: $0 <file> <partition name> <0|1>"
+		return 1
+	}
+
+	[ ! -e "$file" ] && {
+		echo "file $file not found" >&2
+		return 1
+	}
+
+	[ ! -w $file ] && {
+		echo "file $file not writable" >&2
+		return 1
+	}
+
+	validate_bootconfig_magic "$file"
+	[ $? -ne 0 ] && return 1
+
+	_set_bootconfig_primaryboot $file $partname $primaryboot
+	[ $? -ne 0 ] && return 1
+
+	return 0
+}
+
+toggle_bootconfig_primaryboot() {
+	local file=$1
+	local partname=$2
+	local primaryboot
+	
+	[ -z "$file" ] || [ -z "$partname" ] && {
+		echo "usage: $0 <file> <partition name>"
+		return 1
+	}
+
+	[ ! -e "$file" ] && {
+		echo "file $file not found" >&2
+		return 1
+	}
+
+	[ ! -w $file ] && {
+		echo "file $file not writable" >&2
+		return 1
+	}
+
+	validate_bootconfig_magic "$file"
+	[ $? -ne 0 ] && return 1
+	
+	primaryboot=$(get_bootconfig_primaryboot "$1" "$2")
+
+	case "$primaryboot" in
+		0)
+			_set_bootconfig_primaryboot "$1" "$2" 1
+			;;
+		1)
+			_set_bootconfig_primaryboot "$1" "$2" 0
+			;;
+		*)
+			echo "invalid value: primaryboot must be 0 or 1" >&2
+			return 1
+			;;
+	esac
+
+	[ $? -ne 0 ] && return 1
+
+	return 0
+}
diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
index d31363521f..edd0127143 100644
--- a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
@@ -1,3 +1,5 @@
+. /lib/functions/bootconfig.sh
+
 PART_NAME=firmware
 REQUIRE_IMAGE_METADATA=1
 
@@ -27,6 +29,43 @@ remove_oem_ubi_volume() {
 	fi
 }
 
+qihoo_bootconfig_toggle_rootfs() {
+	local partname=$1
+	local tempfile
+	local mtdidx
+
+	mtdidx=$(find_mtd_index "$partname")
+	[ ! "$mtdidx" ] && {
+		echo "cannot find mtd index for $partname"
+		return 1
+	}
+
+	tempfile=/tmp/mtd"$mtdidx".bin
+	dd if=/dev/mtd"$mtdidx" of="$tempfile" bs=1 count=336 2>/dev/null
+	[ $? -ne 0 ] || [ ! -f "$tempfile" ] && {
+		echo "failed to create a temp copy of /dev/mtd$mtdidx"
+		return 1
+	}
+
+	toggle_bootconfig_primaryboot "$tempfile" "rootfs"
+	[ $? -ne 0 ] && {
+		echo "failed to toggle primaryboot for rootfs partition"
+		return 1
+	}
+
+	mtd write "$tempfile" /dev/mtd"$mtdidx" 2>/dev/null
+	[ $? -ne 0 ] && {
+		echo "failed to write temp copy back to /dev/mtd$mtdidx"
+		return 1
+	}
+
+	# Update bootconfig1 if exists
+	local mtdidx1=$(find_mtd_index "${partname}1")
+	[ -n "$mtdidx1" ] && mtd write "$tempfile" /dev/mtd"$mtdidx1" 2>/dev/null
+
+	return 0
+}
+
 tplink_get_boot_part() {
 	local cur_boot_part
 	local args
@@ -117,8 +156,14 @@ platform_do_upgrade() {
 		;;
 	glinet,gl-ax1800|\
 	glinet,gl-axt1800|\
-	netgear,wax214|\
+	netgear,wax214)
+		nand_do_upgrade "$1"
+		;;
 	qihoo,360v6)
+		CI_UBIPART="rootfs_1"
+		qihoo_bootconfig_toggle_rootfs "0:bootconfig"
+		remove_oem_ubi_volume wifi_fw
+		remove_oem_ubi_volume ubi_rootfs
 		nand_do_upgrade "$1"
 		;;
 	netgear,wax610|\



From lede-commits at lists.infradead.org  Sun Dec 28 03:46:27 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 28 Dec 2025 06:46:27 -0500
Subject: [openwrt/openwrt]  mvebu: enable tickless idle
In-Reply-To: <176692238707.3226220.12378632216866128526@git-01.infra.openwrt.org>
References: <176692238707.3226220.12378632216866128526@git-01.infra.openwrt.org>
Message-ID: <mailman.39535.1766922391.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/ffd0e5c9f021ede3cab96bcfa9820d45a68d83d5

commit ffd0e5c9f021ede3cab96bcfa9820d45a68d83d5
Author: Qingfang Deng <dqfext at gmail.com>
AuthorDate: Fri Dec 12 10:53:11 2025 +0800

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21136
    (cherry picked from commit c13f299918702799e883fc330521bed4b7da0bd3)
    Link: https://github.com/openwrt/openwrt/pull/21305
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/mvebu/config-6.12 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/linux/mvebu/config-6.12 b/target/linux/mvebu/config-6.12
index 62bdda2734..ef1c628abc 100644
--- a/target/linux/mvebu/config-6.12
+++ b/target/linux/mvebu/config-6.12
@@ -88,7 +88,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 CONFIG_CPU_FREQ_STAT=y
 CONFIG_CPU_HAS_ASID=y
 CONFIG_CPU_IDLE=y
-CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
 CONFIG_CPU_MITIGATIONS=y
 CONFIG_CPU_PABRT_V7=y
 CONFIG_CPU_PJ4B=y
@@ -213,7 +213,6 @@ CONFIG_HWBM=y
 CONFIG_HWMON=y
 CONFIG_HW_RANDOM=y
 CONFIG_HZ_FIXED=0
-CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
@@ -298,6 +297,8 @@ CONFIG_NET_SELFTESTS=y
 CONFIG_NET_XGRESS=y
 CONFIG_NLS=y
 CONFIG_NOP_USB_XCEIV=y
+CONFIG_NO_HZ_COMMON=y
+CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=4
 CONFIG_NVMEM=y
 CONFIG_NVMEM_LAYOUTS=y



From lede-commits at lists.infradead.org  Sun Dec 28 03:48:15 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 28 Dec 2025 06:48:15 -0500
Subject: [openwrt/openwrt]  airoha: spi: update airoha-snfi patches and en7523
 dts
In-Reply-To: <176692249562.3230603.8323277511213889925@git-01.infra.openwrt.org>
References: <176692249562.3230603.8323277511213889925@git-01.infra.openwrt.org>
Message-ID: <mailman.39536.1766922504.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d9b1c747807973053a2cba599ae247234588e341

commit d9b1c747807973053a2cba599ae247234588e341
Author: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
AuthorDate: Sat Dec 27 08:28:09 2025 +0300

    airoha: spi: update airoha-snfi patches and en7523 dts
    
    Changes:
    * use upstream patches for airoha-snfi driver
    * update in kernel en7523 dts to add spinand support
    
    Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
    Link: https://github.com/openwrt/openwrt/pull/21299
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 ...ha-remove-unnecessary-restriction-length.patch} |   8 +-
 ...emove-unnecessary-switch-to-non-dma-mode.patch} |   9 +-
 ...-spi-airoha-unify-dirmap-read-write-code.patch} |   8 +-
 ...upport-of-dualio-quadio-flash-reading-co.patch} |   8 +-
 ...void-setting-of-page-oob-sizes-in-REG_SP.patch} |   8 +-
 ...educe-the-number-of-modification-of-REG_.patch} |  14 +--
 ...et-custom-sector-size-equal-to-flash-pag.patch} |  14 +--
 ...void-reading-flash-page-settings-from-SN.patch} |  14 +--
 ...ha-buffer-must-be-0xff-ed-before-writing.patch} |  11 ++-
 ...oha-snfi-en7523-workaround-flash-damaging.patch |  97 --------------------
 ...snfi-en7523-workaround-flash-damaging-if-.patch | 102 +++++++++++++++++++++
 ...9-15-arm-dts-airoha-en7523-add-SNAND-node.patch |  40 ++++++++
 12 files changed, 198 insertions(+), 135 deletions(-)

diff --git a/target/linux/airoha/patches-6.12/029-02-spi-airoha-remove-unnecessary-restriction-length.patch b/target/linux/airoha/patches-6.12/029-05-v6.19-spi-airoha-remove-unnecessary-restriction-length.patch
similarity index 73%
rename from target/linux/airoha/patches-6.12/029-02-spi-airoha-remove-unnecessary-restriction-length.patch
rename to target/linux/airoha/patches-6.12/029-05-v6.19-spi-airoha-remove-unnecessary-restriction-length.patch
index e3b9f0ccbe..c99c25921c 100644
--- a/target/linux/airoha/patches-6.12/029-02-spi-airoha-remove-unnecessary-restriction-length.patch
+++ b/target/linux/airoha/patches-6.12/029-05-v6.19-spi-airoha-remove-unnecessary-restriction-length.patch
@@ -1,7 +1,7 @@
-From 4658f57ba7f60c3bd8e14c1ca7acf2090aee8436 Mon Sep 17 00:00:00 2001
+From 661856ca131c8bf6724905966e02149805660abe Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Tue, 12 Aug 2025 06:21:35 +0300
-Subject: [PATCH v6 02/13] spi: airoha: remove unnecessary restriction length
+Date: Sun, 12 Oct 2025 15:16:53 +0300
+Subject: [PATCH 05/14] spi: airoha: remove unnecessary restriction length
 
 The "length < 160" restriction is not needed because airoha_snand_write_data()
 and airoha_snand_read_data() will properly handle data transfers above
@@ -9,6 +9,8 @@ SPI_MAX_TRANSFER_SIZE.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-3-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 7 -------
  1 file changed, 7 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-04-spi-airoha-remove-unnecessary-switch-to-non-dma-m.patch b/target/linux/airoha/patches-6.12/029-06-v6.19-spi-airoha-remove-unnecessary-switch-to-non-dma-mode.patch
similarity index 74%
rename from target/linux/airoha/patches-6.12/029-04-spi-airoha-remove-unnecessary-switch-to-non-dma-m.patch
rename to target/linux/airoha/patches-6.12/029-06-v6.19-spi-airoha-remove-unnecessary-switch-to-non-dma-mode.patch
index 626e5c0ad9..afe496c968 100644
--- a/target/linux/airoha/patches-6.12/029-04-spi-airoha-remove-unnecessary-switch-to-non-dma-m.patch
+++ b/target/linux/airoha/patches-6.12/029-06-v6.19-spi-airoha-remove-unnecessary-switch-to-non-dma-mode.patch
@@ -1,8 +1,7 @@
-From fb41a3e3bc357592b28a8abb504df99dad642588 Mon Sep 17 00:00:00 2001
+From 7350f8dc15bfbb7abf1ce4babea6fcace1c574c5 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Mon, 11 Aug 2025 13:09:51 +0300
-Subject: [PATCH v6 04/13] spi: airoha: remove unnecessary switch to non-dma
- mode
+Date: Sun, 12 Oct 2025 15:16:55 +0300
+Subject: [PATCH 06/14] spi: airoha: remove unnecessary switch to non-dma mode
 
 The code switches to dma at the start of dirmap operation and returns
 to non-dma at the end of dirmap operation, so an additional switch to
@@ -11,6 +10,8 @@ non-dma at the start of dirmap write is not required.
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Acked-by: Lorenzo Bianconi <lorenzo at kernel.org>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-5-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 3 ---
  1 file changed, 3 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-07-spi-airoha-unify-dirmap-read-write-code.patch b/target/linux/airoha/patches-6.12/029-07-v6.19-spi-airoha-unify-dirmap-read-write-code.patch
similarity index 92%
rename from target/linux/airoha/patches-6.12/029-07-spi-airoha-unify-dirmap-read-write-code.patch
rename to target/linux/airoha/patches-6.12/029-07-v6.19-spi-airoha-unify-dirmap-read-write-code.patch
index 4be20c5b55..c85c6861fc 100644
--- a/target/linux/airoha/patches-6.12/029-07-spi-airoha-unify-dirmap-read-write-code.patch
+++ b/target/linux/airoha/patches-6.12/029-07-v6.19-spi-airoha-unify-dirmap-read-write-code.patch
@@ -1,12 +1,14 @@
-From 995b1a65206ee28d5403db0518cb230f2ce429ef Mon Sep 17 00:00:00 2001
+From 233a22687411ea053a4b169c07324ee6aa33bf38 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Mon, 11 Aug 2025 19:57:43 +0300
-Subject: [PATCH v6 07/13] spi: airoha: unify dirmap read/write code
+Date: Sun, 12 Oct 2025 15:16:58 +0300
+Subject: [PATCH 07/14] spi: airoha: unify dirmap read/write code
 
 Makes dirmap writing looks similar to dirmap reading. Just a minor
 refactoring, no behavior change is expected.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Link: https://patch.msgid.link/20251012121707.2296160-8-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 50 ++++++++++++++++++++++-------------
  1 file changed, 32 insertions(+), 18 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-08-spi-airoha-support-of-dualio-quadio-flash-reading.patch b/target/linux/airoha/patches-6.12/029-08-v6.19-spi-airoha-support-of-dualio-quadio-flash-reading-co.patch
similarity index 90%
rename from target/linux/airoha/patches-6.12/029-08-spi-airoha-support-of-dualio-quadio-flash-reading.patch
rename to target/linux/airoha/patches-6.12/029-08-v6.19-spi-airoha-support-of-dualio-quadio-flash-reading-co.patch
index 4e00e7c178..7e3fcb4764 100644
--- a/target/linux/airoha/patches-6.12/029-08-spi-airoha-support-of-dualio-quadio-flash-reading.patch
+++ b/target/linux/airoha/patches-6.12/029-08-v6.19-spi-airoha-support-of-dualio-quadio-flash-reading-co.patch
@@ -1,7 +1,7 @@
-From baaba9b8d3d907575323cbb7fabeae23db2a542b Mon Sep 17 00:00:00 2001
+From 80b09137aeab27e59004383058f8cc696a9ee048 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Mon, 11 Aug 2025 20:52:34 +0300
-Subject: [PATCH v6 08/13] spi: airoha: support of dualio/quadio flash reading
+Date: Sun, 12 Oct 2025 15:16:59 +0300
+Subject: [PATCH 08/14] spi: airoha: support of dualio/quadio flash reading
  commands
 
 Airoha snfi spi controller supports acceleration of DUAL/QUAD
@@ -12,6 +12,8 @@ DUAL_IO/QUAD_IO one.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-9-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 28 ++++++++++++++++++++++------
  1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-10-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG.patch b/target/linux/airoha/patches-6.12/029-09-v6.19-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG_SP.patch
similarity index 83%
rename from target/linux/airoha/patches-6.12/029-10-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG.patch
rename to target/linux/airoha/patches-6.12/029-09-v6.19-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG_SP.patch
index 0a3ddc8be3..f8902f7e57 100644
--- a/target/linux/airoha/patches-6.12/029-10-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG.patch
+++ b/target/linux/airoha/patches-6.12/029-09-v6.19-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG_SP.patch
@@ -1,7 +1,7 @@
-From 4abbbc74306598159fe1dc545f929ae594bf4dd1 Mon Sep 17 00:00:00 2001
+From 70eec454f2d6cdfab547c262781acd38328e11a1 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 14 Aug 2025 18:00:32 +0300
-Subject: [PATCH v6 10/13] spi: airoha: avoid setting of page/oob sizes in
+Date: Sun, 12 Oct 2025 15:17:00 +0300
+Subject: [PATCH 09/14] spi: airoha: avoid setting of page/oob sizes in
  REG_SPI_NFI_PAGEFMT
 
 spi-airoha-snfi uses custom sector size in REG_SPI_NFI_SECCUS_SIZE
@@ -9,6 +9,8 @@ register, so setting of page/oob sizes in REG_SPI_NFI_PAGEFMT is not
 required.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Link: https://patch.msgid.link/20251012121707.2296160-10-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 38 -----------------------------------
  1 file changed, 38 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-11-spi-airoha-reduce-the-number-of-modification-of-R.patch b/target/linux/airoha/patches-6.12/029-10-v6.19-spi-airoha-reduce-the-number-of-modification-of-REG_.patch
similarity index 92%
rename from target/linux/airoha/patches-6.12/029-11-spi-airoha-reduce-the-number-of-modification-of-R.patch
rename to target/linux/airoha/patches-6.12/029-10-v6.19-spi-airoha-reduce-the-number-of-modification-of-REG_.patch
index 2193994ed9..40e2f6ea21 100644
--- a/target/linux/airoha/patches-6.12/029-11-spi-airoha-reduce-the-number-of-modification-of-R.patch
+++ b/target/linux/airoha/patches-6.12/029-10-v6.19-spi-airoha-reduce-the-number-of-modification-of-REG_.patch
@@ -1,7 +1,7 @@
-From 0d8f58869192df0acdba286d233b57a4feeaf94b Mon Sep 17 00:00:00 2001
+From d1ff30df1d9a4eb4c067795abb5e2a66910fd108 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 14 Aug 2025 18:49:34 +0300
-Subject: [PATCH v6 11/13] spi: airoha: reduce the number of modification of
+Date: Sun, 12 Oct 2025 15:17:01 +0300
+Subject: [PATCH 10/14] spi: airoha: reduce the number of modification of
  REG_SPI_NFI_CNFG and REG_SPI_NFI_SECCUS_SIZE registers
 
 This just reduce the number of modification of REG_SPI_NFI_CNFG and
@@ -12,6 +12,8 @@ from SNFI registers during driver startup.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-11-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 135 +++++++++++++++++++++++++---------
  1 file changed, 102 insertions(+), 33 deletions(-)
@@ -103,7 +105,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  	err = regmap_write(as_ctrl->regmap_nfi, REG_SPI_NFI_CMD, 0x0);
  	if (err)
  		goto error_dma_unmap;
-@@ -819,7 +855,48 @@ static ssize_t airoha_snand_dirmap_write
+@@ -815,7 +851,48 @@ static ssize_t airoha_snand_dirmap_write
  	if (err < 0)
  		return err;
  
@@ -153,7 +155,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  	if (err)
  		goto error_dma_mode_off;
  
-@@ -835,8 +912,16 @@ static ssize_t airoha_snand_dirmap_write
+@@ -831,8 +908,16 @@ static ssize_t airoha_snand_dirmap_write
  	if (err)
  		goto error_dma_unmap;
  
@@ -172,7 +174,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  	err = regmap_update_bits(as_ctrl->regmap_nfi,
  				 REG_SPI_NFI_SNF_MISC_CTL2,
  				 SPI_NFI_PROG_LOAD_BYTE_NUM, val);
-@@ -861,22 +946,6 @@ static ssize_t airoha_snand_dirmap_write
+@@ -857,22 +942,6 @@ static ssize_t airoha_snand_dirmap_write
  	if (err)
  		goto error_dma_unmap;
  
diff --git a/target/linux/airoha/patches-6.12/029-12-spi-airoha-set-custom-sector-size-equal-to-flash-.patch b/target/linux/airoha/patches-6.12/029-11-v6.19-spi-airoha-set-custom-sector-size-equal-to-flash-pag.patch
similarity index 91%
rename from target/linux/airoha/patches-6.12/029-12-spi-airoha-set-custom-sector-size-equal-to-flash-.patch
rename to target/linux/airoha/patches-6.12/029-11-v6.19-spi-airoha-set-custom-sector-size-equal-to-flash-pag.patch
index d9f35366b4..514212835c 100644
--- a/target/linux/airoha/patches-6.12/029-12-spi-airoha-set-custom-sector-size-equal-to-flash-.patch
+++ b/target/linux/airoha/patches-6.12/029-11-v6.19-spi-airoha-set-custom-sector-size-equal-to-flash-pag.patch
@@ -1,8 +1,8 @@
-From 893ee23d650ca9ee36541b9a5ae0bc18be01a11f Mon Sep 17 00:00:00 2001
+From fb81b5cecb8553e3ca2b45288cf340d43c9c2991 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 14 Aug 2025 22:47:17 +0300
-Subject: [PATCH v6 12/13] spi: airoha: set custom sector size equal to flash
- page size
+Date: Sun, 12 Oct 2025 15:17:02 +0300
+Subject: [PATCH 11/14] spi: airoha: set custom sector size equal to flash page
+ size
 
 Set custom sector size equal to flash page size including oob. Thus we
 will always read a single sector. The maximum custom sector size is
@@ -13,6 +13,8 @@ from SNFI registers during driver startup.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-12-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 35 +++++++++++++++++++----------------
  1 file changed, 19 insertions(+), 16 deletions(-)
@@ -102,7 +104,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  	opcode = desc->info.op_tmpl.cmd.opcode;
  	switch (opcode) {
  	case SPI_NAND_OP_PROGRAM_LOAD_SINGLE:
-@@ -884,18 +889,17 @@ static ssize_t airoha_snand_dirmap_write
+@@ -880,18 +885,17 @@ static ssize_t airoha_snand_dirmap_write
  		goto error_dma_mode_off;
  
  	/* Set number of sector will be written */
@@ -124,7 +126,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  				 SPI_NFI_CUS_SEC_SIZE_EN);
  	if (err)
  		goto error_dma_mode_off;
-@@ -920,11 +924,10 @@ static ssize_t airoha_snand_dirmap_write
+@@ -916,11 +920,10 @@ static ssize_t airoha_snand_dirmap_write
  	 *        = NFI_SNF_MISC_CTL2.write_data_byte_number =
  	 *        = NFI_CON.sector_number * NFI_SECCUS.custom_sector_size
  	 */
diff --git a/target/linux/airoha/patches-6.12/029-13-spi-airoha-avoid-reading-flash-page-settings-from.patch b/target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch
similarity index 91%
rename from target/linux/airoha/patches-6.12/029-13-spi-airoha-avoid-reading-flash-page-settings-from.patch
rename to target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch
index 2efc56f356..c785ae8d56 100644
--- a/target/linux/airoha/patches-6.12/029-13-spi-airoha-avoid-reading-flash-page-settings-from.patch
+++ b/target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch
@@ -1,7 +1,7 @@
-From 64a4d6e84145227211485067022cd4e5cf052e04 Mon Sep 17 00:00:00 2001
+From 902c0ea18a97b1a6eeee5799cb1fd9a79ef9208e Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 14 Aug 2025 23:56:24 +0300
-Subject: [PATCH v6 13/13] spi: airoha: avoid reading flash page settings from
+Date: Sun, 12 Oct 2025 15:17:03 +0300
+Subject: [PATCH 12/14] spi: airoha: avoid reading flash page settings from
  SNFI registers during driver startup
 
 The spinand driver do 3 type of dirmap requests:
@@ -25,6 +25,8 @@ SNFI registers during driver startup. Also airoha_snand_adjust_op_size()
 function becomes unnecessary.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Link: https://patch.msgid.link/20251012121707.2296160-13-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 115 ++--------------------------------
  1 file changed, 5 insertions(+), 110 deletions(-)
@@ -148,7 +150,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
  
  	opcode = desc->info.op_tmpl.cmd.opcode;
  	switch (opcode) {
-@@ -1080,7 +1006,6 @@ static int airoha_snand_exec_op(struct s
+@@ -1076,7 +1002,6 @@ static int airoha_snand_exec_op(struct s
  }
  
  static const struct spi_controller_mem_ops airoha_snand_mem_ops = {
@@ -156,7 +158,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
  	.supports_op = airoha_snand_supports_op,
  	.exec_op = airoha_snand_exec_op,
  	.dirmap_create = airoha_snand_dirmap_create,
-@@ -1105,36 +1030,6 @@ static int airoha_snand_setup(struct spi
+@@ -1101,36 +1026,6 @@ static int airoha_snand_setup(struct spi
  	return 0;
  }
  
@@ -193,7 +195,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
  static const struct regmap_config spi_ctrl_regmap_config = {
  	.name		= "ctrl",
  	.reg_bits	= 32,
-@@ -1208,7 +1103,7 @@ static int airoha_snand_probe(struct pla
+@@ -1204,7 +1099,7 @@ static int airoha_snand_probe(struct pla
  	ctrl->setup = airoha_snand_setup;
  	device_set_node(&ctrl->dev, dev_fwnode(dev));
  
diff --git a/target/linux/airoha/patches-6.12/029-09-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch b/target/linux/airoha/patches-6.12/029-13-v6.19-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
similarity index 63%
rename from target/linux/airoha/patches-6.12/029-09-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
rename to target/linux/airoha/patches-6.12/029-13-v6.19-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
index 7eef83d562..669f9b2dd4 100644
--- a/target/linux/airoha/patches-6.12/029-09-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
+++ b/target/linux/airoha/patches-6.12/029-13-v6.19-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
@@ -1,7 +1,7 @@
-From 6ca9cd453cb5d8a6411791295771b4dbd1c623de Mon Sep 17 00:00:00 2001
+From 0743acf746a81e0460a56fd5ff847d97fa7eb370 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Mon, 11 Aug 2025 21:18:04 +0300
-Subject: [PATCH v6 09/13] spi: airoha: buffer must be 0xff-ed before writing
+Date: Sun, 12 Oct 2025 15:17:04 +0300
+Subject: [PATCH 13/14] spi: airoha: buffer must be 0xff-ed before writing
 
 During writing, the entire flash page (including OOB) will be updated
 with the values from the temporary buffer, so we need to fill the
@@ -9,13 +9,16 @@ untouched areas of the buffer with 0xff value to prevent accidental
 data overwriting.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-14-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 4 ++++
  1 file changed, 4 insertions(+)
 
 --- a/drivers/spi/spi-airoha-snfi.c
 +++ b/drivers/spi/spi-airoha-snfi.c
-@@ -847,7 +847,11 @@ static ssize_t airoha_snand_dirmap_write
+@@ -776,7 +776,11 @@ static ssize_t airoha_snand_dirmap_write
  		return -EOPNOTSUPP;
  	}
  
diff --git a/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch b/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch
deleted file mode 100644
index c40645b002..0000000000
--- a/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 86f88e604305186aec1fb6eebbf8f0a42c2435d3 Mon Sep 17 00:00:00 2001
-From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 9 Oct 2025 19:33:23 +0300
-Subject: [PATCH] spi: airoha-snfi: en7523: workaround flash damaging
- if UART_TXD was short to GND
-
-We found that some serial console may pull TX line to GROUND during board
-boot time. Airoha uses TX line as one of it's BOOT pins. This will lead
-to booting in RESERVED boot mode.
-
-It was found that some flashes operates incorrectly in RESERVED mode.
-Micron and Skyhigh flashes are definitely affected by the issue,
-Winbond flashes are NOT affected.
-
-Details:
---------
-DMA reading of odd pages on affected flashes operates incorrectly. Page
-reading offset (start of the page) on hardware level is replaced by 0x10.
-Thus results in incorrect data reading. Usage of UBI make things even
-worse. Any attempt to access UBI leads to ubi damaging. As result OS loading
-becomes impossible.
-
-Non-DMA reading is OK.
-
-This patch detects booting in reserved mode, turn off DMA and print big
-fat warning.
-
-Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
----
- drivers/spi/spi-airoha-snfi.c | 40 ++++++++++++++++++++++++++++++-----
- 1 file changed, 35 insertions(+), 5 deletions(-)
-
---- a/drivers/spi/spi-airoha-snfi.c
-+++ b/drivers/spi/spi-airoha-snfi.c
-@@ -1013,6 +1013,11 @@ static const struct spi_controller_mem_o
- 	.dirmap_write = airoha_snand_dirmap_write,
- };
- 
-+static const struct spi_controller_mem_ops airoha_snand_nodma_mem_ops = {
-+	.supports_op = airoha_snand_supports_op,
-+	.exec_op = airoha_snand_exec_op,
-+};
-+
- static int airoha_snand_setup(struct spi_device *spi)
- {
- 	struct airoha_snand_ctrl *as_ctrl;
-@@ -1058,7 +1063,8 @@ static int airoha_snand_probe(struct pla
- 	struct device *dev = &pdev->dev;
- 	struct spi_controller *ctrl;
- 	void __iomem *base;
--	int err;
-+	int err, dma_enabled;
-+	u32 sfc_strap;
- 
- 	ctrl = devm_spi_alloc_host(dev, sizeof(*as_ctrl));
- 	if (!ctrl)
-@@ -1092,12 +1098,36 @@ static int airoha_snand_probe(struct pla
- 		return dev_err_probe(dev, PTR_ERR(as_ctrl->spi_clk),
- 				     "unable to get spi clk\n");
- 
--	err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
--	if (err)
--		return err;
-+	dma_enabled = 1;
-+	if (device_is_compatible(dev, "airoha,en7523-snand")) {
-+		err = regmap_read(as_ctrl->regmap_ctrl,
-+				  REG_SPI_CTRL_SFC_STRAP, &sfc_strap);
-+		if (err)
-+			return err;
-+
-+		if (!(sfc_strap & 0x04)) {
-+			dma_enabled = 0;
-+			printk(KERN_WARNING "\n"
-+				"=== WARNING ======================================================\n"
-+				"Detected booting in RESERVED mode (UART_TXD was short to GND).\n"
-+				"This mode is known for incorrect DMA reading of some flashes.\n"
-+				"Usage of DMA for flash operations will be disabled to prevent data\n"
-+				"damage. Unplug your serial console and power cycle the board\n"
-+				"to boot with full performance.\n"
-+				"==================================================================\n\n");
-+		}
-+	}
-+
-+	if (dma_enabled) {
-+		err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
-+		if (err)
-+			return err;
-+	}
- 
- 	ctrl->num_chipselect = 2;
--	ctrl->mem_ops = &airoha_snand_mem_ops;
-+	ctrl->mem_ops = dma_enabled ?
-+				&airoha_snand_mem_ops :
-+				&airoha_snand_nodma_mem_ops;
- 	ctrl->bits_per_word_mask = SPI_BPW_MASK(8);
- 	ctrl->mode_bits = SPI_RX_DUAL;
- 	ctrl->setup = airoha_snand_setup;
diff --git a/target/linux/airoha/patches-6.12/029-14-v6.19-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch b/target/linux/airoha/patches-6.12/029-14-v6.19-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch
new file mode 100644
index 0000000000..cd5962445e
--- /dev/null
+++ b/target/linux/airoha/patches-6.12/029-14-v6.19-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch
@@ -0,0 +1,102 @@
+From 061795b345aff371df8f71d54ae7c7dc8ae630d0 Mon Sep 17 00:00:00 2001
+From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Date: Wed, 26 Nov 2025 02:40:45 +0300
+Subject: [PATCH 14/14] spi: airoha-snfi: en7523: workaround flash damaging if
+ UART_TXD was short to GND
+
+Airoha EN7523 specific bug
+--------------------------
+We found that some serial console may pull TX line to GROUND during board
+boot time. Airoha uses TX line as one of its bootstrap pins. On the EN7523
+SoC this may lead to booting in RESERVED boot mode.
+
+It was found that some flashes operates incorrectly in RESERVED mode.
+Micron and Skyhigh flashes are definitely affected by the issue,
+Winbond flashes are not affected.
+
+Details:
+--------
+DMA reading of odd pages on affected flashes operates incorrectly. Page
+reading offset (start of the page) on hardware level is replaced by 0x10.
+Thus results in incorrect data reading. As result OS loading becomes
+impossible.
+
+Usage of UBI make things even worse. On attaching, UBI will detects
+corruptions (because of wrong reading of odd pages) and will try to
+recover. For recovering UBI will erase and write 'damaged' blocks with
+a valid information. This will destroy all UBI data.
+
+Non-DMA reading is OK.
+
+This patch detects booting in reserved mode, turn off DMA and print big
+fat warning.
+
+It's worth noting that the boot configuration is preserved across reboots.
+Therefore, to boot normally, you should do the following:
+- disconnect the serial console from the board,
+- power cycle the board.
+
+Fixes: a403997c12019 ("spi: airoha: add SPI-NAND Flash controller driver")
+Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko at intel.com>
+Link: https://patch.msgid.link/20251125234047.1101985-2-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
+---
+ drivers/spi/spi-airoha-snfi.c | 25 ++++++++++++++++++++++++-
+ 1 file changed, 24 insertions(+), 1 deletion(-)
+
+--- a/drivers/spi/spi-airoha-snfi.c
++++ b/drivers/spi/spi-airoha-snfi.c
+@@ -1013,6 +1013,11 @@ static const struct spi_controller_mem_o
+ 	.dirmap_write = airoha_snand_dirmap_write,
+ };
+ 
++static const struct spi_controller_mem_ops airoha_snand_nodma_mem_ops = {
++	.supports_op = airoha_snand_supports_op,
++	.exec_op = airoha_snand_exec_op,
++};
++
+ static int airoha_snand_setup(struct spi_device *spi)
+ {
+ 	struct airoha_snand_ctrl *as_ctrl;
+@@ -1057,7 +1062,9 @@ static int airoha_snand_probe(struct pla
+ 	struct airoha_snand_ctrl *as_ctrl;
+ 	struct device *dev = &pdev->dev;
+ 	struct spi_controller *ctrl;
++	bool dma_enable = true;
+ 	void __iomem *base;
++	u32 sfc_strap;
+ 	int err;
+ 
+ 	ctrl = devm_spi_alloc_host(dev, sizeof(*as_ctrl));
+@@ -1092,12 +1099,28 @@ static int airoha_snand_probe(struct pla
+ 		return dev_err_probe(dev, PTR_ERR(as_ctrl->spi_clk),
+ 				     "unable to get spi clk\n");
+ 
++	if (device_is_compatible(dev, "airoha,en7523-snand")) {
++		err = regmap_read(as_ctrl->regmap_ctrl,
++				  REG_SPI_CTRL_SFC_STRAP, &sfc_strap);
++		if (err)
++			return err;
++
++		if (!(sfc_strap & 0x04)) {
++			dma_enable = false;
++			dev_warn(dev, "Detected booting in RESERVED mode (UART_TXD was short to GND).\n");
++			dev_warn(dev, "This mode is known for incorrect DMA reading of some flashes.\n");
++			dev_warn(dev, "Much slower PIO mode will be used to prevent flash data damage.\n");
++			dev_warn(dev, "Unplug UART cable and power cycle board to get full performance.\n");
++		}
++	}
++
+ 	err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
+ 	if (err)
+ 		return err;
+ 
+ 	ctrl->num_chipselect = 2;
+-	ctrl->mem_ops = &airoha_snand_mem_ops;
++	ctrl->mem_ops = dma_enable ? &airoha_snand_mem_ops
++				   : &airoha_snand_nodma_mem_ops;
+ 	ctrl->bits_per_word_mask = SPI_BPW_MASK(8);
+ 	ctrl->mode_bits = SPI_RX_DUAL;
+ 	ctrl->setup = airoha_snand_setup;
diff --git a/target/linux/airoha/patches-6.12/029-15-arm-dts-airoha-en7523-add-SNAND-node.patch b/target/linux/airoha/patches-6.12/029-15-arm-dts-airoha-en7523-add-SNAND-node.patch
new file mode 100644
index 0000000000..bd68440b30
--- /dev/null
+++ b/target/linux/airoha/patches-6.12/029-15-arm-dts-airoha-en7523-add-SNAND-node.patch
@@ -0,0 +1,40 @@
+From bb2f9b3d71717c7df942deb1488c56e544d4a32c Mon Sep 17 00:00:00 2001
+From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Date: Fri, 10 Oct 2025 06:01:33 +0300
+Subject: [PATCH v6 3/3] arm: dts: airoha: en7523: add SNAND node
+
+Add SNAND node to enable support of attached SPI-NAND on the EN7523 SoC.
+
+Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+---
+ arch/arm/boot/dts/airoha/en7523.dtsi | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+--- a/arch/arm/boot/dts/airoha/en7523.dtsi
++++ b/arch/arm/boot/dts/airoha/en7523.dtsi
+@@ -203,4 +203,24 @@
+ 			#interrupt-cells = <1>;
+ 		};
+ 	};
++
++	spi_ctrl: spi at 1fa10000 {
++		compatible = "airoha,en7523-snand", "airoha,en7581-snand";
++		reg = <0x1fa10000 0x140>,
++		      <0x1fa11000 0x160>;
++
++		clocks = <&scu EN7523_CLK_SPI>;
++		clock-names = "spi";
++
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		nand: nand at 0 {
++			compatible = "spi-nand";
++			reg = <0>;
++			spi-max-frequency = <50000000>;
++			spi-tx-bus-width = <1>;
++			spi-rx-bus-width = <2>;
++		};
++	};
+ };



From lede-commits at lists.infradead.org  Sun Dec 28 03:48:51 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 28 Dec 2025 06:48:51 -0500
Subject: [openwrt/openwrt]  airoha: spi: update airoha-snfi patches and en7523
 dts
In-Reply-To: <176692253135.3231828.10315357809206992667@git-01.infra.openwrt.org>
References: <176692253135.3231828.10315357809206992667@git-01.infra.openwrt.org>
Message-ID: <mailman.39539.1766922535.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/d819a05a8e78d1ad63a88e10f9e2131efcbaba10

commit d819a05a8e78d1ad63a88e10f9e2131efcbaba10
Author: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
AuthorDate: Sat Dec 27 08:28:09 2025 +0300

    airoha: spi: update airoha-snfi patches and en7523 dts
    
    Changes:
    * use upstream patches for airoha-snfi driver
    * update in kernel en7523 dts to add spinand support
    
    Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
    Link: https://github.com/openwrt/openwrt/pull/21299
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit d9b1c747807973053a2cba599ae247234588e341)
---
 ...ha-remove-unnecessary-restriction-length.patch} |   8 +-
 ...emove-unnecessary-switch-to-non-dma-mode.patch} |   9 +-
 ...-spi-airoha-unify-dirmap-read-write-code.patch} |   8 +-
 ...upport-of-dualio-quadio-flash-reading-co.patch} |   8 +-
 ...void-setting-of-page-oob-sizes-in-REG_SP.patch} |   8 +-
 ...educe-the-number-of-modification-of-REG_.patch} |  14 +--
 ...et-custom-sector-size-equal-to-flash-pag.patch} |  14 +--
 ...void-reading-flash-page-settings-from-SN.patch} |  14 +--
 ...ha-buffer-must-be-0xff-ed-before-writing.patch} |  11 ++-
 ...oha-snfi-en7523-workaround-flash-damaging.patch |  97 --------------------
 ...snfi-en7523-workaround-flash-damaging-if-.patch | 102 +++++++++++++++++++++
 ...9-15-arm-dts-airoha-en7523-add-SNAND-node.patch |  40 ++++++++
 12 files changed, 198 insertions(+), 135 deletions(-)

diff --git a/target/linux/airoha/patches-6.12/029-02-spi-airoha-remove-unnecessary-restriction-length.patch b/target/linux/airoha/patches-6.12/029-05-v6.19-spi-airoha-remove-unnecessary-restriction-length.patch
similarity index 73%
rename from target/linux/airoha/patches-6.12/029-02-spi-airoha-remove-unnecessary-restriction-length.patch
rename to target/linux/airoha/patches-6.12/029-05-v6.19-spi-airoha-remove-unnecessary-restriction-length.patch
index e3b9f0ccbe..c99c25921c 100644
--- a/target/linux/airoha/patches-6.12/029-02-spi-airoha-remove-unnecessary-restriction-length.patch
+++ b/target/linux/airoha/patches-6.12/029-05-v6.19-spi-airoha-remove-unnecessary-restriction-length.patch
@@ -1,7 +1,7 @@
-From 4658f57ba7f60c3bd8e14c1ca7acf2090aee8436 Mon Sep 17 00:00:00 2001
+From 661856ca131c8bf6724905966e02149805660abe Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Tue, 12 Aug 2025 06:21:35 +0300
-Subject: [PATCH v6 02/13] spi: airoha: remove unnecessary restriction length
+Date: Sun, 12 Oct 2025 15:16:53 +0300
+Subject: [PATCH 05/14] spi: airoha: remove unnecessary restriction length
 
 The "length < 160" restriction is not needed because airoha_snand_write_data()
 and airoha_snand_read_data() will properly handle data transfers above
@@ -9,6 +9,8 @@ SPI_MAX_TRANSFER_SIZE.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-3-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 7 -------
  1 file changed, 7 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-04-spi-airoha-remove-unnecessary-switch-to-non-dma-m.patch b/target/linux/airoha/patches-6.12/029-06-v6.19-spi-airoha-remove-unnecessary-switch-to-non-dma-mode.patch
similarity index 74%
rename from target/linux/airoha/patches-6.12/029-04-spi-airoha-remove-unnecessary-switch-to-non-dma-m.patch
rename to target/linux/airoha/patches-6.12/029-06-v6.19-spi-airoha-remove-unnecessary-switch-to-non-dma-mode.patch
index 626e5c0ad9..afe496c968 100644
--- a/target/linux/airoha/patches-6.12/029-04-spi-airoha-remove-unnecessary-switch-to-non-dma-m.patch
+++ b/target/linux/airoha/patches-6.12/029-06-v6.19-spi-airoha-remove-unnecessary-switch-to-non-dma-mode.patch
@@ -1,8 +1,7 @@
-From fb41a3e3bc357592b28a8abb504df99dad642588 Mon Sep 17 00:00:00 2001
+From 7350f8dc15bfbb7abf1ce4babea6fcace1c574c5 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Mon, 11 Aug 2025 13:09:51 +0300
-Subject: [PATCH v6 04/13] spi: airoha: remove unnecessary switch to non-dma
- mode
+Date: Sun, 12 Oct 2025 15:16:55 +0300
+Subject: [PATCH 06/14] spi: airoha: remove unnecessary switch to non-dma mode
 
 The code switches to dma at the start of dirmap operation and returns
 to non-dma at the end of dirmap operation, so an additional switch to
@@ -11,6 +10,8 @@ non-dma at the start of dirmap write is not required.
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Acked-by: Lorenzo Bianconi <lorenzo at kernel.org>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-5-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 3 ---
  1 file changed, 3 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-07-spi-airoha-unify-dirmap-read-write-code.patch b/target/linux/airoha/patches-6.12/029-07-v6.19-spi-airoha-unify-dirmap-read-write-code.patch
similarity index 92%
rename from target/linux/airoha/patches-6.12/029-07-spi-airoha-unify-dirmap-read-write-code.patch
rename to target/linux/airoha/patches-6.12/029-07-v6.19-spi-airoha-unify-dirmap-read-write-code.patch
index 4be20c5b55..c85c6861fc 100644
--- a/target/linux/airoha/patches-6.12/029-07-spi-airoha-unify-dirmap-read-write-code.patch
+++ b/target/linux/airoha/patches-6.12/029-07-v6.19-spi-airoha-unify-dirmap-read-write-code.patch
@@ -1,12 +1,14 @@
-From 995b1a65206ee28d5403db0518cb230f2ce429ef Mon Sep 17 00:00:00 2001
+From 233a22687411ea053a4b169c07324ee6aa33bf38 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Mon, 11 Aug 2025 19:57:43 +0300
-Subject: [PATCH v6 07/13] spi: airoha: unify dirmap read/write code
+Date: Sun, 12 Oct 2025 15:16:58 +0300
+Subject: [PATCH 07/14] spi: airoha: unify dirmap read/write code
 
 Makes dirmap writing looks similar to dirmap reading. Just a minor
 refactoring, no behavior change is expected.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Link: https://patch.msgid.link/20251012121707.2296160-8-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 50 ++++++++++++++++++++++-------------
  1 file changed, 32 insertions(+), 18 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-08-spi-airoha-support-of-dualio-quadio-flash-reading.patch b/target/linux/airoha/patches-6.12/029-08-v6.19-spi-airoha-support-of-dualio-quadio-flash-reading-co.patch
similarity index 90%
rename from target/linux/airoha/patches-6.12/029-08-spi-airoha-support-of-dualio-quadio-flash-reading.patch
rename to target/linux/airoha/patches-6.12/029-08-v6.19-spi-airoha-support-of-dualio-quadio-flash-reading-co.patch
index 4e00e7c178..7e3fcb4764 100644
--- a/target/linux/airoha/patches-6.12/029-08-spi-airoha-support-of-dualio-quadio-flash-reading.patch
+++ b/target/linux/airoha/patches-6.12/029-08-v6.19-spi-airoha-support-of-dualio-quadio-flash-reading-co.patch
@@ -1,7 +1,7 @@
-From baaba9b8d3d907575323cbb7fabeae23db2a542b Mon Sep 17 00:00:00 2001
+From 80b09137aeab27e59004383058f8cc696a9ee048 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Mon, 11 Aug 2025 20:52:34 +0300
-Subject: [PATCH v6 08/13] spi: airoha: support of dualio/quadio flash reading
+Date: Sun, 12 Oct 2025 15:16:59 +0300
+Subject: [PATCH 08/14] spi: airoha: support of dualio/quadio flash reading
  commands
 
 Airoha snfi spi controller supports acceleration of DUAL/QUAD
@@ -12,6 +12,8 @@ DUAL_IO/QUAD_IO one.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-9-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 28 ++++++++++++++++++++++------
  1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-10-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG.patch b/target/linux/airoha/patches-6.12/029-09-v6.19-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG_SP.patch
similarity index 83%
rename from target/linux/airoha/patches-6.12/029-10-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG.patch
rename to target/linux/airoha/patches-6.12/029-09-v6.19-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG_SP.patch
index 0a3ddc8be3..f8902f7e57 100644
--- a/target/linux/airoha/patches-6.12/029-10-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG.patch
+++ b/target/linux/airoha/patches-6.12/029-09-v6.19-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG_SP.patch
@@ -1,7 +1,7 @@
-From 4abbbc74306598159fe1dc545f929ae594bf4dd1 Mon Sep 17 00:00:00 2001
+From 70eec454f2d6cdfab547c262781acd38328e11a1 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 14 Aug 2025 18:00:32 +0300
-Subject: [PATCH v6 10/13] spi: airoha: avoid setting of page/oob sizes in
+Date: Sun, 12 Oct 2025 15:17:00 +0300
+Subject: [PATCH 09/14] spi: airoha: avoid setting of page/oob sizes in
  REG_SPI_NFI_PAGEFMT
 
 spi-airoha-snfi uses custom sector size in REG_SPI_NFI_SECCUS_SIZE
@@ -9,6 +9,8 @@ register, so setting of page/oob sizes in REG_SPI_NFI_PAGEFMT is not
 required.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Link: https://patch.msgid.link/20251012121707.2296160-10-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 38 -----------------------------------
  1 file changed, 38 deletions(-)
diff --git a/target/linux/airoha/patches-6.12/029-11-spi-airoha-reduce-the-number-of-modification-of-R.patch b/target/linux/airoha/patches-6.12/029-10-v6.19-spi-airoha-reduce-the-number-of-modification-of-REG_.patch
similarity index 92%
rename from target/linux/airoha/patches-6.12/029-11-spi-airoha-reduce-the-number-of-modification-of-R.patch
rename to target/linux/airoha/patches-6.12/029-10-v6.19-spi-airoha-reduce-the-number-of-modification-of-REG_.patch
index 2193994ed9..40e2f6ea21 100644
--- a/target/linux/airoha/patches-6.12/029-11-spi-airoha-reduce-the-number-of-modification-of-R.patch
+++ b/target/linux/airoha/patches-6.12/029-10-v6.19-spi-airoha-reduce-the-number-of-modification-of-REG_.patch
@@ -1,7 +1,7 @@
-From 0d8f58869192df0acdba286d233b57a4feeaf94b Mon Sep 17 00:00:00 2001
+From d1ff30df1d9a4eb4c067795abb5e2a66910fd108 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 14 Aug 2025 18:49:34 +0300
-Subject: [PATCH v6 11/13] spi: airoha: reduce the number of modification of
+Date: Sun, 12 Oct 2025 15:17:01 +0300
+Subject: [PATCH 10/14] spi: airoha: reduce the number of modification of
  REG_SPI_NFI_CNFG and REG_SPI_NFI_SECCUS_SIZE registers
 
 This just reduce the number of modification of REG_SPI_NFI_CNFG and
@@ -12,6 +12,8 @@ from SNFI registers during driver startup.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-11-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 135 +++++++++++++++++++++++++---------
  1 file changed, 102 insertions(+), 33 deletions(-)
@@ -103,7 +105,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  	err = regmap_write(as_ctrl->regmap_nfi, REG_SPI_NFI_CMD, 0x0);
  	if (err)
  		goto error_dma_unmap;
-@@ -819,7 +855,48 @@ static ssize_t airoha_snand_dirmap_write
+@@ -815,7 +851,48 @@ static ssize_t airoha_snand_dirmap_write
  	if (err < 0)
  		return err;
  
@@ -153,7 +155,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  	if (err)
  		goto error_dma_mode_off;
  
-@@ -835,8 +912,16 @@ static ssize_t airoha_snand_dirmap_write
+@@ -831,8 +908,16 @@ static ssize_t airoha_snand_dirmap_write
  	if (err)
  		goto error_dma_unmap;
  
@@ -172,7 +174,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  	err = regmap_update_bits(as_ctrl->regmap_nfi,
  				 REG_SPI_NFI_SNF_MISC_CTL2,
  				 SPI_NFI_PROG_LOAD_BYTE_NUM, val);
-@@ -861,22 +946,6 @@ static ssize_t airoha_snand_dirmap_write
+@@ -857,22 +942,6 @@ static ssize_t airoha_snand_dirmap_write
  	if (err)
  		goto error_dma_unmap;
  
diff --git a/target/linux/airoha/patches-6.12/029-12-spi-airoha-set-custom-sector-size-equal-to-flash-.patch b/target/linux/airoha/patches-6.12/029-11-v6.19-spi-airoha-set-custom-sector-size-equal-to-flash-pag.patch
similarity index 91%
rename from target/linux/airoha/patches-6.12/029-12-spi-airoha-set-custom-sector-size-equal-to-flash-.patch
rename to target/linux/airoha/patches-6.12/029-11-v6.19-spi-airoha-set-custom-sector-size-equal-to-flash-pag.patch
index d9f35366b4..514212835c 100644
--- a/target/linux/airoha/patches-6.12/029-12-spi-airoha-set-custom-sector-size-equal-to-flash-.patch
+++ b/target/linux/airoha/patches-6.12/029-11-v6.19-spi-airoha-set-custom-sector-size-equal-to-flash-pag.patch
@@ -1,8 +1,8 @@
-From 893ee23d650ca9ee36541b9a5ae0bc18be01a11f Mon Sep 17 00:00:00 2001
+From fb81b5cecb8553e3ca2b45288cf340d43c9c2991 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 14 Aug 2025 22:47:17 +0300
-Subject: [PATCH v6 12/13] spi: airoha: set custom sector size equal to flash
- page size
+Date: Sun, 12 Oct 2025 15:17:02 +0300
+Subject: [PATCH 11/14] spi: airoha: set custom sector size equal to flash page
+ size
 
 Set custom sector size equal to flash page size including oob. Thus we
 will always read a single sector. The maximum custom sector size is
@@ -13,6 +13,8 @@ from SNFI registers during driver startup.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-12-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 35 +++++++++++++++++++----------------
  1 file changed, 19 insertions(+), 16 deletions(-)
@@ -102,7 +104,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  	opcode = desc->info.op_tmpl.cmd.opcode;
  	switch (opcode) {
  	case SPI_NAND_OP_PROGRAM_LOAD_SINGLE:
-@@ -884,18 +889,17 @@ static ssize_t airoha_snand_dirmap_write
+@@ -880,18 +885,17 @@ static ssize_t airoha_snand_dirmap_write
  		goto error_dma_mode_off;
  
  	/* Set number of sector will be written */
@@ -124,7 +126,7 @@ Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com
  				 SPI_NFI_CUS_SEC_SIZE_EN);
  	if (err)
  		goto error_dma_mode_off;
-@@ -920,11 +924,10 @@ static ssize_t airoha_snand_dirmap_write
+@@ -916,11 +920,10 @@ static ssize_t airoha_snand_dirmap_write
  	 *        = NFI_SNF_MISC_CTL2.write_data_byte_number =
  	 *        = NFI_CON.sector_number * NFI_SECCUS.custom_sector_size
  	 */
diff --git a/target/linux/airoha/patches-6.12/029-13-spi-airoha-avoid-reading-flash-page-settings-from.patch b/target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch
similarity index 91%
rename from target/linux/airoha/patches-6.12/029-13-spi-airoha-avoid-reading-flash-page-settings-from.patch
rename to target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch
index 2efc56f356..c785ae8d56 100644
--- a/target/linux/airoha/patches-6.12/029-13-spi-airoha-avoid-reading-flash-page-settings-from.patch
+++ b/target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch
@@ -1,7 +1,7 @@
-From 64a4d6e84145227211485067022cd4e5cf052e04 Mon Sep 17 00:00:00 2001
+From 902c0ea18a97b1a6eeee5799cb1fd9a79ef9208e Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 14 Aug 2025 23:56:24 +0300
-Subject: [PATCH v6 13/13] spi: airoha: avoid reading flash page settings from
+Date: Sun, 12 Oct 2025 15:17:03 +0300
+Subject: [PATCH 12/14] spi: airoha: avoid reading flash page settings from
  SNFI registers during driver startup
 
 The spinand driver do 3 type of dirmap requests:
@@ -25,6 +25,8 @@ SNFI registers during driver startup. Also airoha_snand_adjust_op_size()
 function becomes unnecessary.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Link: https://patch.msgid.link/20251012121707.2296160-13-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 115 ++--------------------------------
  1 file changed, 5 insertions(+), 110 deletions(-)
@@ -148,7 +150,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
  
  	opcode = desc->info.op_tmpl.cmd.opcode;
  	switch (opcode) {
-@@ -1080,7 +1006,6 @@ static int airoha_snand_exec_op(struct s
+@@ -1076,7 +1002,6 @@ static int airoha_snand_exec_op(struct s
  }
  
  static const struct spi_controller_mem_ops airoha_snand_mem_ops = {
@@ -156,7 +158,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
  	.supports_op = airoha_snand_supports_op,
  	.exec_op = airoha_snand_exec_op,
  	.dirmap_create = airoha_snand_dirmap_create,
-@@ -1105,36 +1030,6 @@ static int airoha_snand_setup(struct spi
+@@ -1101,36 +1026,6 @@ static int airoha_snand_setup(struct spi
  	return 0;
  }
  
@@ -193,7 +195,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
  static const struct regmap_config spi_ctrl_regmap_config = {
  	.name		= "ctrl",
  	.reg_bits	= 32,
-@@ -1208,7 +1103,7 @@ static int airoha_snand_probe(struct pla
+@@ -1204,7 +1099,7 @@ static int airoha_snand_probe(struct pla
  	ctrl->setup = airoha_snand_setup;
  	device_set_node(&ctrl->dev, dev_fwnode(dev));
  
diff --git a/target/linux/airoha/patches-6.12/029-09-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch b/target/linux/airoha/patches-6.12/029-13-v6.19-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
similarity index 63%
rename from target/linux/airoha/patches-6.12/029-09-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
rename to target/linux/airoha/patches-6.12/029-13-v6.19-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
index 7eef83d562..669f9b2dd4 100644
--- a/target/linux/airoha/patches-6.12/029-09-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
+++ b/target/linux/airoha/patches-6.12/029-13-v6.19-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch
@@ -1,7 +1,7 @@
-From 6ca9cd453cb5d8a6411791295771b4dbd1c623de Mon Sep 17 00:00:00 2001
+From 0743acf746a81e0460a56fd5ff847d97fa7eb370 Mon Sep 17 00:00:00 2001
 From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Mon, 11 Aug 2025 21:18:04 +0300
-Subject: [PATCH v6 09/13] spi: airoha: buffer must be 0xff-ed before writing
+Date: Sun, 12 Oct 2025 15:17:04 +0300
+Subject: [PATCH 13/14] spi: airoha: buffer must be 0xff-ed before writing
 
 During writing, the entire flash page (including OOB) will be updated
 with the values from the temporary buffer, so we need to fill the
@@ -9,13 +9,16 @@ untouched areas of the buffer with 0xff value to prevent accidental
 data overwriting.
 
 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Link: https://patch.msgid.link/20251012121707.2296160-14-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
 ---
  drivers/spi/spi-airoha-snfi.c | 4 ++++
  1 file changed, 4 insertions(+)
 
 --- a/drivers/spi/spi-airoha-snfi.c
 +++ b/drivers/spi/spi-airoha-snfi.c
-@@ -847,7 +847,11 @@ static ssize_t airoha_snand_dirmap_write
+@@ -776,7 +776,11 @@ static ssize_t airoha_snand_dirmap_write
  		return -EOPNOTSUPP;
  	}
  
diff --git a/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch b/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch
deleted file mode 100644
index c40645b002..0000000000
--- a/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 86f88e604305186aec1fb6eebbf8f0a42c2435d3 Mon Sep 17 00:00:00 2001
-From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 9 Oct 2025 19:33:23 +0300
-Subject: [PATCH] spi: airoha-snfi: en7523: workaround flash damaging
- if UART_TXD was short to GND
-
-We found that some serial console may pull TX line to GROUND during board
-boot time. Airoha uses TX line as one of it's BOOT pins. This will lead
-to booting in RESERVED boot mode.
-
-It was found that some flashes operates incorrectly in RESERVED mode.
-Micron and Skyhigh flashes are definitely affected by the issue,
-Winbond flashes are NOT affected.
-
-Details:
---------
-DMA reading of odd pages on affected flashes operates incorrectly. Page
-reading offset (start of the page) on hardware level is replaced by 0x10.
-Thus results in incorrect data reading. Usage of UBI make things even
-worse. Any attempt to access UBI leads to ubi damaging. As result OS loading
-becomes impossible.
-
-Non-DMA reading is OK.
-
-This patch detects booting in reserved mode, turn off DMA and print big
-fat warning.
-
-Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
----
- drivers/spi/spi-airoha-snfi.c | 40 ++++++++++++++++++++++++++++++-----
- 1 file changed, 35 insertions(+), 5 deletions(-)
-
---- a/drivers/spi/spi-airoha-snfi.c
-+++ b/drivers/spi/spi-airoha-snfi.c
-@@ -1013,6 +1013,11 @@ static const struct spi_controller_mem_o
- 	.dirmap_write = airoha_snand_dirmap_write,
- };
- 
-+static const struct spi_controller_mem_ops airoha_snand_nodma_mem_ops = {
-+	.supports_op = airoha_snand_supports_op,
-+	.exec_op = airoha_snand_exec_op,
-+};
-+
- static int airoha_snand_setup(struct spi_device *spi)
- {
- 	struct airoha_snand_ctrl *as_ctrl;
-@@ -1058,7 +1063,8 @@ static int airoha_snand_probe(struct pla
- 	struct device *dev = &pdev->dev;
- 	struct spi_controller *ctrl;
- 	void __iomem *base;
--	int err;
-+	int err, dma_enabled;
-+	u32 sfc_strap;
- 
- 	ctrl = devm_spi_alloc_host(dev, sizeof(*as_ctrl));
- 	if (!ctrl)
-@@ -1092,12 +1098,36 @@ static int airoha_snand_probe(struct pla
- 		return dev_err_probe(dev, PTR_ERR(as_ctrl->spi_clk),
- 				     "unable to get spi clk\n");
- 
--	err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
--	if (err)
--		return err;
-+	dma_enabled = 1;
-+	if (device_is_compatible(dev, "airoha,en7523-snand")) {
-+		err = regmap_read(as_ctrl->regmap_ctrl,
-+				  REG_SPI_CTRL_SFC_STRAP, &sfc_strap);
-+		if (err)
-+			return err;
-+
-+		if (!(sfc_strap & 0x04)) {
-+			dma_enabled = 0;
-+			printk(KERN_WARNING "\n"
-+				"=== WARNING ======================================================\n"
-+				"Detected booting in RESERVED mode (UART_TXD was short to GND).\n"
-+				"This mode is known for incorrect DMA reading of some flashes.\n"
-+				"Usage of DMA for flash operations will be disabled to prevent data\n"
-+				"damage. Unplug your serial console and power cycle the board\n"
-+				"to boot with full performance.\n"
-+				"==================================================================\n\n");
-+		}
-+	}
-+
-+	if (dma_enabled) {
-+		err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
-+		if (err)
-+			return err;
-+	}
- 
- 	ctrl->num_chipselect = 2;
--	ctrl->mem_ops = &airoha_snand_mem_ops;
-+	ctrl->mem_ops = dma_enabled ?
-+				&airoha_snand_mem_ops :
-+				&airoha_snand_nodma_mem_ops;
- 	ctrl->bits_per_word_mask = SPI_BPW_MASK(8);
- 	ctrl->mode_bits = SPI_RX_DUAL;
- 	ctrl->setup = airoha_snand_setup;
diff --git a/target/linux/airoha/patches-6.12/029-14-v6.19-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch b/target/linux/airoha/patches-6.12/029-14-v6.19-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch
new file mode 100644
index 0000000000..cd5962445e
--- /dev/null
+++ b/target/linux/airoha/patches-6.12/029-14-v6.19-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch
@@ -0,0 +1,102 @@
+From 061795b345aff371df8f71d54ae7c7dc8ae630d0 Mon Sep 17 00:00:00 2001
+From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Date: Wed, 26 Nov 2025 02:40:45 +0300
+Subject: [PATCH 14/14] spi: airoha-snfi: en7523: workaround flash damaging if
+ UART_TXD was short to GND
+
+Airoha EN7523 specific bug
+--------------------------
+We found that some serial console may pull TX line to GROUND during board
+boot time. Airoha uses TX line as one of its bootstrap pins. On the EN7523
+SoC this may lead to booting in RESERVED boot mode.
+
+It was found that some flashes operates incorrectly in RESERVED mode.
+Micron and Skyhigh flashes are definitely affected by the issue,
+Winbond flashes are not affected.
+
+Details:
+--------
+DMA reading of odd pages on affected flashes operates incorrectly. Page
+reading offset (start of the page) on hardware level is replaced by 0x10.
+Thus results in incorrect data reading. As result OS loading becomes
+impossible.
+
+Usage of UBI make things even worse. On attaching, UBI will detects
+corruptions (because of wrong reading of odd pages) and will try to
+recover. For recovering UBI will erase and write 'damaged' blocks with
+a valid information. This will destroy all UBI data.
+
+Non-DMA reading is OK.
+
+This patch detects booting in reserved mode, turn off DMA and print big
+fat warning.
+
+It's worth noting that the boot configuration is preserved across reboots.
+Therefore, to boot normally, you should do the following:
+- disconnect the serial console from the board,
+- power cycle the board.
+
+Fixes: a403997c12019 ("spi: airoha: add SPI-NAND Flash controller driver")
+Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko at intel.com>
+Link: https://patch.msgid.link/20251125234047.1101985-2-mikhail.kshevetskiy at iopsys.eu
+Signed-off-by: Mark Brown <broonie at kernel.org>
+---
+ drivers/spi/spi-airoha-snfi.c | 25 ++++++++++++++++++++++++-
+ 1 file changed, 24 insertions(+), 1 deletion(-)
+
+--- a/drivers/spi/spi-airoha-snfi.c
++++ b/drivers/spi/spi-airoha-snfi.c
+@@ -1013,6 +1013,11 @@ static const struct spi_controller_mem_o
+ 	.dirmap_write = airoha_snand_dirmap_write,
+ };
+ 
++static const struct spi_controller_mem_ops airoha_snand_nodma_mem_ops = {
++	.supports_op = airoha_snand_supports_op,
++	.exec_op = airoha_snand_exec_op,
++};
++
+ static int airoha_snand_setup(struct spi_device *spi)
+ {
+ 	struct airoha_snand_ctrl *as_ctrl;
+@@ -1057,7 +1062,9 @@ static int airoha_snand_probe(struct pla
+ 	struct airoha_snand_ctrl *as_ctrl;
+ 	struct device *dev = &pdev->dev;
+ 	struct spi_controller *ctrl;
++	bool dma_enable = true;
+ 	void __iomem *base;
++	u32 sfc_strap;
+ 	int err;
+ 
+ 	ctrl = devm_spi_alloc_host(dev, sizeof(*as_ctrl));
+@@ -1092,12 +1099,28 @@ static int airoha_snand_probe(struct pla
+ 		return dev_err_probe(dev, PTR_ERR(as_ctrl->spi_clk),
+ 				     "unable to get spi clk\n");
+ 
++	if (device_is_compatible(dev, "airoha,en7523-snand")) {
++		err = regmap_read(as_ctrl->regmap_ctrl,
++				  REG_SPI_CTRL_SFC_STRAP, &sfc_strap);
++		if (err)
++			return err;
++
++		if (!(sfc_strap & 0x04)) {
++			dma_enable = false;
++			dev_warn(dev, "Detected booting in RESERVED mode (UART_TXD was short to GND).\n");
++			dev_warn(dev, "This mode is known for incorrect DMA reading of some flashes.\n");
++			dev_warn(dev, "Much slower PIO mode will be used to prevent flash data damage.\n");
++			dev_warn(dev, "Unplug UART cable and power cycle board to get full performance.\n");
++		}
++	}
++
+ 	err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
+ 	if (err)
+ 		return err;
+ 
+ 	ctrl->num_chipselect = 2;
+-	ctrl->mem_ops = &airoha_snand_mem_ops;
++	ctrl->mem_ops = dma_enable ? &airoha_snand_mem_ops
++				   : &airoha_snand_nodma_mem_ops;
+ 	ctrl->bits_per_word_mask = SPI_BPW_MASK(8);
+ 	ctrl->mode_bits = SPI_RX_DUAL;
+ 	ctrl->setup = airoha_snand_setup;
diff --git a/target/linux/airoha/patches-6.12/029-15-arm-dts-airoha-en7523-add-SNAND-node.patch b/target/linux/airoha/patches-6.12/029-15-arm-dts-airoha-en7523-add-SNAND-node.patch
new file mode 100644
index 0000000000..bd68440b30
--- /dev/null
+++ b/target/linux/airoha/patches-6.12/029-15-arm-dts-airoha-en7523-add-SNAND-node.patch
@@ -0,0 +1,40 @@
+From bb2f9b3d71717c7df942deb1488c56e544d4a32c Mon Sep 17 00:00:00 2001
+From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Date: Fri, 10 Oct 2025 06:01:33 +0300
+Subject: [PATCH v6 3/3] arm: dts: airoha: en7523: add SNAND node
+
+Add SNAND node to enable support of attached SPI-NAND on the EN7523 SoC.
+
+Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
+---
+ arch/arm/boot/dts/airoha/en7523.dtsi | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+--- a/arch/arm/boot/dts/airoha/en7523.dtsi
++++ b/arch/arm/boot/dts/airoha/en7523.dtsi
+@@ -203,4 +203,24 @@
+ 			#interrupt-cells = <1>;
+ 		};
+ 	};
++
++	spi_ctrl: spi at 1fa10000 {
++		compatible = "airoha,en7523-snand", "airoha,en7581-snand";
++		reg = <0x1fa10000 0x140>,
++		      <0x1fa11000 0x160>;
++
++		clocks = <&scu EN7523_CLK_SPI>;
++		clock-names = "spi";
++
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		nand: nand at 0 {
++			compatible = "spi-nand";
++			reg = <0>;
++			spi-max-frequency = <50000000>;
++			spi-tx-bus-width = <1>;
++			spi-rx-bus-width = <2>;
++		};
++	};
+ };



From lede-commits at lists.infradead.org  Mon Dec 29 02:11:34 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 05:11:34 -0500
Subject: [openwrt/openwrt]  realtek: ethernet/dsa: Reduce mach include
 dependency
In-Reply-To: <176700309481.2237148.13643041245871403603@git-01.infra.openwrt.org>
References: <176700309481.2237148.13643041245871403603@git-01.infra.openwrt.org>
Message-ID: <mailman.39740.1767003106.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/349040eeb5a6504e953eb94f7ab84379564fdfb5

commit 349040eeb5a6504e953eb94f7ab84379564fdfb5
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 23 22:35:49 2025 +0100

    realtek: ethernet/dsa: Reduce mach include dependency
    
    The ethernet and dsa drivers still rely on several defines from
    the central mach include. Move important defines over to the
    driver specific includes as a first decoupling step.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21263
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../mips/include/asm/mach-rtl838x/mach-rtl83xx.h   | 70 ----------------------
 .../files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h   | 52 ++++++++++++++++
 .../files-6.12/drivers/net/ethernet/rtl838x_eth.h  | 12 ++++
 3 files changed, 64 insertions(+), 70 deletions(-)

diff --git a/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h b/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h
index 364b66b73a..0a98399591 100644
--- a/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h
+++ b/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h
@@ -26,78 +26,8 @@
 #define RTL93XX_MODEL_NAME_INFO		(0x0004)
 #define RTL93XX_CHIP_INFO		(0x0008)
 
-#define RTL838X_LED_GLB_CTRL		(0xA000)
-#define RTL839X_LED_GLB_CTRL		(0x00E4)
-#define RTL930X_LED_GLB_CTRL		(0xCC00)
-#define RTL931X_LED_GLB_CTRL		(0x0600)
-
 #define RTL838X_INT_RW_CTRL		(0x0058)
 #define RTL838X_EXT_VERSION		(0x00D0)
-#define RTL838X_PLL_CML_CTRL		(0x0FF8)
-
-/*
- * Reset
- */
-#define RTL838X_RST_GLB_CTRL_0		(0x003c)
-#define RTL838X_RST_GLB_CTRL_1		(0x0040)
-#define RTL839X_RST_GLB_CTRL		(0x0014)
-#define RTL930X_RST_GLB_CTRL_0		(0x000c)
-#define RTL931X_RST_GLB_CTRL		(0x0400)
-
-/* LED control by switch */
-#define RTL838X_LED_MODE_SEL		(0x1004)
-#define RTL838X_LED_MODE_CTRL		(0xA004)
-#define RTL838X_LED_P_EN_CTRL		(0xA008)
-
-/* LED control by software */
-#define RTL838X_LED_SW_CTRL		(0xA00C)
-#define RTL839X_LED_SW_CTRL		(0xA00C)
-#define RTL838X_LED_SW_P_EN_CTRL	(0xA010)
-#define RTL839X_LED_SW_P_EN_CTRL	(0x012C)
-#define RTL838X_LED0_SW_P_EN_CTRL	(0xA010)
-#define RTL839X_LED0_SW_P_EN_CTRL	(0x012C)
-#define RTL838X_LED1_SW_P_EN_CTRL	(0xA014)
-#define RTL839X_LED1_SW_P_EN_CTRL	(0x0130)
-#define RTL838X_LED2_SW_P_EN_CTRL	(0xA018)
-#define RTL839X_LED2_SW_P_EN_CTRL	(0x0134)
-#define RTL838X_LED_SW_P_CTRL		(0xA01C)
-#define RTL838X_LED_SW_P_CTRL_PORT(p)	(RTL838X_LED_SW_P_CTRL + (((p) << 2)))
-#define RTL839X_LED_SW_P_CTRL		(0x0144)
-
-#define RTL839X_MAC_EFUSE_CTRL		(0x02ac)
-
-/*
- * MDIO via Realtek's SMI interface
- */
-#define RTL838X_SMI_GLB_CTRL		(0xa100)
-#define RTL838X_SMI_POLL_CTRL		(0xa17c)
-
-#define RTL839X_SMI_GLB_CTRL		(0x03f8)
-#define RTL839X_SMI_PORT_POLLING_CTRL	(0x03fc)
-
-#define RTL930X_SMI_POLL_CTRL		(0xca90)
-#define RTL931X_SMI_PORT_POLLING_CTRL	(0x0CCC)
-
-/* Switch interrupts */
-#define RTL838X_IMR_GLB			(0x1100)
-#define RTL838X_IMR_PORT_LINK_STS_CHG	(0x1104)
-#define RTL838X_ISR_GLB_SRC		(0x1148)
-#define RTL838X_ISR_PORT_LINK_STS_CHG	(0x114C)
-
-#define RTL839X_IMR_GLB			(0x0064)
-#define RTL839X_IMR_PORT_LINK_STS_CHG	(0x0068)
-#define RTL839X_ISR_GLB_SRC		(0x009c)
-#define RTL839X_ISR_PORT_LINK_STS_CHG	(0x00a0)
-
-#define RTL930X_IMR_GLB			(0xC628)
-#define RTL930X_IMR_PORT_LINK_STS_CHG	(0xC62C)
-#define RTL930X_ISR_GLB			(0xC658)
-#define RTL930X_ISR_PORT_LINK_STS_CHG	(0xC660)
-
-/* IMR_GLB does not exit on RTL931X */
-#define RTL931X_IMR_PORT_LINK_STS_CHG	(0x126C)
-#define RTL931X_ISR_GLB_SRC		(0x12B4)
-#define RTL931X_ISR_PORT_LINK_STS_CHG	(0x12B8)
 
 /* Definition of family IDs */
 #define RTL8380_FAMILY_ID		(0x8380)
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
index 95ccfba639..4d1283cd6a 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
@@ -417,6 +417,58 @@
 #define RTL930X_INGRESS_FC_CTRL(port)		(0x81CC + ((port / 29) * 4))
 #define RTL930X_INGRESS_FC_CTRL_EN(port)	BIT(port % 29)
 
+/* Switch interrupts */
+#define RTL838X_IMR_GLB				(0x1100)
+#define RTL838X_IMR_PORT_LINK_STS_CHG		(0x1104)
+#define RTL838X_ISR_GLB_SRC			(0x1148)
+#define RTL838X_ISR_PORT_LINK_STS_CHG		(0x114C)
+
+#define RTL839X_IMR_GLB				(0x0064)
+#define RTL839X_IMR_PORT_LINK_STS_CHG		(0x0068)
+#define RTL839X_ISR_GLB_SRC			(0x009c)
+#define RTL839X_ISR_PORT_LINK_STS_CHG		(0x00a0)
+
+#define RTL930X_IMR_GLB				(0xC628)
+#define RTL930X_IMR_PORT_LINK_STS_CHG		(0xC62C)
+#define RTL930X_ISR_GLB				(0xC658)
+#define RTL930X_ISR_PORT_LINK_STS_CHG		(0xC660)
+
+/* IMR_GLB does not exit on RTL931X */
+#define RTL931X_IMR_PORT_LINK_STS_CHG		(0x126C)
+#define RTL931X_ISR_GLB_SRC			(0x12B4)
+#define RTL931X_ISR_PORT_LINK_STS_CHG		(0x12B8)
+
+/*
+ * MDIO via Realtek's SMI interface
+ */
+#define RTL838X_SMI_GLB_CTRL			(0xa100)
+#define RTL838X_SMI_POLL_CTRL			(0xa17c)
+
+#define RTL839X_SMI_GLB_CTRL			(0x03f8)
+#define RTL839X_SMI_PORT_POLLING_CTRL		(0x03fc)
+
+#define RTL930X_SMI_POLL_CTRL			(0xca90)
+#define RTL931X_SMI_PORT_POLLING_CTRL		(0x0CCC)
+
+#define RTL838X_LED_GLB_CTRL			(0xA000)
+#define RTL839X_LED_GLB_CTRL			(0x00E4)
+#define RTL930X_LED_GLB_CTRL			(0xCC00)
+#define RTL931X_LED_GLB_CTRL			(0x0600)
+
+/* LED control by switch */
+#define RTL838X_LED_MODE_SEL			(0x1004)
+#define RTL838X_LED_MODE_CTRL			(0xA004)
+#define RTL838X_LED_P_EN_CTRL			(0xA008)
+
+/* LED control by software */
+#define RTL838X_LED_SW_CTRL			(0xA00C)
+#define RTL838X_LED0_SW_P_EN_CTRL		(0xA010)
+#define RTL838X_LED1_SW_P_EN_CTRL		(0xA014)
+#define RTL838X_LED2_SW_P_EN_CTRL		(0xA018)
+#define RTL838X_LED_SW_P_CTRL			(0xA01C)
+#define RTL838X_LED_SW_P_CTRL_PORT(p)		(RTL838X_LED_SW_P_CTRL + (((p) << 2)))
+
+
 /* special port action controls */
 /* values:
  *      0 = FORWARD (default)
diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
index 835bd742b4..eceb6960b6 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
@@ -5,6 +5,18 @@
 
 /* Register definition */
 
+/*
+ * Reset
+ */
+#define RTL838X_RST_GLB_CTRL_0			(0x003c)
+#define RTL839X_RST_GLB_CTRL			(0x0014)
+#define RTL930X_RST_GLB_CTRL_0			(0x000c)
+#define RTL931X_RST_GLB_CTRL			(0x0400)
+
+/* Switch interrupts */
+#define RTL839X_IMR_PORT_LINK_STS_CHG		(0x0068)
+#define RTL839X_ISR_PORT_LINK_STS_CHG		(0x00a0)
+
 /* Per port MAC control */
 #define RTL838X_MAC_PORT_CTRL			(0xd560)
 #define RTL839X_MAC_PORT_CTRL			(0x8004)



From lede-commits at lists.infradead.org  Mon Dec 29 03:57:11 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 06:57:11 -0500
Subject: [openwrt/openwrt]  realtek: mdio: configure bus read/write only once.
In-Reply-To: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
References: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
Message-ID: <mailman.39755.1767009434.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3fb1c9c6259ef1d4916c7f1f40988a5e4275337c

commit 3fb1c9c6259ef1d4916c7f1f40988a5e4275337c
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Wed Dec 24 12:19:02 2025 +0100

    realtek: mdio: configure bus read/write only once.
    
    For all families the driver uses the same read/write functions.
    Drop the duplicate per-family initialization.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21274
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c   | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
index 04cc924479..97f8ae1a70 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
@@ -1440,8 +1440,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 	switch (family) {
 	case RTMDIO_838X_FAMILY_ID:
 		bus->name = "rtl838x-eth-mdio";
-		bus->read = rtmdio_read;
-		bus->write = rtmdio_write;
 		bus->reset = rtmdio_838x_reset;
 		priv->read_sds_phy = rtmdio_838x_read_sds_phy;
 		priv->write_sds_phy = rtmdio_838x_write_sds_phy;
@@ -1452,8 +1450,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		break;
 	case RTMDIO_839X_FAMILY_ID:
 		bus->name = "rtl839x-eth-mdio";
-		bus->read = rtmdio_read;
-		bus->write = rtmdio_write;
 		bus->reset = rtmdio_839x_reset;
 		priv->read_sds_phy = rtmdio_839x_read_sds_phy;
 		priv->write_sds_phy = rtmdio_839x_write_sds_phy;
@@ -1464,8 +1460,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		break;
 	case RTMDIO_930X_FAMILY_ID:
 		bus->name = "rtl930x-eth-mdio";
-		bus->read = rtmdio_read;
-		bus->write = rtmdio_write;
 		bus->reset = rtmdio_930x_reset;
 		priv->read_sds_phy = rtmdio_930x_read_sds_phy;
 		priv->write_sds_phy = rtmdio_930x_write_sds_phy;
@@ -1476,8 +1470,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		break;
 	case RTMDIO_931X_FAMILY_ID:
 		bus->name = "rtl931x-eth-mdio";
-		bus->read = rtmdio_read;
-		bus->write = rtmdio_write;
 		bus->reset = rtmdio_931x_reset;
 		priv->read_sds_phy = rtsds_931x_read;
 		priv->write_sds_phy = rtsds_931x_write;
@@ -1487,6 +1479,9 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->write_phy = rtmdio_931x_write_phy;
 		break;
 	}
+
+	bus->read = rtmdio_read;
+	bus->write = rtmdio_write;
 	bus->read_c45 = rtmdio_read_c45;
 	bus->write_c45 = rtmdio_write_c45;
 	bus->parent = dev;



From lede-commits at lists.infradead.org  Mon Dec 29 03:57:15 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 06:57:15 -0500
Subject: [openwrt/openwrt]  realtek: mdio: drop family leftovers
In-Reply-To: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
References: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
Message-ID: <mailman.39756.1767009434.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b8a596e40b64abadbe2d914c5102a897a39df1f7

commit b8a596e40b64abadbe2d914c5102a897a39df1f7
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Wed Dec 24 13:05:01 2025 +0100

    realtek: mdio: drop family leftovers
    
    Now that the bus is completely configured by the dts
    compatible, drop the hard coded family detection.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21274
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../drivers/net/mdio/mdio-realtek-otto.c           | 38 +---------------------
 1 file changed, 1 insertion(+), 37 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
index 27200c074b..f0f3103291 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
@@ -12,11 +12,6 @@
 #define RTMDIO_MAX_SMI_BUS			4
 #define RTMDIO_PAGE_SELECT			0x1f
 
-#define RTMDIO_838X_FAMILY_ID			0x8380
-#define RTMDIO_839X_FAMILY_ID			0x8390
-#define RTMDIO_930X_FAMILY_ID			0x9300
-#define RTMDIO_931X_FAMILY_ID			0x9310
-
 /* Register base */
 #define RTMDIO_SW_BASE				((volatile void *) 0xBB000000)
 
@@ -74,10 +69,6 @@
 #define RTMDIO_931X_SERDES_INDRT_ACCESS_CTRL	(0x5638)
 #define RTMDIO_931X_SERDES_INDRT_DATA_CTRL	(0x563C)
 
-/* Other registers */
-#define RTMDIO_839X_MODEL_NAME_INFO_REG		(0x0ff0)
-#define RTMDIO_93XX_MODEL_NAME_INFO_REG		(0x0004)
-
 #define sw_r32(reg)				readl(RTMDIO_SW_BASE + reg)
 #define sw_w32(val, reg)			writel(val, RTMDIO_SW_BASE + reg)
 #define sw_w32_mask(clear, set, reg)		sw_w32((sw_r32(reg) & ~(clear)) | (set), reg)
@@ -153,8 +144,6 @@ DEFINE_MUTEX(rtmdio_lock_sds);
 
 struct rtmdio_bus_priv {
 	const struct rtmdio_config *cfg;
-	u16 id;
-	u16 family_id;
 	int page[RTMDIO_MAX_PORT];
 	bool raw[RTMDIO_MAX_PORT];
 	int smi_bus[RTMDIO_MAX_PORT];
@@ -1390,39 +1379,14 @@ static int rtmdio_reset(struct mii_bus *bus)
 	return priv->cfg->reset(bus);
 }
 
-/*
- * TODO: This is a tiny leftover from the central SoC include. For now try to detect the
- * Realtek SoC automatically. This needs to be changed to a proper DTS compatible in a
- * future driver version.
- */
-static int rtmdio_get_family(void)
-{
-	unsigned int val;
-
-	val = sw_r32(RTMDIO_93XX_MODEL_NAME_INFO_REG);
-	if ((val & 0xfffc0000) == 0x93000000)
-		return RTMDIO_930X_FAMILY_ID;
-	if ((val & 0xfffc0000) == 0x93100000)
-		return RTMDIO_931X_FAMILY_ID;
-
-	val = sw_r32(RTMDIO_839X_MODEL_NAME_INFO_REG);
-	if ((val & 0xfff80000) == 0x83900000)
-		return RTMDIO_839X_FAMILY_ID;
-
-	return RTMDIO_838X_FAMILY_ID;
-}
-
 static int rtmdio_probe(struct platform_device *pdev)
 {
 	struct device_node *dn, *mii_np, *pcs_node;
 	struct device *dev = &pdev->dev;
 	struct rtmdio_bus_priv *priv;
 	struct mii_bus *bus;
-	int i, family;
 	u32 pn;
-
-	family = rtmdio_get_family();
-	dev_info(dev, "probing RTL%04x family mdio bus\n", family);
+	int i;
 
 	mii_np = of_get_child_by_name(dev->of_node, "mdio-bus");
 	if (!mii_np)



From lede-commits at lists.infradead.org  Mon Dec 29 03:57:14 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 06:57:14 -0500
Subject: [openwrt/openwrt]  realtek: mdio: relocate reset function
In-Reply-To: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
References: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
Message-ID: <mailman.39757.1767009436.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/96bcabe1bf772aa44c45ff395b17fa73b665e7ce

commit 96bcabe1bf772aa44c45ff395b17fa73b665e7ce
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Wed Dec 24 12:57:11 2025 +0100

    realtek: mdio: relocate reset function
    
    Place the reset function into the config structure.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21274
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../drivers/net/mdio/mdio-realtek-otto.c           | 28 ++++++++++------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
index 176c152fec..27200c074b 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
@@ -171,6 +171,7 @@ struct rtmdio_config {
 	int (*read_mmd_phy)(u32 port, u32 addr, u32 reg, u32 *val);
 	int (*read_phy)(u32 port, u32 page, u32 reg, u32 *val);
 	int (*read_sds_phy)(int sds, int page, int regnum);
+	int (*reset)(struct mii_bus *bus);
 	int (*write_mmd_phy)(u32 port, u32 addr, u32 reg, u32 val);
 	int (*write_phy)(u32 port, u32 page, u32 reg, u32 val);
 	int (*write_sds_phy)(int sds, int page, int regnum, u16 val);
@@ -1382,6 +1383,13 @@ static int rtmdio_931x_reset(struct mii_bus *bus)
 	return 0;
 }
 
+static int rtmdio_reset(struct mii_bus *bus)
+{
+	struct rtmdio_bus_priv *priv = bus->priv;
+
+	return priv->cfg->reset(bus);
+}
+
 /*
  * TODO: This is a tiny leftover from the central SoC include. For now try to detect the
  * Realtek SoC automatically. This needs to be changed to a proper DTS compatible in a
@@ -1437,22 +1445,8 @@ static int rtmdio_probe(struct platform_device *pdev)
 
 	priv->cfg = (const struct rtmdio_config *)device_get_match_data(dev);
 
-	switch (family) {
-	case RTMDIO_838X_FAMILY_ID:
-		bus->reset = rtmdio_838x_reset;
-		break;
-	case RTMDIO_839X_FAMILY_ID:
-		bus->reset = rtmdio_839x_reset;
-		break;
-	case RTMDIO_930X_FAMILY_ID:
-		bus->reset = rtmdio_930x_reset;
-		break;
-	case RTMDIO_931X_FAMILY_ID:
-		bus->reset = rtmdio_931x_reset;
-		break;
-	}
-
 	bus->name = "Realtek MDIO bus";
+	bus->reset = rtmdio_reset;
 	bus->read = rtmdio_read;
 	bus->write = rtmdio_write;
 	bus->read_c45 = rtmdio_read_c45;
@@ -1533,6 +1527,7 @@ static const struct rtmdio_config rtmdio_838x_cfg = {
 	.read_mmd_phy	= rtmdio_838x_read_mmd_phy,
 	.read_phy	= rtmdio_838x_read_phy,
 	.read_sds_phy	= rtmdio_838x_read_sds_phy,
+	.reset		= rtmdio_838x_reset,
 	.write_mmd_phy	= rtmdio_838x_write_mmd_phy,
 	.write_phy	= rtmdio_838x_write_phy,
 	.write_sds_phy	= rtmdio_838x_write_sds_phy,
@@ -1544,6 +1539,7 @@ static const struct rtmdio_config rtmdio_839x_cfg = {
 	.read_mmd_phy	= rtmdio_839x_read_mmd_phy,
 	.read_phy	= rtmdio_839x_read_phy,
 	.read_sds_phy	= rtmdio_839x_read_sds_phy,
+	.reset		= rtmdio_839x_reset,
 	.write_mmd_phy	= rtmdio_839x_write_mmd_phy,
 	.write_phy	= rtmdio_839x_write_phy,
 	.write_sds_phy	= rtmdio_839x_write_sds_phy,
@@ -1555,6 +1551,7 @@ static const struct rtmdio_config rtmdio_930x_cfg = {
 	.read_mmd_phy	= rtmdio_930x_read_mmd_phy,
 	.read_phy	= rtmdio_930x_read_phy,
 	.read_sds_phy	= rtmdio_930x_read_sds_phy,
+	.reset		= rtmdio_930x_reset,
 	.write_mmd_phy	= rtmdio_930x_write_mmd_phy,
 	.write_phy	= rtmdio_930x_write_phy,
 	.write_sds_phy	= rtmdio_930x_write_sds_phy,
@@ -1566,6 +1563,7 @@ static const struct rtmdio_config rtmdio_931x_cfg = {
 	.read_mmd_phy	= rtmdio_931x_read_mmd_phy,
 	.read_phy	= rtmdio_931x_read_phy,
 	.read_sds_phy	= rtsds_931x_read,
+	.reset		= rtmdio_931x_reset,
 	.write_mmd_phy	= rtmdio_931x_write_mmd_phy,
 	.write_phy	= rtmdio_931x_write_phy,
 	.write_sds_phy	= rtsds_931x_write,



From lede-commits at lists.infradead.org  Mon Dec 29 03:57:12 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 06:57:12 -0500
Subject: [openwrt/openwrt]  realtek: mdio: move read/write functions to config
 structure
In-Reply-To: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
References: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
Message-ID: <mailman.39760.1767009436.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b7f519ff3db0449ba7cde29f8f7c623332048ef8

commit b7f519ff3db0449ba7cde29f8f7c623332048ef8
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Wed Dec 24 12:32:34 2025 +0100

    realtek: mdio: move read/write functions to config structure
    
    Move the read/write functions to where they belong.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21274
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../drivers/net/mdio/mdio-realtek-otto.c           | 72 +++++++++++-----------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
index 97f8ae1a70..14f3e1668e 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
@@ -163,17 +163,17 @@ struct rtmdio_bus_priv {
 	bool smi_bus_isc45[RTMDIO_MAX_SMI_BUS];
 	bool phy_is_internal[RTMDIO_MAX_PORT];
 	phy_interface_t interfaces[RTMDIO_MAX_PORT];
-	int (*read_mmd_phy)(u32 port, u32 addr, u32 reg, u32 *val);
-	int (*write_mmd_phy)(u32 port, u32 addr, u32 reg, u32 val);
-	int (*read_phy)(u32 port, u32 page, u32 reg, u32 *val);
-	int (*write_phy)(u32 port, u32 page, u32 reg, u32 val);
-	int (*read_sds_phy)(int sds, int page, int regnum);
-	int (*write_sds_phy)(int sds, int page, int regnum, u16 val);
 };
 
 struct rtmdio_config {
 	int cpu_port;
 	int raw_page;
+	int (*read_mmd_phy)(u32 port, u32 addr, u32 reg, u32 *val);
+	int (*read_phy)(u32 port, u32 page, u32 reg, u32 *val);
+	int (*read_sds_phy)(int sds, int page, int regnum);
+	int (*write_mmd_phy)(u32 port, u32 addr, u32 reg, u32 val);
+	int (*write_phy)(u32 port, u32 page, u32 reg, u32 val);
+	int (*write_sds_phy)(int sds, int page, int regnum, u16 val);
 };
 
 /* SerDes reader/writer functions for the ports without external phy. */
@@ -1073,7 +1073,7 @@ static int rtmdio_read_c45(struct mii_bus *bus, int addr, int devnum, int regnum
 	if (addr >= priv->cfg->cpu_port)
 		return -ENODEV;
 
-	err = (*priv->read_mmd_phy)(addr, devnum, regnum, &val);
+	err = (*priv->cfg->read_mmd_phy)(addr, devnum, regnum, &val);
 	pr_debug("rd_MMD(adr=%d, dev=%d, reg=%d) = %d, err = %d\n",
 		 addr, devnum, regnum, val, err);
 	return err ? err : val;
@@ -1113,7 +1113,7 @@ static int rtmdio_read_sds_phy(struct rtmdio_bus_priv *priv, int sds, int page,
 
 	ret = rtmdio_map_sds_register(page, regnum, &sds_page, &sds_regnum);
 	if (ret)
-		ret = priv->read_sds_phy(sds, sds_page, sds_regnum);
+		ret = priv->cfg->read_sds_phy(sds, sds_page, sds_regnum);
 	pr_debug("rd_SDS(sds=%d, pag=%d, reg=%d) = %d\n", sds, page, regnum, ret);
 
 	return ret;
@@ -1125,7 +1125,7 @@ static int rtmdio_write_sds_phy(struct rtmdio_bus_priv *priv, int sds, int page,
 
 	ret = rtmdio_map_sds_register(page, regnum, &sds_page, &sds_regnum);
 	if (ret)
-		ret = priv->write_sds_phy(sds, sds_page, sds_regnum, val);
+		ret = priv->cfg->write_sds_phy(sds, sds_page, sds_regnum, val);
 	pr_debug("wr_SDS(sds=%d, pag=%d, reg=%d, val=%d) err = %d\n", sds, page, regnum, val, ret);
 
 	return ret;
@@ -1147,7 +1147,7 @@ static int rtmdio_read(struct mii_bus *bus, int addr, int regnum)
 		return rtmdio_read_sds_phy(priv, priv->sds_id[addr],
 					   priv->page[addr], regnum);
 
-	err = (*priv->read_phy)(addr, priv->page[addr], regnum, &val);
+	err = (*priv->cfg->read_phy)(addr, priv->page[addr], regnum, &val);
 	pr_debug("rd_PHY(adr=%d, pag=%d, reg=%d) = %d, err = %d\n",
 		 addr, priv->page[addr], regnum, val, err);
 	return err ? err : val;
@@ -1161,7 +1161,7 @@ static int rtmdio_write_c45(struct mii_bus *bus, int addr, int devnum, int regnu
 	if (addr >= priv->cfg->cpu_port)
 		return -ENODEV;
 
-	err = (*priv->write_mmd_phy)(addr, devnum, regnum, val);
+	err = (*priv->cfg->write_mmd_phy)(addr, devnum, regnum, val);
 	pr_debug("wr_MMD(adr=%d, dev=%d, reg=%d, val=%d) err = %d\n",
 		 addr, devnum, regnum, val, err);
 	return err;
@@ -1186,7 +1186,7 @@ static int rtmdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
 			return rtmdio_write_sds_phy(priv, priv->sds_id[addr],
 						    priv->page[addr], regnum, val);
 
-		err = (*priv->write_phy)(addr, page, regnum, val);
+		err = (*priv->cfg->write_phy)(addr, page, regnum, val);
 		pr_debug("wr_PHY(adr=%d, pag=%d, reg=%d, val=%d) err = %d\n",
 			 addr, page, regnum, val, err);
 		return err;
@@ -1441,42 +1441,18 @@ static int rtmdio_probe(struct platform_device *pdev)
 	case RTMDIO_838X_FAMILY_ID:
 		bus->name = "rtl838x-eth-mdio";
 		bus->reset = rtmdio_838x_reset;
-		priv->read_sds_phy = rtmdio_838x_read_sds_phy;
-		priv->write_sds_phy = rtmdio_838x_write_sds_phy;
-		priv->read_mmd_phy = rtmdio_838x_read_mmd_phy;
-		priv->write_mmd_phy = rtmdio_838x_write_mmd_phy;
-		priv->read_phy = rtmdio_838x_read_phy;
-		priv->write_phy = rtmdio_838x_write_phy;
 		break;
 	case RTMDIO_839X_FAMILY_ID:
 		bus->name = "rtl839x-eth-mdio";
 		bus->reset = rtmdio_839x_reset;
-		priv->read_sds_phy = rtmdio_839x_read_sds_phy;
-		priv->write_sds_phy = rtmdio_839x_write_sds_phy;
-		priv->read_mmd_phy = rtmdio_839x_read_mmd_phy;
-		priv->write_mmd_phy = rtmdio_839x_write_mmd_phy;
-		priv->read_phy = rtmdio_839x_read_phy;
-		priv->write_phy = rtmdio_839x_write_phy;
 		break;
 	case RTMDIO_930X_FAMILY_ID:
 		bus->name = "rtl930x-eth-mdio";
 		bus->reset = rtmdio_930x_reset;
-		priv->read_sds_phy = rtmdio_930x_read_sds_phy;
-		priv->write_sds_phy = rtmdio_930x_write_sds_phy;
-		priv->read_mmd_phy = rtmdio_930x_read_mmd_phy;
-		priv->write_mmd_phy = rtmdio_930x_write_mmd_phy;
-		priv->read_phy = rtmdio_930x_read_phy;
-		priv->write_phy = rtmdio_930x_write_phy;
 		break;
 	case RTMDIO_931X_FAMILY_ID:
 		bus->name = "rtl931x-eth-mdio";
 		bus->reset = rtmdio_931x_reset;
-		priv->read_sds_phy = rtsds_931x_read;
-		priv->write_sds_phy = rtsds_931x_write;
-		priv->read_mmd_phy = rtmdio_931x_read_mmd_phy;
-		priv->write_mmd_phy = rtmdio_931x_write_mmd_phy;
-		priv->read_phy = rtmdio_931x_read_phy;
-		priv->write_phy = rtmdio_931x_write_phy;
 		break;
 	}
 
@@ -1557,21 +1533,45 @@ static int rtmdio_probe(struct platform_device *pdev)
 static const struct rtmdio_config rtmdio_838x_cfg = {
 	.cpu_port	= 28,
 	.raw_page	= 4095,
+	.read_mmd_phy	= rtmdio_838x_read_mmd_phy,
+	.read_phy	= rtmdio_838x_read_phy,
+	.read_sds_phy	= rtmdio_838x_read_sds_phy,
+	.write_mmd_phy	= rtmdio_838x_write_mmd_phy,
+	.write_phy	= rtmdio_838x_write_phy,
+	.write_sds_phy	= rtmdio_838x_write_sds_phy,
 };
 
 static const struct rtmdio_config rtmdio_839x_cfg = {
 	.cpu_port	= 52,
 	.raw_page	= 8191,
+	.read_mmd_phy	= rtmdio_839x_read_mmd_phy,
+	.read_phy	= rtmdio_839x_read_phy,
+	.read_sds_phy	= rtmdio_839x_read_sds_phy,
+	.write_mmd_phy	= rtmdio_839x_write_mmd_phy,
+	.write_phy	= rtmdio_839x_write_phy,
+	.write_sds_phy	= rtmdio_839x_write_sds_phy,
 };
 
 static const struct rtmdio_config rtmdio_930x_cfg = {
 	.cpu_port	= 28,
 	.raw_page	= 4095,
+	.read_mmd_phy	= rtmdio_930x_read_mmd_phy,
+	.read_phy	= rtmdio_930x_read_phy,
+	.read_sds_phy	= rtmdio_930x_read_sds_phy,
+	.write_mmd_phy	= rtmdio_930x_write_mmd_phy,
+	.write_phy	= rtmdio_930x_write_phy,
+	.write_sds_phy	= rtmdio_930x_write_sds_phy,
 };
 
 static const struct rtmdio_config rtmdio_931x_cfg = {
 	.cpu_port	= 56,
 	.raw_page	= 8191,
+	.read_mmd_phy	= rtmdio_931x_read_mmd_phy,
+	.read_phy	= rtmdio_931x_read_phy,
+	.read_sds_phy	= rtsds_931x_read,
+	.write_mmd_phy	= rtmdio_931x_write_mmd_phy,
+	.write_phy	= rtmdio_931x_write_phy,
+	.write_sds_phy	= rtsds_931x_write,
 };
 
 static const struct of_device_id rtmdio_ids[] = {



From lede-commits at lists.infradead.org  Mon Dec 29 03:57:09 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 06:57:09 -0500
Subject: [openwrt/openwrt]  realtek: mdio: add per family configuration
 structure
In-Reply-To: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
References: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
Message-ID: <mailman.39761.1767009436.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/36f56f27ae3c75686d7505d232aed001776f1b89

commit 36f56f27ae3c75686d7505d232aed001776f1b89
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Wed Dec 24 11:34:43 2025 +0100

    realtek: mdio: add per family configuration structure
    
    The mdio driver already has a family specific compatible that
    is used in the dts to denote the device type. Nevertheless it
    is not evaluated. The driver determines the family on its own
    in rtmdio_get_family().
    
    Break up this dependency by providing a configuration structure
    that can be automatically assigned by device_get_match_data().
    For now only move the rawpage variable over there.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21274
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../drivers/net/mdio/mdio-realtek-otto.c           | 58 ++++++++++++++++------
 1 file changed, 44 insertions(+), 14 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
index e6574178ea..df56dfad02 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
@@ -159,9 +159,9 @@ DEFINE_MUTEX(rtmdio_lock);
 DEFINE_MUTEX(rtmdio_lock_sds);
 
 struct rtmdio_bus_priv {
+	const struct rtmdio_config *cfg;
 	u16 id;
 	u16 family_id;
-	int rawpage;
 	int cpu_port;
 	int page[RTMDIO_MAX_PORT];
 	bool raw[RTMDIO_MAX_PORT];
@@ -179,6 +179,10 @@ struct rtmdio_bus_priv {
 	int (*write_sds_phy)(int sds, int page, int regnum, u16 val);
 };
 
+struct rtmdio_config {
+	int raw_page;
+};
+
 /* SerDes reader/writer functions for the ports without external phy. */
 
 /*
@@ -1150,10 +1154,10 @@ static int rtmdio_read(struct mii_bus *bus, int addr, int regnum)
 	if (addr >= priv->cpu_port)
 		return -ENODEV;
 
-	if (regnum == RTMDIO_PAGE_SELECT && priv->page[addr] != priv->rawpage)
+	if (regnum == RTMDIO_PAGE_SELECT && priv->page[addr] != priv->cfg->raw_page)
 		return priv->page[addr];
 
-	priv->raw[addr] = (priv->page[addr] == priv->rawpage);
+	priv->raw[addr] = (priv->page[addr] == priv->cfg->raw_page);
 	if ((priv->phy_is_internal[addr]) && (priv->sds_id[addr] >= 0))
 		return rtmdio_read_sds_phy(priv, priv->sds_id[addr],
 					   priv->page[addr], regnum);
@@ -1191,8 +1195,8 @@ static int rtmdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
 	if (regnum == RTMDIO_PAGE_SELECT)
 		priv->page[addr] = val;
 
-	if (!priv->raw[addr] && (regnum != RTMDIO_PAGE_SELECT || page == priv->rawpage)) {
-		priv->raw[addr] = (page == priv->rawpage);
+	if (!priv->raw[addr] && (regnum != RTMDIO_PAGE_SELECT || page == priv->cfg->raw_page)) {
+		priv->raw[addr] = (page == priv->cfg->raw_page);
 		if (priv->phy_is_internal[addr] && priv->sds_id[addr] >= 0)
 			return rtmdio_write_sds_phy(priv, priv->sds_id[addr],
 						    priv->page[addr], regnum, val);
@@ -1446,6 +1450,8 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->raw[i] = false;
 	}
 
+	priv->cfg = (const struct rtmdio_config *)device_get_match_data(dev);
+
 	switch (family) {
 	case RTMDIO_838X_FAMILY_ID:
 		bus->name = "rtl838x-eth-mdio";
@@ -1459,7 +1465,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->read_phy = rtmdio_838x_read_phy;
 		priv->write_phy = rtmdio_838x_write_phy;
 		priv->cpu_port = RTMDIO_838X_CPU_PORT;
-		priv->rawpage = 0xfff;
 		break;
 	case RTMDIO_839X_FAMILY_ID:
 		bus->name = "rtl839x-eth-mdio";
@@ -1473,7 +1478,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->read_phy = rtmdio_839x_read_phy;
 		priv->write_phy = rtmdio_839x_write_phy;
 		priv->cpu_port = RTMDIO_839X_CPU_PORT;
-		priv->rawpage = 0x1fff;
 		break;
 	case RTMDIO_930X_FAMILY_ID:
 		bus->name = "rtl930x-eth-mdio";
@@ -1487,7 +1491,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->read_phy = rtmdio_930x_read_phy;
 		priv->write_phy = rtmdio_930x_write_phy;
 		priv->cpu_port = RTMDIO_930X_CPU_PORT;
-		priv->rawpage = 0xfff;
 		break;
 	case RTMDIO_931X_FAMILY_ID:
 		bus->name = "rtl931x-eth-mdio";
@@ -1501,7 +1504,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->read_phy = rtmdio_931x_read_phy;
 		priv->write_phy = rtmdio_931x_write_phy;
 		priv->cpu_port = RTMDIO_931X_CPU_PORT;
-		priv->rawpage = 0x1fff;
 		break;
 	}
 	bus->read_c45 = rtmdio_read_c45;
@@ -1576,12 +1578,40 @@ static int rtmdio_probe(struct platform_device *pdev)
 	return devm_of_mdiobus_register(dev, bus, mii_np);
 }
 
+static const struct rtmdio_config rtmdio_838x_cfg = {
+	.raw_page	= 4095,
+};
+
+static const struct rtmdio_config rtmdio_839x_cfg = {
+	.raw_page	= 8191,
+};
+
+static const struct rtmdio_config rtmdio_930x_cfg = {
+	.raw_page	= 4095,
+};
+
+static const struct rtmdio_config rtmdio_931x_cfg = {
+	.raw_page	= 8191,
+};
+
 static const struct of_device_id rtmdio_ids[] = {
-	{ .compatible = "realtek,rtl8380-mdio" },
-	{ .compatible = "realtek,rtl8392-mdio" },
-	{ .compatible = "realtek,rtl9301-mdio" },
-	{ .compatible = "realtek,rtl9311-mdio" },
-	{}
+	{
+		.compatible = "realtek,rtl8380-mdio",
+		.data = &rtmdio_838x_cfg,
+	},
+	{
+		.compatible = "realtek,rtl8392-mdio",
+		.data = &rtmdio_839x_cfg,
+	},
+	{
+		.compatible = "realtek,rtl9301-mdio",
+		.data = &rtmdio_930x_cfg,
+	},
+	{
+		.compatible = "realtek,rtl9311-mdio",
+		.data = &rtmdio_931x_cfg,
+	},
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rtmdio_ids);
 



From lede-commits at lists.infradead.org  Mon Dec 29 03:57:10 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 06:57:10 -0500
Subject: [openwrt/openwrt]  realtek: mdio: move cpu_port to configuration
 structure
In-Reply-To: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
References: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
Message-ID: <mailman.39762.1767009436.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/89f56789482675efd406575103b9333ecc098157

commit 89f56789482675efd406575103b9333ecc098157
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Wed Dec 24 11:54:33 2025 +0100

    realtek: mdio: move cpu_port to configuration structure
    
    Relocate the cpu port definition over to the new configuration
    structure. There are several family specific places where the
    driver checks port ranges. These are a wild mix of arbitrary
    values (64) or constant defines. Remove them as the the central
    read/write functions already have a proper check with -ENODEV
    bail out in place.
    
    With the cleanup drop the port defines as there is only one
    consumer (config structure) left.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21274
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../drivers/net/mdio/mdio-realtek-otto.c           | 55 ++++++++--------------
 1 file changed, 20 insertions(+), 35 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
index df56dfad02..04cc924479 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
@@ -12,16 +12,9 @@
 #define RTMDIO_MAX_SMI_BUS			4
 #define RTMDIO_PAGE_SELECT			0x1f
 
-#define RTMDIO_838X_CPU_PORT			28
 #define RTMDIO_838X_FAMILY_ID			0x8380
-
-#define RTMDIO_839X_CPU_PORT			52
 #define RTMDIO_839X_FAMILY_ID			0x8390
-
-#define RTMDIO_930X_CPU_PORT			28
 #define RTMDIO_930X_FAMILY_ID			0x9300
-
-#define RTMDIO_931X_CPU_PORT			56
 #define RTMDIO_931X_FAMILY_ID			0x9310
 
 /* Register base */
@@ -162,7 +155,6 @@ struct rtmdio_bus_priv {
 	const struct rtmdio_config *cfg;
 	u16 id;
 	u16 family_id;
-	int cpu_port;
 	int page[RTMDIO_MAX_PORT];
 	bool raw[RTMDIO_MAX_PORT];
 	int smi_bus[RTMDIO_MAX_PORT];
@@ -180,6 +172,7 @@ struct rtmdio_bus_priv {
 };
 
 struct rtmdio_config {
+	int cpu_port;
 	int raw_page;
 };
 
@@ -472,7 +465,7 @@ static int rtmdio_839x_read_phy(u32 port, u32 page, u32 reg, u32 *val)
 	int err = 0;
 	u32 v;
 
-	if (port >= RTMDIO_839X_CPU_PORT || page > 8191 || reg > 31)
+	if (page > 8191 || reg > 31)
 		return -ENOTSUPP;
 
 	mutex_lock(&rtmdio_lock);
@@ -504,7 +497,7 @@ static int rtmdio_839x_write_phy(u32 port, u32 page, u32 reg, u32 val)
 	u32 v;
 
 	val &= 0xffff;
-	if (port >= RTMDIO_839X_CPU_PORT || page > 8191 || reg > 31)
+	if (page > 8191 || reg > 31)
 		return -ENOTSUPP;
 
 	mutex_lock(&rtmdio_lock);
@@ -542,10 +535,6 @@ static int rtmdio_839x_read_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 *val)
 	int err = 0;
 	u32 v;
 
-	/* Take bug on RTL839x Rev <= C into account */
-	if (port >= RTMDIO_839X_CPU_PORT)
-		return -EIO;
-
 	mutex_lock(&rtmdio_lock);
 
 	/* Set PHY to access */
@@ -577,10 +566,6 @@ static int rtmdio_839x_write_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 val)
 	int err = 0;
 	u32 v;
 
-	/* Take bug on RTL839x Rev <= C into account */
-	if (port >= RTMDIO_839X_CPU_PORT)
-		return -EIO;
-
 	mutex_lock(&rtmdio_lock);
 
 	/* Set PHY to access */
@@ -709,7 +694,7 @@ static int rtmdio_930x_read_phy(u32 port, u32 page, u32 reg, u32 *val)
 	u32 v;
 	int err = 0;
 
-	if (port > 63 || page > 4095 || reg > 31)
+	if (page > 4095 || reg > 31)
 		return -ENOTSUPP;
 
 	mutex_lock(&rtmdio_lock);
@@ -976,7 +961,7 @@ static int rtmdio_931x_read_phy(u32 port, u32 page, u32 reg, u32 *val)
 {
 	u32 v;
 
-	if (port > 63 || page > 4095 || reg > 31)
+	if (page > 4095 || reg > 31)
 		return -ENOTSUPP;
 
 	mutex_lock(&rtmdio_lock);
@@ -1085,7 +1070,7 @@ static int rtmdio_read_c45(struct mii_bus *bus, int addr, int devnum, int regnum
 	struct rtmdio_bus_priv *priv = bus->priv;
 	int err, val;
 
-	if (addr >= priv->cpu_port)
+	if (addr >= priv->cfg->cpu_port)
 		return -ENODEV;
 
 	err = (*priv->read_mmd_phy)(addr, devnum, regnum, &val);
@@ -1151,7 +1136,7 @@ static int rtmdio_read(struct mii_bus *bus, int addr, int regnum)
 	struct rtmdio_bus_priv *priv = bus->priv;
 	int err, val;
 
-	if (addr >= priv->cpu_port)
+	if (addr >= priv->cfg->cpu_port)
 		return -ENODEV;
 
 	if (regnum == RTMDIO_PAGE_SELECT && priv->page[addr] != priv->cfg->raw_page)
@@ -1173,7 +1158,7 @@ static int rtmdio_write_c45(struct mii_bus *bus, int addr, int devnum, int regnu
 	struct rtmdio_bus_priv *priv = bus->priv;
 	int err;
 
-	if (addr >= priv->cpu_port)
+	if (addr >= priv->cfg->cpu_port)
 		return -ENODEV;
 
 	err = (*priv->write_mmd_phy)(addr, devnum, regnum, val);
@@ -1187,7 +1172,7 @@ static int rtmdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
 	struct rtmdio_bus_priv *priv = bus->priv;
 	int err, page;
 
-	if (addr >= priv->cpu_port)
+	if (addr >= priv->cfg->cpu_port)
 		return -ENODEV;
 
 	page = priv->page[addr];
@@ -1240,8 +1225,8 @@ static int rtmdio_839x_reset(struct mii_bus *bus)
 	return 0;
 }
 
-u8 mac_type_bit[RTMDIO_930X_CPU_PORT] = {0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6,
-					 8, 8, 8, 8, 10, 10, 10, 10, 12, 15, 18, 21};
+u8 mac_type_bit[RTMDIO_MAX_PORT] = {0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6,
+				    8, 8, 8, 8, 10, 10, 10, 10, 12, 15, 18, 21};
 
 static int rtmdio_930x_reset(struct mii_bus *bus)
 {
@@ -1255,7 +1240,7 @@ static int rtmdio_930x_reset(struct mii_bus *bus)
 	u32 v;
 
 	/* Mapping of port to phy-addresses on an SMI bus */
-	for (int i = 0; i < RTMDIO_930X_CPU_PORT; i++) {
+	for (int i = 0; i < priv->cfg->cpu_port; i++) {
 		int pos;
 
 		if (priv->smi_bus[i] < 0)
@@ -1288,7 +1273,7 @@ static int rtmdio_930x_reset(struct mii_bus *bus)
 	/* Set the MAC type of each port according to the PHY-interface */
 	/* Values are FE: 2, GE: 3, XGE/2.5G: 0(SERDES) or 1(otherwise), SXGE: 0 */
 	v = 0;
-	for (int i = 0; i < RTMDIO_930X_CPU_PORT; i++) {
+	for (int i = 0; i < priv->cfg->cpu_port; i++) {
 		switch (priv->interfaces[i]) {
 		case PHY_INTERFACE_MODE_10GBASER:
 			break;			/* Serdes: Value = 0 */
@@ -1358,7 +1343,7 @@ static int rtmdio_931x_reset(struct mii_bus *bus)
 	msleep(100);
 
 	/* Mapping of port to phy-addresses on an SMI bus */
-	for (int i = 0; i < RTMDIO_931X_CPU_PORT; i++) {
+	for (int i = 0; i < priv->cfg->cpu_port; i++) {
 		u32 pos;
 
 		if (priv->smi_bus[i] < 0)
@@ -1464,7 +1449,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->write_mmd_phy = rtmdio_838x_write_mmd_phy;
 		priv->read_phy = rtmdio_838x_read_phy;
 		priv->write_phy = rtmdio_838x_write_phy;
-		priv->cpu_port = RTMDIO_838X_CPU_PORT;
 		break;
 	case RTMDIO_839X_FAMILY_ID:
 		bus->name = "rtl839x-eth-mdio";
@@ -1477,7 +1461,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->write_mmd_phy = rtmdio_839x_write_mmd_phy;
 		priv->read_phy = rtmdio_839x_read_phy;
 		priv->write_phy = rtmdio_839x_write_phy;
-		priv->cpu_port = RTMDIO_839X_CPU_PORT;
 		break;
 	case RTMDIO_930X_FAMILY_ID:
 		bus->name = "rtl930x-eth-mdio";
@@ -1490,7 +1473,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->write_mmd_phy = rtmdio_930x_write_mmd_phy;
 		priv->read_phy = rtmdio_930x_read_phy;
 		priv->write_phy = rtmdio_930x_write_phy;
-		priv->cpu_port = RTMDIO_930X_CPU_PORT;
 		break;
 	case RTMDIO_931X_FAMILY_ID:
 		bus->name = "rtl931x-eth-mdio";
@@ -1503,13 +1485,12 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->write_mmd_phy = rtmdio_931x_write_mmd_phy;
 		priv->read_phy = rtmdio_931x_read_phy;
 		priv->write_phy = rtmdio_931x_write_phy;
-		priv->cpu_port = RTMDIO_931X_CPU_PORT;
 		break;
 	}
 	bus->read_c45 = rtmdio_read_c45;
 	bus->write_c45 = rtmdio_write_c45;
 	bus->parent = dev;
-	bus->phy_mask = ~(BIT_ULL(priv->cpu_port) - 1ULL);
+	bus->phy_mask = ~(BIT_ULL(priv->cfg->cpu_port) - 1ULL);
 
 	for_each_node_by_name(dn, "ethernet-phy") {
 		u32 smi_addr[2];
@@ -1551,7 +1532,7 @@ static int rtmdio_probe(struct platform_device *pdev)
 		if (of_property_read_u32(dn, "reg", &pn))
 			continue;
 		dev_dbg(dev, "Looking at port %d\n", pn);
-		if (pn > priv->cpu_port)
+		if (pn > priv->cfg->cpu_port)
 			continue;
 		if (of_get_phy_mode(dn, &priv->interfaces[pn]))
 			priv->interfaces[pn] = PHY_INTERFACE_MODE_NA;
@@ -1579,18 +1560,22 @@ static int rtmdio_probe(struct platform_device *pdev)
 }
 
 static const struct rtmdio_config rtmdio_838x_cfg = {
+	.cpu_port	= 28,
 	.raw_page	= 4095,
 };
 
 static const struct rtmdio_config rtmdio_839x_cfg = {
+	.cpu_port	= 52,
 	.raw_page	= 8191,
 };
 
 static const struct rtmdio_config rtmdio_930x_cfg = {
+	.cpu_port	= 28,
 	.raw_page	= 4095,
 };
 
 static const struct rtmdio_config rtmdio_931x_cfg = {
+	.cpu_port	= 56,
 	.raw_page	= 8191,
 };
 



From lede-commits at lists.infradead.org  Mon Dec 29 03:57:13 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 06:57:13 -0500
Subject: [openwrt/openwrt]  realtek: mdio: give bus a family independent name
In-Reply-To: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
References: <176700942997.2511001.2162777967557250315@git-01.infra.openwrt.org>
Message-ID: <mailman.39765.1767009439.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/87a3c62e3288746cd01b642b26c1947deeaba45c

commit 87a3c62e3288746cd01b642b26c1947deeaba45c
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Wed Dec 24 12:47:06 2025 +0100

    realtek: mdio: give bus a family independent name
    
    There is no need to give the mdio bus a family dependent name.
    Name the bus similar to the SerDes mdio bus.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21274
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
index 14f3e1668e..176c152fec 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
@@ -1439,23 +1439,20 @@ static int rtmdio_probe(struct platform_device *pdev)
 
 	switch (family) {
 	case RTMDIO_838X_FAMILY_ID:
-		bus->name = "rtl838x-eth-mdio";
 		bus->reset = rtmdio_838x_reset;
 		break;
 	case RTMDIO_839X_FAMILY_ID:
-		bus->name = "rtl839x-eth-mdio";
 		bus->reset = rtmdio_839x_reset;
 		break;
 	case RTMDIO_930X_FAMILY_ID:
-		bus->name = "rtl930x-eth-mdio";
 		bus->reset = rtmdio_930x_reset;
 		break;
 	case RTMDIO_931X_FAMILY_ID:
-		bus->name = "rtl931x-eth-mdio";
 		bus->reset = rtmdio_931x_reset;
 		break;
 	}
 
+	bus->name = "Realtek MDIO bus";
 	bus->read = rtmdio_read;
 	bus->write = rtmdio_write;
 	bus->read_c45 = rtmdio_read_c45;



From lede-commits at lists.infradead.org  Mon Dec 29 08:06:24 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 11:06:24 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: fix clearing symbol errors
In-Reply-To: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
References: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
Message-ID: <mailman.39816.1767024387.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/19585a79660a9e0698f2244b5c8ad8d342ddf205

commit 19585a79660a9e0698f2244b5c8ad8d342ddf205
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 20 18:36:56 2025 +0000

    realtek: pcs: rtl931x: fix clearing symbol errors
    
    Fix the implementation to clear symbol errors. Up to now, it was barely
    functional because important modes weren't handled. Add another function
    (which is needed in the future anyway) and pick to missing bits from
    that function into the symbol clearing function to handle the modes
    1000Base-X and 10GBaseR too. All that is based on [1].
    
    While at it, rename the function to adhere to a common naming scheme and
    fix some minor style issues.
    
    [1] https://github.com/plappermaul/realtek-doc/blob/69d2890a2e2d7a03df6e40e2cd2c32ff5b074dcf/sources/rtk-dms1250/src/hal/phy/phy_rtl9310.c#L703
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20736
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 62 +++++++++++++++++-----
 1 file changed, 48 insertions(+), 14 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index d2268ae76d..768952b472 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2340,30 +2340,64 @@ static void rtpcs_931x_sds_disable(struct rtpcs_serdes *sds)
 		     RTL931X_SERDES_MODE_CTRL + (sds->id >> 2) * 4, 0x9f);
 }
 
-static void rtpcs_931x_sds_symerr_clear(struct rtpcs_serdes *sds,
-					phy_interface_t mode)
+__maybe_unused
+static int rtpcs_931x_sds_fiber_get_symerr(struct rtpcs_serdes *sds,
+					   phy_interface_t mode)
 {
+	int symerr, val, val2;
+
 	switch (mode) {
-	case PHY_INTERFACE_MODE_NA:
+	case PHY_INTERFACE_MODE_10GBASER:
+		symerr = rtpcs_sds_read_bits(sds, 0x5, 0x1, 7, 0);
 		break;
+	case PHY_INTERFACE_MODE_1000BASEX:
+		rtpcs_sds_write_bits(sds, 0x41, 0x18, 2, 0, 0x0);
+
+		val = rtpcs_sds_read_bits(sds, 0x41, 0x3, 15, 8);
+		val2 = rtpcs_sds_read_bits(sds, 0x41, 0x2, 15, 0);
+		symerr = (val << 16) | val2;
+		break;
+	default:
+		symerr = -EINVAL;
+	}
+
+	return symerr;
+}
+
+static void rtpcs_931x_sds_clear_symerr(struct rtpcs_serdes *sds,
+					phy_interface_t mode)
+{
+	switch (mode) {
+	case PHY_INTERFACE_MODE_SGMII:
+	case PHY_INTERFACE_MODE_HISGMII:
 	case PHY_INTERFACE_MODE_XGMII:
 		for (int i = 0; i < 4; ++i) {
-			rtpcs_sds_write_bits(sds, 0x41, 24,  2, 0, i);
-			rtpcs_sds_write_bits(sds, 0x41,  3, 15, 8, 0x0);
-			rtpcs_sds_write_bits(sds, 0x41,  2, 15, 0, 0x0);
+			rtpcs_sds_write_bits(sds, 0x41, 0x18, 2, 0, i);
+			rtpcs_sds_write_bits(sds, 0x41, 0x3, 15, 8, 0x0);
+			rtpcs_sds_write_bits(sds, 0x41, 0x2, 15, 0, 0x0);
 		}
 
 		for (int i = 0; i < 4; ++i) {
-			rtpcs_sds_write_bits(sds, 0x81, 24,  2, 0, i);
-			rtpcs_sds_write_bits(sds, 0x81,  3, 15, 8, 0x0);
-			rtpcs_sds_write_bits(sds, 0x81,  2, 15, 0, 0x0);
+			rtpcs_sds_write_bits(sds, 0x81, 0x18, 2, 0, i);
+			rtpcs_sds_write_bits(sds, 0x81, 0x3, 15, 8, 0x0);
+			rtpcs_sds_write_bits(sds, 0x81, 0x2, 15, 0, 0x0);
 		}
 
-		rtpcs_sds_write_bits(sds, 0x41, 0, 15, 0, 0x0);
-		rtpcs_sds_write_bits(sds, 0x41, 1, 15, 8, 0x0);
-		rtpcs_sds_write_bits(sds, 0x81, 0, 15, 0, 0x0);
-		rtpcs_sds_write_bits(sds, 0x81, 1, 15, 8, 0x0);
+		rtpcs_sds_write_bits(sds, 0x41, 0x0, 15, 0, 0x0);
+		rtpcs_sds_write_bits(sds, 0x41, 0x1, 15, 8, 0x0);
+		rtpcs_sds_write_bits(sds, 0x81, 0x0, 15, 0, 0x0);
+		rtpcs_sds_write_bits(sds, 0x81, 0x1, 15, 8, 0x0);
 		break;
+	case PHY_INTERFACE_MODE_1000BASEX:
+		rtpcs_sds_write_bits(sds, 0x41, 0x18, 2, 0, 0x0);
+		rtpcs_sds_write_bits(sds, 0x41, 0x3, 15, 8, 0x0);
+		rtpcs_sds_write_bits(sds, 0x41, 0x2, 15, 0, 0x0);
+		break;
+	case PHY_INTERFACE_MODE_10GBASER:
+		/* to be verified: clear on read? */
+		rtpcs_sds_read_bits(sds, 0x5, 0x1, 7, 0);
+		break;
+	case PHY_INTERFACE_MODE_NA:
 	default:
 		break;
 	}
@@ -2383,7 +2417,7 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 	u32 val;
 
 	/* clear symbol error count before changing mode */
-	rtpcs_931x_sds_symerr_clear(sds, mode);
+	rtpcs_931x_sds_clear_symerr(sds, mode);
 
 	rtpcs_931x_sds_disable(sds);
 



From lede-commits at lists.infradead.org  Mon Dec 29 08:06:27 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 11:06:27 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: merge helper into mode
 setting
In-Reply-To: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
References: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
Message-ID: <mailman.39817.1767024388.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f67d9ed9b44b1838dd2cabbc48b228be5a8ff434

commit f67d9ed9b44b1838dd2cabbc48b228be5a8ff434
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 20 20:40:12 2025 +0000

    realtek: pcs: rtl931x: merge helper into mode setting
    
    Merge the 'rtpcs_931x_sds_disable' helper into the MII mode setting and
    use that instead. The helper was essentially doing same just with a
    value for OFF state.
    
    Moreover, the name of the helper was confusing. It implied it disables
    the whole SerDes. However, this is used in Fiber mode setting and thus,
    cannot completely disable the SerDes.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20736
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c  | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 48b890114f..2c49d90531 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2384,6 +2384,9 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
 	int shift = ((sds->id & 0x3) << 3);
 
 	switch (mode) {
+	case PHY_INTERFACE_MODE_NA:
+		val = 0x1f;
+		break;
 	case PHY_INTERFACE_MODE_QSGMII:
 		val = 0x6;
 		break;
@@ -2407,12 +2410,6 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
 			  0xff << shift, val << shift);
 }
 
-static void rtpcs_931x_sds_disable(struct rtpcs_serdes *sds)
-{
-	regmap_write(sds->ctrl->map,
-		     RTL931X_SERDES_MODE_CTRL + (sds->id >> 2) * 4, 0x9f);
-}
-
 static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 					  phy_interface_t mode)
 {
@@ -2420,8 +2417,7 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 
 	/* clear symbol error count before changing mode */
 	rtpcs_931x_sds_clear_symerr(sds, mode);
-
-	rtpcs_931x_sds_disable(sds);
+	rtpcs_931x_sds_mii_mode_set(sds, PHY_INTERFACE_MODE_NA);
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_SGMII:



From lede-commits at lists.infradead.org  Mon Dec 29 08:06:31 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 11:06:31 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: streamline hardware mode
 setting
In-Reply-To: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
References: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
Message-ID: <mailman.39818.1767024389.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9efcc52a7bf61a3728ffb87f54c03ca1e8840c66

commit 9efcc52a7bf61a3728ffb87f54c03ca1e8840c66
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 20 23:34:10 2025 +0000

    realtek: pcs: rtl931x: streamline hardware mode setting
    
    The SDK and our code for finally applying the hardware mode are quite
    confusing. There are two different "places" where a mode can be set,
    in a SerDes register and in a global SerDes mode register. Neither the
    SDK nor any of the datasheet/documentation serve any explanation for
    that. The functions are just named "fiber_mode_set" and "mii_mode_set"
    which is basically as useless as it can be to understand it.
    
    Try to get rid off this confusion by naming the functions
    'sds_set_mac_mode' and 'sds_set_ip_mode' to make clear where the mode
    is set. While at it, also clarify the naming of 'config_mode' by
    renaming it to 'config_hw_mode'.
    
    The naming is based on the following assumption:
    
    > Realtek uses an SerDes IP core design (probably from another vendor)
    > in their switch. This supports a variety of modes and must be
    > configured properly for each mode. Usually, changing the mode in the
    > MAC's registers triggers a proper configuration of the SerDes IP block
    > in the background.
    
    > However, for some modes this seems to be incomplete, at least missing
    > important parts so it doesn't work on its own in the end. In this
    > case, the SerDes IP block needs to be configured manually with the
    > missing bits to make it work.
    
    There are several places in the SDK that support this assumption, both
    for RTL931X and RTL930X (as they are somewhat similar), e.g. [1].
    
    [1] https://github.com/plappermaul/realtek-doc/blob/f7f85ffc14c6e575ad94f2b427106de533b888fe/sources/rtk-dms1250/src/dal/longan/dal_longan_sds.c#L1746
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20736
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 29 +++++++++++++++-------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 21ff31371d..a28b01d59f 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2377,7 +2377,12 @@ static int rtpcs_931x_sds_power(struct rtpcs_serdes *sds, bool power_on)
 				 BIT(sds->id), en_val);
 }
 
-static int rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
+/*
+ * rtpcs_931x_sds_set_mac_mode
+ *
+ * Set the SerDes mode in the MAC's registers.
+ */
+static int rtpcs_931x_sds_set_mac_mode(struct rtpcs_serdes *sds,
 				       enum rtpcs_sds_mode hw_mode)
 {
 	u32 mode_val;
@@ -2417,14 +2422,19 @@ static int rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
 				 0xff << shift, mode_val << shift);
 }
 
-static int rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
-					 enum rtpcs_sds_mode hw_mode)
+/*
+ * rtpcs_931x_sds_set_ip_mode
+ *
+ * Set the SerDes mode in the SerDes IP block's registers.
+ */
+static int rtpcs_931x_sds_set_ip_mode(struct rtpcs_serdes *sds,
+				      enum rtpcs_sds_mode hw_mode)
 {
 	u32 mode_val;
 
 	/* clear symbol error count before changing mode */
 	rtpcs_931x_sds_clear_symerr(sds, hw_mode);
-	rtpcs_931x_sds_mii_mode_set(sds, RTPCS_SDS_MODE_OFF);
+	rtpcs_931x_sds_set_mac_mode(sds, RTPCS_SDS_MODE_OFF);
 
 	switch (hw_mode) {
 	case RTPCS_SDS_MODE_OFF:
@@ -2735,8 +2745,9 @@ static int rtpcs_931x_sds_config_fiber_1g(struct rtpcs_serdes *sds)
 	return 0;
 }
 
-static int rtpcs_931x_sds_config_mode(struct rtpcs_serdes *sds,
-				      enum rtpcs_sds_mode hw_mode, int chiptype)
+static int rtpcs_931x_sds_config_hw_mode(struct rtpcs_serdes *sds,
+					 enum rtpcs_sds_mode hw_mode,
+					 int chiptype)
 {
 	struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
 
@@ -2912,7 +2923,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 		return -ENOTSUPP;
 	}
 
-	ret = rtpcs_931x_sds_config_mode(sds, hw_mode, chiptype);
+	ret = rtpcs_931x_sds_config_hw_mode(sds, hw_mode, chiptype);
 	if (ret < 0)
 		return ret;
 
@@ -2945,9 +2956,9 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 	    mode == PHY_INTERFACE_MODE_SGMII ||
 	    mode == PHY_INTERFACE_MODE_USXGMII) {
 		if (mode == PHY_INTERFACE_MODE_XGMII)
-			ret = rtpcs_931x_sds_mii_mode_set(sds, hw_mode);
+			ret = rtpcs_931x_sds_set_mac_mode(sds, hw_mode);
 		else
-			ret = rtpcs_931x_sds_fiber_mode_set(sds, hw_mode);
+			ret = rtpcs_931x_sds_set_ip_mode(sds, hw_mode);
 	}
 
 	if (ret < 0)



From lede-commits at lists.infradead.org  Mon Dec 29 08:06:25 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 11:06:25 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: reorder functions
In-Reply-To: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
References: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
Message-ID: <mailman.39819.1767024389.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/90cddeb75e69b06d5930a13a8a1254fcf683fe2f

commit 90cddeb75e69b06d5930a13a8a1254fcf683fe2f
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 20 18:57:35 2025 +0000

    realtek: pcs: rtl931x: reorder functions
    
    Bring the RTL931X functions into a proper order for two purposes:
    - be able to reuse code
    - have blocks of logically connected functions
    
    This just moves code, no functional changes.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20736
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 178 ++++++++++-----------
 1 file changed, 89 insertions(+), 89 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 768952b472..bf2110ef53 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2305,41 +2305,6 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 
 /* RTL931X */
 
-static int rtpcs_931x_sds_power(struct rtpcs_serdes *sds, bool power_on)
-{
-	u32 en_val = power_on ? 0 : BIT(sds->id);
-
-	return regmap_write_bits(sds->ctrl->map,
-				 RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR,
-				 BIT(sds->id), en_val);
-}
-
-static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
-{
-	struct rtpcs_ctrl *ctrl = sds->ctrl;
-	u32 sds_id = sds->id;
-	u32 v, o_mode;
-	int shift = ((sds_id & 0x3) << 3);
-
-	/* TODO: We need to lock this! */
-
-	rtpcs_931x_sds_power(sds, false);
-
-	regmap_read(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), &o_mode);
-	v = BIT(7) | 0x1F;
-	regmap_write_bits(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2),
-			  0xff << shift, v << shift);
-	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), o_mode);
-
-	rtpcs_931x_sds_power(sds, true);
-}
-
-static void rtpcs_931x_sds_disable(struct rtpcs_serdes *sds)
-{
-	regmap_write(sds->ctrl->map,
-		     RTL931X_SERDES_MODE_CTRL + (sds->id >> 2) * 4, 0x9f);
-}
-
 __maybe_unused
 static int rtpcs_931x_sds_fiber_get_symerr(struct rtpcs_serdes *sds,
 					   phy_interface_t mode)
@@ -2403,12 +2368,48 @@ static void rtpcs_931x_sds_clear_symerr(struct rtpcs_serdes *sds,
 	}
 }
 
-__always_unused
-static void rtpcs_931x_sds_fiber_disable(struct rtpcs_serdes *sds)
+static int rtpcs_931x_sds_power(struct rtpcs_serdes *sds, bool power_on)
 {
-	u32 v = 0x3F;
+	u32 en_val = power_on ? 0 : BIT(sds->id);
 
-	rtpcs_sds_write_bits(sds, 0x1F, 0x9, 11, 6, v);
+	return regmap_write_bits(sds->ctrl->map,
+				 RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR,
+				 BIT(sds->id), en_val);
+}
+
+static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
+					phy_interface_t mode)
+{
+	u32 val;
+
+	switch (mode) {
+	case PHY_INTERFACE_MODE_QSGMII:
+		val = 0x6;
+		break;
+	case PHY_INTERFACE_MODE_XGMII:
+		val = 0x10; /* serdes mode XSGMII */
+		break;
+	case PHY_INTERFACE_MODE_USXGMII:
+	case PHY_INTERFACE_MODE_2500BASEX:
+		val = 0xD;
+		break;
+	case PHY_INTERFACE_MODE_SGMII:
+		val = 0x2;
+		break;
+	default:
+		return;
+	}
+
+	val |= (1 << 7);
+
+	regmap_write(sds->ctrl->map,
+		     RTL931X_SERDES_MODE_CTRL + 4 * (sds->id >> 2), val);
+}
+
+static void rtpcs_931x_sds_disable(struct rtpcs_serdes *sds)
+{
+	regmap_write(sds->ctrl->map,
+		     RTL931X_SERDES_MODE_CTRL + (sds->id >> 2) * 4, 0x9f);
 }
 
 static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
@@ -2435,9 +2436,9 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 	case PHY_INTERFACE_MODE_10GKR:
 		val = 0x35;
 		break;
-/*	case MII_10GR1000BX_AUTO:
-		val = 0x39;
-		break; */
+/*      case MII_10GR1000BX_AUTO:
+                val = 0x39;
+                break; */
 
 	case PHY_INTERFACE_MODE_USXGMII:
 		val = 0x1B;
@@ -2450,6 +2451,52 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 	rtpcs_sds_write_bits(sds, 0x1F, 0x9, 11, 6, val);
 }
 
+static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
+{
+	struct rtpcs_ctrl *ctrl = sds->ctrl;
+	u32 sds_id = sds->id;
+	u32 v, o_mode;
+	int shift = ((sds_id & 0x3) << 3);
+
+	/* TODO: We need to lock this! */
+
+	rtpcs_931x_sds_power(sds, false);
+
+	regmap_read(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), &o_mode);
+	v = BIT(7) | 0x1F;
+	regmap_write_bits(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2),
+			  0xff << shift, v << shift);
+	regmap_write(ctrl->map, RTL931X_SERDES_MODE_CTRL + 4 * (sds_id >> 2), o_mode);
+
+	rtpcs_931x_sds_power(sds, true);
+}
+
+static void rtpcs_931x_sds_rx_reset(struct rtpcs_serdes *sds)
+{
+	if (sds->id < 2)
+		return;
+
+	rtpcs_sds_write(sds, 0x2e, 0x12, 0x2740);
+	rtpcs_sds_write(sds, 0x2f, 0x0, 0x0);
+	rtpcs_sds_write(sds, 0x2f, 0x2, 0x2010);
+	rtpcs_sds_write(sds, 0x20, 0x0, 0xc10);
+
+	rtpcs_sds_write(sds, 0x2e, 0x12, 0x27c0);
+	rtpcs_sds_write(sds, 0x2f, 0x0, 0xc000);
+	rtpcs_sds_write(sds, 0x2f, 0x2, 0x6010);
+	rtpcs_sds_write(sds, 0x20, 0x0, 0xc30);
+
+	mdelay(50);
+}
+
+__always_unused
+static void rtpcs_931x_sds_fiber_disable(struct rtpcs_serdes *sds)
+{
+	u32 v = 0x3F;
+
+	rtpcs_sds_write_bits(sds, 0x1F, 0x9, 11, 6, v);
+}
+
 static int rtpcs_931x_sds_cmu_page_get(phy_interface_t mode)
 {
 	switch (mode) {
@@ -2559,53 +2606,6 @@ static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_serdes *sds,
 	pr_info("%s CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(sds, 0x28, 0x7));
 }
 
-static void rtpcs_931x_sds_rx_reset(struct rtpcs_serdes *sds)
-{
-	if (sds->id < 2)
-		return;
-
-	rtpcs_sds_write(sds, 0x2e, 0x12, 0x2740);
-	rtpcs_sds_write(sds, 0x2f, 0x0, 0x0);
-	rtpcs_sds_write(sds, 0x2f, 0x2, 0x2010);
-	rtpcs_sds_write(sds, 0x20, 0x0, 0xc10);
-
-	rtpcs_sds_write(sds, 0x2e, 0x12, 0x27c0);
-	rtpcs_sds_write(sds, 0x2f, 0x0, 0xc000);
-	rtpcs_sds_write(sds, 0x2f, 0x2, 0x6010);
-	rtpcs_sds_write(sds, 0x20, 0x0, 0xc30);
-
-	mdelay(50);
-}
-
-static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
-					phy_interface_t mode)
-{
-	u32 val;
-
-	switch (mode) {
-	case PHY_INTERFACE_MODE_QSGMII:
-		val = 0x6;
-		break;
-	case PHY_INTERFACE_MODE_XGMII:
-		val = 0x10; /* serdes mode XSGMII */
-		break;
-	case PHY_INTERFACE_MODE_USXGMII:
-	case PHY_INTERFACE_MODE_2500BASEX:
-		val = 0xD;
-		break;
-	case PHY_INTERFACE_MODE_SGMII:
-		val = 0x2;
-		break;
-	default:
-		return;
-	}
-
-	val |= (1 << 7);
-
-	regmap_write(sds->ctrl->map,
-		     RTL931X_SERDES_MODE_CTRL + 4 * (sds->id >> 2), val);
-}
-
 static int rtpcs_931x_sds_cmu_band_set(struct rtpcs_serdes *sds,
 				       bool enable, u32 band,
 				       phy_interface_t mode)



From lede-commits at lists.infradead.org  Mon Dec 29 08:06:26 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 11:06:26 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: fix MII mode setting
In-Reply-To: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
References: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
Message-ID: <mailman.39822.1767024389.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6614fcb95ef71c666cf3c169754f39c14a03921b

commit 6614fcb95ef71c666cf3c169754f39c14a03921b
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 20 21:42:34 2025 +0000

    realtek: pcs: rtl931x: fix MII mode setting
    
    The function 'rtpcs_931x_sds_mii_mode_set' does not correctly write the
    register. It just write a plain value at the determined register
    address. While this works for SerDes with (id mod 4 == 0), it doesn't
    for the other SerDes.
    
    Fix that by using a corresponding shift and writing only some bits
    instead of the whole register.
    
    While at it, drop an unneeded blank line, add comment to explain a bit
    that is set and use the BIT(..) helper for that instead of manual shift.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20736
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index bf2110ef53..48b890114f 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2381,6 +2381,7 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
 					phy_interface_t mode)
 {
 	u32 val;
+	int shift = ((sds->id & 0x3) << 3);
 
 	switch (mode) {
 	case PHY_INTERFACE_MODE_QSGMII:
@@ -2400,10 +2401,10 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
 		return;
 	}
 
-	val |= (1 << 7);
-
-	regmap_write(sds->ctrl->map,
-		     RTL931X_SERDES_MODE_CTRL + 4 * (sds->id >> 2), val);
+	val |= BIT(7); /* force mode bit */
+	regmap_write_bits(sds->ctrl->map,
+			  RTL931X_SERDES_MODE_CTRL + 4 * (sds->id >> 2),
+			  0xff << shift, val << shift);
 }
 
 static void rtpcs_931x_sds_disable(struct rtpcs_serdes *sds)



From lede-commits at lists.infradead.org  Mon Dec 29 08:06:28 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 11:06:28 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: use hardware mode for mode
 setting
In-Reply-To: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
References: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
Message-ID: <mailman.39823.1767024389.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/65dc1ecf49fbb426d2875263a3ac50eb44d3e172

commit 65dc1ecf49fbb426d2875263a3ac50eb44d3e172
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 20 21:01:20 2025 +0000

    realtek: pcs: rtl931x: use hardware mode for mode setting
    
    Use the hardware mode instead of PHY_INTERFACE_MODE_* mode for mode
    setting. Adjust all affected functions and switch cases accordingly.
    
    In MII mode setting, drop the case for 2500Base-X as this is a mistake.
    In the SDK reference code, this doesn't exist [1].
    
    [1] https://github.com/plappermaul/realtek-doc/blob/69d2890a2e2d7a03df6e40e2cd2c32ff5b074dcf/sources/rtk-dms1250/src/hal/phy/phy_rtl9310.c#L817
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20736
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 72 ++++++++++++----------
 1 file changed, 40 insertions(+), 32 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 2c49d90531..91bcc6f392 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2307,15 +2307,15 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 
 __maybe_unused
 static int rtpcs_931x_sds_fiber_get_symerr(struct rtpcs_serdes *sds,
-					   phy_interface_t mode)
+					   enum rtpcs_sds_mode hw_mode)
 {
 	int symerr, val, val2;
 
-	switch (mode) {
-	case PHY_INTERFACE_MODE_10GBASER:
+	switch (hw_mode) {
+	case RTPCS_SDS_MODE_10GBASER:
 		symerr = rtpcs_sds_read_bits(sds, 0x5, 0x1, 7, 0);
 		break;
-	case PHY_INTERFACE_MODE_1000BASEX:
+	case RTPCS_SDS_MODE_1000BASEX:
 		rtpcs_sds_write_bits(sds, 0x41, 0x18, 2, 0, 0x0);
 
 		val = rtpcs_sds_read_bits(sds, 0x41, 0x3, 15, 8);
@@ -2330,12 +2330,12 @@ static int rtpcs_931x_sds_fiber_get_symerr(struct rtpcs_serdes *sds,
 }
 
 static void rtpcs_931x_sds_clear_symerr(struct rtpcs_serdes *sds,
-					phy_interface_t mode)
+					enum rtpcs_sds_mode hw_mode)
 {
-	switch (mode) {
-	case PHY_INTERFACE_MODE_SGMII:
-	case PHY_INTERFACE_MODE_HISGMII:
-	case PHY_INTERFACE_MODE_XGMII:
+	switch (hw_mode) {
+	case RTPCS_SDS_MODE_SGMII:
+	case RTPCS_SDS_MODE_HISGMII:
+	case RTPCS_SDS_MODE_XSGMII:
 		for (int i = 0; i < 4; ++i) {
 			rtpcs_sds_write_bits(sds, 0x41, 0x18, 2, 0, i);
 			rtpcs_sds_write_bits(sds, 0x41, 0x3, 15, 8, 0x0);
@@ -2353,16 +2353,16 @@ static void rtpcs_931x_sds_clear_symerr(struct rtpcs_serdes *sds,
 		rtpcs_sds_write_bits(sds, 0x81, 0x0, 15, 0, 0x0);
 		rtpcs_sds_write_bits(sds, 0x81, 0x1, 15, 8, 0x0);
 		break;
-	case PHY_INTERFACE_MODE_1000BASEX:
+	case RTPCS_SDS_MODE_1000BASEX:
 		rtpcs_sds_write_bits(sds, 0x41, 0x18, 2, 0, 0x0);
 		rtpcs_sds_write_bits(sds, 0x41, 0x3, 15, 8, 0x0);
 		rtpcs_sds_write_bits(sds, 0x41, 0x2, 15, 0, 0x0);
 		break;
-	case PHY_INTERFACE_MODE_10GBASER:
+	case RTPCS_SDS_MODE_10GBASER:
 		/* to be verified: clear on read? */
 		rtpcs_sds_read_bits(sds, 0x5, 0x1, 7, 0);
 		break;
-	case PHY_INTERFACE_MODE_NA:
+	case RTPCS_SDS_MODE_OFF:
 	default:
 		break;
 	}
@@ -2378,26 +2378,30 @@ static int rtpcs_931x_sds_power(struct rtpcs_serdes *sds, bool power_on)
 }
 
 static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
-					phy_interface_t mode)
+					enum rtpcs_sds_mode hw_mode)
 {
 	u32 val;
 	int shift = ((sds->id & 0x3) << 3);
 
-	switch (mode) {
-	case PHY_INTERFACE_MODE_NA:
+	switch (hw_mode) {
+	case RTPCS_SDS_MODE_OFF:
 		val = 0x1f;
 		break;
-	case PHY_INTERFACE_MODE_QSGMII:
+	case RTPCS_SDS_MODE_QSGMII:
 		val = 0x6;
 		break;
-	case PHY_INTERFACE_MODE_XGMII:
-		val = 0x10; /* serdes mode XSGMII */
+	case RTPCS_SDS_MODE_XSGMII:
+		val = 0x10;
 		break;
-	case PHY_INTERFACE_MODE_USXGMII:
-	case PHY_INTERFACE_MODE_2500BASEX:
+	case RTPCS_SDS_MODE_USXGMII_10GSXGMII:
+	case RTPCS_SDS_MODE_USXGMII_10GDXGMII:
+	case RTPCS_SDS_MODE_USXGMII_10GQXGMII:
+	case RTPCS_SDS_MODE_USXGMII_5GSXGMII:
+	case RTPCS_SDS_MODE_USXGMII_5GDXGMII:
+	case RTPCS_SDS_MODE_USXGMII_2_5GSXGMII:
 		val = 0xD;
 		break;
-	case PHY_INTERFACE_MODE_SGMII:
+	case RTPCS_SDS_MODE_SGMII:
 		val = 0x2;
 		break;
 	default:
@@ -2411,33 +2415,37 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
 }
 
 static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
-					  phy_interface_t mode)
+					  enum rtpcs_sds_mode hw_mode)
 {
 	u32 val;
 
 	/* clear symbol error count before changing mode */
-	rtpcs_931x_sds_clear_symerr(sds, mode);
-	rtpcs_931x_sds_mii_mode_set(sds, PHY_INTERFACE_MODE_NA);
+	rtpcs_931x_sds_clear_symerr(sds, hw_mode);
+	rtpcs_931x_sds_mii_mode_set(sds, RTPCS_SDS_MODE_OFF);
 
-	switch (mode) {
-	case PHY_INTERFACE_MODE_SGMII:
+	switch (hw_mode) {
+	case RTPCS_SDS_MODE_SGMII:
 		val = 0x5;
 		break;
 
-	case PHY_INTERFACE_MODE_1000BASEX:
+	case RTPCS_SDS_MODE_1000BASEX:
 		/* serdes mode FIBER1G */
 		val = 0x9;
 		break;
 
-	case PHY_INTERFACE_MODE_10GBASER:
-	case PHY_INTERFACE_MODE_10GKR:
+	case RTPCS_SDS_MODE_10GBASER:
 		val = 0x35;
 		break;
 /*      case MII_10GR1000BX_AUTO:
                 val = 0x39;
                 break; */
 
-	case PHY_INTERFACE_MODE_USXGMII:
+	case RTPCS_SDS_MODE_USXGMII_10GSXGMII:
+	case RTPCS_SDS_MODE_USXGMII_10GDXGMII:
+	case RTPCS_SDS_MODE_USXGMII_10GQXGMII:
+	case RTPCS_SDS_MODE_USXGMII_5GSXGMII:
+	case RTPCS_SDS_MODE_USXGMII_5GDXGMII:
+	case RTPCS_SDS_MODE_USXGMII_2_5GSXGMII:
 		val = 0x1B;
 		break;
 	default:
@@ -2935,9 +2943,9 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 	    mode == PHY_INTERFACE_MODE_SGMII ||
 	    mode == PHY_INTERFACE_MODE_USXGMII) {
 		if (mode == PHY_INTERFACE_MODE_XGMII)
-			rtpcs_931x_sds_mii_mode_set(sds, mode);
+			rtpcs_931x_sds_mii_mode_set(sds, hw_mode);
 		else
-			rtpcs_931x_sds_fiber_mode_set(sds, mode);
+			rtpcs_931x_sds_fiber_mode_set(sds, hw_mode);
 	}
 	sds->hw_mode = hw_mode;
 



From lede-commits at lists.infradead.org  Mon Dec 29 08:06:30 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 11:06:30 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: improve mode setting
 functions
In-Reply-To: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
References: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
Message-ID: <mailman.39824.1767024389.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d5a4387ac5613c8e235c0197255adff48b0111e7

commit d5a4387ac5613c8e235c0197255adff48b0111e7
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 20 22:18:23 2025 +0000

    realtek: pcs: rtl931x: improve mode setting functions
    
    Improve the current mode setting functions to address a few issues:
    - add missing mode from SDK reference (instead of using the
      corresponding value as a default value)
    - use and return error values
    - give internal variable a more meaningful name
    - consistently use lowercase letters in hex values
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20736
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 64 +++++++++++++---------
 1 file changed, 37 insertions(+), 27 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 2b737bc35b..21ff31371d 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2377,21 +2377,24 @@ static int rtpcs_931x_sds_power(struct rtpcs_serdes *sds, bool power_on)
 				 BIT(sds->id), en_val);
 }
 
-static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
-					enum rtpcs_sds_mode hw_mode)
+static int rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
+				       enum rtpcs_sds_mode hw_mode)
 {
-	u32 val;
+	u32 mode_val;
 	int shift = ((sds->id & 0x3) << 3);
 
 	switch (hw_mode) {
 	case RTPCS_SDS_MODE_OFF:
-		val = 0x1f;
+		mode_val = 0x1f;
 		break;
 	case RTPCS_SDS_MODE_QSGMII:
-		val = 0x6;
+		mode_val = 0x6;
+		break;
+	case RTPCS_SDS_MODE_HISGMII:
+		mode_val = 0x12;
 		break;
 	case RTPCS_SDS_MODE_XSGMII:
-		val = 0x10;
+		mode_val = 0x10;
 		break;
 	case RTPCS_SDS_MODE_USXGMII_10GSXGMII:
 	case RTPCS_SDS_MODE_USXGMII_10GDXGMII:
@@ -2399,25 +2402,25 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds,
 	case RTPCS_SDS_MODE_USXGMII_5GSXGMII:
 	case RTPCS_SDS_MODE_USXGMII_5GDXGMII:
 	case RTPCS_SDS_MODE_USXGMII_2_5GSXGMII:
-		val = 0xD;
+		mode_val = 0xd;
 		break;
 	case RTPCS_SDS_MODE_SGMII:
-		val = 0x2;
+		mode_val = 0x2;
 		break;
 	default:
-		return;
+		return -EINVAL;
 	}
 
-	val |= BIT(7); /* force mode bit */
-	regmap_write_bits(sds->ctrl->map,
-			  RTL931X_SERDES_MODE_CTRL + 4 * (sds->id >> 2),
-			  0xff << shift, val << shift);
+	mode_val |= BIT(7); /* force mode bit */
+	return regmap_write_bits(sds->ctrl->map,
+				 RTL931X_SERDES_MODE_CTRL + 4 * (sds->id >> 2),
+				 0xff << shift, mode_val << shift);
 }
 
-static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
-					  enum rtpcs_sds_mode hw_mode)
+static int rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
+					 enum rtpcs_sds_mode hw_mode)
 {
-	u32 val;
+	u32 mode_val;
 
 	/* clear symbol error count before changing mode */
 	rtpcs_931x_sds_clear_symerr(sds, hw_mode);
@@ -2425,23 +2428,23 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 
 	switch (hw_mode) {
 	case RTPCS_SDS_MODE_OFF:
-		val = 0x3f;
+		mode_val = 0x3f;
 		break;
 
 	case RTPCS_SDS_MODE_SGMII:
-		val = 0x5;
+		mode_val = 0x5;
 		break;
 
 	case RTPCS_SDS_MODE_1000BASEX:
 		/* serdes mode FIBER1G */
-		val = 0x9;
+		mode_val = 0x9;
 		break;
 
 	case RTPCS_SDS_MODE_10GBASER:
-		val = 0x35;
+		mode_val = 0x35;
 		break;
 /*      case MII_10GR1000BX_AUTO:
-                val = 0x39;
+                mode_val = 0x39;
                 break; */
 
 	case RTPCS_SDS_MODE_USXGMII_10GSXGMII:
@@ -2450,14 +2453,17 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 	case RTPCS_SDS_MODE_USXGMII_5GSXGMII:
 	case RTPCS_SDS_MODE_USXGMII_5GDXGMII:
 	case RTPCS_SDS_MODE_USXGMII_2_5GSXGMII:
-		val = 0x1B;
+		mode_val = 0x1b;
+		break;
+	case RTPCS_SDS_MODE_HISGMII:
+		mode_val = 0x25;
 		break;
 	default:
-		val = 0x25;
+		return -ENOTSUPP;
 	}
 
-	pr_info("%s writing analog SerDes Mode value %02x\n", __func__, val);
-	rtpcs_sds_write_bits(sds, 0x1F, 0x9, 11, 6, val);
+	pr_info("%s writing analog SerDes Mode value %02x\n", __func__, mode_val);
+	return rtpcs_sds_write_bits(sds, 0x1f, 0x9, 11, 6, mode_val);
 }
 
 static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
@@ -2939,10 +2945,14 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 	    mode == PHY_INTERFACE_MODE_SGMII ||
 	    mode == PHY_INTERFACE_MODE_USXGMII) {
 		if (mode == PHY_INTERFACE_MODE_XGMII)
-			rtpcs_931x_sds_mii_mode_set(sds, hw_mode);
+			ret = rtpcs_931x_sds_mii_mode_set(sds, hw_mode);
 		else
-			rtpcs_931x_sds_fiber_mode_set(sds, hw_mode);
+			ret = rtpcs_931x_sds_fiber_mode_set(sds, hw_mode);
 	}
+
+	if (ret < 0)
+		return ret;
+
 	sds->hw_mode = hw_mode;
 
 	return 0;



From lede-commits at lists.infradead.org  Mon Dec 29 08:06:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 11:06:29 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: merge and drop unused
 helper
In-Reply-To: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
References: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
Message-ID: <mailman.39825.1767024392.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/75493a812fd5dbbd1839ecec3543cdc9ee7c3cca

commit 75493a812fd5dbbd1839ecec3543cdc9ee7c3cca
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 20 21:09:52 2025 +0000

    realtek: pcs: rtl931x: merge and drop unused helper
    
    Merge the unused helper 'rtpcs_931x_sds_fiber_disable' into Fiber mode
    setting, and drop the helper itself. As with the MII helper in a
    previous commit, functionality is basically the same just with a value
    for OFF mode. If functionality is required later, Fiber mode setting can
    be used with the OFF mode instead of carrying the unused helper until
    it's used.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20736
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c  | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 91bcc6f392..2b737bc35b 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2424,6 +2424,10 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds,
 	rtpcs_931x_sds_mii_mode_set(sds, RTPCS_SDS_MODE_OFF);
 
 	switch (hw_mode) {
+	case RTPCS_SDS_MODE_OFF:
+		val = 0x3f;
+		break;
+
 	case RTPCS_SDS_MODE_SGMII:
 		val = 0x5;
 		break;
@@ -2494,14 +2498,6 @@ static void rtpcs_931x_sds_rx_reset(struct rtpcs_serdes *sds)
 	mdelay(50);
 }
 
-__always_unused
-static void rtpcs_931x_sds_fiber_disable(struct rtpcs_serdes *sds)
-{
-	u32 v = 0x3F;
-
-	rtpcs_sds_write_bits(sds, 0x1F, 0x9, 11, 6, v);
-}
-
 static int rtpcs_931x_sds_cmu_page_get(phy_interface_t mode)
 {
 	switch (mode) {



From lede-commits at lists.infradead.org  Mon Dec 29 08:06:32 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 11:06:32 -0500
Subject: [openwrt/openwrt]  realtek: pcs: rtl931x: fix SerDes mode application
In-Reply-To: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
References: <176702438405.3261370.6105904906500254752@git-01.infra.openwrt.org>
Message-ID: <mailman.39826.1767024395.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a0805af66c6aa6106ff04ffdd6b190623fd80a7e

commit a0805af66c6aa6106ff04ffdd6b190623fd80a7e
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 20 23:53:20 2025 +0000

    realtek: pcs: rtl931x: fix SerDes mode application
    
    The SerDes mode setting at the end of rtpcs_931x_setup_serdes is
    currently broken although it is mostly similar to what the SDK does [1].
    It prevents several modes from being set, especially fiber modes. This
    seems to be one (if not the only) issue for currently missing SFP
    support.
    
    Add a small helper function which takes cares of setting the mode, to
    keep the still valid different procedure when using XSGMII mode. Only
    this helper is called in rtpcs_931x_setup_serdes to keep it clean there.
    
    As a functional change, call mode application in every case, not just
    for SGMII, QSGMII and USXGMII. We can assume the SDK is misleading in
    this case, either accidentially or on purpose. This makes SFP modules
    work in theory. In practice, there still seem to be device-specific
    issues which need to be fixed later. These issues may include no link
    detection or link flapping.
    
    [1] https://github.com/plappermaul/realtek-doc/blob/f7f85ffc14c6e575ad94f2b427106de533b888fe/sources/rtk-dms1250/src/dal/mango/dal_mango_construct.c#L2266
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20736
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c        | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index a28b01d59f..e00e19b1f3 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -2476,6 +2476,15 @@ static int rtpcs_931x_sds_set_ip_mode(struct rtpcs_serdes *sds,
 	return rtpcs_sds_write_bits(sds, 0x1f, 0x9, 11, 6, mode_val);
 }
 
+static int rtpcs_931x_sds_set_mode(struct rtpcs_serdes *sds,
+				   enum rtpcs_sds_mode hw_mode)
+{
+	if (hw_mode == RTPCS_SDS_MODE_XSGMII)
+		return rtpcs_931x_sds_set_mac_mode(sds, hw_mode);
+	else
+		return rtpcs_931x_sds_set_ip_mode(sds, hw_mode);
+}
+
 static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
 {
 	struct rtpcs_ctrl *ctrl = sds->ctrl;
@@ -2951,16 +2960,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
 
 	rtpcs_931x_sds_power(sds, true);
 
-	if (mode == PHY_INTERFACE_MODE_XGMII ||
-	    mode == PHY_INTERFACE_MODE_QSGMII ||
-	    mode == PHY_INTERFACE_MODE_SGMII ||
-	    mode == PHY_INTERFACE_MODE_USXGMII) {
-		if (mode == PHY_INTERFACE_MODE_XGMII)
-			ret = rtpcs_931x_sds_set_mac_mode(sds, hw_mode);
-		else
-			ret = rtpcs_931x_sds_set_ip_mode(sds, hw_mode);
-	}
-
+	ret = rtpcs_931x_sds_set_mode(sds, hw_mode);
 	if (ret < 0)
 		return ret;
 



From lede-commits at lists.infradead.org  Mon Dec 29 10:41:28 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 13:41:28 -0500
Subject: [openwrt/openwrt]  ipq40xx: add support for Cisco Meraki MR20
In-Reply-To: <176703368723.3614726.12913296056704700004@git-01.infra.openwrt.org>
References: <176703368723.3614726.12913296056704700004@git-01.infra.openwrt.org>
Message-ID: <mailman.39849.1767033698.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5578eb69c2eb279fee6d9dc47a6d5d328bc33acd

commit 5578eb69c2eb279fee6d9dc47a6d5d328bc33acd
Author: Hal Martin <hal.martin at gmail.com>
AuthorDate: Sun Dec 28 14:43:17 2025 +0100

    ipq40xx: add support for Cisco Meraki MR20
    
    This commit adds support for the Cisco Meraki MR20/Go GR10.
    
    The Meraki MR20 is a Cisco 802.11ac/WiFi 5 AP with 1 Ethernet port.
    It can be powered by a 12V DC barrel jack (5.5x2.5mm, center positive)
    or via 802.3af POE.
    
    The Meraki Go GR10 (codename: Maggot) is identical to the MR20
    (codename: Grub), so this document will refer to both devices as the MR20.
    
    MR20 hardware info:
    * CPU: Qualcomm IPQ4029
    * RAM: 256MB DDR3
    * Storage: 128 MB (MX30LF1G18AC)
    * Networking: 1 Gigabit Ethernet
    * WiFi: QCA4019 802.11b/g/n/ac
    * Serial: Internal header (J10, 2.54mm, unpopulated)
    
    This device ships with secure boot, and cannot be flashed without
    external programmers (TSOP48 NAND and I2C EEEPROM)!
    
    Disassembly:
    
    Remove the four rubber feet on the rear of the AP and the four
    Torx T8 screws under the feet.
    
    Using a guitar pick or similar plastic tool, insert it on the side
    along the seam around the edge. Push in gently while gently lifting
    the front of the housing to release the plastic retention clips.
    
    There are 15 clips in total.
    
    Once you have removed the plastic front (shown above already removed
    so you know where the clips are), remove the 4 Philips screws holding
    down the two metal WiFi antennas.
    
    Lift the PCB gently while pushing the Ethernet port into the housing
    to release it. The PCB should come free from the metal heat spreader.
    
    The TSOP48 NAND flash (U9, Macronix/MXIC MX30LF1G18AC) is located on
    the opposite side of the PCB.
    
    To flash, you need to desolder the TSOP48 or use a 360 clip.
    
    You also need to reprogram the I2C EEPROM (U20, Atmel 24c64).
    
    Installation:
    
    The dumps to flash can be found in this repository:
    https://github.com/halmartin/meraki-openwrt-docs/tree/main/mr20_gr10
    
    The device has the following flash layout (offsets with OOB data):
    ```
    0x000000000000-0x000000100000 : "sbl1"
    0x000000100000-0x000000200000 : "mibib"
    0x000000200000-0x000000300000 : "bootconfig"
    0x000000300000-0x000000400000 : "qsee"
    0x000000400000-0x000000500000 : "qsee_alt"
    0x000000500000-0x000000580000 : "cdt"
    0x000000580000-0x000000600000 : "cdt_alt"
    0x000000600000-0x000000680000 : "ddrparams"
    0x000000700000-0x000000900000 : "u-boot"
    0x000000900000-0x000000b00000 : "u-boot-backup"
    0x000000b00000-0x000000b80000 : "ART"
    0x000000c00000-0x000007c00000 : "ubi"
    ```
    
    * Dump your original NAND (if using nanddump, include OOB data).
    
    * Decompress `u-boot.bin.gz` dump from the GitHub repository above (dump
    contains OOB data) and overwrite the `u-boot` portion of NAND from
    `0x738000`-`0x948000` (length `0x210000`). Offsets here include OOB data.
    
    * Decompress `ubi.bin.gz` dump from the GitHub repository above (dump
    contains OOB data) and overwrite the `ubi` portion of NAND from
    `0xc60000`-`0x8400000` (length `0x77a0000`). Offsets here include OOB data.
    
    * Dump your original EEPROM. Change the byte at offset `0x49` to `0x1e`
    (originally `0x2c` or `0x25`). Remember to re-write the EEPROM with the
    modified data.
        * This can be done on Linux via the following command:
        `printf "\x1e" | dd of=/tmp/eeprom.bin bs=1 seek=$((0x49)) conv=notrunc`
    
    **Note**: the device will not boot if you modify the board major number and
    have not yet overwritten the `ubi` and `u-boot` regions of NAND.
    
    * Resolder the NAND after overwriting the `u-boot` and `ubi` regions.
    
    OpenWrt Installation:
    
    * After flashing NAND and EEPROM with external programmers. Plug in an
    Ethernet cable and power up the device.
    
    * The new U-Boot build uses the space character `" "` (without quotes) to
    interrupt boot.
    
    * Interrupt U-Boot and `tftpboot` the OpenWrt initramfs image from your
    tftp server
    ```
    dhcp
    setenv serverip <your_tftp>
    tftpboot openwrt-ipq40xx-generic-meraki_mr20-initramfs-uImage.itb
    ```
    
    * Once booted into the OpenWrt initramfs, created the `ART` ubivol with
    the WiFi radio calibration from the mtd partition:
    ```
    cat /dev/mtd10 > /tmp/ART.bin
    ubiupdatevol /dev/ubi0_1 /tmp/ART.bin
    ```
    
    * `scp` the `sysupgrade` image to
    the device and run the normal `sysupgrade` procedure:
    ```
    scp -O openwrt-ipq40xx-generic-meraki_mr20-squashfs-sysupgrade.bin root at 192.168.1.1:/tmp/
    ssh root at 192.168.1.1 "sysupgrade -n /tmp/openwrt-ipq40xx-generic-meraki_mr20-squashfs-sysupgrade.bin"
    ```
    
    * OpenWrt should now be installed on the device.
    
    Signed-off-by: Hal Martin <hal.martin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20646
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/firmware/ipq-wifi/Makefile                 |   2 +
 .../ipq40xx/base-files/etc/board.d/02_network      |   1 +
 .../ipq40xx/base-files/lib/upgrade/platform.sh     |   1 +
 .../dts/qcom/qcom-ipq4029-meraki-underdog.dtsi     | 101 +++++++++++++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4029-mr20.dts   |  59 ++++++++++++
 target/linux/ipq40xx/image/generic.mk              |   8 ++
 6 files changed, 172 insertions(+)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index da6f29e29e..0d39cea2a5 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -60,6 +60,7 @@ ALLWIFIBOARDS:= \
 	linksys_spnmx56 \
 	linksys_whw03 \
 	meraki_mr30h \
+	meraki_underdog \
 	meraki_z3 \
 	netgear_lbr20 \
 	netgear_rax120v2 \
@@ -241,6 +242,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500))
 $(eval $(call generate-ipq-wifi-package,linksys_spnmx56,Linksys SPNMX56))
 $(eval $(call generate-ipq-wifi-package,linksys_whw03,Linksys WHW03))
 $(eval $(call generate-ipq-wifi-package,meraki_mr30h,Meraki MR30H))
+$(eval $(call generate-ipq-wifi-package,meraki_underdog,Meraki underdog))
 $(eval $(call generate-ipq-wifi-package,meraki_z3,Meraki Z3))
 $(eval $(call generate-ipq-wifi-package,netgear_lbr20,Netgear LBR20))
 $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))
diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 9b1ea2994a..801a64ae57 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -57,6 +57,7 @@ ipq40xx_setup_interfaces()
 	dlink,dap-2610|\
 	engenius,eap1300|\
 	extreme-networks,ws-ap3915i|\
+	meraki,mr20|\
 	meraki,mr33|\
 	meraki,mr74|\
 	mikrotik,lhgg-60ad|\
diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
index 7db23a1c77..9fca8edc1d 100644
--- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
@@ -178,6 +178,7 @@ platform_do_upgrade() {
 	linksys,whw03)
 		platform_do_upgrade_linksys_emmc "$1"
 		;;
+	meraki,mr20|\
 	meraki,gx20|\
 	meraki,z3)
 		# DO NOT set CI_KERNPART to part.safe,
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-meraki-underdog.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-meraki-underdog.dtsi
new file mode 100644
index 0000000000..1c2fcdaa22
--- /dev/null
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-meraki-underdog.dtsi
@@ -0,0 +1,101 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Device Tree Source for Meraki devices
+ *
+ * Copyright (C) 2017 Chris Blake <chrisrblake93 at gmail.com>
+ * Copyright (C) 2017 Christian Lamparter <chunkeey at googlemail.com>
+ * Copyright (C) 2025 Hal Martin <halmartin at googlemail.com>
+ *
+ * Based on Cisco Meraki DTS from GPL release r25-linux-3.14-20170427
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+#include "qcom-ipq4029-meraki-common.dtsi"
+
+/ {
+	aliases {
+		led-boot = &status_green;
+		led-failsafe = &status_red;
+		led-running = &status_green;
+		led-upgrade = &power_orange;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		power_orange: power {
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_ORANGE>;
+			gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>;
+			panic-indicator;
+		};
+	};
+};
+
+&blsp1_i2c3 {
+	eeprom at 56 {
+		compatible = "atmel,24c64";
+		pagesize = <32>;
+		reg = <0x56>;
+		read-only; /* This holds our MAC & Meraki board-data */
+
+		nvmem-layout {
+			compatible = "fixed-layout";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			mac_address: mac-address at 66 {
+				compatible = "mac-base";
+				reg = <0x66 0x6>;
+				#nvmem-cell-cells = <1>;
+			};
+		};
+	};
+};
+
+&tlmm {
+	i2c_0_pins: i2c_0_pinmux {
+		function = "blsp_i2c0";
+		pins = "gpio10", "gpio11";
+		drive-strength = <16>;
+		bias-disable;
+	};
+};
+
+&mdio {
+	ethernet-phy-package at 0 {
+		status = "disabled";
+	};
+};
+
+&switch {
+	/delete-property/ psgmii-ethphy;
+};
+
+&ethphy0 {
+	status = "disabled";
+};
+
+&ethphy1 {
+	status = "disabled";
+};
+
+&ethphy2 {
+	status = "disabled";
+};
+
+&ethphy3 {
+	status = "disabled";
+};
+
+&ethphy4 {
+	status = "disabled";
+};
+
+&psgmiiphy {
+	status = "disabled";
+};
+
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr20.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr20.dts
new file mode 100644
index 0000000000..9c50b10655
--- /dev/null
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr20.dts
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// Device Tree Source for Meraki MR20 (Grub) / Go GR10 (Maggot)
+
+#include "qcom-ipq4029-meraki-underdog.dtsi"
+
+/ {
+	model = "Meraki MR20";
+	compatible = "meraki,mr20";
+
+	leds {
+		compatible = "gpio-leds";
+
+		status_green: led_green {
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
+		};
+
+		status_blue: led_blue {
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
+		};
+
+		status_red: led_red {
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>;
+		};
+
+	};
+
+	soc {
+		ess_tcsr at 1953000 {
+			qcom,ess-interface-select = <TCSR_ESS_PSGMII_RGMII5>;
+		};
+	};
+};
+
+&mdio {
+	ar8035: ethernet-phy at 0 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0>;
+	};
+};
+
+&swport5 {
+	status = "okay";
+	label = "lan";
+	phy-handle = <&ar8035>;
+	phy-mode = "rgmii-id";
+};
+
+&wifi0 {
+	status = "okay";
+	qcom,ath10k-calibration-variant = "Meraki-underdog";
+};
+
+&wifi1 {
+	status = "okay";
+	qcom,ath10k-calibration-variant = "Meraki-underdog";
+};
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index 1d02a2fc1f..79d2c80a17 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -822,6 +822,14 @@ define Device/meraki_common
 	DEVICE_PACKAGES := ath10k-firmware-qca9887-ct
 endef
 
+define Device/meraki_mr20
+	$(call Device/meraki_common)
+	DEVICE_MODEL := MR20
+	DEVICE_DTS_CONFIG := config at 4
+	DEVICE_PACKAGES := ipq-wifi-meraki_underdog
+endef
+TARGET_DEVICES += meraki_mr20
+
 define Device/meraki_mr30h
 	$(call Device/meraki_common)
 	DEVICE_MODEL := MR30H



From lede-commits at lists.infradead.org  Mon Dec 29 10:41:27 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 29 Dec 2025 13:41:27 -0500
Subject: [openwrt/openwrt]  ipq40xx/meraki: refactor common device tree
In-Reply-To: <176703368723.3614726.12913296056704700004@git-01.infra.openwrt.org>
References: <176703368723.3614726.12913296056704700004@git-01.infra.openwrt.org>
Message-ID: <mailman.39850.1767033698.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/593e399568a9834576f03e9414c1a232d82078b6

commit 593e399568a9834576f03e9414c1a232d82078b6
Author: Hal Martin <hal.martin at gmail.com>
AuthorDate: Mon Dec 22 10:48:46 2025 +0100

    ipq40xx/meraki: refactor common device tree
    
    qcom-ipq4029-insect-common.dtsi was common to the MR33 and MR74, but was no
    longer common with the other supported Meraki devices. I have refactored
    insect-common and wired-qca-common into qcom-ipq4029-meraki-common.dtsi
    which contains the actual common components (e.g. NAND partitions, ART nvmem).
    
    Individual devices reference qcom-ipq4029-meraki-insect.dtsi
    plus their own individual configuration.
    
    Signed-off-by: Hal Martin <hal.martin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20646
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../arch/arm/boot/dts/qcom/qcom-ipq4029-gx20.dts   |  66 +++++-
 ...common.dtsi => qcom-ipq4029-meraki-common.dtsi} | 233 +++------------------
 .../boot/dts/qcom/qcom-ipq4029-meraki-insect.dtsi  | 122 +++++++++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4029-mr30h.dts  |  36 +---
 .../arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts   |  69 +++++-
 .../arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts   |  69 +++++-
 .../arch/arm/boot/dts/qcom/qcom-ipq4029-z3.dts     |  65 +++++-
 7 files changed, 421 insertions(+), 239 deletions(-)

diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-gx20.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-gx20.dts
index 0c951e56da..d3dd6edd8e 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-gx20.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-gx20.dts
@@ -1,12 +1,26 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // Device Tree Source for Meraki Go GX20 (Fairyfly)
 
-#include "qcom-ipq4029-wired-qca-common.dtsi"
+#include "qcom-ipq4029-meraki-insect.dtsi"
 
 / {
 	model = "Meraki Go GX20 Router";
 	compatible = "meraki,gx20";
 
+	soc {
+		ess_tcsr at 1953000 {
+			qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+		};
+
+		tcsr at 194b000 {
+			/* select hostmode */
+			compatible = "qcom,tcsr";
+			reg = <0x194b000 0x100>;
+			qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
+			status = "okay";
+		};
+	};
+
 	leds {
 		compatible = "gpio-leds";
 
@@ -99,11 +113,51 @@
 	};
 };
 
-/* GX20 does not have WiFi radios */
-&wifi0 {
-	status = "disabled";
+&tricolor {
+	enable-gpio = <&tlmm 48 GPIO_ACTIVE_HIGH>;
+};
+
+&usb2_hs_phy {
+		status = "okay";
+};
+
+&usb2 {
+		status = "okay";
+};
+
+&usb3_hs_phy {
+		status = "okay";
+};
+
+&usb3_ss_phy {
+		status = "okay";
+};
+
+&usb3 {
+		status = "okay";
+};
+
+&swport1 {
+	label = "wan";
+	status = "okay";
+};
+
+&swport2 {
+	label = "lan2";
+	status = "okay";
+};
+
+&swport3 {
+	label = "lan3";
+	status = "okay";
+};
+
+&swport4 {
+	label = "lan4";
+	status = "okay";
 };
 
-&wifi1 {
-	status = "disabled";
+&swport5 {
+	label = "lan5";
+	status = "okay";
 };
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-insect-common.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-meraki-common.dtsi
similarity index 61%
rename from target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-insect-common.dtsi
rename to target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-meraki-common.dtsi
index 46cc68435f..2e5d961eae 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-insect-common.dtsi
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-meraki-common.dtsi
@@ -1,9 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Device Tree Source for Meraki "Insect" series
+ * Device Tree Source for Meraki devices
  *
  * Copyright (C) 2017 Chris Blake <chrisrblake93 at gmail.com>
  * Copyright (C) 2017 Christian Lamparter <chunkeey at googlemail.com>
+ * Copyright (C) 2025 Hal Martin <halmartin at googlemail.com>
  *
  * Based on Cisco Meraki DTS from GPL release r25-linux-3.14-20170427
  *
@@ -19,21 +20,6 @@
 #include <dt-bindings/leds/common.h>
 
 / {
-	aliases {
-		// TODO: Verify if the ethernet0 alias is needed
-		ethernet0 = &gmac;
-		led-boot = &status_green;
-		led-failsafe = &status_red;
-		led-running = &status_green;
-		led-upgrade = &power_orange;
-	};
-
-	/* Do we really need this defined? */
-	memory {
-		device_type = "memory";
-		reg = <0x80000000 0x10000000>;
-	};
-
 	soc {
 		/* It is a 56-bit counter that supplies the count to the ARM arch
 		   timers and without upstream driver */
@@ -45,7 +31,6 @@
 		ess_tcsr at 1953000 {
 			compatible = "qcom,tcsr";
 			reg = <0x1953000 0x1000>;
-			qcom,ess-interface-select = <TCSR_ESS_PSGMII_RGMII5>;
 		};
 
 		tcsr at 1949000 {
@@ -70,17 +55,6 @@
 			linux,code = <KEY_RESTART>;
 		};
 	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		power_orange: power {
-			function = LED_FUNCTION_POWER;
-			color = <LED_COLOR_ID_ORANGE>;
-			gpios = <&tlmm 49 GPIO_ACTIVE_LOW>;
-			panic-indicator;
-		};
-	};
 };
 
 &watchdog {
@@ -105,17 +79,6 @@
 	status = "okay";
 };
 
-&blsp1_uart2 {
-	pinctrl-0 = <&serial_1_pins>;
-	pinctrl-names = "default";
-	status = "okay";
-
-	bluetooth {
-		compatible = "ti,cc2650";
-		enable-gpios = <&tlmm 12 GPIO_ACTIVE_LOW>;
-	};
-};
-
 &cryptobam {
 	status = "okay";
 };
@@ -124,72 +87,6 @@
 	pinctrl-0 = <&i2c_0_pins>;
 	pinctrl-names = "default";
 	status = "okay";
-
-	eeprom at 50 {
-		compatible = "atmel,24c64";
-		pagesize = <32>;
-		reg = <0x50>;
-		read-only; /* This holds our MAC & Meraki board-data */
-
-		nvmem-layout {
-			compatible = "fixed-layout";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			mac_address: mac-address at 66 {
-				compatible = "mac-base";
-				reg = <0x66 0x6>;
-				#nvmem-cell-cells = <1>;
-			};
-		};
-	};
-};
-
-&blsp1_i2c4 {
-	pinctrl-0 = <&i2c_1_pins>;
-	pinctrl-names = "default";
-	status = "okay";
-
-	tricolor: led-controller at 30 {
-		compatible = "ti,lp5562";
-		reg = <0x30>;
-		clock-mode = /bits/8 <2>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		/* RGB led */
-		status_red: chan at 0 {
-			chan-name = "red:status";
-			led-cur = /bits/ 8 <0x20>;
-			max-cur = /bits/ 8 <0x60>;
-			reg = <0>;
-			color = <LED_COLOR_ID_RED>;
-		};
-
-		status_green: chan at 1 {
-			chan-name = "green:status";
-			led-cur = /bits/ 8 <0x20>;
-			max-cur = /bits/ 8 <0x60>;
-			reg = <1>;
-			color = <LED_COLOR_ID_GREEN>;
-		};
-
-		chan at 2 {
-			chan-name = "blue:status";
-			led-cur = /bits/ 8 <0x20>;
-			max-cur = /bits/ 8 <0x60>;
-			reg = <2>;
-			color = <LED_COLOR_ID_BLUE>;
-		};
-
-		chan at 3 {
-			chan-name = "white:status";
-			led-cur = /bits/ 8 <0x20>;
-			max-cur = /bits/ 8 <0x60>;
-			reg = <3>;
-			color = <LED_COLOR_ID_WHITE>;
-		};
-	};
 };
 
 &nand {
@@ -277,6 +174,12 @@
 	};
 };
 
+&pcie0 {
+	status = "disabled";
+	perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 50 GPIO_ACTIVE_LOW>;
+};
+
 &ubi_art {
 	nvmem-layout {
 		compatible = "fixed-layout";
@@ -297,33 +200,11 @@
 	};
 };
 
-&pcie0 {
-	status = "okay";
-	perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 50 GPIO_ACTIVE_LOW>;
-};
-
-&pcie_bridge0 {
-	wifi at 0,0 {
-		compatible = "qcom,ath10k";
-		reg = <0x00010000 0 0 0 0>;
-		nvmem-cells = <&mac_address 1>, <&cal_factory_9000>;
-		nvmem-cell-names = "mac-address", "calibration";
-	};
-};
-
 &qpic_bam {
 	status = "okay";
 };
 
 &tlmm {
-	/*
-	 * GPIO43 should be 0/1 whenever the unit is
-	 * powered through PoE or AC-Adapter.
-	 * That said, playing with this seems to
-	 * reset the AP.
-	 */
-
 	mdio_pins: mdio_pinmux {
 		mux_1 {
 			pins = "gpio6";
@@ -355,27 +236,17 @@
 	};
 
 	i2c_0_pins: i2c_0_pinmux {
-		pinmux {
-			function = "blsp_i2c0";
-			pins = "gpio20", "gpio21";
-		};
-		pinconf {
-			pins = "gpio20", "gpio21";
-			drive-strength = <16>;
-			bias-disable;
-		};
+		function = "blsp_i2c0";
+		pins = "gpio20", "gpio21";
+		drive-strength = <16>;
+		bias-disable;
 	};
 
 	i2c_1_pins: i2c_1_pinmux {
-		pinmux {
-			function = "blsp_i2c1";
-			pins = "gpio34", "gpio35";
-		};
-		pinconf {
-			pins = "gpio34", "gpio35";
-			drive-strength = <16>;
-			bias-disable;
-		};
+		function = "blsp_i2c1";
+		pins = "gpio34", "gpio35";
+		drive-strength = <16>;
+		bias-disable;
 	};
 
 	nand_pins: nand_pins {
@@ -390,90 +261,46 @@
 		 */
 
 		pullups {
-			pins = "gpio52", "gpio53", "gpio58",
-				"gpio59";
+			pins = "gpio53", "gpio58", "gpio59";
 			function = "qpic";
 			bias-pull-up;
 		};
 
 		pulldowns {
-			pins = "gpio54", "gpio55", "gpio56",
-				"gpio57", "gpio60", "gpio61",
-				"gpio62", "gpio63", "gpio64",
-				"gpio65", "gpio66", "gpio67",
-				"gpio68", "gpio69";
+			pins = "gpio55", "gpio56", "gpio57",
+				"gpio60", "gpio62", "gpio63",
+				"gpio64", "gpio65", "gpio66",
+				"gpio67", "gpio68", "gpio69";
 			function = "qpic";
 			bias-pull-down;
 		};
 	};
 };
 
-&wifi0 {
-	status = "okay";
-	nvmem-cells = <&mac_address 2>, <&precal_factory_1000>;
-	nvmem-cell-names = "mac-address", "pre-calibration";
-};
-
-&wifi1 {
-	status = "okay";
-	nvmem-cells = <&mac_address 3>, <&precal_factory_5000>;
-	nvmem-cell-names = "mac-address", "pre-calibration";
-};
-
 &mdio {
 	status = "okay";
 	pinctrl-0 = <&mdio_pins>;
 	pinctrl-names = "default";
-
-	ar8035: ethernet-phy at 1 {
-		reg = <1>;
-	};
-
-	ethernet-phy-package at 0 {
-		status = "disabled";
-	};
-};
-
-&gmac {
-	status = "okay";
-	nvmem-cells = <&mac_address 0>;
-	nvmem-cell-names = "mac-address";
 };
 
 &switch {
 	status = "okay";
-
-	/delete-property/ psgmii-ethphy;
 };
 
-&swport5 {
+&gmac {
 	status = "okay";
-
-	label = "lan";
-	phy-handle = <&ar8035>;
-	phy-mode = "rgmii-rxid";
-};
-
-&ethphy0 {
-	status = "disabled";
-};
-
-&ethphy1 {
-	status = "disabled";
-};
-
-&ethphy2 {
-	status = "disabled";
-};
-
-&ethphy3 {
-	status = "disabled";
+	nvmem-cells = <&mac_address 0>;
+	nvmem-cell-names = "mac-address";
 };
 
-&ethphy4 {
+&wifi0 {
 	status = "disabled";
+	nvmem-cells = <&mac_address 2>, <&precal_factory_1000>;
+	nvmem-cell-names = "mac-address", "pre-calibration";
 };
 
-&psgmiiphy {
+&wifi1 {
 	status = "disabled";
+	nvmem-cells = <&mac_address 3>, <&precal_factory_5000>;
+	nvmem-cell-names = "mac-address", "pre-calibration";
 };
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-meraki-insect.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-meraki-insect.dtsi
new file mode 100644
index 0000000000..9c9f307219
--- /dev/null
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-meraki-insect.dtsi
@@ -0,0 +1,122 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Device Tree Source for Meraki devices
+ *
+ * Copyright (C) 2017 Chris Blake <chrisrblake93 at gmail.com>
+ * Copyright (C) 2017 Christian Lamparter <chunkeey at googlemail.com>
+ * Copyright (C) 2025 Hal Martin <halmartin at googlemail.com>
+ *
+ * Based on Cisco Meraki DTS from GPL release r25-linux-3.14-20170427
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+#include "qcom-ipq4029-meraki-common.dtsi"
+
+/ {
+	aliases {
+		led-boot = &status_green;
+		led-failsafe = &status_red;
+		led-running = &status_green;
+		led-upgrade = &power_orange;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		power_orange: power {
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_ORANGE>;
+			gpios = <&tlmm 49 GPIO_ACTIVE_LOW>;
+			panic-indicator;
+		};
+	};
+};
+
+&blsp1_i2c3 {
+	eeprom at 50 {
+		compatible = "atmel,24c64";
+		pagesize = <32>;
+		reg = <0x50>;
+		read-only; /* This holds our MAC & Meraki board-data */
+
+		nvmem-layout {
+			compatible = "fixed-layout";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			mac_address: mac-address at 66 {
+				compatible = "mac-base";
+				reg = <0x66 0x6>;
+				#nvmem-cell-cells = <1>;
+			};
+		};
+	};
+};
+
+&blsp1_i2c4 {
+	pinctrl-0 = <&i2c_1_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+
+	tricolor: led-controller at 30 {
+		compatible = "ti,lp5562";
+		reg = <0x30>;
+		clock-mode = /bits/8 <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/* RGB led */
+		status_red: chan at 0 {
+			chan-name = "red:status";
+			led-cur = /bits/ 8 <0x20>;
+			max-cur = /bits/ 8 <0x60>;
+			reg = <0>;
+			color = <LED_COLOR_ID_RED>;
+		};
+
+		status_green: chan at 1 {
+			chan-name = "green:status";
+			led-cur = /bits/ 8 <0x20>;
+			max-cur = /bits/ 8 <0x60>;
+			reg = <1>;
+			color = <LED_COLOR_ID_GREEN>;
+		};
+
+		chan at 2 {
+			chan-name = "blue:status";
+			led-cur = /bits/ 8 <0x20>;
+			max-cur = /bits/ 8 <0x60>;
+			reg = <2>;
+			color = <LED_COLOR_ID_BLUE>;
+		};
+
+		chan at 3 {
+			chan-name = "white:status";
+			led-cur = /bits/ 8 <0x20>;
+			max-cur = /bits/ 8 <0x60>;
+			reg = <3>;
+			color = <LED_COLOR_ID_WHITE>;
+		};
+	};
+};
+
+&gmac {
+	status = "okay";
+	nvmem-cells = <&mac_address 0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&wifi0 {
+	status = "disabled";
+	nvmem-cells = <&mac_address 2>, <&precal_factory_1000>;
+	nvmem-cell-names = "mac-address", "pre-calibration";
+};
+
+&wifi1 {
+	status = "disabled";
+	nvmem-cells = <&mac_address 3>, <&precal_factory_5000>;
+	nvmem-cell-names = "mac-address", "pre-calibration";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr30h.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr30h.dts
index 4edc1bf120..8b21736d00 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr30h.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr30h.dts
@@ -1,19 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // Device Tree Source for Meraki MR30H (Noisy Cricket)
 
-#include "qcom-ipq4029-wired-qca-common.dtsi"
+#include "qcom-ipq4029-meraki-insect.dtsi"
 
 / {
 	model = "Meraki MR30H";
 	compatible = "meraki,mr30h";
 
-	soc {
-		/* for USB PHY, device has no USB port */
-		tcsr at 194b000 {
-			status = "disabled";
-		};
-	};
-
 	leds {
 		compatible = "gpio-leds";
 
@@ -80,26 +73,16 @@
 			gpios = <&tlmm 22 GPIO_ACTIVE_LOW>;
 		};
 	};
-};
-
-&usb2_hs_phy {
-	status = "disabled";
-};
 
-&usb2 {
-	status = "disabled";
-};
-
-&usb3_hs_phy {
-	status = "disabled";
-};
-
-&usb3_ss_phy {
-	status = "disabled";
+	soc {
+		ess_tcsr at 1953000 {
+			qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+		};
+	};
 };
 
-&usb3 {
-	status = "disabled";
+&tricolor {
+	enable-gpio = <&tlmm 48 GPIO_ACTIVE_HIGH>;
 };
 
 &pcie0 {
@@ -109,7 +92,7 @@
 };
 
 &pcie_bridge0 {
-	wifi2: wifi at 1,0 {
+	wifi2: wifi at 0,0 {
 		compatible = "qcom,ath10k";
 		reg = <0x00010000 0 0 0 0>;
 		nvmem-cells = <&cal_factory_9000>;
@@ -127,7 +110,6 @@
 	qcom,ath10k-calibration-variant = "Meraki-MR30H";
 };
 
-
 &swport1 {
 	label = "lan4";
 	status = "okay";
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts
index a1fad08559..62a793cedb 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts
@@ -1,21 +1,88 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // Device Tree Source for Meraki MR33 (Stinkbug)
 
-#include "qcom-ipq4029-insect-common.dtsi"
+#include "qcom-ipq4029-meraki-insect.dtsi"
 
 / {
 	model = "Meraki MR33 Access Point";
 	compatible = "meraki,mr33";
+
+	soc {
+		ess_tcsr at 1953000 {
+			qcom,ess-interface-select = <TCSR_ESS_PSGMII_RGMII5>;
+		};
+	};
 };
 
 &tricolor {
 	enable-gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>;
 };
 
+&pcie0 {
+	status = "okay";
+};
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		nvmem-cells = <&mac_address 1>, <&cal_factory_9000>;
+		nvmem-cell-names = "mac-address", "calibration";
+	};
+};
+
 &wifi0 {
+	status = "okay";
 	qcom,ath10k-calibration-variant = "Meraki-MR33";
 };
 
 &wifi1 {
+	status = "okay";
 	qcom,ath10k-calibration-variant = "Meraki-MR33";
 };
+
+&mdio {
+	ar8035: ethernet-phy at 1 {
+		reg = <1>;
+	};
+
+	ethernet-phy-package at 0 {
+		status = "disabled";
+	};
+};
+
+&switch {
+	/delete-property/ psgmii-ethphy;
+};
+
+&swport5 {
+	status = "okay";
+
+	label = "lan";
+	phy-handle = <&ar8035>;
+	phy-mode = "rgmii-rxid";
+};
+
+&ethphy0 {
+	status = "disabled";
+};
+
+&ethphy1 {
+	status = "disabled";
+};
+
+&ethphy2 {
+	status = "disabled";
+};
+
+&ethphy3 {
+	status = "disabled";
+};
+
+&ethphy4 {
+	status = "disabled";
+};
+
+&psgmiiphy {
+	status = "disabled";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts
index 2df9e912a2..09e71a65a8 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts
@@ -1,21 +1,88 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // Device Tree Source for Meraki MR74 (Ladybug)
 
-#include "qcom-ipq4029-insect-common.dtsi"
+#include "qcom-ipq4029-meraki-insect.dtsi"
 
 / {
 	model = "Meraki MR74 Access Point";
 	compatible = "meraki,mr74";
+
+	soc {
+		ess_tcsr at 1953000 {
+			qcom,ess-interface-select = <TCSR_ESS_PSGMII_RGMII5>;
+		};
+	};
 };
 
 &tricolor {
 	enable-gpios = <&tlmm 14 GPIO_ACTIVE_LOW>;
 };
 
+&pcie0 {
+	status = "okay";
+};
+
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		nvmem-cells = <&mac_address 1>, <&cal_factory_9000>;
+		nvmem-cell-names = "mac-address", "calibration";
+	};
+};
+
 &wifi0 {
+	status = "okay";
 	qcom,ath10k-calibration-variant = "Meraki-MR33";
 };
 
 &wifi1 {
+	status = "okay";
 	qcom,ath10k-calibration-variant = "Meraki-MR33";
 };
+
+&mdio {
+	ar8035: ethernet-phy at 1 {
+		reg = <1>;
+	};
+
+	ethernet-phy-package at 0 {
+		status = "disabled";
+	};
+};
+
+&switch {
+	/delete-property/ psgmii-ethphy;
+};
+
+&swport5 {
+	status = "okay";
+
+	label = "lan";
+	phy-handle = <&ar8035>;
+	phy-mode = "rgmii-rxid";
+};
+
+&ethphy0 {
+	status = "disabled";
+};
+
+&ethphy1 {
+	status = "disabled";
+};
+
+&ethphy2 {
+	status = "disabled";
+};
+
+&ethphy3 {
+	status = "disabled";
+};
+
+&ethphy4 {
+	status = "disabled";
+};
+
+&psgmiiphy {
+	status = "disabled";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-z3.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-z3.dts
index 6ed70dc0a2..ea3b3ee759 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-z3.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-z3.dts
@@ -1,12 +1,26 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // Device Tree Source for Meraki Z3 (Fuzzy Cricket)
 
-#include "qcom-ipq4029-wired-qca-common.dtsi"
+#include "qcom-ipq4029-meraki-insect.dtsi"
 
 / {
 	model = "Meraki Z3 Router";
 	compatible = "meraki,z3";
 
+	soc {
+		ess_tcsr at 1953000 {
+			qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+		};
+
+		tcsr at 194b000 {
+			/* select hostmode */
+			compatible = "qcom,tcsr";
+			reg = <0x194b000 0x100>;
+			qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
+			status = "okay";
+		};
+	};
+
 	leds {
 		compatible = "gpio-leds";
 
@@ -99,6 +113,55 @@
 	};
 };
 
+&tricolor {
+	enable-gpio = <&tlmm 48 GPIO_ACTIVE_HIGH>;
+};
+
+&usb2_hs_phy {
+	status = "okay";
+};
+
+&usb2 {
+	status = "okay";
+};
+
+&usb3_hs_phy {
+	status = "okay";
+};
+
+&usb3_ss_phy {
+	status = "okay";
+};
+
+&usb3 {
+	status = "okay";
+};
+
+&swport1 {
+	label = "wan";
+	status = "okay";
+};
+
+&swport2 {
+	label = "lan2";
+	status = "okay";
+};
+
+&swport3 {
+	label = "lan3";
+	status = "okay";
+};
+
+&swport4 {
+	label = "lan4";
+	status = "okay";
+};
+
+&swport5 {
+	label = "lan5";
+	status = "okay";
+};
+
 &wifi0 {
 	status = "okay";
 	qcom,ath10k-calibration-variant = "Meraki-Z3";



From lede-commits at lists.infradead.org  Tue Dec 30 00:43:18 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 03:43:18 -0500
Subject: [openwrt/openwrt]  odhcp6c: update to Git HEAD (2025-12-29)
In-Reply-To: <176708419882.1457872.595504049924805412@git-01.infra.openwrt.org>
References: <176708419882.1457872.595504049924805412@git-01.infra.openwrt.org>
Message-ID: <mailman.39921.1767084204.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/fb15ef4b232ca34fdc3b90455a1ff02b436da4b0

commit fb15ef4b232ca34fdc3b90455a1ff02b436da4b0
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Mon Dec 29 18:14:39 2025 +0100

    odhcp6c: update to Git HEAD (2025-12-29)
    
    8abb45065f5e dhcpv6: omit IA_NA on Request
    988d5fb306b3 dhcpv6: dhcpv6_send: convert whitespaces to tabs
    5e1ab3bc1be8 ra: convert if block to switch
    2e6682bfcaff odhcp6c: do cleanup at exit
    610e4bddb8d7 config: fix potential memory leaks in error paths
    bfd7597cada1 all: add log helpers
    0bb93c26d14b dhcpv6: clarifying comments
    65f9ee25e5eb dhcpv6: offload FQDN construction to init_dhcpv6
    48dbd38122e4 dhcpv6: migrate dhcpv6_response_is_valid to switch case
    
    https://github.com/openwrt/odhcp6c/compare/9a4d6fe802d2...8abb45065f5e
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile        | 6 +++---
 package/network/ipv6/odhcp6c/files/dhcpv6.sh | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index ecc6ff11cc..a35e72bd3c 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
-PKG_SOURCE_DATE:=2025-12-18
-PKG_SOURCE_VERSION:=9a4d6fe802d21e4fc1b84f7d55b5c3c23e71d6ba
-PKG_MIRROR_HASH:=0be95faccad6b4c9107fc7819526f11b59eedc09454c8dcb0435450ff3afbf77
+PKG_SOURCE_DATE:=2025-12-29
+PKG_SOURCE_VERSION:=8abb45065f5ef9d176efa6bd151a1209b05852c4
+PKG_MIRROR_HASH:=e7ce2b3025dfc005b9fb960f53c1848c1864e026e11e336f7b017d6eb9c68cef
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
index 59a6021c5c..d59e988991 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -42,7 +42,7 @@ proto_dhcpv6_init_config() {
 	proto_config_add_boolean sourcefilter
 	proto_config_add_boolean keep_ra_dnslifetime
 	proto_config_add_int "ra_holdoff"
-	proto_config_add_boolean verbose
+	proto_config_add_int 'verbose:range(0, 7)'
 	proto_config_add_boolean dynamic
 }
 
@@ -116,7 +116,7 @@ proto_dhcpv6_setup() {
 
 	[ -n "$ra_holdoff" ] && append opts "-m$ra_holdoff"
 
-	[ "$verbose" = "1" ] && append opts "-v"
+	[ -n "$verbose" ] && append opts "-l$verbose"
 
 	json_for_each_item proto_dhcpv6_add_sendopts sendopts opts
 



From lede-commits at lists.infradead.org  Tue Dec 30 00:44:51 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 03:44:51 -0500
Subject: [openwrt/openwrt]  odhcp6c: update to 25.12 Git HEAD (2025-12-29)
In-Reply-To: <176708429183.1462516.12575368813692680122@git-01.infra.openwrt.org>
References: <176708429183.1462516.12575368813692680122@git-01.infra.openwrt.org>
Message-ID: <mailman.39922.1767084296.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/948b1b564dcf0afa84882cb79691951d41ff51a5

commit 948b1b564dcf0afa84882cb79691951d41ff51a5
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Mon Dec 29 18:25:47 2025 +0100

    odhcp6c: update to 25.12 Git HEAD (2025-12-29)
    
    699cc61568b6 dhcpv6: omit IA_NA on Request
    8774d3c0ec9c dhcpv6: dhcpv6_send: convert whitespaces to tabs
    11abe3790431 ra: convert if block to switch
    c05b803d38e9 odhcp6c: do cleanup at exit
    6aa4e491a869 config: fix potential memory leaks in error paths
    235cdc97d73b all: add log helpers
    6e3272d609d3 dhcpv6: clarifying comments
    04aea4e3f870 dhcpv6: offload FQDN construction to init_dhcpv6
    449ce8374275 dhcpv6: migrate dhcpv6_response_is_valid to switch case
    
    https://github.com/openwrt/odhcp6c/compare/5ab3203875ad...699cc61568b6
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/network/ipv6/odhcp6c/Makefile        | 6 +++---
 package/network/ipv6/odhcp6c/files/dhcpv6.sh | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 952831e47a..9741046cfe 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
-PKG_SOURCE_DATE:=2025-12-18
-PKG_SOURCE_VERSION:=5ab3203875ad938ea85f6d0ceebdff113c355656
-PKG_MIRROR_HASH:=4de69fe364be2d302329cdc86d4d93820e73c82f00d788a536cf947076a4ded3
+PKG_SOURCE_DATE:=2025-12-29
+PKG_SOURCE_VERSION:=699cc61568b6816783d17d57dda4ef7851198528
+PKG_MIRROR_HASH:=e8a42c429ed83660ccc04d69e3bcbf0056d8e96e08caff0f14518150b89ec352
 
 PKG_MAINTAINER:=?lvaro Fern?ndez Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
index 59a6021c5c..d59e988991 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -42,7 +42,7 @@ proto_dhcpv6_init_config() {
 	proto_config_add_boolean sourcefilter
 	proto_config_add_boolean keep_ra_dnslifetime
 	proto_config_add_int "ra_holdoff"
-	proto_config_add_boolean verbose
+	proto_config_add_int 'verbose:range(0, 7)'
 	proto_config_add_boolean dynamic
 }
 
@@ -116,7 +116,7 @@ proto_dhcpv6_setup() {
 
 	[ -n "$ra_holdoff" ] && append opts "-m$ra_holdoff"
 
-	[ "$verbose" = "1" ] && append opts "-v"
+	[ -n "$verbose" ] && append opts "-l$verbose"
 
 	json_for_each_item proto_dhcpv6_add_sendopts sendopts opts
 



From lede-commits at lists.infradead.org  Tue Dec 30 01:39:10 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 04:39:10 -0500
Subject: [openwrt/openwrt]  wifi-scripts: don't set wpa_pairwise for wpa=0
In-Reply-To: <176708755025.1612329.15536997315423050740@git-01.infra.openwrt.org>
References: <176708755025.1612329.15536997315423050740@git-01.infra.openwrt.org>
Message-ID: <mailman.39941.1767087555.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/bc4e7fd38ee1925c3cec8c2fe4730f334ca6be1e

commit bc4e7fd38ee1925c3cec8c2fe4730f334ca6be1e
Author: Leon M. Busch-George <leon at georgemail.eu>
AuthorDate: Thu Dec 18 22:24:51 2025 +0100

    wifi-scripts: don't set wpa_pairwise for wpa=0
    
    Without this patch, the
    
        if (!config.wpa)
                    config.wpa_pairwise = null;
    
    is overwritten immediately.
    
    Signed-off-by: Leon M. Busch-George <leon at georgemail.eu>
    Link: https://github.com/openwrt/openwrt/pull/21215
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
index 942fef059a..5b7b14b6ff 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
@@ -16,10 +16,11 @@ export function parse_encryption(config, dev_config) {
 			config.wpa = v;
 			break;
 		}
-	if (!config.wpa)
-		config.wpa_pairwise = null;
 
-	config.wpa_pairwise = (config.hw_mode == 'ad') ? 'GCMP' : 'CCMP';
+	config.wpa_pairwise = null;
+	if (config.wpa)
+		config.wpa_pairwise = (config.hw_mode == 'ad') ? 'GCMP' : 'CCMP';
+
 	config.auth_type = encryption[0] ?? 'none';
 
 	let wpa3_pairwise = config.wpa_pairwise;



From lede-commits at lists.infradead.org  Tue Dec 30 01:40:20 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 04:40:20 -0500
Subject: [openwrt/openwrt]  wifi-scripts: don't set wpa_pairwise for wpa=0
In-Reply-To: <176708762096.1614995.9834877976465081873@git-01.infra.openwrt.org>
References: <176708762096.1614995.9834877976465081873@git-01.infra.openwrt.org>
Message-ID: <mailman.39942.1767087628.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/ff713d3d9e39d148e60cc411b47d4f88b204ae30

commit ff713d3d9e39d148e60cc411b47d4f88b204ae30
Author: Leon M. Busch-George <leon at georgemail.eu>
AuthorDate: Thu Dec 18 22:24:51 2025 +0100

    wifi-scripts: don't set wpa_pairwise for wpa=0
    
    Without this patch, the
    
        if (!config.wpa)
                    config.wpa_pairwise = null;
    
    is overwritten immediately.
    
    Signed-off-by: Leon M. Busch-George <leon at georgemail.eu>
    Link: https://github.com/openwrt/openwrt/pull/21215
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit bc4e7fd38ee1925c3cec8c2fe4730f334ca6be1e)
---
 .../config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
index 942fef059a..5b7b14b6ff 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
@@ -16,10 +16,11 @@ export function parse_encryption(config, dev_config) {
 			config.wpa = v;
 			break;
 		}
-	if (!config.wpa)
-		config.wpa_pairwise = null;
 
-	config.wpa_pairwise = (config.hw_mode == 'ad') ? 'GCMP' : 'CCMP';
+	config.wpa_pairwise = null;
+	if (config.wpa)
+		config.wpa_pairwise = (config.hw_mode == 'ad') ? 'GCMP' : 'CCMP';
+
 	config.auth_type = encryption[0] ?? 'none';
 
 	let wpa3_pairwise = config.wpa_pairwise;



From lede-commits at lists.infradead.org  Tue Dec 30 01:44:13 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 04:44:13 -0500
Subject: [openwrt/openwrt]  package: gpio-nct5104d: adapt to kernel 6.18
In-Reply-To: <176708785344.1624856.16947271151407322123@git-01.infra.openwrt.org>
References: <176708785344.1624856.16947271151407322123@git-01.infra.openwrt.org>
Message-ID: <mailman.39943.1767087858.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/ed836b1a9d86777cc37fa5b3765aea8b5addd876

commit ed836b1a9d86777cc37fa5b3765aea8b5addd876
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Thu Dec 18 12:51:33 2025 -0500

    package: gpio-nct5104d: adapt to kernel 6.18
    
    - Changing return type from void to int
    - Returning error code instead of void on superio_enter() failure
    - Returning 0 on success
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21218
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/kernel/gpio-nct5104d/src/gpio-nct5104d.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c
index ffeab29eda..6dce1c2960 100644
--- a/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c
+++ b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c
@@ -124,8 +124,11 @@ static int nct5104d_gpio_direction_in(struct gpio_chip *chip, unsigned offset);
 static int nct5104d_gpio_get(struct gpio_chip *chip, unsigned offset);
 static int nct5104d_gpio_direction_out(struct gpio_chip *chip,
 				     unsigned offset, int value);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
+static int nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value);
+#else
 static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value);
-
+#endif
 #define NCT5104D_GPIO_BANK(_base, _ngpio, _regbase)			\
 	{								\
 		.chip = {						\
@@ -219,7 +222,11 @@ static int nct5104d_gpio_direction_out(struct gpio_chip *chip,
 	return 0;
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
+static int nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+#else
 static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+#endif
 {
 	int err;
 	struct nct5104d_gpio_bank *bank = gpiochip_get_data(chip);
@@ -228,7 +235,11 @@ static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value
 
 	err = superio_enter(sio->addr);
 	if (err)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
+		return err;
+#else
 		return;
+#endif
 	superio_select(sio->addr, SIO_LD_GPIO);
 
 	data_out = superio_inb(sio->addr, gpio_data(bank->regbase));
@@ -239,6 +250,10 @@ static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value
 	superio_outb(sio->addr, gpio_data(bank->regbase), data_out);
 
 	superio_exit(sio->addr);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
+	return 0;
+#endif
 }
 
 /*



From lede-commits at lists.infradead.org  Tue Dec 30 05:45:31 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 08:45:31 -0500
Subject: [openwrt/openwrt]  wifi-scripts: use OWE + country for 6GHz
In-Reply-To: <176710233165.2307429.9355550509884780301@git-01.infra.openwrt.org>
References: <176710233165.2307429.9355550509884780301@git-01.infra.openwrt.org>
Message-ID: <mailman.39979.1767102338.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/01a87f4bd0cdbfc84bbc172920e865c1600f7a45

commit 01a87f4bd0cdbfc84bbc172920e865c1600f7a45
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Dec 28 23:03:32 2025 +0100

    wifi-scripts: use OWE + country for 6GHz
    
    Wifi on the 6GHz band does not support open networks, configure owe by
    default. 6GHz wifi also needs a country code, configure a broken country
    code '00' by default to hint the user to change it.
    
    Link: https://github.com/openwrt/openwrt/pull/21313
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc b/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
index 0b81fd65ec..187a823a0e 100644
--- a/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
+++ b/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
@@ -78,7 +78,13 @@ for (let phy_name, phy in board.wlan) {
 
 		band_name = lc(band_name);
 
-		let country, defaults, num_global_macaddr;
+		let country, encryption, defaults, num_global_macaddr;
+		if (band_name == '6g') {
+			country = '00';
+			encryption = 'owe';
+		} else {
+			encryption = 'open';
+		}
 		if (board.wlan.defaults) {
 			defaults = board.wlan.defaults.ssids?.[band_name]?.ssid ? board.wlan.defaults.ssids?.[band_name] : board.wlan.defaults.ssids?.all;
 			country = board.wlan.defaults.country;
@@ -105,7 +111,7 @@ set ${si}.device='${name}'
 set ${si}.network='lan'
 set ${si}.mode='ap'
 set ${si}.ssid='${defaults?.ssid || "OpenWrt"}'
-set ${si}.encryption='${defaults?.encryption || "none"}'
+set ${si}.encryption='${defaults?.encryption || encryption}'
 set ${si}.key='${defaults?.key || ""}'
 
 `);



From lede-commits at lists.infradead.org  Tue Dec 30 05:46:39 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 08:46:39 -0500
Subject: [openwrt/openwrt]  wifi-scripts: use OWE + country for 6GHz
In-Reply-To: <176710239980.2310468.17624975271287067321@git-01.infra.openwrt.org>
References: <176710239980.2310468.17624975271287067321@git-01.infra.openwrt.org>
Message-ID: <mailman.39982.1767102403.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/1818f4fbceca41ccb68d679ad546fa65a0e9bc25

commit 1818f4fbceca41ccb68d679ad546fa65a0e9bc25
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Dec 28 23:03:32 2025 +0100

    wifi-scripts: use OWE + country for 6GHz
    
    Wifi on the 6GHz band does not support open networks, configure owe by
    default. 6GHz wifi also needs a country code, configure a broken country
    code '00' by default to hint the user to change it.
    
    Link: https://github.com/openwrt/openwrt/pull/21313
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 01a87f4bd0cdbfc84bbc172920e865c1600f7a45)
---
 package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc b/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
index e82525e247..34a7269778 100644
--- a/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
+++ b/package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
@@ -78,7 +78,13 @@ for (let phy_name, phy in board.wlan) {
 
 		band_name = lc(band_name);
 
-		let country, defaults, num_global_macaddr;
+		let country, encryption, defaults, num_global_macaddr;
+		if (band_name == '6g') {
+			country = '00';
+			encryption = 'owe';
+		} else {
+			encryption = 'open';
+		}
 		if (board.wlan.defaults) {
 			defaults = board.wlan.defaults.ssids?.[band_name]?.ssid ? board.wlan.defaults.ssids?.[band_name] : board.wlan.defaults.ssids?.all;
 			country = board.wlan.defaults.country;
@@ -105,7 +111,7 @@ set ${si}.device='${name}'
 set ${si}.network='lan'
 set ${si}.mode='ap'
 set ${si}.ssid='${defaults?.ssid || "OpenWrt"}'
-set ${si}.encryption='${defaults?.encryption || "none"}'
+set ${si}.encryption='${defaults?.encryption || encryption}'
 set ${si}.key='${defaults?.key || ""}'
 
 `);



From lede-commits at lists.infradead.org  Tue Dec 30 13:21:42 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 16:21:42 -0500
Subject: [openwrt/openwrt]  arm-trusted-firmware-mediatek: add Cudy DDR3
 target
In-Reply-To: <176712970259.3319952.11694098860118476963@git-01.infra.openwrt.org>
References: <176712970259.3319952.11694098860118476963@git-01.infra.openwrt.org>
Message-ID: <mailman.40055.1767129707.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f4c9ab659191b19af21a861defb6f9408c9aac44

commit f4c9ab659191b19af21a861defb6f9408c9aac44
Author: Fil Dunsky <filipp.dunsky at gmail.com>
AuthorDate: Sat Dec 20 00:28:16 2025 +0300

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21225
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/arm-trusted-firmware-mediatek/Makefile | 6 +++---
 package/boot/uboot-mediatek/Makefile                | 4 ++--
 target/linux/mediatek/image/filogic.mk              | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile
index 4082bc294b..fb3d8d49ff 100644
--- a/package/boot/arm-trusted-firmware-mediatek/Makefile
+++ b/package/boot/arm-trusted-firmware-mediatek/Makefile
@@ -262,8 +262,8 @@ define Trusted-Firmware-A/mt7981-spim-nand-ubi-ddr4
   USE_UBI:=1
 endef
 
-define Trusted-Firmware-A/mt7981-cudy-tr3000-v1
-  NAME:=Cudy TR3000 v1 (SPI-NAND via SPIM, DDR3)
+define Trusted-Firmware-A/mt7981-cudy-ddr3
+  NAME:=Cudy (SPI-NAND via SPIM, DDR3)
   BOOT_DEVICE:=spim-nand
   BUILD_SUBTARGET:=filogic
   PLAT:=mt7981
@@ -664,7 +664,7 @@ TFA_TARGETS:= \
 	mt7981-emmc-ddr4 \
 	mt7981-sdmmc-ddr4 \
 	mt7981-spim-nand-ddr4 \
-	mt7981-cudy-tr3000-v1 \
+	mt7981-cudy-ddr3 \
 	mt7986-ram-ddr3 \
 	mt7986-emmc-ddr3 \
 	mt7986-nor-ddr3 \
diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile
index 4f3e049014..9d59e87f8c 100644
--- a/package/boot/uboot-mediatek/Makefile
+++ b/package/boot/uboot-mediatek/Makefile
@@ -309,9 +309,9 @@ define U-Boot/mt7981_cudy_tr3000-v1
   BUILD_DEVICES:=cudy_tr3000-v1-ubootmod
   UBOOT_CONFIG:=mt7981_cudy_tr3000-v1
   UBOOT_IMAGE:=u-boot.fip
-  BL2_BOOTDEV:=cudy-tr3000-v1
+  BL2_BOOTDEV:=cudy-ddr3
   BL2_SOC:=mt7981
-  DEPENDS:=+trusted-firmware-a-mt7981-cudy-tr3000-v1
+  DEPENDS:=+trusted-firmware-a-mt7981-cudy-ddr3
 endef
 
 define U-Boot/mt7981_glinet_gl-mt2500
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 6e19507d05..4d5ca41835 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1139,7 +1139,7 @@ define Device/cudy_tr3000-v1-ubootmod
   IMAGE/sysupgrade.itb := append-kernel | \
 	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
   ARTIFACTS := preloader.bin bl31-uboot.fip
-  ARTIFACT/preloader.bin := mt7981-bl2 cudy-tr3000-v1
+  ARTIFACT/preloader.bin := mt7981-bl2 cudy-ddr3
   ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot cudy_tr3000-v1
 endef
 TARGET_DEVICES += cudy_tr3000-v1-ubootmod



From lede-commits at lists.infradead.org  Tue Dec 30 13:21:44 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 16:21:44 -0500
Subject: [openwrt/openwrt]  mediatek: add ubootmod layout for Cudy WBR3000UAX
 v1
In-Reply-To: <176712970259.3319952.11694098860118476963@git-01.infra.openwrt.org>
References: <176712970259.3319952.11694098860118476963@git-01.infra.openwrt.org>
Message-ID: <mailman.40056.1767129707.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/15df98f3b54d9ce0d3a7c7b238e1c7b4814a15d6

commit 15df98f3b54d9ce0d3a7c7b238e1c7b4814a15d6
Author: Fil Dunsky <filipp.dunsky at gmail.com>
AuthorDate: Fri Dec 12 18:51:39 2025 +0300

    mediatek: add ubootmod layout for Cudy WBR3000UAX v1
    
    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21225
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/uboot-mediatek/Makefile               |  12 +
 .../patches/449-add-cudy_wbr3000uax-v1.patch       | 355 +++++++++++++++++++++
 .../uboot-envtools/files/mediatek_filogic          |   1 +
 .../dts/mt7981b-cudy-wbr3000uax-v1-ubootmod.dts    |  24 ++
 .../filogic/base-files/etc/board.d/01_leds         |   3 +-
 .../etc/hotplug.d/ieee80211/11_fix_wifi_mac        |   1 +
 .../filogic/base-files/lib/upgrade/platform.sh     |   2 +
 target/linux/mediatek/image/filogic.mk             |  25 ++
 8 files changed, 422 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile
index 9d59e87f8c..fc10c07477 100644
--- a/package/boot/uboot-mediatek/Makefile
+++ b/package/boot/uboot-mediatek/Makefile
@@ -314,6 +314,17 @@ define U-Boot/mt7981_cudy_tr3000-v1
   DEPENDS:=+trusted-firmware-a-mt7981-cudy-ddr3
 endef
 
+define U-Boot/mt7981_cudy_wbr3000uax-v1
+  NAME:=Cudy WBR3000UAX v1
+  BUILD_SUBTARGET:=filogic
+  BUILD_DEVICES:=cudy_wbr3000uax-v1-ubootmod
+  UBOOT_CONFIG:=mt7981_cudy_wbr3000uax-v1
+  UBOOT_IMAGE:=u-boot.fip
+  BL2_BOOTDEV:=cudy-ddr3
+  BL2_SOC:=mt7981
+  DEPENDS:=+trusted-firmware-a-mt7981-cudy-ddr3
+endef
+
 define U-Boot/mt7981_glinet_gl-mt2500
   NAME:=GL.iNet GL-MT2500
   BUILD_SUBTARGET:=filogic
@@ -1091,6 +1102,7 @@ UBOOT_TARGETS := \
 	mt7981_cmcc_rax3000m-nand-ddr4 \
 	mt7981_comfast_cf-wr632ax \
 	mt7981_cudy_tr3000-v1 \
+	mt7981_cudy_wbr3000uax-v1 \
 	mt7981_gatonetworks_gdsp \
 	mt7981_glinet_gl-mt2500 \
 	mt7981_glinet_gl-x3000 \
diff --git a/package/boot/uboot-mediatek/patches/449-add-cudy_wbr3000uax-v1.patch b/package/boot/uboot-mediatek/patches/449-add-cudy_wbr3000uax-v1.patch
new file mode 100644
index 0000000000..1f948aa030
--- /dev/null
+++ b/package/boot/uboot-mediatek/patches/449-add-cudy_wbr3000uax-v1.patch
@@ -0,0 +1,355 @@
+--- /dev/null
++++ b/configs/mt7981_cudy_wbr3000uax-v1_defconfig
+@@ -0,0 +1,108 @@
++CONFIG_ARM=y
++CONFIG_SYS_HAS_NONCACHED_MEMORY=y
++CONFIG_POSITION_INDEPENDENT=y
++CONFIG_ARCH_MEDIATEK=y
++CONFIG_TEXT_BASE=0x41e00000
++CONFIG_SYS_MALLOC_F_LEN=0x4000
++CONFIG_NR_DRAM_BANKS=1
++CONFIG_DEFAULT_DEVICE_TREE="mt7981-cudy-wbr3000uax-v1"
++CONFIG_OF_LIBFDT_OVERLAY=y
++CONFIG_TARGET_MT7981=y
++CONFIG_SYS_LOAD_ADDR=0x46000000
++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
++CONFIG_DEBUG_UART_BASE=0x11002000
++CONFIG_DEBUG_UART_CLOCK=40000000
++CONFIG_DEBUG_UART=y
++CONFIG_FIT=y
++CONFIG_BOOTDELAY=30
++CONFIG_AUTOBOOT_KEYED=y
++CONFIG_AUTOBOOT_MENU_SHOW=y
++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cudy-wbr3000uax-v1.dtb"
++CONFIG_LOGLEVEL=7
++CONFIG_PRE_CONSOLE_BUFFER=y
++CONFIG_LOG=y
++# CONFIG_BOARD_INIT is not set
++CONFIG_BOARD_LATE_INIT=y
++CONFIG_HUSH_PARSER=y
++CONFIG_SYS_PROMPT="MT7981> "
++CONFIG_CMD_CPU=y
++CONFIG_CMD_LICENSE=y
++CONFIG_CMD_BOOTMENU=y
++CONFIG_CMD_ASKENV=y
++CONFIG_CMD_ERASEENV=y
++CONFIG_CMD_ENV_FLAGS=y
++CONFIG_CMD_STRINGS=y
++CONFIG_CMD_DM=y
++CONFIG_CMD_GPIO=y
++CONFIG_CMD_GPT=y
++CONFIG_CMD_MTD=y
++CONFIG_CMD_PART=y
++CONFIG_CMD_TFTPSRV=y
++CONFIG_CMD_RARP=y
++CONFIG_CMD_CDP=y
++CONFIG_CMD_SNTP=y
++CONFIG_CMD_LINK_LOCAL=y
++CONFIG_CMD_DHCP=y
++CONFIG_CMD_DNS=y
++CONFIG_CMD_PING=y
++CONFIG_CMD_PXE=y
++CONFIG_CMD_CACHE=y
++CONFIG_CMD_PSTORE=y
++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
++CONFIG_CMD_UUID=y
++CONFIG_CMD_HASH=y
++CONFIG_CMD_SMC=y
++CONFIG_CMD_UBI=y
++CONFIG_CMD_UBI_RENAME=y
++CONFIG_OF_EMBED=y
++CONFIG_ENV_OVERWRITE=y
++CONFIG_ENV_IS_IN_UBI=y
++CONFIG_ENV_REDUNDANT=y
++CONFIG_ENV_UBI_PART="ubi"
++CONFIG_ENV_UBI_VOLUME="ubootenv"
++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
++CONFIG_ENV_RELOC_GD_ENV_ADDR=y
++CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
++CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/cudy_wbr3000uax-v1_env"
++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
++CONFIG_VERSION_VARIABLE=y
++CONFIG_NETCONSOLE=y
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
++CONFIG_NET_RANDOM_ETHADDR=y
++CONFIG_REGMAP=y
++CONFIG_SYSCON=y
++CONFIG_BUTTON=y
++CONFIG_BUTTON_GPIO=y
++CONFIG_CLK=y
++CONFIG_GPIO_HOG=y
++CONFIG_LED=y
++CONFIG_LED_BLINK=y
++CONFIG_LED_GPIO=y
++# CONFIG_MMC is not set
++CONFIG_MTD=y
++CONFIG_DM_MTD=y
++CONFIG_MTD_SPI_NAND=y
++CONFIG_MTD_UBI_FASTMAP=y
++CONFIG_PHY_FIXED=y
++CONFIG_MEDIATEK_ETH=y
++CONFIG_PHY=y
++CONFIG_PINCTRL=y
++CONFIG_PINCONF=y
++CONFIG_PINCTRL_MT7981=y
++CONFIG_POWER_DOMAIN=y
++CONFIG_MTK_POWER_DOMAIN=y
++CONFIG_DM_REGULATOR=y
++CONFIG_DM_REGULATOR_FIXED=y
++CONFIG_DM_REGULATOR_GPIO=y
++CONFIG_RAM=y
++CONFIG_DM_SERIAL=y
++CONFIG_SERIAL_RX_BUFFER=y
++CONFIG_MTK_SERIAL=y
++CONFIG_SPI=y
++CONFIG_DM_SPI=y
++CONFIG_MTK_SPIM=y
++CONFIG_ZSTD=y
++CONFIG_HEXDUMP=y
+--- /dev/null
++++ b/arch/arm/dts/mt7981-cudy-wbr3000uax-v1.dts
+@@ -0,0 +1,184 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++
++/dts-v1/;
++#include "mt7981.dtsi"
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/linux-event-codes.h>
++
++/ {
++	#address-cells = <1>;
++	#size-cells = <1>;
++	model = "Cudy WBR3000UAX v1";
++	compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
++
++	chosen {
++		stdout-path = &uart0;
++		tick-timer = &timer0;
++	};
++
++	memory at 40000000 {
++		device_type = "memory";
++		reg = <0x40000000 0x20000000>;
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++
++		button-reset {
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
++		};
++
++		button-wps {
++			label = "wps";
++			linux,code = <KEY_WPS_BUTTON>;
++			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	gpio-leds {
++		compatible = "gpio-leds";
++
++		led_status: led_power {
++			label = "blue:power";
++			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
++		};
++
++		led_wan_blue {
++			label = "blue:wan";
++			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
++		};
++		
++		led_wan_red {
++			label = "red:wan";
++			gpios = <&pio 4 GPIO_ACTIVE_LOW>;
++		};
++
++		led_lan {
++			label = "blue:lan";
++			gpios = <&pio 11 GPIO_ACTIVE_LOW>;
++		};
++
++		led_wps_blue {
++			label = "blue:wps";
++			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
++		};
++
++		led_wps_red {
++			label = "red:wps";
++			gpios = <&pio 5 GPIO_ACTIVE_LOW>;
++		};
++
++		led_wifi2g {
++			label = "blue:wifi2g";
++			gpios = <&pio 6 GPIO_ACTIVE_LOW>;
++		};
++
++		led_wifi5g {
++			label = "blue:wifi5g";
++			gpios = <&pio 7 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&eth {
++	status = "okay";
++	mediatek,gmac-id = <0>;
++	phy-mode = "2500base-x";
++	mediatek,switch = "mt7531";
++	reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
++
++	fixed-link {
++		speed = <2500>;
++		full-duplex;
++	};
++};
++
++&pio {
++	spi_flash_pins: spi0-pins-func-1 {
++		mux {
++			function = "flash";
++			groups = "spi0", "spi0_wp_hold";
++		};
++
++		conf-pu {
++			pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
++			drive-strength = <MTK_DRIVE_8mA>;
++			bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
++		};
++
++		conf-pd {
++			pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
++			drive-strength = <MTK_DRIVE_8mA>;
++			bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
++		};
++	};
++};
++
++&spi0 {
++	#address-cells = <1>;
++	#size-cells = <0>;
++	pinctrl-names = "default";
++	pinctrl-0 = <&spi_flash_pins>;
++	status = "okay";
++	must_tx;
++	enhance_timing;
++	dma_ext;
++	ipm_design;
++	support_quad;
++	tick_dly = <2>;
++	sample_sel = <0>;
++
++	spi_nand at 0 {
++		compatible = "spi-nand";
++		reg = <0>;
++		spi-max-frequency = <52000000>;
++
++		partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition at 0 {
++				label = "bl2";
++				reg = <0x0 0x100000>;
++			};
++
++			partition at 100000 {
++				label = "u-boot-env";
++				reg = <0x100000 0x80000>;
++			};
++
++			partition at 180000 {
++				label = "factory";
++				reg = <0x180000 0x200000>;
++			};
++
++			partition at 380000 {
++				label = "bdinfo";
++				reg = <0x380000 0x40000>;
++			};
++
++			partition at 3c0000 {
++				label = "fip";
++				reg = <0x3c0000 0x200000>;
++			};
++
++			partition at 5c0000 {
++				label = "ubi";
++				reg = <0x5c0000 0x7a40000>;
++				compatible = "linux,ubi";
++			};
++		};
++	};
++};
++
++&uart0 {
++	mediatek,force-highspeed;
++	status = "okay";
++};
++
++&watchdog {
++	status = "disabled";
++};
+--- /dev/null
++++ b/defenvs/cudy_wbr3000uax-v1_env
+@@ -0,0 +1,54 @@
++ipaddr=192.168.1.1
++serverip=192.168.1.254
++loadaddr=0x46000000
++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
++bootconf=config-1
++bootdelay=0
++bootfile=openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-initramfs-recovery.itb
++bootfile_bl2=openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-preloader.bin
++bootfile_fip=openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-bl31-uboot.fip
++bootfile_upg=openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-squashfs-sysupgrade.itb
++bootled_pwr=blue:power
++bootled_rec=red:wan
++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
++bootmenu_default=0
++bootmenu_delay=0
++bootmenu_title=      [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
++bootmenu_0=Initialize environment.=run _firstboot
++bootmenu_0d=Run default boot command.=run boot_default
++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
++bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
++bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
++bootmenu_8=Reboot.=reset
++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
++boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
++boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
++boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
++mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
++mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format
++ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
++ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
++_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title       [33m$ver[0m"
diff --git a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
index 2dfa68c697..deffb4bffd 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
+++ b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
@@ -28,6 +28,7 @@ asus,zenwifi-bt8-ubootmod|\
 cmcc,a10-ubootmod|\
 comfast,cf-wr632ax-ubootmod|\
 cudy,tr3000-v1-ubootmod|\
+cudy,wbr3000uax-v1-ubootmod|\
 h3c,magic-nx30-pro|\
 imou,hx21|\
 jcg,q30-pro|\
diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wbr3000uax-v1-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cudy-wbr3000uax-v1-ubootmod.dts
new file mode 100644
index 0000000000..8f2c3901f2
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-cudy-wbr3000uax-v1-ubootmod.dts
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7981b-cudy-wbr3000uax-v1.dtsi"
+
+/ {
+	model = "Cudy WBR3000UAX v1 (OpenWrt U-Boot layout)";
+	compatible = "cudy,wbr3000uax-v1-ubootmod", "mediatek,mt7981";
+
+	chosen {
+		bootargs = "root=/dev/fit0 rootwait";
+		rootdisk = <&ubi_rootdisk>;
+	};
+};
+
+&ubi {
+	reg = <0x5c0000 0x7a40000>;
+
+	volumes {
+		ubi_rootdisk: ubi-volume-fit {
+			volname = "fit";
+		};
+	};
+};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
index a42a72406e..324f478f5c 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
@@ -76,7 +76,8 @@ cudy,wr3000p-v1)
 	ucidef_set_led_netdev "wan" "wan" "white:wan" "wan" "link tx rx"
 	ucidef_set_led_netdev "internet" "internet" "white:wan-online" "wan" "link"
 	;;
-cudy,wbr3000uax-v1)
+cudy,wbr3000uax-v1|\
+cudy,wbr3000uax-v1-ubootmod)
 	ucidef_set_led_default "internet_off" "internet_off" "red:fault" "1"
 	ucidef_set_led_netdev "internet" "internet" "blue:wan-online" "wan" "link"
 	ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "tx rx"
diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
index 057ed79af9..60d4528227 100644
--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
@@ -91,6 +91,7 @@ case "$board" in
 	cudy,tr3000-v1|\
 	cudy,tr3000-v1-ubootmod|\
 	cudy,wbr3000uax-v1|\
+	cudy,wbr3000uax-v1-ubootmod|\
 	cudy,wr3000e-v1|\
 	cudy,wr3000s-v1|\
 	cudy,wr3000h-v1|\
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index 8ebbc7326b..074fe3ee8e 100644
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -91,6 +91,7 @@ platform_do_upgrade() {
 	cmcc,rax3000m|\
 	comfast,cf-wr632ax-ubootmod|\
 	cudy,tr3000-v1-ubootmod|\
+	cudy,wbr3000uax-v1-ubootmod|\
 	gatonetworks,gdsp|\
 	h3c,magic-nx30-pro|\
 	imou,hx21|\
@@ -279,6 +280,7 @@ platform_check_image() {
 	cmcc,rax3000m|\
 	comfast,cf-wr632ax-ubootmod|\
 	cudy,tr3000-v1-ubootmod|\
+	cudy,wbr3000uax-v1-ubootmod|\
 	gatonetworks,gdsp|\
 	h3c,magic-nx30-pro|\
 	jcg,q30-pro|\
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index c86666b857..be3a1d40d3 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1248,6 +1248,31 @@ define Device/cudy_wbr3000uax-v1
 endef
 TARGET_DEVICES += cudy_wbr3000uax-v1
 
+define Device/cudy_wbr3000uax-v1-ubootmod
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := WBR3000UAX
+  DEVICE_VARIANT := v1 (OpenWrt U-Boot layout)
+  DEVICE_DTS := mt7981b-cudy-wbr3000uax-v1-ubootmod
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  KERNEL_IN_UBI := 1
+  UBOOTENV_IN_UBI := 1
+  IMAGES := sysupgrade.itb
+  KERNEL_INITRAMFS_SUFFIX := -recovery.itb
+  KERNEL := kernel-bin | gzip
+  KERNEL_INITRAMFS := kernel-bin | lzma | \
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+  IMAGE/sysupgrade.itb := append-kernel | \
+	fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+  ARTIFACTS := preloader.bin bl31-uboot.fip
+  ARTIFACT/preloader.bin := mt7981-bl2 cudy-ddr3
+  ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot cudy_wbr3000uax-v1
+endef
+TARGET_DEVICES += cudy_wbr3000uax-v1-ubootmod
+
 define Device/dlink_aquila-pro-ai-m30-a1
   DEVICE_VENDOR := D-Link
   DEVICE_MODEL := AQUILA PRO AI M30



From lede-commits at lists.infradead.org  Tue Dec 30 13:21:43 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 16:21:43 -0500
Subject: [openwrt/openwrt]  mediatek: add support for Cudy WBR3000UAX v1
In-Reply-To: <176712970259.3319952.11694098860118476963@git-01.infra.openwrt.org>
References: <176712970259.3319952.11694098860118476963@git-01.infra.openwrt.org>
Message-ID: <mailman.40057.1767129714.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d7d6faf26f39b59d22c38d09321e0d345fbec950

commit d7d6faf26f39b59d22c38d09321e0d345fbec950
Author: Fil Dunsky <filipp.dunsky at gmail.com>
AuthorDate: Fri Dec 12 16:16:50 2025 +0300

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21225
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../mediatek/dts/mt7981b-cudy-wbr3000uax-v1.dts    |   9 ++
 .../mediatek/dts/mt7981b-cudy-wbr3000uax-v1.dtsi   | 137 +++++++++++++++++++++
 .../mediatek/dts/mt7981b-cudy-wr3000-nand.dtsi     |   2 +-
 .../filogic/base-files/etc/board.d/01_leds         |   7 ++
 .../etc/hotplug.d/ieee80211/11_fix_wifi_mac        |   1 +
 target/linux/mediatek/image/filogic.mk             |  17 +++
 6 files changed, 172 insertions(+), 1 deletion(-)

diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wbr3000uax-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wbr3000uax-v1.dts
new file mode 100644
index 0000000000..9402a319de
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-cudy-wbr3000uax-v1.dts
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7981b-cudy-wbr3000uax-v1.dtsi"
+
+/ {
+	model = "Cudy WBR3000UAX v1";
+	compatible = "cudy,wbr3000uax-v1", "mediatek,mt7981";
+};
diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wbr3000uax-v1.dtsi b/target/linux/mediatek/dts/mt7981b-cudy-wbr3000uax-v1.dtsi
new file mode 100644
index 0000000000..bd097cc844
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-cudy-wbr3000uax-v1.dtsi
@@ -0,0 +1,137 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include "mt7981b-cudy-wr3000-nand.dtsi"
+
+/ {
+	aliases {
+		label-mac-device = &gmac0;
+		led-boot = &led_status;
+		led-failsafe = &led_warning;
+		led-running = &led_status;
+		led-upgrade = &led_warning;
+		serial0 = &uart0;
+	};
+	
+	leds {
+		compatible = "gpio-leds";
+
+		led_status: led_power {
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
+		};
+
+		led_internet {
+			function = LED_FUNCTION_WAN_ONLINE;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+		};
+		
+		led_warning: led_fault {
+			function = LED_FUNCTION_FAULT;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&pio 4 GPIO_ACTIVE_LOW>;
+		};
+
+		led_wan {
+			function = LED_FUNCTION_WAN;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 11 GPIO_ACTIVE_LOW>;
+		};
+
+		led_lan {
+			function = LED_FUNCTION_LAN;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+		};
+
+		led_wps {
+			function = LED_FUNCTION_WPS;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&pio 5 GPIO_ACTIVE_LOW>;
+		};
+
+		led_wifi2g {
+			function = LED_FUNCTION_WLAN_2GHZ;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		led_wifi5g {
+			function = LED_FUNCTION_WLAN_5GHZ;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+	};
+
+	usb_vbus: regulator-usb {
+		compatible = "regulator-fixed";
+		regulator-name = "usb-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&pio 35 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-boot-on;
+	};
+};
+
+&switch {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port at 0 {
+			reg = <0>;
+			label = "wan";
+
+			nvmem-cell-names = "mac-address";
+			nvmem-cells = <&macaddr_bdinfo_de00 1>;
+		};
+
+		port at 1 {
+			reg = <1>;
+			label = "lan1";
+		};
+
+		port at 2 {
+			reg = <2>;
+			label = "lan2";
+		};
+
+		port at 3 {
+			reg = <3>;
+			label = "lan3";
+		};
+
+		port at 4 {
+			reg = <4>;
+			label = "lan4";
+		};
+
+		port at 6 {
+			reg = <6>;
+			label = "cpu";
+			ethernet = <&gmac0>;
+			phy-mode = "2500base-x";
+
+			fixed-link {
+				speed = <2500>;
+				full-duplex;
+				pause;
+			};
+		};
+	};
+};
+
+&usb_phy {
+	status = "okay";
+};
+
+&xhci {
+	status = "okay";
+	vbus-supply = <&usb_vbus>;
+};
diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-nand.dtsi b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-nand.dtsi
index 3a1d60101d..a3e4c7e4fe 100644
--- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-nand.dtsi
+++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-nand.dtsi
@@ -146,7 +146,7 @@
 				read-only;
 			};
 
-			partition at 5c0000 {
+			ubi: partition at 5c0000 {
 				label = "ubi";
 				reg = <0x5c0000 0x4000000>;
 				compatible = "linux,ubi";
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
index bb8283a3d0..a42a72406e 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
@@ -76,6 +76,13 @@ cudy,wr3000p-v1)
 	ucidef_set_led_netdev "wan" "wan" "white:wan" "wan" "link tx rx"
 	ucidef_set_led_netdev "internet" "internet" "white:wan-online" "wan" "link"
 	;;
+cudy,wbr3000uax-v1)
+	ucidef_set_led_default "internet_off" "internet_off" "red:fault" "1"
+	ucidef_set_led_netdev "internet" "internet" "blue:wan-online" "wan" "link"
+	ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "tx rx"
+	ucidef_set_led_default "lan_off" "lan_off" "red:wps" "1"
+	ucidef_set_led_netdev "lan" "lan" "blue:lan" "br-lan" "link tx rx"
+	;;
 elecom,wrc-x3000gs3)
 	ucidef_set_led_netdev "wan" "wan" "green:wan" "wan"
 	;;
diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
index 8ced69c152..057ed79af9 100644
--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
@@ -90,6 +90,7 @@ case "$board" in
 	cudy,tr3000-256mb-v1|\
 	cudy,tr3000-v1|\
 	cudy,tr3000-v1-ubootmod|\
+	cudy,wbr3000uax-v1|\
 	cudy,wr3000e-v1|\
 	cudy,wr3000s-v1|\
 	cudy,wr3000h-v1|\
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 4d5ca41835..c86666b857 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1231,6 +1231,23 @@ define Device/cudy_wr3000p-v1
 endef
 TARGET_DEVICES += cudy_wr3000p-v1
 
+define Device/cudy_wbr3000uax-v1
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := WBR3000UAX
+  DEVICE_VARIANT := v1
+  DEVICE_DTS := mt7981b-cudy-wbr3000uax-v1
+  DEVICE_DTS_DIR := ../dts
+  SUPPORTED_DEVICES += R120
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  IMAGE_SIZE := 65536k
+  KERNEL_IN_UBI := 1
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+endef
+TARGET_DEVICES += cudy_wbr3000uax-v1
+
 define Device/dlink_aquila-pro-ai-m30-a1
   DEVICE_VENDOR := D-Link
   DEVICE_MODEL := AQUILA PRO AI M30



From lede-commits at lists.infradead.org  Tue Dec 30 13:35:46 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 16:35:46 -0500
Subject: [openwrt/openwrt]  uboot-mediatek: comfast,cf-wr632ax: fix missing
 escape sequence
In-Reply-To: <176713054629.3344144.6047444116680197143@git-01.infra.openwrt.org>
References: <176713054629.3344144.6047444116680197143@git-01.infra.openwrt.org>
Message-ID: <mailman.40064.1767130551.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3af16b2359691adf0e4ff4fa9302e40f4b494985

commit 3af16b2359691adf0e4ff4fa9302e40f4b494985
Author: Andrii Kuiukoff <andros.ua at gmail.com>
AuthorDate: Wed Dec 24 19:50:40 2025 +0200

    uboot-mediatek: comfast,cf-wr632ax: fix missing escape sequence
    
    Add missing escape sequence to restore terminal coloring in the OpenWrt U-Boot boot menu.
    
    Signed-off-by: Andrii Kuiukoff <andros.ua at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21283
    [Fix _bootmenu_update_title too]
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch b/package/boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch
index 24762424a2..e277410564 100644
--- a/package/boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch
+++ b/package/boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch
@@ -283,7 +283,7 @@
 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
 +bootmenu_default=0
 +bootmenu_delay=0
-+bootmenu_title=      [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
++bootmenu_title=      [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
 +bootmenu_0=Initialize environment.=run _firstboot
 +bootmenu_0d=Run default boot command.=run boot_default
 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
@@ -291,8 +291,8 @@
 +bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
 +bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
 +bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
-+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
-+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
++bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
++bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
 +bootmenu_8=Reboot.=reset
 +bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
 +boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
@@ -320,4 +320,4 @@
 +_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
 +_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
-+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title       [33m$ver[0m"
++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title       [33m$ver[0m"



From lede-commits at lists.infradead.org  Tue Dec 30 14:00:33 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 17:00:33 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: fix supported_devices list for
 gl-mt2500
In-Reply-To: <176713203340.3382697.11514231467878719647@git-01.infra.openwrt.org>
References: <176713203340.3382697.11514231467878719647@git-01.infra.openwrt.org>
Message-ID: <mailman.40065.1767132037.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b71f4665cda10c284c9460409ae30fb9b0beecf8

commit b71f4665cda10c284c9460409ae30fb9b0beecf8
Author: Eric Fahlgren <ericfahlgren at gmail.com>
AuthorDate: Mon Nov 3 12:34:37 2025 -0800

    mediatek: filogic: fix supported_devices list for gl-mt2500
    
    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20632
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mediatek/image/filogic.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index be3a1d40d3..77172fe560 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1379,7 +1379,7 @@ define Device/glinet_gl-mt2500
   DEVICE_DTS_DIR := ../dts
   DEVICE_DTS_LOADADDR := 0x47000000
   DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3
-  SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500-airoha
+  SUPPORTED_DEVICES += glinet,mt2500-emmc
   IMAGES := sysupgrade.bin factory.bin
   IMAGE/factory.bin := append-kernel | pad-to 32M | append-rootfs
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
@@ -1397,7 +1397,7 @@ define Device/glinet_gl-mt2500-airoha
   DEVICE_DTS_DIR := ../dts
   DEVICE_DTS_LOADADDR := 0x47000000
   DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-phy-airoha-en8811h airoha-en8811h-firmware
-  SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500
+  SUPPORTED_DEVICES += glinet,mt2500-emmc
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
 endef



From lede-commits at lists.infradead.org  Tue Dec 30 14:04:10 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 17:04:10 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: fix supported_devices list for
 gl-mt2500
In-Reply-To: <176713224946.3388303.10357365779684846149@git-01.infra.openwrt.org>
References: <176713224946.3388303.10357365779684846149@git-01.infra.openwrt.org>
Message-ID: <mailman.40066.1767132254.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/0d3e93e7ba40e10d8d87df030a307d29aa1f5d42

commit 0d3e93e7ba40e10d8d87df030a307d29aa1f5d42
Author: Eric Fahlgren <ericfahlgren at gmail.com>
AuthorDate: Mon Nov 3 12:34:37 2025 -0800

    mediatek: filogic: fix supported_devices list for gl-mt2500
    
    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20632
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit b71f4665cda10c284c9460409ae30fb9b0beecf8)
---
 target/linux/mediatek/image/filogic.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 2e4a0b48a3..5acbae25db 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1306,7 +1306,7 @@ define Device/glinet_gl-mt2500
   DEVICE_DTS_DIR := ../dts
   DEVICE_DTS_LOADADDR := 0x47000000
   DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3
-  SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500-airoha
+  SUPPORTED_DEVICES += glinet,mt2500-emmc
   IMAGES := sysupgrade.bin factory.bin
   IMAGE/factory.bin := append-kernel | pad-to 32M | append-rootfs
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
@@ -1324,7 +1324,7 @@ define Device/glinet_gl-mt2500-airoha
   DEVICE_DTS_DIR := ../dts
   DEVICE_DTS_LOADADDR := 0x47000000
   DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-phy-airoha-en8811h airoha-en8811h-firmware
-  SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500
+  SUPPORTED_DEVICES += glinet,mt2500-emmc
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
 endef



From lede-commits at lists.infradead.org  Tue Dec 30 14:04:09 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 17:04:09 -0500
Subject: [openwrt/openwrt]  uboot-mediatek: comfast,cf-wr632ax: fix missing
 escape sequence
In-Reply-To: <176713224946.3388303.10357365779684846149@git-01.infra.openwrt.org>
References: <176713224946.3388303.10357365779684846149@git-01.infra.openwrt.org>
Message-ID: <mailman.40067.1767132254.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/234b367b10bd90dc48be9820f3d244bc96660644

commit 234b367b10bd90dc48be9820f3d244bc96660644
Author: Andrii Kuiukoff <andros.ua at gmail.com>
AuthorDate: Wed Dec 24 19:50:40 2025 +0200

    uboot-mediatek: comfast,cf-wr632ax: fix missing escape sequence
    
    Add missing escape sequence to restore terminal coloring in the OpenWrt U-Boot boot menu.
    
    Signed-off-by: Andrii Kuiukoff <andros.ua at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21283
    [Fix _bootmenu_update_title too]
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 3af16b2359691adf0e4ff4fa9302e40f4b494985)
---
 .../boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch b/package/boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch
index 24762424a2..e277410564 100644
--- a/package/boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch
+++ b/package/boot/uboot-mediatek/patches/448-add-comfast_cf-wr632ax.patch
@@ -283,7 +283,7 @@
 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
 +bootmenu_default=0
 +bootmenu_delay=0
-+bootmenu_title=      [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
++bootmenu_title=      [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
 +bootmenu_0=Initialize environment.=run _firstboot
 +bootmenu_0d=Run default boot command.=run boot_default
 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
@@ -291,8 +291,8 @@
 +bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
 +bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
 +bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
-+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
-+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
++bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
++bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
 +bootmenu_8=Reboot.=reset
 +bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
 +boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
@@ -320,4 +320,4 @@
 +_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
 +_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
-+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title       [33m$ver[0m"
++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title       [33m$ver[0m"



From lede-commits at lists.infradead.org  Tue Dec 30 14:05:54 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 30 Dec 2025 17:05:54 -0500
Subject: [openwrt/openwrt]  mediatek: filogic: fix supported_devices list for
 gl-mt2500
In-Reply-To: <176713235435.3390712.13996703984991964135@git-01.infra.openwrt.org>
References: <176713235435.3390712.13996703984991964135@git-01.infra.openwrt.org>
Message-ID: <mailman.40068.1767132359.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/dcf11c832a95595e6b919b88d6cd649bd9343a1f

commit dcf11c832a95595e6b919b88d6cd649bd9343a1f
Author: Eric Fahlgren <ericfahlgren at gmail.com>
AuthorDate: Mon Nov 3 12:34:37 2025 -0800

    mediatek: filogic: fix supported_devices list for gl-mt2500
    
    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20632
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit b71f4665cda10c284c9460409ae30fb9b0beecf8)
---
 target/linux/mediatek/image/filogic.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index e33f8a3aec..fda38fbec2 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -980,7 +980,7 @@ define Device/glinet_gl-mt2500
   DEVICE_DTS_DIR := ../dts
   DEVICE_DTS_LOADADDR := 0x47000000
   DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3
-  SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500-airoha
+  SUPPORTED_DEVICES += glinet,mt2500-emmc
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
 endef
@@ -994,7 +994,7 @@ define Device/glinet_gl-mt2500-airoha
   DEVICE_DTS_DIR := ../dts
   DEVICE_DTS_LOADADDR := 0x47000000
   DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-phy-airoha-en8811h airoha-en8811h-firmware
-  SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500
+  SUPPORTED_DEVICES += glinet,mt2500-emmc
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
 endef



From lede-commits at lists.infradead.org  Wed Dec 31 00:43:34 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 03:43:34 -0500
Subject: [openwrt/openwrt]  kernel: r8101: fix CFLAGS with linux 6.15+
In-Reply-To: <176717061445.737969.15786565808591972156@git-01.infra.openwrt.org>
References: <176717061445.737969.15786565808591972156@git-01.infra.openwrt.org>
Message-ID: <mailman.40153.1767170619.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b3d27b0115917f37f416460e3f1d458620374b99

commit b3d27b0115917f37f416460e3f1d458620374b99
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Tue Dec 30 14:44:10 2025 +0100

    kernel: r8101: fix CFLAGS with linux 6.15+
    
    Fix r8101 module CFLAGS with kernels >= v6.15.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/kernel/r8101/Makefile                      |  2 +-
 .../002-Makefile-fix-CFLAGS-with-linux-6.15.patch  | 26 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/package/kernel/r8101/Makefile b/package/kernel/r8101/Makefile
index f37e9acd0f..993e0de13a 100644
--- a/package/kernel/r8101/Makefile
+++ b/package/kernel/r8101/Makefile
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=r8101
 PKG_VERSION:=1.039.00
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/openwrt/rtl8101/releases/download/$(PKG_VERSION)
diff --git a/package/kernel/r8101/patches/002-Makefile-fix-CFLAGS-with-linux-6.15.patch b/package/kernel/r8101/patches/002-Makefile-fix-CFLAGS-with-linux-6.15.patch
new file mode 100644
index 0000000000..22f5657c63
--- /dev/null
+++ b/package/kernel/r8101/patches/002-Makefile-fix-CFLAGS-with-linux-6.15.patch
@@ -0,0 +1,26 @@
+From 1bb099396afa88077b93bfdbd4d20dbdacea36eb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari at gmail.com>
+Date: Tue, 30 Dec 2025 14:38:03 +0100
+Subject: [PATCH] Makefile: fix CFLAGS with linux 6.15+
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Ensure EXTRA_CFLAGS are taken into account.
+
+Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
+---
+ src/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -64,6 +64,8 @@ ifneq ($(KERNELRELEASE),)
+ 	ifeq ($(CONFIG_CTAP_SHORT_OFF), y)
+ 		EXTRA_CFLAGS += -DCONFIG_CTAP_SHORT_OFF
+ 	endif
++
++	ccflags-y += $(EXTRA_CFLAGS)
+ else
+ 	BASEDIR := /lib/modules/$(shell uname -r)
+ 	KERNELDIR ?= $(BASEDIR)/build



From lede-commits at lists.infradead.org  Wed Dec 31 00:43:35 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 03:43:35 -0500
Subject: [openwrt/openwrt]  kernel: r8168: fix CFLAGS with linux 6.15+
In-Reply-To: <176717061445.737969.15786565808591972156@git-01.infra.openwrt.org>
References: <176717061445.737969.15786565808591972156@git-01.infra.openwrt.org>
Message-ID: <mailman.40154.1767170620.2093109.lede-commits@lists.infradead.org>

noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8b93c563add283612700a5fac8191e1d79895143

commit 8b93c563add283612700a5fac8191e1d79895143
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Tue Dec 30 14:45:15 2025 +0100

    kernel: r8168: fix CFLAGS with linux 6.15+
    
    Fix r8168 module CFLAGS with kernels >= v6.15.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/kernel/r8168/Makefile                      |  2 +-
 .../002-Makefile-fix-CFLAGS-with-linux-6.15.patch  | 26 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/package/kernel/r8168/Makefile b/package/kernel/r8168/Makefile
index 182950a624..812cbad61d 100644
--- a/package/kernel/r8168/Makefile
+++ b/package/kernel/r8168/Makefile
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=r8168
 PKG_VERSION:=8.055.00
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/openwrt/rtl8168/releases/download/$(PKG_VERSION)
diff --git a/package/kernel/r8168/patches/002-Makefile-fix-CFLAGS-with-linux-6.15.patch b/package/kernel/r8168/patches/002-Makefile-fix-CFLAGS-with-linux-6.15.patch
new file mode 100644
index 0000000000..b3250db616
--- /dev/null
+++ b/package/kernel/r8168/patches/002-Makefile-fix-CFLAGS-with-linux-6.15.patch
@@ -0,0 +1,26 @@
+From b5a3eaec6a4ba859602a286fcb5034cf3f25fc55 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari at gmail.com>
+Date: Tue, 30 Dec 2025 14:35:03 +0100
+Subject: [PATCH] Makefile: fix CFLAGS with linux 6.15+
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Ensure EXTRA_CFLAGS are taken into account.
+
+Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
+---
+ src/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -121,6 +121,8 @@ ifneq ($(KERNELRELEASE),)
+ 	ifeq ($(ENABLE_GIGA_LITE), y)
+ 		EXTRA_CFLAGS += -DENABLE_GIGA_LITE
+ 	endif
++
++	ccflags-y += $(EXTRA_CFLAGS)
+ else
+ 	BASEDIR := /lib/modules/$(shell uname -r)
+ 	KERNELDIR ?= $(BASEDIR)/build



From lede-commits at lists.infradead.org  Wed Dec 31 08:55:48 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 11:55:48 -0500
Subject: [openwrt/openwrt]  generic: add missing symbol
In-Reply-To: <176720014810.2038552.4035372748439696501@git-01.infra.openwrt.org>
References: <176720014810.2038552.4035372748439696501@git-01.infra.openwrt.org>
Message-ID: <mailman.40216.1767200162.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b3d1da911561736942e7deb19777e0fc518d1009

commit b3d1da911561736942e7deb19777e0fc518d1009
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Fri Dec 19 16:37:38 2025 -0500

    generic: add missing symbol
    
    Set SND_SOC_NAU8325 to no
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21329
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/generic/config-6.12 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/generic/config-6.12 b/target/linux/generic/config-6.12
index fda78b422e..b657e6cc67 100644
--- a/target/linux/generic/config-6.12
+++ b/target/linux/generic/config-6.12
@@ -6240,6 +6240,7 @@ CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y
 # CONFIG_SND_SOC_MT8365 is not set
 # CONFIG_SND_SOC_MTK_BTCVSD is not set
 # CONFIG_SND_SOC_NAU8315 is not set
+# CONFIG_SND_SOC_NAU8325 is not set
 # CONFIG_SND_SOC_NAU8540 is not set
 # CONFIG_SND_SOC_NAU8810 is not set
 # CONFIG_SND_SOC_NAU8821 is not set



From lede-commits at lists.infradead.org  Wed Dec 31 08:55:49 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 11:55:49 -0500
Subject: [openwrt/openwrt]  kernel: bump 6.12 to 6.12.63
In-Reply-To: <176720014810.2038552.4035372748439696501@git-01.infra.openwrt.org>
References: <176720014810.2038552.4035372748439696501@git-01.infra.openwrt.org>
Message-ID: <mailman.40217.1767200162.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b638d886f05caa655986e973fa17eebfe0a643b0

commit b638d886f05caa655986e973fa17eebfe0a643b0
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Thu Dec 18 10:10:55 2025 -0500

    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 at gmail.com>
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21329
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 ...avoid-reading-flash-page-settings-from-SN.patch |   4 +-
 ...snfi-en7523-workaround-flash-damaging-if-.patch | 102 ---------------------
 ...pport-for-all-the-downstream-rpi-sound-ca.patch |  16 ++--
 ...usb-dwc3-Set-DMA-and-coherent-masks-early.patch |   4 +-
 ...-brcmstb-l2-Add-config-for-2711-controlle.patch |   2 +-
 .../linux/generic/hack-6.12/902-debloat_proc.patch |   2 +-
 target/linux/generic/kernel-6.12                   |   4 +-
 ...ft_flow_offload-handle-netdevice-events-f.patch |   2 +-
 ...13-remoteproc-qcom-Add-secure-PIL-support.patch |   2 +-
 ...qcom-Update-regmap-offsets-for-halt-regis.patch |  22 -----
 .../850-awake-rt305x-dwc2-controller.patch         |   2 +-
 .../patches-6.12/318-add-rtl83xx-clk-support.patch |   2 +-
 ...-rockchip-Split-up-RK3588-s-PCIe-pinctrls.patch |   4 +-
 ...rm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch |   4 +-
 ...ockchip-Fix-label-name-of-hdptxphy-for-RK.patch |   2 +-
 ...ockchip-Add-GPU-power-domain-regulator-de.patch |   2 +-
 ...ckchip-Update-LED-properties-for-Radxa-Ro.patch |   2 +-
 .../005-clk-add-drivers-for-siflower-socs.patch    |   2 +-
 18 files changed, 28 insertions(+), 152 deletions(-)

diff --git a/target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch b/target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch
index c785ae8d56..00fd100bc3 100644
--- a/target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch
+++ b/target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch
@@ -158,7 +158,7 @@ Signed-off-by: Mark Brown <broonie at kernel.org>
  	.supports_op = airoha_snand_supports_op,
  	.exec_op = airoha_snand_exec_op,
  	.dirmap_create = airoha_snand_dirmap_create,
-@@ -1101,36 +1026,6 @@ static int airoha_snand_setup(struct spi
+@@ -1106,36 +1031,6 @@ static int airoha_snand_setup(struct spi
  	return 0;
  }
  
@@ -195,7 +195,7 @@ Signed-off-by: Mark Brown <broonie at kernel.org>
  static const struct regmap_config spi_ctrl_regmap_config = {
  	.name		= "ctrl",
  	.reg_bits	= 32,
-@@ -1204,7 +1099,7 @@ static int airoha_snand_probe(struct pla
+@@ -1227,7 +1122,7 @@ static int airoha_snand_probe(struct pla
  	ctrl->setup = airoha_snand_setup;
  	device_set_node(&ctrl->dev, dev_fwnode(dev));
  
diff --git a/target/linux/airoha/patches-6.12/029-14-v6.19-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch b/target/linux/airoha/patches-6.12/029-14-v6.19-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch
deleted file mode 100644
index cd5962445e..0000000000
--- a/target/linux/airoha/patches-6.12/029-14-v6.19-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-From 061795b345aff371df8f71d54ae7c7dc8ae630d0 Mon Sep 17 00:00:00 2001
-From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Wed, 26 Nov 2025 02:40:45 +0300
-Subject: [PATCH 14/14] spi: airoha-snfi: en7523: workaround flash damaging if
- UART_TXD was short to GND
-
-Airoha EN7523 specific bug
---------------------------
-We found that some serial console may pull TX line to GROUND during board
-boot time. Airoha uses TX line as one of its bootstrap pins. On the EN7523
-SoC this may lead to booting in RESERVED boot mode.
-
-It was found that some flashes operates incorrectly in RESERVED mode.
-Micron and Skyhigh flashes are definitely affected by the issue,
-Winbond flashes are not affected.
-
-Details:
---------
-DMA reading of odd pages on affected flashes operates incorrectly. Page
-reading offset (start of the page) on hardware level is replaced by 0x10.
-Thus results in incorrect data reading. As result OS loading becomes
-impossible.
-
-Usage of UBI make things even worse. On attaching, UBI will detects
-corruptions (because of wrong reading of odd pages) and will try to
-recover. For recovering UBI will erase and write 'damaged' blocks with
-a valid information. This will destroy all UBI data.
-
-Non-DMA reading is OK.
-
-This patch detects booting in reserved mode, turn off DMA and print big
-fat warning.
-
-It's worth noting that the boot configuration is preserved across reboots.
-Therefore, to boot normally, you should do the following:
-- disconnect the serial console from the board,
-- power cycle the board.
-
-Fixes: a403997c12019 ("spi: airoha: add SPI-NAND Flash controller driver")
-Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
-Reviewed-by: Andy Shevchenko <andriy.shevchenko at intel.com>
-Link: https://patch.msgid.link/20251125234047.1101985-2-mikhail.kshevetskiy at iopsys.eu
-Signed-off-by: Mark Brown <broonie at kernel.org>
----
- drivers/spi/spi-airoha-snfi.c | 25 ++++++++++++++++++++++++-
- 1 file changed, 24 insertions(+), 1 deletion(-)
-
---- a/drivers/spi/spi-airoha-snfi.c
-+++ b/drivers/spi/spi-airoha-snfi.c
-@@ -1013,6 +1013,11 @@ static const struct spi_controller_mem_o
- 	.dirmap_write = airoha_snand_dirmap_write,
- };
- 
-+static const struct spi_controller_mem_ops airoha_snand_nodma_mem_ops = {
-+	.supports_op = airoha_snand_supports_op,
-+	.exec_op = airoha_snand_exec_op,
-+};
-+
- static int airoha_snand_setup(struct spi_device *spi)
- {
- 	struct airoha_snand_ctrl *as_ctrl;
-@@ -1057,7 +1062,9 @@ static int airoha_snand_probe(struct pla
- 	struct airoha_snand_ctrl *as_ctrl;
- 	struct device *dev = &pdev->dev;
- 	struct spi_controller *ctrl;
-+	bool dma_enable = true;
- 	void __iomem *base;
-+	u32 sfc_strap;
- 	int err;
- 
- 	ctrl = devm_spi_alloc_host(dev, sizeof(*as_ctrl));
-@@ -1092,12 +1099,28 @@ static int airoha_snand_probe(struct pla
- 		return dev_err_probe(dev, PTR_ERR(as_ctrl->spi_clk),
- 				     "unable to get spi clk\n");
- 
-+	if (device_is_compatible(dev, "airoha,en7523-snand")) {
-+		err = regmap_read(as_ctrl->regmap_ctrl,
-+				  REG_SPI_CTRL_SFC_STRAP, &sfc_strap);
-+		if (err)
-+			return err;
-+
-+		if (!(sfc_strap & 0x04)) {
-+			dma_enable = false;
-+			dev_warn(dev, "Detected booting in RESERVED mode (UART_TXD was short to GND).\n");
-+			dev_warn(dev, "This mode is known for incorrect DMA reading of some flashes.\n");
-+			dev_warn(dev, "Much slower PIO mode will be used to prevent flash data damage.\n");
-+			dev_warn(dev, "Unplug UART cable and power cycle board to get full performance.\n");
-+		}
-+	}
-+
- 	err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
- 	if (err)
- 		return err;
- 
- 	ctrl->num_chipselect = 2;
--	ctrl->mem_ops = &airoha_snand_mem_ops;
-+	ctrl->mem_ops = dma_enable ? &airoha_snand_mem_ops
-+				   : &airoha_snand_nodma_mem_ops;
- 	ctrl->bits_per_word_mask = SPI_BPW_MASK(8);
- 	ctrl->mode_bits = SPI_RX_DUAL;
- 	ctrl->setup = airoha_snand_setup;
diff --git a/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch b/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch
index 61b880bb43..3bf4122503 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0073-ASoC-Add-support-for-all-the-downstream-rpi-sound-ca.patch
@@ -15556,7 +15556,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  	imply SND_SOC_MAX98088
  	imply SND_SOC_MAX98090
  	imply SND_SOC_MAX98095
-@@ -175,6 +177,7 @@ config SND_SOC_ALL_CODECS
+@@ -176,6 +178,7 @@ config SND_SOC_ALL_CODECS
  	imply SND_SOC_PCM179X_SPI
  	imply SND_SOC_PCM186X_I2C
  	imply SND_SOC_PCM186X_SPI
@@ -15564,7 +15564,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  	imply SND_SOC_PCM3008
  	imply SND_SOC_PCM3060_I2C
  	imply SND_SOC_PCM3060_SPI
-@@ -267,6 +270,7 @@ config SND_SOC_ALL_CODECS
+@@ -268,6 +271,7 @@ config SND_SOC_ALL_CODECS
  	imply SND_SOC_TLV320ADCX140
  	imply SND_SOC_TLV320AIC23_I2C
  	imply SND_SOC_TLV320AIC23_SPI
@@ -15572,7 +15572,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  	imply SND_SOC_TLV320AIC26
  	imply SND_SOC_TLV320AIC31XX
  	imply SND_SOC_TLV320AIC32X4_I2C
-@@ -424,12 +428,12 @@ config SND_SOC_AD193X
+@@ -425,12 +429,12 @@ config SND_SOC_AD193X
  	tristate
  
  config SND_SOC_AD193X_SPI
@@ -15587,7 +15587,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  	depends on I2C
  	select SND_SOC_AD193X
  
-@@ -1229,6 +1233,13 @@ config SND_SOC_LOCHNAGAR_SC
+@@ -1230,6 +1234,13 @@ config SND_SOC_LOCHNAGAR_SC
  	  This driver support the sound card functionality of the Cirrus
  	  Logic Lochnagar audio development board.
  
@@ -15601,7 +15601,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  config SND_SOC_MADERA
  	tristate
  	default y if SND_SOC_CS47L15=y
-@@ -1638,6 +1649,10 @@ config SND_SOC_RT5616
+@@ -1639,6 +1650,10 @@ config SND_SOC_RT5616
  	tristate "Realtek RT5616 CODEC"
  	depends on I2C
  
@@ -15612,7 +15612,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  config SND_SOC_RT5631
  	tristate "Realtek ALC5631/RT5631 CODEC"
  	depends on I2C
-@@ -1995,6 +2010,9 @@ config SND_SOC_TFA9879
+@@ -1996,6 +2011,9 @@ config SND_SOC_TFA9879
  	tristate "NXP Semiconductors TFA9879 amplifier"
  	depends on I2C
  
@@ -15622,7 +15622,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  config SND_SOC_TFA989X
  	tristate "NXP/Goodix TFA989X (TFA1) amplifiers"
  	depends on I2C
-@@ -2596,4 +2614,8 @@ config SND_SOC_LPASS_TX_MACRO
+@@ -2601,4 +2619,8 @@ config SND_SOC_LPASS_TX_MACRO
  	select SND_SOC_LPASS_MACRO_COMMON
  	tristate "Qualcomm TX Macro in LPASS(Low Power Audio SubSystem)"
  
@@ -15633,7 +15633,7 @@ Signed-off-by: j-schambacher <joerg at hifiberry.com>
  endmenu
 --- a/sound/soc/codecs/Makefile
 +++ b/sound/soc/codecs/Makefile
-@@ -820,3 +820,12 @@ obj-$(CONFIG_SND_SOC_LPASS_TX_MACRO)	+=
+@@ -822,3 +822,12 @@ obj-$(CONFIG_SND_SOC_LPASS_TX_MACRO)	+=
  
  # Mux
  obj-$(CONFIG_SND_SOC_SIMPLE_MUX)	+= snd-soc-simple-mux.o
diff --git a/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch b/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
index 97030141eb..d93a73f7f6 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0348-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
@@ -351,7 +351,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  
 --- a/drivers/usb/dwc3/host.c
 +++ b/drivers/usb/dwc3/host.c
-@@ -126,10 +126,12 @@ out:
+@@ -129,10 +129,12 @@ out:
  
  int dwc3_host_init(struct dwc3 *dwc)
  {
@@ -364,7 +364,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.com>
  
  	/*
  	 * Some platforms need to power off all Root hub ports immediately after DWC3 set to host
-@@ -141,7 +143,12 @@ int dwc3_host_init(struct dwc3 *dwc)
+@@ -144,7 +146,12 @@ int dwc3_host_init(struct dwc3 *dwc)
  	if (irq < 0)
  		return irq;
  
diff --git a/target/linux/bcm27xx/patches-6.12/950-0380-irqchip-irq-brcmstb-l2-Add-config-for-2711-controlle.patch b/target/linux/bcm27xx/patches-6.12/950-0380-irqchip-irq-brcmstb-l2-Add-config-for-2711-controlle.patch
index b203e7a341..5909f5d66b 100644
--- a/target/linux/bcm27xx/patches-6.12/950-0380-irqchip-irq-brcmstb-l2-Add-config-for-2711-controlle.patch
+++ b/target/linux/bcm27xx/patches-6.12/950-0380-irqchip-irq-brcmstb-l2-Add-config-for-2711-controlle.patch
@@ -52,7 +52,7 @@ Signed-off-by: Dom Cobley <popcornmix at gmail.com>
  /* L2 intc private data structure */
  struct brcmstb_l2_intc_data {
  	struct irq_domain *domain;
-@@ -299,11 +309,18 @@ static int __init brcmstb_l2_lvl_intc_of
+@@ -295,11 +305,18 @@ static int brcmstb_l2_lvl_intc_of_init(s
  	return brcmstb_l2_intc_of_init(np, parent, &l2_lvl_intc_init);
  }
  
diff --git a/target/linux/generic/hack-6.12/902-debloat_proc.patch b/target/linux/generic/hack-6.12/902-debloat_proc.patch
index cd7241e6af..239561c0e4 100644
--- a/target/linux/generic/hack-6.12/902-debloat_proc.patch
+++ b/target/linux/generic/hack-6.12/902-debloat_proc.patch
@@ -409,7 +409,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
 --- a/net/ipv4/inet_timewait_sock.c
 +++ b/net/ipv4/inet_timewait_sock.c
-@@ -296,7 +296,7 @@ void __inet_twsk_schedule(struct inet_ti
+@@ -285,7 +285,7 @@ void __inet_twsk_schedule(struct inet_ti
  	 */
  
  	if (!rearm) {
diff --git a/target/linux/generic/kernel-6.12 b/target/linux/generic/kernel-6.12
index 0a9808b6be..463c22204a 100644
--- a/target/linux/generic/kernel-6.12
+++ b/target/linux/generic/kernel-6.12
@@ -1,2 +1,2 @@
-LINUX_VERSION-6.12 = .62
-LINUX_KERNEL_HASH-6.12.62 = 13e2c685ac8fab5dd992dd105732554dae514aef350c2a8c7418e7b74eb62c13
+LINUX_VERSION-6.12 = .63
+LINUX_KERNEL_HASH-6.12.63 = 9502c5ffe4b894383c97abfccf74430a84732f04ee476b9c0d87635b29df7db3
diff --git a/target/linux/generic/pending-6.12/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch b/target/linux/generic/pending-6.12/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
index 301defb49a..59868b2a53 100644
--- a/target/linux/generic/pending-6.12/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
+++ b/target/linux/generic/pending-6.12/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
@@ -55,7 +55,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  }
 --- a/net/netfilter/nft_flow_offload.c
 +++ b/net/netfilter/nft_flow_offload.c
-@@ -487,47 +487,14 @@ static struct nft_expr_type nft_flow_off
+@@ -494,47 +494,14 @@ static struct nft_expr_type nft_flow_off
  	.owner		= THIS_MODULE,
  };
  
diff --git a/target/linux/qualcommax/patches-6.12/0113-remoteproc-qcom-Add-secure-PIL-support.patch b/target/linux/qualcommax/patches-6.12/0113-remoteproc-qcom-Add-secure-PIL-support.patch
index fc35733fa2..6b11f04808 100644
--- a/target/linux/qualcommax/patches-6.12/0113-remoteproc-qcom-Add-secure-PIL-support.patch
+++ b/target/linux/qualcommax/patches-6.12/0113-remoteproc-qcom-Add-secure-PIL-support.patch
@@ -25,7 +25,7 @@ Signed-off-by: Nikhil Prakash V <nprakash at codeaurora.org>
 @@ -86,6 +87,9 @@
  #define TCSR_WCSS_CLK_ENABLE	0x14
  
- #define MAX_HALT_REG		3
+ #define MAX_HALT_REG		4
 +
 +#define WCNSS_PAS_ID		6
 +
diff --git a/target/linux/qualcommax/patches-6.12/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch b/target/linux/qualcommax/patches-6.12/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch
index 7989dfa5c9..c9795b8028 100644
--- a/target/linux/qualcommax/patches-6.12/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch
+++ b/target/linux/qualcommax/patches-6.12/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch
@@ -13,15 +13,6 @@ Signed-off-by: Sricharan R <sricharan at codeaurora.org>
 
 --- a/drivers/remoteproc/qcom_q6v5_wcss.c
 +++ b/drivers/remoteproc/qcom_q6v5_wcss.c
-@@ -86,7 +86,7 @@
- #define TCSR_WCSS_CLK_MASK	0x1F
- #define TCSR_WCSS_CLK_ENABLE	0x14
- 
--#define MAX_HALT_REG		3
-+#define MAX_HALT_REG		4
- 
- #define WCNSS_PAS_ID		6
- 
 @@ -155,6 +155,7 @@ struct wcss_data {
  	u32 version;
  	bool aon_reset_required;
@@ -48,19 +39,6 @@ Signed-off-by: Sricharan R <sricharan at codeaurora.org>
  	}
  
  	return 0;
-@@ -929,9 +933,9 @@ static int q6v5_wcss_init_mmio(struct q6
- 		return -EINVAL;
- 	}
- 
--	wcss->halt_q6 = halt_reg[0];
--	wcss->halt_wcss = halt_reg[1];
--	wcss->halt_nc = halt_reg[2];
-+	wcss->halt_q6 = halt_reg[1];
-+	wcss->halt_wcss = halt_reg[2];
-+	wcss->halt_nc = halt_reg[3];
- 
- 	return 0;
- }
 @@ -1173,6 +1177,7 @@ static const struct wcss_data wcss_ipq80
  	.crash_reason_smem = WCSS_CRASH_REASON,
  	.aon_reset_required = true,
diff --git a/target/linux/ramips/patches-6.12/850-awake-rt305x-dwc2-controller.patch b/target/linux/ramips/patches-6.12/850-awake-rt305x-dwc2-controller.patch
index 560a2efeac..f963c756ec 100644
--- a/target/linux/ramips/patches-6.12/850-awake-rt305x-dwc2-controller.patch
+++ b/target/linux/ramips/patches-6.12/850-awake-rt305x-dwc2-controller.patch
@@ -1,6 +1,6 @@
 --- a/drivers/usb/dwc2/platform.c
 +++ b/drivers/usb/dwc2/platform.c
-@@ -481,6 +481,12 @@ static int dwc2_driver_probe(struct plat
+@@ -484,6 +484,12 @@ static int dwc2_driver_probe(struct plat
  	if (retval)
  		return retval;
  
diff --git a/target/linux/realtek/patches-6.12/318-add-rtl83xx-clk-support.patch b/target/linux/realtek/patches-6.12/318-add-rtl83xx-clk-support.patch
index 72ac8a58c1..2a580e670c 100644
--- a/target/linux/realtek/patches-6.12/318-add-rtl83xx-clk-support.patch
+++ b/target/linux/realtek/patches-6.12/318-add-rtl83xx-clk-support.patch
@@ -23,7 +23,7 @@ Submitted-by: Markus Stockhausen <markus.stockhausen at gmx.de>
  source "drivers/clk/rockchip/Kconfig"
 --- a/drivers/clk/Makefile
 +++ b/drivers/clk/Makefile
-@@ -123,6 +123,7 @@ obj-$(CONFIG_COMMON_CLK_PISTACHIO)	+= pi
+@@ -122,6 +122,7 @@ obj-$(CONFIG_COMMON_CLK_PISTACHIO)	+= pi
  obj-$(CONFIG_COMMON_CLK_PXA)		+= pxa/
  obj-$(CONFIG_COMMON_CLK_QCOM)		+= qcom/
  obj-y					+= ralink/
diff --git a/target/linux/rockchip/patches-6.12/001-01-v6.13-arm64-dts-rockchip-Split-up-RK3588-s-PCIe-pinctrls.patch b/target/linux/rockchip/patches-6.12/001-01-v6.13-arm64-dts-rockchip-Split-up-RK3588-s-PCIe-pinctrls.patch
index 9a58adf4cd..6b1284f74c 100644
--- a/target/linux/rockchip/patches-6.12/001-01-v6.13-arm64-dts-rockchip-Split-up-RK3588-s-PCIe-pinctrls.patch
+++ b/target/linux/rockchip/patches-6.12/001-01-v6.13-arm64-dts-rockchip-Split-up-RK3588-s-PCIe-pinctrls.patch
@@ -422,7 +422,7 @@ Signed-off-by: Heiko Stuebner <heiko at sntech.de>
  		};
 --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
 +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
-@@ -310,7 +310,7 @@
+@@ -311,7 +311,7 @@
  };
  
  &pcie2x1l2 {
@@ -431,7 +431,7 @@ Signed-off-by: Heiko Stuebner <heiko at sntech.de>
  	pinctrl-names = "default";
  	reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>;
  	vpcie3v3-supply = <&vcc3v3_wf>;
-@@ -328,6 +328,10 @@
+@@ -329,6 +329,10 @@
  		pow_en: pow-en {
  			rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
  		};
diff --git a/target/linux/rockchip/patches-6.12/002-02-v6.13-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch b/target/linux/rockchip/patches-6.12/002-02-v6.13-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch
index c305197183..8eaca4b9a7 100644
--- a/target/linux/rockchip/patches-6.12/002-02-v6.13-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch
+++ b/target/linux/rockchip/patches-6.12/002-02-v6.13-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch
@@ -37,7 +37,7 @@ Signed-off-by: Heiko Stuebner <heiko at sntech.de>
  	leds {
  		compatible = "gpio-leds";
  		pinctrl-names = "default";
-@@ -301,6 +313,31 @@
+@@ -302,6 +314,31 @@
  	status = "okay";
  };
  
@@ -69,7 +69,7 @@ Signed-off-by: Heiko Stuebner <heiko at sntech.de>
  &mdio1 {
  	rgmii_phy1: ethernet-phy at 1 {
  		/* RTL8211F */
-@@ -793,3 +830,18 @@
+@@ -794,3 +831,18 @@
  &usb_host2_xhci {
  	status = "okay";
  };
diff --git a/target/linux/rockchip/patches-6.12/002-05-v6.15-arm64-dts-rockchip-Fix-label-name-of-hdptxphy-for-RK.patch b/target/linux/rockchip/patches-6.12/002-05-v6.15-arm64-dts-rockchip-Fix-label-name-of-hdptxphy-for-RK.patch
index 0e30195847..1d901b83b2 100644
--- a/target/linux/rockchip/patches-6.12/002-05-v6.15-arm64-dts-rockchip-Fix-label-name-of-hdptxphy-for-RK.patch
+++ b/target/linux/rockchip/patches-6.12/002-05-v6.15-arm64-dts-rockchip-Fix-label-name-of-hdptxphy-for-RK.patch
@@ -15,7 +15,7 @@ Signed-off-by: Heiko Stuebner <heiko at sntech.de>
 
 --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
 +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
-@@ -334,7 +334,7 @@
+@@ -335,7 +335,7 @@
  	};
  };
  
diff --git a/target/linux/rockchip/patches-6.12/002-06-v6.15-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch b/target/linux/rockchip/patches-6.12/002-06-v6.15-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch
index c11bc86c9d..76f6aa504c 100644
--- a/target/linux/rockchip/patches-6.12/002-06-v6.15-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch
+++ b/target/linux/rockchip/patches-6.12/002-06-v6.15-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch
@@ -35,7 +35,7 @@ Signed-off-by: Heiko Stuebner <heiko at sntech.de>
 
 --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
 +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
-@@ -359,6 +359,10 @@
+@@ -360,6 +360,10 @@
  	status = "okay";
  };
  
diff --git a/target/linux/rockchip/patches-6.12/116-arm64-dts-rockchip-Update-LED-properties-for-Radxa-Ro.patch b/target/linux/rockchip/patches-6.12/116-arm64-dts-rockchip-Update-LED-properties-for-Radxa-Ro.patch
index 009c72992c..3cb14c23da 100644
--- a/target/linux/rockchip/patches-6.12/116-arm64-dts-rockchip-Update-LED-properties-for-Radxa-Ro.patch
+++ b/target/linux/rockchip/patches-6.12/116-arm64-dts-rockchip-Update-LED-properties-for-Radxa-Ro.patch
@@ -44,7 +44,7 @@ Signed-off-by: Tianling Shen <cnsztl at gmail.com>
  		};
  	};
  
-@@ -365,8 +375,9 @@
+@@ -366,8 +376,9 @@
  
  &pinctrl {
  	leds {
diff --git a/target/linux/siflower/patches-6.12/005-clk-add-drivers-for-siflower-socs.patch b/target/linux/siflower/patches-6.12/005-clk-add-drivers-for-siflower-socs.patch
index 4fb218d482..2be0427b79 100644
--- a/target/linux/siflower/patches-6.12/005-clk-add-drivers-for-siflower-socs.patch
+++ b/target/linux/siflower/patches-6.12/005-clk-add-drivers-for-siflower-socs.patch
@@ -20,7 +20,7 @@ Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>
  source "drivers/clk/sprd/Kconfig"
 --- a/drivers/clk/Makefile
 +++ b/drivers/clk/Makefile
-@@ -127,6 +127,7 @@ obj-y					+= renesas/
+@@ -126,6 +126,7 @@ obj-y					+= renesas/
  obj-$(CONFIG_ARCH_ROCKCHIP)		+= rockchip/
  obj-$(CONFIG_COMMON_CLK_SAMSUNG)	+= samsung/
  obj-$(CONFIG_CLK_SIFIVE)		+= sifive/



From lede-commits at lists.infradead.org  Wed Dec 31 09:16:54 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 12:16:54 -0500
Subject: [openwrt/openwrt]  build: refactor provides logic
In-Reply-To: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
References: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
Message-ID: <mailman.40222.1767201419.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cefbf1184f860b3ae29ea7a06d79b49c40879277

commit cefbf1184f860b3ae29ea7a06d79b49c40879277
Author: George Sapkin <george at sapk.in>
AuthorDate: Thu Dec 25 14:09:53 2025 +0200

    build: refactor provides logic
    
    Refactor provides logic into a helper define and use it for both apk and
    control. Document the behavior.
    
    Store preformatted provides in Package/$(1)/PROVIDES similar to defines.
    
    Remove unnecessary logging.
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21288
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 include/package-pack.mk | 56 +++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 47 insertions(+), 9 deletions(-)

diff --git a/include/package-pack.mk b/include/package-pack.mk
index b38000ca97..7080b8362b 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -78,6 +78,50 @@ define FixupDependencies
   $(call AddDependency,$(1),$$(DEPS))
 endef
 
+# Format provides both for apk and control
+#
+# - If ABI version is defined:
+#   - package is named `${package_name}${ABI_version}`
+#     if a `package_name` ends in a number, the `ABI_version` will be prefixed
+#     with a - sign, e.g.: libsqlite3-0
+#   - package implicitly provides
+#     `${package_name}${ABI_version}=${package_version}`
+#     this implies that only one version of a package per ABI can be installed
+#     at the same time
+#   - additionally provide `${package_name}` so multiple packages can be looked
+#     up by its base name
+#   - for each `provides`, provide `${provide}${ABI_version}=${package_version}`
+#     this implies that only one version of a provide can be installed at the
+#     same time
+#
+# - else if ABI version is _not_ defined
+#   - package is named `${package_name}`
+#   - package implicitly provides `${package_name}=${package_version}`
+#     this implies that only one version of a package can be installed at the
+#     same time
+#   - if `alternatives` is defined
+#     - for each `provides`, provide `${provide}`
+#       this implies that multiple versions of a provide can be installed at the
+#       same time
+#   - else if `alternatives` is _not_ defined
+#     - for each `provides`, provide `${provide}=${package_version}`
+#       this implies that only one version of a provide can be installed at the
+#       same time
+#
+# 1: package name
+# 2: package version
+# 3: list of provides
+# 4: list of alternatives
+define FormatProvides
+$(strip $(if $(ABIV_$(1)), \
+  $(1) $(foreach provide,$(3), $(provide)$(ABIV_$(1))=$(2)), \
+  $(if $(4), \
+    $(3), \
+    $(foreach provide,$(3), $(provide)=$(2)) \
+  ) \
+))
+endef
+
 ifneq ($(PKG_NAME),toolchain)
   define CheckDependencies
 	@( \
@@ -241,14 +285,14 @@ endif
       Package/$(1)/DEPENDS := $$(call mergelist,$$(Package/$(1)/DEPENDS))
     endif
 
-    $$(info $(1) fused dependencies: $$(Package/$(1)/DEPENDS))
+    Package/$(1)/PROVIDES := $$(call FormatProvides,$(1),$(VERSION),$(PROVIDES),$(ALTERNATIVES))
 
 $(_define) Package/$(1)/CONTROL
 Package: $(1)$$(ABIV_$(1))
 Version: $(VERSION)
 $$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
 )$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
-)$$(call addfield,Provides,$$(call mergelist,$$(filter-out $(1)$$(ABIV_$(1)),$(PROVIDES)$$(if $$(ABIV_$(1)), $(1) $(foreach provide,$(PROVIDES),$(provide)$$(ABIV_$(1))))))
+)$$(call addfield,Provides,$$(call mergelist,$$(Package/$(1)/PROVIDES))
 )$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
 )$$(call addfield,Source,$(SOURCE)
 )$$(call addfield,SourceName,$(PKG_NAME)
@@ -433,13 +477,7 @@ else
 	  --info "origin:$(SOURCE)" \
 	  --info "url:$(URL)" \
 	  --info "maintainer:$(MAINTAINER)" \
-	  --info "provides:$$(if $$(ABIV_$(1)), \
-	    $(1) $(foreach provide,$(PROVIDES), $(provide)$$(ABIV_$(1))=$(VERSION)), \
-	    $(if $(ALTERNATIVES), \
-	      $(PROVIDES), \
-	      $(foreach provide,$(PROVIDES), $(provide)=$(VERSION)) \
-	    ) \
-	  )" \
+	  $$(if $$(Package/$(1)/PROVIDES),--info "provides:$$(Package/$(1)/PROVIDES)") \
 	  $(if $(DEFAULT_VARIANT),--info "provider-priority:100",$(if $(PROVIDES),--info "provider-priority:1")) \
 	  $$(APK_SCRIPTS_$(1)) \
 	  --info "depends:$$(foreach depends,$$(subst $$(comma),$$(space),$$(subst $$(space),,$$(subst $$(paren_right),,$$(subst $$(paren_left),,$$(Package/$(1)/DEPENDS))))),$$(depends))" \



From lede-commits at lists.infradead.org  Wed Dec 31 09:16:57 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 12:16:57 -0500
Subject: [openwrt/openwrt]  ca-certificates: provide a virtual package
In-Reply-To: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
References: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
Message-ID: <mailman.40223.1767201419.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d75a6bed7a520c7a556e04b9270b0a3dc41e0d10

commit d75a6bed7a520c7a556e04b9270b0a3dc41e0d10
Author: George Sapkin <george at sapk.in>
AuthorDate: Thu Dec 25 17:16:18 2025 +0200

    ca-certificates: provide a virtual package
    
    Switch ca-certs provides to use the new virtual provides semantic that
    enables ca-bundle and ca-certificates to be installed side-by-side.
    
    Provide the new format virtual ca-certificates-any in ca-bundle.
    
    Fixes: https://github.com/openwrt/openwrt/issues/21257
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21288
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/system/ca-certificates/Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/package/system/ca-certificates/Makefile b/package/system/ca-certificates/Makefile
index 4febb647ac..be9a00f367 100644
--- a/package/system/ca-certificates/Makefile
+++ b/package/system/ca-certificates/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ca-certificates
 PKG_VERSION:=20250419
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MAINTAINER:=
 
 PKG_LICENSE:=GPL-2.0-or-later MPL-2.0
@@ -24,12 +24,14 @@ include $(INCLUDE_DIR)/package.mk
 TAR_OPTIONS+= --strip-components 1
 TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
 
+# ca-certs is deprecated and new packages should use ca-certificates-any if
+# they don't need a specific package
 define Package/ca-certificates
   SECTION:=base
   CATEGORY:=Base system
   TITLE:=System CA certificates
   PKGARCH:=all
-  PROVIDES:=ca-certs
+  PROVIDES:=@ca-certs
 endef
 
 define Package/ca-bundle
@@ -37,7 +39,7 @@ define Package/ca-bundle
   CATEGORY:=Base system
   TITLE:=System CA certificates as a bundle
   PKGARCH:=all
-  PROVIDES:=ca-certs
+  PROVIDES:=@ca-certs @ca-certificates-any
 endef
 
 define Build/Install



From lede-commits at lists.infradead.org  Wed Dec 31 09:17:00 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 12:17:00 -0500
Subject: [openwrt/openwrt]  kernel/rtl8812au-ct: provide a virtual kmod
In-Reply-To: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
References: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
Message-ID: <mailman.40224.1767201420.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2c81176f2b5cfde3fd1a7243077802b106d3dd71

commit 2c81176f2b5cfde3fd1a7243077802b106d3dd71
Author: George Sapkin <george at sapk.in>
AuthorDate: Sun Dec 28 17:37:08 2025 +0200

    kernel/rtl8812au-ct: provide a virtual kmod
    
    Switch rtl8812au-ct to use the new virtual kmod provides semantic.
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21288
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/kernel/rtl8812au-ct/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/rtl8812au-ct/Makefile b/package/kernel/rtl8812au-ct/Makefile
index c6d09e50b8..4d0ca18d2c 100644
--- a/package/kernel/rtl8812au-ct/Makefile
+++ b/package/kernel/rtl8812au-ct/Makefile
@@ -28,7 +28,7 @@ define KernelPackage/rtl8812au-ct
   FILES:=\
 	$(PKG_BUILD_DIR)/rtl8812au.ko
   AUTOLOAD:=$(call AutoProbe,rtl8812au)
-  PROVIDES:=kmod-rtl8812au
+  PROVIDES:=@kmod-rtl8812au-any
 endef
 
 NOSTDINC_FLAGS := \



From lede-commits at lists.infradead.org  Wed Dec 31 09:16:59 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 12:16:59 -0500
Subject: [openwrt/openwrt]  kernel/ath10k: provide a virtual kmod
In-Reply-To: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
References: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
Message-ID: <mailman.40225.1767201420.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8f4c64b9304a79ab6e004b945b00b25de4e5d5d7

commit 8f4c64b9304a79ab6e004b945b00b25de4e5d5d7
Author: George Sapkin <george at sapk.in>
AuthorDate: Sun Dec 28 17:34:48 2025 +0200

    kernel/ath10k: provide a virtual kmod
    
    Switch ath10k and related kmods to use the new virtual kmod provides
    semantic and mark ath10k as the default variant.
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21288
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/kernel/ath10k-ct/Makefile |  2 +-
 package/kernel/mac80211/ath.mk    | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index 7b1543dff3..48514a6b40 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -34,7 +34,7 @@ define KernelPackage/ath10k-ct
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
   AUTOLOAD:=$(call AutoProbe,ath10k_pci)
-  PROVIDES:=kmod-ath10k
+  PROVIDES:=@kmod-ath10k-any
   VARIANT:=regular
 endef
 
diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk
index 5b13b6aac4..35c36954e5 100644
--- a/package/kernel/mac80211/ath.mk
+++ b/package/kernel/mac80211/ath.mk
@@ -265,7 +265,7 @@ This module adds support for wireless adapters based on
 Atheros USB AR9271 and AR7010 family of chipsets.
 endef
 
-define KernelPackage/ath10k
+define KernelPackage/ath10k/Default
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros 802.11ac wireless cards support
   URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k
@@ -276,7 +276,12 @@ define KernelPackage/ath10k
 	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
   AUTOLOAD:=$(call AutoProbe,ath10k_core ath10k_pci)
   MODPARAMS.ath10k_core:=frame_mode=2
+endef
+
+define KernelPackage/ath10k
+  $(call KernelPackage/ath10k/Default)
   VARIANT:=regular
+  DEFAULT_VARIANT:=1
 endef
 
 define KernelPackage/ath10k/description
@@ -299,9 +304,10 @@ define KernelPackage/ath10k/config
 endef
 
 define KernelPackage/ath10k-smallbuffers
-  $(call KernelPackage/ath10k)
+  $(call KernelPackage/ath10k/Default)
   TITLE+= (small buffers for low-RAM devices)
   VARIANT:=smallbuffers
+  PROVIDES:=@kmod-ath10k-any
 endef
 
 define KernelPackage/ath11k



From lede-commits at lists.infradead.org  Wed Dec 31 09:16:55 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 12:16:55 -0500
Subject: [openwrt/openwrt]  build: add support for virtual provides
In-Reply-To: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
References: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
Message-ID: <mailman.40226.1767201420.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5ed650acbfd9cfbfd6a381df7db060c9153bacfc

commit 5ed650acbfd9cfbfd6a381df7db060c9153bacfc
Author: George Sapkin <george at sapk.in>
AuthorDate: Thu Dec 25 15:32:29 2025 +0200

    build: add support for virtual provides
    
    Allow defining virtual provides using the PROVIDES field by prefixing
    them with @, e.g.:
    
    PROVIDES:=@ca-certs
    
    Virtual provides don't own the provided name and multiple packages with
    the same virtual provides can be installed side-by-side. Packages must
    still take care not to override each other's files.
    
    Add an implicit self-provide to packages. apk can't handle self
    provides, be it versioned or virtual, so opt for a suffix instead. This
    allows several variants to provide the same virtual package without
    adding extra provides to the default one, e.g. wget implicitly provides
    wget-any and is marked as default, so wget-ssl can explicitly provide
    @wget-any as well.
    
    Filter out virtual provides when generating metadata.
    
    Filter out virtual provides prefix and self provide where appropriate.
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21288
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 include/package-pack.mk | 46 +++++++++++++++++++++++++++++++++++++++++-----
 include/package.mk      |  7 +++++++
 scripts/metadata.pm     |  3 +++
 3 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/include/package-pack.mk b/include/package-pack.mk
index 7080b8362b..853832d90f 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -78,6 +78,25 @@ define FixupDependencies
   $(call AddDependency,$(1),$$(DEPS))
 endef
 
+# Format provide and add ABI and version if it's not a virtual provide marked
+# with an @.
+#
+# 1: provide name
+# 2: provide version
+# 3: (optional) ABI preformatted by FormatABISuffix
+define AddProvide
+$(if $(filter @%,$(1)),$(patsubst @%,%,$(1)),$(1)$(3)=$(2))
+endef
+
+# Remove virtual provides prefix and self. apk doesn't like it when packages
+# specify a redundant provide pointing to self.
+#
+# 1: package name
+# 2: list of provides
+define SanitizeProvides
+$(filter-out $(1),$(patsubst @%,%,$(2)))
+endef
+
 # Format provides both for apk and control
 #
 # - If ABI version is defined:
@@ -108,16 +127,33 @@ endef
 #       this implies that only one version of a provide can be installed at the
 #       same time
 #
+# - Both with and without an ABI, if a provide starts with an @, treat it as a
+#   virtual provide, that doesn't own the name by not appending version.
+#   Multiple packages with the same virtual provides can be installed
+#   side-by-side.
+#
+# - apk doesn't like it when packages specify a redundant provide pointing to
+#   self. Filter it out, but keep virtual self provides, in the form of
+#   @${package_name}-any.
+#
+# - Packages implicitly add a virtual @${package_name}-any provide in Package.
+#
 # 1: package name
 # 2: package version
 # 3: list of provides
 # 4: list of alternatives
 define FormatProvides
 $(strip $(if $(ABIV_$(1)), \
-  $(1) $(foreach provide,$(3), $(provide)$(ABIV_$(1))=$(2)), \
+  $(1) $(foreach provide, \
+    $(filter-out $(1),$(3)), \
+    $(call AddProvide,$(provide),$(2),$(ABIV_$(1))) \
+  ), \
   $(if $(4), \
-    $(3), \
-    $(foreach provide,$(3), $(provide)=$(2)) \
+    $(filter-out $(1),$(3)), \
+    $(foreach provide, \
+      $(filter-out $(1),$(3)), \
+      $(call AddProvide,$(provide),$(2)) \
+    ) \
   ) \
 ))
 endef
@@ -237,7 +273,7 @@ endif
 	$(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || { \
 		mkdir -p $(PKG_INFO_DIR); \
 		echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version; \
-		$(foreach pkg,$(filter-out $(1),$(PROVIDES)), \
+		$(foreach pkg,$(call SanitizeProvides,$(1),$(PROVIDES)), \
 			cp $(PKG_INFO_DIR)/$(1).version $(PKG_INFO_DIR)/$(pkg).version; \
 		) \
 	} )
@@ -336,7 +372,7 @@ endif
 			fi; \
 		done; $(Package/$(1)/extra_provides) \
 	) | sort -u > $(PKG_INFO_DIR)/$(1).provides
-	$(if $(PROVIDES), at for pkg in $(filter-out $(1),$(PROVIDES)); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
+	$(if $(PROVIDES), at for pkg in $(call SanitizeProvides,$(1),$(PROVIDES)); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
 	$(CheckDependencies)
 
 	$(RSTRIP) $$(IDIR_$(1))
diff --git a/include/package.mk b/include/package.mk
index 5392bdf465..087e374ea9 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -332,6 +332,13 @@ define BuildPackage
   $(eval $(Package/Default))
   $(eval $(Package/$(1)))
 
+  # Add an implicit self-provide. apk can't handle self provides, be it
+  # versioned or virtual, so opt for a suffix instead. This allows several
+  # variants to provide the same virtual package without adding extra provides
+  # to the default one, e.g. wget implicitly provides wget-any and is marked as
+  # default, so wget-ssl can explicitly provide @wget-any as well.
+  PROVIDES+=@$(1)-any
+
 ifdef DESCRIPTION
 $$(error DESCRIPTION:= is obsolete, use Package/PKG_NAME/description)
 endif
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index dec9e62dff..6cb63608d2 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -263,6 +263,9 @@ sub parse_package_metadata($) {
 		/^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
 		/^Provides: \s*(.+)\s*$/ and do {
 			my @vpkg = split /\s+/, $1;
+			foreach (@vpkg) {
+				s/^@//;
+			}
 			@{$pkg->{provides}} = ($pkg->{name}, @vpkg);
 			foreach my $vpkg (@vpkg) {
 				next if ($vpkg eq $pkg->{name});



From lede-commits at lists.infradead.org  Wed Dec 31 09:16:58 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 12:16:58 -0500
Subject: [openwrt/openwrt]  kernel/r8169: provide a virtual kmod
In-Reply-To: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
References: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
Message-ID: <mailman.40229.1767201420.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/01fa50b7745b176b0c4e3d1babd1616a1cb36868

commit 01fa50b7745b176b0c4e3d1babd1616a1cb36868
Author: George Sapkin <george at sapk.in>
AuthorDate: Sun Dec 28 17:30:12 2025 +0200

    kernel/r8169: provide a virtual kmod
    
    Switch r8169 and related kmods to use the new virtual kmod provides
    semantic and mark r8169 as the default variant.
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21288
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/kernel/linux/modules/netdevices.mk | 1 +
 package/kernel/r8101/Makefile              | 2 +-
 package/kernel/r8125/Makefile              | 2 +-
 package/kernel/r8126/Makefile              | 2 +-
 package/kernel/r8127/Makefile              | 2 +-
 package/kernel/r8168/Makefile              | 2 +-
 6 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk
index b92c060c1d..11d7b32c27 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -1207,6 +1207,7 @@ define KernelPackage/r8169
     CONFIG_R8169_LEDS=y
   FILES:=$(LINUX_DIR)/drivers/net/ethernet/realtek/r8169.ko
   AUTOLOAD:=$(call AutoProbe,r8169,1)
+  DEFAULT_VARIANT:=1
 endef
 
 define KernelPackage/r8169/description
diff --git a/package/kernel/r8101/Makefile b/package/kernel/r8101/Makefile
index 993e0de13a..a13cd83e21 100644
--- a/package/kernel/r8101/Makefile
+++ b/package/kernel/r8101/Makefile
@@ -21,7 +21,7 @@ define KernelPackage/r8101
   DEPENDS:=@PCI_SUPPORT +kmod-libphy
   FILES:=$(PKG_BUILD_DIR)/src/r8101.ko
   AUTOLOAD:=$(call AutoProbe,r8101,1)
-  PROVIDES:=kmod-r8169
+  PROVIDES:=@kmod-r8169-any
 endef
 
 define Build/Compile
diff --git a/package/kernel/r8125/Makefile b/package/kernel/r8125/Makefile
index 7cb28c9980..032559f4c4 100644
--- a/package/kernel/r8125/Makefile
+++ b/package/kernel/r8125/Makefile
@@ -21,7 +21,7 @@ define KernelPackage/r8125
   DEPENDS:=@PCI_SUPPORT +kmod-libphy
   FILES:=$(PKG_BUILD_DIR)/src/r8125.ko
   AUTOLOAD:=$(call AutoProbe,r8125,1)
-  PROVIDES:=kmod-r8169
+  PROVIDES:=@kmod-r8169-any
   VARIANT:=regular
   PKG_MAKE_FLAGS += CONFIG_ASPM=n
 endef
diff --git a/package/kernel/r8126/Makefile b/package/kernel/r8126/Makefile
index 6bc39a936a..2b6c9427f0 100644
--- a/package/kernel/r8126/Makefile
+++ b/package/kernel/r8126/Makefile
@@ -21,7 +21,7 @@ define KernelPackage/r8126
   DEPENDS:=@PCI_SUPPORT +kmod-libphy
   FILES:=$(PKG_BUILD_DIR)/src/r8126.ko
   AUTOLOAD:=$(call AutoProbe,r8126,1)
-  PROVIDES:=kmod-r8169
+  PROVIDES:=@kmod-r8169-any
   VARIANT:=regular
 endef
 
diff --git a/package/kernel/r8127/Makefile b/package/kernel/r8127/Makefile
index 38be4ae82d..11331390c8 100644
--- a/package/kernel/r8127/Makefile
+++ b/package/kernel/r8127/Makefile
@@ -21,7 +21,7 @@ define KernelPackage/r8127
   DEPENDS:=@PCI_SUPPORT +kmod-libphy
   FILES:=$(PKG_BUILD_DIR)/src/r8127.ko
   AUTOLOAD:=$(call AutoProbe,r8127,1)
-  PROVIDES:=kmod-r8169
+  PROVIDES:=@kmod-r8169-any
   VARIANT:=regular
 endef
 
diff --git a/package/kernel/r8168/Makefile b/package/kernel/r8168/Makefile
index 812cbad61d..79117346ed 100644
--- a/package/kernel/r8168/Makefile
+++ b/package/kernel/r8168/Makefile
@@ -21,7 +21,7 @@ define KernelPackage/r8168
   DEPENDS:=@PCI_SUPPORT +kmod-libphy
   FILES:=$(PKG_BUILD_DIR)/src/r8168.ko
   AUTOLOAD:=$(call AutoProbe,r8168,1)
-  PROVIDES:=kmod-r8169
+  PROVIDES:=@kmod-r8169-any
   VARIANT:=regular
 endef
 



From lede-commits at lists.infradead.org  Wed Dec 31 09:16:56 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 12:16:56 -0500
Subject: [openwrt/openwrt]  build: provide virtual self in kmods
In-Reply-To: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
References: <176720141444.2089684.5961121975112266512@git-01.infra.openwrt.org>
Message-ID: <mailman.40230.1767201422.2093109.lede-commits@lists.infradead.org>

robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9b37b7185c18855f4e017ac573701cdcd92fbcd1

commit 9b37b7185c18855f4e017ac573701cdcd92fbcd1
Author: George Sapkin <george at sapk.in>
AuthorDate: Sun Dec 28 17:22:41 2025 +0200

    build: provide virtual self in kmods
    
    Add an implicit self-provide to kmods. apk can't handle self provides,
    be it versioned or virtual, so opt for a prefix and a suffix instead.
    Package name without a prefix/suffix is too generic and might conflict
    with other packages, e.g. wireguard. This allows several variants to
    provide the same virtual package without adding extra provides to the
    default one, e.g. r8169 implicitly provides kmod-r8169-any and is marked
    as default, so r8125 can explicitly provide @kmod-r8169-any as well.
    
    Signed-off-by: George Sapkin <george at sapk.in>
    Link: https://github.com/openwrt/openwrt/pull/21288
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 include/kernel.mk       | 10 +++++++++-
 include/package-pack.mk |  5 ++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index 7d09e90656..4f75033b45 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -219,6 +219,15 @@ define KernelPackage
     $(call KernelPackage/$(1))
     $(call KernelPackage/$(1)/$(BOARD))
     $(call KernelPackage/$(1)/$(BOARD)/$(SUBTARGET))
+
+    # Add an implicit self-provide. apk can't handle self provides, be it
+    # versioned or virtual, so opt for a prefix and a suffix instead. Package
+    # name without a prefix/suffix is too generic and might conflict with other
+    # packages, e.g. wireguard. This allows several variants to provide the same
+    # virtual package without adding extra provides to the default one, e.g.
+    # r8169 implicitly provides kmod-r8169-any and is marked as default, so
+    # r8125 can explicitly provide @kmod-r8169-any as well.
+    PROVIDES+=@kmod-$(1)-any
   endef
 
   ifdef KernelPackage/$(1)/conffiles
@@ -306,4 +315,3 @@ kernel_patchver_ge=$(call kernel_version_cmp,-ge,$(KERNEL_PATCHVER),$(1))
 kernel_patchver_eq=$(call kernel_version_cmp,-eq,$(KERNEL_PATCHVER),$(1))
 kernel_patchver_le=$(call kernel_version_cmp,-le,$(KERNEL_PATCHVER),$(1))
 kernel_patchver_lt=$(call kernel_version_cmp,-lt,$(KERNEL_PATCHVER),$(1))
-
diff --git a/include/package-pack.mk b/include/package-pack.mk
index 853832d90f..15c06fab0b 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -134,10 +134,13 @@ endef
 #
 # - apk doesn't like it when packages specify a redundant provide pointing to
 #   self. Filter it out, but keep virtual self provides, in the form of
-#   @${package_name}-any.
+#   @(kmod-)?${package_name}-any.
 #
 # - Packages implicitly add a virtual @${package_name}-any provide in Package.
 #
+# - kmods implicitly add a virtual @kmod-${package_name}-any provide in
+#   KernelPackage.
+#
 # 1: package name
 # 2: package version
 # 3: list of provides



From lede-commits at lists.infradead.org  Wed Dec 31 13:00:26 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 16:00:26 -0500
Subject: [openwrt/openwrt]  realtek: harmonize variables in prom.c
In-Reply-To: <176721482626.2673130.1840372383649271825@git-01.infra.openwrt.org>
References: <176721482626.2673130.1840372383649271825@git-01.infra.openwrt.org>
Message-ID: <mailman.40262.1767214832.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/833757342206ebae4860b09b2ab4efb2344bbe21

commit 833757342206ebae4860b09b2ab4efb2344bbe21
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 30 09:59:26 2025 +0100

    realtek: harmonize variables in prom.c
    
    There is mix of variable naming in prom.c. Use a fixed
    prefix of "rtl_" for all static variables. Additionally
    remove the prefix from rtl83xx_set_system_type as it is
    a generic function for all SoC types.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21327
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../realtek/files-6.12/arch/mips/rtl838x/prom.c    | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
index 2e668ee078..94d659913c 100644
--- a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
+++ b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
@@ -20,13 +20,13 @@
 struct rtl83xx_soc_info soc_info;
 const void *fdt;
 
-static char soc_name[16];
-static char rtl83xx_system_type[48];
+static char rtl_soc_name[16];
+static char rtl_system_type[48];
 
 #ifdef CONFIG_MIPS_MT_SMP
 
 extern const struct plat_smp_ops vsmp_smp_ops;
-static struct plat_smp_ops rtlops;
+static struct plat_smp_ops rtl_smp_ops;
 
 static void rtlsmp_init_secondary(void)
 {
@@ -62,10 +62,10 @@ static int rtlsmp_register(void)
 	if (!cpu_has_mipsmt)
 		return 1;
 
-	rtlops = vsmp_smp_ops;
-	rtlops.init_secondary = rtlsmp_init_secondary;
-	rtlops.smp_finish = rtlsmp_finish;
-	register_smp_ops(&rtlops);
+	rtl_smp_ops = vsmp_smp_ops;
+	rtl_smp_ops.init_secondary = rtlsmp_init_secondary;
+	rtl_smp_ops.smp_finish = rtlsmp_finish;
+	register_smp_ops(&rtl_smp_ops);
 
 	return 0;
 }
@@ -99,7 +99,7 @@ void __init device_tree_init(void)
 
 const char *get_system_type(void)
 {
-	return rtl83xx_system_type;
+	return rtl_system_type;
 }
 
 static void __init rtl838x_read_details(u32 model)
@@ -206,13 +206,13 @@ static void __init parse_model(u32 model)
 	if (val > 0 && val <= 26)
 		suffix = 'A' + (val - 1);
 
-	snprintf(soc_name, sizeof(soc_name), "RTL%04X%c",
+	snprintf(rtl_soc_name, sizeof(rtl_soc_name), "RTL%04X%c",
 		 soc_info.id, suffix);
 
-	soc_info.name = soc_name;
+	soc_info.name = rtl_soc_name;
 }
 
-static void __init rtl83xx_set_system_type(void)
+static void __init set_system_type(void)
 {
 	char revision = '?';
 	char *es = "";
@@ -223,7 +223,7 @@ static void __init rtl83xx_set_system_type(void)
 	if (soc_info.testchip)
 		es = " ES";
 
-	snprintf(rtl83xx_system_type, sizeof(rtl83xx_system_type),
+	snprintf(rtl_system_type, sizeof(rtl_system_type),
 		 "Realtek %s%s rev %c (%04X)",
 		 soc_info.name, es, revision, soc_info.cpu);
 }
@@ -233,7 +233,7 @@ void __init prom_init(void)
 	u32 model = read_model();
 
 	parse_model(model);
-	rtl83xx_set_system_type();
+	set_system_type();
 
 	pr_info("SoC Type: %s\n", get_system_type());
 



From lede-commits at lists.infradead.org  Wed Dec 31 13:00:29 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 16:00:29 -0500
Subject: [openwrt/openwrt]  realtek: setup cpu port in soc_info structure
In-Reply-To: <176721482626.2673130.1840372383649271825@git-01.infra.openwrt.org>
References: <176721482626.2673130.1840372383649271825@git-01.infra.openwrt.org>
Message-ID: <mailman.40263.1767214832.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8e6cd2608ab14a017f493dd10bd4a6045a5bac0f

commit 8e6cd2608ab14a017f493dd10bd4a6045a5bac0f
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 30 14:07:32 2025 +0100

    realtek: setup cpu port in soc_info structure
    
    A lot of soc_info usage has been reorganized. Nevertheless there
    are some consumers left. A very critical one is the dsa/qos coding.
    It makes use of the cpu_port in this shared structure. This is
    totally broken as that info is never properly initialized. Fill
    the cpu_port according to the identified hardware.
    
    Remark: Looking at the prom.c history soc_info.cpu_port was never
    setup since the beginning of time. So no "fixes" tag here.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21327
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
index acd9f4581d..689e862d27 100644
--- a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
+++ b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
@@ -187,6 +187,7 @@ static u32 __init read_model(void)
 	if ((id >= 0x8380 && id <= 0x8382) || id == 0x8330 || id == 0x8332) {
 		soc_info.id = id;
 		soc_info.family = RTL8380_FAMILY_ID;
+		soc_info.cpu_port = RTL838X_CPU_PORT;
 		rtl838x_read_details(model);
 		return model;
 	}
@@ -196,6 +197,7 @@ static u32 __init read_model(void)
 	if ((id >= 0x8391 && id <= 0x8396) || (id >= 0x8351 && id <= 0x8353)) {
 		soc_info.id = id;
 		soc_info.family = RTL8390_FAMILY_ID;
+		soc_info.cpu_port = RTL839X_CPU_PORT;
 		rtl839x_read_details(model);
 		return model;
 	}
@@ -205,11 +207,13 @@ static u32 __init read_model(void)
 	if (id >= 0x9301 && id <= 0x9303) {
 		soc_info.id = id;
 		soc_info.family = RTL9300_FAMILY_ID;
+		soc_info.cpu_port = RTL930X_CPU_PORT;
 		rtl93xx_read_details(model);
 		return model;
 	} else if (id >= 0x9311 && id <= 0x9313) {
 		soc_info.id = id;
 		soc_info.family = RTL9310_FAMILY_ID;
+		soc_info.cpu_port = RTL931X_CPU_PORT;
 		rtl93xx_read_details(model);
 		return model;
 	}



From lede-commits at lists.infradead.org  Wed Dec 31 13:00:28 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 16:00:28 -0500
Subject: [openwrt/openwrt]  realtek: RTL930x: setup highmem registers during
 init
In-Reply-To: <176721482626.2673130.1840372383649271825@git-01.infra.openwrt.org>
References: <176721482626.2673130.1840372383649271825@git-01.infra.openwrt.org>
Message-ID: <mailman.40264.1767214835.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6b2e7ffd4be91ca6245b34e5ed55e858860a2191

commit 6b2e7ffd4be91ca6245b34e5ed55e858860a2191
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 30 11:02:04 2025 +0100

    realtek: RTL930x: setup highmem registers during init
    
    For some reason the highmem configuration of RTL930x
    devices was totally missed until now. Take over the
    setup from the SDK. This will avoid boot stalls on
    switches with more than 256 MB RAM when switching
    over to kernel 6.18.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21327
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../realtek/files-6.12/arch/mips/rtl838x/prom.c    | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
index f8c13ee49f..acd9f4581d 100644
--- a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
+++ b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
@@ -18,7 +18,20 @@
 #include <mach-rtl83xx.h>
 
 #define RTL_SOC_BASE			((volatile void *) 0xB8000000)
+
 #define RTL83XX_DRAM_CONFIG		0x1004
+
+#define RTL9300_SRAMSAR0		0x4000
+#define RTL9300_SRAMSAR1		0x4010
+#define RTL9300_SRAMSAR2		0x4020
+#define RTL9300_SRAMSAR3		0x4030
+#define RTL9300_UMSAR0			0x1300
+#define RTL9300_UMSAR1			0x1310
+#define RTL9300_UMSAR2			0x1320
+#define RTL9300_UMSAR3			0x1330
+#define RTL9300_O0DOR2			0x4220
+#define RTL9300_O0DMAR2			0x4224
+
 #define RTL931X_DRAM_CONFIG		0x14304c
 
 #define soc_r32(reg)			readl(RTL_SOC_BASE + reg)
@@ -251,6 +264,39 @@ static void get_system_memory(void)
 	soc_info.memory_size = 1 << bits;
 }
 
+static void prepare_highmem(void)
+{
+	if ((soc_info.family != RTL9300_FAMILY_ID) ||
+	    (soc_info.memory_size <= 256 * 1024 * 1024) ||
+	    !IS_ENABLED(CONFIG_HIGHMEM))
+		return;
+
+	/*
+	 * To use highmem on RTL930x, SRAM must be deactivated and the highmem mapping
+	 * registers must be setup properly. The hardcoded 0x70000000 might be strange
+	 * but at least it conforms somehow to the RTL931x devices.
+	 *
+	 * - RTL930x: highmem start 0x20000000 + offset 0x70000000 = 0x90000000
+	 * - RTL931x: highmem start 0x90000000 + no offset at all  = 0x90000000
+	 */
+
+	pr_info("highmem kernel on RTL930x with > 256 MB RAM, adapt SoC memory mapping\n");
+
+	soc_w32(0, RTL9300_UMSAR0);
+	soc_w32(0, RTL9300_UMSAR1);
+	soc_w32(0, RTL9300_UMSAR2);
+	soc_w32(0, RTL9300_UMSAR3);
+	soc_w32(0, RTL9300_SRAMSAR0);
+	soc_w32(0, RTL9300_SRAMSAR1);
+	soc_w32(0, RTL9300_SRAMSAR2);
+	soc_w32(0, RTL9300_SRAMSAR3);
+	__sync();
+
+	soc_w32(0x70000000, RTL9300_O0DOR2);
+	soc_w32(0x7fffffff, RTL9300_O0DMAR2);
+	__sync();
+}
+
 void __init prom_init(void)
 {
 	u32 model = read_model();
@@ -261,6 +307,8 @@ void __init prom_init(void)
 
 	pr_info("%s SoC with %d MB\n", get_system_type(), soc_info.memory_size >> 20);
 
+	prepare_highmem();
+
 	/*
 	 * fw_arg2 is be the pointer to the environment. Some devices (e.g. HP JG924A) hand
 	 * over other than expected kernel boot arguments. Something like 0xfffdffff looks



From lede-commits at lists.infradead.org  Wed Dec 31 13:00:27 2025
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 31 Dec 2025 16:00:27 -0500
Subject: [openwrt/openwrt]  realtek: determine memory size during
 initialization
In-Reply-To: <176721482626.2673130.1840372383649271825@git-01.infra.openwrt.org>
References: <176721482626.2673130.1840372383649271825@git-01.infra.openwrt.org>
Message-ID: <mailman.40265.1767214835.2093109.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/88e79af543cd0da4357b4327c694375c9b9610c6

commit 88e79af543cd0da4357b4327c694375c9b9610c6
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Dec 30 10:33:32 2025 +0100

    realtek: determine memory size during initialization
    
    For proper highmem initialization on RTL930x the size of the
    installed memory is needed during early bootup. Enhance the
    soc_info structure and fill the data from the registers.
    
    While we are here remove the obsolete compatible variable from
    the soc_info structure.
    
    Adapt boot message to show the memory size.
    
    old: SoC Type: Realtek RTL9301 rev B (6487)
    new: Realtek RTL9301 rev B (6487) SoC with 512 MB
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21327
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../mips/include/asm/mach-rtl838x/mach-rtl83xx.h   |  2 +-
 .../realtek/files-6.12/arch/mips/rtl838x/prom.c    | 26 +++++++++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h b/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h
index 0a98399591..8639661a94 100644
--- a/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h
+++ b/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h
@@ -48,8 +48,8 @@ struct rtl83xx_soc_info {
 	unsigned int revision;
 	unsigned int cpu;
 	bool testchip;
-	unsigned char *compatible;
 	int cpu_port;
+	int memory_size;
 };
 
 #endif /* _MACH_RTL838X_H_ */
diff --git a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
index 94d659913c..f8c13ee49f 100644
--- a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
+++ b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c
@@ -17,6 +17,13 @@
 
 #include <mach-rtl83xx.h>
 
+#define RTL_SOC_BASE			((volatile void *) 0xB8000000)
+#define RTL83XX_DRAM_CONFIG		0x1004
+#define RTL931X_DRAM_CONFIG		0x14304c
+
+#define soc_r32(reg)			readl(RTL_SOC_BASE + reg)
+#define soc_w32(val, reg)		writel(val, RTL_SOC_BASE + reg)
+
 struct rtl83xx_soc_info soc_info;
 const void *fdt;
 
@@ -228,14 +235,31 @@ static void __init set_system_type(void)
 		 soc_info.name, es, revision, soc_info.cpu);
 }
 
+static void get_system_memory(void)
+{
+	unsigned int dcr, bits;
+
+	if (soc_info.family == RTL9310_FAMILY_ID) {
+		dcr = soc_r32(RTL931X_DRAM_CONFIG);
+		bits = (dcr >> 12) + ((dcr >> 6) & 0x3f) + (dcr & 0x3f);
+	} else {
+		dcr = soc_r32(RTL83XX_DRAM_CONFIG);
+		bits = ((dcr >> 28) & 0x3) + ((dcr >> 24) & 0x3) +
+		       ((dcr >> 20) & 0xf) + ((dcr >> 16) & 0xf) + 20;
+	}
+
+	soc_info.memory_size = 1 << bits;
+}
+
 void __init prom_init(void)
 {
 	u32 model = read_model();
 
 	parse_model(model);
 	set_system_type();
+	get_system_memory();
 
-	pr_info("SoC Type: %s\n", get_system_type());
+	pr_info("%s SoC with %d MB\n", get_system_type(), soc_info.memory_size >> 20);
 
 	/*
 	 * fw_arg2 is be the pointer to the environment. Some devices (e.g. HP JG924A) hand



