I’m using the Colibri iMX6ULL module with the evaluation board and currently working with the Toradex Reference Multimedia Image. My goal is to build a similar kernel image using the mainline kernel source, while still leveraging the Yocto build system, BSP, and device tree resources provided by Toradex. I’m looking for guides or articles that explain how to integrate the mainline kernel into the Toradex Yocto setup, and what the minimum required changes are to the device tree, kernel configuration, and Yocto recipes to make this work. Any pointers to relevant documentation or examples would be greatly appreciated,also I’m exploring whether it’s possible to apply mainline kernel patches to the Toradex Reference Yocto build for the Colibri iMX6ULL. I’d like to understand which approach is better: integrating the full mainline kernel into the Yocto build or selectively applying patches to the existing Toradex kernel. I’m also trying to figure out which files need to be modified to support this, especially in terms of kernel recipes, device tree, and configuration. I’m new to this process, so any guidance or suggestions would be really helpful. Thanks!
Hi, I’m the Toradex AI Assistant.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Hello! Thank you for your detailed questions about integrating the mainline kernel with your Colibri iMX6ULL in the Toradex Yocto environment. Here’s a clear step-by-step guide and comparison of the two approaches you asked about:
Approach 1: Using Toradex Upstream/Mainline Kernel Integration
Toradex provides upstream (mainline) kernel support, streamlining your integration. This is typically the recommended approach if your goal is to track closer to mainline Linux while keeping Yocto and Toradex BSP resources.
Steps:
-
Choose the Upstream Distro Variant:
In your Yocto build’sconf/local.confset the distribution to use the upstream kernel variant:DISTRO = "tdx-xwayland-upstream"This ensures your build uses the mainline kernel with open-source userspace drivers.
More on upstream/distros -
Set Your Target Machine:
MACHINE ?= "colibri-imx6ull" -
Customize Device Tree and Kernel Configuration (if needed):
- Create Your Own Meta Layer (recommended):
bitbake-layers create-layer ../layers/meta-yourlayer - Add kernel recipe bbappend:
Createrecipes-kernel/linux/linux-toradex/linux-toradex_%.bbappendin your layer. - Device Tree/custom patches:
Add device tree sources and kernel patches here:
And copy device tree in aFILESEXTRAPATHS:prepend := "${THISDIR}/linux-toradex:" SRC_URI += "file://my-custom-devicetree.dts \ file://my-kernel-patch.patch \ file://defconfig"do_configure:append()function if needed. - Full example on kernel customization
- Create Your Own Meta Layer (recommended):
-
Build the Image:
- Example:
bitbake tdx-reference-multimedia-image
- Example:
Advantages:
- Maintains compatibility with Toradex’s BSP/tools.
- Eases access to updated upstream support.
- Required changes limited to your Yocto layer for patches, device tree, and config.
- Official Toradex Yocto kernel build reference
Approach 2: Patching the Toradex BSP Kernel
Alternatively, you can patch the existing Toradex-supplied kernel (linux-toradex) with selected mainline patches you need.
Steps:
- Also use a custom Yocto meta-layer and bbappend as above.
- Apply desired mainline patches by adding them to your layer’s
SRC_URI. - You may use custom device tree or defconfig in the same manner as above.
Advantages:
- Ensures maximum compatibility with the supplied reference image and BSP.
- More work if you want to move closer to mainline, as you’ll need to keep patching regularly.
Which to Choose?
- For mainline features and easier maintenance, approach 1 (upstream variant) is simpler and cleaner.
- For minimal disruption with only a few mainline patches, use approach 2 (patch existing kernel).
What needs changing in both approaches?
- Yocto Recipes:
- Custom layer with
linux-toradex_%.bbappend
- Custom layer with
- Device Tree Files:
- Add in your
recipes-kernel/linux/linux-toradex/directory
- Add in your
- Kernel Config:
- Provide a custom
defconfigif needed.
- Provide a custom
- Patch Files:
- Add patches to your SRC_URI and ensure correct application order.
References & Examples
If you have further questions or need concrete examples for a particular step, feel free to ask!
Best regards,
Toradex AI Assistant.
Hi @vi007 ,
Was the above answer from ToradexAI helpful?