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: 
Participant ejubenville
Participant
6,045 Views
Registered: ‎10-17-2008

How to disable data caching on ZedBoard Linux

Jump to solution

I have reserved the last 16 MB of the ZedBoard's DDR3 memory so Linux won't use it, and I can use it for data exchange with Zynq programmable logic.  From Linux user space, I use mmap and /dev/mem to read/write the memory.  However, my PL doesn't see the data that I write.  I suspect a caching issue.  How can I disable DDR3 data caching from Linux for specific ranges of memory? 

 

I've seen the Xil functions for bare-metal applications.  Are there equivalent functions in Linux?

 

0 Kudos
1 Solution

Accepted Solutions
Participant ejubenville
Participant
7,727 Views
Registered: ‎10-17-2008

Re: How to disable data caching on ZedBoard Linux

Jump to solution

The original problem I posted is now solved.  It wasn't a caching issue, but a problem with the wrapper logic associated with the DataMover I had instantiated in the PL to read the data from memory.  I have that direction (PS write, PL read) working now.

View solution in original post

0 Kudos
5 Replies
Scholar austin
Scholar
6,044 Views
Registered: ‎02-27-2008

Re: How to disable data caching on ZedBoard Linux

Jump to solution

DDR3,

 

Is controlled by the processor side.  If you have disabled it, is not there, so the programmable logic cannot get to it, either.

 

You might also try posting on zedbioard.org, as Avnet has engineers who answer questions on their forums.

 

 

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Participant ejubenville
Participant
6,023 Views
Registered: ‎10-17-2008

Re: How to disable data caching on ZedBoard Linux

Jump to solution

Although I have disabled the kernel from using the upper 16 MB as virtual memory, that memory is still known to the memory controller, and I can still read and write it in Linux through mmap of /dev/mem. 

 

Isn't there some way to tell the kernel to flush all data cache?  Conceivably, such a command would be implemented with an ARM command that would apply to all memory, not just the memory that the kernel has allocated.

0 Kudos
Scholar austin
Scholar
6,011 Views
Registered: ‎02-27-2008

Re: How to disable data caching on ZedBoard Linux

Jump to solution

http://forums.arm.com/index.php?/topic/15059-flush-cache/

 

There is a tremendous amount of stuff on the ARM sites....

 

 

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Explorer
Explorer
5,979 Views
Registered: ‎06-23-2013

Re: How to disable data caching on ZedBoard Linux

Jump to solution

   The PL DMA engine reads a readbuffer of PB_LENGTH initialized to 0x5a and writes to writebuffer of PB_LENGTH

initialized to 0x96.

 

Before today, devmem2 was showing the original data in the writebuffer, but with the following code line that flushes the cache, then evident PL DMA engine overwrote the writebuffer from the readbuffer.

 

 write_phys_addr = (u32) dma_map_single(NULL, vbufptrs[PB_PLWRITE], PB_LENGTH, DMA_FROM_DEVICE);


I am proceeding to try dma_sync_single_for_device() and dma_sync_single_for_cpu().

If this helps, please upvote it.

dogbytes
0 Kudos
Participant ejubenville
Participant
7,728 Views
Registered: ‎10-17-2008

Re: How to disable data caching on ZedBoard Linux

Jump to solution

The original problem I posted is now solved.  It wasn't a caching issue, but a problem with the wrapper logic associated with the DataMover I had instantiated in the PL to read the data from memory.  I have that direction (PS write, PL read) working now.

View solution in original post

0 Kudos