[openwrt/openwrt] ramips: zyxel wsm20: set mac address in dts

LEDE Commits lede-commits at lists.infradead.org
Sun Aug 24 07:36:03 PDT 2025


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

commit 749fa79e016cd3c22ce5ee7a53c4dc61f67c8a8a
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Wed Aug 13 17:22:35 2025 -0700

    ramips: zyxel wsm20: set mac address in dts
    
    Support in mt76 has existed for quite a while. Use it.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/19799
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ramips/dts/mt7621_zyxel_wsm20.dts        | 19 ++++++++++++++++++-
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac           |  5 -----
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts
index 42dc716027..07e3551317 100644
--- a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts
+++ b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts
@@ -121,7 +121,9 @@
 				};
 
 				macaddr_factory_1fdfa: macaddr at 1fdfa {
+					compatible = "mac-base";
 					reg = <0x1fdfa 0x6>;
+					#nvmem-cell-cells = <1>;
 				};
 
 				macaddr_factory_1fdf4: macaddr at 1fdf4 {
@@ -180,7 +182,7 @@
 };
 
 &gmac0 {
-	nvmem-cells = <&macaddr_factory_1fdfa>;
+	nvmem-cells = <&macaddr_factory_1fdfa 0>;
 	nvmem-cell-names = "mac-address";
 };
 
@@ -208,6 +210,21 @@
 		nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
 		nvmem-cell-names = "eeprom", "precal";
 		mediatek,disable-radar-background;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		band at 0 {
+			reg = <0>;
+			nvmem-cells = <&macaddr_factory_1fdfa 1>;
+			nvmem-cell-names = "mac-address";
+		};
+
+		band at 1 {
+			reg = <1>;
+			nvmem-cells = <&macaddr_factory_1fdfa 2>;
+			nvmem-cell-names = "mac-address";
+		};
 	};
 };
 
diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 2dd11f6760..fe09740492 100644
--- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -245,9 +245,4 @@ case "$board" in
 		[ "$PHYNBR" = "0" ] && macaddr_setbit_la "$hw_mac_addr" > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && echo -n "$hw_mac_addr" > /sys${DEVPATH}/macaddress
 		;;
-	zyxel,wsm20)
-		hw_mac_addr="$(mtd_get_mac_binary Factory 0x1fdfa)"
-		[ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
-		[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
-		;;
 esac




More information about the lede-commits mailing list