[openwrt/openwrt] realtek: switch Zyxel XGS1210 to NVMEM

LEDE Commits lede-commits at lists.infradead.org
Sun Feb 15 03:02:41 PST 2026


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

commit 98e7ed14629b8f906f5f958c3153c3fd4b04fe94
Author: Jan Hoffmann <jan at 3e8.eu>
AuthorDate: Sat Feb 14 20:27:58 2026 +0100

    realtek: switch Zyxel XGS1210 to NVMEM
    
    These devices contain a single MAC address in the U-Boot environment.
    Set it as eth0 and label MAC in device tree.
    
    To maintain the current state, the 02_network script still sets
    individual port MAC addresses and the bridge MAC address.
    
    Signed-off-by: Jan Hoffmann <jan at 3e8.eu>
    Link: https://github.com/openwrt/openwrt/pull/22024
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/realtek/base-files/etc/board.d/02_network  |  6 +++---
 .../realtek/dts/rtl9302_zyxel_xgs1210-12-common.dtsi    | 17 +++++++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network
index 188f9ded20..528ca4f342 100644
--- a/target/linux/realtek/base-files/etc/board.d/02_network
+++ b/target/linux/realtek/base-files/etc/board.d/02_network
@@ -58,7 +58,9 @@ realtek_setup_macs()
 	tplink,sg2452p-v4|\
 	tplink,t1600g-28ts-v3|\
 	xikestor,sks8300-8t|\
-	xikestor,sks8300-12e2t2x)
+	xikestor,sks8300-12e2t2x|\
+	zyxel,xgs1210-12-a1|\
+	zyxel,xgs1210-12-b1)
 		lan_mac=$(get_mac_label)
 		lan_mac_start=$lan_mac
 		;;
@@ -142,8 +144,6 @@ realtek_setup_macs()
 	zyxel,gs1900-8hp-a1|\
 	zyxel,gs1900-8hp-b1|\
 	zyxel,gs1920-24hp-v1|\
-	zyxel,xgs1210-12-a1|\
-	zyxel,xgs1210-12-b1|\
 	zyxel,xgs1250-12-a1|\
 	zyxel,xgs1250-12-b1)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env2 mac_start)
diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-common.dtsi b/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-common.dtsi
index a4e82b5af0..034d24b0cc 100644
--- a/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-common.dtsi
+++ b/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-common.dtsi
@@ -4,6 +4,10 @@
 #include "rtl9302_zyxel_xgs1x10-12-common.dtsi"
 
 / {
+	aliases {
+		label-mac-device = &ethernet0;
+	};
+
 	keys {
 		compatible = "gpio-keys";
 
@@ -35,6 +39,14 @@
 			partition at e0000 {
 				label = "u-boot-env";
 				reg = <0xe0000 0x10000>;
+
+				nvmem-layout {
+					compatible = "u-boot,env";
+
+					macaddr_ubootenv_ethaddr: ethaddr {
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 			partition at f0000 {
 				label = "u-boot-env2";
@@ -63,3 +75,8 @@
 		};
 	};
 };
+
+&ethernet0 {
+	nvmem-cells = <&macaddr_ubootenv_ethaddr 0>;
+	nvmem-cell-names = "mac-address";
+};




More information about the lede-commits mailing list