ath79: nec,wg800hp: convert to nvmem
authorRosen Penev <rosenp@gmail.com>
Sat, 15 Jun 2024 22:19:04 +0000 (15:19 -0700)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 29 Aug 2024 19:23:58 +0000 (21:23 +0200)
Userspace handling is deprecated.

Unused wan mac added to dts. Requires DSA to implement.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16246
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/ath79/dts/qca9563_nec_wg800hp.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 d2621fa30400fdaebce69e1a938081390676728b..d8ecf462017fa412b0660516e43a7a6449fae5dc 100644 (file)
                                        #address-cells = <1>;
                                        #size-cells = <1>;
 
+                                       macaddr_board_data_280: macaddr@280 {
+                                               compatible = "mac-base";
+                                               reg = <0x280 0x11>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+
+                                       macaddr_board_data_480: macaddr@480 {
+                                               compatible = "mac-base";
+                                               reg = <0x480 0x11>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+
+                                       macaddr_board_data_680: macaddr@680 {
+                                               compatible = "mac-base";
+                                               reg = <0x680 0x11>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+
                                        macaddr_board_data_880: macaddr@880 {
                                                compatible = "mac-base";
                                                reg = <0x880 0x11>;
                                        #address-cells = <1>;
                                        #size-cells = <1>;
 
+                                       cal_art_1000: calibration@1000 {
+                                               reg = <0x1000 0x440>;
+                                       };
+
                                        cal_art_5000: calibration@5000 {
                                                reg = <0x5000 0x844>;
                                        };
 
        phy-mode = "sgmii";
        phy-handle = <&phy0>;
+
+       nvmem-cells = <&macaddr_board_data_280 0>;
+       nvmem-cell-names = "mac-address";
 };
 
 &pcie {
 
 &wmac {
        status = "okay";
-       qca,no-eeprom;
+
+       nvmem-cells = <&macaddr_board_data_680 0>, <&cal_art_1000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
index bc251d048484610102ebee6d09d2321ed12ef6f4..742892a2f3c79dc87a9d473471ff4fbc2ca15bcf 100644 (file)
@@ -781,7 +781,6 @@ ath79_setup_macs()
                label_mac=$wan_mac
                ;;
        nec,wg800hp)
-               lan_mac=$(mtd_get_mac_text board_data 0x280)
                wan_mac=$(mtd_get_mac_text board_data 0x480)
                label_mac=$wan_mac
                ;;
index 1f20250a2b06a327264b54a43346fa3bc16c5730..8cbb0e10bd645dae2e8a22d3778aa3cd878839b8 100644 (file)
@@ -61,10 +61,6 @@ case "$FIRMWARE" in
                caldata_extract "art" 0x1000 0x440
                ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)
                ;;
-       nec,wg800hp)
-               caldata_extract "art" 0x1000 0x440
-               ath9k_patch_mac $(mtd_get_mac_text board_data 0x680)
-               ;;
        qihoo,c301)
                caldata_extract "radiocfg" 0x1000 0x440
                ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")