[PATCH 1/2] remoteproc: imx: don't re-request reserved SDRAM region

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux