[U-Boot] [PATCH v4 4/8] pico-imx7d: Reserve region of memory to OPTEE

Jun Nie jun.nie at linaro.org
Wed May 8 06:38:32 UTC 2019


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 live in the end part of DRAM and 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 at linaro.org>
Reviewed-by: Peng Fan <peng.fan at nxp.com>
---
 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 e63b19d..5b357f2 100644
--- a/board/technexion/pico-imx7d/pico-imx7d.c
+++ b/board/technexion/pico-imx7d/pico-imx7d.c
@@ -63,6 +63,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;
 }
 
-- 
2.7.4



More information about the U-Boot mailing list