including firmware sdma-imx6q.bin


Angelo Dureghello <angelo@...>
 

Hi all,

already had this issue more than one time, and solved
in a way or another, but trying to figure out the most
correct way to do this.

This sdma firmware file on recent kernel > (4.14) could
be needed, generally to be (even if not always) built-in.
I need the kernel build to work both from yocto and
from standalone source tree.

Actually used below solutions:

1) yocto side, in kernel recipe/bbappend i copy the
firmware blob into the kernel source path, in
do_compile_prepend(), by:

defconfig

+CONFIG_EXTRA_FIRMWARE="imx/sdma/sdma-imx6q.bin"
+CONFIG_EXTRA_FIRMWARE_DIR="firmware"

kernel bbappend

+DEPENDS += " \
+ firmware-imx \
+"
...
+do_compile_prepend() {
+ ## fetch the firmware blob
+ rm -rf ${S}/firmware
+ mkdir ${S}/firmware
+ cp -arv ${TMPDIR}/sysroots-components/all/firmware-imx/lib/firmware/imx ${S}/firmware/
+}

This works, but if i build the kernel out of yocto, have to
add separately the fw blob in the /firmware path.

2) i include the blob hex in the kernel tree, and modify
makefile, so it get translated to bin, and included.


Looks like there must me more proper solutions, if
any hint, welcome.

Thanks a lot.
--
Angelo Dureghello
+E: angelo AT kernel-space.org