From: Marc-André Lureau <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
---
SecurityPkg/Include/Library/Tpm12DeviceLib.h | 13 +++++++++++++
.../Library/Tpm12DeviceLibDTpm/Tpm12Tis.c | 17 ++++++++++-------
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/SecurityPkg/Include/Library/Tpm12DeviceLib.h
b/SecurityPkg/Include/Library/Tpm12DeviceLib.h
index eac7885ca3d8..bcdfbdac76b5 100644
--- a/SecurityPkg/Include/Library/Tpm12DeviceLib.h
+++ b/SecurityPkg/Include/Library/Tpm12DeviceLib.h
@@ -11,6 +11,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <IndustryStandard/Tpm12.h>
+typedef enum {
+ PtpInterfaceTis,
+ PtpInterfaceFifo,
+ PtpInterfaceCrb,
+ PtpInterfaceMax,
+} PTP_INTERFACE_TYPE;
+
/**
This service enables the sending of commands to the TPM12.
@@ -45,4 +52,10 @@ Tpm12RequestUseTpm (
VOID
);
+EFIAPI
+PTP_INTERFACE_TYPE
+Tpm12GetPtpInterfaceType (
+ VOID
+ );
+
#endif
diff --git a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
index 1caa076203ba..381915130b7f 100644
--- a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
+++ b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
@@ -15,18 +15,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/TimerLib.h>
#include <Library/DebugLib.h>
#include <Library/Tpm12CommandLib.h>
+#include <Library/Tpm12DeviceLib.h>
#include <Library/PcdLib.h>
#include <IndustryStandard/TpmPtp.h>
#include <IndustryStandard/TpmTis.h>
-typedef enum {
- PtpInterfaceTis,
- PtpInterfaceFifo,
- PtpInterfaceCrb,
- PtpInterfaceMax,
-} PTP_INTERFACE_TYPE;
-
//
// Max TPM command/reponse length
//
@@ -542,3 +536,12 @@ Tpm12RequestUseTpm (
return EFI_NOT_FOUND;
}
}
+
+EFIAPI
+PTP_INTERFACE_TYPE
+Tpm12GetPtpInterfaceType (
+ VOID
+ )
+{
+ return Tpm12GetPtpInterface ((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddress));
+}
--
2.25.0.rc2.1.g09a9a1a997
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#54359): https://edk2.groups.io/g/devel/message/54359
Mute This Topic: https://groups.io/mt/71240874/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-