feat(fvp): add flash areas for secure partition

To support UEFI secure variable service,
StandaloneMm which runs in BL32 should know flash areas.
Add flash memory areas and system register region
so that StandaloneMm access to flash storages.

Change-Id: I803bda9664a17a0b978ebff90974eaf5442a91cd
Signed-off-by: levi.yun <yeoreum.yun@arm.com>
This commit is contained in:
levi.yun 2024-05-16 11:18:20 +01:00 committed by Levi Yun
parent 638e3aa5a2
commit 9fb767630d
3 changed files with 30 additions and 11 deletions
include/plat/arm/board/common
plat/arm/board

View file

@ -17,6 +17,7 @@
/* V2M motherboard system registers & offsets */
#define V2M_SYSREGS_BASE UL(0x1c010000)
#define V2M_SYSREGS_SIZE UL(0x00010000)
#define V2M_SYS_ID UL(0x0)
#define V2M_SYS_SWITCH UL(0x4)
#define V2M_SYS_LED UL(0x8)
@ -78,6 +79,8 @@
/* NOR Flash */
#define V2M_FLASH0_BASE (V2M_OFFSET + UL(0x08000000))
#define V2M_FLASH0_SIZE UL(0x04000000)
#define V2M_FLASH1_BASE (V2M_OFFSET + UL(0x0c000000))
#define V2M_FLASH1_SIZE UL(0x04000000)
#define V2M_FLASH_BLOCK_SIZE UL(0x00040000) /* 256 KB */
#define V2M_IOFPGA_BASE (V2M_OFFSET + UL(0x1c000000))
@ -126,6 +129,14 @@
V2M_FLASH0_SIZE, \
MT_RO_DATA | MT_SECURE)
#define V2M_MAP_FLASH1_RW MAP_REGION_FLAT(V2M_FLASH1_BASE,\
V2M_FLASH1_SIZE, \
MT_DEVICE | MT_RW | MT_SECURE)
#define V2M_MAP_FLASH1_RO MAP_REGION_FLAT(V2M_FLASH1_BASE,\
V2M_FLASH1_SIZE, \
MT_RO_DATA | MT_SECURE)
#define V2M_MAP_IOFPGA MAP_REGION_FLAT(V2M_IOFPGA_BASE,\
V2M_IOFPGA_SIZE, \
MT_DEVICE | MT_RW | MT_SECURE)
@ -136,5 +147,19 @@
V2M_IOFPGA_SIZE, \
MT_DEVICE | MT_RW | MT_SECURE | MT_USER)
#define V2M_MAP_SECURE_SYSTEMREG_EL0 MAP_REGION_FLAT( \
V2M_SYSREGS_BASE, \
V2M_SYSREGS_SIZE, \
MT_DEVICE | MT_RW | MT_SECURE | MT_USER)
#define V2M_MAP_FLASH0_RW_EL0 MAP_REGION_FLAT( \
V2M_FLASH0_BASE, \
V2M_FLASH0_SIZE, \
MT_DEVICE | MT_RW | MT_SECURE | MT_USER)
#define V2M_MAP_FLASH1_RW_EL0 MAP_REGION_FLAT( \
V2M_FLASH1_BASE, \
V2M_FLASH1_SIZE, \
MT_DEVICE | MT_RW | MT_SECURE | MT_USER)
#endif /* V2M_DEF_H */

View file

@ -219,6 +219,11 @@ const mmap_region_t plat_arm_mmap[] = {
#if defined(IMAGE_BL31) && SPM_MM
const mmap_region_t plat_arm_secure_partition_mmap[] = {
V2M_MAP_IOFPGA_EL0, /* for the UART */
V2M_MAP_SECURE_SYSTEMREG_EL0, /* for initializing flash */
#if PSA_FWU_SUPPORT
V2M_MAP_FLASH0_RW_EL0, /* for firmware update service in standalone mm */
#endif
V2M_MAP_FLASH1_RW_EL0, /* for secure variable service in standalone mm */
MAP_REGION_FLAT(DEVICE0_BASE,
DEVICE0_SIZE,
MT_DEVICE | MT_RO | MT_SECURE | MT_USER),

View file

@ -70,15 +70,4 @@
#define FVP_VE_IRQ_TZ_WDOG 56
#define FVP_VE_IRQ_SEC_SYS_TIMER 57
#define V2M_FLASH1_BASE UL(0x0C000000)
#define V2M_FLASH1_SIZE UL(0x04000000)
#define V2M_MAP_FLASH1_RW MAP_REGION_FLAT(V2M_FLASH1_BASE,\
V2M_FLASH1_SIZE, \
MT_DEVICE | MT_RW | MT_SECURE)
#define V2M_MAP_FLASH1_RO MAP_REGION_FLAT(V2M_FLASH1_BASE,\
V2M_FLASH1_SIZE, \
MT_RO_DATA | MT_SECURE)
#endif /* FVP_VE_DEF_H */