From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] remoteproc: imx: don't re-request reserved SDRAM region
Date: Thu, 14 Sep 2023 11:10:53 +0200 [thread overview]
Message-ID: <20230914091054.121730-1-a.fatoum@pengutronix.de> (raw)
Various remoteproc drivers point at reserved memory regions via a
memory-region property in the device tree. As all reserved memory
regions are requested since 2022.10.0, we shouldn't have code request
them again. Fix that. There's not much use of the memory-region property
for i.MX upstream, so breakage should've been rather limited.
This has only been build-tested.
Fixes: d0b5f6bde15b ("of: reserved-mem: reserve regions prior to mmu_initcall()")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/remoteproc/imx_rproc.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 68fe8031e5fb..c1f70cf75520 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -422,7 +422,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
/* remap optional addresses */
for (a = 0; a < nph; a++) {
struct device_node *node;
- struct resource res, *res_cpu;
+ struct resource res;
node = of_parse_phandle(np, "memory-region", a);
err = of_address_to_resource(node, 0, &res);
@@ -434,13 +434,12 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
if (b >= IMX7D_RPROC_MEM_MAX)
break;
- res_cpu = request_sdram_region(dev_name(dev), res.start,
- resource_size(&res));
- if (!res_cpu) {
- dev_err(dev, "remap optional addresses failed\n");
- return -ENOMEM;
- }
- priv->mem[b].cpu_addr = (void *)res_cpu->start;
+ /*
+ * reserved memory region are automatically requested and
+ * mapped uncached
+ */
+
+ priv->mem[b].cpu_addr = phys_to_virt(res.start);
priv->mem[b].sys_addr = res.start;
priv->mem[b].size = resource_size(&res);
b++;
--
2.39.2
next reply other threads:[~2023-09-14 9:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-14 9:10 Ahmad Fatoum [this message]
2023-09-14 9:10 ` [PATCH 2/2] remoteproc: update Kconfig text for IMX_REMOTEPROC symbol Ahmad Fatoum
2023-09-21 8:07 ` [PATCH 1/2] remoteproc: imx: don't re-request reserved SDRAM region 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=20230914091054.121730-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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