aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-12-01 12:58:58 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-12-11 15:16:22 -0800
commitae8d044cd15f49f56de4db84da7203a0ac2ff783 (patch)
tree8d70c2186bc1d22f0b1dc4532669f00d2b93b88c
parentc456225bd529067d237dc7242c954e22479b1fea (diff)
downloadtpm2-ae8d044cd15f49f56de4db84da7203a0ac2ff783.tar.gz
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 <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/803741 Reviewed-by: Andrey Pronin <apronin@chromium.org>
-rw-r--r--Platform.h6
-rw-r--r--Startup.c3
2 files changed, 9 insertions, 0 deletions
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;
}