[meta-xilinx] Linux/FreeRTOS AMP vrings
Wendy Liang
wendy.liang at xilinx.com
Thu Aug 27 19:55:54 PDT 2015
Hi Edward,
> -----Original Message-----
> From: Edward Wingate [mailto:edwingate8 at gmail.com]
> Sent: Thursday, August 27, 2015 4:57 PM
> To: Wendy Liang <jliang at xilinx.com>
> Cc: Magnus Olsson <Mago at hms.se>; meta-xilinx at yoctoproject.org; Veena
> Kumar <veena at xilinx.com>
> Subject: Re: [meta-xilinx] Linux/FreeRTOS AMP vrings
>
> On Thu, Aug 27, 2015 at 3:46 PM, Wendy Liang <wendy.liang at xilinx.com>
> wrote:
> >
> > Linux is the rpmsg master, it will allocate the buffers for tx/rx, CPU1 should use
> the buffers allocated from Linux.
>
> Agreed. For me, Linux is allocating buffers at physical addresses 0x1f440xxx.
> That's the only information CPU1 has about the vring buffers, so it can't do
> anything but use the given buffers. But then Linux, who gave CPU1 those
> addresses in the first place, wants to read from 0x1e440xxx instead when kicked.
[Wendy] This doesn't smell right. Looks like will need to debug the rpmsg bus driver
to see why it didn't put the DMA addr there. Or will need to double check to make
sure the FreeRTOS didn't get the addr wrongly.
>
> > " VRING_ADDR_MASK" is supposed to convert virtual <-> physical addr before
> send/receive.
> > Addr in the vring0 needs to be physical address understood by the other side.
>
> These two statements seem contradictory. If addr in vring0 needs to be physical
> address understood by CPU1, then why is virtual to physical conversion needed?
> But regardless, how would you go about determining exactly what conversion
> needs to take place?
[Wendy] I didn't see the code. I mean when the slave get the phy address of the buffer, you will need to convert it
To the one used by the slave, if slave is using virt addr, you will need to convert it to virt addr. When you add a buf, you will also need to make sure the addr put to the descriptor is the phy addr.
Best Regards,
Wendy
>
> > From what you described, it looks like the assumption doesn't work in your
> case.
>
> Yes, I'd really like to get to bottom of why this doesn't work in my case. Linux is
> obviously writing a physical, not virtual, address to the vring descriptors. But it's
> not the address it will be reading from.
>
> > You can update the virtual <-> physical conversion method.
>
> I went ahead and subtracted 0x01000000 from the (already physical) vring buffer
> address allocated by Linux and Linux is now able to receive data from CPU1.
>
> But I'm really thrown for a loop why Linux gives one address to write, but reads
> from another.
>
> > The ug978 is an example of AMP 2 years ago, you can try to OpenAMP:
> > https://github.com/OpenAMP/open-amp
>
> For better or for worse, I am using Yocto workflow and don't see a simple
> transition to using OpenAMP from Yocto. I can't switch to Petalinux or Mentor
> toolchain as documented in OpenAMP. But I glanced through the documents
> and other than different/more examples, don't see what OpenAMP provides
> that's different from what I'm trying to do now. OpenAMP is also just using
> remoteproc and rpmsg in pretty much the same manner.
>
> >
> > Best Regards,
> > Wendy
> >
>
> Thank you, Wendy, for your response.
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.
More information about the meta-xilinx
mailing list