[openwrt/openwrt] ath79: dir-505: use nvmem

LEDE Commits lede-commits at lists.infradead.org
Tue Sep 30 02:21:23 PDT 2025


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

commit bd2e17c18064fbeabe39742bbbec1cc398917920
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Jun 14 12:04:21 2024 -0700

    ath79: dir-505: use nvmem
    
    Userspace handling is deprecated.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20176
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/ath79/dts/ar9330_dlink_dir-505.dts    | 31 ++++++++++++++++++++--
 .../generic/base-files/etc/board.d/02_network      |  3 ---
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  4 ---
 3 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/target/linux/ath79/dts/ar9330_dlink_dir-505.dts b/target/linux/ath79/dts/ar9330_dlink_dir-505.dts
index c6fc0d97aa..1362ffea67 100644
--- a/target/linux/ath79/dts/ar9330_dlink_dir-505.dts
+++ b/target/linux/ath79/dts/ar9330_dlink_dir-505.dts
@@ -73,6 +73,9 @@
 &eth0 {
 	status = "okay";
 
+	nvmem-cells = <&macaddr_mac_4 0>;
+	nvmem-cell-names = "mac-address";
+
 	gmac-config {
 		device = <&gmac>;
 		switch-phy-addr-swap = <0>;
@@ -108,12 +111,34 @@
 				label = "art";
 				reg = <0x10000 0x10000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					cal_art_1000: calibration at 1000 {
+						reg = <0x1000 0x440>;
+					};
+				};
 			};
 
-			mac: partition at 20000 {
+			partition at 20000 {
 				label = "mac";
 				reg = <0x20000 0x10000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					macaddr_mac_4: macaddr at 4 {
+						compatible = "mac-base";
+						reg = <0x4 0x11>;
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 
 			partition at 30000 {
@@ -139,5 +164,7 @@
 
 &wmac {
 	status = "okay";
-	qca,no-eeprom;
+
+	nvmem-cells = <&cal_art_1000>, <&macaddr_mac_4 0>;
+	nvmem-cell-names = "calibration", "mac-address";
 };
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index d397600ddc..30ee6405b1 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -709,9 +709,6 @@ ath79_setup_macs()
 	dlink,dir-629-a1)
 		wan_mac=$(mtd_get_mac_text "mfcdata" 0x6a)
 		;;
-	dlink,dir-505)
-		lan_mac=$(mtd_get_mac_text "mac" 0x4)
-		;;
 	dlink,dir-825-c1|\
 	dlink,dir-835-a1)
 		wan_mac=$(mtd_get_mac_text "mac" 0x18)
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 97acc60b80..63f10e0de3 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -20,10 +20,6 @@ case "$FIRMWARE" in
 	avm,fritzdvbc)
 		caldata_extract_reverse "urlader" 0x1541 0x440
 		;;
-	dlink,dir-505)
-		caldata_extract "art" 0x1000 0x440
-		ath9k_patch_mac $(mtd_get_mac_text "mac" 0x4)
-		;;
 	engenius,ecb1200|\
 	engenius,ecb1750)
 		caldata_extract "art" 0x1000 0x440




More information about the lede-commits mailing list