AnsweredAssumed Answered

how to config the sdma to use the external event0 to triggle an interrupt

Question asked by 玲 贾 on Jul 24, 2018
Latest reply on Aug 6, 2018 by yunteng long

I'm working on a iMX6Q board with SDMA and external hardware events. There are two external event lines available: Event 0 and Event 1. (and their alternates), I want to use event 0 to triggle a interrupt to start copy data from fpga to mcu memory through weim bus. I have verified that the pin is connected (using GPIO) and that the external trigger signal arrives on the chip.

 

 


int dts as:
dmas = <&sdma 14 12 0>;
dma-names = "rx";


in my driver:   
dma_cap_zero(dma_m2m_mask);
dma_cap_set(DMA_SLAVE, dma_m2m_mask);
dma_m2m_chan = dma_request_slave_channel(&pdev->dev, "rx");
if (!dma_m2m_chan) {
printk("dma request failed\n");
}
printk("dma_m2m_chan.channel=%d\n", dma_m2m_chan->chan_id);
dma_m2m_config.direction = DMA_DEV_TO_MEM;
dma_m2m_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
dma_m2m_config.src_addr = 0x08000000;

dmaengine_slave_config(dma_m2m_chan, &dma_m2m_config);

 

my question is:
1.how to config the sdma to use the external event0 to triggle an interrupt ?
2.how to use callback fuction connected to this interrupt?

Outcomes