]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDriver.c
Add TPM2 implementation.
[mirror_edk2.git] / SecurityPkg / Tcg / TcgConfigDxe / TcgConfigDriver.c
index 2d3728cdb228a75f16a2e8cf5cba20b3781ad46f..a9a10c9e107f527d7a45f5c2436d1847e749bd44 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The module entry point for Tcg configuration module.\r
 \r
-Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 #include "TcgConfigImpl.h"\r
+#include <Guid/TpmInstance.h>\r
 \r
 /**\r
   The entry point for Tcg configuration driver.\r
@@ -37,6 +38,11 @@ TcgConfigDriverEntryPoint (
   TCG_CONFIG_PRIVATE_DATA   *PrivateData;\r
   EFI_TCG_PROTOCOL          *TcgProtocol;\r
 \r
+  if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){\r
+    DEBUG ((EFI_D_ERROR, "No TPM12 instance required!\n"));\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   Status = TisPcRequestUseTpm ((TIS_TPM_HANDLE) (UINTN) TPM_BASE_ADDRESS);\r
   if (EFI_ERROR (Status)) {\r
     DEBUG ((EFI_D_ERROR, "TPM not detected!\n"));\r