imx6 : How to use SDMA from EIM(FPGA) to DDR

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

imx6 : How to use SDMA from EIM(FPGA) to DDR

2,762 Views
housepark
Contributor I

Environment

 MCU : imx6 solo
 Kernel : L3.0.35_4.1.0
 EIM Setting : 16bit, Burst, Continuous  BCLK
    - When I use memcopy from ddr to eim(using ioremap), memcopy function is good.
    - So, I think there is no problem with eim settings.
 SDMA test sample : unitest - mxc_sdma_memcopy_test.c sample source
    - mem to mem test is good using sample source. (from DDR to DDR)
  SDMA firmware version is .1(imx6q)

My plan is data transmission from DDR to EIM(FPGA) using SDMA.
I made two attempts.
try 1 :
 SDMA Type : IMX_DMATYPE_MEMORY
 I changed the address of wbuf or rbuf to EIM address(using ioremap to change to virtual memory), but chip select not responding.
 Simply, I just modified the memory address(rbuf->eim virtual address or wbuf->eim virtual address) in the sample source.
try 2 :
 SDMA Type : IMX_DMATYPE_MEMORY or IMX_DMATYPE_EXT
  dma_m2m_config_rx.direction = DMA_DEV_TO_MEM;
  dma_m2m_config_rx.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
  dma_m2m_config_rx.src_addr = EIM_CS0_BASE_ADDR; ( EIM_CS0_BASE_ADDR is 0x08000000;phys addr)
  dma_m2m_config_rx.src_maxburst = 16;

  dmaengine_slave_config(dma_m2m_chan_rx, &dma_m2m_config_rx);
  sg_init_table(sg, 1);
  sg_set_buf(&sg[0], wbuf, SDMA_BUF_SIZE);
  ret = dma_map_sg(NULL, sg, 1, dma_m2m_config.direction);
  dma_m2m_desc = dma_m2m_chan->device->device_prep_slave_sg(dma_m2m_chan,sg, 1, dma_m2m_config.direction, 1);
  dmaengine_submit(dma_m2m_desc);

  Chip select soes not work, too.

Question 1
   Can I access the EIM throuhg SDMA? If not, is DMA possible?
Question 2
   Can I get an SDMA sample source from EIM to DDR?
Question 3
   If SDMA is not able to use EIM, is there any other way to resuce cpu usage for memory copy?

Tags (4)
0 Kudos
4 Replies

1,160 Views
Yuri
NXP Employee
NXP Employee

Hello,

  Generally You approach is right - the SDMA test is the simplest way

to adapt current Linux SDMA support for Your purposes. Please take into considerations the following :

1) EIM must be configured and enabled before using via SDMA;

2) EIM SDMA channel is assumed as configured for address increment (non-FIFO).

 

  For maximal performance it may be recommended to use ARM block copy instructions (LDM / STM).

 

Also please look at the following :

Measure SDMA Memory To Memory Copy Performance on i.MX6Q 

Have a great day,
Yuri

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

0 Kudos

1,160 Views
jieh朱
Contributor III

Hi I recently tried imx6: How to use SDMA from EIM (FPGA) to DDR, encountered the same problem with the landlord is EIM does not support SDMA

0 Kudos

1,160 Views
lingyicai
Contributor I

hi jieh:

       is imx6q not support SDMA form EIM to DDR ?

       thx.

0 Kudos

1,160 Views
rclongyunteng
Contributor I

Hi lingyi:

        Recently i also try imx6 to use SDMA from EIM to DDR.Did you resolve it?

        How can i make imx6q work as mem_to_mem please?

        Thank you.

         

        Best Regards.

0 Kudos