]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(imx8mp): add BL31 PIE support
authorMarco Felsch <m.felsch@pengutronix.de>
Fri, 1 Jul 2022 13:55:30 +0000 (15:55 +0200)
committerMarco Felsch <m.felsch@pengutronix.de>
Thu, 20 Oct 2022 16:20:27 +0000 (18:20 +0200)
Enable PIE support so the BL31 firmware can be loaded from anywhere
within the OCRAM (SRAM). How important this is shows the back and forth
of the BL31_BASE address starting with TF-A v2.5. Since then the
BL31_BASE address wasn't stable and choosing the correct combination of
SPL version loadaddress and TF-A version loadaddr was tricky.

For the PIE support we only need to replace the BL31_BASE by the
BL31_START which is a relocatable symbol and to enable it by setting
ENABLE_PIE := 1.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I4214db1f27120f9f9cd1413ccd7a5a7d095ff45d

plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
plat/imx/imx8m/imx8mp/platform.mk

index 4221633e0543f9f18c626721f5a1662221c694b0..a5edf9880a3a4f48019c74a401134174a993cb97 100644 (file)
@@ -176,7 +176,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                                                                          \
index e8669e5f844754468855a1c69605413e0f342856..b8fdbab1c56f84631958e5202763f6a8ea05cfe9 100644 (file)
@@ -138,6 +138,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