diff mbox series

ath79: fix ath10k caldata extraction on some D-Link DIR-842 C3 devices

Message ID 20201027062606.7457-1-fercerpav@gmail.com
State Superseded
Headers show
Series ath79: fix ath10k caldata extraction on some D-Link DIR-842 C3 devices | expand

Commit Message

Paul Fertser Oct. 27, 2020, 6:26 a.m. UTC
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@gmail.com>
---
 .../generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata  | 1 +
 1 file changed, 1 insertion(+)

Comments

Adrian Schmutzler Oct. 27, 2020, 10:47 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Paul Fertser
> Sent: Dienstag, 27. Oktober 2020 07:26
> To: openwrt-devel@lists.openwrt.org
> Cc: Paul Fertser <fercerpav@gmail.com>
> Subject: [PATCH] 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@gmail.com>
> ---
>  .../generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata  | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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 25e864ba72..79003929df 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-at
> +++ h10k-caldata
> @@ -170,6 +170,7 @@ case "$FIRMWARE" in
>  	dlink,dir-842-c3|\
>  	nec,wg1200cr)

Is this meant to cover nec,wg1200cr as well? Otherwise you should split the case.

Best

Adrian

>  		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
> --
> 2.20.1
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

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 25e864ba72..79003929df 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
@@ -170,6 +170,7 @@  case "$FIRMWARE" in
 	dlink,dir-842-c3|\
 	nec,wg1200cr)
 		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