From cf21064ec8a1889f64de48e30e38285227d27745 Mon Sep 17 00:00:00 2001 From: Manish V Badarkhe Date: Wed, 20 Oct 2021 22:06:40 +0100 Subject: feat(fvp): measure critical data Implemented a platform function 'plat_mboot_measure_critical_data' to measure critical data and record its measurement using the Event Log driver. 'bl2_plat_mboot_finish' function invokes this platform function immediately after populating the critical data. Signed-off-by: Manish V Badarkhe Change-Id: Ia198295c6e07ab26d436eab1ff90df2cf28303af --- include/plat/common/common_def.h | 8 ++++++++ include/plat/common/platform.h | 10 ++++++++++ 2 files changed, 18 insertions(+) (limited to 'include/plat') diff --git a/include/plat/common/common_def.h b/include/plat/common/common_def.h index 14ae603b9..632f1229c 100644 --- a/include/plat/common/common_def.h +++ b/include/plat/common/common_def.h @@ -85,4 +85,12 @@ #endif /* BL2_IN_XIP_MEM */ #endif /* SEPARATE_CODE_AND_RODATA */ +#if MEASURED_BOOT +/* + * Start critical data Ids from 2^32/2 reserving Ids from 0 to (2^32/2 - 1) + * for Images, It is a critical data Id base for all platforms. + */ +#define CRITICAL_DATA_ID_BASE U(0x80000000) +#endif /* MEASURED_BOOT */ + #endif /* COMMON_DEF_H */ diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h index 3fa63f555..9a61b502c 100644 --- a/include/plat/common/platform.h +++ b/include/plat/common/platform.h @@ -124,12 +124,22 @@ int plat_try_next_boot_source(void); #if MEASURED_BOOT int plat_mboot_measure_image(unsigned int image_id, image_info_t *image_data); +int plat_mboot_measure_critical_data(unsigned int critical_data_id, + const void *base, + size_t size); #else static inline int plat_mboot_measure_image(unsigned int image_id __unused, image_info_t *image_data __unused) { return 0; } +static inline int plat_mboot_measure_critical_data( + unsigned int critical_data_id __unused, + const void *base __unused, + size_t size __unused) +{ + return 0; +} #endif /* MEASURED_BOOT */ /******************************************************************************* -- cgit v1.2.1