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