Force fixed dst addr for SDMA EIM on 4.1 with 6sl

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

Force fixed dst addr for SDMA EIM on 4.1 with 6sl

528 Views
jayakumar2
Contributor V

Hi,

I'm using SDMA from host to EIM target (fpga) on i.mx6 sololite with Linux 4.1. I have it partially working now.

I'm using the following settings:

dma_cap_zero(dma_m2m_mask);
dma_cap_set(DMA_SLAVE, dma_m2m_mask);
m2m_dma_data.dma_request = 0;
m2m_dma_data.dma_request2 = 0;

m2m_dma_data.peripheral_type = IMX_DMATYPE_MEMORY

m2m_dma_data.priority = DMA_PRIO_HIGH;
dma_m2m_chan = dma_request_channel(dma_m2m_mask, dma_m2m_filter,
&m2m_dma_data);

dma_m2m_config.direction = DMA_MEM_TO_MEM;
dma_m2m_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;

dma_m2m_config.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
dma_m2m_config.src_maxburst = 128;
dma_m2m_config.dst_maxburst = 128;

dmaengine_slave_config(dma_m2m_chan, &dma_m2m_config);

dma_m2m_desc = dma_m2m_chan->device->device_prep_dma_memcpy(dma_m2m_chan, targetaddr, rbuf, bytecount, 0);

When I try this, eg:

targetaddr=0x0C000000 bytecount=4 sourcevalue=0xcccccccc

(2 writes of 16-bits width with value 0xcccccccc to address 0x0C000000)

Then this is detected correctly by the FPGA:
Read data=0xcccc

However, I noticed that the target address on the EIM bus is incrementing with each cycle. Meaning the first cycle on the bus has address 0 as expected, then the next cycle has address 0x02. So the last address becomes 0x02.

For my purpose with this FPGA, I need to treat the DMA as a fixed address. Meaning I don't want the destination address to increment automatically.

I tried changing the DMA_MEM_TO_MEM to DMA_MEM_TO_DEV. The result was no activity on the bus so it seems MEM_TO_DEV is not a valid option for an EIM target address.

I also tried changing IMX_DMATYPE_MEMORY to IMX_DMATYPE_FIFO_MEMORY and this also resulted in no activity on the bus.

I also checked that the device_prep_interleaved_dma dmaengine api function which has parameters for turning off dst_inc is not supported in imx-sdma. Linux/drivers/dma/imx-sdma.c - Linux Cross Reference - Free Electrons 

I'm a bit stuck. Anyone have any suggestions for a solution on imx6sl that would enable sdma to eim with non-incrementing targett address?

Thanks!

Labels (2)
0 Kudos
1 Reply

275 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jaya

I am afraid it is not supported in new kernels, general approach

is apply to mss services or elevate through local marketing so

such script was developed for you.

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

0 Kudos