Skip to content

Commit cfe4a02

Browse files
committed
feat(stm32mp2): disable PIE by default on STM32MP2 platform
Allow to disable ENABLE_PIE on STM32MP2. BL31 is loaded at the beginning of SYSRAM whatever the options set. Set ENABLE_PIE to 0 by default. This should allow us to reduce BL31 and BL2 size. Change-Id: Ie8c83c9205e81301eb1fdcf24b94216172586630 Signed-off-by: Maxime Méré <maxime.mere@foss.st.com> Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/tf-a/+/423949 ACI: CITOOLS <MDG-smet-aci-reviews@list.st.com> Reviewed-by: Yann GAUTIER <yann.gautier@foss.st.com> Domain-Review: Yann GAUTIER <yann.gautier@foss.st.com> Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/tf-a/+/438769
1 parent e91b539 commit cfe4a02

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

plat/st/stm32mp2/include/platform_def.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,15 @@
7373
/*******************************************************************************
7474
* BL31 specific defines.
7575
******************************************************************************/
76+
#if ENABLE_PIE
7677
#define BL31_BASE 0
77-
#define BL31_LIMIT (STM32MP_SEC_SYSRAM_SIZE / 2)
78+
#else
79+
#define BL31_BASE STM32MP_SEC_SYSRAM_BASE
80+
#endif
81+
82+
#define BL31_LIMIT (BL31_BASE + (STM32MP_SEC_SYSRAM_SIZE / 2))
83+
84+
#define BL31_PROGBITS_LIMIT (BL31_BASE + STM32MP_BL31_SIZE)
7885

7986
/*******************************************************************************
8087
* BL33 specific defines.

plat/st/stm32mp2/platform.mk

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ STM32_EXTRA_PARTS := 6
1111
include plat/st/common/common.mk
1212

1313
CRASH_REPORTING := 1
14-
ENABLE_PIE := 1
14+
ENABLE_PIE := 0
1515
PROGRAMMABLE_RESET_ADDRESS := 1
16+
ifeq ($(ENABLE_PIE),1)
1617
BL2_IN_XIP_MEM := 1
18+
endif
1719

1820
STM32MP_BL33_EL1 ?= 1
1921
ifeq ($(STM32MP_BL33_EL1),1)

plat/st/stm32mp2/stm32mp2_def.h

-2
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ enum ddr_type {
237237
#define STM32MP_BL31_SIZE (STM32MP_SEC_SYSRAM_SIZE - \
238238
STM32MP_BL2_SIZE)
239239

240-
#define BL31_PROGBITS_LIMIT STM32MP_BL31_SIZE
241-
242240
#define STM32MP_BL2_BASE (STM32MP_SEC_SYSRAM_BASE + \
243241
STM32MP_SEC_SYSRAM_SIZE - \
244242
STM32MP_BL2_SIZE)

0 commit comments

Comments
 (0)