diff options
author | Zhang, Chao B <chao.b.zhang@intel.com> | 2018-03-23 14:04:01 +0800 |
---|---|---|
committer | Zhang, Chao B <chao.b.zhang@intel.com> | 2018-06-27 09:31:01 +0800 |
commit | 631976706de655baa5f44ff00d69f9773ad325f3 (patch) | |
tree | a1bdf0f5b2ec99604e1cda81a0b07e3b8734e37e /SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c | |
parent | 714eedc5b9ee92629e649c100862b828448a91c7 (diff) | |
download | edk2-631976706de655baa5f44ff00d69f9773ad325f3.tar.gz edk2-631976706de655baa5f44ff00d69f9773ad325f3.tar.bz2 edk2-631976706de655baa5f44ff00d69f9773ad325f3.zip |
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>
Diffstat (limited to 'SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c')
-rw-r--r-- | SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c b/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c index 3feb64df7e..e6fe563b40 100644 --- a/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c +++ b/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c @@ -32,6 +32,18 @@ Tpm2GetPtpInterface ( );
/**
+ Return PTP CRB interface IdleByPass state.
+
+ @param[in] Register Pointer to PTP register.
+
+ @return PTP CRB interface IdleByPass state.
+**/
+UINT8
+Tpm2GetIdleByPass (
+ IN VOID *Register
+ );
+
+/**
This service enables the sending of commands to the TPM2.
@param[in] InputParameterBlockSize Size of the TPM2 input parameter block.
@@ -140,6 +152,7 @@ Tpm2DeviceLibConstructor ( )
{
TPM2_PTP_INTERFACE_TYPE PtpInterface;
+ UINT8 IdleByPass;
//
// Cache current active TpmInterfaceType only when needed
@@ -148,5 +161,11 @@ Tpm2DeviceLibConstructor ( 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);
+ }
+
return EFI_SUCCESS;
}
|