TianoCore EDK2 master
Loading...
Searching...
No Matches
Tpm2DeviceLibDTpmBase.c
Go to the documentation of this file.
1
11#include <Library/PcdLib.h>
12
13#include "Tpm2DeviceLibDTpm.h"
14
20UINT8
22 VOID
23 )
24{
25 return PcdGet8 (PcdCRBIdleByPass);
26}
27
33TPM2_PTP_INTERFACE_TYPE
35 VOID
36 )
37{
38 return PcdGet8 (PcdActiveTpmInterfaceType);
39}
40
48 VOID
49 )
50{
51 TPM2_PTP_INTERFACE_TYPE PtpInterface;
52 UINT8 IdleByPass;
53
54 //
55 // Cache current active TpmInterfaceType only when needed
56 //
57 if (PcdGet8 (PcdActiveTpmInterfaceType) == 0xFF) {
58 PtpInterface = Tpm2GetPtpInterface ((VOID *)(UINTN)PcdGet64 (PcdTpmBaseAddress));
59 PcdSet8S (PcdActiveTpmInterfaceType, PtpInterface);
60 }
61
62 if ((PcdGet8 (PcdActiveTpmInterfaceType) == Tpm2PtpInterfaceCrb) && (PcdGet8 (PcdCRBIdleByPass) == 0xFF)) {
63 IdleByPass = Tpm2GetIdleByPass ((VOID *)(UINTN)PcdGet64 (PcdTpmBaseAddress));
64 PcdSet8S (PcdCRBIdleByPass, IdleByPass);
65 }
66
67 return EFI_SUCCESS;
68}
UINT64 UINTN
#define PcdGet64(TokenName)
Definition: PcdLib.h:375
#define PcdGet8(TokenName)
Definition: PcdLib.h:336
#define PcdSet8S(TokenName, Value)
Definition: PcdLib.h:469
UINT8 Tpm2GetIdleByPass(IN VOID *Register)
Definition: Tpm2Ptp.c:482
TPM2_PTP_INTERFACE_TYPE Tpm2GetPtpInterface(IN VOID *Register)
Definition: Tpm2Ptp.c:435
TPM2_PTP_INTERFACE_TYPE GetCachedPtpInterface(VOID)
EFI_STATUS InternalTpm2DeviceLibDTpmCommonConstructor(VOID)
UINT8 GetCachedIdleByPass(VOID)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112