I am implementing a design on ZC702 EK with HDMI output based on Analog Devices design. I use openAMP for running linux on CPU0 and baremetal on CPU1. I have tested all the demo applications and everything works fine.
However I am trying to implement an image processing algorithm and I need a shared DDR region for passing image data. I am using reseved-memory nodes on my device tree and the I mmap() the area through /dev/mem, but my application sometimes crushes the system and I am forced to reboot. Is there something wrong on how I implement this or this way cannot work for data passing between processors at all?
This is my tree nodes that i add on analog devices device tree:
reserved-memory{
#address-cells = <0x1>
#size-cells = <0x1>
ranges;
sharedmem@0x3FE00000{
reg = <0x3fe00000 0x200000>
};
};
And this is how I open the memory area in my program:
#define DDR_SIZE (1024*1024*2)
#define DDR_BASE (0x3FE00000)
int mem_file;
void* ddr=NULL;
mem_file = open("/dev/mem", O_RDWR);
ddr = mmap(NULL, DDR_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, mem_file,DDR_BASE);
Thanks, Nikos.
remoteproc@0{
compatible = "xlnx,zynq_remoteproc";
reg = <0x00000000 0x10000000>;
firmware = "firmware";
vring0 = <15>;
vring1 = <14>;
};
To your questions:
* is your application + shared memory are covered in the reserved memory? *
If I understand correctly you mean if my application runs from the reserved memory? If so, then no, my CPU1 application runs at the first MBs of RAM and uses a pointer to 0x3FE00000 to read and write data.
* do you use fixed shared memory or shared memory? *
I am not sure what you mean here. You are talking about the mmap() parameter?
* what's your resource table settings? *
My resource table is the default for openAMP. This is what it looks like:
ELF_START 0x00000000
ELF_END 0x08000000
NUM_VRINGS 0x02
VRING_ALIGN 0x1000
RING_TX 0x08000000
RING_RX 0x08004000
VRING_SIZE 256
Some more info about the application: My linux app uses TX write to send signal to CPU1 to start reading data from DDR area. Then it waits for reply by read RX.
When CPU1 app is done it writes to the buffer and waits. Then CPU0 reads data from the DDR area and thats it. The area of DDR is hardcoded to BM application and the address is 0x3F300000.
Thank you for your time,
Nikos.
From: open...@googlegroups.com [mailto:open...@googlegroups.com]
On Behalf Of vivozhang
Sent: Saturday, August 26, 2017 1:13 AM
To: open-amp <open...@googlegroups.com>
Cc: snspa...@gmail.com
Subject: [open-amp] Re: OpenAMP and reserved DDR
Any progress on this topic? did you make it work?
--
You received this message because you are subscribed to the Google Groups "open-amp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
open-amp+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
Hi Nikos,
Does your linux kernel have this patch:
Best Regards,
Wendy
From: Nikos Spanidis [mailto:snspa...@gmail.com]
Sent: Tuesday, September 12, 2017 10:18 AM
To: Jiaying Liang <jli...@xilinx.com>
Subject: RE: [open-amp] Re: OpenAMP and reserved DDR
Hello and sorry for the late answer,
I wasn't able to make it work for the application I wanted. Unfortunately because of my work I wasn't able to pursue it further so I don't have an answer. If anyone is willing to try it, maybe with a DMA driver for the reserved area, I am looking forward to see their implementation.
Thank you again for your time,
Nikos
Nikos
To unsubscribe from this group and stop receiving emails from it, send an email to open-amp+unsubscribe@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "open-amp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/open-amp/0a5B2AisE50/unsubscribe.
To unsubscribe from this group and all its topics, send an email to open-amp+unsubscribe@googlegroups.com.
From: open...@googlegroups.com [mailto:open...@googlegroups.com]
On Behalf Of Jie Zhang
Sent: Friday, November 10, 2017 3:16 AM
To: open...@googlegroups.com
Subject: RE: [open-amp] Re: OpenAMP and reserved DDR
Hello,
I am also trying use a large block of DDR as shared memory between baremetal and linux in with OpenAmp. However, i met following issues.
1. When i write a block of different data in to memory starting from 0x09000000 in baremetal CPU1 periodically, everything works fine. (Readback data looks ok)But when i read data from the same address in Linux in CPU0, the data stay unchanged. I can get update data only when i stop CPU 1.
[Wendy] it looks like you have cached your memory either in CPU0 or CPU1
You will need to map your memory as non-cacheable memory.
Best Regards,
Wendy
Thank you.
Jie
Nikos
To unsubscribe from this group and stop receiving emails from it, send an email to open-amp+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "open-amp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/open-amp/0a5B2AisE50/unsubscribe.
To unsubscribe from this group and all its topics, send an email to open-amp+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "open-amp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-amp+u...@googlegroups.com.
Thank you.
Jie
Nikos
To unsubscribe from this group and stop receiving emails from it, send an email to open-amp+unsubscribe@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "open-amp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/open-amp/0a5B2AisE50/unsubscribe.
To unsubscribe from this group and all its topics, send an email to open-amp+unsubscribe@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "open-amp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-amp+unsubscribe@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "open-amp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/open-amp/0a5B2AisE50/unsubscribe.
To unsubscribe from this group and all its topics, send an email to open-amp+unsubscribe@googlegroups.com.