feat(stm32mp1): adaptations for STM32MP13 image header

The header must now include by default at least an extra padding
header, increasing the size of the header to 512 bytes (0x200).
This header will be placed at the end of SRAM3 by BootROM, letting
the whole SYSRAM to TF-A.
The boot context is now placed in SRAM2, hence this memory has to be
mapped in BL2 MMU. This mapping is done for all SRAMs in a 2MB area.

Change-Id: I50fcd43ecd0ba2076292b057566efe6809b9971a
Signed-off-by: Yann Gautier <yann.gautier@st.com>
This commit is contained in:
Yann Gautier 2020-04-14 18:08:50 +02:00
parent 5f52eb1597
commit a5308745ee
2 changed files with 24 additions and 0 deletions

View File

@ -103,6 +103,8 @@
#define SRAM2_SIZE U(0x00002000)
#define SRAM3_BASE U(0x30006000)
#define SRAM3_SIZE U(0x00002000)
#define SRAMS_BASE SRAM1_BASE
#define SRAMS_SIZE_2MB_ALIGNED U(0x00200000)
#endif /* STM32MP13 */
#if STM32MP15
#define STM32MP_SYSRAM_BASE U(0x2FFC0000)
@ -135,6 +137,15 @@ enum ddr_type {
#endif
/* Section used inside TF binaries */
#if STM32MP13
/* 512 Octets reserved for header */
#define STM32MP_HEADER_RESERVED_SIZE U(0x200)
#define STM32MP_BINARY_BASE STM32MP_SEC_SYSRAM_BASE
#define STM32MP_BINARY_SIZE STM32MP_SEC_SYSRAM_SIZE
#endif
#if STM32MP15
#define STM32MP_PARAM_LOAD_SIZE U(0x00002400) /* 9 KB for param */
/* 256 Octets reserved for header */
#define STM32MP_HEADER_SIZE U(0x00000100)
@ -148,6 +159,7 @@ enum ddr_type {
#define STM32MP_BINARY_SIZE (STM32MP_SEC_SYSRAM_SIZE - \
(STM32MP_PARAM_LOAD_SIZE + \
STM32MP_HEADER_SIZE))
#endif
/* BL2 and BL32/sp_min require finer granularity tables */
#if defined(IMAGE_BL2)

View File

@ -72,6 +72,15 @@
MT_EXECUTE_NEVER)
#endif
#if STM32MP13
#define MAP_SRAM_ALL MAP_REGION_FLAT(SRAMS_BASE, \
SRAMS_SIZE_2MB_ALIGNED, \
MT_MEMORY | \
MT_RW | \
MT_SECURE | \
MT_EXECUTE_NEVER)
#endif
#define MAP_DEVICE1 MAP_REGION_FLAT(STM32MP1_DEVICE1_BASE, \
STM32MP1_DEVICE1_SIZE, \
MT_DEVICE | \
@ -89,6 +98,9 @@
#if defined(IMAGE_BL2)
static const mmap_region_t stm32mp1_mmap[] = {
MAP_SEC_SYSRAM,
#if STM32MP13
MAP_SRAM_ALL,
#endif
MAP_DEVICE1,
#if STM32MP_RAW_NAND
MAP_DEVICE2,