xref: /linux/drivers/scsi/mpt3sas/mpi/mpi2_image.h (revision 06d07429858317ded2db7986113a9e0129cd599b)
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  * 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
26  */
27 #ifndef MPI2_IMAGE_H
28 #define MPI2_IMAGE_H
29 
30 
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;
80 
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)
86 
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)
103 
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)
108 
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)
113 
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)
117 
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)
122 
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)
130 
131 /*use MPI2_IOCFACTS_PROTOCOL_ defines for ProtocolFlags field */
132 
133 /*use MPI2_IOCFACTS_CAPABILITY_ defines for IOCCapabilities field */
134 
135 #define MPI2_FW_HEADER_IMAGESIZE_OFFSET         (0x2C)
136 #define MPI2_FW_HEADER_NEXTIMAGE_OFFSET         (0x30)
137 
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)
143 
144 
145 #define MPI2_FW_HEADER_VERNMHWAT_OFFSET         (0x64)
146 
147 #define MPI2_FW_HEADER_WHAT_SIGNATURE           (0x29232840)
148 
149 #define MPI2_FW_HEADER_SIZE                     (0x100)
150 
151 
152 /****************************************************************************
153  *              Component Image Format and related defines                  *
154  ****************************************************************************/
155 
156 /*Maximum number of Hash Exclusion entries in a Component Image Header */
157 #define MPI26_COMP_IMG_HDR_NUM_HASH_EXCL        (4)
158 
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;
167 
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;
203 
204 
205 /**** Definitions for Signature0 field ****/
206 #define MPI26_IMAGE_HEADER_SIGNATURE0_MPI26                     (0xEB000042)
207 
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)
222 
223 /**** Definitions for Signature2 field ****/
224 #define MPI26_IMAGE_HEADER_SIGNATURE2_VALUE                    (0x50584546)
225 
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)
249 
250 
251 #define MPI26_IMAGE_HEADER_SIZE                                (0x100)
252 
253 
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;
269 
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)
275 
276 #define MPI2_EXT_IMAGE_HEADER_SIZE              (0x40)
277 
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)
292 
293 #define MPI2_EXT_IMAGE_TYPE_MAX (MPI2_EXT_IMAGE_TYPE_MAX_PRODUCT_SPECIFIC)
294 
295 /*FLASH Layout Extended Image Data */
296 
297 /*
298  *Host code (drivers, BIOS, utilities, etc.) should check NumberOfLayouts and
299  *RegionsPerLayout at runtime before using Layout[] and Region[].
300  */
301 
302 typedef struct _MPI2_FLASH_REGION {
303 	U8 RegionType;		/*0x00 */
304 	U8 Reserved1;		/*0x01 */
305 	U16 Reserved2;		/*0x02 */
306 	U32 RegionOffset;	/*0x04 */
307 	U32 RegionSize;		/*0x08 */
308 	U32 Reserved3;		/*0x0C */
309 } MPI2_FLASH_REGION, *PTR_MPI2_FLASH_REGION,
310 	Mpi2FlashRegion_t, *pMpi2FlashRegion_t;
311 
312 typedef struct _MPI2_FLASH_LAYOUT {
313 	U32 FlashSize;		/*0x00 */
314 	U32 Reserved1;		/*0x04 */
315 	U32 Reserved2;		/*0x08 */
316 	U32 Reserved3;		/*0x0C */
317 	MPI2_FLASH_REGION Region[];	/*0x10 */
318 } MPI2_FLASH_LAYOUT, *PTR_MPI2_FLASH_LAYOUT,
319 	Mpi2FlashLayout_t, *pMpi2FlashLayout_t;
320 
321 typedef struct _MPI2_FLASH_LAYOUT_DATA {
322 	U8 ImageRevision;	/*0x00 */
323 	U8 Reserved1;		/*0x01 */
324 	U8 SizeOfRegion;	/*0x02 */
325 	U8 Reserved2;		/*0x03 */
326 	U16 NumberOfLayouts;	/*0x04 */
327 	U16 RegionsPerLayout;	/*0x06 */
328 	U16 MinimumSectorAlignment;	/*0x08 */
329 	U16 Reserved3;		/*0x0A */
330 	U32 Reserved4;		/*0x0C */
331 	MPI2_FLASH_LAYOUT Layout[];	/*0x10 */
332 } MPI2_FLASH_LAYOUT_DATA, *PTR_MPI2_FLASH_LAYOUT_DATA,
333 	Mpi2FlashLayoutData_t, *pMpi2FlashLayoutData_t;
334 
335 /*defines for the RegionType field */
336 #define MPI2_FLASH_REGION_UNUSED                (0x00)
337 #define MPI2_FLASH_REGION_FIRMWARE              (0x01)
338 #define MPI2_FLASH_REGION_BIOS                  (0x02)
339 #define MPI2_FLASH_REGION_NVDATA                (0x03)
340 #define MPI2_FLASH_REGION_FIRMWARE_BACKUP       (0x05)
341 #define MPI2_FLASH_REGION_MFG_INFORMATION       (0x06)
342 #define MPI2_FLASH_REGION_CONFIG_1              (0x07)
343 #define MPI2_FLASH_REGION_CONFIG_2              (0x08)
344 #define MPI2_FLASH_REGION_MEGARAID              (0x09)
345 #define MPI2_FLASH_REGION_COMMON_BOOT_BLOCK     (0x0A)
346 #define MPI2_FLASH_REGION_INIT (MPI2_FLASH_REGION_COMMON_BOOT_BLOCK)
347 #define MPI2_FLASH_REGION_CBB_BACKUP            (0x0D)
348 #define MPI2_FLASH_REGION_SBR                   (0x0E)
349 #define MPI2_FLASH_REGION_SBR_BACKUP            (0x0F)
350 #define MPI2_FLASH_REGION_HIIM                  (0x10)
351 #define MPI2_FLASH_REGION_HIIA                  (0x11)
352 #define MPI2_FLASH_REGION_CTLR                  (0x12)
353 #define MPI2_FLASH_REGION_IMR_FIRMWARE          (0x13)
354 #define MPI2_FLASH_REGION_MR_NVDATA             (0x14)
355 #define MPI2_FLASH_REGION_CPLD                  (0x15)
356 #define MPI2_FLASH_REGION_PSOC                  (0x16)
357 #define MPI2_FLASH_REGION_COREDUMP              (0x17)
358 
359 /*ImageRevision */
360 #define MPI2_FLASH_LAYOUT_IMAGE_REVISION        (0x00)
361 
362 /*Supported Devices Extended Image Data */
363 
364 /*
365  *Host code (drivers, BIOS, utilities, etc.) should check NumberOfDevices at
366  *runtime before using SupportedDevice[].
367  */
368 
369 typedef struct _MPI2_SUPPORTED_DEVICE {
370 	U16 DeviceID;		/*0x00 */
371 	U16 VendorID;		/*0x02 */
372 	U16 DeviceIDMask;	/*0x04 */
373 	U16 Reserved1;		/*0x06 */
374 	U8 LowPCIRev;		/*0x08 */
375 	U8 HighPCIRev;		/*0x09 */
376 	U16 Reserved2;		/*0x0A */
377 	U32 Reserved3;		/*0x0C */
378 } MPI2_SUPPORTED_DEVICE, *PTR_MPI2_SUPPORTED_DEVICE,
379 	Mpi2SupportedDevice_t, *pMpi2SupportedDevice_t;
380 
381 typedef struct _MPI2_SUPPORTED_DEVICES_DATA {
382 	U8 ImageRevision;	/*0x00 */
383 	U8 Reserved1;		/*0x01 */
384 	U8 NumberOfDevices;	/*0x02 */
385 	U8 Reserved2;		/*0x03 */
386 	U32 Reserved3;		/*0x04 */
387 	MPI2_SUPPORTED_DEVICE
388 	SupportedDevice[];	/*0x08 */
389 } MPI2_SUPPORTED_DEVICES_DATA, *PTR_MPI2_SUPPORTED_DEVICES_DATA,
390 	Mpi2SupportedDevicesData_t, *pMpi2SupportedDevicesData_t;
391 
392 /*ImageRevision */
393 #define MPI2_SUPPORTED_DEVICES_IMAGE_REVISION   (0x00)
394 
395 /*Init Extended Image Data */
396 
397 typedef struct _MPI2_INIT_IMAGE_FOOTER {
398 	U32 BootFlags;		/*0x00 */
399 	U32 ImageSize;		/*0x04 */
400 	U32 Signature0;		/*0x08 */
401 	U32 Signature1;		/*0x0C */
402 	U32 Signature2;		/*0x10 */
403 	U32 ResetVector;	/*0x14 */
404 } MPI2_INIT_IMAGE_FOOTER, *PTR_MPI2_INIT_IMAGE_FOOTER,
405 	Mpi2InitImageFooter_t, *pMpi2InitImageFooter_t;
406 
407 /*defines for the BootFlags field */
408 #define MPI2_INIT_IMAGE_BOOTFLAGS_OFFSET        (0x00)
409 
410 /*defines for the ImageSize field */
411 #define MPI2_INIT_IMAGE_IMAGESIZE_OFFSET        (0x04)
412 
413 /*defines for the Signature0 field */
414 #define MPI2_INIT_IMAGE_SIGNATURE0_OFFSET       (0x08)
415 #define MPI2_INIT_IMAGE_SIGNATURE0              (0x5AA55AEA)
416 
417 /*defines for the Signature1 field */
418 #define MPI2_INIT_IMAGE_SIGNATURE1_OFFSET       (0x0C)
419 #define MPI2_INIT_IMAGE_SIGNATURE1              (0xA55AEAA5)
420 
421 /*defines for the Signature2 field */
422 #define MPI2_INIT_IMAGE_SIGNATURE2_OFFSET       (0x10)
423 #define MPI2_INIT_IMAGE_SIGNATURE2              (0x5AEAA55A)
424 
425 /*Signature fields as individual bytes */
426 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_0        (0xEA)
427 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_1        (0x5A)
428 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_2        (0xA5)
429 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_3        (0x5A)
430 
431 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_4        (0xA5)
432 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_5        (0xEA)
433 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_6        (0x5A)
434 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_7        (0xA5)
435 
436 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_8        (0x5A)
437 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_9        (0xA5)
438 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_A        (0xEA)
439 #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_B        (0x5A)
440 
441 /*defines for the ResetVector field */
442 #define MPI2_INIT_IMAGE_RESETVECTOR_OFFSET      (0x14)
443 
444 
445 /* Encrypted Hash Extended Image Data */
446 
447 typedef struct _MPI25_ENCRYPTED_HASH_ENTRY {
448 	U8		HashImageType;		/*0x00 */
449 	U8		HashAlgorithm;		/*0x01 */
450 	U8		EncryptionAlgorithm;	/*0x02 */
451 	U8		Reserved1;		/*0x03 */
452 	U32		Reserved2;		/*0x04 */
453 	U32		EncryptedHash[];	/*0x08 */
454 } MPI25_ENCRYPTED_HASH_ENTRY, *PTR_MPI25_ENCRYPTED_HASH_ENTRY,
455 Mpi25EncryptedHashEntry_t, *pMpi25EncryptedHashEntry_t;
456 
457 /* values for HashImageType */
458 #define MPI25_HASH_IMAGE_TYPE_UNUSED            (0x00)
459 #define MPI25_HASH_IMAGE_TYPE_FIRMWARE          (0x01)
460 #define MPI25_HASH_IMAGE_TYPE_BIOS              (0x02)
461 
462 #define MPI26_HASH_IMAGE_TYPE_UNUSED            (0x00)
463 #define MPI26_HASH_IMAGE_TYPE_FIRMWARE          (0x01)
464 #define MPI26_HASH_IMAGE_TYPE_BIOS              (0x02)
465 #define MPI26_HASH_IMAGE_TYPE_KEY_HASH          (0x03)
466 
467 /* values for HashAlgorithm */
468 #define MPI25_HASH_ALGORITHM_UNUSED             (0x00)
469 #define MPI25_HASH_ALGORITHM_SHA256             (0x01)
470 
471 #define MPI26_HASH_ALGORITHM_VER_MASK		(0xE0)
472 #define MPI26_HASH_ALGORITHM_VER_NONE		(0x00)
473 #define MPI26_HASH_ALGORITHM_VER_SHA1		(0x20)
474 #define MPI26_HASH_ALGORITHM_VER_SHA2		(0x40)
475 #define MPI26_HASH_ALGORITHM_VER_SHA3		(0x60)
476 #define MPI26_HASH_ALGORITHM_SIZE_MASK		(0x1F)
477 #define MPI26_HASH_ALGORITHM_SIZE_256           (0x01)
478 #define MPI26_HASH_ALGORITHM_SIZE_512           (0x02)
479 
480 
481 /* values for EncryptionAlgorithm */
482 #define MPI25_ENCRYPTION_ALG_UNUSED             (0x00)
483 #define MPI25_ENCRYPTION_ALG_RSA256             (0x01)
484 
485 #define MPI26_ENCRYPTION_ALG_UNUSED             (0x00)
486 #define MPI26_ENCRYPTION_ALG_RSA256             (0x01)
487 #define MPI26_ENCRYPTION_ALG_RSA512             (0x02)
488 #define MPI26_ENCRYPTION_ALG_RSA1024            (0x03)
489 #define MPI26_ENCRYPTION_ALG_RSA2048            (0x04)
490 #define MPI26_ENCRYPTION_ALG_RSA4096            (0x05)
491 
492 typedef struct _MPI25_ENCRYPTED_HASH_DATA {
493 	U8				ImageVersion;		/*0x00 */
494 	U8				NumHash;		/*0x01 */
495 	U16				Reserved1;		/*0x02 */
496 	U32				Reserved2;		/*0x04 */
497 	MPI25_ENCRYPTED_HASH_ENTRY	EncryptedHashEntry[];	/*0x08 */
498 } MPI25_ENCRYPTED_HASH_DATA, *PTR_MPI25_ENCRYPTED_HASH_DATA,
499 Mpi25EncryptedHashData_t, *pMpi25EncryptedHashData_t;
500 
501 
502 #endif /* MPI2_IMAGE_H */
503