ath79: convert WiFis based on ar7241_ubnt_unifi.dtsi to nvmem-cells
authorNick Hainke <vincent@systemli.org>
Thu, 15 Dec 2022 16:04:14 +0000 (17:04 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 17 Dec 2022 19:48:57 +0000 (20:48 +0100)
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

While working on it remove stale uboot partition label and merge art
into partition node.

Signed-off-by: Nick Hainke <vincent@systemli.org>
target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts
target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi
target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

index 9ccbdbd450d40e09cf9f5450048bdfae3a3d2e50..3f965ec9deaea0c925e06ba3068360d41f3f0cd6 100644 (file)
@@ -41,7 +41,7 @@
                        #address-cells = <1>;
                        #size-cells = <1>;
 
-                       uboot: partition@0 {
+                       partition@0 {
                                label = "u-boot";
                                reg = <0x0 0x40000>;
                                read-only;
                                read-only;
                        };
 
-                       art: partition@ff0000 {
+                       partition@ff0000 {
                                label = "art";
                                reg = <0xff0000 0x10000>;
                                read-only;
+
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               macaddr_art_0: macaddr@0 {
+                                       reg = <0x0 0x6>;
+                               };
+
+                               macaddr_art_6: macaddr@6 {
+                                       reg = <0x6 0x6>;
+                               };
+
+                               calibration_art_1000: calibration@1000 {
+                                       reg = <0x1000 0xeb8>;
+                               };
                        };
                };
        };
 
 &wifi {
        ubnt,hsr;
-};
-
-&art {
-       compatible = "nvmem-cells";
-       #address-cells = <1>;
-       #size-cells = <1>;
-
-       macaddr_art_0: macaddr@0 {
-               reg = <0x0 0x6>;
-       };
-
-       macaddr_art_6: macaddr@6 {
-               reg = <0x6 0x6>;
-       };
+       nvmem-cells = <&calibration_art_1000>;
+       nvmem-cell-names = "calibration";
 };
index c70a1c02dba9d2a1e37ff7c17ae9941022621b84..02166a26eb8610e6fba9f0a5cf2eaead030f92aa 100644 (file)
                                read-only;
                        };
 
-                       art: partition@7f0000 {
+                       partition@7f0000 {
                                label = "art";
                                reg = <0x7f0000 0x010000>;
                                read-only;
+
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               macaddr_art_0: macaddr@0 {
+                                       reg = <0x0 0x6>;
+                               };
+
+                               calibration_art_1000: calibration@1000 {
+                                       reg = <0x1000 0x440>;
+                               };
                        };
                };
        };
 };
 
+&wifi {
+       nvmem-cells = <&calibration_art_1000>;
+       nvmem-cell-names = "calibration";
+};
+
 &eth0 {
        nvmem-cells = <&macaddr_art_0>;
        nvmem-cell-names = "mac-address";
 &eth1 {
        compatible = "syscon", "simple-mfd";
 };
-
-&art {
-       compatible = "nvmem-cells";
-       #address-cells = <1>;
-       #size-cells = <1>;
-
-       macaddr_art_0: macaddr@0 {
-               reg = <0x0 0x6>;
-       };
-};
index ec8c6381e715f2bd3eef44f713749fa8cce076ae..fa6c2337333bab7058b607c0425d1999a2b335b0 100644 (file)
@@ -26,7 +26,6 @@
 
        wifi: wifi@0,0 {
                reg = <0x0000 0 0 0 0>;
-               qca,no-eeprom;
        };
 };
 
index 5fcfcaf64fa66acc1bb74748f4e9498a4ab376dd..4f107bfe8814e5aa3c16a5d8888ba2b6abb028d9 100644 (file)
@@ -86,11 +86,7 @@ case "$FIRMWARE" in
        avm,fritz300e)
                caldata_extract_reverse "urloader" 0x1541 0x440
                ;;
-       ubnt,unifi-ap-outdoor-plus)
-               caldata_extract "art" 0x1000 0xeb8
-               ;;
-       buffalo,wzr-hp-g450h|\
-       ubnt,unifi)
+       buffalo,wzr-hp-g450h)
                caldata_extract "art" 0x1000 0x440
                ;;
        dlink,dir-825-c1|\