How to design a SPI Slave driver of Linux kernel 2.6.35 on i.MX28 platform.

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

How to design a SPI Slave driver of Linux kernel 2.6.35 on i.MX28 platform.

7,850 Views
yongkimin
Contributor III

I’m designing a SPI Slave driver of Linux kernel 2.6.35 on i.MX28 platform.

I know that Linux does not support only Master mode! So the application code starts with spi_ioc_transfer ioctl.

But, the CPU (i.MX285) can support Slave function.

Is there anyone can help me or example?

  1. 1. How to setup Slave mode to receive a data from Master side?
    I think the SPI interrupt in Slave mode should be occur after settings (Slave settings).
    I think SPI operation will start with SS (Slave Select) signal of Master side.
    But I confuse how to setup because the BSP is only shows Master examples.

  2. 2. If I receive a data from Master side in SPI handler, then what is next?
    How to share or send a data copy from Data Register to user

Thanks.

Labels (2)
0 Kudos
4 Replies

1,935 Views
igorpadykov
NXP Employee
NXP Employee

Hi yongki

please try attached patch.

Best regards

chip

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

1,931 Views
shengpingzhang
Contributor I

HI igorpadykov would please tell me how to use the patch file ? What files and softwares must I have first.

0 Kudos

1,935 Views
yongkimin
Contributor III

That patch file have some help to me for understanding Slave settings.

But, I still have a question about a settings (settings are start User application area). In case Master driver, User area application open a device (ex spidev1.0) and then use ioctl (mode settings, bit settings) and finally ioctl message to exchange data on MISO pin.

My question is how to open a Slave driver of CPU in User application.

Sencond question is how to share or notify of Rx data to User applicatoin on MOSI pin at Slave driver side.

I think register the Rx FIFO hander using a request_irq at in probe function at boot time.

And then User application area will open a device (spidev1.0) to Slave driver. At this time I have a question how ?

Thanks.

0 Kudos

1,935 Views
igorpadykov
NXP Employee
NXP Employee

Hi yongki

you can start with

ltib/..linux/Documentation/spi

Best regards

chip

0 Kudos