How to do a SPI data transfer using SDMA on iMX6DL

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

How to do a SPI data transfer using SDMA on iMX6DL

1,803 Views
maximeleroy
Contributor I

Dear community,

I'm interested in making spi data transfer using sdma on i.MX6DL on a linux based system (v3.12).

Do you think it's possible to use the example "spi_lpb.c" provided in the Freescale SDK v1.1 as a basis and port it to linux?

If someone ever done it or could give me some advice on how to do it, I would be very grateful :smileyhappy:.

Thank you,

Maxime

Labels (2)
Tags (4)
0 Kudos
Reply
6 Replies

1,171 Views
igorpadykov
NXP Employee
NXP Employee

Hi Maxime

one can look at SDK sdma examples (eCSPI1, sdma_test.c)

and ENGR00229787 on

raymond1860 / linux-2.6-imx / imx_2.6.35_maintain — Bitbucket

Best regards

igor

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

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

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

0 Kudos
Reply

1,171 Views
maximeleroy
Contributor I

Hi Igor,

Thank you for your answer, I knew about the file "sdma_test.c" and i'm particularly interested in what's done in "spi_lpb.c" which contains two test functions involving spi transfer.

The second reference you provided me lead me to an interesting discovery:

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/plat-mxc/sdma?h=imx_2.6.35...

If I understand correctly inside the folder "arch/arm/plat-mxc/sdma/" there is module called "iapi" which is a "dmaengine" that does not depend on linux imx-sdma driver.

Can you confirm?

Would it be possible to use "I.API" to run on linux the sdma test example in file spi_lpb.c?

Best regards,

Maxime

0 Kudos
Reply

1,171 Views
igorpadykov
NXP Employee
NXP Employee

Hi Maxime

yes iapi is some kind of dmaengine.

>Would it be possible to use "I.API" to run on linux the sdma test example in file spi_lpb.c?

yes.

there is mxc_sdma_mem_test.c in  imx-test-3.aa.bb-c.d.e

package, one can use it as example.

~igor

0 Kudos
Reply

1,171 Views
maximeleroy
Contributor I

Hi Igor,

Thanks again for your answer, it is very helpful and i think  the file "mxc_sdma_mem_test.c" could help me a lot.

However I'm not sure where to find it, I found it here:

imx-linux-test/module_test at imx_jb4.2.2_1.0.0-ga · boundarydevices/imx-linux-test · GitHub

Is this the file your talking about?

Maxime

0 Kudos
Reply

1,171 Views
igorpadykov
NXP Employee
NXP Employee

Hi Maxime

yes it is right file.

~igor

0 Kudos
Reply

1,171 Views
igorpadykov
NXP Employee
NXP Employee

Hi Maxime

iapi one can find in ltib sources: linux/..arm/plat-mxc/sdma/iapi,

they are called from linux i.mx sdma routines.

~igor

0 Kudos
Reply