From 749fa79e016cd3c22ce5ee7a53c4dc61f67c8a8a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 13 Aug 2025 17:22:35 -0700 Subject: [PATCH] ramips: zyxel wsm20: set mac address in dts Support in mt76 has existed for quite a while. Use it. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/19799 Signed-off-by: Hauke Mehrtens --- .../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 42dc7160275..07e35513176 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@1fdfa { + compatible = "mac-base"; reg = <0x1fdfa 0x6>; + #nvmem-cell-cells = <1>; }; macaddr_factory_1fdf4: macaddr@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@0 { + reg = <0>; + nvmem-cells = <&macaddr_factory_1fdfa 1>; + nvmem-cell-names = "mac-address"; + }; + + band@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 2dd11f67603..fe097404922 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 -- 2.47.2