From d44f5f509403db4122ed0b4fc612904b172d2bb5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 20 Dec 2011 10:42:31 -0800 Subject: Add bootstage timing to TPM operations Records the total time taken by TPM operations for display as part of the bootstage report. BUG=chromium-os:22938 TEST=build and boot on Kaen Change-Id: I7ce6efa3c2bb90858d17ab6613724e6ae73d918b Reviewed-on: https://gerrit.chromium.org/gerrit/13371 Commit-Ready: Simon Glass Reviewed-by: Simon Glass Tested-by: Simon Glass --- include/bootstage.h | 2 ++ lib/vbexport/tlcl_stub.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/bootstage.h b/include/bootstage.h index 5ae5d1d7122..72a3e85d602 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -46,6 +46,8 @@ enum bootstage_id { BOOTSTAGE_MAIN_CPU_AWAKE, BOOTSTAGE_MAIN_CPU_READY, + BOOTSTAGE_TPM_SEND_RECV, + /* a few spare for the user, from here */ BOOTSTAGE_USER, diff --git a/lib/vbexport/tlcl_stub.c b/lib/vbexport/tlcl_stub.c index 63e70bc2e96..241bceb1277 100644 --- a/lib/vbexport/tlcl_stub.c +++ b/lib/vbexport/tlcl_stub.c @@ -41,7 +41,12 @@ VbError_t VbExTpmOpen(void) VbError_t VbExTpmSendReceive(const uint8_t* request, uint32_t request_length, uint8_t* response, uint32_t* response_length) { - if (tis_sendrecv(request, request_length, response, response_length)) + int err; + + bootstage_start(BOOTSTAGE_TPM_SEND_RECV, "tpm_send_recv"); + err = tis_sendrecv(request, request_length, response, response_length); + bootstage_accum(BOOTSTAGE_TPM_SEND_RECV); + if (err) return TPM_E_IOERROR; return TPM_SUCCESS; } -- cgit v1.2.3