Skip to content

Commit a84f14d

Browse files
MrVanmehmetb0
authored andcommitted
remoteproc: imx_rproc: Use imx specific hook for find_loaded_rsc_table
BugLink: https://bugs.launchpad.net/bugs/2086242 [ Upstream commit e954a1bd16102abc800629f9900715d8ec4c3130 ] 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> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20240719-imx_rproc-v2-2-10d0268c7eb1@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
1 parent 522130f commit a84f14d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/remoteproc/imx_rproc.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,17 @@ static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc
529529
return (struct resource_table *)priv->rsc_table;
530530
}
531531

532+
static struct resource_table *
533+
imx_rproc_elf_find_loaded_rsc_table(struct rproc *rproc, const struct firmware *fw)
534+
{
535+
struct imx_rproc *priv = rproc->priv;
536+
537+
if (priv->rsc_table)
538+
return (struct resource_table *)priv->rsc_table;
539+
540+
return rproc_elf_find_loaded_rsc_table(rproc, fw);
541+
}
542+
532543
static const struct rproc_ops imx_rproc_ops = {
533544
.prepare = imx_rproc_prepare,
534545
.attach = imx_rproc_attach,
@@ -538,7 +549,7 @@ static const struct rproc_ops imx_rproc_ops = {
538549
.da_to_va = imx_rproc_da_to_va,
539550
.load = rproc_elf_load_segments,
540551
.parse_fw = imx_rproc_parse_fw,
541-
.find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
552+
.find_loaded_rsc_table = imx_rproc_elf_find_loaded_rsc_table,
542553
.get_loaded_rsc_table = imx_rproc_get_loaded_rsc_table,
543554
.sanity_check = rproc_elf_sanity_check,
544555
.get_boot_addr = rproc_elf_get_boot_addr,

0 commit comments

Comments
 (0)