Skip to content

Firmware

Erik Stromdahl edited this page Jan 10, 2020 · 4 revisions

Generate ath10k firmware files

ath10k has its own firmware format. Standard qca firmware files (qwlan30.bin, athwlan.bin etc.) must be converted into the ath10k format using the tool ath10k-fwencoder

ath10k-fwencoder is a part of the qca-swiss-army-knife package:

https://github.com/qca/qca-swiss-army-knife.git

Usage instructions:

git clone https://github.com/qca/qca-swiss-army-knife.git
cd qca-swiss-army-knife
./tools/scripts/ath10k/ath10k-fwencoder \
        --create \
        --otp /path/to/otp30.bin \
        --firmware /path/to/qwlan30.bin \
        --set-wmi-op-version=tlv \
        --set-htt-op-version=tlv \
        --set-fw-api=5 \
        --features=ignore-otp-result \

SDIO fw (usually named qwlan30.bin) must be obtained from the module vendor.

USB firmware (usually named athwlan.bin) for Linksys WUSB6100M can be downloaded from:

http://downloads.linksys.com/downloads/driver/Win10.zip

ath10k-fwencoder will produce a firmware file named firmware-X.bin, where X is the API version (--set-fw-api argument).

The file must be renamed to either firmware-usb-X.bin or firmware-sdio-X.bin depending on which chipset the file was generated for.

Currently, ath10k supports QCA9377 based usb and sdio chipsets. Thus, the generated firmware files should be placed in the QCA9377/hw1.0 subdirectory of the ath10k firmware directory.

Board files

Board files contain calibration stuff etc. They are radio device dependent and not just chip dependent (other circuitry on the board like LNA's and PA's etc. affect the performance as well). This is the reason the board data is not included in the firmware file. The board data files are always 8124 bytes and should be obtained from the device manufacturer.

In the case with WUSB6100M, Linksys distributes a bunch of different files for different regions:

-rw-rw-r-- 1 erik erik 8124 dec 26 18:26 eeprom_qca9377_7_1p1_Robin_clpc_as.bin
-rw-rw-r-- 1 erik erik 8124 dec 26 18:26 eeprom_qca9377_7_1p1_Robin_clpc_ce.bin
-rw-rw-r-- 1 erik erik 8124 dec 26 18:26 eeprom_qca9377_7_1p1_Robin_clpc_fcc.bin
-rw-rw-r-- 1 erik erik 8124 dec 26 18:26 eeprom_qca9377_7_1p1_Robin_clpc_ic.bin

I guess that ce is indended for Europe and fcc for America, but any of the files will do.

The board data should be added to the board file for the chipset. The board file is named board-2.bin (the number at the end is the ABI version). Each chipset has one board file that contain the board data for all boards using that chipset.

Default board files can be found in the ath10k-firmware repo:

https://github.com/kvalo/ath10k-firmware.git

For QCA9377, the board file is located in QCA9377/hw1.0/board-2.bin

Start off by extracting all board data files from board-2.bin using the tool ath10k-bdencoder. This tool is also part of the qca-swiss-armyknife repository (see above):

./tools/scripts/ath10k/ath10k-bdencoder \
            -e <path-to-ath10k-firmware-repo>/QCA9377/hw1.0/board-2.bin

Then edit the generated json file board-2.json and add a new array member at the end of the array.

Each board has a JSON object containing a names and data field. The names field is used by the driver at startup to determine if the board data is applicable for the current device. It consists of a comma separated list of attributes. Most of them are self-explanatory I guess.

Below is an example for the WUSB6100M USB device:

...
{
    "names": [
        "bus=usb,vendor=13b1,device=0042,subsystem-vendor=0000,subsystem-device=0000"
    ],
    "data": "eeprom_qca9377_7_1p1_Robin_clpc_ce.bin.bin"
}

Note that bus is set to usb and that vendor and device are set to the USB vendor and device ID of the device. Currently, the subsystem-vendor and subsystem-device properties are not used for USB and SDIO so they are set to 0.

When board-2.json has been updated, go ahead and create a new board file:

./tools/scripts/ath10k/ath10k-bdencoder -c board-2.json

A new version of board-2.bin containing the new board data will be created.

Older kernels

In older versions of the driver, the board files for USB and SDIO are expected to be named board-usb.bin and board-sdio.bin resepectively.

The recommended approach is to create a symlink pointing to the board file of interest:

ln -s eeprom_qca9377_7_1p1_Robin_clpc_ce.bin board-usb.bin
Clone this wiki locally