]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h
MdePkg: introduce standalone MM entry point library implementation
[mirror_edk2.git] / SecurityPkg / Tcg / Tcg2Config / Tcg2ConfigNvData.h
1 /** @file
2 Header file for NV data structure definition.
3
4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __TCG2_CONFIG_NV_DATA_H__
16 #define __TCG2_CONFIG_NV_DATA_H__
17
18 #include <Guid/HiiPlatformSetupFormset.h>
19 #include <Guid/Tcg2ConfigHii.h>
20 #include <IndustryStandard/TcgPhysicalPresence.h>
21
22 //
23 // BUGBUG: In order to pass VfrCompiler, we have to redefine below MACRO, which already in <Protocol/Tcg2Protocol.h>.
24 //
25 #ifndef __TCG2_H__
26 #define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 0x00000001
27 #define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 0x00000002
28 #endif
29 #define EFI_TCG2_EVENT_LOG_FORMAT_ALL (EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 | EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)
30
31 #define TCG2_CONFIGURATION_VARSTORE_ID 0x0001
32 #define TCG2_CONFIGURATION_INFO_VARSTORE_ID 0x0002
33 #define TCG2_VERSION_VARSTORE_ID 0x0003
34 #define TCG2_CONFIGURATION_FORM_ID 0x0001
35
36 #define KEY_TPM_DEVICE 0x2000
37 #define KEY_TPM2_OPERATION 0x2001
38 #define KEY_TPM2_OPERATION_PARAMETER 0x2002
39 #define KEY_TPM2_PCR_BANKS_REQUEST_0 0x2003
40 #define KEY_TPM2_PCR_BANKS_REQUEST_1 0x2004
41 #define KEY_TPM2_PCR_BANKS_REQUEST_2 0x2005
42 #define KEY_TPM2_PCR_BANKS_REQUEST_3 0x2006
43 #define KEY_TPM2_PCR_BANKS_REQUEST_4 0x2007
44 #define KEY_TPM_DEVICE_INTERFACE 0x2008
45 #define KEY_TCG2_PPI_VERSION 0x2009
46 #define KEY_TPM2_ACPI_REVISION 0x200A
47
48 #define TPM_DEVICE_NULL 0
49 #define TPM_DEVICE_1_2 1
50 #define TPM_DEVICE_2_0_DTPM 2
51 #define TPM_DEVICE_MIN TPM_DEVICE_1_2
52 #define TPM_DEVICE_MAX TPM_DEVICE_2_0_DTPM
53 #define TPM_DEVICE_DEFAULT TPM_DEVICE_1_2
54
55 #define TPM2_ACPI_REVISION_3 3
56 #define TPM2_ACPI_REVISION_4 4
57
58 #define TPM_DEVICE_INTERFACE_TIS 0
59 #define TPM_DEVICE_INTERFACE_PTP_FIFO 1
60 #define TPM_DEVICE_INTERFACE_PTP_CRB 2
61 #define TPM_DEVICE_INTERFACE_MAX TPM_DEVICE_INTERFACE_PTP_FIFO
62 #define TPM_DEVICE_INTERFACE_DEFAULT TPM_DEVICE_INTERFACE_PTP_CRB
63
64 #define TCG2_PROTOCOL_VERSION_DEFAULT 0x0001
65 #define EFI_TCG2_EVENT_LOG_FORMAT_DEFAULT EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2
66
67 #define TCG2_PPI_VERSION_1_2 0x322E31 // "1.2"
68 #define TCG2_PPI_VERSION_1_3 0x332E31 // "1.3"
69
70 //
71 // Nv Data structure referenced by IFR, TPM device user desired
72 //
73 typedef struct {
74 UINT8 TpmDevice;
75 } TCG2_CONFIGURATION;
76
77 typedef struct {
78 UINT64 PpiVersion;
79 UINT8 Tpm2AcpiTableRev;
80 } TCG2_VERSION;
81
82 typedef struct {
83 BOOLEAN Sha1Supported;
84 BOOLEAN Sha256Supported;
85 BOOLEAN Sha384Supported;
86 BOOLEAN Sha512Supported;
87 BOOLEAN Sm3Supported;
88 UINT8 TpmDeviceInterfaceAttempt;
89 BOOLEAN TpmDeviceInterfacePtpFifoSupported;
90 BOOLEAN TpmDeviceInterfacePtpCrbSupported;
91 } TCG2_CONFIGURATION_INFO;
92
93 //
94 // Variable saved for S3, TPM detected, only valid in S3 path.
95 // This variable is ReadOnly.
96 //
97 typedef struct {
98 UINT8 TpmDeviceDetected;
99 } TCG2_DEVICE_DETECTION;
100
101 #define TCG2_STORAGE_NAME L"TCG2_CONFIGURATION"
102 #define TCG2_STORAGE_INFO_NAME L"TCG2_CONFIGURATION_INFO"
103 #define TCG2_DEVICE_DETECTION_NAME L"TCG2_DEVICE_DETECTION"
104 #define TCG2_VERSION_NAME L"TCG2_VERSION"
105
106 #define TPM_INSTANCE_ID_LIST { \
107 {TPM_DEVICE_INTERFACE_NONE, TPM_DEVICE_NULL}, \
108 {TPM_DEVICE_INTERFACE_TPM12, TPM_DEVICE_1_2}, \
109 {TPM_DEVICE_INTERFACE_TPM20_DTPM, TPM_DEVICE_2_0_DTPM}, \
110 }
111
112 //
113 // BUGBUG: In order to pass VfrCompiler, we have to redefine GUID here.
114 //
115 #ifndef __BASE_H__
116 typedef struct {
117 UINT32 Data1;
118 UINT16 Data2;
119 UINT16 Data3;
120 UINT8 Data4[8];
121 } GUID;
122 #endif
123
124 typedef struct {
125 GUID TpmInstanceGuid;
126 UINT8 TpmDevice;
127 } TPM_INSTANCE_ID;
128
129 #endif