AnsweredAssumed Answered

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

Question asked by SangYoung Park on Jun 25, 2017
Latest reply on Jan 31, 2018 by jieh 朱

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?

Outcomes