* [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc
@ 2024-07-19 8:36 Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 1/4] remoteproc: imx_rproc: correct ddr alias for i.MX8M Peng Fan (OSS)
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Peng Fan (OSS) @ 2024-07-19 8:36 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Daniel Baluta,
Iuliana Prodan, Marek Vasut
Cc: linux-remoteproc, imx, linux-arm-kernel, linux-kernel, Peng Fan,
Terry Lv
This patchset is to upstream a few patches that in NXP downstream for
quite sometime. For patches directly cherry-picked from NXP downstream,
I keep the R-b tags.
Patch 1 is a minor fix to DDR alias.
Patch 2 was sent out before,
https://patchwork.kernel.org/project/linux-remoteproc/patch/20220111033333.403448-1-peng.fan@oss.nxp.com/#25144792
this is just a resend
Patch 3 is to avoid mu interrupt trigger earlier.
Patch 4 is merge small area to support elf that has large section
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in v2:
- Add R-b for patch 1,2,4
- Add Fixes tag for patch 3
- Drop downstream R-b tag
- Drop patch 5,6 which will be in a new patchset for 7ULP
- Link to v1: https://lore.kernel.org/r/20240712-imx_rproc-v1-0-7bcf6732d328@nxp.com
---
Peng Fan (4):
remoteproc: imx_rproc: correct ddr alias for i.MX8M
remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table
remoteproc: imx_rproc: initialize workqueue earlier
remoteproc: imx_rproc: merge TCML/U
drivers/remoteproc/imx_rproc.c | 37 +++++++++++++++++++++----------------
1 file changed, 21 insertions(+), 16 deletions(-)
---
base-commit: f477dd6eede3ecedc8963478571d99ec3bf3f762
change-id: 20240712-imx_rproc-25f3ab753c58
Best regards,
--
Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/4] remoteproc: imx_rproc: correct ddr alias for i.MX8M
2024-07-19 8:36 [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Peng Fan (OSS)
@ 2024-07-19 8:36 ` Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 2/4] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table Peng Fan (OSS)
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Peng Fan (OSS) @ 2024-07-19 8:36 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Daniel Baluta,
Iuliana Prodan, Marek Vasut
Cc: linux-remoteproc, imx, linux-arm-kernel, linux-kernel, Peng Fan,
Terry Lv
From: Peng Fan <peng.fan@nxp.com>
The DDR Alias address should be 0x40000000 according to RM, so correct
it.
Fixes: 4ab8f9607aad ("remoteproc: imx_rproc: support i.MX8MQ/M")
Reported-by: Terry Lv <terry.lv@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/remoteproc/imx_rproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 144c8e9a642e..3c8b64db8823 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -210,7 +210,7 @@ static const struct imx_rproc_att imx_rproc_att_imx8mq[] = {
/* QSPI Code - alias */
{ 0x08000000, 0x08000000, 0x08000000, 0 },
/* DDR (Code) - alias */
- { 0x10000000, 0x80000000, 0x0FFE0000, 0 },
+ { 0x10000000, 0x40000000, 0x0FFE0000, 0 },
/* TCML */
{ 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN | ATT_IOMEM},
/* TCMU */
--
2.37.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/4] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table
2024-07-19 8:36 [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 1/4] remoteproc: imx_rproc: correct ddr alias for i.MX8M Peng Fan (OSS)
@ 2024-07-19 8:36 ` Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 3/4] remoteproc: imx_rproc: initialize workqueue earlier Peng Fan (OSS)
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Peng Fan (OSS) @ 2024-07-19 8:36 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Daniel Baluta,
Iuliana Prodan, Marek Vasut
Cc: linux-remoteproc, imx, linux-arm-kernel, linux-kernel, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
If there is a resource table device tree node, use the address as
the resource table address, otherwise use the address(where
.resource_table section loaded) inside the Cortex-M elf file.
And there is an update in NXP SDK that Resource Domain Control(RDC)
enabled to protect TCM, linux not able to write the TCM space when
updating resource table status and cause kernel dump. So use the address
from device tree could avoid kernel dump.
Note: NXP M4 SDK not check resource table update, so it does not matter
use whether resource table address specified in elf file or in device
tree. But to reflect the fact that if people specific resource table
address in device tree, it means people are aware and going to use it,
not the address specified in elf file.
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/remoteproc/imx_rproc.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 3c8b64db8823..48c48b53a3aa 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -666,6 +666,17 @@ static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc
return (struct resource_table *)priv->rsc_table;
}
+static struct resource_table *
+imx_rproc_elf_find_loaded_rsc_table(struct rproc *rproc, const struct firmware *fw)
+{
+ struct imx_rproc *priv = rproc->priv;
+
+ if (priv->rsc_table)
+ return (struct resource_table *)priv->rsc_table;
+
+ return rproc_elf_find_loaded_rsc_table(rproc, fw);
+}
+
static const struct rproc_ops imx_rproc_ops = {
.prepare = imx_rproc_prepare,
.attach = imx_rproc_attach,
@@ -676,7 +687,7 @@ static const struct rproc_ops imx_rproc_ops = {
.da_to_va = imx_rproc_da_to_va,
.load = rproc_elf_load_segments,
.parse_fw = imx_rproc_parse_fw,
- .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
+ .find_loaded_rsc_table = imx_rproc_elf_find_loaded_rsc_table,
.get_loaded_rsc_table = imx_rproc_get_loaded_rsc_table,
.sanity_check = rproc_elf_sanity_check,
.get_boot_addr = rproc_elf_get_boot_addr,
--
2.37.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/4] remoteproc: imx_rproc: initialize workqueue earlier
2024-07-19 8:36 [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 1/4] remoteproc: imx_rproc: correct ddr alias for i.MX8M Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 2/4] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table Peng Fan (OSS)
@ 2024-07-19 8:36 ` Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 4/4] remoteproc: imx_rproc: merge TCML/U Peng Fan (OSS)
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Peng Fan (OSS) @ 2024-07-19 8:36 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Daniel Baluta,
Iuliana Prodan, Marek Vasut
Cc: linux-remoteproc, imx, linux-arm-kernel, linux-kernel, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Initialize workqueue before requesting mailbox channel, otherwise if
mailbox interrupt comes before workqueue ready, the imx_rproc_rx_callback
will trigger issue.
Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/remoteproc/imx_rproc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 48c48b53a3aa..9e99bb27c033 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -1087,6 +1087,8 @@ static int imx_rproc_probe(struct platform_device *pdev)
return -ENOMEM;
}
+ INIT_WORK(&priv->rproc_work, imx_rproc_vq_work);
+
ret = imx_rproc_xtr_mbox_init(rproc);
if (ret)
goto err_put_wkq;
@@ -1105,8 +1107,6 @@ static int imx_rproc_probe(struct platform_device *pdev)
if (ret)
goto err_put_scu;
- INIT_WORK(&priv->rproc_work, imx_rproc_vq_work);
-
if (rproc->state != RPROC_DETACHED)
rproc->auto_boot = of_property_read_bool(np, "fsl,auto-boot");
--
2.37.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 4/4] remoteproc: imx_rproc: merge TCML/U
2024-07-19 8:36 [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Peng Fan (OSS)
` (2 preceding siblings ...)
2024-07-19 8:36 ` [PATCH v2 3/4] remoteproc: imx_rproc: initialize workqueue earlier Peng Fan (OSS)
@ 2024-07-19 8:36 ` Peng Fan (OSS)
2024-07-19 8:52 ` [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Daniel Baluta
2024-07-29 14:59 ` Mathieu Poirier
5 siblings, 0 replies; 7+ messages in thread
From: Peng Fan (OSS) @ 2024-07-19 8:36 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Daniel Baluta,
Iuliana Prodan, Marek Vasut
Cc: linux-remoteproc, imx, linux-arm-kernel, linux-kernel, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Merge contiguous TCML/U regions into one to avoid load elf files which
has large sections failure.
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/remoteproc/imx_rproc.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 9e99bb27c033..552fccebf7e2 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -119,20 +119,16 @@ struct imx_rproc {
static const struct imx_rproc_att imx_rproc_att_imx93[] = {
/* dev addr , sys addr , size , flags */
/* TCM CODE NON-SECURE */
- { 0x0FFC0000, 0x201C0000, 0x00020000, ATT_OWN | ATT_IOMEM },
- { 0x0FFE0000, 0x201E0000, 0x00020000, ATT_OWN | ATT_IOMEM },
+ { 0x0FFC0000, 0x201C0000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* TCM CODE SECURE */
- { 0x1FFC0000, 0x201C0000, 0x00020000, ATT_OWN | ATT_IOMEM },
- { 0x1FFE0000, 0x201E0000, 0x00020000, ATT_OWN | ATT_IOMEM },
+ { 0x1FFC0000, 0x201C0000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* TCM SYS NON-SECURE*/
- { 0x20000000, 0x20200000, 0x00020000, ATT_OWN | ATT_IOMEM },
- { 0x20020000, 0x20220000, 0x00020000, ATT_OWN | ATT_IOMEM },
+ { 0x20000000, 0x20200000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* TCM SYS SECURE*/
- { 0x30000000, 0x20200000, 0x00020000, ATT_OWN | ATT_IOMEM },
- { 0x30020000, 0x20220000, 0x00020000, ATT_OWN | ATT_IOMEM },
+ { 0x30000000, 0x20200000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* DDR */
{ 0x80000000, 0x80000000, 0x10000000, 0 },
@@ -211,10 +207,8 @@ static const struct imx_rproc_att imx_rproc_att_imx8mq[] = {
{ 0x08000000, 0x08000000, 0x08000000, 0 },
/* DDR (Code) - alias */
{ 0x10000000, 0x40000000, 0x0FFE0000, 0 },
- /* TCML */
- { 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN | ATT_IOMEM},
- /* TCMU */
- { 0x20000000, 0x00800000, 0x00020000, ATT_OWN | ATT_IOMEM},
+ /* TCML/U */
+ { 0x1FFE0000, 0x007E0000, 0x00040000, ATT_OWN | ATT_IOMEM},
/* OCRAM_S */
{ 0x20180000, 0x00180000, 0x00008000, ATT_OWN },
/* OCRAM */
--
2.37.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc
2024-07-19 8:36 [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Peng Fan (OSS)
` (3 preceding siblings ...)
2024-07-19 8:36 ` [PATCH v2 4/4] remoteproc: imx_rproc: merge TCML/U Peng Fan (OSS)
@ 2024-07-19 8:52 ` Daniel Baluta
2024-07-29 14:59 ` Mathieu Poirier
5 siblings, 0 replies; 7+ messages in thread
From: Daniel Baluta @ 2024-07-19 8:52 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Daniel Baluta,
Iuliana Prodan, Marek Vasut, linux-remoteproc, imx,
linux-arm-kernel, linux-kernel, Peng Fan, Terry Lv
On Fri, Jul 19, 2024 at 11:27 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> This patchset is to upstream a few patches that in NXP downstream for
> quite sometime. For patches directly cherry-picked from NXP downstream,
> I keep the R-b tags.
>
> Patch 1 is a minor fix to DDR alias.
> Patch 2 was sent out before,
> https://patchwork.kernel.org/project/linux-remoteproc/patch/20220111033333.403448-1-peng.fan@oss.nxp.com/#25144792
> this is just a resend
> Patch 3 is to avoid mu interrupt trigger earlier.
> Patch 4 is merge small area to support elf that has large section
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Neat and clean.
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Thanks Peng!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc
2024-07-19 8:36 [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Peng Fan (OSS)
` (4 preceding siblings ...)
2024-07-19 8:52 ` [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Daniel Baluta
@ 2024-07-29 14:59 ` Mathieu Poirier
5 siblings, 0 replies; 7+ messages in thread
From: Mathieu Poirier @ 2024-07-29 14:59 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Bjorn Andersson, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Daniel Baluta, Iuliana Prodan, Marek Vasut,
linux-remoteproc, imx, linux-arm-kernel, linux-kernel, Peng Fan,
Terry Lv
On Fri, Jul 19, 2024 at 04:36:10PM +0800, Peng Fan (OSS) wrote:
> This patchset is to upstream a few patches that in NXP downstream for
> quite sometime. For patches directly cherry-picked from NXP downstream,
> I keep the R-b tags.
>
> Patch 1 is a minor fix to DDR alias.
> Patch 2 was sent out before,
> https://patchwork.kernel.org/project/linux-remoteproc/patch/20220111033333.403448-1-peng.fan@oss.nxp.com/#25144792
> this is just a resend
> Patch 3 is to avoid mu interrupt trigger earlier.
> Patch 4 is merge small area to support elf that has large section
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> Changes in v2:
> - Add R-b for patch 1,2,4
> - Add Fixes tag for patch 3
> - Drop downstream R-b tag
> - Drop patch 5,6 which will be in a new patchset for 7ULP
> - Link to v1: https://lore.kernel.org/r/20240712-imx_rproc-v1-0-7bcf6732d328@nxp.com
>
> ---
> Peng Fan (4):
> remoteproc: imx_rproc: correct ddr alias for i.MX8M
> remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table
> remoteproc: imx_rproc: initialize workqueue earlier
> remoteproc: imx_rproc: merge TCML/U
>
I have applied this set.
Thanks,
Mathieu
> drivers/remoteproc/imx_rproc.c | 37 +++++++++++++++++++++----------------
> 1 file changed, 21 insertions(+), 16 deletions(-)
> ---
> base-commit: f477dd6eede3ecedc8963478571d99ec3bf3f762
> change-id: 20240712-imx_rproc-25f3ab753c58
>
> Best regards,
> --
> Peng Fan <peng.fan@nxp.com>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-07-29 14:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-19 8:36 [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 1/4] remoteproc: imx_rproc: correct ddr alias for i.MX8M Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 2/4] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 3/4] remoteproc: imx_rproc: initialize workqueue earlier Peng Fan (OSS)
2024-07-19 8:36 ` [PATCH v2 4/4] remoteproc: imx_rproc: merge TCML/U Peng Fan (OSS)
2024-07-19 8:52 ` [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc Daniel Baluta
2024-07-29 14:59 ` Mathieu Poirier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).