All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table
@ 2022-01-11  3:33 ` Peng Fan (OSS)
  0 siblings, 0 replies; 68+ messages in thread
From: Peng Fan (OSS) @ 2022-01-11  3:33 UTC (permalink / raw)
  To: bjorn.andersson, mathieu.poirier, shawnguo, s.hauer, kernel,
	festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
	linux-kernel
  Cc: 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.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---

V2:
 Update commit message

 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 7a096f1891e6..0bd24c937a73 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -499,6 +499,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,
@@ -508,7 +519,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.25.1


^ permalink raw reply related	[flat|nested] 68+ messages in thread

end of thread, other threads:[~2023-01-02 22:48 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11  3:33 [PATCH V2] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table Peng Fan (OSS)
2022-01-11  3:33 ` Peng Fan (OSS)
2022-01-11  3:33 ` [PATCH] remoteproc: imx_rproc: validate resource table Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-17 18:25   ` Mathieu Poirier
2022-01-17 18:25     ` Mathieu Poirier
2022-01-18  1:24     ` Peng Fan
2022-01-18  1:24       ` Peng Fan
2022-01-11  3:33 ` [PATCH 0/9] remoteproc: imx_rproc: support i.MX8QXP/QM and self recovery Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-11  3:33 ` [PATCH 1/9] dt-bindings: remoteproc: imx_rproc: support i.MX8QXP Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-11  6:44   ` Peng Fan
2022-01-11  6:44     ` Peng Fan
2022-01-18 18:41   ` Mathieu Poirier
2022-01-18 18:41     ` Mathieu Poirier
2022-01-19  2:20     ` Peng Fan
2022-01-19  2:20       ` Peng Fan
2022-01-11  3:33 ` [PATCH 2/9] dt-bindings: remoteproc: imx_rproc: support i.MX8QM Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-11  6:45   ` Peng Fan
2022-01-11  6:45     ` Peng Fan
2022-01-11  3:33 ` [PATCH 3/9] remoteproc: support self recovery after rproc crash Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-18 18:44   ` Mathieu Poirier
2022-01-18 18:44     ` Mathieu Poirier
2022-01-19  2:21     ` Peng Fan
2022-01-19  2:21       ` Peng Fan
2022-01-11  3:33 ` [PATCH 4/9] remoteproc: imx_rproc: ignore create mem entry for resource table Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-18 18:47   ` Mathieu Poirier
2022-01-18 18:47     ` Mathieu Poirier
2022-01-19  2:23     ` Peng Fan
2022-01-19  2:23       ` Peng Fan
2022-01-11  3:33 ` [PATCH 5/9] remoteproc: imx_rproc: make clk optional Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-18 18:50   ` Mathieu Poirier
2022-01-18 18:50     ` Mathieu Poirier
2022-01-19  2:25     ` Peng Fan
2022-01-19  2:25       ` Peng Fan
2022-01-19 17:49       ` Mathieu Poirier
2022-01-19 17:49         ` Mathieu Poirier
2022-01-11  3:33 ` [PATCH 6/9] remoteproc: imx_rproc: support attaching to i.MX8QXP M4 Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-18 18:57   ` Mathieu Poirier
2022-01-18 18:57     ` Mathieu Poirier
2022-01-19  2:28     ` Peng Fan
2022-01-19  2:28       ` Peng Fan
2022-01-19 18:04       ` Mathieu Poirier
2022-01-19 18:04         ` Mathieu Poirier
2022-01-19 18:31   ` Mathieu Poirier
2022-01-19 18:31     ` Mathieu Poirier
2022-01-11  3:33 ` [PATCH 7/9] remoteproc: imx_rproc: support kicking Mcore from Linux for i.MX8QXP Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-19 18:58   ` Mathieu Poirier
2022-01-19 18:58     ` Mathieu Poirier
2022-01-11  3:33 ` [PATCH 8/9] remoteproc: imx_rproc: support i.MX8QM Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-01-20 17:23   ` Mathieu Poirier
2022-01-20 17:23     ` Mathieu Poirier
2022-01-21  1:00     ` Peng Fan
2022-01-21  1:00       ` Peng Fan
2022-01-11  3:33 ` [PATCH 9/9] remoteproc: imx_rproc: request mbox channel later Peng Fan (OSS)
2022-01-11  3:33   ` Peng Fan (OSS)
2022-12-21 10:55 ` [PATCH V2] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table Marco Felsch
2022-12-21 10:55   ` Marco Felsch
2023-01-02 22:46   ` Mathieu Poirier
2023-01-02 22:46     ` Mathieu Poirier

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.