Hi everyone,
I'm working on a custom board bringup based around the imx8 platform. It has both compiled-in drivers via the kernel config, and (customized) module drivers brought in via the OpenWRT feeds/packages.
Some of these drivers come with either proprietary firmware blobs that must be loaded with the driver, or configuration, or both.
Essentially, I see messages like:
dmesg | grep "Direct firmware load"
[ 0.169313] imx-sdma 30bd0000.dma-controller: Direct firmware load for imx/sdma/sdma-imx7d.bin failed with error -2
[ 2.013882] imx-sdma 30e10000.dma-controller: Direct firmware load for imx/sdma/sdma-imx7d.bin failed with error -2
[ 2.795837] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 12.887438] wlan_sdio mmc1:0001:1: Direct firmware load for nxp/sduart_nw61x_v1.bin failed with error -2
At the end of the day - I'm looking for those error messages to go away and for the driver load to be successful and in a timely manner.
The DMA driver seems like the most important to get in there as early as possible.
As for WiFi - I'd like for that adapter to be available as soon as possible as well. That one (nxp/sduart_nw61x_v1.bin
) requires a corresponding config file to be passed as a modprobe/insmod parameter.
All of the drivers and config files are already located in my rootfs /lib/firmware
directory at the correct places. If I enable the firmware fallback via FW_LOADER_USER_HELPER
and FW_LOADER_USER_HELPER_FALLBACK
some of these files (specifically the sdma-imx7d.bin
file gets loaded eventually, but it's really late into the boot process. (i.e. after init when shell is available).
My research has turned up the following possible solutions:
- Compile the firmware blobs into the kernel image using
CONFIG_EXTRA_FIRMWARE
option. This seems to be "easiest", but comes with some downsides. I think licensing can be an issue if it's proprietary FW, doesn't help me (I don't think) if the driver is a module, and lastly I don't think it solves my blob+config problem. - Use
initramfs
. This seems to be the way that Linux generally wants you to solve this sort of problem. I do see some mechanisms and hooks for initramfs in the OpenWRT build system, but it's not clear to me how best to use it. I don't want to have my entire root filesystem contents in it - just the drivers, configs, and the minimum to get switched over to the true rootfs. - Possibly use a FIT image? Looks like you can specify extra files and such in the image format and make it available to some drivers.. but I'm not sure if that would really work for all of my needs.
My questions are:
- Does the OpenWRT build system have a "preferred" way of handling driver fw blobs?
- Is initramfs the way to go? If so, are there any guides or guidance on how to hook that into the build system?
- Or am I completely missing something and there's some other easy way to accomplish what I'm trying to do here?
Please let me know if there's any additional information that would be useful.
Thanks for your help.