]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/TcgStorageOpal.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / TcgStorageOpal.h
1 /** @file
2 Opal Specification defined values and structures.
3
4 (TCG Storage Architecture Core Specification, Version 2.01, Revision 1.00,
5 https://trustedcomputinggroup.org/tcg-storage-architecture-core-specification/
6
7 Storage Work Group Storage Security Subsystem Class: Pyrite, Version 1.00 Final, Revision 1.00,
8 https://trustedcomputinggroup.org/tcg-storage-security-subsystem-class-pyrite/
9
10 Storage Work Group Storage Security Subsystem Class: Opal, Version 2.01 Final, Revision 1.00,
11 https://trustedcomputinggroup.org/storage-work-group-storage-security-subsystem-class-opal/
12
13 TCG Storage Security Subsystem Class: Opalite Version 1.00 Revision 1.00,
14 https://trustedcomputinggroup.org/tcg-storage-security-subsystem-class-opalite/)
15
16 Check http://trustedcomputinggroup.org for latest specification updates.
17
18 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
19 SPDX-License-Identifier: BSD-2-Clause-Patent
20
21 **/
22
23 #ifndef _TCG_STORAGE_OPAL_H_
24 #define _TCG_STORAGE_OPAL_H_
25
26 #include <IndustryStandard/TcgStorageCore.h>
27
28 #define OPAL_UID_ADMIN_SP TCG_TO_UID(0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00, 0x01)
29 #define OPAL_UID_ADMIN_SP_C_PIN_MSID TCG_TO_UID(0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x84, 0x02)
30 #define OPAL_UID_ADMIN_SP_C_PIN_SID TCG_TO_UID(0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01)
31 #define OPAL_UID_LOCKING_SP TCG_TO_UID(0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00, 0x02)
32
33 // ADMIN_SP
34 // Authorities
35 #define OPAL_ADMIN_SP_ANYBODY_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01)
36 #define OPAL_ADMIN_SP_ADMINS_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02)
37 #define OPAL_ADMIN_SP_MAKERS_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03)
38 #define OPAL_ADMIN_SP_SID_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06)
39 #define OPAL_ADMIN_SP_ADMIN1_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x02, 0x01)
40 #define OPAL_ADMIN_SP_PSID_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0xFF, 0x01)
41
42 #define OPAL_ADMIN_SP_ACTIVATE_METHOD TCG_TO_UID(0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x02, 0x03)
43 #define OPAL_ADMIN_SP_REVERT_METHOD TCG_TO_UID(0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x02, 0x02)
44
45 // ADMIN_SP
46 // Data Removal mechanism
47 #define OPAL_UID_ADMIN_SP_DATA_REMOVAL_MECHANISM TCG_TO_UID(0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x00, 0x01)
48
49 // LOCKING SP
50 // Authorities
51 #define OPAL_LOCKING_SP_ANYBODY_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01)
52 #define OPAL_LOCKING_SP_ADMINS_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02)
53 #define OPAL_LOCKING_SP_ADMIN1_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0x00, 0x01)
54 #define OPAL_LOCKING_SP_USERS_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x03, 0x00, 0x00)
55 #define OPAL_LOCKING_SP_USER1_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x03, 0x00, 0x01)
56
57 #define OPAL_LOCKING_SP_REVERTSP_METHOD TCG_TO_UID(0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11)
58
59 // C_PIN Table Rows
60 #define OPAL_LOCKING_SP_C_PIN_ADMIN1 TCG_TO_UID( 0x00, 0x00, 0x00, 0x0B, 0x00, 0x01, 0x00, 0x01 )
61 #define OPAL_LOCKING_SP_C_PIN_USER1 TCG_TO_UID( 0x00, 0x00, 0x00, 0x0B, 0x00, 0x03, 0x00, 0x01 )
62
63 // Locking Table
64 #define OPAL_LOCKING_SP_LOCKING_GLOBALRANGE TCG_TO_UID( 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x01 )
65 #define OPAL_LOCKING_SP_LOCKING_RANGE1 TCG_TO_UID( 0x00, 0x00, 0x08, 0x02, 0x00, 0x03, 0x00, 0x01 )
66
67
68 // LOCKING SP ACE Table Preconfiguration
69 #define OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_GET_ALL TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xD0, 0x00 )
70 #define OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_SET_RDLOCKED TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xE0, 0x00 )
71 #define OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_SET_WRLOCKED TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xE8, 0x00 )
72
73 #define OPAL_LOCKING_SP_ACE_K_AES_256_GLOBALRANGE_GENKEY TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xB8, 0x00 )
74 #define OPAL_LOCKING_SP_ACE_K_AES_128_GLOBALRANGE_GENKEY TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xB0, 0x00 )
75
76
77 // LOCKING SP LockingInfo Table Preconfiguration
78 #define OPAL_LOCKING_SP_LOCKING_INFO TCG_TO_UID( 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x01 )
79
80 #define OPAL_LOCKING_SP_LOCKINGINFO_ALIGNMENTREQUIRED_COL 0x7
81 #define OPAL_LOCKING_SP_LOCKINGINFO_LOGICALBLOCKSIZE_COL 0x8
82 #define OPAL_LOCKING_SP_LOCKINGINFO_ALIGNMENTGRANULARITY_COL 0x9
83 #define OPAL_LOCKING_SP_LOCKINGINFO_LOWESTALIGNEDLBA_COL 0xA
84
85 // K_AES_256 Table Preconfiguration
86 #define OPAL_LOCKING_SP_K_AES_256_GLOBALRANGE_KEY TCG_TO_UID( 0x00, 0x00, 0x08, 0x06, 0x00, 0x00, 0x00, 0x01 )
87
88 // K_AES_128 Table Preconfiguration
89 #define OPAL_LOCKING_SP_K_AES_128_GLOBALRANGE_KEY TCG_TO_UID( 0x00, 0x00, 0x08, 0x05, 0x00, 0x00, 0x00, 0x01 )
90
91 // Minimum Properties that an Opal Compliant SD Shall support
92 #define OPAL_MIN_MAX_COM_PACKET_SIZE 2048
93 #define OPAL_MIN_MAX_REPONSE_COM_PACKET_SIZE 2048
94 #define OPAL_MIN_MAX_PACKET_SIZE 2028
95 #define OPAL_MIN_MAX_IND_TOKEN_SIZE 1992
96 #define OPAL_MIN_MAX_PACKETS 1
97 #define OPAL_MIN_MAX_SUBPACKETS 1
98 #define OPAL_MIN_MAX_METHODS 1
99 #define OPAL_MIN_MAX_SESSIONS 1
100 #define OPAL_MIN_MAX_AUTHENTICATIONS 2
101 #define OPAL_MIN_MAX_TRANSACTION_LIMIT 1
102
103 #define OPAL_ADMIN_SP_PIN_COL 3
104 #define OPAL_LOCKING_SP_C_PIN_TRYLIMIT_COL 5
105 #define OPAL_RANDOM_METHOD_MAX_COUNT_SIZE 32
106
107 // Data Removal Mechanism column.
108 #define OPAL_ADMIN_SP_ACTIVE_DATA_REMOVAL_MECHANISM_COL 1
109
110 //
111 // Supported Data Removal Mechanism.
112 // Detail see Pyrite SSC v2 spec.
113 //
114 typedef enum {
115 OverwriteDataErase = 0,
116 BlockErase,
117 CryptoErase,
118 Unmap,
119 ResetWritePointers,
120 VendorSpecificErase,
121 ResearvedMechanism
122 } SUPPORTED_DATA_REMOVAL_MECHANISM;
123
124 #pragma pack(1)
125
126 typedef struct _OPAL_GEOMETRY_REPORTING_FEATURE {
127 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header;
128 UINT8 Reserved[8];
129 UINT32 LogicalBlockSizeBE;
130 UINT64 AlignmentGranularityBE;
131 UINT64 LowestAlignedLBABE;
132 } OPAL_GEOMETRY_REPORTING_FEATURE;
133
134 typedef struct _OPAL_SINGLE_USER_MODE_FEATURE {
135 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header;
136 UINT32 NumLockingObjectsSupportedBE;
137 UINT8 Any : 1;
138 UINT8 All : 1;
139 UINT8 Policy : 1;
140 UINT8 Reserved : 5;
141 UINT8 Reserved2[7];
142 } OPAL_SINGLE_USER_MODE_FEATURE;
143
144 typedef struct _OPAL_DATASTORE_TABLE_FEATURE {
145 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header;
146 UINT16 Reserved;
147 UINT16 MaxNumTablesBE;
148 UINT32 MaxTotalSizeBE;
149 UINT32 SizeAlignmentBE;
150 } OPAL_DATASTORE_TABLE_FEATURE;
151
152 typedef struct _OPAL_SSCV1_FEATURE_DESCRIPTOR {
153 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header;
154 UINT16 BaseComdIdBE;
155 UINT16 NumComIdsBE;
156 UINT8 RangeCrossing : 1;
157 UINT8 Reserved : 7;
158 UINT8 Future[11];
159 } OPAL_SSCV1_FEATURE_DESCRIPTOR;
160
161 typedef struct _OPAL_SSCV2_FEATURE_DESCRIPTOR {
162 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header;
163 UINT16 BaseComdIdBE;
164 UINT16 NumComIdsBE;
165 UINT8 Reserved;
166 UINT16 NumLockingSpAdminAuthoritiesSupportedBE;
167 UINT16 NumLockingSpUserAuthoritiesSupportedBE;
168 UINT8 InitialCPINSIDPIN;
169 UINT8 CPINSIDPINRevertBehavior;
170 UINT8 Future[5];
171 } OPAL_SSCV2_FEATURE_DESCRIPTOR;
172
173 typedef struct _OPAL_SSCLITE_FEATURE_DESCRIPTOR {
174 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header;
175 UINT16 BaseComdIdBE;
176 UINT16 NumComIdsBE;
177 UINT8 Reserved[5];
178 UINT8 InitialCPINSIDPIN;
179 UINT8 CPINSIDPINRevertBehavior;
180 UINT8 Future[5];
181 } OPAL_SSCLITE_FEATURE_DESCRIPTOR;
182
183 typedef struct _PYRITE_SSC_FEATURE_DESCRIPTOR {
184 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header;
185 UINT16 BaseComdIdBE;
186 UINT16 NumComIdsBE;
187 UINT8 Reserved[5];
188 UINT8 InitialCPINSIDPIN;
189 UINT8 CPINSIDPINRevertBehavior;
190 UINT8 Future[5];
191 } PYRITE_SSC_FEATURE_DESCRIPTOR;
192
193 typedef struct _PYRITE_SSCV2_FEATURE_DESCRIPTOR {
194 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header;
195 UINT16 BaseComdIdBE;
196 UINT16 NumComIdsBE;
197 UINT8 Reserved[5];
198 UINT8 InitialCPINSIDPIN;
199 UINT8 CPINSIDPINRevertBehavior;
200 UINT8 Future[5];
201 } PYRITE_SSCV2_FEATURE_DESCRIPTOR;
202
203 typedef struct _DATA_REMOVAL_FEATURE_DESCRIPTOR {
204 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header;
205 UINT8 Reserved;
206 UINT8 OperationProcessing : 1;
207 UINT8 Reserved2 : 7;
208 UINT8 RemovalMechanism;
209 UINT8 FormatBit0 : 1; // Data Removal Time Format for Bit 0
210 UINT8 FormatBit1 : 1; // Data Removal Time Format for Bit 1
211 UINT8 FormatBit2 : 1; // Data Removal Time Format for Bit 2
212 UINT8 FormatBit3 : 1; // Data Removal Time Format for Bit 3
213 UINT8 FormatBit4 : 1; // Data Removal Time Format for Bit 4
214 UINT8 FormatBit5 : 1; // Data Removal Time Format for Bit 5
215 UINT8 Reserved3 : 2;
216 UINT16 TimeBit0; // Data Removal Time for Supported Data Removal Mechanism Bit 0
217 UINT16 TimeBit1; // Data Removal Time for Supported Data Removal Mechanism Bit 1
218 UINT16 TimeBit2; // Data Removal Time for Supported Data Removal Mechanism Bit 2
219 UINT16 TimeBit3; // Data Removal Time for Supported Data Removal Mechanism Bit 3
220 UINT16 TimeBit4; // Data Removal Time for Supported Data Removal Mechanism Bit 4
221 UINT16 TimeBit5; // Data Removal Time for Supported Data Removal Mechanism Bit 5
222 UINT8 Future[16];
223 } DATA_REMOVAL_FEATURE_DESCRIPTOR;
224
225 typedef union {
226 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER CommonHeader;
227 TCG_TPER_FEATURE_DESCRIPTOR Tper;
228 TCG_LOCKING_FEATURE_DESCRIPTOR Locking;
229 OPAL_GEOMETRY_REPORTING_FEATURE Geometry;
230 OPAL_SINGLE_USER_MODE_FEATURE SingleUser;
231 OPAL_DATASTORE_TABLE_FEATURE DataStore;
232 OPAL_SSCV1_FEATURE_DESCRIPTOR OpalSscV1;
233 OPAL_SSCV2_FEATURE_DESCRIPTOR OpalSscV2;
234 OPAL_SSCLITE_FEATURE_DESCRIPTOR OpalSscLite;
235 PYRITE_SSC_FEATURE_DESCRIPTOR PyriteSsc;
236 PYRITE_SSCV2_FEATURE_DESCRIPTOR PyriteSscV2;
237 TCG_BLOCK_SID_FEATURE_DESCRIPTOR BlockSid;
238 DATA_REMOVAL_FEATURE_DESCRIPTOR DataRemoval;
239 } OPAL_LEVEL0_FEATURE_DESCRIPTOR;
240
241 #pragma pack()
242
243 #endif // _OPAL_H_