]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: filogic: use NVMEM for wifi macaddr on NWA50AX Pro
authorZhi-Jun You <hujy652@protonmail.com>
Fri, 5 Sep 2025 04:43:12 +0000 (12:43 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 10 Sep 2025 20:57:49 +0000 (22:57 +0200)
Convert NWA50AX Pro to use NVMEM framework for wifi macaddr.

Also remove the unused macaddr@a.

Signed-off-by: Zhi-Jun You <hujy652@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/19982
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts
target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac

index dc22046262fc1c798e994173de5449a6f802e530..e6f335feac0c8794cb122c608f41775741c9f0f1 100644 (file)
@@ -71,7 +71,7 @@
 
                phy-handle = <&phy0>;
 
-               nvmem-cells = <&macaddr_mrd_1fff8>;
+               nvmem-cells = <&macaddr_mrd_1fff8 0>;
                nvmem-cell-names = "mac-address";
        };
 };
                                        precal_factory_1010: precal@1010 {
                                                reg = <0x1010 0x6f010>;
                                        };
-
-                                       macaddr: macaddr@a {
-                                               reg = <0xa 0x6>;
-                                       };
                                };
                        };
 
                                        #size-cells = <1>;
 
                                        macaddr_mrd_1fff8: macaddr@1fff8 {
+                                               compatible = "mac-base";
                                                reg = <0x1fff8 0x6>;
+                                               #nvmem-cell-cells = <1>;
                                        };
                                };
                        };
 &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";
+       };
 };
index da0323dae088a222253a3d561cba4fe17cbeba45..36024bf2e37387900f1dcfd540efa8d1d96b5741 100644 (file)
@@ -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