mediatek: filogic: use nvmem for Unifi 6 Plus WiFi mac
authorBjørn Mork <[email protected]>
Wed, 24 Sep 2025 17:18:20 +0000 (19:18 +0200)
committerHauke Mehrtens <[email protected]>
Fri, 26 Sep 2025 22:32:40 +0000 (00:32 +0200)
Avoids the occacial lost race, where VAPs are created before the hotplug
script has updated the phy mac address.

Signed-off-by: Bjørn Mork <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20154
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts
target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac

index 51b8c420218aa3f7bd5bf00bef0d02ae21c891f6..9c1182e85dce3d494f7c5b69ef4c5ada061cbf55 100644 (file)
                                        };
 
                                        macaddr_eeprom_6: macaddr@6 {
+                                               compatible = "mac-base";
                                                reg = <0x6 0x6>;
+                                               #nvmem-cell-cells = <1>;
                                        };
                                };
                        };
 };
 
 &wifi {
+       #address-cells = <1>;
+       #size-cells = <0>;
        status = "okay";
+
+       band@0 {
+               reg = <0>;
+               nvmem-cells = <&macaddr_eeprom_6 0>;
+               nvmem-cell-names = "mac-address";
+       };
+
+       band@1 {
+               reg = <1>;
+               nvmem-cells = <&macaddr_eeprom_6 1>;
+               nvmem-cell-names = "mac-address";
+       };
 };
index d753941c62ab9cc4024e352d8891e2b1bc2712c0..93a3e86a162a80a0cad720d05f7c48fcf4252093 100644 (file)
@@ -206,11 +206,6 @@ case "$board" in
        tplink,tl-xtr8488)
                [ "$PHYNBR" = "1" ] && get_mac_label > /sys${DEVPATH}/macaddress
                ;;
-       ubnt,unifi-6-plus)
-               addr=$(mtd_get_mac_binary EEPROM 0x6)
-               [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
-               [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
-               ;;
        routerich,ax3000|\
        routerich,ax3000-ubootmod|\
        zbtlink,zbt-z8102ax|\