[openwrt/openwrt] ath79: fix ath10k caldata extraction on some D-Link DIR-842 C3 devices

LEDE Commits lede-commits at lists.infradead.org
Mon Nov 16 08:06:04 EST 2020


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/4d36569b9cab6422d31bda5501718177f2f9c990

commit 4d36569b9cab6422d31bda5501718177f2f9c990
Author: Paul Fertser <fercerpav at gmail.com>
AuthorDate: Tue Oct 27 14:02:53 2020 +0300

    ath79: fix ath10k caldata extraction on some D-Link DIR-842 C3 devices
    
    According to forum threads [0][1] and a report on IRC by Doc-Saintly
    some of those boards have calibration data in a different place. Only
    one alternative location is known.
    
    Without proper board calibration data (board.bin having all 0xff bytes)
    ath10k firmware still tries to load but crashes on startup with a
    confusing error message.
    
    If you're applying this patch manually on your device do not forget to
    remove /lib/firmware/ath10k/pre-cal-pci-0000:00:00.0.bin and reboot to
    force caldata re-extraction.
    
    [0] https://forum.openwrt.org/t/support-for-d-link-dir842-rev-c3/41654
    [1] https://forum.openwrt.org/t/d-link-dir-842-cant-access-firmware-upload-form/65454
    
    Signed-off-by: Paul Fertser <fercerpav at gmail.com>
---
 .../generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

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 e968658cac..a72ed0206b 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
@@ -169,13 +169,18 @@ case "$FIRMWARE" in
 		;;
 	dlink,dir-842-c1|\
 	dlink,dir-842-c2|\
-	dlink,dir-842-c3|\
-	nec,wg1200cr)
+	dlink,dir-842-c3)
 		caldata_extract "art" 0x5000 0x2f20
+		caldata_valid "202f" || caldata_extract "reserved" 0x15000 0x2f20
 		ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
 		ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
 			/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
 		;;
+	nec,wg1200cr)
+		caldata_extract "art" 0x5000 0x2f20
+		ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
+		ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
+			/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
 	netgear,ex6400|\
 	netgear,ex7300)
 		caldata_extract "caldata" 0x5000 0x2f20



More information about the lede-commits mailing list