[PATCH 2/2] remoteproc: imx: add support for loading ELF data sections into DRAM
Ahmad Fatoum
a.fatoum at pengutronix.de
Tue Nov 19 00:56:41 PST 2024
The Cortex-A MPU and the Cortex-M co-processor on the i.MX have
different address space layouts. The driver thus keeps
struct imx_rproc_att[] tables for the different SoCs to translate device
addresses in the ELF headers to the virtual addresses used by the
Cortex-A, which loads the ELF image.
The maximum size of this mapping was so far 8, which may not be large
enough for some ELF images. Enlarge it to 32 like Linux does.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
drivers/remoteproc/imx_rproc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 6ae8ef3966ae..d50b164bed93 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -44,7 +44,7 @@
| IMX6SX_SW_M4C_NON_SCLR_RST \
| IMX6SX_SW_M4C_RST)
-#define IMX7D_RPROC_MEM_MAX 8
+#define IMX_RPROC_MEM_MAX 32
/**
* struct imx_rproc_mem - slim internal memory structure
@@ -84,7 +84,7 @@ struct imx_rproc {
struct regmap *gpr;
struct rproc *rproc;
const struct imx_rproc_dcfg *dcfg;
- struct imx_rproc_mem mem[IMX7D_RPROC_MEM_MAX];
+ struct imx_rproc_mem mem[IMX_RPROC_MEM_MAX];
struct clk *clk;
};
@@ -362,7 +362,7 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, int len)
if (imx_rproc_da_to_sys(priv, da, len, &sys))
return NULL;
- for (i = 0; i < IMX7D_RPROC_MEM_MAX; i++) {
+ for (i = 0; i < IMX_RPROC_MEM_MAX; i++) {
if (sys >= priv->mem[i].sys_addr && sys + len <
priv->mem[i].sys_addr + priv->mem[i].size) {
unsigned int offset = sys - priv->mem[i].sys_addr;
@@ -398,7 +398,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
if (!(att->flags & ATT_OWN))
continue;
- if (b >= IMX7D_RPROC_MEM_MAX)
+ if (b >= IMX_RPROC_MEM_MAX)
break;
res_cpu = request_iomem_region(dev_name(dev),
@@ -431,7 +431,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
return err;
}
- if (b >= IMX7D_RPROC_MEM_MAX)
+ if (b >= IMX_RPROC_MEM_MAX)
break;
/*
--
2.39.5
More information about the barebox
mailing list