[openwrt/openwrt] mediatek: filogic: use NVMEM for wifi macaddr on NWA50AX Pro

LEDE Commits lede-commits at lists.infradead.org
Wed Sep 10 14:00:18 PDT 2025


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

commit 97fca425073b79c8ebf64d40ea29bda2dbbcec78
Author: Zhi-Jun You <hujy652 at protonmail.com>
AuthorDate: Fri Sep 5 12:43:12 2025 +0800

    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 at a.
    
    Signed-off-by: Zhi-Jun You <hujy652 at protonmail.com>
    Link: https://github.com/openwrt/openwrt/pull/19982
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../mediatek/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 at 1010 {
 						reg = <0x1010 0x6f010>;
 					};
-
-					macaddr: macaddr at a {
-						reg = <0xa 0x6>;
-					};
 				};
 			};
 
@@ -220,7 +216,9 @@
 					#size-cells = <1>;
 
 					macaddr_mrd_1fff8: macaddr at 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 at 0 {
+		reg = <0>;
+		nvmem-cells = <&macaddr_mrd_1fff8 1>;
+		nvmem-cell-names = "mac-address";
+	};
+
+	band at 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




More information about the lede-commits mailing list