From 95e018dc7eaf9735337c3aa35a3dc1910a86dbab Mon Sep 17 00:00:00 2001 From: Silvano di Ninno Date: Thu, 17 May 2018 17:05:19 +0200 Subject: MLK-18344: add OP-TEE support for i.Mx 8MM like for i.MX 8mq ATF passes as argument to u-boot the start and the length of the BL32 firmware. u-boot uses this information to adjust the size of the DDR for linux. Signed-off-by: Silvano di Ninno Acked-by: Peng Fan (cherry picked from commit e9ec5ea8dbe3d12b40ba22fe36400cfe98e1bd44) --- arch/arm/mach-imx/imx8m/soc.c | 2 ++ board/freescale/imx8mm_evk/imx8mm_evk.c | 6 +++++- include/configs/imx8mm_evk.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index dc024508f3..c31f75b1e9 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -248,6 +248,7 @@ static int ft_add_optee_node(void *fdt, bd_t *bd) int ft_system_setup(void *blob, bd_t *bd) { +#ifdef CONFIG_IMX8MQ int i = 0; int rc; int nodeoff; @@ -339,6 +340,7 @@ usb_modify_speed: "cpu-idle-states"); } } +#endif return ft_add_optee_node(blob, bd); } diff --git a/board/freescale/imx8mm_evk/imx8mm_evk.c b/board/freescale/imx8mm_evk/imx8mm_evk.c index 9d57b3b946..9fec297fc5 100644 --- a/board/freescale/imx8mm_evk/imx8mm_evk.c +++ b/board/freescale/imx8mm_evk/imx8mm_evk.c @@ -135,7 +135,11 @@ int board_postclk_init(void) int dram_init(void) { - gd->ram_size = PHYS_SDRAM_SIZE; + /* rom_pointer[1] contains the size of TEE occupies */ + if (rom_pointer[1]) + gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1]; + else + gd->ram_size = PHYS_SDRAM_SIZE; return 0; } diff --git a/include/configs/imx8mm_evk.h b/include/configs/imx8mm_evk.h index 366ee02c3d..ae1dd6f696 100644 --- a/include/configs/imx8mm_evk.h +++ b/include/configs/imx8mm_evk.h @@ -316,4 +316,6 @@ #endif +#define CONFIG_OF_SYSTEM_SETUP + #endif -- cgit v1.2.3