failed to copy data from eim to memory while using sdma

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

failed to copy data from eim to memory while using sdma

3,693 Views
jiejia
Contributor III

I have a a custom iMX6q board which have an FPGA connected on the EIM bus. It's work well while I get data from fpga using ioread16(). I want to transfort data using dma, so i download the mxc_sdma_memcopy_test.c and mxc_sdma_test.c. The driver and app is ok. However, while i replace the wbuf using the fpga address, it make no sense. I can't see any pulse on the eim bus. what is wrong with it?

Labels (2)
8 Replies

2,872 Views
igorpadykov
NXP Employee
NXP Employee

Hi jie

probably EIM is not configured properly.

Among other things there may be linux virtual memory mapping.

One can start with SDK and find correct EIM settings.

Then port them to linux.

i.MX 6Series Platform SDK : Bare-metal SDK

Also link below may help

http://billauer.co.il/blog/2011/10/imx-sdma-howto-memory-map/

Also please check Linux codes for Sabre-AI board, it has parallel NOR connected to

EIM.

RDIMX6SABREAUTO: SABRE for Automotive Infotainment Based on the i.MX 6 Series: SABRE for Automotive ...

Best regards

chip

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

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

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

0 Kudos
Reply

2,872 Views
jiejia
Contributor III

Hi chipexpert,

    Thanks for answer. I sure the EIM is configured correctly. I used ioread() can read the correct data from FPGA. I wonder the example is only used for internal memory to internal memory.  I tried to used the dma_alloc_coherent() to allocate buffer, and i used the virtual address to replace the wbuf. I can't see any print information. The data do not transport. Could you please send me a code that can get data from ram-like peripheral using sdma?

0 Kudos
Reply

2,872 Views
igorpadykov
NXP Employee
NXP Employee

Hi jie

I am afraid such linux examples are not available.

Suggest to check these examples and try to get EIM working without OS,

with SDK

i.MX 6Series Platform SDK : Bare-metal SDK

http://billauer.co.il/blog/2011/10/imx-sdma-howto-memory-map/

then you can easily port EIM changes to linux.

Best regards

chip

0 Kudos
Reply

2,872 Views
jiejia
Contributor III

Hi chipexpert,

     I think the problem is not in EIM bus. I tried to used the dma_alloc_coherent() to allocate buffer, and i used the virtual address to replace the wbuf. I can't see any print information.

In the mxc_sdma_memcopy_test.c, I have two questions:

1.m2m_dma_data.peripheral_type = IMX_DMATYPE_MEMORY;      // I don't know which one to fill it in the eim memory.

2.dma_m2m_config.direction = DMA_MEM_TO_MEM;                    // I don't know which one to fill it in the eim memory.

0 Kudos
Reply

2,872 Views
igorpadykov
NXP Employee
NXP Employee

Hi jie

I think you should create for these linux questions

separate thread.

Still I would suggest to check these examples and try to get EIM working

without OS, with SDK and check if hardware works at all.

i.MX 6Series Platform SDK : Bare-metal SDK

BTW you can try with uboot, not forget to define EIM address

space in function board_mmu_init.

Best regards

chip

0 Kudos
Reply

2,872 Views
jiejia
Contributor III

Hi chip:

   I get some code from:https://community.freescale.com/thread/304610 

   There are four files:ap_2_ap.asm, hwi_sdma_defs.inc, loop_DMAs_routines.asm, sdma_core_defs.inc. However, I don't know how to build these four files and load them to sdma core. Would you give me some advices?

   best regards.

0 Kudos
Reply

2,871 Views
sedat_altun
Contributor III

Hi,

I also used the imx memcopy.c but as an address I hacked imx-sdma.c driver  in MEM_2_MEM case by setting ext_bdaddr = FPGA_PHYSICAL_ADDRESS I succeeded to transfer 8-burst word in one cycle.

Best regards.

0 Kudos
Reply

2,871 Views
igorpadykov
NXP Employee
NXP Employee

I think you can ask about that from author Weidong. :smileyhappy:

0 Kudos
Reply