I would like to convert the ECSPI1 form master to slave.
Module: Verdin iMX8M Plus
I’ve read this post: verdin-imx8mp-spi-slave
and it looks like this can be done with modifications on the verdin-imx8mp_spidev_overlay.dts file.
Could you please tell me where to find the original file? I could not find it in the git repository device-trees
Regarding using Verdin iMX8MP’s SPI as slave, there is the Using ECSPI as Slave in Linux for i.MX 8M Series application note from NXP which is certainly useful:
Also, this documentation about SPI slave support on Linux:
From the link above, we read from the “SPI Slave Support” section:
Due to the nature of SPI slave (simultaneous transmit and receive, while everything runs at the pace of the master), it has hard real-time requirements: once an SPI transfer is started by the SPI master, a software SPI slave must have prepared all data to be sent back to the SPI master. Hence without additional hardware support, an SPI slave response can never be a reply to a command being simultaneously transmitted, and SPI slave replies must be received by the SPI master in a subsequent SPI transfer.
But, anyway, the application note from NXP shares some nice inputs about SPI slave and you will find there a link to a set of patches, device tree, and C source code example to test SPI slave.
I hope this information is helpful to you
Btw, thanks @brute for pointing out that link, but it doesn’t show how to set SPI slave.
Concerning the SPI slave in real time, the intention is to use the SPI interface to transfer data from an SPI master device (FPGA) to the SPI SLAVE (verdin module). It is not supposed that the SPI slave device processes this data and provides a reply. We would like to use the driver to perform this task through DMA. I hope the driver patches described in the AN13633 will allow to implement this feature.
Could you please confirmed that the driver described by NXP in the AN13633 and available for download here AN13633SW.zip is the one that is currently used in torizon?
Just for my personal knowledge, where can I find the code of the driver spi-imx.c that is actually used in my device, just to check if it is different from the one described in the patch? I apologize if this question makes no sense (I’m not really a software guru) .