aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Salveti2021-08-25 18:47:18 +0300
committerStefano Babic2021-10-21 13:59:26 +0200
commitcdf31924521b347980a2b4e9871acb4a995f5d24 (patch)
treed51d714c316b9fa68da3d0d0f04bb89239002d11
parent35813490d63ac6c421f0ec1f70b53d18e5fbcd0d (diff)
board: ea: mx7ulp_com: allocate specific region of memory to OP-TEE
On the iMX7ULP uCOM board, OP-TEE uses the memory region defined by the maximum DRAM address minus CONFIG_OPTEE_TZDRAM_SIZE, so subtract CONFIG_OPTEE_TZDRAM_SIZE from the available DRAM size to avoid conflicts. Note the OPTEE boot process itself subtracts the DRAM region it lives in from the memory map passed to Linux. Signed-off-by: Ricardo Salveti <ricardo@foundries.io> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io> Reviewed-by: Fabio Estevam <festevam@gmail.com>
-rw-r--r--board/ea/mx7ulp_com/mx7ulp_com.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/board/ea/mx7ulp_com/mx7ulp_com.c b/board/ea/mx7ulp_com/mx7ulp_com.c
index 5b2d444366c..7fce75ade9d 100644
--- a/board/ea/mx7ulp_com/mx7ulp_com.c
+++ b/board/ea/mx7ulp_com/mx7ulp_com.c
@@ -20,6 +20,10 @@ int dram_init(void)
{
gd->ram_size = imx_ddr_size();
+#ifdef CONFIG_OPTEE_TZDRAM_SIZE
+ gd->ram_size -= CONFIG_OPTEE_TZDRAM_SIZE;
+#endif
+
return 0;
}