ipq806x: use nvmem for precal on smem based device
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 29 Jun 2022 15:59:51 +0000 (17:59 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 29 Jun 2022 16:16:42 +0000 (18:16 +0200)
Use nvmem cells for precal bin on smem based device.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-g10.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts

index 398ddf9a290a3606385a37d93ff1fc81e8211113..ae96ee3037d2a5cd98c9ad14b6ea0748f1b56917 100644 (file)
@@ -17,12 +17,8 @@ case "$FIRMWARE" in
        ;;
 "ath10k/pre-cal-pci-0000:01:00.0.bin")
        case $board in
-       asrock,g10)
-               caldata_extract "0:art" 0x1000 0x2f20
-               ;;
        linksys,ea7500-v1 |\
        linksys,ea8500)
-               caldata_extract "art" 0x1000 0x2f20
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1)
                ;;
        meraki,mr42)
@@ -30,22 +26,14 @@ case "$FIRMWARE" in
                caldata_extract_ubi "ART" 0x1000 0x2f20
                ;;
        zyxel,nbg6817)
-               caldata_extract "0:art" 0x1000 0x2f20
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1)
                ;;
        esac
        ;;
 "ath10k/pre-cal-pci-0001:01:00.0.bin")
        case $board in
-       asrock,g10)
-               caldata_extract "0:art" 0x5000 0x2f20
-               ;;
-       edgecore,ecw5410)
-               caldata_extract "0:art" 0x1000 0x2f20
-               ;;
        linksys,ea7500-v1 |\
        linksys,ea8500)
-               caldata_extract "art" 0x5000 0x2f20
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2)
                ;;
        meraki,mr42 |\
@@ -54,7 +42,6 @@ case "$FIRMWARE" in
                caldata_extract_ubi "ART" 0x5000 0x2f20
                ;;
        zyxel,nbg6817)
-               caldata_extract "0:art" 0x5000 0x2f20
                ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr)
                ;;
        esac
@@ -69,9 +56,6 @@ case "$FIRMWARE" in
        ;;
 "ath10k/pre-cal-pci-0002:01:00.0.bin")
        case $board in
-       edgecore,ecw5410)
-               caldata_extract "0:art" 0x5000 0x2f20
-               ;;
        meraki,mr52)
                CI_UBIPART=art
                caldata_extract_ubi "ART" 0x9000 0x2f20
index 007564e24a65c2532b56b82961f5aa49a2113503..8b699263fe1b462c39afe7406d3e142294aaae41 100644 (file)
        status = "okay";
 
        max-link-speed = <1>;
+
+       bridge@0,0 {
+               reg = <0x00000000 0 0 0 0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               ranges;
+
+               wifi@1,0 {
+                       compatible = "qcom,ath10k";
+                       status = "okay";
+                       reg = <0x00010000 0 0 0 0>;
+
+                       nvmem-cells = <&precal_art_1000>;
+                       nvmem-cell-names = "pre-calibration";
+               };
+       };
 };
 
 &pcie1 {
        status = "okay";
+
+       bridge@0,0 {
+               reg = <0x00000000 0 0 0 0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               ranges;
+
+               wifi@1,0 {
+                       compatible = "qcom,ath10k";
+                       status = "okay";
+                       reg = <0x00010000 0 0 0 0>;
+
+                       nvmem-cells = <&precal_art_5000>;
+                       nvmem-cell-names = "pre-calibration";
+               };
+       };
 };
 
 &pcie2 {
                                label = "art";
                                reg = <0x0c80000 0x0140000>;
                                read-only;
+
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               precal_art_1000: precal@1000 {
+                                       reg = <0x1000 0x2f20>;
+                               };
+
+                               precal_art_5000: precal@5000 {
+                                       reg = <0x5000 0x2f20>;
+                               };
                        };
 
                        partition@dc0000 {
index 735ccb2d53d6b75f399e7192de4f5301bc9a1ff5..b1c6b7c1742ec461b5e37fcfb635413c768387e9 100644 (file)
 
                partitions {
                        compatible = "qcom,smem-part";
+
+                       partition-art {
+                               label = "0:art";
+                               read-only;
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               precal_art_1000: precal@1000 {
+                                       reg = <0x1000 0x2f20>;
+                               };
+
+                               precal_art_5000: precal@5000 {
+                                       reg = <0x5000 0x2f20>;
+                               };
+                       };
                };
        };
 };
                        reg = <0x00010000 0 0 0 0>;
                        compatible = "qcom,ath10k";
                        qcom,ath10k-calibration-variant = "ASRock-G10";
+                       nvmem-cells = <&precal_art_1000>;
+                       nvmem-cell-names = "pre-calibration";
                };
        };
 };
                        reg = <0x00010000 0 0 0 0>;
                        compatible = "qcom,ath10k";
                        qcom,ath10k-calibration-variant = "ASRock-G10";
+                       nvmem-cells = <&precal_art_5000>;
+                       nvmem-cell-names = "pre-calibration";
                };
        };
 };
index 969ca724e3ae500425012ebcb80f2fae02227827..973fa52565969a367b00f71639e43df1ec6b7d38 100644 (file)
 
                        partitions {
                                compatible = "qcom,smem-part";
+
+                               partition-art {
+                                       label = "0:art";
+                                       read-only;
+                                       compatible = "nvmem-cells";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       precal_art_1000: precal@1000 {
+                                               reg = <0x1000 0x2f20>;
+                                       };
+
+                                       precal_art_5000: precal@5000 {
+                                               reg = <0x5000 0x2f20>;
+                                       };
+                               };
                        };
                };
        };
        reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>;
        pinctrl-0 = <&pcie0_pins>;
        pinctrl-names = "default";
+
+       bridge@0,0 {
+               reg = <0x00000000 0 0 0 0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               ranges;
+
+               wifi@1,0 {
+                       reg = <0x00010000 0 0 0 0>;
+                       compatible = "qcom,ath10k";
+
+                       nvmem-cells = <&precal_art_1000>;
+                       nvmem-cell-names = "pre-calibration";
+               };
+       };
 };
 
 &pcie1 {
        pinctrl-0 = <&pcie1_pins>;
        pinctrl-names = "default";
        max-link-speed = <1>;
+
+       bridge@0,0 {
+               reg = <0x00000000 0 0 0 0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               ranges;
+
+               wifi@1,0 {
+                       reg = <0x00010000 0 0 0 0>;
+                       compatible = "qcom,ath10k";
+
+                       nvmem-cells = <&precal_art_5000>;
+                       nvmem-cell-names = "pre-calibration";
+               };
+       };
 };
 
 &mdio0 {
index 85b0dc3b8ccd691539bcb20e381fc790fefcec42..b088c5659c0f88496c49f6fe9f0815e2b3cb196c 100644 (file)
 
                        partitions {
                                compatible = "qcom,smem-part";
+
+                               partition-art {
+                                       label = "0:art";
+                                       read-only;
+                                       compatible = "nvmem-cells";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       precal_art_1000: precal@1000 {
+                                               reg = <0x1000 0x2f20>;
+                                       };
+
+                                       precal_art_5000: precal@5000 {
+                                               reg = <0x5000 0x2f20>;
+                                       };
+                               };
                        };
                };
        };
                        status = "okay";
                        reg = <0x00010000 0 0 0 0>;
                        qcom,ath10k-calibration-variant = "Edgecore-ECW5410-L";
+                       nvmem-cells = <&precal_art_1000>;
+                       nvmem-cell-names = "pre-calibration";
                };
        };
 };
                        status = "okay";
                        reg = <0x00010000 0 0 0 0>;
                        qcom,ath10k-calibration-variant = "Edgecore-ECW5410-L";
+                       nvmem-cells = <&precal_art_5000>;
+                       nvmem-cell-names = "pre-calibration";
                };
        };
 };