Hello,
I’m using a Zynq board with 4 A-53 Arm cores that run an embedded Linux (Ubuntu). I need to use a DMA to do a data transfer (it is a data transfer from DDR to DDR but I need to use DMA). When the Linux comes up, I see the following messages (Fig 1) that show some DMAs are available:
Fig 1
In the device tree, I found the following DMAs (Fig2: here I show only 2 of them). As you can see, they have the same register address as listed in the above screenshot. (gdma0 -> 0xfd500000 and so on).
Fig 2
In my device driver, I want to allocate a channel from one of these DMAs, say gdma0. When I call the following function, it returns an error:
//----------------------------------------------------
struct dma_chan *dmachan;
dmachan = dma_request_slave_channel_reason(pdev->dev, "gdma0");
if (IS_ERR(dmachan)){
printk(KERN_ALERT "error in allocating dma channel!\n");
return -1;
}
//----------------------------------------------------
Then I defined a channel from gdma0 (in the device tree) as shown in the follow:
Fig 3
And tried to allocate a channel in my driver as follow:
//----------------------------------------------------
dmachan = dma_request_slave_channel_reason(pdev->dev, "gdma");
if (IS_ERR(dmachan)){
printk(KERN_ALERT "error in allocating dma channel!\n");
return -1;
}
//----------------------------------------------------
However, still I cannot allocate a DMA channel and the function returns an error.
Can you please help me with the changes that I need to do in my device tree and/or in my driver?