Compile kernel from source code

Hi,

for my project i have to compile the kernel from source code. I follow this guide: Build Linux Kernel from Source Code | Toradex Developer Center, but i have a few question about it. I am working with som verdin imx8mp with wifi and carrier board mallow. I cloned the kernel source code from here: git://git.toradex.com/linux-toradex.git (branch toradex_6.6-2.2.x-im). My questions are:

  1. What kernel configuration should i load for my system and where can i find it?

  2. What dts file should i use for my system?

Thanks for the help :slightly_smiling_face: .

Fabio

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Hi Fabio,

Great questions about building the kernel for your Verdin iMX8MP with Wi-Fi and Mallow carrier board setup! Let me address both of your questions:

1. Kernel Configuration

For your kernel configuration, you need to download the kernel-config file from the Toradex Artifacts repository(1). Here’s how to find it:

  1. Go to the Toradex Artifact Repository Browser(1)
  2. Navigate to the path following this structure(1):
tdxref-oe-prod-frankfurt  
└── <yocto-branch>  
    └── release  
        └── <build-number>  
            └── <SoM>  
                └── <distro>  
                    └── <image>  
                        └── oedeploy  
                            └── kernel-config

For your Verdin iMX8MP system, the directories would be something like:

  • <yocto-branch>: scarthgap-7.x.y (for BSP 7)
  • <SoM>: verdin-imx8mp
  • <distro>: tdx-xwayland (or your chosen distro)
  • <image>: tdx-reference-multimedia-image (or your chosen image)

Once you have the kernel-config file, copy it to your kernel source directory and rename it(1):

$ cp kernel-config ~/linux-toradex && cd ~/linux-toradex   
$ mv kernel-config .config   
$ make olddefconfig

2. Device Tree Selection

For the Verdin iMX8MP with Wi-Fi on the Mallow carrier board, you should look in the device tree directory for 64-bit modules(2):

  • Directory: /arch/arm64/boot/dts/freescale/(2)

For your specific configuration (Verdin iMX8MP with Wi-Fi + Mallow), you’ll likely need a device tree like:

  • imx8mp-verdin-wifi-mallow.dts (or similar naming convention)

You can explore the available device trees in the /arch/arm64/boot/dts/freescale/ directory(2) to find the exact match for your Verdin iMX8MP Wi-Fi variant with Mallow carrier board.

To compile the device tree, use(3):

$ make DTC_FLAGS="-@" freescale/<device-tree>.dtb  
$ ls ./arch/arm64/boot/dts/freescale/<device-tree>.dtb

Additional Notes

Since you’re using the downstream kernel from git://git.toradex.com/linux-toradex.git with branch toradex_6.6-2.2.x-imx, this is the correct approach for the Verdin iMX8MP(1). The Mallow carrier board is compatible with various Verdin modules including the Verdin iMX8M Plus(4).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the β€œSolution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Thanks for the answer. Another question regarding kernel configuration. Inside the tdxref-oe-prod-frankfurt β†’ scarthgap-7.x.y β†’ release β†’ , i see 5 builder number: 1,3,5,8 and 10. Which distro number i should chose? Thanks.

Fabio

Hey @fmolon,

This is the build number. Each of our images has a version and a correspondent build number as you can see in the tables of our Download Links page. You could look into the image you installed in your system (for which you want to substitute the kernel for your custom one) and see what number appears after build in it’s name. For example, the torizon-docker-verdin-imx8mp-Tezi_7.4.0+build.28 image has build number 28, so you should choose the 28 one for maximum compatibility.

Generally, though, you should be fine using the config for the latest image (the one with the higher build number).

Best regards,

Thanks @leonardo.costa.tx for the explanation.

Best regards.

Fabio

1 Like