summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev2024-06-14 19:04:21 +0000
committerRobert Marko2025-09-30 09:21:18 +0000
commitbd2e17c18064fbeabe39742bbbec1cc398917920 (patch)
tree8770017e383dcbe1fa5dfcba63d22a0cb29cabba
parent6c20daed133e93f8a72831fffc60f40d3a729dca (diff)
downloadopenwrt-bd2e17c18064fbeabe39742bbbec1cc398917920.tar.gz
ath79: dir-505: use nvmem
Userspace handling is deprecated. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://github.com/openwrt/openwrt/pull/20176 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--target/linux/ath79/dts/ar9330_dlink_dir-505.dts31
-rw-r--r--target/linux/ath79/generic/base-files/etc/board.d/02_network3
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom4
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@1000 {
+ reg = <0x1000 0x440>;
+ };
+ };
};
- mac: partition@20000 {
+ partition@20000 {
label = "mac";
reg = <0x20000 0x10000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_mac_4: macaddr@4 {
+ compatible = "mac-base";
+ reg = <0x4 0x11>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
partition@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