X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=SecurityPkg%2FLibrary%2FTpm2DeviceLibDTpm%2FTpm2DeviceLibDTpm.c;h=e6fe563b4000213aec9dc16695ce272630cd748f;hp=3feb64df7edfde5f1c0ac987f7e69018980818e6;hb=631976706de655baa5f44ff00d69f9773ad325f3;hpb=714eedc5b9ee92629e649c100862b828448a91c7 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 @@ -31,6 +31,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 + ); + /** This service enables the sending of commands to the TPM2. @@ -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; }