ECSPI slave mode support for iMX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ECSPI slave mode support for iMX6

3,199 Views
kuldeepnigam
Contributor I

Hi,

I am working on phyBOARD-Segin i.MX 6UL Alpha Kit and Linux 4.8.0 running on it. We want to enable ECSPI slave mode for one of the usecase. Can anyone let me know how to configure it and how to test it from user space.

Regards,

Kuldeep

Labels (3)
3 Replies

1,424 Views
kuldeepnigam
Contributor I

Hi,

I have ported the support for SPI slave from kernel 4.15 to kernel 4.8 and I can see the sysfs entries for SPI slave.
Testing the SPI communication using Spidev application in Slave side. Also able to communicate to phyBOARD-Segin i.MX 6UL Alpha Kit.  
But the data sent from Master and data received at slave is not same.
I am using the following setting at master :
SPI clock : 500 KHz (also tested with different Baudrate)
SPI Mode : 1 (CPOL = 0, CPOH = 0)
Frame size : 8 bits

DMA disabled at slave side.

Can anyone provide some input to debug further.

Thanks,

Kuldeep

0 Kudos

1,424 Views
fabio_estevam
NXP Employee
NXP Employee

spi-imx driver supports SPI Slave since commit: 71abd29057cb1 ("spi: imx: Add support for SPI Slave mode"), which is part of 4.15-rc kernel.

Regards,

Fabio Estevam

1,424 Views
Yuri
NXP Employee
NXP Employee

Hello,

 

   NXP BSP does not support neither ECSPI slave mode nor kernel 4.8.

Nevertheless, customers can configure SPI slave mode support in Linux (SPIDEV).
By default it is not supported; the following sequence may be performed for SPIDEV :

$ bitbake linux-imx -c menuconfig

# select DEVICE DRIVERS -> SPI Support -> User mode SPI device driver support

$ bitbake linux-imx
$ bitbake core-image-minimal  

  The recent command is used to deploy compiled files to file system.

Also, the following may be helpful :

https://community.nxp.com/message/921897 

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos