No Wifi after custom Debian build

Hi,
I followed https://wiki.radxa.com/Rockpi4/dev/Debian to build a Debian-based system image including u-boot, kernel and rootfs. So far everything worked out but after booting the RockPi4b-v1.4 into Openbox I don’t see any Wifi device.
ifconfig -a only shows the loopback device lo and eth0. I used the kernel compile script mk-kernel.sh and double checked that make rockchip_linux_defconfig is run. I however did not run make menuconfig afterwards since I’m building in a non-interactive Docker environment. Might that be the source of the problem?

According to uname -a I’m running:
Linux linaro-alip 4.4.154-00037-gdb9dfc2cdd25-dirty #1 SMP Fri Jul 16 15:23:07 UTC 2021 aarch64 GNU/Linux.

Please let me know, if you need any further information to diagnose the problem!

Thanks!

I investigated a bit further: The problem does not seem to be kernel config related. I booted the official Debian Buster Desktop (xfce4) image and wifi works.

(rockpi) $ uname -a
Linux rockpi4b 4.4.154-111-rockchip-g39b306a41b2d #1 SMP Wed Jul 8 15:03:52 UTC 2020 aarch64 GNU/Linux

I then checked the kernel config using /proc/config.gz:

(rockpi) $ cat /proc/config.gz | gunzip | md5sum
88df238bdc2d6551bc4255ba41f96297  -

Which is the same as in my build environment on the host:

(host) $ md5sum rockchip-bsp/kernel/.config
88df238bdc2d6551bc4255ba41f96297  rockchip-bsp/kernel/.config

What else could possibly have gone wrong during the custom image build?

PS: I can’t find kernel revision 39b306a41b2d from the official Debian image in the radxa/kernel github repo. I wanted to diff it against rev db9dfc2cdd25 of the release-4.4-rockpi4 branch. Any pointers where to find it?

Digging deeper I found this post documenting that for custom kernels the firmware is located in /lib/firmware/ but the kernel needs the firmware files to be placed in /system/etc/firmware/. However this is not the case on my system. fw_bcm43456c5_ag.bin and nvram_ap6256.txt are both there. Though, clm_bcmdhd.blob does not exist on my system. I checked syslog for any firmware related errors but found nothing:

$ dmesg | grep firmware
[    0.000000] psci: PSCIv1.0 detected in firmware.
$ lsmod
Module          Size  Used by
$

There aren’t any kernel modules loaded as well, which seems suspicious.

Switching to the system image with working wifi I get the following:

$ dmesg | grep firmware
[...] psci: PSCIv1.0 detected in firmware.
[...] dhd_conf_read_config: Ignore config file /system/etc/firmware/config.txt
[...] Final fw_path=/system/etc/firmware/fw_bcm43456c5_ag.bin
[...] Final nv_path=/system/etc/firmware/nvram_ap6256.txt
[...] Final clm_path=/system/etc/firmware/clm_bcmdhd.blob
[...] Final conf_path=/system/etc/firmware/config.txt
[...] dhd_os_open_image: /system/etc/firmware/fw_bcm43456c5_ag.bin (585884 bytes) open success
[...] dhd_os_open_image: /system/etc/firmware/nvram_ap6256.txt (2099 bytes) open success
[...] dhd_apply_default_clm: Ignore clm file /system/etc/firmware/clm_bcmdhd.blob
$ lsmod
Module         Size  Used by
bcmdhd      1183744  0
binfmt_misc   20480  1
autofs4       40960  3

Firmware is found and the appropriate kernel modules get loaded.

Searching for bcmdhd.ko on the system running my self-built image does not yield any results. Seems that I’m missing the driver kernel module, right?! Where do I get it from? It’s also suspicious that during boot the system does not even attempt to load any wifi related firmware. :thinking:

Any pointers on how I may proceed are very appreciated!

In mk-rootfs-buster.sh there’s this one line that copies the wifi kernel modules from the kernel build into the rootfs:

sudo find ../kernel/drivers/net/wireless/rockchip_wlan/*  -name "*.ko" | \
    xargs -n1 -i sudo cp {} $TARGET_ROOTFS_DIR/system/lib/modules/

However I did checkout rockchip-bsp and rk-rootfs-build side-by-side. So the path had to be adapted accordingly.

Now wifi works as expected. :+1:

2 Likes