ramips: update WLAN MAC address of Phicomm K2P
authorChukun Pan <amadeus@jmu.edu.cn>
Sun, 9 Jan 2022 04:16:06 +0000 (12:16 +0800)
committerSungbo Eo <mans0n@gorani.run>
Sun, 13 Mar 2022 03:39:58 +0000 (12:39 +0900)
The wireless mac address difference of this machine is similar
to that of D-Link DIR-853-R1, so use the same practice.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
target/linux/ramips/dts/mt7621_phicomm_k2p.dts
target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

index a5060a1aee23a1dd4d317b94d262148fbe6d5d23..a0bdab2226399e57b798ab9b35c30ed2b258c82f 100644 (file)
 };
 
 &pcie0 {
-       mt76@0,0 {
+       wifi@0,0 {
+               compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                mediatek,mtd-eeprom = <&factory 0x0>;
+
+               /* 5 GHz (phy1) does not take the address from calibration data,
+                  but setting it manually here works */
+               nvmem-cells = <&macaddr_factory_4>;
+               nvmem-cell-names = "mac-address";
        };
 };
 
        #address-cells = <1>;
        #size-cells = <1>;
 
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+
        macaddr_factory_e000: macaddr@e000 {
                reg = <0xe000 0x6>;
        };
index 7b6827b79a0f79b4107545eeb252ef1ae5e0e767..9a002d24c81e3a7cd52c32ec358fc9031e388bdf 100644 (file)
@@ -15,7 +15,8 @@ case "$board" in
                        macaddr_setbit_la "$(mtd_get_mac_binary factory 0xe000)" \
                                > /sys${DEVPATH}/macaddress
                ;;
-       dlink,dir-853-r1)
+       dlink,dir-853-r1|\
+       phicomm,k2p)
                if [ "$PHYNBR" = "0" ]; then
                        base_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" -1)
                        macaddr_setbit_la "$base_mac" > /sys${DEVPATH}/macaddress