]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ath79: dir-505: use nvmem
authorRosen Penev <rosenp@gmail.com>
Fri, 14 Jun 2024 19:04:21 +0000 (12:04 -0700)
committerRobert Marko <robimarko@gmail.com>
Tue, 30 Sep 2025 09:21:18 +0000 (11:21 +0200)
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>
target/linux/ath79/dts/ar9330_dlink_dir-505.dts
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

index c6fc0d97aaa104eae45212a12ccb2a7bef0f4035..1362ffea67479462f9c9543fbe3aeda71ac73117 100644 (file)
@@ -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>;
                                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 {
 
 &wmac {
        status = "okay";
-       qca,no-eeprom;
+
+       nvmem-cells = <&cal_art_1000>, <&macaddr_mac_4 0>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
index d397600ddc5377eab160783fd8605e114e21b8de..30ee6405b155ba9512813363fc0c0015b8ade40c 100644 (file)
@@ -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)
index 97acc60b80ac73c373e75bbb7d1f7c1149841f57..63f10e0de36c17fbe4a243830aaf97253a8bab8b 100644 (file)
@@ -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