From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Iuliana Prodan <iuliana.prodan@nxp.com>
Cc: "Iuliana Prodan (OSS)" <iuliana.prodan@oss.nxp.com>,
Bjorn Andersson <andersson@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
"S.J. Wang" <shengjiu.wang@nxp.com>,
Fabio Estevam <festevam@gmail.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Mpuaudiosw <Mpuaudiosw@nxp.com>, linux-imx <linux-imx@nxp.com>,
linux-remoteproc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Pengutronix Kernel Team <kernel@pengutronix.de>,
LnxRevLi <LnxRevLi@nxp.com>
Subject: Re: [PATCH 1/2] remoteproc: imx_dsp_rproc: add mandatory find_loaded_rsc_table op
Date: Mon, 4 Sep 2023 15:16:28 -0600 [thread overview]
Message-ID: <ZPZJLJpL+f9nB1cn@p14s> (raw)
In-Reply-To: <03d7c703-81cb-20f9-aaf8-2ab8ca3e7138@nxp.com>
On Tue, Jul 18, 2023 at 06:40:53PM +0300, Iuliana Prodan wrote:
>
> On 7/18/2023 6:23 PM, Mathieu Poirier wrote:
> > On Tue, Jul 18, 2023 at 11:25:03AM +0300, Iuliana Prodan wrote:
> > > On 7/17/2023 8:42 PM, Mathieu Poirier wrote:
> > > > On Thu, Jul 13, 2023 at 01:42:20AM +0300, Iuliana Prodan (OSS) wrote:
> > > > > From: Iuliana Prodan <iuliana.prodan@nxp.com>
> > > > >
> > > > > Add the .find_loaded_rsc_table operation for i.MX DSP.
> > > > > We need it for inter-process communication between DSP
> > > > > and main core.
> > > > >
> > > > > This callback is used to find the resource table (defined
> > > > > in remote processor linker script) where the address of the
> > > > > vrings along with the other allocated resources (carveouts etc)
> > > > > are stored.
> > > > > If this is not found, the vrings are not allocated and
> > > > > the IPC between cores will not work.
> > > > Is there a constraint on the system memory the M4 can address? If so there
> > > > will be a need to declare address ranges for vrings and buffers in reserved
> > > > memory in the DT.
> > > >
> > > > Thanks,
> > > > Mathieu
> > > Hi Mathieu,
> > >
> > > No, there is no constraint on memory.
> > >
> > > We want the Cortex A core to communicate with the HiFi4 DSP.
> > > The Cortex A is in charge of starting the DSP and loading the firmware in
> > > HiFi4's memory.
> > > When using rpmsg for IPC, the Cortex A needs to find the resource table
> > > (defined in the DSP linker script) and this is done using
> > > .find_loaded_rsc_table callback.
> > >
> > > For the DT, we are using a (not upstream) device tree where we have the
> > > reserved-memory for dsp_vdev0vring0, dsp_vdev0vring1 and dsp_vdev0buffer.
> > That is the part I'm interested in. Don't we need the reserved-memory entries?
> > Otherwise the M4 may not be able to access the memory chosen by the application
> > processor, most likely leading to a crash.
>
> This kernel module (imx_dsp_rproc) is used only for DSP.
> For M4 core we use imx_rproc.
>
The point here is that if I merge this patch and someone tries to load a
firmware image that has a resource table, the system will likely crash because
reserved memories haven't been specified in the DT.
Unless there is a very good reason not to, I would like to see the companion DT
changes submitted with this patch so that the feature is complete.
> Iulia
>
> > > Iulia
> > >
> > >
> > > > > Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
> > > > > ---
> > > > > drivers/remoteproc/imx_dsp_rproc.c | 1 +
> > > > > 1 file changed, 1 insertion(+)
> > > > >
> > > > > diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
> > > > > index d95fa5586189..b5634507d953 100644
> > > > > --- a/drivers/remoteproc/imx_dsp_rproc.c
> > > > > +++ b/drivers/remoteproc/imx_dsp_rproc.c
> > > > > @@ -941,6 +941,7 @@ static const struct rproc_ops imx_dsp_rproc_ops = {
> > > > > .kick = imx_dsp_rproc_kick,
> > > > > .load = imx_dsp_rproc_elf_load_segments,
> > > > > .parse_fw = imx_dsp_rproc_parse_fw,
> > > > > + .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
> > > > > .sanity_check = rproc_elf_sanity_check,
> > > > > .get_boot_addr = rproc_elf_get_boot_addr,
> > > > > };
> > > > > --
> > > > > 2.17.1
> > > > >
WARNING: multiple messages have this Message-ID (diff)
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Iuliana Prodan <iuliana.prodan@nxp.com>
Cc: "Iuliana Prodan (OSS)" <iuliana.prodan@oss.nxp.com>,
Bjorn Andersson <andersson@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
"S.J. Wang" <shengjiu.wang@nxp.com>,
Fabio Estevam <festevam@gmail.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Mpuaudiosw <Mpuaudiosw@nxp.com>, linux-imx <linux-imx@nxp.com>,
linux-remoteproc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Pengutronix Kernel Team <kernel@pengutronix.de>,
LnxRevLi <LnxRevLi@nxp.com>
Subject: Re: [PATCH 1/2] remoteproc: imx_dsp_rproc: add mandatory find_loaded_rsc_table op
Date: Mon, 4 Sep 2023 15:16:28 -0600 [thread overview]
Message-ID: <ZPZJLJpL+f9nB1cn@p14s> (raw)
In-Reply-To: <03d7c703-81cb-20f9-aaf8-2ab8ca3e7138@nxp.com>
On Tue, Jul 18, 2023 at 06:40:53PM +0300, Iuliana Prodan wrote:
>
> On 7/18/2023 6:23 PM, Mathieu Poirier wrote:
> > On Tue, Jul 18, 2023 at 11:25:03AM +0300, Iuliana Prodan wrote:
> > > On 7/17/2023 8:42 PM, Mathieu Poirier wrote:
> > > > On Thu, Jul 13, 2023 at 01:42:20AM +0300, Iuliana Prodan (OSS) wrote:
> > > > > From: Iuliana Prodan <iuliana.prodan@nxp.com>
> > > > >
> > > > > Add the .find_loaded_rsc_table operation for i.MX DSP.
> > > > > We need it for inter-process communication between DSP
> > > > > and main core.
> > > > >
> > > > > This callback is used to find the resource table (defined
> > > > > in remote processor linker script) where the address of the
> > > > > vrings along with the other allocated resources (carveouts etc)
> > > > > are stored.
> > > > > If this is not found, the vrings are not allocated and
> > > > > the IPC between cores will not work.
> > > > Is there a constraint on the system memory the M4 can address? If so there
> > > > will be a need to declare address ranges for vrings and buffers in reserved
> > > > memory in the DT.
> > > >
> > > > Thanks,
> > > > Mathieu
> > > Hi Mathieu,
> > >
> > > No, there is no constraint on memory.
> > >
> > > We want the Cortex A core to communicate with the HiFi4 DSP.
> > > The Cortex A is in charge of starting the DSP and loading the firmware in
> > > HiFi4's memory.
> > > When using rpmsg for IPC, the Cortex A needs to find the resource table
> > > (defined in the DSP linker script) and this is done using
> > > .find_loaded_rsc_table callback.
> > >
> > > For the DT, we are using a (not upstream) device tree where we have the
> > > reserved-memory for dsp_vdev0vring0, dsp_vdev0vring1 and dsp_vdev0buffer.
> > That is the part I'm interested in. Don't we need the reserved-memory entries?
> > Otherwise the M4 may not be able to access the memory chosen by the application
> > processor, most likely leading to a crash.
>
> This kernel module (imx_dsp_rproc) is used only for DSP.
> For M4 core we use imx_rproc.
>
The point here is that if I merge this patch and someone tries to load a
firmware image that has a resource table, the system will likely crash because
reserved memories haven't been specified in the DT.
Unless there is a very good reason not to, I would like to see the companion DT
changes submitted with this patch so that the feature is complete.
> Iulia
>
> > > Iulia
> > >
> > >
> > > > > Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
> > > > > ---
> > > > > drivers/remoteproc/imx_dsp_rproc.c | 1 +
> > > > > 1 file changed, 1 insertion(+)
> > > > >
> > > > > diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
> > > > > index d95fa5586189..b5634507d953 100644
> > > > > --- a/drivers/remoteproc/imx_dsp_rproc.c
> > > > > +++ b/drivers/remoteproc/imx_dsp_rproc.c
> > > > > @@ -941,6 +941,7 @@ static const struct rproc_ops imx_dsp_rproc_ops = {
> > > > > .kick = imx_dsp_rproc_kick,
> > > > > .load = imx_dsp_rproc_elf_load_segments,
> > > > > .parse_fw = imx_dsp_rproc_parse_fw,
> > > > > + .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
> > > > > .sanity_check = rproc_elf_sanity_check,
> > > > > .get_boot_addr = rproc_elf_get_boot_addr,
> > > > > };
> > > > > --
> > > > > 2.17.1
> > > > >
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-09-04 21:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 22:42 [PATCH 1/2] remoteproc: imx_dsp_rproc: add mandatory find_loaded_rsc_table op Iuliana Prodan (OSS)
2023-07-12 22:42 ` Iuliana Prodan (OSS)
2023-07-13 10:04 ` Daniel Baluta
2023-07-13 10:04 ` Daniel Baluta
2023-07-17 17:42 ` Mathieu Poirier
2023-07-17 17:42 ` Mathieu Poirier
2023-07-18 8:25 ` Iuliana Prodan
2023-07-18 8:25 ` Iuliana Prodan
2023-07-18 15:23 ` Mathieu Poirier
2023-07-18 15:23 ` Mathieu Poirier
2023-07-18 15:40 ` Iuliana Prodan
2023-07-18 15:40 ` Iuliana Prodan
2023-09-04 21:16 ` Mathieu Poirier [this message]
2023-09-04 21:16 ` Mathieu Poirier
2023-09-04 22:31 ` Iuliana Prodan
2023-09-04 22:31 ` Iuliana Prodan
-- strict thread matches above, loose matches on Subject: below --
2023-09-11 22:44 [PATCH 0/2] Rpmsg support for i.MX DSP with resource table Iuliana Prodan (OSS)
2023-09-11 22:44 ` [PATCH 1/2] remoteproc: imx_dsp_rproc: add mandatory find_loaded_rsc_table op Iuliana Prodan (OSS)
2023-09-11 22:44 ` Iuliana Prodan (OSS)
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=ZPZJLJpL+f9nB1cn@p14s \
--to=mathieu.poirier@linaro.org \
--cc=LnxRevLi@nxp.com \
--cc=Mpuaudiosw@nxp.com \
--cc=andersson@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=festevam@gmail.com \
--cc=iuliana.prodan@nxp.com \
--cc=iuliana.prodan@oss.nxp.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=shengjiu.wang@nxp.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.