From ae8d044cd15f49f56de4db84da7203a0ac2ff783 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Fri, 1 Dec 2017 12:58:58 -0800 Subject: report successful startup to the platform For proper CCD password management it is necessary to be able to alert the rest of the system when the actual restart happens. A good indication of a restart is successful processing of the Starup command of the SU_RESET type. CQ-DEPEND=CL:804141 BRANCH=cr50 BUG=b:67007578 TEST=verified that the callback is indeed called on appropriate starups. Change-Id: I984fb971410ff29454250c40e44a7ca7710eaf1c Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/803741 Reviewed-by: Andrey Pronin --- Platform.h | 6 ++++++ Startup.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/Platform.h b/Platform.h index f7bcbcd..4779594 100644 --- a/Platform.h +++ b/Platform.h @@ -384,6 +384,12 @@ _plat__GetFwVersion( uint32_t *fw2 ); +// A function to call after every successful SU_RESET TPM2_Startup. +LIB_EXPORT void +_plat__ResetCallback( + void +); + int uart_printf(const char *format, ...); #define ecprintf(format, args...) uart_printf(format, ## args); diff --git a/Startup.c b/Startup.c index 8759e52..54df25b 100644 --- a/Startup.c +++ b/Startup.c @@ -163,5 +163,8 @@ TPM2_Startup( // The H-CRTM state no longer matters g_DrtmPreStartup = FALSE; + if (startup == SU_RESET) + _plat__ResetCallback(); + return TPM_RC_SUCCESS; } -- cgit v1.2.3