Skip to content

Commit 4de8d61

Browse files
kraxelmergify[bot]
authored andcommitted
OvmfPkg: rework TPM configuration
Rename TPM_ENABLE to TPM2_ENABLE so naming is in line with the ArmVirtPkg config option name. Add separate TPM1_ENABLE option for TPM 1.2 support. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Stefan Berger <stefanb@linux.ibm.com>
1 parent b819388 commit 4de8d61

14 files changed

+41
-18
lines changed

OvmfPkg/OvmfTpmComponentsDxe.dsc.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
!if $(TPM_ENABLE) == TRUE
5+
!if $(TPM2_ENABLE) == TRUE
66
SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf {
77
<LibraryClasses>
88
Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.inf
@@ -15,10 +15,12 @@
1515
NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf
1616
}
1717
SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
18+
!if $(TPM1_ENABLE) == TRUE
1819
SecurityPkg/Tcg/TcgDxe/TcgDxe.inf {
1920
<LibraryClasses>
2021
Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf
2122
}
23+
!endif
2224
SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf {
2325
<LibraryClasses>
2426
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf

OvmfPkg/OvmfTpmComponentsPei.dsc.inc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
!if $(TPM_ENABLE) == TRUE
5+
!if $(TPM2_ENABLE) == TRUE
66
OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
7+
!if $(TPM1_ENABLE) == TRUE
78
OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
89
SecurityPkg/Tcg/TcgPei/TcgPei.inf
10+
!else
11+
OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
12+
!endif
913
SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {
1014
<LibraryClasses>
1115
HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf

OvmfPkg/OvmfTpmDefines.dsc.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
DEFINE TPM_ENABLE = FALSE
5+
DEFINE TPM2_ENABLE = FALSE
6+
7+
# has no effect unless TPM2_ENABLE == TRUE
8+
DEFINE TPM1_ENABLE = TRUE

OvmfPkg/OvmfTpmDxe.fdf.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
!if $(TPM_ENABLE) == TRUE
5+
!if $(TPM2_ENABLE) == TRUE
6+
!if $(TPM1_ENABLE) == TRUE
67
INF SecurityPkg/Tcg/TcgDxe/TcgDxe.inf
8+
!endif
79
INF SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
810
INF SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf
911
INF SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf

OvmfPkg/OvmfTpmLibs.dsc.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
!if $(TPM_ENABLE) == TRUE
5+
!if $(TPM2_ENABLE) == TRUE
6+
!if $(TPM1_ENABLE) == TRUE
67
Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf
8+
!endif
79
Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
810
Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
911
Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf

OvmfPkg/OvmfTpmLibsDxe.dsc.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
!if $(TPM_ENABLE) == TRUE
5+
!if $(TPM2_ENABLE) == TRUE
6+
!if $(TPM1_ENABLE) == TRUE
67
Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.inf
8+
!endif
79
Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf
810
!endif

OvmfPkg/OvmfTpmLibsPeim.dsc.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
!if $(TPM_ENABLE) == TRUE
5+
!if $(TPM2_ENABLE) == TRUE
66
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
7+
!if $(TPM1_ENABLE) == TRUE
78
Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf
9+
!endif
810
Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf
911
!endif

OvmfPkg/OvmfTpmPcds.dsc.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
!if $(TPM_ENABLE) == TRUE
5+
!if $(TPM2_ENABLE) == TRUE
66
gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
77
!endif

OvmfPkg/OvmfTpmPcdsHii.dsc.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
!if $(TPM_ENABLE) == TRUE
5+
!if $(TPM2_ENABLE) == TRUE
66
gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS
77
gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x8|3|NV,BS
88
!endif

OvmfPkg/OvmfTpmPei.fdf.inc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
# SPDX-License-Identifier: BSD-2-Clause-Patent
33
##
44

5-
!if $(TPM_ENABLE) == TRUE
5+
!if $(TPM2_ENABLE) == TRUE
66
INF OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
7+
!if $(TPM1_ENABLE) == TRUE
78
INF OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
89
INF SecurityPkg/Tcg/TcgPei/TcgPei.inf
10+
!else
11+
INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
12+
!endif
913
INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
1014
INF SecurityPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf
1115
!endif

0 commit comments

Comments
 (0)