From a8e6a2c83ce511dad88eb68f98a3191fa93564d4 Mon Sep 17 00:00:00 2001 From: Marco Felsch Date: Mon, 22 Aug 2022 12:39:01 +0200 Subject: [PATCH] feat(imx8mm): add BL31 PIE support Enable PIE support so the BL31 firmware can be loaded from anywhere within the OCRAM (SRAM). For the PIE support we only need to replace the BL31_BASE define by the BL31_START symbol which is a relocatable and we need to enable it by setting ENABLE_PIE := 1. Signed-off-by: Marco Felsch Change-Id: I52e654917167f0faf6aa437da233d8faf1f2bb26 --- plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c | 2 +- plat/imx/imx8m/imx8mm/platform.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c index d63e0a5e7..27097d1bd 100644 --- a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c +++ b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c @@ -175,7 +175,7 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, } #define MAP_BL31_TOTAL \ - MAP_REGION_FLAT(BL31_BASE, BL31_SIZE, MT_MEMORY | MT_RW | MT_SECURE) + MAP_REGION_FLAT(BL31_START, BL31_SIZE, MT_MEMORY | MT_RW | MT_SECURE) #define MAP_BL31_RO \ MAP_REGION_FLAT(BL_CODE_BASE, BL_CODE_END - BL_CODE_BASE, MT_MEMORY | MT_RO | MT_SECURE) #define MAP_COHERENT_MEM \ diff --git a/plat/imx/imx8m/imx8mm/platform.mk b/plat/imx/imx8m/imx8mm/platform.mk index e3e5c0c5a..de0faf69f 100644 --- a/plat/imx/imx8m/imx8mm/platform.mk +++ b/plat/imx/imx8m/imx8mm/platform.mk @@ -141,6 +141,7 @@ $(ROTPK_HASH): $(ROT_KEY) ${OPENSSL_BIN_PATH}/openssl dgst -sha256 -binary > $@ 2>/dev/null endif +ENABLE_PIE := 1 USE_COHERENT_MEM := 1 RESET_TO_BL31 := 1 A53_DISABLE_NON_TEMPORAL_HINT := 0 -- 2.39.5