IMX8: PCIE8997: Bluetooth startup issue and kernel oops

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8: PCIE8997: Bluetooth startup issue and kernel oops

2,492 Views
TerryBarnaby1
Contributor V

We are currently using NXP’s 6.1.55_2.5.0​ based on Yocto Mickledore on a custom IMX8mp board which has a Wifi/Bluetooth module drive as a PCIE8997.

We are just getting Bluetooth to work on this board. In general we have this working with audio recording and playback. However we get occasional issues where the Bluetooth is not available after system boot with a kernel oops message given below.

I think we have an issue with the order of kernel module loading, device initialisation. We are unsure on how this is supposed to work. I think the issue may be due to the order of the moal and btnxpuart module loading.

We have a systemd service that is started, that basically does:

insmod /usr/dsmc/drivers/mlan.ko
insmod /usr/dsmc/drivers/moal.ko mod_para=nxp/wifi_mod_para.conf

wpa_supplicant -B -i uap0 -c /usr/dsmc/etc/wpa_supplicant_ap.conf
wpa_supplicant -B -i mlan0 -c /usr/dsmc/etc/wpa_supplicant.conf

# Bluetooth startup
# hciconfig hci0 down
# rmmod btnxpuart; modprobe btnxpuart
# hciconfig hci0 up

We found we needed the "rmmod btnxpuart; modprobe btnxpuart" to get the Bluetooth to operate to some extent (apart from the odd kernel oops). So how is this supposed to work ?

I would have expected we would need to have the following order:

insmod /usr/dsmc/drivers/mlan.ko
insmod /usr/dsmc/drivers/moal.ko mod_para=nxp/wifi_mod_para.conf
modprobe btnxpuart
systemctl start bluetooth

However without our systemd service we note that btnxpuart is being loaded by something, before moal is loaded. Is that to be expected ?

 

 

0 Kudos
Reply
5 Replies

2,432 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

Could  you try with editing conf file.

# nano /lib/firmware/nxp/wifi_mod_para.conf

PCIE8997 = {
 cfg80211_wext=0xf
 wfd_name=p2p
 cal_data_cfg=none
 drv_mode=7
 fw_name=nxp/pcieuart8997_combo_v4.bin
}

Then the initialization would be like this:

# modprobe moal mod_para=nxp/wifi_mod_para.conf
# modprobe btnxpuart
# hciconfig hci0 up

Regards

0 Kudos
Reply

2,428 Views
TerryBarnaby1
Contributor V

Thanks for the reply, but I can't see how those moal parameters would help. They seem to be about enabling the WIFI direct mode. My moal configuration is:

PCIE8997 = {
cfg80211_wext=0xf
max_vir_bss=1
cal_data_cfg=none
ps_mode=2
auto_ds=2
host_mlme=1
fw_name=nxp/pcieuart8997_combo_v4.bin
}

This came from some NXP documentation.

I don't think this is anything to do with the issue. I am trying to find out how this is supposed to work properly.

What I can see is that in my DTS (based on NXP IMX8mp DTS examples) it has:

&uart1 { /* BT */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
assigned-clocks = <&clk IMX8MP_CLK_UART1>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
fsl,uart-has-rtscts;
status = "okay";

bluetooth {
compatible = "nxp,88w8997-bt";
};
};

Due to this the btnxpuart module is loaded automatically during kernel start up and this will be before moal/mlan. I think it should be loaded after moal (as per your example of manually loading btnxpuart after moal). As stated I would like to know how the Bluetooth module setup should be set up to work (should the DTS entry be removed for example and it should be started after moal manually or should it be there before moal using the DTS and something else is wrong) ?

I have worked around the issue at the moment, leaving my DTS as it is, but adding "blacklist btnxpuart" to /etc/modprobe.d/blacklist.conf and manually loading btnxpuart after moal. This appears to stop the kernel oops happening (but only time will tell).

Also there should not be a kernel oops in the first place no matter what, so a driver bug is in there somewhere ...

 

Terry

0 Kudos
Reply

2,455 Views
malik_cisse
Senior Contributor I

Thank you @TerryBarnaby1  for sharing this. 

0 Kudos
Reply

2,476 Views
malik_cisse
Senior Contributor I

Hi,

Unfortunately, I'm not able to provide substantial feedback yet as I've only recently begun working on the same Wi-Fi/BT module (Murata 1YM M.2 chipset = NXP 88W8997) for my i.MX8MP.

Given your somewhat successful implementation, I would be very grateful if you could share your device tree configuration for setting up Bluetooth.
Thank you

0 Kudos
Reply

2,457 Views
TerryBarnaby1
Contributor V

Yes, enclosed is our current device tree. Some bits in there you obviously won't need and things that would break on your system.

We are using PCIe for Wifi and the UART for Bluetooth. Obviously there is moal driver setup, firmware files and Bluetooth config files to contend with as well.