]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mt7621: zyxel nwa-ax: set mac address in dts 19771/head
authorRosen Penev <rosenp@gmail.com>
Wed, 13 Aug 2025 23:34:05 +0000 (16:34 -0700)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 17 Aug 2025 16:55:38 +0000 (18:55 +0200)
Support in mt76 has existed for quite a while. Use it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19771
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi
target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

index cd6f63a78e176d8965cbfb0ee7dd08cc6921587c..4505eb9c776201c38a3c520e8f75a4f46a841a75 100644 (file)
                                #size-cells = <1>;
 
                                macaddr_mrd_1fff8: macaddr@1fff8 {
+                                       compatible = "mac-base";
                                        reg = <0x1fff8 0x6>;
+                                       #nvmem-cell-cells = <1>;
                                };
                        };
                };
                reg = <0x0000 0 0 0 0>;
                nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
                nvmem-cell-names = "eeprom", "precal";
-               /* MAC-Address set in userspace */
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               band@0 {
+                       reg = <0>;
+                       nvmem-cells = <&macaddr_mrd_1fff8 0>;
+                       nvmem-cell-names = "mac-address";
+               };
+
+               band@1 {
+                       reg = <1>;
+                       nvmem-cells = <&macaddr_mrd_1fff8 1>;
+                       nvmem-cell-names = "mac-address";
+               };
        };
 };
 
 &gmac0 {
-       nvmem-cells = <&macaddr_mrd_1fff8>;
+       nvmem-cells = <&macaddr_mrd_1fff8 0>;
        nvmem-cell-names = "mac-address";
 };
 
index 21ab3f16ea400735633ebdecb54bf9f7769dd456..2dd11f67603346be4698e2a4029f13f149403f1f 100644 (file)
@@ -245,12 +245,6 @@ 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,nwa50ax|\
-       zyxel,nwa55axe)
-               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
-               ;;
        zyxel,wsm20)
                hw_mac_addr="$(mtd_get_mac_binary Factory 0x1fdfa)"
                [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress