Ronak Kanabar | 1ae366f | 2023-06-07 01:21:56 +0530 | [diff] [blame^] | 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 | // 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 | // |
| 112 | typedef 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 | |
| 124 | typedef struct _OPAL_GEOMETRY_REPORTING_FEATURE { |
| 125 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; |
| 126 | UINT8 Reserved[8]; |
| 127 | UINT32 LogicalBlockSizeBE; |
| 128 | UINT64 AlignmentGranularityBE; |
| 129 | UINT64 LowestAlignedLBABE; |
| 130 | } OPAL_GEOMETRY_REPORTING_FEATURE; |
| 131 | |
| 132 | typedef struct _OPAL_SINGLE_USER_MODE_FEATURE { |
| 133 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; |
| 134 | UINT32 NumLockingObjectsSupportedBE; |
| 135 | UINT8 Any : 1; |
| 136 | UINT8 All : 1; |
| 137 | UINT8 Policy : 1; |
| 138 | UINT8 Reserved : 5; |
| 139 | UINT8 Reserved2[7]; |
| 140 | } OPAL_SINGLE_USER_MODE_FEATURE; |
| 141 | |
| 142 | typedef struct _OPAL_DATASTORE_TABLE_FEATURE { |
| 143 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; |
| 144 | UINT16 Reserved; |
| 145 | UINT16 MaxNumTablesBE; |
| 146 | UINT32 MaxTotalSizeBE; |
| 147 | UINT32 SizeAlignmentBE; |
| 148 | } OPAL_DATASTORE_TABLE_FEATURE; |
| 149 | |
| 150 | typedef struct _OPAL_SSCV1_FEATURE_DESCRIPTOR { |
| 151 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; |
| 152 | UINT16 BaseComdIdBE; |
| 153 | UINT16 NumComIdsBE; |
| 154 | UINT8 RangeCrossing : 1; |
| 155 | UINT8 Reserved : 7; |
| 156 | UINT8 Future[11]; |
| 157 | } OPAL_SSCV1_FEATURE_DESCRIPTOR; |
| 158 | |
| 159 | typedef struct _OPAL_SSCV2_FEATURE_DESCRIPTOR { |
| 160 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; |
| 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]; |
| 169 | } OPAL_SSCV2_FEATURE_DESCRIPTOR; |
| 170 | |
| 171 | typedef struct _OPAL_SSCLITE_FEATURE_DESCRIPTOR { |
| 172 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; |
| 173 | UINT16 BaseComdIdBE; |
| 174 | UINT16 NumComIdsBE; |
| 175 | UINT8 Reserved[5]; |
| 176 | UINT8 InitialCPINSIDPIN; |
| 177 | UINT8 CPINSIDPINRevertBehavior; |
| 178 | UINT8 Future[5]; |
| 179 | } OPAL_SSCLITE_FEATURE_DESCRIPTOR; |
| 180 | |
| 181 | typedef struct _PYRITE_SSC_FEATURE_DESCRIPTOR { |
| 182 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; |
| 183 | UINT16 BaseComdIdBE; |
| 184 | UINT16 NumComIdsBE; |
| 185 | UINT8 Reserved[5]; |
| 186 | UINT8 InitialCPINSIDPIN; |
| 187 | UINT8 CPINSIDPINRevertBehavior; |
| 188 | UINT8 Future[5]; |
| 189 | } PYRITE_SSC_FEATURE_DESCRIPTOR; |
| 190 | |
| 191 | typedef struct _PYRITE_SSCV2_FEATURE_DESCRIPTOR { |
| 192 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; |
| 193 | UINT16 BaseComdIdBE; |
| 194 | UINT16 NumComIdsBE; |
| 195 | UINT8 Reserved[5]; |
| 196 | UINT8 InitialCPINSIDPIN; |
| 197 | UINT8 CPINSIDPINRevertBehavior; |
| 198 | UINT8 Future[5]; |
| 199 | } PYRITE_SSCV2_FEATURE_DESCRIPTOR; |
| 200 | |
| 201 | typedef struct _DATA_REMOVAL_FEATURE_DESCRIPTOR { |
| 202 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; |
| 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]; |
| 221 | } DATA_REMOVAL_FEATURE_DESCRIPTOR; |
| 222 | |
| 223 | typedef union { |
| 224 | TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER CommonHeader; |
| 225 | TCG_TPER_FEATURE_DESCRIPTOR Tper; |
| 226 | TCG_LOCKING_FEATURE_DESCRIPTOR Locking; |
| 227 | OPAL_GEOMETRY_REPORTING_FEATURE Geometry; |
| 228 | OPAL_SINGLE_USER_MODE_FEATURE SingleUser; |
| 229 | OPAL_DATASTORE_TABLE_FEATURE DataStore; |
| 230 | OPAL_SSCV1_FEATURE_DESCRIPTOR OpalSscV1; |
| 231 | OPAL_SSCV2_FEATURE_DESCRIPTOR OpalSscV2; |
| 232 | OPAL_SSCLITE_FEATURE_DESCRIPTOR OpalSscLite; |
| 233 | PYRITE_SSC_FEATURE_DESCRIPTOR PyriteSsc; |
| 234 | PYRITE_SSCV2_FEATURE_DESCRIPTOR PyriteSscV2; |
| 235 | TCG_BLOCK_SID_FEATURE_DESCRIPTOR BlockSid; |
| 236 | DATA_REMOVAL_FEATURE_DESCRIPTOR DataRemoval; |
| 237 | } OPAL_LEVEL0_FEATURE_DESCRIPTOR; |
| 238 | |
| 239 | #pragma pack() |
| 240 | |
| 241 | #endif // _OPAL_H_ |