How to use a custom u-boot-toradex device tree

Hi,

I am trying to figure out how to replace the default u-boot device tree for a verdin imx8mp SoM.
My custom image is based on the tdx-reference-minimal-image on the latest Scarthgap branch.

From my build logs I can see that this seems to be using the “origin/master” branch of the toradex u-bott-toradex git repo (I was expecting this to be the imx 2024.04 branch).

The main reason for this is so I can remove the ctrl-sleep-moci-hog from gpio4, and both the EEPROM definitions from i2c4.
This is required as my custom carrier board uses that GPIO for another peripheral (which cannot be changed) and the EEPROMs do not exist on our boards.

Originally I added a copy of the verdin dev wifi dtsi and dts (similar to how I would for linux). However this causes several build errors with it not existing in the Makefile and also not generating an “upstream” version of the dtb.
Having looked more deeply into the origin/master branch it would appear the layout is now very different and the file I need to change is `imx8mp-verdin-wifi-dev-u-boot.dtsi`, but I am unsure where this is used to create the dtb and how that gets specified when building the u-boot code.

Is there an updated tutorial for doing something like this anywhere?

Thanks for any help and pointers.

Hi, I’m the Toradex AI Assistant.

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


Custom U-Boot Device Tree for Verdin iMX8MP

For Verdin iMX8MP, the U-Boot configuration uses the upstream branch v2024.07 (1). The device tree files you need to modify are located in the U-Boot source tree structure.

Device Tree File Structure

Based on the U-Boot version information, for i.MX 8MM/8MP modules, the configuration is verdin-imx8mp_defconfig and the binary generated is imx-boot (1).

Modifying Device Tree for Custom Carrier Board

For your specific requirements to remove the ctrl-sleep-moci-hog from gpio4 and EEPROM definitions from i2c4, you’ll need to work with the U-Boot device tree files.

The documentation shows an example of device tree modifications for Verdin iMX8MP in the Chinese blog post (2), which demonstrates modifications to U-Boot device tree files including:

  • imx8mp-verdin-u-boot.dtsi for U-Boot specific configurations (2)
  • imx8mp-verdin.dts for main device tree modifications (2)

Build Process

The U-Boot build process for iMX8MP follows these steps (1):

  1. Configure U-Boot:
make mrproper
make verdin-imx8mp_defconfig

(1)

  1. Compile U-Boot:
make -j$(nproc) 2>&1 | tee build.log

(1)

Integration with Yocto Build

When building custom U-Boot with Yocto, you’ll need to follow the process described in the build documentation (1). The U-Boot artifacts need to be integrated into the Toradex Easy Installer package by replacing the bootloader binaries and adjusting the image.json file accordingly (1).

CTRL_SLEEP_MOCI Configuration

The CTRL_SLEEP_MOCI signal is a power management signal that enables power rails for carrier board peripherals (3). This signal is defined as a CMOS output at 1.8V that remains high during sleep modes (3). Modifying this in the device tree requires careful consideration of your custom carrier board’s power management requirements.

To get the exact hardware and OS version information for your setup, please run the tdx-info command as described in the development resources documentation.

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.