[Wendy] It is possible, but you will need to have a driver in kernel space to export the DMA memory to userspace. you can take a look at the UIO uio_dmem_genirq.c
You can use that driver with some customisation, or you can have your RPMsgremoteproc kernel driver to export the DMA shared memory directly or register a UIO dmem device.
This is on the Linux side.
On the remote side, you will need to map those memory as non-cacheable memory from initialization.
At the moment, resource table doesn’t cover this type of memory.
Best Regards,
Wendy
--
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.
dmabuf1 {
compatible = "dmem-uio";
reg = < 0x1F000000 0x400000 >;
};HI Ed,
But if you just do that mapping in the DTS, the memory is mapped as device memory, I think you will need to use some UIO dmem platform property to specify your DMA memory region. I am not sure if you can do that with DTS.
Best Regards,
Wendy
HI Ed,
But if you just do that mapping in the DTS, the memory is mapped as device memory, I think you will need to use some UIO dmem platform property to specify your DMA memory region. I am not sure if you can do that with DTS.
From: open...@googlegroups.com [mailto:open...@googlegroups.com]
On Behalf Of Ed Wingate
Sent: Friday, December 08, 2017 2:02 PM
To: open-amp <open...@googlegroups.com>
Subject: Re: [open-amp] AMP shared memory configuration
On Thursday, 7 December 2017 17:41:36 UTC-8, Jiaying Liang wrote:
HI Ed,
But if you just do that mapping in the DTS, the memory is mapped as device memory, I think you will need to use some UIO dmem platform property to specify your DMA memory region. I am not sure if you can do that with DTS.
Hi Wendy,
I haven't been able to try uio dmem driver as-is yet. Been having trouble getting uio modules into my Yocto images. But if I were to customize uio_dmem_genirq.c or make my rpmsg remoteproc driver export DMA memory, I really wouldn't know what to do differently than what is already in uio_dmem_genirq.c and so it would be doing pretty much the same thing as that driver (map as device memory).
What would I have to do differently to map a DMA block that is in DDR RAM so that it is not device memory?
[Wendy] DMA block it needs to be mapped as normal memory instead, in uio_dmem, when you open the UIO device, it will allocate the DMA coherent memory, you can you can check the UIO sysfs directory mapping file to get the DMA address .
Also, how is "export DMA memory" different from "register a UIO dmem device"? I know the latter would create a /dev/uioX device; how would the former be exposed/used?
[Wendy] register a UIO dmem will not work, you will need to set the platform parameter “num_dynamic_regions”.
Can you point me to examples of exporting DMA memory that I can use in my rpmsg remotproc driver?
[Wendy] you can check the mmap function in uio.c, to see how the mmap() is implemented. Uio_dmem_genirq.c shows how to allocate the coherent DMA memory from the driver, you can also consider DMA buffer: https://www.kernel.org/doc/html/v4.12/media/uapi/v4l/dmabuf.html
I haven’t used DMA buffer, you should be able to find some kernel document about it.
Best Regards,
Wendy
Thanks,
Ed
[Wendy] register a UIO dmem will not work, you will need to set the platform parameter “num_dynamic_regions”.