ath79: convert ath10k pre-calibration data to NVMEM (built-in MAC)
authorShiji Yang <yangshiji66@qq.com>
Thu, 1 Feb 2024 11:39:51 +0000 (19:39 +0800)
committerChristian Marangi <ansuelsmth@gmail.com>
Thu, 1 Feb 2024 16:09:01 +0000 (17:09 +0100)
This patch converts ath10k pre-calibration data to NVMEM format for
wave 2 devices with built-in MAC address. The "pre-calibration"
NVMEM cell size is 0x2f20.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
target/linux/ath79/dts/qca9531_asus_rp-ac51.dts
target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts
target/linux/ath79/dts/qca9563_yuncore_xd3200.dts
target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata

index b2777f6cc6fb9c8decb90081f5772bebdb29181a..cdc365beb77c4bce977b5e877b5cea9081d8c1b7 100644 (file)
 
 &pcie0 {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&precal_art_5000>;
+               nvmem-cell-names = "pre-calibration";
+       };
 };
 
 &spi {
                                        macaddr_art_1002: macaddr@1002 {
                                                reg = <0x1002 0x6>;
                                        };
+
+                                       precal_art_5000: pre-calibration@5000 {
+                                               reg = <0x5000 0x2f20>;
+                                       };
                                };
                        };
 
index 2085644f766289064cba34a6ede4f8866a07fd4a..6dfc885bc0a637beea0d3f3444a1aa0cfba1f0cf 100644 (file)
                                        macaddr_art_0: macaddr@0 {
                                                reg = <0x0 0x6>;
                                        };
+
+                                       precal_art_5000: pre-calibration@5000 {
+                                               reg = <0x5000 0x2f20>;
+                                       };
                                };
                        };
 
 
 &pcie {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&precal_art_5000>;
+               nvmem-cell-names = "pre-calibration";
+       };
 };
index 5c87752585f3c1c0dc6f7ac9e5a64303e691618b..d496f482633690d1e9812eb355b70b054a70e6b7 100644 (file)
                };
        };
 };
+
+&pcie {
+       wifi@0,0 {
+               /delete-property/ nvmem-cells;
+               /delete-property/ nvmem-cell-names;
+       };
+};
index dff9428295067b51d2972a7d532038c2f2cb75ae..f6b68989be900c2cb523c074aa5170e350c6d0e5 100644 (file)
@@ -57,6 +57,8 @@
        wifi@0,0 {
                compatible = "pci168c,0056";
                reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&precal_art_5000>;
+               nvmem-cell-names = "pre-calibration";
        };
 };
 
                                        macaddr_art_0: macaddr@0 {
                                                reg = <0x0 0x6>;
                                        };
+
+                                       precal_art_5000: pre-calibration@5000 {
+                                               reg = <0x5000 0x2f20>;
+                                       };
                                };
                        };
                };
index a5d244d85bdf923ac3b7c8de0ac3f79151539b6e..559bcd55a0e15a76956b9c5de10ecfb719695ec7 100644 (file)
@@ -173,13 +173,6 @@ case "$FIRMWARE" in
        ;;
 "ath10k/pre-cal-pci-0000:00:00.0.bin")
        case $board in
-       asus,rp-ac51|\
-       yuncore,a782|\
-       yuncore,xd4200)
-               caldata_extract "art" 0x5000 0x2f20
-               ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
-                       /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
-               ;;
        comfast,cf-e313ac)
                caldata_extract "art" 0x5000 0x2f20
                ath10k_patch_mac $(mtd_get_mac_binary art 0x6)
@@ -237,11 +230,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
                ;;
-       xiaomi,aiot-ac2350)
-               caldata_extract "art" 0x5000 0x2f20
-               ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
-                       /lib/firmware/ath10k/QCA9984/hw1.0/board.bin
-               ;;
        tplink,deco-m4r-v1)
                caldata_extract "art" 0x5000 0x2f20
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary config 0x8) -1)