mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] remoteproc: imx: don't re-request reserved SDRAM region
@ 2023-09-14  9:10 Ahmad Fatoum
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-09-14  9:10 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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




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

end of thread, other threads:[~2023-09-21  8:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-14  9:10 [PATCH 1/2] remoteproc: imx: don't re-request reserved SDRAM region Ahmad Fatoum
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox