I would like to convert the ECSPI1 form master to slave.
Module: Verdin iMX8M Plus
I’ve read this post:
and it looks like this can be done with modifications on the
Could you please tell me where to find the original file? I could not find it in the git repository device-trees
Hi @VMB !
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.
Thank you @brute for the link and @henrique.tx for the clarification.
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) .
I think I found the file in the kernel source code at
Hi @VMB !
As you already found, this is indeed the driver for ECSPI interfaces of Verdin iMX8MP.
We can find this out from Verdin iMX8MP’s device tree (imx8mp.dtsi « freescale « dts « boot « arm64 « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules) and find out the driver that has one of the compatibles of the node. In this case, the compatible is
spi-imx.c you found has the compatible
If your questions were answered, please mark the most suitable question as the Solution