From: Shiji Yang Date: Thu, 1 Feb 2024 11:39:51 +0000 (+0800) Subject: ath79: convert ath10k pre-calibration data to NVMEM (built-in MAC) X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=650d37a809bdb84a517ff0580bb2c4168e501d0d;p=openwrt%2Fstaging%2Fwigyori.git ath79: convert ath10k pre-calibration data to NVMEM (built-in MAC) 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 --- diff --git a/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts b/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts index b2777f6cc6..cdc365beb7 100644 --- a/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts +++ b/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts @@ -65,6 +65,13 @@ &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 { @@ -109,6 +116,10 @@ macaddr_art_1002: macaddr@1002 { reg = <0x1002 0x6>; }; + + precal_art_5000: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts index 2085644f76..6dfc885bc0 100644 --- a/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts +++ b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts @@ -118,6 +118,10 @@ macaddr_art_0: macaddr@0 { reg = <0x0 0x6>; }; + + precal_art_5000: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -183,4 +187,11 @@ &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"; + }; }; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd3200.dts b/target/linux/ath79/dts/qca9563_yuncore_xd3200.dts index 5c87752585..d496f48263 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd3200.dts +++ b/target/linux/ath79/dts/qca9563_yuncore_xd3200.dts @@ -30,3 +30,10 @@ }; }; }; + +&pcie { + wifi@0,0 { + /delete-property/ nvmem-cells; + /delete-property/ nvmem-cell-names; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi index dff9428295..f6b68989be 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -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"; }; }; @@ -103,6 +105,10 @@ macaddr_art_0: macaddr@0 { reg = <0x0 0x6>; }; + + 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 a5d244d85b..559bcd55a0 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 @@ -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)