Sharing large amounts of memory BareMetal<->LInux

531 views
Skip to first unread message

Pavel B

unread,
Jul 12, 2016, 7:14:23 AM7/12/16
to open-amp
Hi

I'm using the the Zynq zc706 platform for image processing.
The image is aquired by the PL, pre-processed by the BareMetal core and then graphically processed by the Linux Core.
To allow this, I need to transfer large amounts of memory (~MB) between the three modules. What is the best way to do this using OpenAMP?

To my understanding, the OpenAMP messaging method can't be used by a DMA and can't be used to transfer MB easily because of the limited OCM memory.

Is there an alternative way - perhaps sharing DDR between the two cores to allow this?

Thank you,
Pavel

Jiaying Liang

unread,
Jul 12, 2016, 12:32:47 PM7/12/16
to open...@googlegroups.com

Hi Pavel,

 

From: open...@googlegroups.com [mailto:open...@googlegroups.com] On Behalf Of Pavel B
Sent: Tuesday, July 12, 2016 4:14 AM
To: open-amp
Subject: [open-amp] Sharing large amounts of memory BareMetal<->LInux

 

Hi

 

I'm using the the Zynq zc706 platform for image processing.

The image is aquired by the PL, pre-processed by the BareMetal core and then graphically processed by the Linux Core.

To allow this, I need to transfer large amounts of memory (~MB) between the three modules. What is the best way to do this using OpenAMP?

[Wendy] OpenAMP uses rpmsg/virtio for shared buffers. It is not ready for large buffers yet.

In this case, you can use rpmsg/virtio to transfer the pointer of the your DMA memory.

Some community member mentioned about making use of virtio chained buffer for large buffers, maybe they can comment here.

 

To my understanding, the OpenAMP messaging method can't be used by a DMA and can't be used to transfer MB easily because of the limited OCM memory.

[Wendy] You can use DDR memory. OCM memory is also too small

You will need to make sure you owned the buffer when you do the DMA.

There was zero copy patch posted to this mailing list before, you can have a look at the patch.

And other community member can comment about it.

 

Is there an alternative way - perhaps sharing DDR between the two cores to allow this?

[Wendy] As mentioned before, current rpmsg/virtio doesn’t allow you to do this. If you want to just

Use the current OpenAMP, you can use it to transfer the pointers and control messages.

However, some ideas on large buffers and zero copy in this community may help you.

 

Thank you,

Pavel

--
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.
For more options, visit https://groups.google.com/d/optout.



This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

Pavel B

unread,
Jul 13, 2016, 11:34:48 AM7/13/16
to open-amp
Thank you for your answer!

Sharing a DDR pointer could do the job.
But the linux memory is mapped to 0x10000000 to 0x4.. whereas the Bare Metal is 0x0.. to 0x10000000.
How can they share a physical address?

Is there a way to declare a certain address space shared between the cores?

Thanks,
Pavel

Jiaying Liang

unread,
Jul 13, 2016, 7:23:10 PM7/13/16
to open...@googlegroups.com

Hi Pavel,

 

I am not sure what exactly you are asking for.

 

The address you have is likely from the Xilinx Zynq demo.

Linux is able to access “0 to 0x10000000”, if you look at the demo device tree from Xilinx, you will see it is specified in “reg” of the zynq remoteproc device node. The Zynq remoteproc kernel driver declares it as DMA memory.

 

In order to access the DMA memory from remote, you can map your memory in the remote application. You can refer to the https://github.com/OpenAMP/open-amp/blob/master/lib/system/generic/machine/zynq7/machine_system.c, the platform_map_mem_region() function.

 

 

Best Regards,

Wendy

javier....@gmail.com

unread,
Nov 14, 2017, 5:53:51 AM11/14/17
to open-amp
Hello !!

We are working with ZC702 FPGA platform and Petalinux 2016.3. We have petalinux running in CPU0 whereas a baremetal application is running in CPU1. When we use the baremetal application alone everything works fine: DMA and interrupts are working. However, when using petalinux for CPU0 and baremetal for CPU1 we are having some issues. It seems DMA is not reading, our buffer is initializated to known values, but data is not being updated in DDR (its values never change). However, if we executed this code standalone (without petalinux) everything works fine. Anyone knows what can be happening? There's anything we have to configure when using petalinux along with a baremetal application which utilizes DMA? Is petalinux taking control over DMA and this is the cause our application is not running properly?


thx in advance,
Javier

Jiaying Liang

unread,
Nov 14, 2017, 3:54:55 PM11/14/17
to open-amp

Hi Javier,


It looks like your memory is still cached, or you haven't setup your DMA transaction properly.


As this question is about PetaLinux, please raise the issue to Xilinx support portal: https://www.xilinx.com/support.html#serviceportal


Xilinx support will follow up your question.


Best Regards,

Wendy



From: open...@googlegroups.com <open...@googlegroups.com> on behalf of javier....@gmail.com <javier....@gmail.com>
Sent: Tuesday, November 14, 2017 2:53 AM
To post to this group, send an email to open...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages