Enabling SPI on Verdin AM62 in Yocto: Missing .dts file - modify .dtsi

Hi @Uday10122!

This is the structure you should have:

meta-overlay-test/
├── conf
│   └── layer.conf
├── COPYING.MIT
├── README
└── recipes-kernel
    └── linux
        ├── device-tree-overlays
        │   └── verdin-imx8mp_gpio-pullup.dts
        └── device-tree-overlays_%.bbappend

In this example, I used an overlay to enable GPIOs pull-ups.

The .dts is:

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include "imx8mp-pinfunc.h"

/ {
        compatible = "toradex,verdin-imx8mp-nonwifi-dahlia",
                     "toradex,verdin-imx8mp-nonwifi",
                     "toradex,verdin-imx8mp",
                     "fsl,imx8mp";
};

&pinctrl_gpio1 {
        fsl,pins = <MX8MP_IOMUXC_GPIO1_IO00__GPIO1_IO00         0x1c4>;
};

&pinctrl_gpio3 {
        fsl,pins = <MX8MP_IOMUXC_GPIO1_IO05__GPIO1_IO05         0x1c4>;
};

&pinctrl_gpio4 {
        fsl,pins = <MX8MP_IOMUXC_GPIO1_IO06__GPIO1_IO06         0x1c4>;
};

And the .bbappend file is:

FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"

SRC_URI:append = " file://verdin-imx8mp_gpio-pullup.dts"

do_collect_overlays:prepend () {
    cp ${WORKDIR}/verdin-imx8mp_gpio-pullup.dts ${S}
}

TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT:append = " verdin-imx8mp_gpio-pullup.dtbo"

After this, you must add the meta-layer (meta-overlay-test in this example) to your bblayers.conf. Otherwise, Yocto won’t build it.

Following this structure, you should be able to build an image with your overlay added.

Feel free to ask if you face any issues or doubts.

Best regards.
Lucas Azeituno.

1 Like