[openwrt/openwrt] ath79: dlink,dir-615-e4: use nvmem

LEDE Commits lede-commits at lists.infradead.org
Wed Sep 24 04:33:04 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2767baebed8a55e1c71e8ca5c380237dbd153bc7

commit 2767baebed8a55e1c71e8ca5c380237dbd153bc7
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Jun 15 13:57:31 2024 -0700

    ath79: dlink,dir-615-e4: use nvmem
    
    Userspace handling is deprecated.
    
    Move the mac address patch to 10_fix_wifi_mac.
    
    This uses an AR9287, which uses a smaller size for its calibration.
    
    The PCI ID is also wrong.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/19864
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts    | 15 +++++++++++++--
 .../base-files/etc/hotplug.d/firmware/10-ath9k-eeprom |  4 ----
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac           | 19 +++++++++++++++++++
 3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts b/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts
index 4a709395e9..18eb6f8c74 100644
--- a/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts
+++ b/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts
@@ -138,6 +138,16 @@
 				reg = <0x3f0000 0x10000>;
 				label = "art";
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					cal_art_1000: calibration at 1000 {
+						reg = <0x1000 0x3d8>;
+					};
+				};
 			};
 		};
 	};
@@ -151,9 +161,10 @@
 	status = "okay";
 
 	ath9k: wifi at 0,0 {
-		compatible = "pci168c,002b";
+		compatible = "pci168c,002e";
 		reg = <0x0000 0 0 0 0>;
-		qca,no-eeprom;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
 		#gpio-cells = <2>;
 		gpio-controller;
 	};
diff --git a/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 6976a24c07..ccbaafda72 100644
--- a/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -14,10 +14,6 @@ case "$FIRMWARE" in
 	engenius,enh202-v1)
 		caldata_extract "art" 0x1000 0xeb8
 		;;
-	dlink,dir-615-e4)
-		caldata_extract "art" 0x1000 0x1000
-		ath9k_patch_mac_crc $(mtd_get_mac_ascii "nvram" "lan_mac") 0x10c
-		;;
 	netgear,wnr2000-v3|\
 	ubnt,airrouter|\
 	ubnt,bullet-m-ar7240|\
diff --git a/target/linux/ath79/tiny/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/tiny/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
new file mode 100755
index 0000000000..0a950d8582
--- /dev/null
+++ b/target/linux/ath79/tiny/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -0,0 +1,19 @@
+#!/bin/ash
+
+[ "$ACTION" = "add" ] || exit 0
+
+PHYNBR=${DEVPATH##*/phy}
+
+[ -n $PHYNBR ] || exit 0
+
+. /lib/functions.sh
+. /lib/functions/system.sh
+
+board=$(board_name)
+
+case "$board" in
+	dlink,dir-615-e4)
+		[ "$PHYNBR" -eq 0 ] && \
+			mtd_get_mac_ascii "nvram" "lan_mac" > /sys${DEVPATH}/macaddress
+		;;
+esac




More information about the lede-commits mailing list