cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peter.kuchnio
Observer
Observer
7,421 Views
Registered: ‎11-16-2015

Host to Zynq linux comms & PCIe DMA

Good morning,

 

This is a fairly broad question, but has anyone created a system with a host PC transferring data to a Zynq running linux using PCIe?

 

On the host side, it seems fairly straightforward to blast data into a predefined memory space on the Zynq. However, what is the best method to let the embedded linux side know about the transfer and allocate the memory properly so it can be used on the zynq side?

0 Kudos
3 Replies
milosoftware
Scholar
Scholar
7,404 Views
Registered: ‎10-26-2012

Raises hand.

 

If I understand correctly, you want the PC to place data into the DDR memory on the Zynq.

 

The proper Linux way to do that would be to create a small driver that allocates a chunk of memory using dma_alloc_coherent() and passes the resulting physical address to the logic. The PC on the other side is just another periferal in Logic, as far as the PS side of the Zynq is concerned.

0 Kudos
milosoftware
Scholar
Scholar
7,402 Views
Registered: ‎10-26-2012

That "small driver" would run on the Zynq side.

 

In logic, you'll want a DMA controller to transfer the data from PC memory to Zynq memory.

 

On the PC, you'll need a driver that either creates a scatter-gather list of the memory data to be transferred to the DMA controller, or, if you have a simple linear DMA controller, copy the data into a physically contiguous buffer (you can use dma_alloc_coherent on the PC side too) and then instruct the DMA controller in logic to transfer the data from PC memory to Zynq.

 

It is possible to create a direct AXI link from PC to a memory block (tried that with blockram), but that results in horrible performance (memory read at about 2 MB/s).

0 Kudos
jackfrye11
Explorer
Explorer
1,426 Views
Registered: ‎10-19-2017

How about the other way with a Zynq Linux as master and Ubuntu Linux as slave? Zynq initiates transfer to host running Ubuntu. How could that be done and what kind of throughput could I expect?

 

Thanks

0 Kudos