mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
fix(stm32mp2): remove mapping of BL2 DT area
To prevent from coding issues that could overwrite DT area, we were mapping this area as read-only on STM32MP1. But on STM32MP2, we need this area to put BL31 binary. We were then using dynamic mapping. But the area is included in the whole SYSRAM memory mapping. This is not allowed with dynamic mapping. As no other code is running at this step, and we know what code is running in BL2, just remove this extra read-only protection for STM32MP2. A message is added after the post load process of FW-CONFIG file, as BL2 DT area will be overwritten after that. And remove the now useless macros DTB_BASE & DTB_LIMIT. This corrects Coverity issue: CID 443168. Change-Id: Ic01d6a443ecf7721380ef39dc570e2d1627008d0 Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
This commit is contained in:
parent
e2c3611cf1
commit
60d0758411
2 changed files with 4 additions and 13 deletions
|
@ -179,11 +179,6 @@ void bl2_el3_plat_arch_setup(void)
|
|||
|
||||
configure_mmu();
|
||||
|
||||
/* Prevent corruption of preloaded Device Tree */
|
||||
mmap_add_dynamic_region(DTB_BASE, DTB_BASE,
|
||||
DTB_LIMIT - DTB_BASE,
|
||||
MT_RO_DATA | MT_SECURE);
|
||||
|
||||
if (dt_open_and_check(STM32MP_DTB_BASE) < 0) {
|
||||
panic();
|
||||
}
|
||||
|
@ -258,7 +253,10 @@ int bl2_plat_handle_post_image_load(unsigned int image_id)
|
|||
FW_CONFIG_ID);
|
||||
fconf_populate("FW_CONFIG", STM32MP_FW_CONFIG_BASE);
|
||||
|
||||
mmap_remove_dynamic_region(DTB_BASE, DTB_LIMIT - DTB_BASE);
|
||||
/*
|
||||
* After this step, the BL2 device tree area will be overwritten
|
||||
* with BL31 binary, no other data should be read from BL2 DT.
|
||||
*/
|
||||
|
||||
break;
|
||||
|
||||
|
|
|
@ -80,13 +80,6 @@
|
|||
******************************************************************************/
|
||||
#define BL33_BASE STM32MP_BL33_BASE
|
||||
|
||||
/*******************************************************************************
|
||||
* DTB specific defines.
|
||||
******************************************************************************/
|
||||
#define DTB_BASE STM32MP_DTB_BASE
|
||||
#define DTB_LIMIT (STM32MP_DTB_BASE + \
|
||||
STM32MP_DTB_SIZE)
|
||||
|
||||
/*******************************************************************************
|
||||
* Platform specific page table and MMU setup constants
|
||||
******************************************************************************/
|
||||
|
|
Loading…
Add table
Reference in a new issue