]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ath79: tew-673gru: use nvmem
authorRosen Penev <rosenp@gmail.com>
Fri, 14 Jun 2024 17:59:16 +0000 (10:59 -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/ar7161_trendnet_tew-673gru.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 d10c75c0d6708e36348799fe885557c275afb0f1..c704b062f13952887bdcfd6907dea78623e4c5cb 100644 (file)
@@ -11,6 +11,7 @@
        model = "TRENDNET TEW-673GRU";
 
        aliases {
+               label-mac-device = &eth1;
                led-boot = &led_wps;
                led-failsafe = &led_wps;
                led-running = &led_wps;
        wifi@11,0 {
                compatible = "pci168c,0029";
                reg = <0x8800 0 0 0 0>;
-               qca,no-eeprom;
+               nvmem-cells = <&cal_caldata_1000>, <&macaddr_lan 0>;
+               nvmem-cell-names = "calibration", "mac-address";
        };
 
        wifi@12,0 {
                compatible = "pci168c,0029";
                reg = <0x9000 0 0 0 0>;
-               qca,no-eeprom;
+               nvmem-cells = <&cal_caldata_5000>, <&macaddr_wan 1>;
+               nvmem-cell-names = "calibration", "mac-address";
        };
 };
 
                                label = "caldata";
                                reg = <0x660000 0x010000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       cal_caldata_1000: calibration@1000 {
+                                               reg = <0x1000 0xeb8>;
+                                       };
+
+                                       cal_caldata_5000: calibration@5000 {
+                                               reg = <0x5000 0xeb8>;
+                                       };
+
+                                       macaddr_lan: macaddr@ffa0 {
+                                               compatible = "mac-base";
+                                               reg = <0xffa0 0x11>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+
+                                       macaddr_wan: macaddr@ffb4 {
+                                               compatible = "mac-base";
+                                               reg = <0xffb4 0x11>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
 
                        fwconcat1: partition@670000 {
 
        pll-data = <0x11110000 0x00001099 0x00991099>;
 
+       nvmem-cells = <&macaddr_lan 0>;
+       nvmem-cell-names = "mac-address";
+
        fixed-link {
                speed = <1000>;
                full-duplex;
 
        pll-data = <0x11110000 0x00001099 0x00991099>;
 
+       nvmem-cells = <&macaddr_wan 0>;
+       nvmem-cell-names = "mac-address";
+
        phy-handle = <&phy4>;
 };
index 464fec44d1eea17c39ce721b5d9ad587b6f981f4..d397600ddc5377eab160783fd8605e114e21b8de 100644 (file)
@@ -709,11 +709,6 @@ ath79_setup_macs()
        dlink,dir-629-a1)
                wan_mac=$(mtd_get_mac_text "mfcdata" 0x6a)
                ;;
-       trendnet,tew-673gru)
-               lan_mac=$(mtd_get_mac_text "caldata" 0xffa0)
-               wan_mac=$(mtd_get_mac_text "caldata" 0xffb4)
-               label_mac=$wan_mac
-               ;;
        dlink,dir-505)
                lan_mac=$(mtd_get_mac_text "mac" 0x4)
                ;;
index 0a98a8ef8cd647bf54cb4d3813f85df013da8a8b..97acc60b80ac73c373e75bbb7d1f7c1149841f57 100644 (file)
@@ -90,10 +90,6 @@ case "$FIRMWARE" in
        buffalo,wzr-hp-ag300h)
                caldata_extract "art" 0x1000 0xeb8
                ;;
-       trendnet,tew-673gru)
-               caldata_extract "caldata" 0x1000 0xeb8
-               ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c
-               ;;
        meraki,mr16)
                caldata_extract "art" 0x11000 0xeb8
                ;;
@@ -108,10 +104,6 @@ case "$FIRMWARE" in
        buffalo,wzr-hp-ag300h)
                caldata_extract "art" 0x5000 0xeb8
                ;;
-       trendnet,tew-673gru)
-               caldata_extract "caldata" 0x5000 0xeb8
-               ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c
-               ;;
        meraki,mr16)
                caldata_extract "art" 0x15000 0xeb8
                ;;