cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
4,019 Views
Registered: ‎10-13-2011

How can I transfer data from PL to DDR and let Linux on PS access it as need?

In my application we designed a small board based on Zynq, only PS has LpDDR2 memory device to run Linux OS. PL is used to collect data from camera and some sensors.

We want PL to move collected data directly into PS's LpDDR2 through HP port without bothering Linux OS. And Linux OS can access those data and save them into SD card as need .

How can we achieve this?  I studied a little about the MMU in Linux, but still can not figure this out. Do I have to decrease the available memory size for PS, and use the left space as a block device which corresponds to the address PL write data to? Or is there a easier way to do this?

Thanks.

0 Kudos
2 Replies
Highlighted
Xilinx Employee
Xilinx Employee
4,012 Views
Registered: ‎08-02-2011

You will probably want to use one or more DMA engines (AXI DMA and AXI VDMA most likely).

The challenge you have now is to make sure that Linux memory virtualization doesn't mess with your DMA buffers which are accessing physical memory.

A quick solution is to simply reserve a chunk of memory that the OS doesn't use. You can do that by using the memmap bootarg.

See here for more info and other solutions:
http://lwn.net/images/pdf/LDD3/ch15.pdf

Particularly the "Allocating the DMA Buffer" section.
www.xilinx.com
0 Kudos
Highlighted
Observer
Observer
3,977 Views
Registered: ‎10-13-2011

Thanks.

Does that mean I should do something like this:

1. Seperate the space of lpddr2 into two parts, one for Linux OS, the other for PL writing data through HP port.

2. Design a block device driver with DMA engine for reading data from physical address in lpddr2 written by PL.

If yes, does that mean both Linux OS and DMA engine will talk to DDR controller? will it cause any conflicts?

0 Kudos