[openwrt/openwrt] ramips: update WLAN MAC address of Phicomm K2P

LEDE Commits lede-commits at lists.infradead.org
Sat Mar 12 22:43:04 PST 2022


mans0n pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/285e636b1665f0f238da072c497f150f9acc4b54

commit 285e636b1665f0f238da072c497f150f9acc4b54
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Sun Jan 9 12:16:06 2022 +0800

    ramips: update WLAN MAC address of Phicomm K2P
    
    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 at jmu.edu.cn>
---
 target/linux/ramips/dts/mt7621_phicomm_k2p.dts               | 12 +++++++++++-
 .../base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac       |  3 ++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
index a5060a1aee..a0bdab2226 100644
--- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
+++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
@@ -96,9 +96,15 @@
 };
 
 &pcie0 {
-	mt76 at 0,0 {
+	wifi at 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";
 	};
 };
 
@@ -150,6 +156,10 @@
 	#address-cells = <1>;
 	#size-cells = <1>;
 
+	macaddr_factory_4: macaddr at 4 {
+		reg = <0x4 0x6>;
+	};
+
 	macaddr_factory_e000: macaddr at e000 {
 		reg = <0xe000 0x6>;
 	};
diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 7b6827b79a..9a002d24c8 100644
--- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -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




More information about the lede-commits mailing list