From af216d834e1ec665129d68d8df9256f659371ee8 Mon Sep 17 00:00:00 2001 From: Namyoon Woo Date: Mon, 4 Feb 2019 20:17:11 -0800 Subject: cr50/ec: add a console command to display event logs. 'dlog' console command is introduced, which displays event logs on console. To activate this command, CONFIG_CMD_DLOG should be defined in board.h. 'dlog clear' clears all event logs. BUG=b:63760920 BRANCH=cr50 TEST=manually > help dlog Usage: dlog [clear] Display/clear TPM event logs > tpm_log 1 0xABCD > tpm_log 2 0x1234 > dlog TIMESTAMP | TYPE | DATA | SIZE | PAYLOAD 749 1 0xABCD 0 8325 2 0x1234 0 > dlog clear > dlog TIMESTAMP | TYPE | DATA | SIZE | PAYLOAD > Change-Id: I313beeb2e5ec04c108296cd4c017d938aab24b0d Signed-off-by: Namyoon Woo Reviewed-on: https://chromium-review.googlesource.com/1454136 Reviewed-by: Mary Ruthven --- common/tpm_registers.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common/tpm_registers.c') diff --git a/common/tpm_registers.c b/common/tpm_registers.c index 74fff76082..397d067742 100644 --- a/common/tpm_registers.c +++ b/common/tpm_registers.c @@ -764,9 +764,11 @@ int tpm_reset_request(int wait_until_done, int wipe_nvmem_first) return EC_ERROR_BUSY; } +#ifdef CONFIG_TPM_LOGGING /* Record input parameters as two bits in the data field. */ tpm_log_event(TPM_EVENT_INIT, (!!wait_until_done << 1) | !!wipe_nvmem_first); +#endif reset_in_progress = 1; wipe_result = EC_SUCCESS; -- cgit v1.2.1