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

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

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

1,342 Views
jial2012
Contributor II

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?

Labels (1)
0 Kudos
Reply
3 Replies

1,084 Views
igorpadykov
NXP Employee
NXP Employee

Hi  玲 贾

one can look on

SDMA external request and EIM 

Freescale i.MX51 SDMA tutorial (part III) 

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

0 Kudos
Reply

1,084 Views
jial2012
Contributor II

Hi igorpadykov:

   Thanks for your reply.

   I have see the two part of SDMA external request and EIM and Freescale i.MX51 SDMA tutorial (part III) ,but it  seems not clear to my question. should I need to write a costom SDMA script to my case? I don't kown how to write a costom assembly code can triggle the SDMA_EXT_EVENT0 signal to an interrupt.

   I have write to the registers to config the SDMA_EXT_EVENT0,  i want to enable event14, but sdmac->channel=3, and enabled channel is channel 0. please give some guide to my case, thank you very much!

 tmp1 = readl(imx6_reg_iomux_gpr0)|0x80;
tmp2 = readl(imx6_reg_iomux_sdma_event14_input)|0x1;
tmp3 = readl(imx6_reg_iomux_gpio17)|0x3;

writel(tmp1, imx6_reg_iomux_gpr0);
writel(tmp2, imx6_reg_iomux_sdma_event14_input);
writel(0x3, imx6_reg_iomux_gpio17);

Best regards!

0 Kudos
Reply

1,084 Views
rclongyunteng
Contributor I

Hi,

        It is the same question with me. Have you solved it please?Thank you.

        Best Regards

0 Kudos
Reply