TianoCore EDK2 master
Loading...
Searching...
No Matches
TcgStorageOpal.h
Go to the documentation of this file.
1
23#ifndef _TCG_STORAGE_OPAL_H_
24#define _TCG_STORAGE_OPAL_H_
25
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// LOCKING SP ACE Table Preconfiguration
68#define OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_GET_ALL TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xD0, 0x00 )
69#define OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_SET_RDLOCKED TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xE0, 0x00 )
70#define OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_SET_WRLOCKED TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xE8, 0x00 )
71
72#define OPAL_LOCKING_SP_ACE_K_AES_256_GLOBALRANGE_GENKEY TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xB8, 0x00 )
73#define OPAL_LOCKING_SP_ACE_K_AES_128_GLOBALRANGE_GENKEY TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xB0, 0x00 )
74
75// LOCKING SP LockingInfo Table Preconfiguration
76#define OPAL_LOCKING_SP_LOCKING_INFO TCG_TO_UID( 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x01 )
77
78#define OPAL_LOCKING_SP_LOCKINGINFO_ALIGNMENTREQUIRED_COL 0x7
79#define OPAL_LOCKING_SP_LOCKINGINFO_LOGICALBLOCKSIZE_COL 0x8
80#define OPAL_LOCKING_SP_LOCKINGINFO_ALIGNMENTGRANULARITY_COL 0x9
81#define OPAL_LOCKING_SP_LOCKINGINFO_LOWESTALIGNEDLBA_COL 0xA
82
83// K_AES_256 Table Preconfiguration
84#define OPAL_LOCKING_SP_K_AES_256_GLOBALRANGE_KEY TCG_TO_UID( 0x00, 0x00, 0x08, 0x06, 0x00, 0x00, 0x00, 0x01 )
85
86// K_AES_128 Table Preconfiguration
87#define OPAL_LOCKING_SP_K_AES_128_GLOBALRANGE_KEY TCG_TO_UID( 0x00, 0x00, 0x08, 0x05, 0x00, 0x00, 0x00, 0x01 )
88
89// Minimum Properties that an Opal Compliant SD Shall support
90#define OPAL_MIN_MAX_COM_PACKET_SIZE 2048
91#define OPAL_MIN_MAX_REPONSE_COM_PACKET_SIZE 2048
92#define OPAL_MIN_MAX_PACKET_SIZE 2028
93#define OPAL_MIN_MAX_IND_TOKEN_SIZE 1992
94#define OPAL_MIN_MAX_PACKETS 1
95#define OPAL_MIN_MAX_SUBPACKETS 1
96#define OPAL_MIN_MAX_METHODS 1
97#define OPAL_MIN_MAX_SESSIONS 1
98#define OPAL_MIN_MAX_AUTHENTICATIONS 2
99#define OPAL_MIN_MAX_TRANSACTION_LIMIT 1
100
101#define OPAL_ADMIN_SP_PIN_COL 3
102#define OPAL_LOCKING_SP_C_PIN_TRYLIMIT_COL 5
103#define OPAL_RANDOM_METHOD_MAX_COUNT_SIZE 32
104
105// Data Removal Mechanism column.
106#define OPAL_ADMIN_SP_ACTIVE_DATA_REMOVAL_MECHANISM_COL 1
107
108//
109// Supported Data Removal Mechanism.
110// Detail see Pyrite SSC v2 spec.
111//
112typedef enum {
113 OverwriteDataErase = 0,
114 BlockErase,
115 CryptoErase,
116 Unmap,
117 ResetWritePointers,
118 VendorSpecificErase,
119 ResearvedMechanism
120} SUPPORTED_DATA_REMOVAL_MECHANISM;
121
122#pragma pack(1)
123
126 UINT8 Reserved[8];
127 UINT32 LogicalBlockSizeBE;
128 UINT64 AlignmentGranularityBE;
129 UINT64 LowestAlignedLBABE;
131
134 UINT32 NumLockingObjectsSupportedBE;
135 UINT8 Any : 1;
136 UINT8 All : 1;
137 UINT8 Policy : 1;
138 UINT8 Reserved : 5;
139 UINT8 Reserved2[7];
141
144 UINT16 Reserved;
145 UINT16 MaxNumTablesBE;
146 UINT32 MaxTotalSizeBE;
147 UINT32 SizeAlignmentBE;
149
152 UINT16 BaseComdIdBE;
153 UINT16 NumComIdsBE;
154 UINT8 RangeCrossing : 1;
155 UINT8 Reserved : 7;
156 UINT8 Future[11];
158
161 UINT16 BaseComdIdBE;
162 UINT16 NumComIdsBE;
163 UINT8 Reserved;
164 UINT16 NumLockingSpAdminAuthoritiesSupportedBE;
165 UINT16 NumLockingSpUserAuthoritiesSupportedBE;
166 UINT8 InitialCPINSIDPIN;
167 UINT8 CPINSIDPINRevertBehavior;
168 UINT8 Future[5];
170
173 UINT16 BaseComdIdBE;
174 UINT16 NumComIdsBE;
175 UINT8 Reserved[5];
176 UINT8 InitialCPINSIDPIN;
177 UINT8 CPINSIDPINRevertBehavior;
178 UINT8 Future[5];
180
183 UINT16 BaseComdIdBE;
184 UINT16 NumComIdsBE;
185 UINT8 Reserved[5];
186 UINT8 InitialCPINSIDPIN;
187 UINT8 CPINSIDPINRevertBehavior;
188 UINT8 Future[5];
190
193 UINT16 BaseComdIdBE;
194 UINT16 NumComIdsBE;
195 UINT8 Reserved[5];
196 UINT8 InitialCPINSIDPIN;
197 UINT8 CPINSIDPINRevertBehavior;
198 UINT8 Future[5];
200
203 UINT8 Reserved;
204 UINT8 OperationProcessing : 1;
205 UINT8 Reserved2 : 7;
206 UINT8 RemovalMechanism;
207 UINT8 FormatBit0 : 1; // Data Removal Time Format for Bit 0
208 UINT8 FormatBit1 : 1; // Data Removal Time Format for Bit 1
209 UINT8 FormatBit2 : 1; // Data Removal Time Format for Bit 2
210 UINT8 FormatBit3 : 1; // Data Removal Time Format for Bit 3
211 UINT8 FormatBit4 : 1; // Data Removal Time Format for Bit 4
212 UINT8 FormatBit5 : 1; // Data Removal Time Format for Bit 5
213 UINT8 Reserved3 : 2;
214 UINT16 TimeBit0; // Data Removal Time for Supported Data Removal Mechanism Bit 0
215 UINT16 TimeBit1; // Data Removal Time for Supported Data Removal Mechanism Bit 1
216 UINT16 TimeBit2; // Data Removal Time for Supported Data Removal Mechanism Bit 2
217 UINT16 TimeBit3; // Data Removal Time for Supported Data Removal Mechanism Bit 3
218 UINT16 TimeBit4; // Data Removal Time for Supported Data Removal Mechanism Bit 4
219 UINT16 TimeBit5; // Data Removal Time for Supported Data Removal Mechanism Bit 5
220 UINT8 Future[16];
222
223typedef union {
238
239#pragma pack()
240
241#endif // _OPAL_H_