Adding SPI-SLAVE mode to an older kernel version

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding SPI-SLAVE mode to an older kernel version

Jump to solution
115 Views
Contributor III

Hi Everybody, 

I have a few questions related to LINUX SPI concepts and SLAVE MODE implementations.

I am trying to port an IMX6 board to embedded linux by yocto from another operating system. Right now I need to port one SPI SLAVE MODE peripheral and one SPI MASTER MODE peripheral to port. 

Linux-imx kernel version is 4.9.88. It is coming from yocto packages released by NXP. 

I have added 2 spi devices using spidev userspace driver and tested with spidev_test loopback test. On loopback test it seem successful. But both are in SPI MASTR MODE.

When I checked the concepts of SPI on linux I encountered 2 nice videos on youtube 

"https://www.youtube.com/watch?v=tCa_ydVwKhM&list=WL&index=3&t=0s"

"https://www.youtube.com/watch?v=MV8Sy6jGUIE&list=WL&index=2&t=0s"

First one defines slave mode support on linux and later one explains SPI subsystem on Linux kernel.

An far as I understand the SPI slave implementation is in LINUX Kernel.

Q1 Is it ready to use for an IMX6 system?  If I had a newer version of kernel would it be easily implemented? Is there such an example that works for imx-yocto-bsp for imx6 SPI slave mode?

Q2 Can I port the SLAVE MODE capability from later kernels to my kernel version 4.9.88? How can i do that? 

Q3 Is controller driver spi-imx.c used for this purpose? On device tree can i specify spidev as "compatible" parameter? How will spidev userspace driver use spi-imx.c as a control driver? How is the connection between protocol driver (userspace driver) and controller driver is established? 

Q4 May be is it possible to change my linux-imx version to a kernel that supports spi slave mode functionality? It also needs to be supported by a yocto environment. 

I know these are quite wide and unclear questions but it is so because my mind is also confused on concepts. 

I hope to clarify these issues by your answers.

Best Regards

Yavuz

 

0 Kudos
1 Solution
63 Views
Contributor III

Hi, 

I have decided not to port spi slave support to an older version of kernel but rather switched to a kernel version 5.4.24. 

https://community.nxp.com/t5/i-MX-Processors/Which-imx-linux-version-shall-be-selected-for-porting-S... 

Best Regards 

View solution in original post

0 Kudos
4 Replies
64 Views
Contributor III

Hi, 

I have decided not to port spi slave support to an older version of kernel but rather switched to a kernel version 5.4.24. 

https://community.nxp.com/t5/i-MX-Processors/Which-imx-linux-version-shall-be-selected-for-porting-S... 

Best Regards 

View solution in original post

0 Kudos
104 Views
Contributor III

Thank You @Yuri   for your response,

I checked "https://community.nxp.com/t5/i-MX-Processors/ECSPI-slave-mode-support-for-iMX6/m-p/767130#M119124"

it is definitely the same kind of problem.

But the thread you referred do not explain how to do that?

which files are to be updated for this purpose?

and how can i test it?

Regards

0 Kudos
101 Views
NXP TechSupport
NXP TechSupport

@Yavuz 

It is needed to rebuild the kernel; under Yocto:

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

0 Kudos
113 Views
NXP TechSupport
NXP TechSupport

@Yavuz 
Hello,

   look at the following thread, hope it helps.

https://community.nxp.com/t5/i-MX-Processors/ECSPI-slave-mode-support-for-iMX6/m-p/767130#M119124

Regards,
Yuri.

 

0 Kudos