Ath10k and qca4019 .bin files

So it seems my Netgear WAC510 uses an ath10k & qca4019 chip for it's wifi. Eth1 port works and the gpio module has found what I assume to be the LEDs, so I'm getting there!

Unfortunately I'm stuck on the main part - the wifi.

The ath10k_pci module is trying to load 3 firmware files for each of the two radios (2G/5G):

  1. pre-cal-ahb-a000000.wifi.bin / pre-cal-ahb-a800000.wifi.bin
  2. board-2.bin
  3. firmware-6.bin

I've found [1] which were kept on the ART partition. I had to use 'dd' and some magic offsets to get them out which I found in a Netgear init script.

I found a load of 'board*' files for [2] that look like they belong in 'board-2.bin', but they all throw up an error 'found invalid board magic' when I try to put them in the right directory and load the module.

I can't find anything to do with [3], so I copied the existing 'firmware-5.bin' from the initramfs to 'firmware-6.bin' and now ath10_pci isn't complaining anymore.

Can anyone point me in the right direction?

Below is the output from when I 'modprobe ath10k_pci' with the (I assume correct) pre-cal data:

[ 1481.877140] ath10k_ahb a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[ 1481.877199] ath10k_ahb a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 1
[ 1481.893825] ath10k_ahb a000000.wifi: firmware ver 10.4-3.4-00104 api 6 features no-p2p,mfp,peer-flow-ctrl,btcoex-param,allows-mesh-bcast,no-ps crc32 6c332c67
[ 1481.935885] ath10k_ahb a000000.wifi: found invalid board magic
[ 1481.936280] ath10k_ahb a000000.wifi: board_file api 1 bmi_id 0:31 crc32 4806941d
[ 1483.283106] ath10k_ahb a000000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file max-sta 512 raw 0 hwcrypto 1
[ 1483.475767] ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[ 1483.475825] ath10k_ahb a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 1
[ 1483.492360] ath10k_ahb a800000.wifi: firmware ver 10.4-3.4-00104 api 6 features no-p2p,mfp,peer-flow-ctrl,btcoex-param,allows-mesh-bcast,no-ps crc32 6c332c67
[ 1483.533488] ath10k_ahb a800000.wifi: found invalid board magic
[ 1483.533799] ath10k_ahb a800000.wifi: board_file api 1 bmi_id 0:31 crc32 4806941d
[ 1484.881838] ath10k_ahb a800000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file max-sta 512 raw 0 hwcrypto 1

Many thanks,

Tim

It seems you are mixing some files.
From add new dt entry for ath10k calibration variant

To summarize:

  • pre-cal is some data stored in a special partition of the devices and will
    not be overwritten on updates
  • board-2.bin are multiple BDF files containing the second part of the
    calibration data
  • pre-cal + BDF (+ some OTP stuff) are getting combined to form the complete
    calibration data

On OpenWRT, the pre-cal data is loaded at run-time by the script 11-ath10k-caldata (target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata), which will extract the data from the ART (or similar) partition. For the IPQ4019 SoC, it will produce two files:

  • /lib/firmware/ath10k/pre-cal-ahb-a000000.wifi.bin
  • /lib/firmware/ath10k/ath10k/pre-cal-ahb-a800000.wifi.bin

The next part, the board data files (BDF) are board-specific and provided by packages ath10k-firmware-qca4019 (package/firmware/ath10k-firmware) for reference designs and upstreamed devices, and ipq-wifi (package/firmware/ipq-wifi) for custom devices not yet upstreamed. For your case, you probably have to extract the file, usually called board-2.bin, from the original firmware.

Finally, the third file needed is firmware-5.bin (or firmware-6.bin), which is generic and provided by the package ath10k-firmware-qca4019

Thank you, Luis. That's a very helpful link.

I've checked as much as I can, and I think Netgear are working their own magic when it comes to the BDF.

They appear to be running and old version of the kernel, which perhaps predates the ath10k_pci module's auto-detection of the board layouts:

Linux version 3.14.43-V3.1.0.12 (root@cbuap-build2.netgear.com) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.01 r43761) ) #1 SMP PREEMPT Tue Oct 24 09:12:07 PDT 2017

There's a lot of kernel modules in their source that are marked as 'propietary' and appear to handle all the WiFi loading process. The BDFs are labeled as such, but there's one for each board variant and one for each radio. I've tried all of them by renaming each one to 'board.bin' and reloading ath10k_pci, but none of them work properly.

The wlan interfaces come up, but only 2G is visible and whilst I can join it and get a DHCP address, I cannot send any pings over it (that may be because I've set something up wrong, but I can't see that I have).

Do you think it's possible to create a BDF from the files I have, or from the PCB of the device itself?
The original kernel bootlog shows this:

Machine model: Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C2

And the BDF's I found are named:

boardData_1_0_IPQ4019_DK01_2G.bin
boardData_1_0_IPQ4019_DK01_5G.bin

So I'm assuming they are the right files.

But they make ath10k_pci report 'found invalid board magic', which I guess means they're not in the right format, so proper calibration does not seem to occur, hence why I cannot ping across the interface.

What do you think my next steps should be?

I've emailed the Netgear developer who's name is throughout the GPL'd source, but I don't expect a reply.

Many thanks,

Tim