ath79: convert Winchannel WB2000 WiFis to nvmem-cells
authorNick Hainke <vincent@systemli.org>
Thu, 15 Dec 2022 09:08:39 +0000 (10:08 +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>
(removed mtd-cal-data property, merged art + addr nodes back into
partition)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/ath79/dts/ar9344_winchannel_wb2000.dts
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

index cb595594264a032f0d53d56b6d1cdf174a4b02df..cbde191ac783526d83f99d67582b63982bcfb784 100644 (file)
                                read-only;
                        };
 
-                       art: partition@fe0000 {
+                       partition@fe0000 {
                                label = "art";
                                reg = <0xfe0000 0x10000>;
                                read-only;
+
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               calibration_art_1000: calibration@1000 {
+                                       reg = <0x1000 0x440>;
+                               };
+
+                               calibration_art_5000: calibration@5000 {
+                                       reg = <0x5000 0x440>;
+                               };
                        };
 
-                       addr: partition@ff0000 {
+                       partition@ff0000 {
                                label = "addr";
                                reg = <0xff0000 0x10000>;
                                read-only;
+
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               macaddr_addr_0: macaddr@0 {
+                                       reg = <0x0 0x6>;
+                               };
                        };
                };
        };
        ath9k: wifi@0,0 {
                compatible = "pci168c,0030";
                reg = <0x0000 0 0 0 0>;
-               qca,no-eeprom;
-               nvmem-cells = <&macaddr_addr_0>;
-               nvmem-cell-names = "mac-address";
+               nvmem-cells = <&macaddr_addr_0>, <&calibration_art_5000>;
+               nvmem-cell-names = "mac-address", "calibration";
                mac-address-increment = <0x10>;
                #gpio-cells = <2>;
                gpio-controller;
 &wmac {
        status = "okay";
 
-       mtd-cal-data = <&art 0x1000>;
-       nvmem-cells = <&macaddr_addr_0>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_addr_0>, <&calibration_art_1000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &mdio0 {
        };
 };
 
-&addr {
-       compatible = "nvmem-cells";
-       #address-cells = <1>;
-       #size-cells = <1>;
-
-       macaddr_addr_0: macaddr@0 {
-               reg = <0x0 0x6>;
-       };
-};
index a91885c3fe277938685f315e40632d636cbb57a1..9640baac1728e419032129cd7669068da0643fde 100644 (file)
@@ -83,9 +83,6 @@ case "$FIRMWARE" in
        ;;
 "ath9k-eeprom-pci-0000:00:00.0.bin")
        case $board in
-       winchannel,wb2000)
-               caldata_extract "art" 0x5000 0x440
-               ;;
        avm,fritz300e)
                caldata_extract_reverse "urloader" 0x1541 0x440
                ;;