sd8887-mrvl repo gone

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, thanks for the report. We will build it and update the repo

thanks. my image is based on the cm3 and the kernel is newer than the one for raspbian:

root@fincm3:~# uname -a
Linux fincm3 4.19.75 #1 SMP Thu Sep 10 14:44:40 UTC 2020 armv7l GNU/Linux

I did get the open source mwifiex driver working, can you tell me why I should choose the proprietary driver over the in-kernel one?

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.

Raspbian image (lite version) seems to be

uname -a
Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux

But I have built a custom Yocto image, excluding the balena layer. My machine config has:

MACHINEOVERRIDES = "raspberrypi3:${MACHINE}"
include conf/machine/raspberrypi-cm3.conf

RPI_EXTRA_CONFIG="dtoverlay=balena-fin"

KERNEL_DEVICETREE_append_fincm3 = " overlays/balena-fin.dtbo"

and this pulls in kernel 4.19.75

If you excluded the balena image then you should at least match the kernel version we currently have in master. So use https://github.com/balena-os/balena-raspberrypi/blob/master/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend

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.

Which revision of balena-raspberrypi did you build?

I am not including meta-balena-raspberrypi layer. I can’t build that recipe because it depends on kernel-resin from meta-balena/meta-balena-common

I copied some parts from linux-raspberrypi_4.19.bbappend into my own layer:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI_append_fincm3 = " \
	file://0004-mmc-pwrseq-Repurpose-for-Marvell-SD8777.patch \
	file://0005-balena-fin-wifi-sta-uap-mode.patch \
"

SRC_URI_append = " \
	file://0002-wireless-wext-Bring-back-ndo_do_ioctl-fallback.patch \
"

LINUX_VERSION = "4.19.118"
SRCREV = "fe2c7bf4cad4641dfb6f12712755515ab15815ca"

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

I’m trying to do what I think @mvargasevans was doing in this thread: Connect to wifi and this one: BalenaFin Yocto Layer

Unfortunately there was no follow up on whether they managed to get it working.

Hi, can you also make sure you have CONFIG_PWRSEQ_SD8787=y in your kernel config?

Hi,

I did not have that set. Updated and recompiled but still not working. I carried these three patches over from your recipe:

  • 0002-wireless-wext-Bring-back-ndo_do_ioctl-fallback.patch
  • 0004-mmc-pwrseq-Repurpose-for-Marvell-SD8777.patch
  • 0005-balena-fin-wifi-sta-uap-mode.patch
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, can you share the generated .config you get when you compiled your kernel?

Here is the config, from running kernel: https://drive.google.com/file/d/19lPUsZBcbXgQQNQzXdnFXdpIItlKFHTF/view?usp=sharing

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.

I can work on that. I’ll have to remove some proprietary stuff, and then check I still get the same result.