From: Bryan O'Donoghue Date: Tue, 24 Apr 2018 17:46:35 +0000 (+0100) Subject: warp7: Allocate specific region of memory to OPTEE X-Git-Tag: v2018.05-rc3~1^2~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7175ef4a71e01fe416845a7ecb9af2dfa201cc87;p=u-boot warp7: Allocate specific region of memory to OPTEE 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 Tested-by: Breno Lima Reviewed-by: Fabio Estevam --- diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 0d3d324571..56f0cdd175 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -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; }