pico-imx7d: Reserve region of memory to OPTEE
authorJun Nie <jun.nie@linaro.org>
Wed, 8 May 2019 06:38:32 +0000 (14:38 +0800)
committerStefano Babic <sbabic@denx.de>
Tue, 11 Jun 2019 08:42:48 +0000 (10:42 +0200)
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@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
board/technexion/pico-imx7d/pico-imx7d.c

index e63b19df6ed253c53bc84a12ee9653a63d6c9e80..5b357f265a178d7da4f3d1337a5d84f7e6d6c668 100644 (file)
@@ -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;
 }