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

* [PATCH 2/2] remoteproc: update Kconfig text for IMX_REMOTEPROC symbol
  2023-09-14  9:10 [PATCH 1/2] remoteproc: imx: don't re-request reserved SDRAM region Ahmad Fatoum
@ 2023-09-14  9:10 ` Ahmad Fatoum
  2023-09-21  8:07 ` [PATCH 1/2] remoteproc: imx: don't re-request reserved SDRAM region Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-09-14  9:10 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

i.MX7 was the first SoC supported, but since then support has been
extended, so reflect that in prompt and help text.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/remoteproc/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
index a193fadb69a9..94babd28ff70 100644
--- a/drivers/remoteproc/Kconfig
+++ b/drivers/remoteproc/Kconfig
@@ -12,11 +12,11 @@ config REMOTEPROC
 if REMOTEPROC
 
 config IMX_REMOTEPROC
-	tristate "IMX6/7 remoteproc support"
+	tristate "IMX6/7/8 remoteproc support"
 	depends on ARCH_IMX
 	select MFD_SYSCON
 	help
-	  Say y here to support iMX's remote processors (Cortex M4
+	  Say y here to support iMX's remote processors (e.g. Cortex M4
 	  on iMX7D) via the remote processor framework.
 
 	  It's safe to say N here.
-- 
2.39.2




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

* Re: [PATCH 1/2] remoteproc: imx: don't re-request reserved SDRAM region
  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 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2023-09-21  8:07 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Thu, Sep 14, 2023 at 11:10:53AM +0200, Ahmad Fatoum wrote:
> 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(-)

Applied, thanks

Sascha

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

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ 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