diff mbox series

[v2] board: ea: mx7ulp_com: allocate specific region of memory to OP-TEE

Message ID 20210825184609.v2.1.67631-1-oleksandr.suvorov@changeid
State Accepted
Commit cdf31924521b347980a2b4e9871acb4a995f5d24
Delegated to: Stefano Babic
Headers show
Series [v2] board: ea: mx7ulp_com: allocate specific region of memory to OP-TEE | expand

Commit Message

Oleksandr Suvorov Aug. 25, 2021, 3:47 p.m. UTC
From: Ricardo Salveti <ricardo@foundries.io>

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>
---

Changes in v2:
- add missed Signed-off-by
- add Reviewed-by

 board/ea/mx7ulp_com/mx7ulp_com.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Stefano Babic Oct. 21, 2021, 2:12 p.m. UTC | #1
> From: Ricardo Salveti <ricardo@foundries.io>
> 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>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/board/ea/mx7ulp_com/mx7ulp_com.c b/board/ea/mx7ulp_com/mx7ulp_com.c
index 5b2d444366..7fce75ade9 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;
 }