I’m trying to build a custom Yocto image for the balenaFin, without the rest of balenaOS. I am trying to get the WiFi working, and I see that I need the proprietary driver. I found the recipe at meta-balena-raspberrypi/recipes-kernel/sd8887-mrvl but the binary version won’t load due to version mismatch, and the source recipe refers to the repo at github.com/balena-io/sd8887-mrvl.git which doesn’t seem to exist. How can I build the module?
root@fincm3:~# dmesg | grep -E "sd8|wl|ml"
[ 7.612825] mlan: disagrees about version of symbol module_layout
[ 15.965080] mlan: disagrees about version of symbol module_layout
Hi. I updated the prebuilts for matching the latest kernel we have for the balena fin. This is the PR https://github.com/balena-os/balena-raspberrypi/pull/536
At the time we chose this wifi chipset, mwifiex was not working. So we compiled the proprietary driver that the vendor made available for us.
Are you sure raspbian is at 4.19.75? Last time we checked it was 4.19.118, and that’s what we have at this moment too.
So I have added a bbappend to build that kernel version:
root@fincm3:~# uname -a
Linux fincm3 4.19.118 #1 SMP Thu Sep 17 07:05:25 UTC 2020 armv7l GNU/Linux
But it didn’t help:
root@fincm3:~# dmesg | grep -E 'ml'
[ 7.639686] mlan: disagrees about version of symbol module_layout
I can’t use the recipe from meta-balena-raspberry-pi because that inherits kernel-resin from meta-balena layer which then creates all the other dependencies that I am trying to avoid here.
I also copied sd8887-mrvl-prebuilt.bb from meta-balena-raspberrypi into my layer. meta-balena-raspberrypi is at 16c19486a1279a9677888bd920920a87596d74b9 which includes your updated binaries
root@fincm3:~# zcat /proc/config.gz | grep -E 'PWRSEQ_SD8787'
CONFIG_PWRSEQ_SD8787=y
root@fincm3:~# modprobe sd8xxx
modprobe: ERROR: could not insert 'bt8xxx': Exec format error
modprobe: ERROR: could not insert 'mlan': Exec format error
modprobe: ERROR: could not insert 'sd8xxx': Operation not permitted
root@fincm3:~# dmesg | tail
[58918.323880] bt8xxx: disagrees about version of symbol module_layout
[58923.343636] mlan: disagrees about version of symbol module_layout
Hi Paul,
I’d like ask if you managed to follow my collegue’s suggestion to set up CONFIG_PWRSEQ_SD8787=y in your kernel config. You mention you did not have that set.
You do need some extra instructions regarding that?
Hi @georgiats , see my previous comment. I have now set it, but it didn’t fix the issue. maybe it wasn’t clear, those commands are what I run on my latest image, to prove that its really set! Also, the patch 0004-mmc-pwrseq-Repurpose-for-Marvell-SD8777.patch must be applied correctly as otherwise it would have built that as a module.
Hi Paul, as you probably know the modules need to be built against exactly the same kernel they are to be loaded to. Those error messages point to this not being the case. Some possible reason for this is Yocto building the kernel but using a cached version of the target image that do not include the new modules.
Could you paste the output of modinfo run against both one of the modules already loaded in the kernel (check lsmod) and then the failing modules?
Yes I understand that, and I assume there is some other patch or config option that is causing the difference between the kernel I build and what the module is expecting. The kernel in the image is correct, as it did build in pwrseq_sd8787 whereas without the patch I mentioned it would build as a module.
modinfo output as requested:
root@fincm3:~# modinfo cfg80211
filename: /lib/modules/4.19.118/kernel/net/wireless/cfg80211.ko
alias: net-pf-16-proto-16-family-nl80211
description: wireless configuration support
license: GPL
author: Johannes Berg
srcversion: 1461DB02C03AB8A9F6E50DF
depends: rfkill
intree: Y
name: cfg80211
vermagic: 4.19.118 SMP mod_unload modversions ARMv7 p2v8
parm: bss_entries_limit:limit to number of scan BSS entries (per wiphy, default 1000) (int)
parm: ieee80211_regdom:IEEE 802.11 regulatory domain code (charp)
parm: cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band (bool)
root@fincm3:~# modinfo mlan
filename: /lib/modules/4.19.118/kernel/net/wireless/mlan.ko
license: Marvell Proprietary
version: C651
author: Marvell International Ltd.
description: M-WLAN MLAN Driver
srcversion: 1E9C8967EEEB4A865A2342B
depends:
name: mlan
vermagic: 4.19.118 SMP mod_unload modversions ARMv7 p2v8
Hi Paul, could you share the whole device repository with your modifications so we can built and reproduce this ourselves? At this point that’s the only way we could help any further.