I’m attempting to bringup a PAN9028 radio on a custom PCB with an SDIO connection to an iMX8M processor running the mainline Linux kernel. I want to use both the WiFi and Bluetooth capability.
I’m VERY confused by the state of the documentation for this stack and could REALLY use some help.
Here are my questions:
Thanks!
已解决! 转到解答。
Okay, @ocourson. Thanks again for the clarity and quick response.
Here's my understanding so far:
Is there an NXP doc somewhere for defeating the sunk cost fallacy? I'd happily sign the NDA to see it.
Seriously though, I think my time with this PAN9028 module has reached an end. I'll do a little more homework before selecting the next part.
Solution: Use something else.
Dear @jaredwheeler
We understand your confusion as there are different software release channels, and some documents might be outdated.
1/ User can either load WiFi+Bluetooth combo firmware at once (serial download, easiest solution):
modprobe moal fw_name=nxp/sdiouart8987_combo_v0.bin cfg80211_wext=0xf
Or load WiFi and Bluetooth firmwares individually (parallel download)
modprobe fw_name=nxp/sd8987_wlan.bin cfg80211_wext=0xf fw_serial=0
fw_loader /dev/ttymxcX 115200 0 /lib/firmware/nxp/uartuart8987_bt.bin
(parallel download is only required if independent WiFi/BT firmware reset is needed).
Please refer to UM11483 && UM11490 NXP user guides
2/ NXP now release generic driver and firmwares using github:
You can get NXP WiFi/BT driver from:
git clone http://github.com/nxp-imx/mwifiex.git
git checkout lf-6.1.36-2.1.0
This single driver is supporting all the recent NXP chipsets
And NXP WiFi/BT firmware:
git clone https://github.com/NXP/imx-firmware
git checkout lf-6.1.36-2.1.0
You will find chipset specific firmwares (like nxp/FwImage_8987/sdiouart8987_combo_v0.bin for 88W8987 WiFi+BT combo firmware)
3/ Indeed, UM11675 indeed explains customers how get NXP driver and firmware from github (see 2/).
Let us try to clarify the different NXP releases:
- NXP releases generic driver and firmwares on github. These generic software releases are accessible to any customers. They include all the WiFi/BT generic features. They are also integrated in the NXP i.MX Linux BSP releases, widely tested, and even WiFi pre-certified.
- NXP also release restricted access software on nxp.com. These releases are not available to all customers. On top of the generic WiFi/BT features, they include very specific features which are not used by most of the customers.
4/ As of today, NXP does not support the mainline Linux kernel driver and firmwares. The mainline Linux contains old & outdated driver and firmwares, and does not even support recent chipsets (like IW416, 88W9098, etc).
We are working to upstream our driver/firmwares to the kernel mainline, but this will not be available on short notice.
Do not hesitate to come back to us if something is still not clear.
Regards,
Olivier
Thanks for much @ocourson for the quick response. This context is helpful in sorting out issues with my bringup.
Followup question in your response to #1:
What does this line do?
fw_loader /dev/ttymxcX 115200 0 /lib/firmware/nxp/uartuart8987_bt.bin
Is there an fw_loader binary somewhere I may need? I'm building the kernel/rootfs directly from source, not from the imx Yocto pile. Is that fw_loader built somewhere in the Yocto stack?
My module loading is also a bit different than your code as I have to use insmod:
insmod /lib64/modules/6.0.9+/kernel/drivers/net/wireless/imx/mlan.ko
insmod /lib64/modules/6.0.9+/kernel/drivers/net/wireless/imx/moal.ko fw_name=nxp/sdiouart8987_combo_v0.bin cfg80211_wext=0xf
And finally, when I run the above commands, I get the following output to dmesg:
mlan: loading out-of-tree module taints kernel.
wlan: Loading MWLAN driver
wlan: Register to Bus Driver...
vendor=0x02DF device=0x9149 class=0 function=1
Attach moal handle ops, card interface type: 0x105
rps set to 0 from module param
No module param cfg file specified
SDIO: max_segs=128 max_seg_size=65535
rx_work=1 cpu_num=4
Attach mlan adapter operations.card_type is 0x105.
wlan: Enable TX SG mode
wlan: Enable RX SG mode
Request firmware: nxp/sdiouart8987_combo_v0.bin
Wlan: FW download over, firmwarelen=612584 downloaded 612584
Fail to poll firmware status: firmwarestat=0xf00b
FW failed to be active in time!
wlan_dnld_fw fail ret=0xffffffff
WLAN: Fail download FW with nowwait: 0
SDIO Func0 (0x0-0x9): 43 03 02 02 03 00 00 02 03 00
SDIO Func1 (0x10-0x17): 00 00 00 00 00 00 00 00
SDIO Func1: (0x8) 00 (0x58) 00 (0x5c) 0d (0x5d) 00 (0x60) 01 (0x61) 00 (0x62) 00 (0x64) 10 (0x65) 01 (0x66) 00 (0x68) 00 (0x69) 00 (0x6a) 00
SDIO Func1 (0xe8-0xf2): 0b f0 00 00 00 00 00 00 24 14 70
SDIO Func1 (0xe8-0xf2): 0b f0 00 00 00 00 00 00 24 14 70
woal_request_fw failed
Firmware Init Failed
Free module params
woal_add_card failed
wlan_sdio: probe of mmc1:0001:1 failed with error -1
wlan: Register to Bus Driver Done
wlan: Driver loaded successfully
Note that if, instead, I just modprobe the mwifiex_sdio module from the mainline kernel, the WiFi comes up without issue (though the BT stack isn't stood up -- I assume that's to be expected from the in-tree mwifiex_sdio module). I've confirmed that the in-tree mwifiex_sdio module IS loading the sdiouart8987_combo_v0.bin firmware. So it's doesn't seem to be an issue with the SDIO i/f, could it be a problem with my UART i/f?
Dear @jaredwheeler
As explained previously, below line
fw_loader /dev/ttymxcX 115200 0 /lib/firmware/nxp/uartuart8987_bt.bin
Is used to download the Bluetooth firmware using UART firmware loader.
It is only required if you download WiFi and Bluetooth firmwares separately, meaning using the WiFi only firmware:
modprobe moal fw_name=nxp/sd8987_wlan.bin cfg80211_wext=0xf fw_serial=0
But it shall not be used if you use a WiFi+BT combo firmware
modprobe moal fw_name=nxp/sdiouart8987_combo_v0.bin cfg80211_wext=0xf
fw_loader is provided in the restricted access NXP software releases.
It seems that SDIO is working in your side, because you are able to download the firmware using SDIO, but for some reason, the firmware does not start. Maybe you could try to reset the module using dedicated GPIO.
Let me also remind that NXP does not support (for now) the driver included in the kernel mainline.
Regards,
Olivier
Okay, @ocourson. Thanks again for the clarity and quick response.
Here's my understanding so far:
Is there an NXP doc somewhere for defeating the sunk cost fallacy? I'd happily sign the NDA to see it.
Seriously though, I think my time with this PAN9028 module has reached an end. I'll do a little more homework before selecting the next part.
Solution: Use something else.