SecurityPkg: Tpm2DeviceLib: Enable CapCRBIdleBypass support
Directly transition from CMD completion to CMD Ready state if device supports IdleByPass Cc: Long Qin <qin.long@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Long Qin <qin.long@intel.com>
This commit is contained in:
@@ -34,6 +34,18 @@ Tpm2GetPtpInterface (
|
||||
IN VOID *Register
|
||||
);
|
||||
|
||||
/**
|
||||
Return PTP CRB interface IdleByPass state.
|
||||
|
||||
@param[in] Register Pointer to PTP register.
|
||||
|
||||
@return PTP CRB interface IdleByPass state.
|
||||
**/
|
||||
UINT8
|
||||
Tpm2GetIdleByPass (
|
||||
IN VOID *Register
|
||||
);
|
||||
|
||||
/**
|
||||
Dump PTP register information.
|
||||
|
||||
@@ -97,6 +109,7 @@ Tpm2InstanceLibDTpmConstructor (
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
TPM2_PTP_INTERFACE_TYPE PtpInterface;
|
||||
UINT8 IdleByPass;
|
||||
|
||||
Status = Tpm2RegisterTpm2DeviceLib (&mDTpm2InternalTpm2Device);
|
||||
if ((Status == EFI_SUCCESS) || (Status == EFI_UNSUPPORTED)) {
|
||||
@@ -111,6 +124,12 @@ Tpm2InstanceLibDTpmConstructor (
|
||||
PtpInterface = Tpm2GetPtpInterface ((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddress));
|
||||
PcdSet8S(PcdActiveTpmInterfaceType, PtpInterface);
|
||||
}
|
||||
|
||||
if (PcdGet8(PcdActiveTpmInterfaceType) == PtpInterfaceCrb && PcdGet8(PcdCRBIdleByPass) == 0xFF) {
|
||||
IdleByPass = Tpm2GetIdleByPass((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddress));
|
||||
PcdSet8S(PcdCRBIdleByPass, IdleByPass);
|
||||
}
|
||||
|
||||
DumpPtpInfo ((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddress));
|
||||
}
|
||||
return EFI_SUCCESS;
|
||||
|
Reference in New Issue
Block a user