WiFi module fails on the Dragon Board 410c running Ubuntu


#1

Hello everyone,

I am new to the board69 community. I need to customize the kernel in dragon board 410c,
running Ubuntu, and I am having troubles with the WiFi module.

I initially burned the files from the board69 site:
- boot-linaro-vivid-qcom-snapdragon-arm64-20150930-102.img (boot + kernel)
- linaro-vivid-alip-qcom-snapdragon-arm64-20150930-102.img (rootfs)

Ubuntu release 15.09, kernel 4.2.0, WiFi driver wcn36xx.
The driver works, but when I burn the kernel and put my modules from the open-source it doesn’t work.
I used this link to get the kernel source code, and enabled the wcn36xx module in .config:

git clone -n http://git.linaro.org/landing-teams/working/qualcomm/kernel.git
cd kernel
git checkout -b kernel-15.09 ubuntu-qcom-dragonboard410c-15.09
export ARCH=arm64
export CROSS_COMPILE=<path to your GCC cross compiler>/aarch64-linux-gnu-
git cherry-pick -n e4df9dd88bb3b37d84db277e0f6a5d59cf5ac737
make defconfig distro.config
make -j4 Image dtbs KERNELRELEASE=4.2.0-linaro-lt-qcom

When I use modprobe, it enters the kernel, yet, no WiFi.

Can anyone please help ?


#2

hi,

I don’t understand what you mean by:


The driver works, but when I burn the kernel and put my modules from the open-source it doesn’t work.
I used this link to get the kernel source code, and enabled the wcn36xx module in .config:

Can you provide the detailed instructions/commands that you did? Esepecially any change you might have done to any source file or .config file.

Also, what does ‘it enters the kernel’ mean? Can you provide the output of these commands (before and after running modprobe): lsmod, dmesg.

thx


#3

You’re right, here are the details:

Basically when I wrote ‘enters the kernel’ I meant loads into the kernel, and I can see it using lsmod command. Right now I started everything form scratch, and the modules does not load into the kernel.

Here is what I did:

Downloaded the source code for the db410c with git clone (followed the link here http://builds.96boards.org/releases/dragonboard410c/linaro/ubuntu/latest/), and did a checkout to the kernel-15.09 branch.

This is the output from the git


alonh@server:~/kernel$ git checkout -b kernel-15.09 ubuntu-qcom-dragonboard410c-15.09
Checking out files: 100% (50930/50930), done.
Switched to a new branch &#039;kernel-15.09&#039;
alonh@server:~/kernel$ ls
arch     CREDITS        drivers   include  Kbuild   lib          mm      REPORTING-BUGS  security  usr
block    crypto         firmware  init     Kconfig  MAINTAINERS  net     samples         sound     virt
COPYING  Documentation  fs        ipc      kernel   Makefile     README  scripts         tools
alonh@server:~/kernel$ 

Then I build, kernel, device tree and modules:

make -j4 Image dtbs modules KERNELRELEASE=4.2.0-linaro-lt-qcom

This pass successfully, and Image & ko files are created.

I took the ko files:


alonh@server:~/kernel$ export INSTALL_MOD_PATH=&lt;some directory I chosed&gt;
alonh@server:~/kernel$ make modules_install 

Then I copied the <some directory I chosed> with the ko files to /lib/modules and /lib/firmware to an mmc card to be copied to file-system, and I created the boot-db410c.img with ./skales/mkbootimg, and burn it using fastboot. I also burned the rootfs using fastboot (here is the link http://builds.96boards.org/releases/dragonboard410c/linaro/debian/latest/linaro-jessie-developer-qcom-snapdragon-arm64*.img.gz)

When I load the system the result of lsmod is:

root@linaro-alip:~# lsmod
Module                  Size  Used by
root@linaro-alip:~# 

This is the error I get from modprobe command

root@linaro-alip:~# modprobe wcn36xx
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file &#039;/lib/modules/4.2.0-linaro-lt-qcom/modules.dep.bin&#039;
root@linaro-alip:~#

What am I missing ?


#4

Ok, I just made it loads into the kernel using insmod instead of modprobe, I can see depmod was required so I skipped the modprobe command.

It crashes, here is the output:

[ 2248.131675]  remoteproc0: request_firmware failed: -2

[ 2258.130060] timeout waiting for wcnss firmware ready indicator
[ 2258.146017] wcn36xx wcn36xx: Failed (-2) to read macaddressfile wlan/macaddr0, using a random address instead
root@linaro-alip:~# 
root@linaro-alip:~# 
root@linaro-alip:~# 
root@linaro-alip:~# 
root@linaro-alip:~# [ 2258.366148] wcn36xx: ERROR Failed to load nv file wlan/prima/WCNSS_qcom_wlan_nv.bin: -2
[ 2258.366171] wcn36xx: ERROR Failed to push NV to chip
[ 2268.402201] Error waiting for smd channel ready
[ 2268.402352] 
[ 2268.405561] ======================================================
[ 2268.407304] [ INFO: possible circular locking dependency detected ]
[ 2268.413302] 4.2.0-linaro-lt-qcom #1 Not tainted
[ 2268.419453] -------------------------------------------------------
[ 2268.423974] hciattach/1801 is trying to acquire lock:
[ 2268.430219]  (&amp;tty-&gt;legacy_mutex){+.+.+.}, at: [&lt;ffffffc0008de5f4&gt;] tty_lock+0x50/0xa8
[ 2268.439764] 
[ 2268.439764] but task is already holding lock:
[ 2268.443412]  (&amp;msm_smd_tty_info[idx].open_lock){+.+...}, at: [&lt;ffffffc000452220&gt;] smd_tty_port_activate+0x4c/0x114
[ 2268.454696] 
[ 2268.454696] which lock already depends on the new lock.
[ 2268.454696] 
[ 2268.459391] 
[ 2268.459391] the existing dependency chain (in reverse order) is:
[ 2268.467635] 
-&gt; #1 (&amp;msm_smd_tty_info[idx].open_lock){+.+...}:
[ 2268.480816]        [&lt;ffffffc0008d467c&gt;] check_prev_add+0x364/0x6c4
[ 2268.482906]        [&lt;ffffffc000102c6c&gt;] __lock_acquire+0x1610/0x1780
[ 2268.489070]        [&lt;ffffffc00010379c&gt;] lock_release+0x1b8/0x31c
[ 2268.495406]        [&lt;ffffffc0008dbb6c&gt;] __mutex_unlock_slowpath+0x98/0x19c
[ 2268.501397]        [&lt;ffffffc0008dbc78&gt;] mutex_unlock+0x8/0x14
[ 2268.508253]        [&lt;ffffffc00042d98c&gt;] tty_port_open+0xcc/0xd8
[ 2268.513982]        [&lt;ffffffc0004521c8&gt;] smd_tty_open+0x28/0x34
[ 2268.519885]        [&lt;ffffffc000425c98&gt;] tty_open+0xfc/0x594
[ 2268.525700]        [&lt;ffffffc0001d1560&gt;] chrdev_open+0x98/0x1a8
[ 2268.531256]        [&lt;ffffffc0001ca7f8&gt;] do_dentry_open+0x1b4/0x300
[ 2268.537073]        [&lt;ffffffc0001cbae0&gt;] vfs_open+0x5c/0x6c
[ 2268.543235]        [&lt;ffffffc0001dabf0&gt;] path_openat+0x348/0xe8c
[ 2268.548705]        [&lt;ffffffc0001dca40&gt;] do_filp_open+0x5c/0xd8
[ 2268.554607]        [&lt;ffffffc0001cbeac&gt;] do_sys_open+0x13c/0x224
[ 2268.560422]        [&lt;ffffffc0001cbfc4&gt;] SyS_openat+0xc/0x18
[ 2268.566325]        [&lt;ffffffc000085c6c&gt;] el0_svc_naked+0x20/0x28
[ 2268.571883] 
-&gt; #0 (&amp;tty-&gt;legacy_mutex){+.+.+.}:
[ 2268.580379]        [&lt;ffffffc0008d3de4&gt;] print_circular_bug+0x68/0x2ec
[ 2268.582473]        [&lt;ffffffc0008d445c&gt;] check_prev_add+0x144/0x6c4
[ 2268.588896]        [&lt;ffffffc000102c6c&gt;] __lock_acquire+0x1610/0x1780
[ 2268.595058]        [&lt;ffffffc0001035bc&gt;] lock_acquire+0x50/0x78
[ 2268.601395]        [&lt;ffffffc0008daa9c&gt;] mutex_lock_nested+0x54/0x3b8
[ 2268.607212]        [&lt;ffffffc0008de5f0&gt;] tty_lock+0x4c/0xa8
[ 2268.613547]        [&lt;ffffffc0004251c8&gt;] tty_release+0x6c/0x4dc
[ 2268.619016]        [&lt;ffffffc000425cb8&gt;] tty_open+0x11c/0x594
[ 2268.624832]        [&lt;ffffffc0001d1560&gt;] chrdev_open+0x98/0x1a8
[ 2268.630475]        [&lt;ffffffc0001ca7f8&gt;] do_dentry_open+0x1b4/0x300
[ 2268.636291]        [&lt;ffffffc0001cbae0&gt;] vfs_open+0x5c/0x6c
[ 2268.642452]        [&lt;ffffffc0001dabf0&gt;] path_openat+0x348/0xe8c
[ 2268.647922]        [&lt;ffffffc0001dca40&gt;] do_filp_open+0x5c/0xd8
[ 2268.653826]        [&lt;ffffffc0001cbeac&gt;] do_sys_open+0x13c/0x224
[ 2268.659641]        [&lt;ffffffc0001cbfc4&gt;] SyS_openat+0xc/0x18
[ 2268.665544]        [&lt;ffffffc000085c6c&gt;] el0_svc_naked+0x20/0x28
[ 2268.671102] 
[ 2268.671102] other info that might help us debug this:
[ 2268.671102] 
[ 2268.675104]  Possible unsafe locking scenario:
[ 2268.675104] 
[ 2268.682910]        CPU0                    CPU1
[ 2268.688811]        ----                    ----
[ 2268.693322]   lock(&amp;msm_smd_tty_info[idx].open_lock);
[ 2268.702517]                                lock(&amp;tty-&gt;legacy_mutex);
[ 2268.709026]                                lock(&amp;msm_smd_tty_info[idx].open_lock);
[ 2268.716404]   lock(&amp;tty-&gt;legacy_mutex);
[ 2268.720399] 
[ 2268.720399]  *** DEADLOCK ***
[ 2268.720399] 
[ 2268.720593] 1 lock held by hciattach/1801:
[ 2268.726483]  #0:  (&amp;msm_smd_tty_info[idx].open_lock){+.+...}, at: [&lt;ffffffc000452220&gt;] smd_tty_port_activate+0x4c/0x114
[ 2268.736726] 
[ 2268.736726] stack backtrace:
[ 2268.741432] CPU: 2 PID: 1801 Comm: hciattach Not tainted 4.2.0-linaro-lt-qcom #1
[ 2268.745850] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[ 2268.753314] Call trace:
[ 2268.760008] [&lt;ffffffc000089be0&gt;] dump_backtrace+0x0/0x15c
[ 2268.762181] [&lt;ffffffc000089d4c&gt;] show_stack+0x10/0x1c
[ 2268.767737] [&lt;ffffffc0008d5950&gt;] dump_stack+0x84/0xc8
[ 2268.772772] [&lt;ffffffc0008d4048&gt;] print_circular_bug+0x2cc/0x2ec
[ 2268.777806] [&lt;ffffffc0008d445c&gt;] check_prev_add+0x144/0x6c4
[ 2268.783537] [&lt;ffffffc000102c6c&gt;] __lock_acquire+0x1610/0x1780
[ 2268.789093] [&lt;ffffffc0001035bc&gt;] lock_acquire+0x50/0x78
[ 2268.794995] [&lt;ffffffc0008daa9c&gt;] mutex_lock_nested+0x54/0x3b8
[ 2268.800024] [&lt;ffffffc0008de5f0&gt;] tty_lock+0x4c/0xa8
[ 2268.805928] [&lt;ffffffc0004251c8&gt;] tty_release+0x6c/0x4dc
[ 2268.810616] [&lt;ffffffc000425cb8&gt;] tty_open+0x11c/0x594
[ 2268.815826] [&lt;ffffffc0001d1560&gt;] chrdev_open+0x98/0x1a8
[ 2268.821036] [&lt;ffffffc0001ca7f8&gt;] do_dentry_open+0x1b4/0x300
[ 2268.826064] [&lt;ffffffc0001cbae0&gt;] vfs_open+0x5c/0x6c
[ 2268.831621] [&lt;ffffffc0001dabf0&gt;] path_openat+0x348/0xe8c
[ 2268.836484] [&lt;ffffffc0001dca40&gt;] do_filp_open+0x5c/0xd8
[ 2268.842036] [&lt;ffffffc0001cbeac&gt;] do_sys_open+0x13c/0x224
[ 2268.846985] [&lt;ffffffc0001cbfc4&gt;] SyS_openat+0xc/0x18


#5

OK, I found the problem.

The firmware was missing.

When I built-ed the modules and image, and installed the modules to an external directory, I had a firmware directory, but the files that were relevant to the wireless were not there.

I changed to the old firmware, and it worked …

How come that the firmware were missing from the build directory ? How do I create a firmware file ?


#6

hi,

the firmware are provided separately. You need to acquire them here:

https://developer.qualcomm.com/hardware/dragonboard-410c/tools

Search for “Linux Board support package”. The firmware are included in the image you download from 96baords, though.