From: Shiji Yang Date: Thu, 1 Feb 2024 11:39:51 +0000 (+0800) Subject: ath79: convert ath10k calibration data to NVMEM (built-in MAC) X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d07cec6b2bdcf6389c06a2599a5c924ee490136f;p=openwrt%2Fstaging%2Fsvanheule.git ath79: convert ath10k calibration data to NVMEM (built-in MAC) 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 --- diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index d85a07a8dc..779b3b681f 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -27,6 +27,13 @@ &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 { @@ -79,6 +86,10 @@ macaddr_art_0: macaddr@0 { reg = <0x0 0x6>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi index df157f582c..fc8ac9ce8a 100644 --- a/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi +++ b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi @@ -127,6 +127,10 @@ reg = <0x1002 0x6>; #nvmem-cell-cells = <1>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -161,6 +165,8 @@ wifi@0,0 { compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; + nvmem-cells = <&cal_art_5000>; + nvmem-cell-names = "calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts b/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts index 3b01fa9e42..f599f5b77c 100644 --- a/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts +++ b/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts @@ -107,6 +107,10 @@ macaddr_art_6: macaddr@6 { reg = <0x6 0x6>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -129,6 +133,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"; + }; }; &wmac { diff --git a/target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-16m.dts b/target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-16m.dts index 9b4c0a514d..d6e23bef12 100644 --- a/target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-16m.dts +++ b/target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-16m.dts @@ -23,6 +23,10 @@ }; }; +&pcie0 { + /delete-node/ wifi@0,0; +}; + &usb_phy { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-8m.dts b/target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-8m.dts index 7822ec664a..ff6bdd4815 100644 --- a/target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-8m.dts +++ b/target/linux/ath79/dts/qca9531_qxwlan_e600g-v2-8m.dts @@ -23,6 +23,10 @@ }; }; +&pcie0 { + /delete-node/ wifi@0,0; +}; + &usb_phy { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi index 04becd63c1..383b2e67c5 100644 --- a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi +++ b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi @@ -48,6 +48,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 { @@ -90,6 +97,10 @@ reg = <0x400 0x6>; #nvmem-cell-cells = <1>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts b/target/linux/ath79/dts/qca9531_yuncore_a770.dts index fa1f7dc5fc..0385d73a7a 100644 --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts @@ -101,6 +101,10 @@ macaddr_art_6: macaddr@6 { reg = <0x6 0x6>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -123,6 +127,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"; + }; }; &wmac { diff --git a/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi b/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi index d0c796fadb..4d2f3bb814 100644 --- a/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi +++ b/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi @@ -34,6 +34,16 @@ 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 { diff --git a/target/linux/ath79/dts/qca9556_avm_fritz1750e.dts b/target/linux/ath79/dts/qca9556_avm_fritz1750e.dts index bdb983cd7c..05b76ecadb 100644 --- a/target/linux/ath79/dts/qca9556_avm_fritz1750e.dts +++ b/target/linux/ath79/dts/qca9556_avm_fritz1750e.dts @@ -89,6 +89,13 @@ &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 { diff --git a/target/linux/ath79/dts/qca9556_avm_fritzdvbc.dts b/target/linux/ath79/dts/qca9556_avm_fritzdvbc.dts index bf1c026d17..355f0850c4 100644 --- a/target/linux/ath79/dts/qca9556_avm_fritzdvbc.dts +++ b/target/linux/ath79/dts/qca9556_avm_fritzdvbc.dts @@ -92,6 +92,13 @@ &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 { diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts index e0471c5348..2e6f86b0b2 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts @@ -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"; @@ -47,6 +56,10 @@ macaddr_art_18: macaddr@18 { reg = <0x18 0x6>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts index 9bbbf2a9b4..a4aa4118fa 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts @@ -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"; @@ -47,6 +58,10 @@ macaddr_art_18: macaddr@18 { reg = <0x18 0x6>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap.dtsi b/target/linux/ath79/dts/qca9558_sophos_ap.dtsi index 0cf5eb6e66..70d9e9d148 100644 --- a/target/linux/ath79/dts/qca9558_sophos_ap.dtsi +++ b/target/linux/ath79/dts/qca9558_sophos_ap.dtsi @@ -71,6 +71,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 { @@ -101,6 +108,16 @@ 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 { diff --git a/target/linux/ath79/dts/qca9558_sophos_ap15.dts b/target/linux/ath79/dts/qca9558_sophos_ap15.dts index 490d3ae227..69a0af972e 100644 --- a/target/linux/ath79/dts/qca9558_sophos_ap15.dts +++ b/target/linux/ath79/dts/qca9558_sophos_ap15.dts @@ -39,6 +39,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 { @@ -69,6 +76,16 @@ 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 { diff --git a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi index 519f831bea..7c1870d714 100644 --- a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi +++ b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi @@ -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 { @@ -59,6 +66,10 @@ macaddr_art_0: macaddr@0 { reg = <0x0 0x6>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts b/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts index a31f188142..4510872e27 100644 --- a/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts +++ b/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts @@ -59,6 +59,13 @@ &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 { @@ -99,6 +106,10 @@ macaddr_art_1002: macaddr@1002 { reg = <0x1002 0x6>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts b/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts index c4b9f34713..71c95ad332 100644 --- a/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts +++ b/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts @@ -81,6 +81,13 @@ &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 { @@ -121,6 +128,10 @@ macaddr_art_1002: macaddr@1002 { reg = <0x1002 0x6>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi index a4f7be3e1c..0861821f44 100644 --- a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi +++ b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi @@ -51,6 +51,13 @@ &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 { @@ -98,6 +105,16 @@ 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>; + }; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index 60d6fbc895..48d8d9c83e 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -41,6 +41,13 @@ &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 { @@ -99,6 +106,10 @@ macaddr_art_0: macaddr@0 { reg = <0x0 0x6>; }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd3200.dts b/target/linux/ath79/dts/qca9563_yuncore_xd3200.dts index d496f48263..fa82a6914b 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd3200.dts +++ b/target/linux/ath79/dts/qca9563_yuncore_xd3200.dts @@ -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"; }; }; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi index f6b68989be..2cc227a2da 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -106,6 +106,10 @@ reg = <0x0 0x6>; }; + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; + precal_art_5000: pre-calibration@5000 { reg = <0x5000 0x2f20>; }; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index c5256a23bb..cc7458ae59 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -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|\