I.MX8M Mini as SPI slave

cancel
Showing results for 
Search instead for 
Did you mean: 

I.MX8M Mini as SPI slave

129 Views
liamjm36
Contributor II

Hey, 

I have been trying to set up a I.MX8M Mini as an SPI slave and have ran into some confusion regarding the correct device tree configuration. I am using a VAR-SOM-MX8M-MINI with yocto Dunfell (kernell 5.4.142).

I have been using https://community.nxp.com/t5/i-MX-Processors/Configuration-of-spi-slave-in-device-tree-files-for-IMX... as reference.

If I understand correctly I have to edit the device tree files at arch/arm64/boot/dts/freescale both a .dtsi and .dts file. I have found the imx8mm-var-som.dtsi which seems like the correct file however I don't know which .dts file to edit. 

I also found talk of a patch for the SPI driver which is for a previous release. Have the bugs where you cannot receive more than 64 words without disabling the device been resolved? Ideally we would like to receive up to 4kB per transfer over SPI, would this be possible?

https://patchwork.kernel.org/project/spi-devel-general/patch/cf6fb92ac2c64a2a7efca7996f4699941f56ec2...

Thanks,

Liam

0 Kudos
1 Reply

107 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

The file you found should be the correct one, there is no need to modify any other.

For device tree binding you may refer to the following documentation:

https://source.codeaurora.org/external/imx/linux-imx/tree/Documentation/devicetree/bindings/spi/fsl-...
https://source.codeaurora.org/external/imx/linux-imx/tree/Documentation/devicetree/bindings/spi/spi-...

Regarding issue in SPI driver are you referring to  HW limitation number 1?

Following HW limitation applies:

  1. ECSPI has a HW issue when works in Slave mode, after 64 words written to TXFIFO, even TXFIFO becomes empty, ECSPI_TXDATA keeps shift out the last word data, so we have to disable ECSPI when in slave mode after the transfer completes

I think this was already solved for i.MX8MM, please check errata ERR009535 & ERR009165

https://www.nxp.com/webapp/Download?colCode=IMX8MM_0N87W

Best regards,
Aldo.

0 Kudos