ath79: add QCA9888 BDF for Archer C58 v1
authorDavid Bauer <mail@david-bauer.net>
Sat, 8 Aug 2020 22:33:00 +0000 (00:33 +0200)
committerDavid Bauer <mail@david-bauer.net>
Wed, 28 Oct 2020 10:58:20 +0000 (11:58 +0100)
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 <mail@david-bauer.net>
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 13a25d8bbe9636143a72bf2f1eed3639ba2cc578..76324862cf5bf4dc5e49973ac21948ba6198422f 100644 (file)
@@ -42,7 +42,8 @@ ALLWIFIBOARDS:= \
        linksys_mr8300-v0 \
        luma_wrtq-329acn \
        mobipromo_cm520-79f \
-       qxwlan_e2600ac
+       qxwlan_e2600ac \
+       tp-link_archer-c58-v1
 
 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
 
@@ -121,5 +122,6 @@ $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300))
 $(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN))
 $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F))
 $(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 464bc40b4447c76cce1f64ccd7690cc2c1a5b98c..9d3dde1a1a97fc47b83ad25f4ded4e8bc49d396b 100644 (file)
@@ -53,3 +53,7 @@
                };
        };
 };
+
+&ath10k {
+       qcom,ath10k-calibration-variant = "Archer-C58-v1";
+};
index 9ba6ccfafdbe5a27e410b19a90b5a2cb39f1a7aa..e1f369da666b921802e121ca35da31f03b1ea243 100644 (file)
 
 &pcie {
        status = "okay";
+
+       ath10k: wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0 0 0 0 0>;
+       };
 };
 
 &eth0 {
index 25e864ba72bb1155eb6e828b044e5075e707fd6e..bb768c3583f14624547ccb317cca6b1f77134fa4 100644 (file)
@@ -185,7 +185,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 7979dda78639a896de29d77b30958a6eaced8bf7..5fbe8b6e4a563c43967e849848e3ca17b7247bcb 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