[PATCH 2/2] ath10k: search DT for qcom, ath10k-calibration-variant

Christian Lamparter chunkeey at googlemail.com
Fri Mar 10 10:20:54 PST 2017


On Friday, March 10, 2017 9:06:15 AM CET Sven Eckelmann wrote:
> Board Data File (BDF) is loaded upon driver boot-up procedure. The right
> board data file is identified on QCA4019 using bus, bmi-chip-id and
> bmi-board-id.
> 
> The problem, however, can occur when the (default) board data file cannot
> fulfill with the vendor requirements and it is necessary to use a different
> board data file.
> 
> This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
> Something similar has to be provided for systems without SMBIOS but with
> device trees. No solution was specified by QCA and therefore a new one has
> to be found for ath10k.
> 
> The device tree requires addition strings to define the variant name
> 
>     wifi at a000000 {
>     	status = "okay";
>     	qcom,ath10k-calibration-variant = "RT-AC58U";
>     };
> 
>     wifi at a800000 {
>     	status = "okay";
>     	qcom,ath10k-calibration-variant = "RT-AC58U";
>     };
> 
> This would create the boarddata identifiers for the board-2.bin search
> 
>  *  bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
>  *  bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U
> 
> Signed-off-by: Sven Eckelmann <sven.eckelmann at openmesh.com>
> ---
I've attached a modified board-2.bin for the RT-AC58U variant:

# ath10k-bdencoder -i board-2.bin
FileSize: 48564
FileCRC32: 7ac95dfd
FileMD5: 825c8e7377b0d543024dbf62f2fd29ff
BoardNames[0]: 'bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U'
BoardLength[0]: 12064
BoardCRC32[0]: bd216dd3
BoardMD5[0]: a12a4745c775beb5ab6ba1e4d711aea0
BoardNames[1]: 'bus=ahb,bmi-chip-id=0,bmi-board-id=16'
BoardLength[1]: 12064
BoardCRC32[1]: 65a8a5b3
BoardMD5[1]: cb5dcb0337706c313ea3342587b283ae
BoardNames[2]: 'bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U'
BoardLength[2]: 12064
BoardCRC32[2]: a7d74de3
BoardMD5[2]: 17bbd05ee0cd9099a549c835b7399b3c
BoardNames[3]: 'bus=ahb,bmi-chip-id=0,bmi-board-id=17'
BoardLength[3]: 12064
BoardCRC32[3]: 4fe93ca0
BoardMD5[3]: 1aa45fad7a0d6f1c5774b251c712c67c

And this is a patched ath10k loading it:

[  106.155058] ath10k_ahb a800000.wifi: boot get otp board id result 0x00004400 board_id 17 chip_id 0
[  106.155092] ath10k_ahb a800000.wifi: SMBIOS bdf variant name not set.
[  106.155154] ath10k_ahb a800000.wifi: boot using board name 'bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U'
[  106.155570] ath10k_ahb a800000.wifi: board name
[  106.155607] ath10k_ahb a800000.wifi: 00000000: 62 75 73 3d 61 68 62 2c 62 6d 69 2d 63 68 69 70  bus=ahb,bmi-chip
[  106.155644] ath10k_ahb a800000.wifi: 00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 62 6f 61 72 64 2d  -id=0,bmi-board-
[  106.155681] ath10k_ahb a800000.wifi: 00000020: 69 64 3d 31 36 2c 76 61 72 69 61 6e 74 3d 52 54  id=16,variant=RT
[  106.155904] ath10k_ahb a800000.wifi: 00000030: 2d 41 43 35 38 55                                -AC58U
[  106.155972] ath10k_ahb a800000.wifi: board name
[  106.156057] ath10k_ahb a800000.wifi: 00000000: 62 75 73 3d 61 68 62 2c 62 6d 69 2d 63 68 69 70  bus=ahb,bmi-chip
[  106.156142] ath10k_ahb a800000.wifi: 00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 62 6f 61 72 64 2d  -id=0,bmi-board-
[  106.156211] ath10k_ahb a800000.wifi: 00000020: 69 64 3d 31 36                                   id=16
[  106.156662] ath10k_ahb a800000.wifi: board name
[  106.156700] ath10k_ahb a800000.wifi: 00000000: 62 75 73 3d 61 68 62 2c 62 6d 69 2d 63 68 69 70  bus=ahb,bmi-chip
[  106.156737] ath10k_ahb a800000.wifi: 00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 62 6f 61 72 64 2d  -id=0,bmi-board-
[  106.156773] ath10k_ahb a800000.wifi: 00000020: 69 64 3d 31 37 2c 76 61 72 69 61 6e 74 3d 52 54  id=17,variant=RT
[  106.156809] ath10k_ahb a800000.wifi: 00000030: 2d 41 43 35 38 55                                -AC58U
[  106.156845] ath10k_ahb a800000.wifi: boot found match for name 'bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U'
[  106.156876] ath10k_ahb a800000.wifi: boot found board data for 'bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U'
[  106.156906] ath10k_ahb a800000.wifi: using board api 2
[  106.163704] ath10k_ahb a800000.wifi: board_file api 2 bmi_id 0:17 crc32 f222ba02
[  106.165037] ath10k_ahb a800000.wifi: boot push board extended data addr 0x0
[  106.184867] ath10k_ahb a800000.wifi: boot cal file downloaded
[  106.184905] ath10k_ahb a800000.wifi: boot using calibration mode pre-cal-file
[  106.184945] ath10k_ahb a800000.wifi: boot upload otp to 0x1234 len 4582 for board id
[  106.205657] ath10k_ahb a800000.wifi: boot get otp board id result 0x00004400 board_id 17 chip_id 0
[  106.205811] ath10k_ahb a800000.wifi: boot push board extended data addr 0x0
[  106.225685] ath10k_ahb a800000.wifi: boot upload otp to 0x1234 len 4582
[  106.252294] ath10k_ahb a800000.wifi: boot otp execute result 0

@Aeolus Yang / Kalle / QCA: Would it be possible to assign a variant string to
the Asus RT-AC58U?

I've attached the necessary bmi-board-id=16 and bmi-board-id=17 board 
files to this mail as well. So, all that needs to be done is to add
them to the board-2.bin on your codeaurora / ath10k-firmware project.

Kalle: Can you please update the board-2.bin for the IPQ40XX on your
ath10k-firmware project on github?

https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA40XX/hw1.0/board-2.bin
It looks like this board-2.bin has support for a few more boards.

Thanks,
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: board-2.bin
Type: application/octet-stream
Size: 48564 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/ath10k/attachments/20170310/fa357c53/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U.bin
Type: application/octet-stream
Size: 12064 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/ath10k/attachments/20170310/fa357c53/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U.bin
Type: application/octet-stream
Size: 12064 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/ath10k/attachments/20170310/fa357c53/attachment-0005.bin>


More information about the ath10k mailing list