ath79: add QCA9888 BDF for Archer C58 v1
authorDavid Bauer <[email protected]>
Sat, 8 Aug 2020 22:33:00 +0000 (00:33 +0200)
committerDavid Bauer <[email protected]>
Wed, 26 May 2021 09:39:36 +0000 (11:39 +0200)
Add the correct BDF for the Archer C58 v1. The BDF originates from the
vendor firmware, obtainable from TP-Links website.

Without this BDF, TX power was way to high.

Signed-off-by: David Bauer <[email protected]>
package/firmware/ipq-wifi/Makefile
package/firmware/ipq-wifi/board-tp-link_archer-c58-v1.qca9888 [new file with mode: 0644]
target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts
target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ath79/image/generic-tp-link.mk

index 423740cc28e2e715105730256c157e522aff5b08..e2e37961447558fb57f47d904c50bbb46c70260e 100644 (file)
@@ -49,7 +49,8 @@ ALLWIFIBOARDS:= \
        nec_wg2600hp3 \
        plasmacloud_pa1200 \
        plasmacloud_pa2200 \
-       qxwlan_e2600ac
+       qxwlan_e2600ac \
+       tp-link_archer-c58-v1
 
 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
 
@@ -135,5 +136,6 @@ $(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3))
 $(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200))
 $(eval $(call generate-ipq-wifi-package,plasmacloud_pa2200,Plasma Cloud PA2200))
 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC))
+$(eval $(call generate-ipq-wifi-package,tp-link_archer-c58-v1,TP-Link Archer C58 v1))
 
 $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))
diff --git a/package/firmware/ipq-wifi/board-tp-link_archer-c58-v1.qca9888 b/package/firmware/ipq-wifi/board-tp-link_archer-c58-v1.qca9888
new file mode 100644 (file)
index 0000000..9d5afd6
Binary files /dev/null and b/package/firmware/ipq-wifi/board-tp-link_archer-c58-v1.qca9888 differ
index ea86b8f35eeb617b29c6df17ea6142b5aa8a0043..b6d427e73a517051898ceefc13b3a3e967ea1ebc 100644 (file)
@@ -52,3 +52,7 @@
                };
        };
 };
+
+&ath10k {
+       qcom,ath10k-calibration-variant = "Archer-C58-v1";
+};
index 664032936c9e03ef52bd2fa6159effb6ab622d61..63f2fe070648c628d63cdab6ed2955fef8d0a6c0 100644 (file)
 
 &pcie {
        status = "okay";
+
+       ath10k: wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0 0 0 0 0>;
+       };
 };
 
 &eth0 {
index 9e4b4496e52c99126d4c5f3ea9cdb82a7386e038..24496dac357db2a2d2da1f1d2323b014c528c2ef 100644 (file)
@@ -215,7 +215,10 @@ case "$FIRMWARE" in
                ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
                        /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
                ;;
-       tplink,archer-c58-v1|\
+       tplink,archer-c58-v1)
+               caldata_extract "art" 0x5000 0x2f20
+               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x8) -1)
+               ;;
        tplink,archer-c59-v1|\
        tplink,archer-c59-v2|\
        tplink,archer-c60-v1|\
index be6aa06b55681fa07fac200b9ea1ea33c17c4846..a0a7106ae094075772b7c35fb54f82feeb24afa6 100644 (file)
@@ -55,7 +55,8 @@ define Device/tplink_archer-c58-v1
   DEVICE_MODEL := Archer C58
   DEVICE_VARIANT := v1
   TPLINK_BOARD_ID := ARCHER-C58-V1
-  DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9888-ct
+  DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9888-ct \
+       ipq-wifi-tp-link_archer-c58-v1
   SUPPORTED_DEVICES += archer-c58-v1
 endef
 TARGET_DEVICES += tplink_archer-c58-v1