mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: loic pallardy <loic.pallardy@st.com>
To: Bjorn Andersson <bjorn.andersson@linaro.org>, <s-anna@ti.com>
Cc: <ohad@wizery.com>, <lee.jones@linaro.org>,
	<linux-remoteproc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] remoteproc: core: Add fixed memory region support
Date: Mon, 29 Aug 2016 10:09:48 +0200	[thread overview]
Message-ID: <a56a6ff2-79c5-81d8-0891-a55bae2af184@st.com> (raw)
In-Reply-To: <20160827003244.GL15161@tuxbot>



On 08/27/2016 02:32 AM, Bjorn Andersson wrote:
> On Fri 26 Aug 13:19 PDT 2016, Loic Pallardy wrote:
>
>> Some coprocessors request fixed memory mapping for firmware execution
>> and associated communication linked.
>> Memory resources are defined in firmware resource table.
>> Resource address different from 0x0 and 0xFFFFFFFF is considered as predefined
>
> Do you think we're required to support both 0 and -1 for this?
Hi Bjorn,
You're right, only -1 is needed. SoC can have internal RAM in 0x0 for 
example.
I'll update in a V2.
>
>> and already reserved at system level.
>> In that case, remoteproc core doesn't need to perform any allocation.
>> Memory region access can be managed using memremap/memunmap functions
>>
>> Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
>> ---
>>  drivers/remoteproc/remoteproc_core.c | 61 ++++++++++++++++++++++++++----------
>>  include/linux/remoteproc.h           |  4 +++
>>  2 files changed, 49 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
>> index 18f4286..0ddbb92 100644
>> --- a/drivers/remoteproc/remoteproc_core.c
>> +++ b/drivers/remoteproc/remoteproc_core.c
>> @@ -213,13 +213,25 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
>>  	/* actual size of vring (in bytes) */
>>  	size = PAGE_ALIGN(vring_size(rvring->len, rvring->align));
>>
>> -	/*
>> -	 * Allocate non-cacheable memory for the vring. In the future
>> -	 * this call will also configure the IOMMU for us
>> -	 */
>> -	va = dma_alloc_coherent(dev->parent, size, &dma, GFP_KERNEL);
>> +	rsc = (void *)rproc->table_ptr + rvdev->rsc_offset;
>> +
>> +	/* check if specific memory region requested by firmware */
>> +	if (rsc->vring[i].da != 0 && rsc->vring[i].da != FW_RSC_ADDR_ANY) {
>
> I think we should convert that reserved field in the vring to a "pa";
> allowing this resource to not be 1:1 mapped into the remote. And if
> nothing else just to be consistent with the carveouts and devmem.
In fact vring doesn't have pa because coprocessor diretly access it 
without help of hardware accelerator. On both carveout and devmem, 
hardware accelerators may be used.
That's true having pa field will be more consistent from host pov.

Regards,
Loic

>
>
> @Suman, do you have any input on this?
>
> Regards,
> Bjorn
>

  reply	other threads:[~2016-08-29  8:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 20:19 [PATCH 0/2] Remoteproc: Add predefined coprocessor memory mapping support Loic Pallardy
2016-08-26 20:19 ` [PATCH 1/2] remoteproc: Modify FW_RSC_ADDR_ANY definition Loic Pallardy
2016-08-26 20:19 ` [PATCH 2/2] remoteproc: core: Add fixed memory region support Loic Pallardy
2016-08-27  0:32   ` Bjorn Andersson
2016-08-29  8:09     ` loic pallardy [this message]
2016-08-30 23:13       ` Suman Anna
2016-08-31 16:05         ` loic pallardy
2016-08-31 16:37         ` Bjorn Andersson
2016-08-31 16:55           ` Suman Anna

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=a56a6ff2-79c5-81d8-0891-a55bae2af184@st.com \
    --to=loic.pallardy@st.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=s-anna@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®