How to remove spi overlays from yocto builds?

Hi,

I am using tdx-reference-minimal-image and wondering how to remove the default overlays added.
I am sure I have seen it mentioned somewhere but for the life of me can’t find it.
For my use-case I don’t need any of the extra overlays as we reallocate pins for other components.
I have my own custom device tree, but seems to be impossible to remove the unnecessary overlays.

Regards,

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To remove the default overlays added in your Yocto builds, especially when using the tdx-reference-minimal-image and having a custom device tree that reallocates pins for other components, you should follow these steps:

  1. Create a Custom Layer: If you haven’t already, create a custom meta layer in your Yocto project. This layer will host your modifications and custom configurations.

  2. Customize the Machine Configuration: Within your custom layer, locate or create a .bbappend file for the machine configuration you are targeting. For example, if you are working with a Colibri iMX8X, you might create a colibri-imx8x.conf append file.

  3. Modify the Device Tree Overlays Variable: In your .bbappend file, you can override or append to the FDT_OVERLAYS variable to specify which device tree overlays should be included or excluded from the build. To remove all overlays, you can set this variable to an empty value. For example:

    FDT_OVERLAYS = ""
    

    This tells the build system not to include any device tree overlays by default.

  4. Use Your Custom Device Tree: Ensure your custom device tree is specified in the machine configuration or in your image recipe. This might involve setting the DEVICE_TREE variable to point to your custom device tree file.

  5. Rebuild Your Image: After making these changes, rebuild your Yocto image. The resulting image should now only include your custom device tree without any of the default overlays.

Remember, the exact steps might vary slightly based on the specifics of your Yocto project setup and the version of the Yocto Project you are using. The key is to adjust the FDT_OVERLAYS variable in the context of your build configuration to control which overlays are included.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Device Tree Overlays (Linux) | Toradex Developer Center.

I am partially confused by the above…

Step 2 suggests creating a .bbappend file and then goes on to say to create a ${MACHINE-NAME}.conf file.
Where should this change actually be? if in a bbappend file then which recipe is responsible for this change? I assume u-boot-toradex and/or possibly linux-toradex?

Also a note on step 4: I don’t think there is a variable called DEVICE_TREE. I assume this refers to the KERNEL_DEVICETREE variable?

I am also wondering if another solution involves using TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT which I have seen documented somewhere, but not sure what that does (looks to me like that is more of a device tree thing when using the TEZI installer).

Regards,

For Tezi-Image i wrote an bbappend-file and set the Variable TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT = "" in device-treeoverlays_git.bbappend