#define TIS_TIMEOUT_MAX (90000 * 1000) // 90s\r
\r
//\r
-// Max TPM command/reponse length\r
+// Max TPM command/response length\r
//\r
#define TPMCMDBUFLENGTH 0x500\r
\r
}\r
\r
/**\r
- Get BurstCount by reading the burstCount field of a TIS regiger\r
+ Get BurstCount by reading the burstCount field of a TIS register\r
in the time of default TIS_TIMEOUT_D.\r
\r
@param[in] TisReg Pointer to TIS register.\r
- @param[out] BurstCount Pointer to a buffer to store the got BurstConut.\r
+ @param[out] BurstCount Pointer to a buffer to store the got BurstCount.\r
\r
@retval EFI_SUCCESS Get BurstCount.\r
@retval EFI_INVALID_PARAMETER TisReg is NULL or BurstCount is NULL.\r
UINT16 Data16;\r
UINT32 Data32;\r
\r
- DEBUG_CODE (\r
+ DEBUG_CODE_BEGIN ();\r
UINTN DebugSize;\r
\r
- DEBUG ((EFI_D_VERBOSE, "Tpm2TisTpmCommand Send - "));\r
+ DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand Send - "));\r
if (SizeIn > 0x100) {\r
DebugSize = 0x40;\r
} else {\r
DebugSize = SizeIn;\r
}\r
for (Index = 0; Index < DebugSize; Index++) {\r
- DEBUG ((EFI_D_VERBOSE, "%02x ", BufferIn[Index]));\r
+ DEBUG ((DEBUG_VERBOSE, "%02x ", BufferIn[Index]));\r
}\r
if (DebugSize != SizeIn) {\r
- DEBUG ((EFI_D_VERBOSE, "...... "));\r
+ DEBUG ((DEBUG_VERBOSE, "...... "));\r
for (Index = SizeIn - 0x20; Index < SizeIn; Index++) {\r
- DEBUG ((EFI_D_VERBOSE, "%02x ", BufferIn[Index]));\r
+ DEBUG ((DEBUG_VERBOSE, "%02x ", BufferIn[Index]));\r
}\r
}\r
- DEBUG ((EFI_D_VERBOSE, "\n"));\r
- );\r
+ DEBUG ((DEBUG_VERBOSE, "\n"));\r
+ DEBUG_CODE_END ();\r
TpmOutSize = 0;\r
\r
Status = TisPcPrepareCommand (TisReg);\r
TIS_TIMEOUT_B\r
);\r
//\r
- // Do not clear CANCEL bit here bicoz Writes of 0 to this bit are ignored\r
+ // Do not clear CANCEL bit here because Writes of 0 to this bit are ignored\r
//\r
if (EFI_ERROR (Status)) {\r
//\r
if (Index == sizeof (TPM2_RESPONSE_HEADER)) break;\r
}\r
}\r
- DEBUG_CODE (\r
- DEBUG ((EFI_D_VERBOSE, "Tpm2TisTpmCommand ReceiveHeader - "));\r
+ DEBUG_CODE_BEGIN ();\r
+ DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand ReceiveHeader - "));\r
for (Index = 0; Index < sizeof (TPM2_RESPONSE_HEADER); Index++) {\r
- DEBUG ((EFI_D_VERBOSE, "%02x ", BufferOut[Index]));\r
+ DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
- DEBUG ((EFI_D_VERBOSE, "\n"));\r
- );\r
+ DEBUG ((DEBUG_VERBOSE, "\n"));\r
+ DEBUG_CODE_END ();\r
//\r
- // Check the reponse data header (tag,parasize and returncode )\r
+ // Check the response data header (tag,parasize and returncode )\r
//\r
CopyMem (&Data16, BufferOut, sizeof (UINT16));\r
// TPM2 should not use this RSP_COMMAND\r
if (SwapBytes16 (Data16) == TPM_ST_RSP_COMMAND) {\r
- DEBUG ((EFI_D_ERROR, "TPM2: TPM_ST_RSP error - %x\n", TPM_ST_RSP_COMMAND));\r
+ DEBUG ((DEBUG_ERROR, "TPM2: TPM_ST_RSP error - %x\n", TPM_ST_RSP_COMMAND));\r
Status = EFI_UNSUPPORTED;\r
goto Exit;\r
}\r
}\r
}\r
Exit:\r
- DEBUG_CODE (\r
- DEBUG ((EFI_D_VERBOSE, "Tpm2TisTpmCommand Receive - "));\r
+ DEBUG_CODE_BEGIN ();\r
+ DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand Receive - "));\r
for (Index = 0; Index < TpmOutSize; Index++) {\r
- DEBUG ((EFI_D_VERBOSE, "%02x ", BufferOut[Index]));\r
+ DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
- DEBUG ((EFI_D_VERBOSE, "\n"));\r
- );\r
+ DEBUG ((DEBUG_VERBOSE, "\n"));\r
+ DEBUG_CODE_END ();\r
MmioWrite8((UINTN)&TisReg->Status, TIS_PC_STS_READY);\r
return Status;\r
}\r