ath79: convert ath10k 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:02 +0000 (17:09 +0100)
This patch converts ath10k calibration data to NVMEM format for
wave 1 devices with built-in MAC address. The "calibration"
NVMEM cell size is 0x844.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
22 files changed:
target/linux/ath79/dts/ar9342_ubnt_wa.dtsi
target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi
target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts
target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-16m.dts
target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-8m.dts
target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi
target/linux/ath79/dts/qca9531_yuncore_a770.dts
target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi
target/linux/ath79/dts/qca9556_avm_fritz1750e.dts
target/linux/ath79/dts/qca9556_avm_fritzdvbc.dts
target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts
target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts
target/linux/ath79/dts/qca9558_sophos_ap.dtsi
target/linux/ath79/dts/qca9558_sophos_ap15.dts
target/linux/ath79/dts/qca955x_ubnt_xc.dtsi
target/linux/ath79/dts/qca9563_asus_pl-ac56.dts
target/linux/ath79/dts/qca9563_asus_rp-ac66.dts
target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi
target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi
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 d85a07a8dcb180bb2b872ebf182953d87f519068..779b3b681f6b3b98eeafcc29905fcb350e52ee1a 100644 (file)
 
 &pcie {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &spi {
                                        macaddr_art_0: macaddr@0 {
                                                reg = <0x0 0x6>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
                };
index df157f582cf8cf51af6a37c8dfcdae0f7aad9926..fc8ac9ce8a9652109fbe395ba750d0c9627fd155 100644 (file)
                                                reg = <0x1002 0x6>;
                                                #nvmem-cell-cells = <1>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
                };
        wifi@0,0 {
                compatible = "qcom,ath10k";
                reg = <0 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
        };
 };
 
index 3b01fa9e421b51318869380ddb8dddf565ab541c..f599f5b77cddd6d726d2cafe83780fe1ae06ade9 100644 (file)
                                        macaddr_art_6: macaddr@6 {
                                                reg = <0x6 0x6>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
                };
 
 &pcie0 {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &wmac {
index 9b4c0a514d60ed2f30e82861de468db302cb7388..d6e23bef12067f4038c053171b318d3c72600c85 100644 (file)
        };
 };
 
+&pcie0 {
+       /delete-node/ wifi@0,0;
+};
+
 &usb_phy {
        status = "okay";
 };
index 7822ec664a4c2fc07619c84b177a3de394552272..ff6bdd481520491294f5274a953dc9b68c75e30c 100644 (file)
        };
 };
 
+&pcie0 {
+       /delete-node/ wifi@0,0;
+};
+
 &usb_phy {
        status = "okay";
 };
index 04becd63c1013c71522ac8f56f9df4bdec687703..383b2e67c5e5f1903c6c8370fdda20ed92a430fc 100644 (file)
 
 &pcie0 {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &spi {
                                                reg = <0x400 0x6>;
                                                #nvmem-cell-cells = <1>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
 
index fa1f7dc5fca3c569cb7fb1206b79da4ce3ce50e9..0385d73a7a125ba5e8184348f55b50e2dce73dc9 100644 (file)
                                        macaddr_art_6: macaddr@6 {
                                                reg = <0x6 0x6>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
                };
 
 &pcie0 {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &wmac {
index d0c796fadb500e51ee495905490cb5f84ba7d971..4d2f3bb814f54ef876705155012caf72697f2f11 100644 (file)
                                label = "urlader";
                                reg = <0x0 0x20000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       cal_urlader_198a: calibration@198a {
+                                               reg = <0x198a 0x844>;
+                                       };
+                               };
                        };
 
                        partition@20000 {
index bdb983cd7c73ea545af96751ba6cdd74de6b7022..05b76ecadba030b2c938f42786e668258bb8a54b 100644 (file)
 
 &pcie0 {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_urlader_198a>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &phy0 {
index bf1c026d173b7a3b96a8315f92c66fa80632c151..355f0850c4bf020f9b62654c55c7f30387e91967 100644 (file)
 
 &pcie0 {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_urlader_198a>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &gpio {
index e0471c534870a79ce4b4ca8c5f3811c231b84609..2e6f86b0b24f4faea9ca262c597758eaec0553b9 100644 (file)
@@ -7,6 +7,15 @@
        model = "Comfast CF-WR650AC v1";
 };
 
+&pcie0 {
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
+};
+
 &spi {
        status = "okay";
 
                                        macaddr_art_18: macaddr@18 {
                                                reg = <0x18 0x6>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
 
index 9bbbf2a9b40db30578f353fcf8989db764d4095d..a4aa4118faf29ae6b850e6961979c013bf37028a 100644 (file)
@@ -7,6 +7,17 @@
        model = "Comfast CF-WR650AC v2";
 };
 
+&pcie0 {
+       status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
+};
+
 &spi {
        status = "okay";
 
                                        macaddr_art_18: macaddr@18 {
                                                reg = <0x18 0x6>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
 
index 0cf5eb6e6631f5911d990e74dc1f9209497a153a..70d9e9d148ba9dc1b41c0121fbab951068daa7e9 100644 (file)
 
 &pcie0 {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &spi {
                                label = "art";
                                reg = <0x050000 0x010000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
+                               };
                        };
 
                        config: partition@60000 {
index 490d3ae22767584456b2bf4ae4d1c5d8298b5037..69a0af972ef953da0554e3bedc189ef7362d8953 100644 (file)
 
 &pcie0 {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &spi {
                                label = "art";
                                reg = <0x050000 0x010000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
+                               };
                        };
 
                        config: partition@60000 {
index 519f831beabfe904d21ca1c54af340458a356f90..7c1870d714cd961a01bbc3062ea744d2286d8b98 100644 (file)
@@ -7,6 +7,13 @@
 
 &pcie0 {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &spi {
                                        macaddr_art_0: macaddr@0 {
                                                reg = <0x0 0x6>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
                };
index a31f188142ffad16e3d083850cc59634ae4aae1f..4510872e278f8966580345a8f3695f442bf98807 100644 (file)
 
 &pcie {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &spi {
                                        macaddr_art_1002: macaddr@1002 {
                                                reg = <0x1002 0x6>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
 
index c4b9f3471348156e5d023dcb1d155601a67df4a2..71c95ad3322113e76d5bf5c3eb4dd09b91d6b263 100644 (file)
 
 &pcie {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &spi {
                                        macaddr_art_1002: macaddr@1002 {
                                                reg = <0x1002 0x6>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
 
index a4f7be3e1cd6ffeb1256534357339360eff31105..0861821f44a2c8a1e30afdab13e77a64bce64d1a 100644 (file)
 
 &pcie {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &spi {
                                label = "art";
                                reg = <0x060000 0x010000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
+                               };
                        };
                };
        };
index 60d6fbc895ac6596e9f4e78bfa3a86b65770356b..48d8d9c83e9963e4a294e4091baf65fc8eaaf6a3 100644 (file)
 
 &pcie {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
+       };
 };
 
 &spi {
                                        macaddr_art_0: macaddr@0 {
                                                reg = <0x0 0x6>;
                                        };
+
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
                                };
                        };
                };
index d496f482633690d1e9812eb355b70b054a70e6b7..fa82a6914b6d5fe59db1f1f470efe293a9a976c4 100644 (file)
@@ -33,7 +33,7 @@
 
 &pcie {
        wifi@0,0 {
-               /delete-property/ nvmem-cells;
-               /delete-property/ nvmem-cell-names;
+               nvmem-cells = <&cal_art_5000>;
+               nvmem-cell-names = "calibration";
        };
 };
index f6b68989be900c2cb523c074aa5170e350c6d0e5..2cc227a2dad674acc1efa7924bdfff2c5b515bb9 100644 (file)
                                                reg = <0x0 0x6>;
                                        };
 
+                                       cal_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x844>;
+                                       };
+
                                        precal_art_5000: pre-calibration@5000 {
                                                reg = <0x5000 0x2f20>;
                                        };
index c5256a23bb533b92436e16c8572ae2d08f5e3931..cc7458ae598f9d2030ad8492f1f6d47c73c8e91b 100644 (file)
@@ -19,47 +19,6 @@ case "$FIRMWARE" in
                caldata_extract "art" 0x5000 0x844
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 2)
                ;;
-       asus,pl-ac56|\
-       asus,rp-ac66|\
-       comfast,cf-wr650ac-v1|\
-       comfast,cf-wr650ac-v2|\
-       devolo,dlan-pro-1200plus-ac|\
-       devolo,magic-2-wifi|\
-       joyit,jt-or750i|\
-       qxwlan,e1700ac-v2-8m|\
-       qxwlan,e1700ac-v2-16m|\
-       qxwlan,e600gac-v2-8m|\
-       qxwlan,e600gac-v2-16m|\
-       sophos,ap15|\
-       sophos,ap55|\
-       sophos,ap55c|\
-       sophos,ap100|\
-       sophos,ap100c|\
-       ubnt,bullet-ac|\
-       ubnt,uk-ultra|\
-       ubnt,unifiac-lite|\
-       ubnt,unifiac-lr|\
-       ubnt,unifiac-mesh|\
-       ubnt,unifiac-mesh-pro|\
-       ubnt,lap-120|\
-       ubnt,litebeam-ac-gen2|\
-       ubnt,nanobeam-ac|\
-       ubnt,nanobeam-ac-gen2|\
-       ubnt,nanobeam-ac-xc|\
-       ubnt,nanostation-ac|\
-       ubnt,nanostation-ac-loco|\
-       ubnt,powerbeam-5ac-500|\
-       ubnt,powerbeam-5ac-gen2|\
-       ubnt,rocket-5ac-lite|\
-       ubnt,unifiac-pro|\
-       yuncore,a770|\
-       yuncore,xd3200)
-               caldata_extract "art" 0x5000 0x844
-               ;;
-       avm,fritz1750e|\
-       avm,fritzdvbc)
-               caldata_extract "urlader" 0x198a 0x844
-               ;;
        devolo,dvl1200e|\
        devolo,dvl1200i|\
        devolo,dvl1750c|\