2 This file abstract internal interfaces of which implementation differs per library instance.
4 Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved. <BR>
5 Copyright (c) Microsoft Corporation.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/Tpm2DeviceLib.h>
12 #include "Tpm2DeviceLibDTpm.h"
14 TPM2_PTP_INTERFACE_TYPE mActiveTpmInterfaceType
;
18 Return cached PTP CRB interface IdleByPass state.
20 @return Cached PTP CRB interface IdleByPass state.
27 return mCRBIdleByPass
;
31 Return cached PTP interface type.
33 @return Cached PTP interface type.
35 TPM2_PTP_INTERFACE_TYPE
36 GetCachedPtpInterface (
40 return mActiveTpmInterfaceType
;
44 The common function cache current active TpmInterfaceType when needed.
46 @retval EFI_SUCCESS DTPM2.0 instance is registered, or system does not support register DTPM2.0 instance
49 InternalTpm2DeviceLibDTpmCommonConstructor (
53 mActiveTpmInterfaceType
= 0xFF;
54 mCRBIdleByPass
= 0xFF;
57 // Always cache current active TpmInterfaceType for StandaloneMm implementation
59 mActiveTpmInterfaceType
= Tpm2GetPtpInterface ((VOID
*)(UINTN
)PcdGet64 (PcdTpmBaseAddress
));
61 if (mActiveTpmInterfaceType
== Tpm2PtpInterfaceCrb
) {
62 mCRBIdleByPass
= Tpm2GetIdleByPass ((VOID
*)(UINTN
)PcdGet64 (PcdTpmBaseAddress
));