UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor siavashr
Visitor
179 Views
Registered: ‎07-10-2018

Using Zynq, how to use one of the available DMAs in the Embedded Linux running on A53s

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:

image.pngFig 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).

image.pngFig 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:

image.pngFig 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?

0 Kudos