From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Stefano Manni <stefano.manni@gmail.com>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/2] remoteproc: imx: add support for loading ELF data sections into DRAM
Date: Tue, 19 Nov 2024 09:56:41 +0100 [thread overview]
Message-ID: <20241119085641.2598035-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20241119085641.2598035-1-a.fatoum@pengutronix.de>
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@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
next prev parent reply other threads:[~2024-11-19 8:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 8:56 [PATCH 1/2] remoteproc: elf_loader: skip segment with memsz as zero Ahmad Fatoum
2024-11-19 8:56 ` Ahmad Fatoum [this message]
2024-11-25 8:42 ` Sascha Hauer
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=20241119085641.2598035-2-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=stefano.manni@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox