]> git.sur5r.net Git - u-boot/commitdiff
warp7: Allocate specific region of memory to OPTEE
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Tue, 24 Apr 2018 17:46:35 +0000 (18:46 +0100)
committerStefano Babic <sbabic@denx.de>
Thu, 26 Apr 2018 06:52:51 +0000 (08:52 +0200)
Subtracts CONFIG_OPTEE_TZDRAM_SIZE from the available DRAM size.

On WaRP7 we simply define the OPTEE region as from the maximum DRAM address
minus CONFIG_OPTEE_TZDRAM_SIZE bytes.

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

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
board/warp7/warp7.c

index 0d3d32457106343e8939813a6bbb7142cb42f0e9..56f0cdd17592c9a77484d18d38ef1f0017c50847 100644 (file)
@@ -58,6 +58,11 @@ int dram_init(void)
 {
        gd->ram_size = PHYS_SDRAM_SIZE;
 
+       /* Subtract the defined OPTEE runtime firmware length */
+#ifdef CONFIG_OPTEE_TZDRAM_SIZE
+               gd->ram_size -= CONFIG_OPTEE_TZDRAM_SIZE;
+#endif
+
        return 0;
 }