Jump to content
  • 0

Transfer data from PS to PL through DMA using linux device driver


diya-

Question

Hi,

I am working with Diligent ZYbo and using petalinux 2016.4 . I have ddr of 1GB connected to PS and QDR connected to PL. I want to transfer data from PS to PL through DMA driver running on arm core(i.e PS) .I have searched lot of blogs but that explains only data transfer from PL to PS using sdk dma project but our requirement needs application to run on ps side performing dma b/w ps to pl and vise versa.

Can anyone suggest sample application to configure dma and communicate b/w ps and pl.

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

I'm confused, what board are you using? The Zybo has 512MB of DDR3 and no QDR...

If you are wanting to transfer data between the PS memory controller and memory attached to a MIG IP core in the PL, then I think you want to look into the axi_cdma IP core. You should be able to attach it to an AXI Interconnect IP core as a master, and then attach an HP port of the Zynq processor and the MIG as slaves. Note the MIG will not be directly writable by the processor with this configuration, but the processor will be able to setup and configure DMA transfers to/from the MIG. You could make the MIG accessible to the processor by also making one of the Zynq GP ports a master on the AXI interconnect. The AXI_CDMA has linux drivers:

http://www.wiki.xilinx.com/Linux+Drivers

Another option would be to look at the PL330 DMA controller in the PS and use that. Then you will just attach the MIG directly to one of the GP ports of the Zynq processor. This will require custom driver creation in Linux, see here for more info:

http://www.wiki.xilinx.com/Zynq+Linux+pl330+DMA

 

Link to comment
Share on other sites

Hi,

 

4 hours ago, sbobrowicz said:

The Zybo has 512MB of DDR3 and no QDR.

Sorry, this configuration is in our custom board which has zynq processor and we need to implement dma on this board. Its in design level and not yet started our development on custom board.

I downloaded dma wrapper (zynq-xdma-master) from the link https://github.com/bmartini/zynq-xdma  to test the dma transfer between ps and pl but it through below error when i try to compile with petalinux kernel - 4.9.0 version.

 CC [M]  /home/Project/Petalinux_2016.4/zynq-xdma-master/dev/xdma.o
/home/Project/Petalinux_2016.4/zynq-xdma-master/dev/xdma.c:21:35: fatal error: linux/amba/xilinx_dma.h: No such file or directory
compilation terminated.

Is there any stable Linux kernel released by diligent for ZYBO and tested with similar dma wrappers ?

If so, can you please share the software.

Link to comment
Share on other sites

I don't have any generic DMA demos for linux. We only use DMA for our video solutions in Linux, which is done differently than what you are looking for.

My recommendation is to try to start by using the baremetal (no linux) Xilinx demos for the axi_cdma IP core. You can run these directly from Xilinx SDK. This should get you familiar with how the CDMA IP core functions. Once you have some working example code in baremetal that is similar to what you want to accomplish in Linux, then you can try using the UIO driver in linux, which provides you with direct access to the physical address map of the CDMA controller. If you go this route, the code you write in user space will look very similar to the baremetal code, only you will replace the baremetal register accesses with reads/writes to the  mmap-ed /dev/uio node. 

To get UIO working you just need to modify the bootargs and the compatibility string of the axi_cdma core in the device tree. You should be able to find some guides out there for how to accomplish this, and also how to access the physical address map by mmaping the uio node.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...