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