How to enable IMX8 LPSPI native chip select

Hello,

I’am testing the IMX8 SOM on Apalis eval board.
I have enabled SPIDEV on device tree as follow

&lpspi0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_lpspi0>;
	#address-cells = <1>;
	#size-cells = <0>;
	cs-gpios = <&lsio_gpio3 5 GPIO_ACTIVE_LOW>;

	spidev0: spi@0 {
		compatible = "toradex,evalspi";
		reg = <0>;
		spi-max-frequency = <4000000>;
	};
};

we realized the driver use gpio chip select instead of native CS (delay introduced between byte).

How to force usage of SPI native chip select?

Best regards

Hi @jerraldo ,

I think that removing the cs-gpios property should unset any GPIO CS pins. You probably also need to change in pinctrl_lpspi0 the pinmux of the SPI0_CS0 pin from GPIO (IMX8QM_SPI0_CS0_LSIO_GPIO3_IO05) to native CS (IMX8QM_SPI0_CS0_DMA_SPI0_CS0).

Best regards,
Lucas Akira

Thanks for the tips, it worked

1 Like

Hi @jerraldo,

Thanks for letting us know, glad that it worked!

Best Regards
Kevin