How automatic dtb selection works?

Hello,

We have a Verdin Development board and a Dahlia board and using them with Verdin iMX8M-Plus module and tdx-reference-multimedia-image for our evaluations.

I have noticed that when I insert the SoM module to the development board, it boots by using imx8mp-verdin-wifi-dev.dtb.

But the same SoM module with the same image, when I plug it into Dahlia board, it automatically boots using imx8mp-verdin-wifi-dahlia.dtb.

We recently designed a custom carrier board from scratch, not yet received but I wonder that how it will be recognized by the same image? Can you briefly explain the mechanism behind? Are there some GPIOs responsible to select the carrier board?

Thank you.

I went down this road with the wifi and non-wifi versions of the 6ULL SOMs. There are some uboot environment variables that were used for detection. You might display all of your uboot variables on both boards and compare.

1 Like

Hello @Fide,
The two mentioned verdin carrier boards contain an eeprom that holds carrier board identification information.
You can check more details about how this information is read here:
https://git.toradex.com/cgit/u-boot-toradex.git/tree/board/toradex/common/tdx-cfg-block.c?h=toradex_2020.07&id=eee9c9f11383018bbe25729e6b56fd40effbf9a7#n632

For your custom carrier board you’ll probably not have the eeprom and will need to setup the u-boot environment variables to load the proper device tree according to your needs.

Best Regards,
Rafael Beims

1 Like

Nice trick, thank you.

Hello @Fide, I checked my response internaly and figured out it’s not completely right. Here’s the correct answer:
The verdin modules are able to read some information from our carrier boards eeprom, and because of that they are able to print this message in u-boot:

Carrier: Toradex Verdin Development Board V1.1B, Serial# 10866136

We also set environment variables like this:

carrier_serial#=10866136

However, this detection and the variables have no influence on the boot process and also don’t influence the device tree file selection. For that we still rely on the usual environment variables:

preboot=setenv fdtfile imx8mm-verdin-${variant}-${fdt_board}.dtb

Sorry for the confusion on my part!
Best regards,
Rafael Beims