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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

9,272 次查看
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.

标签 (2)
0 项奖励
回复
4 回复数

3,357 次查看
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!

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

3,353 次查看
shengpingzhang
Contributor I

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

0 项奖励
回复

3,357 次查看
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 项奖励
回复

3,357 次查看
igorpadykov
NXP Employee
NXP Employee

Hi yongki

you can start with

ltib/..linux/Documentation/spi

Best regards

chip

0 项奖励
回复