Modify default U-Boot device tree on iMX8X


I have a Colibri iMX8QXP module and I’ve built a custom device tree for making it compatible with the Focaltech FT5426 touch driver. The problem is that even after setting up all the variables referencing the evaluation board DTB (imx8qxp-colibri-eval-v3.dtb) the default device tree loaded by U-Boot remains the same.

The variables I changed are located in a file called colibri-imx8x-extra.conf that’s included in local.conf:

TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT_remove = " colibri-imx8x_ad7879_overlay.dtbo display-vga_overlay.dtbo "
TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT_append = " colibri-imx8x_atmel-mxt-adapter_overlay.dtbo display-lt161010_overlay.dtbo "

TORADEX_PRODUCT_IDS = "0038 0050 0051 0052"
TORADEX_PRODUCT_IDS[0038] = "imx8qxp-colibri-bcn3d.dtb"
TORADEX_PRODUCT_IDS[0050] = "imx8qxp-colibri-bcn3d.dtb"
TORADEX_PRODUCT_IDS[0051] = "imx8qxp-colibri-bcn3d.dtb"
TORADEX_PRODUCT_IDS[0052] = "imx8qxp-colibri-bcn3d.dtb"

KERNEL_DEVICETREE_append = " freescale/imx8qxp-colibri-bcn3d.dtb"
KERNEL_DEVICETREE_use-mainline-bsp_remove = " freescale/imx8qxp-colibri-eval-v3.dtb "
KERNEL_DEVICETREE_use-mainline-bsp_append = " freescale/imx8qxp-colibri-bcn3d.dtb "

I’ve noticed that in the include/configs/colibri-imx8x.h header file of u-boot-toradex there’s a hardcoded string in the CONFIG_EXTRA_ENV_SETTINGS that specifies the value of fdt_board to eval-v3.
Changing that to bcn3d like the name of the device tree in fact works as the fdtfile string is built dynamically based on the value of this variable.

Is there a better way to handle this without patching that hardcoded string?


Dear @miervasi,

Thanks for joining our community :rocket: ! Please feel free to roam around, exploring topics and asking for help whenever you may need it.

About your point, did you have the time to check the following article: Custom meta layers, recipes and images in Yocto Project (hello-world examples) | Toradex Developer Center ? It has an example on how to define a custom device-tree as the default one using Yocto.

Can you please test the routine described there and check if this would solve your issue?

Best regards,

Hi @gclaudino.tx, thank you for answering.

Yes I indeed checked out that link before and it does the same thing (patching a #define). I guess that’s the way it is intended to be.

It’s not really a big issue, the only thing that bothers me is that every time I want to install an image with Toradex Easy Installer I have to first override the fdt_board environment variable otherwise it won’t boot TEI.
For TEI I’m using an official carrier board, the Viola Plus 1.2, with TEI booting from the SD card. I know it’s not the best way to run TEI but the carrier board doesn’t have OTG.

Best regards

Hi @miervasi,

Thanks for the update. You may also want to check the auto installation capabilities of Toradex Easy Installer (TEZI): Detailed Manual | Toradex Developer Center. With them, you can set the autoinstall property to true on the image.json file for your image and then you can flash your module even without OTG or a screen connected.

Then, when your image is installed, it will have the right device tree already. Would this be a solution for you?

Best regards,