From 02f5d82052939c7bc004c0ac13544f87eac178a3 Mon Sep 17 00:00:00 2001 From: Yann Gautier <yann.gautier@st.com> Date: Thu, 11 Jul 2019 10:45:09 +0200 Subject: [PATCH] stm32mp1: sp_min: initialize MMU and cache earlier This change enhances performance and security in BL32 stage. Change-Id: I64df5995fc6b04f6cf42d6a00a6d3d0f602b5407 Signed-off-by: Yann Gautier <yann.gautier@st.com> --- plat/st/stm32mp1/sp_min/sp_min_setup.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plat/st/stm32mp1/sp_min/sp_min_setup.c b/plat/st/stm32mp1/sp_min/sp_min_setup.c index 5ad219085..e54249f74 100644 --- a/plat/st/stm32mp1/sp_min/sp_min_setup.c +++ b/plat/st/stm32mp1/sp_min/sp_min_setup.c @@ -89,6 +89,12 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1, /* Imprecise aborts can be masked in NonSecure */ write_scr(read_scr() | SCR_AW_BIT); + mmap_add_region(BL_CODE_BASE, BL_CODE_BASE, + BL_CODE_END - BL_CODE_BASE, + MT_CODE | MT_SECURE); + + configure_mmu(); + assert(params_from_bl2 != NULL); assert(params_from_bl2->h.type == PARAM_BL_PARAMS); assert(params_from_bl2->h.version >= VERSION_2); @@ -136,12 +142,6 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1, ******************************************************************************/ void sp_min_platform_setup(void) { - mmap_add_region(BL_CODE_BASE, BL_CODE_BASE, - BL_CODE_END - BL_CODE_BASE, - MT_CODE | MT_SECURE); - - configure_mmu(); - /* Initialize tzc400 after DDR initialization */ stm32mp1_security_setup(); -- GitLab