All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: maitysanchayan@gmail.com
Cc: sanchayan.maity@toradex.com, stefan.agner@toradex.com,
	linux-remoteproc@vger.kernel.org
Subject: Re: Query on vring allocation in internal SRAM with remoteproc
Date: Thu, 13 Oct 2016 22:43:25 -0700	[thread overview]
Message-ID: <20161014054325.GE8247@tuxbot> (raw)
In-Reply-To: <20161006073023.GA1560@Sanchayan-Arch.localdomain>

On Thu 06 Oct 00:30 PDT 2016, maitysanchayan@gmail.com wrote:

> Hello,
> 

Hi Sanchayan

> I have been working on use of remoteproc and rmpsg for bootup and communication
> between A5 and M4 core on NXP Vybrid[1]. Currently we are using a hacked up rpmsg[2]
> implementation for Vybrid based on NXP's implementation in downstream kernel for iMX7.

Looks like the main difference is the allocation strategy for the vrings.

> We also use remoteproc but currently only for booting the M4 core and would like to
> completely leverage remoteproc for booting and rpmsg communication instead of hacked
> up way, so we can also upstream this.
> 

Sounds good.

> For Vybrid, currently the internal On-chip RAM is being used for the vrings. Initially
> I tried with remoteproc, but Linux remoteproc allocates vrings in it's memory space
> with a call to dma_alloc_coherent. This does not work for Vybrid's case as even using
> RSC_VDEV, rproc_handle_vdev dynamically allocates using DMA API and completely ignores
> requested hardcoded addresses. On M4 side, we use FreeRTOS and openamp which has
> support for rpmsg and remoteproc.
> 

Can you please describe why this doesn't work? Why do you need the
vrings to be allocated in on-chip RAM?

I presume you use the virtio_rpmsg_bus implementation, which would end
up allocating the actual communication buffers with dma_alloc_coherent()
later anyways - so why use expensive on-chip memory for the vrings?

> The comment with rproc_handle_vdev mentions to use RSC_DEVMEM to map the required da
> to physical address. Reading the comments along with fw_rsc_devmem and above, I am
> not clear on what the firmware resource table should be. If I want the known internal
> OCRAM addresses to be used, shall I specify da and pa same in firmware resource table
> while using RSC_DEVMEM? Am not exactly clear on how the vrings will be allocated and
> handled in this case. It seems to have calls to iommu while we have no iommu.
> 

Ignore that ;) Let's try to figure out why you need this and how we can
support it in a proper way instead (you're not the only one stating this
need)

> There seems to have been patches for exactly this usecase of internal memories [3]
> using ioremap_nocache, but that seems to have never made it through?
> 

Thanks for the link, I have not seen that patch before. In the
recent discussions on the topic I suggested that instead of trusting the
resource table we would make it possible for the remoteproc driver to
register ioremapped "carveouts".

But as its presented it would allow for positioning data and code
segments like this, but further work is needed for this to back vrings
(I have some ideas on this though...)

Regards,
Bjorn

> Thanks & Regards,
> Sanchayan.
> 
> [1]. http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/vfxxx-controller/f-series/arm-cortex-a5-plus-cortex-m4-mpus-1.5-mb-sram-lcd-security-ethernet-l2-switch:VF6xx
> [2]. https://lkml.org/lkml/2016/1/6/182
> [3]. http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/270534.html

  parent reply	other threads:[~2016-10-14  5:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06  7:30 Query on vring allocation in internal SRAM with remoteproc maitysanchayan
2016-10-13  3:49 ` maitysanchayan
2016-10-14  5:43 ` Bjorn Andersson [this message]
2016-10-17 12:25   ` maitysanchayan
2016-10-17 17:52     ` Wendy Liang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161014054325.GE8247@tuxbot \
    --to=bjorn.andersson@linaro.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=maitysanchayan@gmail.com \
    --cc=sanchayan.maity@toradex.com \
    --cc=stefan.agner@toradex.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.