From 5c25f6c67b12859e9df833aa9027be4ce2a3d942 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 9 Dec 2022 21:03:46 +0800 Subject: OvmfPkg: move dsc and fdf include snippets for TPM support to subdirs Signed-off-by: Gerd Hoffmann Reviewed-by: Jiewen Yao --- OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc | 28 +++++++++++++++++++ OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc | 26 ++++++++++++++++++ OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc | 8 ++++++ OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc | 34 ++++++++++++++++++++++++ OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc | 7 +++++ OvmfPkg/Include/Dsc/OvmfTpmPcdsHii.dsc.inc | 8 ++++++ OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc | 10 +++++++ 7 files changed, 121 insertions(+) create mode 100644 OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc create mode 100644 OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc create mode 100644 OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc create mode 100644 OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc create mode 100644 OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc create mode 100644 OvmfPkg/Include/Dsc/OvmfTpmPcdsHii.dsc.inc create mode 100644 OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc (limited to 'OvmfPkg/Include') diff --git a/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc new file mode 100644 index 0000000000..75ae09571e --- /dev/null +++ b/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc @@ -0,0 +1,28 @@ +## +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +!if $(TPM2_ENABLE) == TRUE + SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf { + + Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.inf + NULL|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2InstanceLibDTpm.inf + HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.inf + NULL|SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.inf + NULL|SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.inf + NULL|SecurityPkg/Library/HashInstanceLibSha384/HashInstanceLibSha384.inf + NULL|SecurityPkg/Library/HashInstanceLibSha512/HashInstanceLibSha512.inf + NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf + } + SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf +!if $(TPM1_ENABLE) == TRUE + SecurityPkg/Tcg/TcgDxe/TcgDxe.inf { + + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf + } +!endif + SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf { + + TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf + } +!endif diff --git a/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc new file mode 100644 index 0000000000..fa486eed82 --- /dev/null +++ b/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc @@ -0,0 +1,26 @@ +## +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +!if $(TPM2_ENABLE) == TRUE + OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf +!if $(TPM1_ENABLE) == TRUE + OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf + SecurityPkg/Tcg/TcgPei/TcgPei.inf +!else + OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf +!endif + SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf { + + HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf + NULL|SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.inf + NULL|SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.inf + NULL|SecurityPkg/Library/HashInstanceLibSha384/HashInstanceLibSha384.inf + NULL|SecurityPkg/Library/HashInstanceLibSha512/HashInstanceLibSha512.inf + NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf + } + SecurityPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf { + + TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf + } +!endif diff --git a/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc new file mode 100644 index 0000000000..a65564d8d9 --- /dev/null +++ b/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc @@ -0,0 +1,8 @@ +## +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + + DEFINE TPM2_ENABLE = FALSE + + # has no effect unless TPM2_ENABLE == TRUE + DEFINE TPM1_ENABLE = TRUE diff --git a/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc new file mode 100644 index 0000000000..cd1a899d68 --- /dev/null +++ b/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc @@ -0,0 +1,34 @@ +## +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[LibraryClasses] +!if $(TPM2_ENABLE) == TRUE +!if $(TPM1_ENABLE) == TRUE + Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf +!endif + Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf + Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf + Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf + TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf +!else + Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf + TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf +!endif + +[LibraryClasses.common.PEIM] +!if $(TPM2_ENABLE) == TRUE + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf +!if $(TPM1_ENABLE) == TRUE + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf +!endif + Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf +!endif + +[LibraryClasses.common.DXE_DRIVER] +!if $(TPM2_ENABLE) == TRUE +!if $(TPM1_ENABLE) == TRUE + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.inf +!endif + Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf +!endif diff --git a/OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc new file mode 100644 index 0000000000..0d55d62737 --- /dev/null +++ b/OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc @@ -0,0 +1,7 @@ +## +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +!if $(TPM2_ENABLE) == TRUE + gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} +!endif diff --git a/OvmfPkg/Include/Dsc/OvmfTpmPcdsHii.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmPcdsHii.dsc.inc new file mode 100644 index 0000000000..e842253235 --- /dev/null +++ b/OvmfPkg/Include/Dsc/OvmfTpmPcdsHii.dsc.inc @@ -0,0 +1,8 @@ +## +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +!if $(TPM2_ENABLE) == TRUE + gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS + gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x8|3|NV,BS +!endif diff --git a/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc new file mode 100644 index 0000000000..e9ab2fca7b --- /dev/null +++ b/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc @@ -0,0 +1,10 @@ +## +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +!if $(TPM2_ENABLE) == TRUE +!if $(TPM1_ENABLE) == TRUE + NULL|SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf +!endif + NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.inf +!endif -- cgit v1.2.3