From 97fca425073b79c8ebf64d40ea29bda2dbbcec78 Mon Sep 17 00:00:00 2001 From: Zhi-Jun You Date: Fri, 5 Sep 2025 12:43:12 +0800 Subject: [PATCH] mediatek: filogic: use NVMEM for wifi macaddr on NWA50AX Pro Convert NWA50AX Pro to use NVMEM framework for wifi macaddr. Also remove the unused macaddr@a. Signed-off-by: Zhi-Jun You Link: https://github.com/openwrt/openwrt/pull/19982 Signed-off-by: Hauke Mehrtens --- .../dts/mt7981b-zyxel-nwa50ax-pro.dts | 22 ++++++++++++++----- .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 5 ----- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts b/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts index dc22046262..e6f335feac 100644 --- a/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts +++ b/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts @@ -71,7 +71,7 @@ phy-handle = <&phy0>; - nvmem-cells = <&macaddr_mrd_1fff8>; + nvmem-cells = <&macaddr_mrd_1fff8 0>; nvmem-cell-names = "mac-address"; }; }; @@ -162,10 +162,6 @@ precal_factory_1010: precal@1010 { reg = <0x1010 0x6f010>; }; - - macaddr: macaddr@a { - reg = <0xa 0x6>; - }; }; }; @@ -220,7 +216,9 @@ #size-cells = <1>; macaddr_mrd_1fff8: macaddr@1fff8 { + compatible = "mac-base"; reg = <0x1fff8 0x6>; + #nvmem-cell-cells = <1>; }; }; }; @@ -247,5 +245,19 @@ &wifi { nvmem-cells = <&eeprom_factory_0>, <&precal_factory_1010>; nvmem-cell-names = "eeprom", "precal"; + #address-cells = <1>; + #size-cells = <0>; status = "okay"; + + band@0 { + reg = <0>; + nvmem-cells = <&macaddr_mrd_1fff8 1>; + nvmem-cell-names = "mac-address"; + }; + + band@1 { + reg = <1>; + nvmem-cells = <&macaddr_mrd_1fff8 2>; + nvmem-cell-names = "mac-address"; + }; }; 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 da0323dae0..36024bf2e3 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 @@ -218,9 +218,4 @@ case "$board" in addr=$(mtd_get_mac_binary factory 0x04) [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr -0x300000) > /sys${DEVPATH}/macaddress ;; - zyxel,nwa50ax-pro) - hw_mac_addr="$(mtd_get_mac_binary mrd 0x1fff8)" - [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress - ;; esac -- 2.30.2