1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright 2016-2020 Broadcom Limited. All rights reserved. 4 * 5 * Name: mpi2_image.h 6 * Description: Contains definitions for firmware and other component images 7 * Creation Date: 04/02/2018 8 * Version: 02.06.03 9 * 10 * 11 * Version History 12 * --------------- 13 * 14 * Date Version Description 15 * -------- -------- ------------------------------------------------------ 16 * 08-01-18 02.06.00 Initial version for MPI 2.6.5. 17 * 08-14-18 02.06.01 Corrected define for MPI26_IMAGE_HEADER_SIGNATURE0_MPI26 18 * 08-28-18 02.06.02 Added MPI2_EXT_IMAGE_TYPE_RDE 19 * 09-07-18 02.06.03 Added MPI26_EVENT_PCIE_TOPO_PI_16_LANES 20 */ 21 #ifndef MPI2_IMAGE_H 22 #define MPI2_IMAGE_H 23 24 25 /*FW Image Header */ 26 typedef struct _MPI2_FW_IMAGE_HEADER { 27 U32 Signature; /*0x00 */ 28 U32 Signature0; /*0x04 */ 29 U32 Signature1; /*0x08 */ 30 U32 Signature2; /*0x0C */ 31 MPI2_VERSION_UNION MPIVersion; /*0x10 */ 32 MPI2_VERSION_UNION FWVersion; /*0x14 */ 33 MPI2_VERSION_UNION NVDATAVersion; /*0x18 */ 34 MPI2_VERSION_UNION PackageVersion; /*0x1C */ 35 U16 VendorID; /*0x20 */ 36 U16 ProductID; /*0x22 */ 37 U16 ProtocolFlags; /*0x24 */ 38 U16 Reserved26; /*0x26 */ 39 U32 IOCCapabilities; /*0x28 */ 40 U32 ImageSize; /*0x2C */ 41 U32 NextImageHeaderOffset; /*0x30 */ 42 U32 Checksum; /*0x34 */ 43 U32 Reserved38; /*0x38 */ 44 U32 Reserved3C; /*0x3C */ 45 U32 Reserved40; /*0x40 */ 46 U32 Reserved44; /*0x44 */ 47 U32 Reserved48; /*0x48 */ 48 U32 Reserved4C; /*0x4C */ 49 U32 Reserved50; /*0x50 */ 50 U32 Reserved54; /*0x54 */ 51 U32 Reserved58; /*0x58 */ 52 U32 Reserved5C; /*0x5C */ 53 U32 BootFlags; /*0x60 */ 54 U32 FirmwareVersionNameWhat; /*0x64 */ 55 U8 FirmwareVersionName[32]; /*0x68 */ 56 U32 VendorNameWhat; /*0x88 */ 57 U8 VendorName[32]; /*0x8C */ 58 U32 PackageNameWhat; /*0x88 */ 59 U8 PackageName[32]; /*0x8C */ 60 U32 ReservedD0; /*0xD0 */ 61 U32 ReservedD4; /*0xD4 */ 62 U32 ReservedD8; /*0xD8 */ 63 U32 ReservedDC; /*0xDC */ 64 U32 ReservedE0; /*0xE0 */ 65 U32 ReservedE4; /*0xE4 */ 66 U32 ReservedE8; /*0xE8 */ 67 U32 ReservedEC; /*0xEC */ 68 U32 ReservedF0; /*0xF0 */ 69 U32 ReservedF4; /*0xF4 */ 70 U32 ReservedF8; /*0xF8 */ 71 U32 ReservedFC; /*0xFC */ 72 } MPI2_FW_IMAGE_HEADER, *PTR_MPI2_FW_IMAGE_HEADER, 73 Mpi2FWImageHeader_t, *pMpi2FWImageHeader_t; 74 75 /*Signature field */ 76 #define MPI2_FW_HEADER_SIGNATURE_OFFSET (0x00) 77 #define MPI2_FW_HEADER_SIGNATURE_MASK (0xFF000000) 78 #define MPI2_FW_HEADER_SIGNATURE (0xEA000000) 79 #define MPI26_FW_HEADER_SIGNATURE (0xEB000000) 80 81 /*Signature0 field */ 82 #define MPI2_FW_HEADER_SIGNATURE0_OFFSET (0x04) 83 #define MPI2_FW_HEADER_SIGNATURE0 (0x5AFAA55A) 84 /*Last byte is defined by architecture */ 85 #define MPI26_FW_HEADER_SIGNATURE0_BASE (0x5AEAA500) 86 #define MPI26_FW_HEADER_SIGNATURE0_ARC_0 (0x5A) 87 #define MPI26_FW_HEADER_SIGNATURE0_ARC_1 (0x00) 88 #define MPI26_FW_HEADER_SIGNATURE0_ARC_2 (0x01) 89 /*legacy (0x5AEAA55A) */ 90 #define MPI26_FW_HEADER_SIGNATURE0_ARC_3 (0x02) 91 #define MPI26_FW_HEADER_SIGNATURE0 \ 92 (MPI26_FW_HEADER_SIGNATURE0_BASE+MPI26_FW_HEADER_SIGNATURE0_ARC_0) 93 #define MPI26_FW_HEADER_SIGNATURE0_3516 \ 94 (MPI26_FW_HEADER_SIGNATURE0_BASE+MPI26_FW_HEADER_SIGNATURE0_ARC_1) 95 #define MPI26_FW_HEADER_SIGNATURE0_4008 \ 96 (MPI26_FW_HEADER_SIGNATURE0_BASE+MPI26_FW_HEADER_SIGNATURE0_ARC_3) 97 98 /*Signature1 field */ 99 #define MPI2_FW_HEADER_SIGNATURE1_OFFSET (0x08) 100 #define MPI2_FW_HEADER_SIGNATURE1 (0xA55AFAA5) 101 #define MPI26_FW_HEADER_SIGNATURE1 (0xA55AEAA5) 102 103 /*Signature2 field */ 104 #define MPI2_FW_HEADER_SIGNATURE2_OFFSET (0x0C) 105 #define MPI2_FW_HEADER_SIGNATURE2 (0x5AA55AFA) 106 #define MPI26_FW_HEADER_SIGNATURE2 (0x5AA55AEA) 107 108 /*defines for using the ProductID field */ 109 #define MPI2_FW_HEADER_PID_TYPE_MASK (0xF000) 110 #define MPI2_FW_HEADER_PID_TYPE_SAS (0x2000) 111 112 #define MPI2_FW_HEADER_PID_PROD_MASK (0x0F00) 113 #define MPI2_FW_HEADER_PID_PROD_A (0x0000) 114 #define MPI2_FW_HEADER_PID_PROD_TARGET_INITIATOR_SCSI (0x0200) 115 #define MPI2_FW_HEADER_PID_PROD_IR_SCSI (0x0700) 116 117 #define MPI2_FW_HEADER_PID_FAMILY_MASK (0x00FF) 118 /*SAS ProductID Family bits */ 119 #define MPI2_FW_HEADER_PID_FAMILY_2108_SAS (0x0013) 120 #define MPI2_FW_HEADER_PID_FAMILY_2208_SAS (0x0014) 121 #define MPI25_FW_HEADER_PID_FAMILY_3108_SAS (0x0021) 122 #define MPI26_FW_HEADER_PID_FAMILY_3324_SAS (0x0028) 123 #define MPI26_FW_HEADER_PID_FAMILY_3516_SAS (0x0031) 124 125 /*use MPI2_IOCFACTS_PROTOCOL_ defines for ProtocolFlags field */ 126 127 /*use MPI2_IOCFACTS_CAPABILITY_ defines for IOCCapabilities field */ 128 129 #define MPI2_FW_HEADER_IMAGESIZE_OFFSET (0x2C) 130 #define MPI2_FW_HEADER_NEXTIMAGE_OFFSET (0x30) 131 132 #define MPI26_FW_HEADER_BOOTFLAGS_OFFSET (0x60) 133 #define MPI2_FW_HEADER_BOOTFLAGS_ISSI32M_FLAG (0x00000001) 134 #define MPI2_FW_HEADER_BOOTFLAGS_W25Q256JW_FLAG (0x00000002) 135 /*This image has a auto-discovery version of SPI */ 136 #define MPI2_FW_HEADER_BOOTFLAGS_AUTO_SPI_FLAG (0x00000004) 137 138 139 #define MPI2_FW_HEADER_VERNMHWAT_OFFSET (0x64) 140 141 #define MPI2_FW_HEADER_WHAT_SIGNATURE (0x29232840) 142 143 #define MPI2_FW_HEADER_SIZE (0x100) 144 145 146 /**************************************************************************** 147 * Component Image Format and related defines * 148 ****************************************************************************/ 149 150 /*Maximum number of Hash Exclusion entries in a Component Image Header */ 151 #define MPI26_COMP_IMG_HDR_NUM_HASH_EXCL (4) 152 153 /*Hash Exclusion Format */ 154 typedef struct _MPI26_HASH_EXCLUSION_FORMAT { 155 U32 Offset; /*0x00 */ 156 U32 Size; /*0x04 */ 157 } MPI26_HASH_EXCLUSION_FORMAT, 158 *PTR_MPI26_HASH_EXCLUSION_FORMAT, 159 Mpi26HashSxclusionFormat_t, 160 *pMpi26HashExclusionFormat_t; 161 162 /*FW Image Header */ 163 typedef struct _MPI26_COMPONENT_IMAGE_HEADER { 164 U32 Signature0; /*0x00 */ 165 U32 LoadAddress; /*0x04 */ 166 U32 DataSize; /*0x08 */ 167 U32 StartAddress; /*0x0C */ 168 U32 Signature1; /*0x10 */ 169 U32 FlashOffset; /*0x14 */ 170 U32 FlashSize; /*0x18 */ 171 U32 VersionStringOffset; /*0x1C */ 172 U32 BuildDateStringOffset; /*0x20 */ 173 U32 BuildTimeStringOffset; /*0x24 */ 174 U32 EnvironmentVariableOffset; /*0x28 */ 175 U32 ApplicationSpecific; /*0x2C */ 176 U32 Signature2; /*0x30 */ 177 U32 HeaderSize; /*0x34 */ 178 U32 Crc; /*0x38 */ 179 U8 NotFlashImage; /*0x3C */ 180 U8 Compressed; /*0x3D */ 181 U16 Reserved3E; /*0x3E */ 182 U32 SecondaryFlashOffset; /*0x40 */ 183 U32 Reserved44; /*0x44 */ 184 U32 Reserved48; /*0x48 */ 185 MPI2_VERSION_UNION RMCInterfaceVersion; /*0x4C */ 186 MPI2_VERSION_UNION Reserved50; /*0x50 */ 187 MPI2_VERSION_UNION FWVersion; /*0x54 */ 188 MPI2_VERSION_UNION NvdataVersion; /*0x58 */ 189 MPI26_HASH_EXCLUSION_FORMAT 190 HashExclusion[MPI26_COMP_IMG_HDR_NUM_HASH_EXCL];/*0x5C */ 191 U32 NextImageHeaderOffset; /*0x7C */ 192 U32 Reserved80[32]; /*0x80 -- 0xFC */ 193 } MPI26_COMPONENT_IMAGE_HEADER, 194 *PTR_MPI26_COMPONENT_IMAGE_HEADER, 195 Mpi26ComponentImageHeader_t, 196 *pMpi26ComponentImageHeader_t; 197 198 199 /**** Definitions for Signature0 field ****/ 200 #define MPI26_IMAGE_HEADER_SIGNATURE0_MPI26 (0xEB000042) 201 202 /**** Definitions for Signature1 field ****/ 203 #define MPI26_IMAGE_HEADER_SIGNATURE1_APPLICATION (0x20505041) 204 #define MPI26_IMAGE_HEADER_SIGNATURE1_CBB (0x20424243) 205 #define MPI26_IMAGE_HEADER_SIGNATURE1_MFG (0x2047464D) 206 #define MPI26_IMAGE_HEADER_SIGNATURE1_BIOS (0x534F4942) 207 #define MPI26_IMAGE_HEADER_SIGNATURE1_HIIM (0x4D494948) 208 #define MPI26_IMAGE_HEADER_SIGNATURE1_HIIA (0x41494948) 209 #define MPI26_IMAGE_HEADER_SIGNATURE1_CPLD (0x444C5043) 210 #define MPI26_IMAGE_HEADER_SIGNATURE1_SPD (0x20445053) 211 #define MPI26_IMAGE_HEADER_SIGNATURE1_NVDATA (0x5444564E) 212 #define MPI26_IMAGE_HEADER_SIGNATURE1_GAS_GAUGE (0x20534147) 213 #define MPI26_IMAGE_HEADER_SIGNATURE1_PBLP (0x50424C50) 214 215 /**** Definitions for Signature2 field ****/ 216 #define MPI26_IMAGE_HEADER_SIGNATURE2_VALUE (0x50584546) 217 218 /**** Offsets for Image Header Fields ****/ 219 #define MPI26_IMAGE_HEADER_SIGNATURE0_OFFSET (0x00) 220 #define MPI26_IMAGE_HEADER_LOAD_ADDRESS_OFFSET (0x04) 221 #define MPI26_IMAGE_HEADER_DATA_SIZE_OFFSET (0x08) 222 #define MPI26_IMAGE_HEADER_START_ADDRESS_OFFSET (0x0C) 223 #define MPI26_IMAGE_HEADER_SIGNATURE1_OFFSET (0x10) 224 #define MPI26_IMAGE_HEADER_FLASH_OFFSET_OFFSET (0x14) 225 #define MPI26_IMAGE_HEADER_FLASH_SIZE_OFFSET (0x18) 226 #define MPI26_IMAGE_HEADER_VERSION_STRING_OFFSET_OFFSET (0x1C) 227 #define MPI26_IMAGE_HEADER_BUILD_DATE_STRING_OFFSET_OFFSET (0x20) 228 #define MPI26_IMAGE_HEADER_BUILD_TIME_OFFSET_OFFSET (0x24) 229 #define MPI26_IMAGE_HEADER_ENVIROMENT_VAR_OFFSET_OFFSET (0x28) 230 #define MPI26_IMAGE_HEADER_APPLICATION_SPECIFIC_OFFSET (0x2C) 231 #define MPI26_IMAGE_HEADER_SIGNATURE2_OFFSET (0x30) 232 #define MPI26_IMAGE_HEADER_HEADER_SIZE_OFFSET (0x34) 233 #define MPI26_IMAGE_HEADER_CRC_OFFSET (0x38) 234 #define MPI26_IMAGE_HEADER_NOT_FLASH_IMAGE_OFFSET (0x3C) 235 #define MPI26_IMAGE_HEADER_COMPRESSED_OFFSET (0x3D) 236 #define MPI26_IMAGE_HEADER_SECONDARY_FLASH_OFFSET_OFFSET (0x40) 237 #define MPI26_IMAGE_HEADER_RMC_INTERFACE_VER_OFFSET (0x4C) 238 #define MPI26_IMAGE_HEADER_COMPONENT_IMAGE_VER_OFFSET (0x54) 239 #define MPI26_IMAGE_HEADER_HASH_EXCLUSION_OFFSET (0x5C) 240 #define MPI26_IMAGE_HEADER_NEXT_IMAGE_HEADER_OFFSET_OFFSET (0x7C) 241 242 243 #define MPI26_IMAGE_HEADER_SIZE (0x100) 244 245 246 /*Extended Image Header */ 247 typedef struct _MPI2_EXT_IMAGE_HEADER { 248 U8 ImageType; /*0x00 */ 249 U8 Reserved1; /*0x01 */ 250 U16 Reserved2; /*0x02 */ 251 U32 Checksum; /*0x04 */ 252 U32 ImageSize; /*0x08 */ 253 U32 NextImageHeaderOffset; /*0x0C */ 254 U32 PackageVersion; /*0x10 */ 255 U32 Reserved3; /*0x14 */ 256 U32 Reserved4; /*0x18 */ 257 U32 Reserved5; /*0x1C */ 258 U8 IdentifyString[32]; /*0x20 */ 259 } MPI2_EXT_IMAGE_HEADER, *PTR_MPI2_EXT_IMAGE_HEADER, 260 Mpi2ExtImageHeader_t, *pMpi2ExtImageHeader_t; 261 262 /*useful offsets */ 263 #define MPI2_EXT_IMAGE_IMAGETYPE_OFFSET (0x00) 264 #define MPI2_EXT_IMAGE_IMAGESIZE_OFFSET (0x08) 265 #define MPI2_EXT_IMAGE_NEXTIMAGE_OFFSET (0x0C) 266 #define MPI2_EXT_IMAGE_PACKAGEVERSION_OFFSET (0x10) 267 268 #define MPI2_EXT_IMAGE_HEADER_SIZE (0x40) 269 270 /*defines for the ImageType field */ 271 #define MPI2_EXT_IMAGE_TYPE_UNSPECIFIED (0x00) 272 #define MPI2_EXT_IMAGE_TYPE_FW (0x01) 273 #define MPI2_EXT_IMAGE_TYPE_NVDATA (0x03) 274 #define MPI2_EXT_IMAGE_TYPE_BOOTLOADER (0x04) 275 #define MPI2_EXT_IMAGE_TYPE_INITIALIZATION (0x05) 276 #define MPI2_EXT_IMAGE_TYPE_FLASH_LAYOUT (0x06) 277 #define MPI2_EXT_IMAGE_TYPE_SUPPORTED_DEVICES (0x07) 278 #define MPI2_EXT_IMAGE_TYPE_MEGARAID (0x08) 279 #define MPI2_EXT_IMAGE_TYPE_ENCRYPTED_HASH (0x09) 280 #define MPI2_EXT_IMAGE_TYPE_RDE (0x0A) 281 #define MPI2_EXT_IMAGE_TYPE_MIN_PRODUCT_SPECIFIC (0x80) 282 #define MPI2_EXT_IMAGE_TYPE_MAX_PRODUCT_SPECIFIC (0xFF) 283 284 #define MPI2_EXT_IMAGE_TYPE_MAX (MPI2_EXT_IMAGE_TYPE_MAX_PRODUCT_SPECIFIC) 285 286 /*FLASH Layout Extended Image Data */ 287 288 /* 289 *Host code (drivers, BIOS, utilities, etc.) should leave this define set to 290 *one and check RegionsPerLayout at runtime. 291 */ 292 #ifndef MPI2_FLASH_NUMBER_OF_REGIONS 293 #define MPI2_FLASH_NUMBER_OF_REGIONS (1) 294 #endif 295 296 /* 297 *Host code (drivers, BIOS, utilities, etc.) should leave this define set to 298 *one and check NumberOfLayouts at runtime. 299 */ 300 #ifndef MPI2_FLASH_NUMBER_OF_LAYOUTS 301 #define MPI2_FLASH_NUMBER_OF_LAYOUTS (1) 302 #endif 303 304 typedef struct _MPI2_FLASH_REGION { 305 U8 RegionType; /*0x00 */ 306 U8 Reserved1; /*0x01 */ 307 U16 Reserved2; /*0x02 */ 308 U32 RegionOffset; /*0x04 */ 309 U32 RegionSize; /*0x08 */ 310 U32 Reserved3; /*0x0C */ 311 } MPI2_FLASH_REGION, *PTR_MPI2_FLASH_REGION, 312 Mpi2FlashRegion_t, *pMpi2FlashRegion_t; 313 314 typedef struct _MPI2_FLASH_LAYOUT { 315 U32 FlashSize; /*0x00 */ 316 U32 Reserved1; /*0x04 */ 317 U32 Reserved2; /*0x08 */ 318 U32 Reserved3; /*0x0C */ 319 MPI2_FLASH_REGION Region[MPI2_FLASH_NUMBER_OF_REGIONS]; /*0x10 */ 320 } MPI2_FLASH_LAYOUT, *PTR_MPI2_FLASH_LAYOUT, 321 Mpi2FlashLayout_t, *pMpi2FlashLayout_t; 322 323 typedef struct _MPI2_FLASH_LAYOUT_DATA { 324 U8 ImageRevision; /*0x00 */ 325 U8 Reserved1; /*0x01 */ 326 U8 SizeOfRegion; /*0x02 */ 327 U8 Reserved2; /*0x03 */ 328 U16 NumberOfLayouts; /*0x04 */ 329 U16 RegionsPerLayout; /*0x06 */ 330 U16 MinimumSectorAlignment; /*0x08 */ 331 U16 Reserved3; /*0x0A */ 332 U32 Reserved4; /*0x0C */ 333 MPI2_FLASH_LAYOUT Layout[MPI2_FLASH_NUMBER_OF_LAYOUTS]; /*0x10 */ 334 } MPI2_FLASH_LAYOUT_DATA, *PTR_MPI2_FLASH_LAYOUT_DATA, 335 Mpi2FlashLayoutData_t, *pMpi2FlashLayoutData_t; 336 337 /*defines for the RegionType field */ 338 #define MPI2_FLASH_REGION_UNUSED (0x00) 339 #define MPI2_FLASH_REGION_FIRMWARE (0x01) 340 #define MPI2_FLASH_REGION_BIOS (0x02) 341 #define MPI2_FLASH_REGION_NVDATA (0x03) 342 #define MPI2_FLASH_REGION_FIRMWARE_BACKUP (0x05) 343 #define MPI2_FLASH_REGION_MFG_INFORMATION (0x06) 344 #define MPI2_FLASH_REGION_CONFIG_1 (0x07) 345 #define MPI2_FLASH_REGION_CONFIG_2 (0x08) 346 #define MPI2_FLASH_REGION_MEGARAID (0x09) 347 #define MPI2_FLASH_REGION_COMMON_BOOT_BLOCK (0x0A) 348 #define MPI2_FLASH_REGION_INIT (MPI2_FLASH_REGION_COMMON_BOOT_BLOCK) 349 #define MPI2_FLASH_REGION_CBB_BACKUP (0x0D) 350 #define MPI2_FLASH_REGION_SBR (0x0E) 351 #define MPI2_FLASH_REGION_SBR_BACKUP (0x0F) 352 #define MPI2_FLASH_REGION_HIIM (0x10) 353 #define MPI2_FLASH_REGION_HIIA (0x11) 354 #define MPI2_FLASH_REGION_CTLR (0x12) 355 #define MPI2_FLASH_REGION_IMR_FIRMWARE (0x13) 356 #define MPI2_FLASH_REGION_MR_NVDATA (0x14) 357 #define MPI2_FLASH_REGION_CPLD (0x15) 358 #define MPI2_FLASH_REGION_PSOC (0x16) 359 360 /*ImageRevision */ 361 #define MPI2_FLASH_LAYOUT_IMAGE_REVISION (0x00) 362 363 /*Supported Devices Extended Image Data */ 364 365 /* 366 *Host code (drivers, BIOS, utilities, etc.) should leave this define set to 367 *one and check NumberOfDevices at runtime. 368 */ 369 #ifndef MPI2_SUPPORTED_DEVICES_IMAGE_NUM_DEVICES 370 #define MPI2_SUPPORTED_DEVICES_IMAGE_NUM_DEVICES (1) 371 #endif 372 373 typedef struct _MPI2_SUPPORTED_DEVICE { 374 U16 DeviceID; /*0x00 */ 375 U16 VendorID; /*0x02 */ 376 U16 DeviceIDMask; /*0x04 */ 377 U16 Reserved1; /*0x06 */ 378 U8 LowPCIRev; /*0x08 */ 379 U8 HighPCIRev; /*0x09 */ 380 U16 Reserved2; /*0x0A */ 381 U32 Reserved3; /*0x0C */ 382 } MPI2_SUPPORTED_DEVICE, *PTR_MPI2_SUPPORTED_DEVICE, 383 Mpi2SupportedDevice_t, *pMpi2SupportedDevice_t; 384 385 typedef struct _MPI2_SUPPORTED_DEVICES_DATA { 386 U8 ImageRevision; /*0x00 */ 387 U8 Reserved1; /*0x01 */ 388 U8 NumberOfDevices; /*0x02 */ 389 U8 Reserved2; /*0x03 */ 390 U32 Reserved3; /*0x04 */ 391 MPI2_SUPPORTED_DEVICE 392 SupportedDevice[MPI2_SUPPORTED_DEVICES_IMAGE_NUM_DEVICES];/*0x08 */ 393 } MPI2_SUPPORTED_DEVICES_DATA, *PTR_MPI2_SUPPORTED_DEVICES_DATA, 394 Mpi2SupportedDevicesData_t, *pMpi2SupportedDevicesData_t; 395 396 /*ImageRevision */ 397 #define MPI2_SUPPORTED_DEVICES_IMAGE_REVISION (0x00) 398 399 /*Init Extended Image Data */ 400 401 typedef struct _MPI2_INIT_IMAGE_FOOTER { 402 U32 BootFlags; /*0x00 */ 403 U32 ImageSize; /*0x04 */ 404 U32 Signature0; /*0x08 */ 405 U32 Signature1; /*0x0C */ 406 U32 Signature2; /*0x10 */ 407 U32 ResetVector; /*0x14 */ 408 } MPI2_INIT_IMAGE_FOOTER, *PTR_MPI2_INIT_IMAGE_FOOTER, 409 Mpi2InitImageFooter_t, *pMpi2InitImageFooter_t; 410 411 /*defines for the BootFlags field */ 412 #define MPI2_INIT_IMAGE_BOOTFLAGS_OFFSET (0x00) 413 414 /*defines for the ImageSize field */ 415 #define MPI2_INIT_IMAGE_IMAGESIZE_OFFSET (0x04) 416 417 /*defines for the Signature0 field */ 418 #define MPI2_INIT_IMAGE_SIGNATURE0_OFFSET (0x08) 419 #define MPI2_INIT_IMAGE_SIGNATURE0 (0x5AA55AEA) 420 421 /*defines for the Signature1 field */ 422 #define MPI2_INIT_IMAGE_SIGNATURE1_OFFSET (0x0C) 423 #define MPI2_INIT_IMAGE_SIGNATURE1 (0xA55AEAA5) 424 425 /*defines for the Signature2 field */ 426 #define MPI2_INIT_IMAGE_SIGNATURE2_OFFSET (0x10) 427 #define MPI2_INIT_IMAGE_SIGNATURE2 (0x5AEAA55A) 428 429 /*Signature fields as individual bytes */ 430 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_0 (0xEA) 431 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_1 (0x5A) 432 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_2 (0xA5) 433 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_3 (0x5A) 434 435 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_4 (0xA5) 436 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_5 (0xEA) 437 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_6 (0x5A) 438 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_7 (0xA5) 439 440 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_8 (0x5A) 441 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_9 (0xA5) 442 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_A (0xEA) 443 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_B (0x5A) 444 445 /*defines for the ResetVector field */ 446 #define MPI2_INIT_IMAGE_RESETVECTOR_OFFSET (0x14) 447 448 449 /* Encrypted Hash Extended Image Data */ 450 451 typedef struct _MPI25_ENCRYPTED_HASH_ENTRY { 452 U8 HashImageType; /*0x00 */ 453 U8 HashAlgorithm; /*0x01 */ 454 U8 EncryptionAlgorithm; /*0x02 */ 455 U8 Reserved1; /*0x03 */ 456 U32 Reserved2; /*0x04 */ 457 U32 EncryptedHash[1]; /*0x08 */ /* variable length */ 458 } MPI25_ENCRYPTED_HASH_ENTRY, *PTR_MPI25_ENCRYPTED_HASH_ENTRY, 459 Mpi25EncryptedHashEntry_t, *pMpi25EncryptedHashEntry_t; 460 461 /* values for HashImageType */ 462 #define MPI25_HASH_IMAGE_TYPE_UNUSED (0x00) 463 #define MPI25_HASH_IMAGE_TYPE_FIRMWARE (0x01) 464 #define MPI25_HASH_IMAGE_TYPE_BIOS (0x02) 465 466 #define MPI26_HASH_IMAGE_TYPE_UNUSED (0x00) 467 #define MPI26_HASH_IMAGE_TYPE_FIRMWARE (0x01) 468 #define MPI26_HASH_IMAGE_TYPE_BIOS (0x02) 469 #define MPI26_HASH_IMAGE_TYPE_KEY_HASH (0x03) 470 471 /* values for HashAlgorithm */ 472 #define MPI25_HASH_ALGORITHM_UNUSED (0x00) 473 #define MPI25_HASH_ALGORITHM_SHA256 (0x01) 474 475 #define MPI26_HASH_ALGORITHM_VERSION_MASK (0xE0) 476 #define MPI26_HASH_ALGORITHM_VERSION_NONE (0x00) 477 #define MPI26_HASH_ALGORITHM_VERSION_SHA1 (0x20) 478 #define MPI26_HASH_ALGORITHM_VERSION_SHA2 (0x40) 479 #define MPI26_HASH_ALGORITHM_VERSION_SHA3 (0x60) 480 #define MPI26_HASH_ALGORITHM_SIZE_MASK (0x1F) 481 #define MPI26_HASH_ALGORITHM_SIZE_256 (0x01) 482 #define MPI26_HASH_ALGORITHM_SIZE_512 (0x02) 483 484 485 /* values for EncryptionAlgorithm */ 486 #define MPI25_ENCRYPTION_ALG_UNUSED (0x00) 487 #define MPI25_ENCRYPTION_ALG_RSA256 (0x01) 488 489 #define MPI26_ENCRYPTION_ALG_UNUSED (0x00) 490 #define MPI26_ENCRYPTION_ALG_RSA256 (0x01) 491 #define MPI26_ENCRYPTION_ALG_RSA512 (0x02) 492 #define MPI26_ENCRYPTION_ALG_RSA1024 (0x03) 493 #define MPI26_ENCRYPTION_ALG_RSA2048 (0x04) 494 #define MPI26_ENCRYPTION_ALG_RSA4096 (0x05) 495 496 typedef struct _MPI25_ENCRYPTED_HASH_DATA { 497 U8 ImageVersion; /*0x00 */ 498 U8 NumHash; /*0x01 */ 499 U16 Reserved1; /*0x02 */ 500 U32 Reserved2; /*0x04 */ 501 MPI25_ENCRYPTED_HASH_ENTRY EncryptedHashEntry[1]; /*0x08 */ 502 } MPI25_ENCRYPTED_HASH_DATA, *PTR_MPI25_ENCRYPTED_HASH_DATA, 503 Mpi25EncryptedHashData_t, *pMpi25EncryptedHashData_t; 504 505 506 #endif /* MPI2_IMAGE_H */ 507