erstrom / linux-ath

Linux qca/ath wireless driver tree (based on git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git)
Other
21 stars 12 forks source link

sdio changes for 4.16? #9

Closed chewitt closed 6 years ago

chewitt commented 6 years ago

I'm running some experiments on Amlogic support in mainline kernels and QCA9377 is a popular sdio module on a number of the devices I'm trying to work with. I've been poking the silex patches but the branches diverged from mainline since Nov/Dec and I haven't been able to merge the patches into an 4.16-rc2 kernel, it needs more knowledge of surrounding changes than I possess. It's a cheeky ask, but would it be possible for you to create/update a branch with those changes?

chewitt commented 6 years ago

@erstrom I spotted the updated master branch (thanks) and built a kernel, but I see issues with firmware loading:

[    8.605571] ath10k_sdio mmc2:0001:1: WARNING: ath10k SDIO support is experimental
[    8.657012] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/pre-cal-sdio-mmc2:0001:1.bin failed with error -2
[    8.657079] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/cal-sdio-mmc2:0001:1.bin failed with error -2
[    8.657138] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-sdio-6.bin failed with error -2
[    8.668899] ath10k_sdio mmc2:0001:1: qca9377 hw1.1 sdio target 0x05020001 chip_id 0x00000000 sub 0000:0000
[    8.668907] ath10k_sdio mmc2:0001:1: kconfig debug 0 debugfs 0 tracing 0 dfs 0 testmode 0
[    8.670097] ath10k_sdio mmc2:0001:1: firmware ver WLAN.TF.1.0-00267-1 api 5 features ignore-otp crc32 79cea2c7
[    8.815051] ath10k_sdio mmc2:0001:1: failed to fetch board data for bus=sdio,vendor=0271,device=0701,subsystem-vendor=0000,subsystem-device=0000 from ath10k/QCA9377/hw1.0/board-2.bin
[    8.815180] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/QCA9377/hw1.0/board-sdio.bin failed with error -2
[    8.815186] ath10k_sdio mmc2:0001:1: failed to fetch board-2.bin or board.bin from ath10k/QCA9377/hw1.0
[    8.815190] ath10k_sdio mmc2:0001:1: failed to fetch board file: -2
[    8.815335] ath10k_sdio mmc2:0001:1: could not probe fw (-2)

I have the following firmware files on the device, which were obtained from the mainline kernel-firmware repo:

CZBOX:~ # ls -l /usr/lib/firmware/ath10k/QCA9377/hw1.0/
total 0
lrwxrwxrwx    1 root     root            75 Jan 28 19:58 board-2.bin -> /usr/lib/kernel-overlays/base/lib/firmware/ath10k/QCA9377/hw1.0/board-2.bin
lrwxrwxrwx    1 root     root            73 Jan 28 19:58 board.bin -> /usr/lib/kernel-overlays/base/lib/firmware/ath10k/QCA9377/hw1.0/board.bin
lrwxrwxrwx    1 root     root            78 Jan 28 19:58 firmware-5.bin -> /usr/lib/kernel-overlays/base/lib/firmware/ath10k/QCA9377/hw1.0/firmware-5.bin
lrwxrwxrwx    1 root     root            83 Jan 28 19:58 firmware-sdio-5.bin -> /usr/lib/kernel-overlays/base/lib/firmware/ath10k/QCA9377/hw1.0/firmware-sdio-5.bin
lrwxrwxrwx    1 root     root            92 Jan 28 19:58 notice_ath10k_firmware-5.txt -> /usr/lib/kernel-overlays/base/lib/firmware/ath10k/QCA9377/hw1.0/notice_ath10k_firmware-5.txt

^ firmware-sdio-5.bin is a symlink to firmware-5.bin, else it complains about no firmware. Adding another symlink for board-sdio.bin results in this:

[    8.465161] ath10k_sdio mmc2:0001:1: WARNING: ath10k SDIO support is experimental
[    8.516371] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/pre-cal-sdio-mmc2:0001:1.bin failed with error -2
[    8.516435] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/cal-sdio-mmc2:0001:1.bin failed with error -2
[    8.516491] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-sdio-6.bin failed with error -2
[    8.534467] ath10k_sdio mmc2:0001:1: qca9377 hw1.1 sdio target 0x05020001 chip_id 0x00000000 sub 0000:0000
[    8.534476] ath10k_sdio mmc2:0001:1: kconfig debug 0 debugfs 0 tracing 0 dfs 0 testmode 0
[    8.538854] ath10k_sdio mmc2:0001:1: firmware ver WLAN.TF.1.0-00267-1 api 5 features ignore-otp crc32 79cea2c7
[    8.683216] ath10k_sdio mmc2:0001:1: failed to fetch board data for bus=sdio,vendor=0271,device=0701,subsystem-vendor=0000,subsystem-device=0000 from ath10k/QCA9377/hw1.0/board-2.bin
[    8.683910] ath10k_sdio mmc2:0001:1: board_file api 1 bmi_id N/A crc32 544289f7
[   15.076118] ath10k_sdio mmc2:0001:1: wmi service ready event not received
[   15.076930] ath10k_sdio mmc2:0001:1: could not init core (-110)
[   15.077803] ath10k_sdio mmc2:0001:1: could not probe fw (-110)

I'm not sure if adding symlinks is the right thing .. or something else needs tweaking?

chewitt commented 6 years ago

after removing the symlink to firmware-5.bin and adding the firmware-sdio-5.bin file from here https://github.com/erstrom/ath10k-firmware/tree/master/QCA9377/hw1.0/untested the box has working wlan :)

[    8.636444] ath10k_sdio mmc2:0001:1: WARNING: ath10k SDIO support is experimental
[    8.694048] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/pre-cal-sdio-mmc2:0001:1.bin failed with error -2
[    8.694101] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/cal-sdio-mmc2:0001:1.bin failed with error -2
[    8.694148] ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-sdio-6.bin failed with error -2
[    8.709155] ath10k_sdio mmc2:0001:1: qca9377 hw1.1 sdio target 0x05020001 chip_id 0x00000000 sub 0000:0000
[    8.709164] ath10k_sdio mmc2:0001:1: kconfig debug 0 debugfs 0 tracing 0 dfs 0 testmode 0
[    8.710417] ath10k_sdio mmc2:0001:1: firmware ver WLAN.TF.1.1.1-00061-QCATFSWPZ-1 api 5 features ignore-otp crc32 7746e551
[    8.857586] ath10k_sdio mmc2:0001:1: failed to fetch board data for bus=sdio,vendor=0271,device=0701,subsystem-vendor=0000,subsystem-device=0000 from ath10k/QCA9377/hw1.0/board-2.bin
[    8.858228] ath10k_sdio mmc2:0001:1: board_file api 1 bmi_id N/A crc32 544289f7
[   10.104116] ath: EEPROM regdomain: 0x0
[   10.104122] ath: EEPROM indicates default country code should be used
[   10.104124] ath: doing EEPROM country->regdmn map search
[   10.104128] ath: country maps to regdmn code: 0x3a
[   10.104131] ath: Country alpha2 being used: US
[   10.104133] ath: Regpair used: 0x3a
[   10.104154] ath10k_sdio mmc2:0001:1: invalid hw_params.n_cipher_suites 0

If there's any testing you'd like to see to help things go upstream please feel free to ping me

erstrom commented 6 years ago

Glad to hear that you got working wifi! I'll close this issue then.

chewitt commented 6 years ago

thanks, can I ask what the plan is for these changes to go upstream?

erstrom commented 6 years ago

Some of the SDIO patches come from Silex (module vendor), so I can't really say. They need to fix them somewhat before everything can be integrated. I also expect at least one round of RFC:s before I could have my HL patches into Kalles ath tree (once they make it into his tree, they will eventually end up in the mainline kernel).

chewitt commented 6 years ago

@erstrom Sorry to bug you via this thread again. I need to rebase against 4.18-rc3, but which of your branches to choose/use? - I'm ideally looking for something that applies the current patch-set needed for ath10k sdio support onto Linus' rc3 commit that doesn't include all the other patch traffic for linux-wireless. What do you advise?

erstrom commented 6 years ago

I just pushed a branch with SDIO ath10k patches on mainline 4.17:

v4.17-ath-201805251019-ath10k-high-latency-tx-bundling

It does not contain any of the other wireless stuff you mentioned, only ath10k. It is not the latest version of my patches, but they should be working. I think it should be fairly easy to use these patches with a 4.18-rc3 kernel.

chewitt commented 5 years ago

@erstrom I'm in the process of bumping to 4.19-rc5 and it looks like ath10k-sdio support went in (yay!) but there's still a collection of fixes in your branch that look useful. Can I ask you to push a branch that will apply onto rc5? .. the latest 20180906 'bundling' branch has some conflicts. So far (on 4.18) sdio support has been working great.

erstrom commented 5 years ago

@chewitt Perhaps a somewhat late reply, but since you requested patches that could be applied directly to mainline, I have created a bunch of mainline-based branches:

Each branch has the necessary extra patches for ath10k sdio added.

chewitt commented 5 years ago

@erstrom thanks! .. and a question: are there going to be any compatible bindings for ath10k-sdio? i.e. similar to the compatible = "brcm,bcm4329-fmac"; used for the broadcom/ampak modules.

erstrom commented 5 years ago

@chewitt No. You only need to make sure that you have MMC/SDIO properly configured in the device tree. You can have a look at the dts files for the Boundary Devices Nitrogen boards and see how it is done there if you need to create your own custom device tree.