Lpspi0 not working on IMX8QXP

Hi,
I need help with setting up lpspi0 in “toradex,colibri-imx8qxp-eval-v3”. I can see /dev/spidev0.0 but I could not get any signals in the clock line SC_P_SAI0_TXFS_ADMA_SPI1_SCK - SODIMM PIN 101 when executing echo 1 > /dev/spidev0.0. Please let me know if I miss anything.

It works well on the other SPI devices (SPI2 /dev/spidev1.0 and SPI3 /dev/spidev2.0)

There are no changes made in build/workspace/sources/linux-toradex/scripts/dtc/include-prefixes/arm64/freescale/fsl-imx8dx.dtsi for lpspi0.

root@colibri-imx8x:~# find / -name
 spidev0.0 /dev/spidev0.0 
 /sys/class/spidev/spidev0.0
 /sys/devices/platform/5a000000.lpspi/spi_master/spi0/spi0.0/spidev/spidev0.0



&lpspi0 {
	   #address-cells = <1>;
	   #size-cells = <0>;
	   fsl,spi-num-chipselects = <1>;
	   pinctrl-names = "default";
	   pinctrl-0 = <&pinctrl_lpspi0>;
	   cs-gpios = <
                  &gpio3 3 GPIO_ACTIVE_LOW
	   >;
	  status = "okay";

	spidev1: spidev@0 {
		compatible = "toradex,evalspi";
		reg = <0>;
		spi-max-frequency = <10000000>;
		status = "okay";
	};
};


    /* Colibri SPI */
	pinctrl_lpspi0: lpspi0 {
		fsl,pins = <
		SC_P_CSI_RESET_LSIO_GPIO3_IO03          0x21   /* SODIMM  29  */              
      	        SC_P_SAI0_TXD_ADMA_SPI1_SDO	      0x06000040   /* SODIMM  103 */			
		SC_P_CSI_EN_ADMA_SPI1_SDI       		0x06000040	 /* SODIMM  37  */
		SC_P_SAI0_TXFS_ADMA_SPI1_SCK			0x06000040	 /* SODIMM  101 */
		>;
	};
	
	pinctrl_lpspi2: lpspi2 {
		fsl,pins = <
			SC_P_SPI2_CS0_LSIO_GPIO1_IO00			0x21	/* SODIMM  86 */
			SC_P_SPI2_SDO_ADMA_SPI2_SDO			0x06000040	/* SODIMM  92 */
			SC_P_SPI2_SDI_ADMA_SPI2_SDI			0x06000040	/* SODIMM  90 */
			SC_P_SPI2_SCK_ADMA_SPI2_SCK			0x06000040	/* SODIMM  88 */
		>;
	};
	
	pinctrl_lpspi3: lpspi3 {
		fsl,pins = <
			SC_P_SPI3_CS0_LSIO_GPIO0_IO16 		0x21		/* SODIMM  68 */
			SC_P_SPI3_CS1_ADMA_LCDIF_D16        0x21		/* SODIMM  57 */    
			SC_P_SPI3_SDO_ADMA_SPI3_SDO			0x06000040	/* SODIMM  66 */
			SC_P_SPI3_SDI_ADMA_SPI3_SDI			0x06000040	/* SODIMM  64 */
			SC_P_SPI3_SCK_ADMA_SPI3_SCK			0x06000040	/* SODIMM  54 */
		>;
	};

I incorrectly mapped it to lpspi0 instead of lpspi1.

After configuring lpspi1 based on “i.MX 8DualX/8DualXPlus/8QuadXPlus Applications Processor Reference Manual” document (https://www.nxp.com/webapp/Download?colCode=IMX8DQXPRM) , I was able to get the SPI device to work.

Hi @dnoot!

Glad that it works. Thanks for the feedback!