Hello,
We are trying to port AW-CM358 (NXP 88W8987) for our custom board. We are using the SDIO interface for the wifi. We are getting the below error on boot with the below kernel config.
root@imx8mp-lpddr4-evk:~# dmesg | grep mrvl
[ 3.240146] mwifiex_sdio mmc0:0001:1: Direct firmware load for mrvl/sd8987_uapsta.bin failed with error -2
[ 3.252447] mwifiex_sdio mmc0:0001:1: Falling back to sysfs fallback for: mrvl/sd8987_uapsta.bin
[ 7.225014] mwifiex_sdio mmc0:0001:1: Failed to get firmware mrvl/sd8987_uapsta.bin
root@imx8mp-lpddr4-evk:~# modprobe moal
modprobe: FATAL: Module moal not found in directory /lib/modules/6.1.55+gf69f7ebd0ab9
CONFIG_BT_HCIUART_MRVL=y
CONFIG_BT_MRVL=y
# CONFIG_BT_MRVL_SDIO is not set
#CONFIG_LIBERTAS_THINFIRM=y
#CONFIG_LIBERTAS_THINFIRM_DEBUG=y
# CONFIG_LIBERTAS_THINFIRM_USB is not set
CONFIG_MWIFIEX=y
CONFIG_MWIFIEX_SDIO=y
# CONFIG_MWIFIEX_PCIE is not set
# CONFIG_MWIFIEX_USB is not set
# CONFIG_PWRSEQ_SD8787 is not set
If I change the configs from y to m, I can't find the .ko object to insert
Can you help with the issue?
Thank you in advance!
Best Regards.
Solved! Go to Solution.
Dear @Wobaffet
The errors you see occur because the driver cannot locate the firmware:
[ 3.240146] mwifiex_sdio mmc0:0001:1: Direct firmware load for mrvl/sd8987_uapsta.bin failed with error -2
[ 3.252447] mwifiex_sdio mmc0:0001:1: Falling back to sysfs fallback for: mrvl/sd8987_uapsta.bin
(path is relative to /lib/firmware/ directory, so driver is looking for /lib/firmware/mrvl/sd8987_uapsta.bin)
We would advise to use NXP Wifi/BT driver and firmware from NXP github, has explained below:
1/ Getting NXP Wifi/BT driver and firmware
- You can get NXP Wifi/BT driver from:
git clone http://github.com/nxp-imx/mwifiex.git
git checkout lf-6.1.55-2.1.0
- And NXP Wifi/BT firmware:
git clone https://github.com/NXP/imx-firmware
git checkout lf-6.1.55-2.1.0
88W8987 chipset SDIO firmware is imx-firmware/nxp/FwImage_8987/sdiouart8987_combo_v0.bin
2/ Cross compiling the driver
You will need to setup the cross compiler for your host processor, then build the driver as follows:
cd mwifiex/mxm_wifiex/wlan_src && make KERNELDIR=<LINUX_KERNEL_SOURCES> build
The driver is composed in two kernel modules moal.ko and mlan.ko, located in mwifiex/mxm_wifiex/bin_wlan
3/ Copy driver and firmware to the target
Driver: copy mwifiex/mxm_wifiex/bin_wlan directory content to your host (.ko file in usual location, the other files in /lib/firmware/nxp/ directory)
Firmware: copy imx-firmware/nxp/FwImage_8987/sdiouart8987_combo_v0.bin to your host, usually in /lib/firmware/nxp/ directory
4/ Starting Wifi driver
Refer to README_MLAN for explanations
Driver is started by insmod'ing moal.ko (has dependancy to mlan.ko)
There are two ways to specify the drivers parameters:
- Using wifi_mod_para.conf file content to provide driver options:
modprobe moal mod_para=nxp/wifi_mod_para.conf
moal.ko driver will get its parameters from the wifi_mod_para.conf file, automatically load mlan.ko dependency and start downloading the firmware
Here is an example of wifi_mod_para.conf (should be located in /lib/firmware/nxp/ directory)
SD8987 = {
cfg80211_wext=0xf
max_vir_bss=1
cal_data_cfg=none
ps_mode=1
auto_ds=1
host_mlme=1
fw_name=nxp/sdiouart8987_combo_v0.bin
}
- Manually specifying driver options
In that case, you can use this kind of command:
modprobe moal fw_name=nxp/sdiouart8987_combo_v0.bin cfg80211_wext=0xf cal_data_cfg=none host_mlme=1
Once firmware is loaded, ifconfig -a should show new network interfaces (by default mlan0 for STA mode and uap0 for AP mode)
Regards,
Olivier
Hello, do you have AM-CM358 WIFI and Bluetooth DTS sample code?
Because I want to implement the SDIO and Bluetooth UART functions of AM-CM358 on NXP i.mx8,
can you help me provide it? Thank you!
Hi jackwu,
Do you confirm you are also using NXP Application Processor i.MX 8M Plus which is the context of the current topic (from Wobaffet) ?
Are you using NXP "Evaluation Kit for the i.MX 8M Plus Applications Processor" (https://www.nxp.com/design/design-center/development-boards-and-designs/i-mx-evaluation-and-developm...
or
a custom board using NXP Application Processor i.MX 8M Plus ?
Because dts content depends on the board hardware used.
Which SDIO and UART ports number are you using ?
Regards,
Christophe
Dear @Wobaffet
The errors you see occur because the driver cannot locate the firmware:
[ 3.240146] mwifiex_sdio mmc0:0001:1: Direct firmware load for mrvl/sd8987_uapsta.bin failed with error -2
[ 3.252447] mwifiex_sdio mmc0:0001:1: Falling back to sysfs fallback for: mrvl/sd8987_uapsta.bin
(path is relative to /lib/firmware/ directory, so driver is looking for /lib/firmware/mrvl/sd8987_uapsta.bin)
We would advise to use NXP Wifi/BT driver and firmware from NXP github, has explained below:
1/ Getting NXP Wifi/BT driver and firmware
- You can get NXP Wifi/BT driver from:
git clone http://github.com/nxp-imx/mwifiex.git
git checkout lf-6.1.55-2.1.0
- And NXP Wifi/BT firmware:
git clone https://github.com/NXP/imx-firmware
git checkout lf-6.1.55-2.1.0
88W8987 chipset SDIO firmware is imx-firmware/nxp/FwImage_8987/sdiouart8987_combo_v0.bin
2/ Cross compiling the driver
You will need to setup the cross compiler for your host processor, then build the driver as follows:
cd mwifiex/mxm_wifiex/wlan_src && make KERNELDIR=<LINUX_KERNEL_SOURCES> build
The driver is composed in two kernel modules moal.ko and mlan.ko, located in mwifiex/mxm_wifiex/bin_wlan
3/ Copy driver and firmware to the target
Driver: copy mwifiex/mxm_wifiex/bin_wlan directory content to your host (.ko file in usual location, the other files in /lib/firmware/nxp/ directory)
Firmware: copy imx-firmware/nxp/FwImage_8987/sdiouart8987_combo_v0.bin to your host, usually in /lib/firmware/nxp/ directory
4/ Starting Wifi driver
Refer to README_MLAN for explanations
Driver is started by insmod'ing moal.ko (has dependancy to mlan.ko)
There are two ways to specify the drivers parameters:
- Using wifi_mod_para.conf file content to provide driver options:
modprobe moal mod_para=nxp/wifi_mod_para.conf
moal.ko driver will get its parameters from the wifi_mod_para.conf file, automatically load mlan.ko dependency and start downloading the firmware
Here is an example of wifi_mod_para.conf (should be located in /lib/firmware/nxp/ directory)
SD8987 = {
cfg80211_wext=0xf
max_vir_bss=1
cal_data_cfg=none
ps_mode=1
auto_ds=1
host_mlme=1
fw_name=nxp/sdiouart8987_combo_v0.bin
}
- Manually specifying driver options
In that case, you can use this kind of command:
modprobe moal fw_name=nxp/sdiouart8987_combo_v0.bin cfg80211_wext=0xf cal_data_cfg=none host_mlme=1
Once firmware is loaded, ifconfig -a should show new network interfaces (by default mlan0 for STA mode and uap0 for AP mode)
Regards,
Olivier
Hello,
We've cross compiled the firmware. Is it possible to copy the generated binaries and kernel object files during yocto build process to the final image?
Thanks!
Dear @Wobaffet
This is basic Yocto knowledge.
You can add do_install() target to any bitbake recipe, something like:
# Copyright 2017-2022 NXP
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
IMX_FIRMWARE_SRC ?= "git://github.com/NXP/imx-firmware.git;protocol=https"
SRCBRANCH_imx-firmware = "lf-6.1.55_2.2.0"
SRC_URI += " \
${IMX_FIRMWARE_SRC};branch=${SRCBRANCH_imx-firmware};destsuffix=imx-firmware;name=imx-firmware \
"
SRCREV_imx-firmware = "7be5a936ce8677962dd7b41c6c9f41dd14350bec"
do_install:append () {
install -d ${D}${sysconfdir}/firmware
# Install NXP Connectivity
install -d ${D}${nonarch_base_libdir}/firmware/nxp
install -m 0644 ${WORKDIR}/imx-firmware/nxp/wifi_mod_para.conf ${D}${nonarch_base_libdir}/firmware/nxp
# Install NXP Connectivity 8987 firmware
install -m 0644 ${WORKDIR}/imx-firmware/nxp/FwImage_8987/ed_mac_ctrl_V3_8987.conf ${D}${nonarch_base_libdir}/firmware/nxp
install -m 0644 ${WORKDIR}/imx-firmware/nxp/FwImage_8987/sd8987_wlan.bin ${D}${nonarch_base_libdir}/firmware/nxp
install -m 0644 ${WORKDIR}/imx-firmware/nxp/FwImage_8987/sdiouart8987_combo_v0.bin ${D}${nonarch_base_libdir}/firmware/nxp
install -m 0644 ${WORKDIR}/imx-firmware/nxp/FwImage_8987/txpwrlimit_cfg_8987.conf ${D}${nonarch_base_libdir}/firmware/nxp
install -m 0644 ${WORKDIR}/imx-firmware/nxp/FwImage_8987/uartuart8987_bt.bin ${D}${nonarch_base_libdir}/firmware/nxp
}
FILES:${PN} = " ${nonarch_base_libdir}/firmware/nxp/* "
Regards,
Olivier
Dear @Wobaffet
You can use i.MX Yocto Linux releases as a reference:
See Embedded Linux
You can get i.MX Linux Yocto recipes:
repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-mickledore -m imx-6.1.55-2.2.0.xml
repos sync
And use below recipes as example:
# wifi kernel modules recipe
sources/meta-imx/meta-bsp/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb
sources/meta-imx/meta-bsp/recipes-connectivity/nxp-wlan-sdk/nxp-wlan-sdk_git.inc
# Wifi Firmware recipe
sources/meta-imx/meta-bsp/recipes-kernel/linux-firmware/linux-firmware_%.bbappend
Regards,
Olivier