diff mbox series

[U-Boot,v3,5/9] pico-imx7d: Reserve region of memory to OPTEE

Message ID 1556078372-26851-6-git-send-email-jun.nie@linaro.org
State Changes Requested
Delegated to: Stefano Babic
Headers show
Series pico-imx7d: Add support for BL33 case | expand

Commit Message

Jun Nie April 24, 2019, 3:59 a.m. UTC
Subtracts CONFIG_OPTEE_TZDRAM_SIZE from the available DRAM size so that
the OPTEE memory is not override during u-boot relocation.

Note the OPTEE boot process will itself subtract the DRAM region it lives
in from the memory map passed to Linux.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 board/technexion/pico-imx7d/pico-imx7d.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Peng Fan April 24, 2019, 5:17 a.m. UTC | #1
> Subject: [PATCH v3 5/9] pico-imx7d: Reserve region of memory to OPTEE
> 
> Subtracts CONFIG_OPTEE_TZDRAM_SIZE from the available DRAM size so
> that the OPTEE memory is not override during u-boot relocation.
> 
> Note the OPTEE boot process will itself subtract the DRAM region it lives in
> from the memory map passed to Linux.
> 
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  board/technexion/pico-imx7d/pico-imx7d.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/board/technexion/pico-imx7d/pico-imx7d.c
> b/board/technexion/pico-imx7d/pico-imx7d.c
> index 53e1469..7c9e145 100644
> --- a/board/technexion/pico-imx7d/pico-imx7d.c
> +++ b/board/technexion/pico-imx7d/pico-imx7d.c
> @@ -60,6 +60,11 @@ int dram_init(void)
>  {
>  	gd->ram_size = imx_ddr_size();
> 
> +	/* Subtract the defined OPTEE runtime firmware length */ #ifdef
> +CONFIG_OPTEE_TZDRAM_SIZE
> +		gd->ram_size -= CONFIG_OPTEE_TZDRAM_SIZE; #endif
> +
Better describe that OP-TEE runs at the top of DRAM. Actually the best
method should be modify dram banks, because OP-TEE not always
runs at top DRAM. Since this is pico board specific, so

Reviewed-by: Peng Fan <peng.fan@nxp.com>

Regards,
Peng.

>  	return 0;
>  }
> 
> --
> 2.7.4
diff mbox series

Patch

diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c
index 53e1469..7c9e145 100644
--- a/board/technexion/pico-imx7d/pico-imx7d.c
+++ b/board/technexion/pico-imx7d/pico-imx7d.c
@@ -60,6 +60,11 @@  int dram_init(void)
 {
 	gd->ram_size = imx_ddr_size();
 
+	/* Subtract the defined OPTEE runtime firmware length */
+#ifdef CONFIG_OPTEE_TZDRAM_SIZE
+		gd->ram_size -= CONFIG_OPTEE_TZDRAM_SIZE;
+#endif
+
 	return 0;
 }