ath79: TP-Link EAP245 v3: convert radios to nvmem-cells
authorSander Vanheule <sander@svanheule.net>
Sun, 5 Jun 2022 10:58:24 +0000 (12:58 +0200)
committerSander Vanheule <sander@svanheule.net>
Thu, 16 Jun 2022 19:39:32 +0000 (21:39 +0200)
Replace the mtd-cal-data phandle by an nvmem-cell reference from the art
partition for the 2.4GHz ath9k radio.

Add the PCIe node for the ath10k radio to the devicetree, and refer to
the art partition for the calibration data using an nvmem-cell.

Use mac-address-increment to ensure the MAC address is set correctly,
and remove the device from the caldata extraction and patching script.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata

index 768a48bd693a222de8fef1a8c8c3c56fa7c286f4..6819d2d822cfd8c542a58dc59da5ce35164c1e03 100644 (file)
 
 &pcie {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0 0 0 0 0>;
+
+               mac-address-increment = <1>;
+
+               nvmem-cells = <&macaddr_info_8>, <&calibration_ath10k>;
+               nvmem-cell-names = "mac-address", "calibration";
+       };
 };
 
 &spi {
                                read-only;
                        };
 
-                       art: partition@a0000 {
+                       partition@a0000 {
                                label = "art";
                                reg = <0x0a0000 0x010000>;
                                read-only;
+
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               calibration_ath9k: calibration@1000 {
+                                       reg = <0x1000 0x440>;
+                               };
+
+                               calibration_ath10k: calibration@5000 {
+                                       reg = <0x5000 0x2f20>;
+                               };
                        };
 
                        partition@b0000 {
 &wmac {
        status = "okay";
 
-       mtd-cal-data = <&art 0x1000>;
-       nvmem-cells = <&macaddr_info_8>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_info_8>, <&calibration_ath9k>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &info {
index 1c80966efeec8edc1d208a2c7dcde157adabf560..ee53f3163846adb34132b365418bd561b63e483b 100644 (file)
@@ -256,10 +256,6 @@ case "$FIRMWARE" in
                ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
                        /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
                ;;
-       tplink,eap245-v3)
-               caldata_extract "art" 0x5000 0x2f20
-               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1)
-               ;;
        xiaomi,aiot-ac2350)
                caldata_extract "art" 0x5000 0x2f20
                ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \