]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h
Add TPM2 support defined in trusted computing group.
[mirror_edk2.git] / SecurityPkg / Tcg / Tcg2Config / Tcg2ConfigNvData.h
diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h
new file mode 100644 (file)
index 0000000..65044c2
--- /dev/null
@@ -0,0 +1,94 @@
+/** @file\r
+  Header file for NV data structure definition.\r
+\r
+Copyright (c) 2015, 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
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __TCG2_CONFIG_NV_DATA_H__\r
+#define __TCG2_CONFIG_NV_DATA_H__\r
+\r
+#include <Guid/HiiPlatformSetupFormset.h>\r
+#include <Guid/Tcg2ConfigHii.h>\r
+#include <IndustryStandard/TcgPhysicalPresence.h>\r
+\r
+//\r
+// BUGBUG: In order to pass VfrCompiler, we have to redefine below MACRO, which already in <Protocol/Tcg2Protocol.h>.\r
+//\r
+#ifndef __TCG2_H__\r
+#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2       0x00000001\r
+#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2         0x00000002\r
+#endif\r
+#define EFI_TCG2_EVENT_LOG_FORMAT_ALL           (EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 | EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)\r
+\r
+#define TCG2_CONFIGURATION_VARSTORE_ID  0x0001\r
+#define TCG2_CONFIGURATION_FORM_ID      0x0001\r
+\r
+#define KEY_TPM_DEVICE                                 0x2000\r
+#define KEY_TPM2_OPERATION                             0x2001\r
+#define KEY_TPM2_OPERATION_PARAMETER            0x2002\r
+#define KEY_TPM2_PCR_BANKS_REQUEST_0            0x2003\r
+#define KEY_TPM2_PCR_BANKS_REQUEST_1            0x2004\r
+#define KEY_TPM2_PCR_BANKS_REQUEST_2            0x2005\r
+#define KEY_TPM2_PCR_BANKS_REQUEST_3            0x2006\r
+#define KEY_TPM2_PCR_BANKS_REQUEST_4            0x2007\r
+\r
+#define TPM_DEVICE_NULL           0\r
+#define TPM_DEVICE_1_2            1\r
+#define TPM_DEVICE_2_0_DTPM       2\r
+#define TPM_DEVICE_MIN            TPM_DEVICE_1_2\r
+#define TPM_DEVICE_MAX            TPM_DEVICE_2_0_DTPM\r
+#define TPM_DEVICE_DEFAULT        TPM_DEVICE_1_2\r
+\r
+#define TCG2_PROTOCOL_VERSION_DEFAULT        0x0001\r
+#define EFI_TCG2_EVENT_LOG_FORMAT_DEFAULT    EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2\r
+\r
+//\r
+// Nv Data structure referenced by IFR, TPM device user desired\r
+//\r
+typedef struct {\r
+  UINT8   TpmDevice;\r
+} TCG2_CONFIGURATION;\r
+\r
+//\r
+// Variable saved for S3, TPM detected, only valid in S3 path.\r
+// This variable is ReadOnly.\r
+//\r
+typedef struct {\r
+  UINT8   TpmDeviceDetected;\r
+} TCG2_DEVICE_DETECTION;\r
+\r
+#define TCG2_STORAGE_NAME  L"TCG2_CONFIGURATION"\r
+#define TCG2_DEVICE_DETECTION_NAME  L"TCG2_DEVICE_DETECTION"\r
+\r
+#define TPM_INSTANCE_ID_LIST  { \\r
+  {TPM_DEVICE_INTERFACE_NONE,           TPM_DEVICE_NULL},      \\r
+  {TPM_DEVICE_INTERFACE_TPM12,          TPM_DEVICE_1_2},       \\r
+  {TPM_DEVICE_INTERFACE_TPM20_DTPM,     TPM_DEVICE_2_0_DTPM},  \\r
+}\r
+\r
+//\r
+// BUGBUG: In order to pass VfrCompiler, we have to redefine GUID here.\r
+//\r
+#ifndef __BASE_H__\r
+typedef struct {\r
+  UINT32  Data1;\r
+  UINT16  Data2;\r
+  UINT16  Data3;\r
+  UINT8   Data4[8];\r
+} GUID;\r
+#endif\r
+\r
+typedef struct {\r
+  GUID       TpmInstanceGuid;\r
+  UINT8      TpmDevice;\r
+} TPM_INSTANCE_ID;\r
+\r
+#endif\r