Change value fdtfile in yocto project

Hi,

i am building a yocto image for verdin imx8mp 2G SoM and carrier board mallow. This is the info regarding my system:

Software summary

Bootloader: U-Boot

Kernel version: 6.6.101-7.4.0 #1 SMP PREEMPT Thu Sep 25 07:49:28 UTC 2025
Kernel command line: root=PARTUUID=12b3663b-02 ro rootwait console=tty1 console=ttymxc2,115200
Distro name: NAME=“TDX Wayland with XWayland”
Distro version: VERSION_ID=7.4.0-build.10
Distro variant: -
Hostname: verdin-imx8mp-15603379

Hardware info

HW model: Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version: 0064 V1.1A
Serial number: 15603379
Processor arch: aarch64

I have a question about this variable. In this moment i see the follow value for the ftdfile is: fdtfile=imx8mp-verdin-wifi-dev.dtb. I created the image with toradex yocto (no torizon). Is it possible in the toradex yocto project to change the value of this variable from imx8mp-verdin-wifi-dev.dtb to imx8mp-verdin-wifi-mallow.dtb ? And if it is possible, what do I need to do?

Thanks for the help.

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.


Hello Fabio,

Yes, it is possible to change the fdtfile variable in your Yocto build to use the Mallow carrier board device tree. Let me explain how this works and what you need to do.

Understanding the fdtfile Variable

The fdtfile variable specifies the device tree binary (DTB) file that U-Boot loads during the boot process(1). Currently, your system is using imx8mp-verdin-wifi-dev.dtb which corresponds to the Development Board, but you want to use imx8mp-verdin-wifi-mallow.dtb for the Mallow carrier board(1).

How Device Tree Selection Works

U-Boot uses the fdt_board and variant variables to automatically determine the fdtfile during the preboot step(2). For Verdin iMX8M Plus, the preboot configuration follows this pattern:

CONFIG_PREBOOT="test -n ${fdtfile} || setenv fdtfile imx8mp-verdin-${variant}-${fdt_board}.dtb"

(2)

Methods to Change the Device Tree

Method 1: Set fdtfile Directly in Yocto

You can modify the U-Boot environment in your Yocto build to set the fdtfile variable directly. This involves customizing the U-Boot configuration to use the Mallow device tree by default.

Method 2: Set fdt_board Variable

Alternatively, you can set the fdt_board variable to mallow in your Yocto build(2). The fdt_board variable identifies the carrier board to select the appropriate DTB(1).

Implementation in Yocto

For your Yocto build, you’ll need to:

  1. Customize the U-Boot Environment: Create a U-Boot environment customization that sets either:

    • fdtfile=imx8mp-verdin-wifi-mallow.dtb directly, or
    • fdt_board=mallow to let the preboot script generate the correct filename
  2. Ensure the Device Tree is Available: Make sure the imx8mp-verdin-wifi-mallow.dtb file is included in your build and available on the boot partition(3).

The device tree customization process in Yocto typically involves modifying kernel recipes to include the appropriate device tree files and configuring the bootloader environment(3).

Verification

After implementing the changes, you can verify the configuration by checking the U-Boot environment variables. The system should show:

  • fdt_board=mallow
  • fdtfile=imx8mp-verdin-wifi-mallow.dtb

This will ensure your Verdin iMX8M Plus uses the correct device tree for the Mallow carrier board instead of the Development Board.

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 @ToradexAI for the reply. Could you please explain how to configure fdt_board using Method 2?

Thanks

Fabio

Hi Fabio,

I’ll explain how to configure the fdt_board variable using Method 2 in your Yocto build.

Understanding the fdt_board Variable

The fdt_board variable identifies the carrier board to select the appropriate DTB (1). For Verdin iMX8M Plus, the default environment sets fdt_board=dev (2), which corresponds to the Development Board.

Configuring fdt_board in Yocto

To change the fdt_board variable to use the Mallow carrier board, you need to modify the U-Boot configuration in your Yocto build. Here’s how to do it:

Step 1: Create a U-Boot Recipe Append

Create a U-Boot bbappend file in your custom meta layer. The structure should be:

recipes-bsp/u-boot/u-boot-toradex_%.bbappend

Step 2: Create the Configuration Patch

You need to modify the board-specific U-Boot configuration file. For Verdin iMX8M Plus, this is typically include/configs/verdin-imx8mp.h (2).

Create a patch file that changes the default fdt_board value from dev to mallow. The patch should modify the CONFIG_EXTRA_ENV_SETTINGS section where the default environment variables are defined (2).

Step 3: Apply the Patch in Your bbappend

In your u-boot-toradex_%.bbappend file, add:

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

SRC_URI_append = " \
    file://0001-change-fdt-board-to-mallow.patch \
"

Step 4: Ensure Device Tree Availability

Make sure the imx8mp-verdin-wifi-mallow.dtb file is available in your kernel build. You may need to add it to your kernel configuration if it’s not already included.

Example Implementation

Based on the documentation pattern (3), your patch should modify the U-Boot environment to set:

"fdt_board=mallow\0" \

This will cause the preboot script to automatically generate fdtfile=imx8mp-verdin-wifi-mallow.dtb during boot.

Verification

After rebuilding and flashing your image, you can verify the configuration by checking the U-Boot environment variables (1):

  • fdt_board should show mallow
  • fdtfile should show imx8mp-verdin-wifi-mallow.dtb

This approach leverages U-Boot’s automatic device tree selection mechanism, making it a clean solution for carrier board-specific configurations.

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.

Hello @fmolon,

The solution would be similar to the one described by the AI, but you need to edit the .env file for your particular board.
See the example below for the Verdin iMX95:

diff --git a/board/toradex/verdin-imx95/verdin-imx95.env b/board/toradex/verdin-imx95/verdin-imx95.env
index 002d23b8146..83af59be273 100644
--- a/board/toradex/verdin-imx95/verdin-imx95.env
+++ b/board/toradex/verdin-imx95/verdin-imx95.env
@@ -2,7 +2,7 @@ boot_scripts=boot.scr
 boot_script_dhcp=boot.scr
 boot_targets=mmc1 mmc0 dhcp
 console=ttyLP2
-fdt_board=dev
+fdt_board=mallow
 fdt_addr=0x9c400000
 fdt_addr_r=0x9c400000
 kernel_addr_r=CONFIG_SYS_LOAD_ADDR

Best Regards,
Bruno

Thanks @bruno.tx for your help.

1 Like