]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h
SecurityPkg: Replace BSD License with BSD+Patent License
[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 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef __TCG2_CONFIG_NV_DATA_H__
10 #define __TCG2_CONFIG_NV_DATA_H__
11
12 #include <Guid/HiiPlatformSetupFormset.h>
13 #include <Guid/Tcg2ConfigHii.h>
14 #include <IndustryStandard/TcgPhysicalPresence.h>
15
16 //
17 // BUGBUG: In order to pass VfrCompiler, we have to redefine below MACRO, which already in <Protocol/Tcg2Protocol.h>.
18 //
19 #ifndef __TCG2_H__
20 #define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 0x00000001
21 #define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 0x00000002
22 #endif
23 #define EFI_TCG2_EVENT_LOG_FORMAT_ALL (EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 | EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)
24
25 #define TCG2_CONFIGURATION_VARSTORE_ID 0x0001
26 #define TCG2_CONFIGURATION_INFO_VARSTORE_ID 0x0002
27 #define TCG2_VERSION_VARSTORE_ID 0x0003
28 #define TCG2_CONFIGURATION_FORM_ID 0x0001
29
30 #define KEY_TPM_DEVICE 0x2000
31 #define KEY_TPM2_OPERATION 0x2001
32 #define KEY_TPM2_OPERATION_PARAMETER 0x2002
33 #define KEY_TPM2_PCR_BANKS_REQUEST_0 0x2003
34 #define KEY_TPM2_PCR_BANKS_REQUEST_1 0x2004
35 #define KEY_TPM2_PCR_BANKS_REQUEST_2 0x2005
36 #define KEY_TPM2_PCR_BANKS_REQUEST_3 0x2006
37 #define KEY_TPM2_PCR_BANKS_REQUEST_4 0x2007
38 #define KEY_TPM_DEVICE_INTERFACE 0x2008
39 #define KEY_TCG2_PPI_VERSION 0x2009
40 #define KEY_TPM2_ACPI_REVISION 0x200A
41
42 #define TPM_DEVICE_NULL 0
43 #define TPM_DEVICE_1_2 1
44 #define TPM_DEVICE_2_0_DTPM 2
45 #define TPM_DEVICE_MIN TPM_DEVICE_1_2
46 #define TPM_DEVICE_MAX TPM_DEVICE_2_0_DTPM
47 #define TPM_DEVICE_DEFAULT TPM_DEVICE_1_2
48
49 #define TPM2_ACPI_REVISION_3 3
50 #define TPM2_ACPI_REVISION_4 4
51
52 #define TPM_DEVICE_INTERFACE_TIS 0
53 #define TPM_DEVICE_INTERFACE_PTP_FIFO 1
54 #define TPM_DEVICE_INTERFACE_PTP_CRB 2
55 #define TPM_DEVICE_INTERFACE_MAX TPM_DEVICE_INTERFACE_PTP_FIFO
56 #define TPM_DEVICE_INTERFACE_DEFAULT TPM_DEVICE_INTERFACE_PTP_CRB
57
58 #define TCG2_PROTOCOL_VERSION_DEFAULT 0x0001
59 #define EFI_TCG2_EVENT_LOG_FORMAT_DEFAULT EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2
60
61 #define TCG2_PPI_VERSION_1_2 0x322E31 // "1.2"
62 #define TCG2_PPI_VERSION_1_3 0x332E31 // "1.3"
63
64 //
65 // Nv Data structure referenced by IFR, TPM device user desired
66 //
67 typedef struct {
68 UINT8 TpmDevice;
69 } TCG2_CONFIGURATION;
70
71 typedef struct {
72 UINT64 PpiVersion;
73 UINT8 Tpm2AcpiTableRev;
74 } TCG2_VERSION;
75
76 typedef struct {
77 BOOLEAN Sha1Supported;
78 BOOLEAN Sha256Supported;
79 BOOLEAN Sha384Supported;
80 BOOLEAN Sha512Supported;
81 BOOLEAN Sm3Supported;
82 UINT8 TpmDeviceInterfaceAttempt;
83 BOOLEAN TpmDeviceInterfacePtpFifoSupported;
84 BOOLEAN TpmDeviceInterfacePtpCrbSupported;
85 } TCG2_CONFIGURATION_INFO;
86
87 //
88 // Variable saved for S3, TPM detected, only valid in S3 path.
89 // This variable is ReadOnly.
90 //
91 typedef struct {
92 UINT8 TpmDeviceDetected;
93 } TCG2_DEVICE_DETECTION;
94
95 #define TCG2_STORAGE_NAME L"TCG2_CONFIGURATION"
96 #define TCG2_STORAGE_INFO_NAME L"TCG2_CONFIGURATION_INFO"
97 #define TCG2_DEVICE_DETECTION_NAME L"TCG2_DEVICE_DETECTION"
98 #define TCG2_VERSION_NAME L"TCG2_VERSION"
99
100 #define TPM_INSTANCE_ID_LIST { \
101 {TPM_DEVICE_INTERFACE_NONE, TPM_DEVICE_NULL}, \
102 {TPM_DEVICE_INTERFACE_TPM12, TPM_DEVICE_1_2}, \
103 {TPM_DEVICE_INTERFACE_TPM20_DTPM, TPM_DEVICE_2_0_DTPM}, \
104 }
105
106 //
107 // BUGBUG: In order to pass VfrCompiler, we have to redefine GUID here.
108 //
109 #ifndef __BASE_H__
110 typedef struct {
111 UINT32 Data1;
112 UINT16 Data2;
113 UINT16 Data3;
114 UINT8 Data4[8];
115 } GUID;
116 #endif
117
118 typedef struct {
119 GUID TpmInstanceGuid;
120 UINT8 TpmDevice;
121 } TPM_INSTANCE_ID;
122
123 #endif