ath79: ecb1xxx: use nvmem
authorRosen Penev <[email protected]>
Fri, 14 Jun 2024 18:50:06 +0000 (11:50 -0700)
committerHauke Mehrtens <[email protected]>
Tue, 2 Dec 2025 23:01:41 +0000 (00:01 +0100)
Userspace handling is deprecated.

Also switch LED to led-sources for simplicity.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20529
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

index 2a00985ba75b3a98da562cae543f045cdd65c3dc..ef7bd19e0079e7faf23dab1d3c7485a4f8e2e301 100644 (file)
@@ -8,6 +8,7 @@
 
 / {
        aliases {
+               label-mac-device = &eth0;
                led-boot = &led_power;
                led-failsafe = &led_power;
                led-running = &led_power;
                        default-state = "on";
                };
 
-               wifi2g {
-                       label = "blue:wifi2g";
-                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-                       linux,default-trigger = "phy1tpt";
-               };
-
                wifi5g {
                        label = "blue:wifi5g";
                        gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
                        partition@40000 {
                                label = "u-boot-env";
                                reg = <0x040000 0x010000>;
+
+                               nvmem-layout {
+                                       compatible = "u-boot,env";
+
+                                       macaddr_uboot_ethaddr: ethaddr {
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
 
                        partition@50000 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
 
+                                       cal_art_1000: calibration@1000 {
+                                               reg = <0x1000 0x440>;
+                                       };
+
                                        cal_art_5000: calibration@5000 {
                                                reg = <0x5000 0x844>;
                                        };
        phy-handle = <&phy5>;
        phy-mode = "rgmii-id";
 
+       nvmem-cells = <&macaddr_uboot_ethaddr 0>;
+       nvmem-cell-names = "mac-address";
+
        pll-data = <0x82000000 0x80000101 0x80001313>;
 
        gmac-config {
 &wmac {
        status = "okay";
 
-       qca,no-eeprom;
+       nvmem-cells = <&cal_art_1000>;
+       nvmem-cell-names = "calibration";
+
+       led {
+               led-sources = <13>;
+               led-active-low;
+       };
 };
index fa158b839c5a570081ffef7dc4a9f53cdf754001..fcb56bd777e3b3b8ba21ea1a85670aacadd8c4b3 100644 (file)
@@ -722,9 +722,7 @@ ath79_setup_macs()
                ;;
        elecom,wab-i1750-ps|\
        elecom,wab-s1167-ps|\
-       elecom,wab-s600-ps|\
-       engenius,ecb1200|\
-       engenius,ecb1750)
+       elecom,wab-s600-ps)
                lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
                label_mac=$lan_mac
                ;;
index 798f2da136da9129118a9cc85ab9b6e9e82d8cf1..b3181372be8658fadca19f911efe66d8591dbdd1 100644 (file)
@@ -15,11 +15,6 @@ case "$FIRMWARE" in
        avm,fritzdvbc)
                caldata_extract_reverse "urlader" 0x1541 0x440
                ;;
-       engenius,ecb1200|\
-       engenius,ecb1750)
-               caldata_extract "art" 0x1000 0x440
-               ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
-               ;;
        sitecom,wlr-7100|\
        sitecom,wlr-8100)
                caldata_extract "art" 0x1000 0x440
index 6153599907d964209c197ca450c91b6ff00292fc..c71ba436b44e623aed918cfd397680d7c642ca62 100644 (file)
@@ -49,8 +49,7 @@ case "$board" in
                ;;
        engenius,ecb1200|\
        engenius,ecb1750)
-               [ "$PHYNBR" -eq 0 ] && \
-                       mtd_get_mac_ascii u-boot-env athaddr > /sys${DEVPATH}/macaddress
+               macaddr_add "$(mtd_get_mac_ascii u-boot-env athaddr)" ${PHYNBR} > /sys${DEVPATH}/macaddress
                ;;
        enterasys,ws-ap3705i)
                [ "$PHYNBR" -eq 0 ] && \