Re: Issue with QCA9980 initialization

2015-12-20 Thread Felix Fietkau
On 2015-12-17 13:10, Josh Bendavid wrote:
> I have a problem with QCA9980 initialization.
> 
> Hardware/software environment is a TP-Link Archer C2600 with Openwrt
> trunk + patches for the c2600.  (This device has two QCA9980
> controllers for simultaneous dual band operation)
> 
> Openwrt is currently populating the firmware files as follows
> 
> https://github.com/kvalo/ath10k-firmware/blob/69f955c3dd95d97c7c30960aa5c9852c80b85cc3/QCA99X0/hw2.0/boardData_AR900B_CUS239_5G_v2_001.bin
> -> /lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
> 
> https://github.com/kvalo/ath10k-firmware/blob/69f955c3dd95d97c7c30960aa5c9852c80b85cc3/QCA99X0/hw2.0/firmware-5.bin_10.4.1.00030-1
> -> /lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin
> 
> https://www.codeaurora.org/cgit/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA99X0/hw2.0/board-2.bin?id=ddcec9efd245da9365c474f513a855a55f3ac7fe
> -> /lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
> 
> Then I am extracting (at hardware initialization time) the appropriate
> calibration data from the ART partition on the router flash
> 
> offset/count 4096/12064 -> /lib/firmware/ath10k/cal-pci-:01:00.0.bin
> offset/count 20480/12064 -> /lib/firmware/ath10k/cal-pci-0001:01:00.0.bin
> 
> Using ath10k as shipped with compat-wireless in openwrt trunk out of
> the box I get the output in attached nopatch.txt (and wireless is not
> functioning clearly)
> 
> Using instead the patch from
> http://lists.infradead.org/pipermail/ath10k/2015-November/006489.html
> 
> Then I get the output in attached patch.txt, and wireless is working
> correctly with both radios.
> 
> Is it a known problem?  Is there a mistake somewhere in how I am
> populating /lib/firmware, or is the applied patch the correct fix for
> the time being?
It's a known problem. ath10k has a bug where it needlessly tries to
extract the OTP board id and fetch data from board-2.bin (and fails if
it can't) even though it already has valid per-radio cal-data.

- Felix

___
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k


Issue with QCA9980 initialization

2015-12-17 Thread Josh Bendavid
I have a problem with QCA9980 initialization.

Hardware/software environment is a TP-Link Archer C2600 with Openwrt
trunk + patches for the c2600.  (This device has two QCA9980
controllers for simultaneous dual band operation)

Openwrt is currently populating the firmware files as follows

https://github.com/kvalo/ath10k-firmware/blob/69f955c3dd95d97c7c30960aa5c9852c80b85cc3/QCA99X0/hw2.0/boardData_AR900B_CUS239_5G_v2_001.bin
-> /lib/firmware/ath10k/QCA99X0/hw2.0/board.bin

https://github.com/kvalo/ath10k-firmware/blob/69f955c3dd95d97c7c30960aa5c9852c80b85cc3/QCA99X0/hw2.0/firmware-5.bin_10.4.1.00030-1
-> /lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin

https://www.codeaurora.org/cgit/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA99X0/hw2.0/board-2.bin?id=ddcec9efd245da9365c474f513a855a55f3ac7fe
-> /lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin

Then I am extracting (at hardware initialization time) the appropriate
calibration data from the ART partition on the router flash

offset/count 4096/12064 -> /lib/firmware/ath10k/cal-pci-:01:00.0.bin
offset/count 20480/12064 -> /lib/firmware/ath10k/cal-pci-0001:01:00.0.bin

Using ath10k as shipped with compat-wireless in openwrt trunk out of
the box I get the output in attached nopatch.txt (and wireless is not
functioning clearly)

Using instead the patch from
http://lists.infradead.org/pipermail/ath10k/2015-November/006489.html

Then I get the output in attached patch.txt, and wireless is working
correctly with both radios.

Is it a known problem?  Is there a mistake somewhere in how I am
populating /lib/firmware, or is the applied patch the correct fix for
the time being?

Thanks,
Josh
[   10.163756] cfg80211: World regulatory domain updated:
[   10.163784] cfg80211:  DFS Master region: unset
[   10.167787] cfg80211:   (start_freq - end_freq @ bandwidth), 
(max_antenna_gain, max_eirp), (dfs_cac_time)
[   10.172511] cfg80211:   (2402000 KHz - 2472000 KHz @ 4 KHz), (N/A, 2000 
mBm), (N/A)
[   10.181945] cfg80211:   (2457000 KHz - 2482000 KHz @ 4 KHz), (N/A, 2000 
mBm), (N/A)
[   10.189846] cfg80211:   (2474000 KHz - 2494000 KHz @ 2 KHz), (N/A, 2000 
mBm), (N/A)
[   10.197810] cfg80211:   (517 KHz - 525 KHz @ 8 KHz, 16 KHz 
AUTO), (N/A, 2000 mBm), (N/A)
[   10.205808] cfg80211:   (525 KHz - 533 KHz @ 8 KHz, 16 KHz 
AUTO), (N/A, 2000 mBm), (0 s)
[   10.215519] cfg80211:   (549 KHz - 573 KHz @ 16 KHz), (N/A, 2000 
mBm), (0 s)
[   10.224984] cfg80211:   (5735000 KHz - 5835000 KHz @ 8 KHz), (N/A, 2000 
mBm), (N/A)
[   10.233030] cfg80211:   (5724 KHz - 6372 KHz @ 216 KHz), (N/A, 0 
mBm), (N/A)
[   10.262439] ath10k_pci :01:00.0: enabling device (0140 -> 0142)
[   10.263267] ath10k_pci :01:00.0: pci irq msi interrupts 1 irq_mode 0 
reset_mode 0
[   10.394488] ath10k_pci :01:00.0: Direct firmware load for 
ath10k/cal-pci-:01:00.0.bin failed with error -2
[   10.394519] ath10k_pci :01:00.0: Falling back to user helper
[   16.935467] ath10k_pci :01:00.0: qca99x0 hw2.0 target 0x0100 chip_id 
0x003b01ff sub 168c:0002
[   16.935504] ath10k_pci :01:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 
1 testmode 1
[   16.945180] ath10k_pci :01:00.0: firmware ver 10.4.1.00030-1 api 5 
features no-p2p crc32 d2901e01
[   18.992515] ath10k_pci :01:00.0: unable to read from the device
[   18.992541] ath10k_pci :01:00.0: could not execute otp for board id 
check: -110
[   18.997581] ath10k_pci :01:00.0: failed to get board id from otp: -110, 
ignoring
[   19.005579] ath10k_pci :01:00.0: failed to fetch board data for 
bus=pci,vendor=168c,device=0040,subsystem-vendor=168c,subsystem-device=0002 
from ath10k/QCA99X0/hw2.0/board-2.bin
[   19.013486] ath10k_pci :01:00.0: board_file api 1 bmi_id N/A crc32 
7e56fd07
[   20.480266] ath10k_pci :01:00.0: htt-ver 2.2 wmi-op 6 htt-op 4 cal file 
max-sta 512 raw 0 hwcrypto 1
[   20.536215] ath: EEPROM regdomain: 0x0
[   20.536224] ath: EEPROM indicates default country code should be used
[   20.536229] ath: doing EEPROM country->regdmn map search
[   20.536239] ath: country maps to regdmn code: 0x3a
[   20.536246] ath: Country alpha2 being used: US
[   20.536253] ath: Regpair used: 0x3a
[   20.539860] cfg80211: Regulatory domain changed to country: US
[   20.539887] cfg80211:  DFS Master region: FCC
[   20.544838] ath10k_pci 0001:01:00.0: enabling device (0140 -> 0142)
[   20.549765] ath10k_pci 0001:01:00.0: pci irq msi interrupts 1 irq_mode 0 
reset_mode 0
[   20.555181] cfg80211:   (start_freq - end_freq @ bandwidth), 
(max_antenna_gain, max_eirp), (dfs_cac_time)
[   20.563135] cfg80211:   (2402000 KHz - 2472000 KHz @ 4 KHz), (N/A, 3000 
mBm), (N/A)
[   20.572695] cfg80211:   (517 KHz - 525 KHz @ 8 KHz, 16 KHz 
AUTO), (N/A, 2300 mBm), (N/A)
[   20.580439] cfg80211:   (525 KHz - 533 KHz @ 8 KHz, 16 KHz 
AUTO), (N/A, 2300 mBm), (0 s)
[   20.590220] cfg80211:   (549 KHz