summaryrefslogtreecommitdiff
path: root/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
diff options
context:
space:
mode:
authorjyao1 <jyao1>2013-09-18 05:31:18 +0000
committerjyao1 <jyao1@6f19259b-4bc3-4df7-8a09-765794883524>2013-09-18 05:31:18 +0000
commitc1d932429ef9700a2da64452546be14e92468b07 (patch)
tree5f2c09763c54a953d5525b6b5da48634992c2aa0 /SecurityPkg/Tcg/TcgDxe/TcgDxe.c
parent2e61fb38b6aaa17d22f1bf72332ccd4bc2f780eb (diff)
Add TPM2 implementation.
signed off by: jiewen.yao@intel.com reviewed by: guo.dong@intel.com git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14687 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/Tcg/TcgDxe/TcgDxe.c')
-rw-r--r--SecurityPkg/Tcg/TcgDxe/TcgDxe.c40
1 files changed, 8 insertions, 32 deletions
diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
index 4f3568ba84..322d726037 100644
--- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
+++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
@@ -24,6 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/PeImage.h>
#include <IndustryStandard/SmBios.h>
+#include <IndustryStandard/TcpaAcpi.h>
#include <Guid/GlobalVariable.h>
#include <Guid/SmBios.h>
@@ -31,6 +32,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/TcgEventHob.h>
#include <Guid/EventGroup.h>
#include <Guid/EventExitBootServiceFailed.h>
+#include <Guid/TpmInstance.h>
+
#include <Protocol/DevicePath.h>
#include <Protocol/TcgService.h>
#include <Protocol/AcpiTable.h>
@@ -53,38 +56,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define EFI_TCG_LOG_AREA_SIZE 0x10000
-#pragma pack (1)
-
-typedef struct _EFI_TCG_CLIENT_ACPI_TABLE {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT16 PlatformClass;
- UINT32 Laml;
- EFI_PHYSICAL_ADDRESS Lasa;
-} EFI_TCG_CLIENT_ACPI_TABLE;
-
-typedef struct _EFI_TCG_SERVER_ACPI_TABLE {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT16 PlatformClass;
- UINT16 Reserved0;
- UINT64 Laml;
- EFI_PHYSICAL_ADDRESS Lasa;
- UINT16 SpecRev;
- UINT8 DeviceFlags;
- UINT8 InterruptFlags;
- UINT8 Gpe;
- UINT8 Reserved1[3];
- UINT32 GlobalSysInt;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE BaseAddress;
- UINT32 Reserved2;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE ConfigAddress;
- UINT8 PciSegNum;
- UINT8 PciBusNum;
- UINT8 PciDevNum;
- UINT8 PciFuncNum;
-} EFI_TCG_SERVER_ACPI_TABLE;
-
-#pragma pack ()
-
#define TCG_DXE_DATA_FROM_THIS(this) \
BASE_CR (this, TCG_DXE_DATA, TcgProtocol)
@@ -1344,6 +1315,11 @@ DriverEntry (
EFI_EVENT Event;
VOID *Registration;
+ if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){
+ DEBUG ((EFI_D_ERROR, "No TPM12 instance required!\n"));
+ return EFI_UNSUPPORTED;
+ }
+
mTcgDxeData.TpmHandle = (TIS_TPM_HANDLE)(UINTN)TPM_BASE_ADDRESS;
Status = TisPcRequestUseTpm (mTcgDxeData.TpmHandle);
if (EFI_ERROR (Status)) {