summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Tcg/Tcg2Config
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/Tcg/Tcg2Config')
-rw-r--r--OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf11
-rw-r--r--OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h4
-rw-r--r--OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c25
3 files changed, 38 insertions, 2 deletions
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
index aa996b7da7..194ebfba64 100644
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
@@ -21,9 +21,14 @@
[Sources]
Tcg2ConfigPeim.c
- Tpm12Support.c
Tpm12Support.h
+[Sources.IA32, Sources.X64]
+ Tpm12Support.c
+
+[Sources.ARM, Sources.AARCH64]
+ Tpm12SupportNull.c
+
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
@@ -35,9 +40,11 @@
BaseLib
DebugLib
PeiServicesLib
- Tpm12DeviceLib
Tpm2DeviceLib
+[LibraryClasses.IA32, LibraryClasses.X64]
+ Tpm12DeviceLib
+
[Guids]
gEfiTpmDeviceSelectedGuid ## PRODUCES ## GUID # Used as a PPI GUID
gEfiTpmDeviceInstanceTpm20DtpmGuid ## SOMETIMES_CONSUMES
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h b/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h
index c739775d23..d92c432530 100644
--- a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h
+++ b/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h
@@ -15,6 +15,10 @@
/**
Detect the presence of a TPM with interface version 1.2.
+ @retval EFI_UNSUPPORTED The platform that includes this particular
+ implementation of the function does not support
+ TPM-1.2.
+
@retval EFI_SUCCESS TPM-1.2 available. The Tpm12RequestUseTpm() and
Tpm12SubmitCommand(TPM_ORD_GetTicks) operations
(from the Tpm12DeviceLib class) have succeeded.
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c b/OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c
new file mode 100644
index 0000000000..7bb377b9b9
--- /dev/null
+++ b/OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c
@@ -0,0 +1,25 @@
+/** @file
+ Null implementation of InternalTpm12Detect(), always returning
+ EFI_UNSUPPORTED.
+
+ Copyright (C) 2020, Red Hat, Inc.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include "Tpm12Support.h"
+
+/**
+ Detect the presence of a TPM with interface version 1.2.
+
+ @retval EFI_UNSUPPORTED The platform that includes this particular
+ implementation of the function does not support
+ TPM-1.2.
+**/
+EFI_STATUS
+InternalTpm12Detect (
+ VOID
+ )
+{
+ return EFI_UNSUPPORTED;
+}