How to use SPI0, SPI1 and SPI2 in toradex verdin imx8mp?

Hello,
I know this question was asked in another topic but it didn’t help me much.

I’m looking for how to enable and use the other SPIs in toradex verdin imx8mp. an example of the code to write in verdin-imx8mp_spidev_overlay.dts wil be really great.

The doc also didn’t help me much.

Hello @Samir1 , welcome to the community :slight_smile:
May we know what topics and documents you looked at?

Can please elaborate more on that? What issues did you have while following the documentation and the community topics?

Best regards,
Josep

Hello,
I done it by adding this lines to verdin-imx8mp_spidev_overlay.dts


/* Verdin SPI_2 */
&ecspi2 {
	status = "okay";

	spidev@1 {
		/* Use compatible "rohm,dh2228fv" to bind spidev driver */
		compatible = "rohm,dh2228fv";
		reg = <0>;
		spi-max-frequency = <100000>;
		status = "okay";
	};
};

and more ...

imx8mp-verdin.dtsi

pinctrl_ecspi2: ecspi2grp {
		fsl,pins = <
			MX8MP_IOMUXC_ECSPI2_SCLK__ECSPI2_SCLK		0x0	/* SODIMM 164 */
			MX8MP_IOMUXC_ECSPI2_MOSI__ECSPI2_MOSI		0x0	/* SODIMM 152 */
			MX8MP_IOMUXC_ECSPI2_MISO__ECSPI2_MISO		0x0	/* SODIMM 116 */
	/*		MX8MP_IOMUXC_ECSPI2_SS0__GPIO5_IO13		0x1c4 *//* SODIMM 12 */
		>;
	};

tcbuild.yaml

customization:
  # >> Splash screen:
  splash-screen: custom-splash-screen.png
  # >> Directories overlayed to the base OSTree
  filesystem:
    - changes/
  device-tree:
    # >> Directories where to look for include files.
    include-dirs:
      - linux/include/
    # >> Custom device tree source:
    custom: linux/arch/arm64/boot/dts/freescale/imx8mp-verdin-nonwifi-yavia.dts
    # >> Device-tree overlays configuration:
    overlays:
      # >> Whether to ignore all overlays from the base image (or ostree
      # >> archive in the future).
      # clear: false
      # >> Specific overlays not to use from base image (useful only when
      # >> clear is false and not DT has been selected).
      # remove:
        # - apalis-imx8_hdmi_overlay.dtbo
      # >> Overlays to add to output image.
      add:
        - device-trees/overlays/verdin-imx8mp_spidev_overlay.dts

And i think i added some other configs in other dts files.

Hello @Samir1,

Did you make some modifications to the imx8mp-verdin-nonwifi-yavia.dts file? I see that you have added it as a custom dts in the tcbuild.yaml file. Other than that, your tcbuild.yaml file looks good to me. Did you try building the custom image with TorizonCore Builder tool? How did it go?