ath79: convert Ubiquiti UniFi AP Pro WiFis to nvmem-cells
authorNick Hainke <vincent@systemli.org>
Thu, 15 Dec 2022 08:57:28 +0000 (09:57 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Thu, 15 Dec 2022 14:45:47 +0000 (15:45 +0100)
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(merged art node back into partition-node)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

index 8471be9b6b83a6bf277e1909398ed1c957355a33..55626c42995a57bc57c367e810272281808c58ec 100644 (file)
                                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>;
+                               };
+
+                               calibration_art_1000: calibration@1000 {
+                                       reg = <0x1000 0x440>;
+                               };
+
+                               calibration_art_5000: calibration@5000 {
+                                       reg = <0x5000 0x440>;
+                               };
                        };
                };
        };
        wifi@0,0 {
                compatible = "pci168c,0033";
                reg = <0 0 0 0 0>;
-               qca,no-eeprom;
+               nvmem-cells = <&calibration_art_5000>;
+               nvmem-cell-names = "calibration";
        };
 };
 
 &wmac {
        status = "okay";
 
-       mtd-cal-data = <&art 0x1000>;
+       nvmem-cells = <&calibration_art_1000>;
+       nvmem-cell-names = "calibration";
 };
 
 &mdio0 {
        phy-mode = "rgmii";
        phy-handle = <&phy0>;
 };
-
-&art {
-       compatible = "nvmem-cells";
-       #address-cells = <1>;
-       #size-cells = <1>;
-
-       macaddr_art_0: macaddr@0 {
-               reg = <0x0 0x6>;
-       };
-};
index 825e4ff99ce213d13900509a1cf79c75b49cafce..a91885c3fe277938685f315e40632d636cbb57a1 100644 (file)
@@ -83,7 +83,6 @@ case "$FIRMWARE" in
        ;;
 "ath9k-eeprom-pci-0000:00:00.0.bin")
        case $board in
-       ubnt,unifi-ap-pro|\
        winchannel,wb2000)
                caldata_extract "art" 0x5000 0x440
                ;;