05-05-2017 01:23 PM
I have an AMP system based on XAPP1078 with Linux in the first 768M and the bare-metal application running in the remaining 256M. I want the Linux application to access some of the memory in the bare-metal application range, but am having problems. For example, I can create a variable in bare metal and print it's address and fill it with some value. When I try to peek that address (300198A8), I see 0. I even wrote a program to scan all 1G of memory for the pattern written by the bare-metal application but cannot find it. Linux clearly sees some memory at 0x30000000-0x3fffffff, but it isn't what the bare-metal application sees. Any idea what's going on?
FWIW, I'm using Petalinux 2014.4.
Kernel command line: console=ttyPS1,115200 earlyprintk maxcpus=1 mem=768M
In my system-conf.dtsi I have:
device_type = "memory";
reg = <0x0 0x30000000>;
With reg = <0x0 0x40000000>; I saw the same result.
Do I need some additional device tree addition?
Or some call to Xil_SetTlbAttributes() in the bare-metal application to make the memory sharable?
06-19-2017 09:06 AM
03-09-2018 02:09 PM
You can just use mmap() in linux and map the memory. It is uncached so very low performance, BUT it is possible to use NEON instructions to block copy the uncached to a cached area and then access the copy (or vice versa).
03-09-2018 02:11 PM
Also note that according to UG1079, when you define USE_AMP it messes up the virtual to physical mapping for core 1 so the logical address may not match the physical address.