Verdin AM62: Custom Device Tree Integration and Auto Load via Yocto

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

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


Hello Uday,

Thank you for your detailed questions! I’ll guide you step-by-step on how to add and integrate a custom device tree for a Verdin AM62-based custom carrier with Yocto, making it load automatically at boot—no manual fw_setenv needed on each deployment.

Below you’ll find a ready-to-use example for each step and each file relevant for your meta-layer (e.g., meta-myboard).


1. Create Your Custom Meta Layer

First, create a dedicated meta-layer if you don’t have one already (here called meta-myboard):

cd <your-yocto-project-dir>/build/
bitbake-layers create-layer ../layers/meta-myboard

Initialize as a Git repo if developing Torizon OS:

cd ../layers/meta-myboard
git init
git commit -m "Initial Commit" -m "Add meta-myboard from template"

(Reference)


2. Add Your DTS to the Meta Layer

Inside your layer, create the folder for kernel recipes:

cd ../layers/meta-myboard
mkdir -p recipes-kernel/linux/linux-toradex/

Copy your custom DTS file (e.g., mycarrier-verdin-am62.dts) into this directory.


3. bbappend: Append the Custom DTS to linux-toradex

Create recipes-kernel/linux/linux-toradex%.bbappend with this content:

FILESEXTRAPATHS:prepend := "${THISDIR}/linux-toradex:"

# Do NOT use the in-tree defconfig
unset KBUILD_DEFCONFIG

SRC_URI += " \
    file://mycarrier-verdin-am62.dts \
"

do_configure:append() {
    cp ${WORKDIR}/mycarrier-verdin-am62.dts ${S}/arch/arm64/boot/dts/ti/
}

This code ensures your custom DTS is available for the build. For the Verdin AM62, the device trees are in arch/arm64/boot/dts/ti/.
(Full reference & step-by-step)


4. Extend Machine Configuration to Add Your DTB

Create or edit a .conf file (e.g., verdin-am62-mycarrier.conf) in conf/machine/ of your meta layer.

Instruct Yocto to build your DTB:

KERNEL_DEVICETREE:append = " ti/mycarrier-verdin-am62.dtb"

You can also include any existing .conf extension, for example by putting in your layer.conf:

include conf/machine/verdin-am62-mycarrier.conf

(Reference)


5. auto-load Custom DTB on Boot (No manual fw_setenv)

If you set KERNEL_DEVICETREE in your machine configuration, Yocto will set the default DTB in the generated U-Boot env during image creation. You won’t have to run fw_setenv manually unless switching DTBs post-deployment.


6. Example Directory Structure of meta-myboard

Your custom meta-layer might look like this:

meta-myboard/
├── conf/
│   ├── layer.conf
│   └── machine/
│       └── verdin-am62-mycarrier.conf
└── recipes-kernel/
    └── linux/
        └── linux-toradex%.bbappend
        └── mycarrier-verdin-am62.dts

7. Verdin AM62-specific Device Tree Example

See this example for inspiration:
What to add to the dts file to get remoteproc working for the M4 core on TI AM62x


Once you have built your image (bitbake <image-name>), your DTB will be included and set to boot by default matching your meta-layer settings.


Summary Checklist

  • Create meta-myboard layer
  • Add custom DTS to recipes-kernel/linux/linux-toradex/
  • Use a .bbappend as shown above to add your DTS to the build
  • Extend the machine conf for KERNEL_DEVICETREE
  • Build your image; your custom DTB will load by default

If you follow these steps and templates, your Verdin AM62 board will pick up your custom DTB automatically.

Best regards,
Toradex AI Assistant