We use Ampak6398P wifi bt card(which use BCM4359 chip) connect to nano module.
After booting, it can’t work, and don’t have wlan0 interface.
And lsmod shows:
sercomm@linux:~$ lsmod
Module Size Used by
overlay 48691 0
zram 26166 4
bcmdhd_pcie 892308 0
cfg80211 589351 1 bcmdhd_pcie
nvgpu 1575721 3
bluedroid_pm 13912 0
ip_tables 19441 0
x_tables 28951 1 ip_tables
sercomm@linux:~$ ifconfig wlan0 up
wlan0: ERROR while getting interface flags: No such device
Then we want to remove bcmdhd_pcie, get crash:
sercomm@linux:~$ sudo rmmod bcmdhd_pcie
[sudo] password for sercomm:
[ 135.890552] ------------[ cut here ]------------
[ 135.895201] WARNING: CPU: 2 PID: 5947 at /home/garret/nano/ForCyril/nvidia_src/kernel/kernel-4.9/drivers/base/driver.c:191 driver_unregister+0x4c/0x58
[ 135.910356] ---[ end trace 3210391a2f93ce75 ]---
[ 135.921327] Unable to handle kernel read from unreadable memory at virtual address 00000000
[ 135.929925] Mem abort info:
[ 135.932801] ESR = 0x96000005
[ 135.935902] Exception class = DABT (current EL), IL = 32 bits
[ 135.941840] SET = 0, FnV = 0
[ 135.944907] EA = 0, S1PTW = 0
[ 135.948055] Data abort info:
[ 135.950945] ISV = 0, ISS = 0x00000005
[ 135.954788] CM = 0, WnR = 0
[ 135.957752] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc0f2b12000
[ 135.964434] [0000000000000000] *pgd=0000000000000000, *pud=0000000000000000
[ 135.971476] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 135.977038] Modules linked in: overlay zram bcmdhd_pcie(-) cfg80211 nvgpu bluedroid_pm ip_tables x_tables
[ 135.987001] CPU: 2 PID: 5947 Comm: rmmod Tainted: G W 4.9.140 #1
[ 135.994208] Hardware name: NVIDIA Jetson Nano Developer Kit (DT)
[ 136.000263] task: ffffffc0dfb82a00 task.stack: ffffffc0f0b9c000
[ 136.006290] PC is at pci_unregister_driver+0x3c/0xb0
[ 136.011371] LR is at pci_unregister_driver+0x34/0xb0
[ 136.016445] pc : [<ffffff80084e2fcc>] lr : [<ffffff80084e2fc4>] pstate: 00400145
[ 136.023948] sp : ffffffc0f0b9fde0
[ 136.027350] x29: ffffffc0f0b9fde0 x28: ffffffc0dfb82a00
[ 136.032853] x27: ffffff8008f72000 x26: 000000000000006a
[ 136.038350] x25: 0000000000000123 x24: 0000000000000015
[ 136.043839] x23: 00000000
We find “BCM4359 support” in Kconfig of “kernel/nvidia/drivers/net/wireless/bcmdhd_pcie/”.
Could bcmdhd_pcie.ko can support this card work? If yes, what should we do?
TX2 supports bcm4354 but it is on SDIO. According to the experience from TX2, you also need the wifi firmware released from broardcom to make this chip work.
Thanks for your reply, we have check with vendor that they give us a package source about bcmdhd, and firmware.
Then we find nvidia folder shows “BCM4359 support” in Kconfig of “kernel/nvidia/drivers/net/wireless/bcmdhd_pcie/”.
We boot the Nano, bcmdhd_pcie.ko is insmod automatic. And this bcmdhd_pcie.ko is compiling from “kernel/nvidia/drivers/net/wireless/bcmdhd_pcie/”.
We refer to the guide from vendor to update firmware path:
If bcmdhd driver is built in kernel image, you will need to configure firmware path.
# echo -n “/etc/firmware/fw_bcmdhd.bin” > /sys/module/bcmdhd/parameters/firmware_path
# echo -n “/etc/firmware/nvram.txt” > /sys/module/bcmdhd/parameters/nvram_path
We update the firmware and nvram path from the vendor, wlan0 still do not appera.
According to the vendor, they said “If bcmdhd driver is built in kernel image”, but what you are doing is not a built-in. You build bcmdhd_pcie as a loadable kernel module (.ko) file. Built-in means you need to set it to “=y” in defconfig instead of “=m” and the driver would be inside Image. Though I am not sure whether it is fatal on their driver.
Any other dmesg comes out from their driver after loading fw?
Actually, the bcmdhd_pcie and bcmdhd source code is greatly different from the official bcmdhd.100.10.545.x source code Ampak provided to us. I have thought that Nvidia add many your own code into bcmdhd_pcie and bcmdhd source code.
garret:~/kernel_source/kernel/nvidia/drivers/net/wireless$ ls
bcmdhd bcmdhd.100.10.545.x bcmdhd_pcie Kconfig Makefile realtek
(1) Could you tell me what the base function of bcmdh module and bcmdhd_pci module and what the difference between them?
(2) For our customized board, our BT/WIFI pins is defined and described as blow pic.
As for the Ampak 6398p, which source code should we focus on,bcmdhd_pcie or bcmdhd? I mean it seem a litter hard for us to locate the right position where the Pins function relative to Ampak 6398p in the source code. If you can give us more information about how to change that code snippet of the source code, that would be better. We will be very appreciated it.
Yes, I notice some changes in our driver code which differs with upstream kernel source. Actually, for jetson, only TX1/TX2 has on-module wifi which is SDIO based device. For SDIO based device, we use bcmdhd as it driver.
We don’t really have a existing platform that uses bcmdhd_pcie. Thus, if you have a latest driver from Ampak,
please use that instead of our bcmdhd_pcie.
If you could see your device in lspci list, then the pcie part is done and only need to worry about the driver as bcmd* drivers.
I have another question about your issue. Since your issue only happens when you “rmmod” this driver, does this wifi card work when you insmod this driver?
We are not sure about the pins connected to AMPAK 6398P match its driver. I mean, do we need to change something related to BT_REG_ON, WL_REG_ON and others in the bcmdhd_pcie driver cause we redefined some pins based on the official pinmux 1.01 which target at R32.2.x while we use it in the lastest version R32.3.1?
Please take a look at the log blow relative to bcmdhd_pcie drvier. The bcmdhd_pcie is auto-loaded when booting. But wlan0 can’t be detected.
How should we change the bcmdhd_pcie driver to make it match our customized carrier board?
The BT and WIFI relative pin mapping of our carrier board is as below pic.
If we use the driver from the vendor, where should we modify in the driver code?
For example, we found dhd_gpio.c need modify GPIO num for Wifi and BT, we use uart0 for bt, how to calculate GPIO num?
And do you think whether we need to modify device tree?