SecurityPkg: Add DEBUG messages for TPM2Startup

Add DEBUG messages for TPM2Startup to distinguish between TPM_RC_SUCCESS
and TPM_RC_INITIALIZE. This helps debugging some hardware problems.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
This commit is contained in:
Samer El-Haj-Mahmoud 2016-04-29 04:04:20 +08:00 committed by Zhang, Chao B
parent 81a23a0fee
commit 148bd4e362
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@
Implement TPM2 Startup related command. Implement TPM2 Startup related command.
Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved. <BR> Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved. <BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -75,8 +76,11 @@ Tpm2Startup (
ResponseCode = SwapBytes32(Res.Header.responseCode); ResponseCode = SwapBytes32(Res.Header.responseCode);
switch (ResponseCode) { switch (ResponseCode) {
case TPM_RC_SUCCESS: case TPM_RC_SUCCESS:
DEBUG ((DEBUG_INFO, "TPM2Startup: TPM_RC_SUCCESS\n"));
return EFI_SUCCESS;
case TPM_RC_INITIALIZE: case TPM_RC_INITIALIZE:
// TPM_RC_INITIALIZE can be returned if Tpm2Startup is not required. // TPM_RC_INITIALIZE can be returned if Tpm2Startup is not required.
DEBUG ((DEBUG_INFO, "TPM2Startup: TPM_RC_INITIALIZE\n"));
return EFI_SUCCESS; return EFI_SUCCESS;
default: default:
DEBUG ((EFI_D_ERROR, "Tpm2Startup: Response Code error! 0x%08x\r\n", ResponseCode)); DEBUG ((EFI_D_ERROR, "Tpm2Startup: Response Code error! 0x%08x\r\n", ResponseCode));