From 9acaaded3ca9b6966efb72e3a989f8ee753b3a44 Mon Sep 17 00:00:00 2001 From: Abhi Singh Date: Thu, 7 Nov 2024 17:41:58 -0600 Subject: [PATCH] fix(rpi3): expose BL1_RW to BL2 map for mboot BL2 requires the ability to access the TCG Event Log during Measured Boot. Currently the Platform hangs since the Event Log is not exposed to BL2's mmap. Define a RPI3_BL1_RW region to be added to the BL2 Image, if Measured Boot is enabled. Change-Id: Ic236a80e73ea342b4590cfb65bafbb8ffac17085 Signed-off-by: Abhi Singh --- plat/rpi/common/rpi3_common.c | 3 +++ plat/rpi/rpi3/include/platform_def.h | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/plat/rpi/common/rpi3_common.c b/plat/rpi/common/rpi3_common.c index 4e3c9f233..490835402 100644 --- a/plat/rpi/common/rpi3_common.c +++ b/plat/rpi/common/rpi3_common.c @@ -75,6 +75,9 @@ static const mmap_region_t plat_rpi3_mmap[] = { #endif MAP_DEVICE0, MAP_FIP, +#if MEASURED_BOOT + RPI3_MAP_BL1_RW, +#endif MAP_NS_DRAM0, #ifdef BL32_BASE MAP_BL32_MEM, diff --git a/plat/rpi/rpi3/include/platform_def.h b/plat/rpi/rpi3/include/platform_def.h index 37aceafc7..eb2914ab4 100644 --- a/plat/rpi/rpi3/include/platform_def.h +++ b/plat/rpi/rpi3/include/platform_def.h @@ -171,6 +171,14 @@ #define BL1_RW_BASE (BL1_RW_LIMIT - PLAT_MAX_BL1_RW_SIZE) #define BL1_RW_LIMIT (BL_RAM_BASE + BL_RAM_SIZE) +/* + * In order to access the TCG Event Log in BL2, we need to expose the BL1_RW region + * where the log resides. + */ +#define RPI3_MAP_BL1_RW MAP_REGION_FLAT(BL1_RW_BASE, \ + BL1_RW_LIMIT - BL1_RW_BASE, \ + MT_MEMORY | MT_RW | MT_SECURE) + /* * BL2 specific defines. *