xref: /freebsd/sys/dev/mpi3mr/mpi/mpi30_image.h (revision e0c4386e)
1 /*
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2016-2023, Broadcom Inc. All rights reserved.
5  * Support: <fbsd-storage-driver.pdl@broadcom.com>
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  *    this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  *    this list of conditions and the following disclaimer in the documentation and/or other
15  *    materials provided with the distribution.
16  * 3. Neither the name of the Broadcom Inc. nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software without
18  *    specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  * The views and conclusions contained in the software and documentation are
33  * those of the authors and should not be interpreted as representing
34  * official policies,either expressed or implied, of the FreeBSD Project.
35  *
36  * Mail to: Broadcom Inc 1320 Ridder Park Dr, San Jose, CA 95131
37  *
38  * Broadcom Inc. (Broadcom) MPI3MR Adapter FreeBSD
39  *
40  */
41 
42 #ifndef MPI30_IMAGE_H
43 #define MPI30_IMAGE_H     1
44 
45 /* Component Image Version */
46 typedef struct _MPI3_COMP_IMAGE_VERSION
47 {
48     U16     BuildNum;            /* 0x00 */
49     U16     CustomerID;          /* 0x02 */
50     U8      PhaseMinor;          /* 0x04 */
51     U8      PhaseMajor;          /* 0x05 */
52     U8      GenMinor;            /* 0x06 */
53     U8      GenMajor;            /* 0x07 */
54 } MPI3_COMP_IMAGE_VERSION, MPI3_POINTER PTR_MPI3_COMP_IMAGE_VERSION,
55   Mpi3CompImageVersion_t, MPI3_POINTER pMpi3CompImageVersion_t;
56 
57 /* Hash Exclusion Format */
58 typedef struct _MPI3_HASH_EXCLUSION_FORMAT
59 {
60     U32                     Offset;        /* 0x00 */
61     U32                     Size;          /* 0x04 */
62 } MPI3_HASH_EXCLUSION_FORMAT, MPI3_POINTER PTR_MPI3_HASH_EXCLUSION_FORMAT,
63 Mpi3HashSxclusionFormat_t, MPI3_POINTER pMpi3HashExclusionFormat_t;
64 
65 #define MPI3_IMAGE_HASH_EXCUSION_NUM                           (4)
66 
67 /* FW Image Header */
68 typedef struct _MPI3_COMPONENT_IMAGE_HEADER
69 {
70     U32                            Signature0;                                      /* 0x00 */
71     U32                            LoadAddress;                                     /* 0x04 */
72     U32                            DataSize;                                        /* 0x08 */
73     U32                            StartOffset;                                     /* 0x0C */
74     U32                            Signature1;                                      /* 0x10 */
75     U32                            FlashOffset;                                     /* 0x14 */
76     U32                            ImageSize;                                       /* 0x18 */
77     U32                            VersionStringOffset;                             /* 0x1C */
78     U32                            BuildDateStringOffset;                           /* 0x20 */
79     U32                            BuildTimeStringOffset;                           /* 0x24 */
80     U32                            EnvironmentVariableOffset;                       /* 0x28 */
81     U32                            ApplicationSpecific;                             /* 0x2C */
82     U32                            Signature2;                                      /* 0x30 */
83     U32                            HeaderSize;                                      /* 0x34 */
84     U32                            Crc;                                             /* 0x38 */
85     U32                            Flags;                                           /* 0x3C */
86     U32                            SecondaryFlashOffset;                            /* 0x40 */
87     U32                            ETPOffset;                                       /* 0x44 */
88     U32                            ETPSize;                                         /* 0x48 */
89     MPI3_VERSION_UNION             RMCInterfaceVersion;                             /* 0x4C */
90     MPI3_VERSION_UNION             ETPInterfaceVersion;                             /* 0x50 */
91     MPI3_COMP_IMAGE_VERSION        ComponentImageVersion;                           /* 0x54 */
92     MPI3_HASH_EXCLUSION_FORMAT     HashExclusion[MPI3_IMAGE_HASH_EXCUSION_NUM];     /* 0x5C */
93     U32                            NextImageHeaderOffset;                           /* 0x7C */
94     MPI3_VERSION_UNION             SecurityVersion;                                 /* 0x80 */
95     U32                            Reserved84[31];                                  /* 0x84 -- 0xFC */
96 } MPI3_COMPONENT_IMAGE_HEADER, MPI3_POINTER PTR_MPI3_COMPONENT_IMAGE_HEADER,
97   Mpi3ComponentImageHeader_t, MPI3_POINTER pMpi3ComponentImageHeader_t;
98 
99 
100 /**** Definitions for Signature0 field ****/
101 #define MPI3_IMAGE_HEADER_SIGNATURE0_MPI3                     (0xEB00003E)
102 
103 /**** Definitions for LoadAddress field ****/
104 #define MPI3_IMAGE_HEADER_LOAD_ADDRESS_INVALID                (0x00000000)
105 
106 /**** Definitions for Signature1 field ****/
107 #define MPI3_IMAGE_HEADER_SIGNATURE1_APPLICATION              (0x20505041)  /* string "APP "  */
108 #define MPI3_IMAGE_HEADER_SIGNATURE1_FIRST_MUTABLE            (0x20434D46)  /* string "FMC "  */
109 #define MPI3_IMAGE_HEADER_SIGNATURE1_BSP                      (0x20505342)  /* string "BSP "  */
110 #define MPI3_IMAGE_HEADER_SIGNATURE1_ROM_BIOS                 (0x534F4942)  /* string "BIOS"  */
111 #define MPI3_IMAGE_HEADER_SIGNATURE1_HII_X64                  (0x4D494948)  /* string "HIIM"  */
112 #define MPI3_IMAGE_HEADER_SIGNATURE1_HII_ARM                  (0x41494948)  /* string "HIIA"  */
113 #define MPI3_IMAGE_HEADER_SIGNATURE1_CPLD                     (0x444C5043)  /* string "CPLD"  */
114 #define MPI3_IMAGE_HEADER_SIGNATURE1_SPD                      (0x20445053)  /* string "SPD "  */
115 #define MPI3_IMAGE_HEADER_SIGNATURE1_GAS_GAUGE                (0x20534147)  /* string "GAS "  */
116 #define MPI3_IMAGE_HEADER_SIGNATURE1_PBLP                     (0x504C4250)  /* string "PBLP"  */
117 #define MPI3_IMAGE_HEADER_SIGNATURE1_MANIFEST                 (0x464E414D)  /* string "MANF"  */
118 #define MPI3_IMAGE_HEADER_SIGNATURE1_OEM                      (0x204D454F)  /* string "OEM "  */
119 #define MPI3_IMAGE_HEADER_SIGNATURE1_RMC                      (0x20434D52)  /* string "RMC "  */
120 #define MPI3_IMAGE_HEADER_SIGNATURE1_SMM                      (0x204D4D53)  /* string "SMM "  */
121 #define MPI3_IMAGE_HEADER_SIGNATURE1_PSW                      (0x20575350)  /* string "PSW "  */
122 
123 
124 /**** Definitions for Signature2 field ****/
125 #define MPI3_IMAGE_HEADER_SIGNATURE2_VALUE                    (0x50584546)
126 
127 /**** Definitions for Flags field ****/
128 #define MPI3_IMAGE_HEADER_FLAGS_DEVICE_KEY_BASIS_MASK         (0x00000030)
129 #define MPI3_IMAGE_HEADER_FLAGS_DEVICE_KEY_BASIS_CDI          (0x00000000)
130 #define MPI3_IMAGE_HEADER_FLAGS_DEVICE_KEY_BASIS_DI           (0x00000010)
131 #define MPI3_IMAGE_HEADER_FLAGS_SIGNED_NVDATA                 (0x00000008)
132 #define MPI3_IMAGE_HEADER_FLAGS_REQUIRES_ACTIVATION           (0x00000004)
133 #define MPI3_IMAGE_HEADER_FLAGS_COMPRESSED                    (0x00000002)
134 #define MPI3_IMAGE_HEADER_FLAGS_FLASH                         (0x00000001)
135 
136 
137 /**** Offsets for Image Header Fields ****/
138 #define MPI3_IMAGE_HEADER_SIGNATURE0_OFFSET                   (0x00)
139 #define MPI3_IMAGE_HEADER_LOAD_ADDRESS_OFFSET                 (0x04)
140 #define MPI3_IMAGE_HEADER_DATA_SIZE_OFFSET                    (0x08)
141 #define MPI3_IMAGE_HEADER_START_OFFSET_OFFSET                 (0x0C)
142 #define MPI3_IMAGE_HEADER_SIGNATURE1_OFFSET                   (0x10)
143 #define MPI3_IMAGE_HEADER_FLASH_OFFSET_OFFSET                 (0x14)
144 #define MPI3_IMAGE_HEADER_FLASH_SIZE_OFFSET                   (0x18)
145 #define MPI3_IMAGE_HEADER_VERSION_STRING_OFFSET_OFFSET        (0x1C)
146 #define MPI3_IMAGE_HEADER_BUILD_DATE_STRING_OFFSET_OFFSET     (0x20)
147 #define MPI3_IMAGE_HEADER_BUILD_TIME_OFFSET_OFFSET            (0x24)
148 #define MPI3_IMAGE_HEADER_ENVIROMENT_VAR_OFFSET_OFFSET        (0x28)
149 #define MPI3_IMAGE_HEADER_APPLICATION_SPECIFIC_OFFSET         (0x2C)
150 #define MPI3_IMAGE_HEADER_SIGNATURE2_OFFSET                   (0x30)
151 #define MPI3_IMAGE_HEADER_HEADER_SIZE_OFFSET                  (0x34)
152 #define MPI3_IMAGE_HEADER_CRC_OFFSET                          (0x38)
153 #define MPI3_IMAGE_HEADER_FLAGS_OFFSET                        (0x3C)
154 #define MPI3_IMAGE_HEADER_SECONDARY_FLASH_OFFSET_OFFSET       (0x40)
155 #define MPI3_IMAGE_HEADER_ETP_OFFSET_OFFSET                   (0x44)
156 #define MPI3_IMAGE_HEADER_ETP_SIZE_OFFSET                     (0x48)
157 #define MPI3_IMAGE_HEADER_RMC_INTERFACE_VER_OFFSET            (0x4C)
158 #define MPI3_IMAGE_HEADER_ETP_INTERFACE_VER_OFFSET            (0x50)
159 #define MPI3_IMAGE_HEADER_COMPONENT_IMAGE_VER_OFFSET          (0x54)
160 #define MPI3_IMAGE_HEADER_HASH_EXCLUSION_OFFSET               (0x5C)
161 #define MPI3_IMAGE_HEADER_NEXT_IMAGE_HEADER_OFFSET_OFFSET     (0x7C)
162 
163 
164 #define MPI3_IMAGE_HEADER_SIZE                                (0x100)
165 
166 
167 
168 /*****************************************************************************
169  *              Component Image Data                                         *
170  *****************************************************************************/
171 
172 /* Package Manifest Data */
173 
174 #ifndef MPI3_CI_MANIFEST_MPI_MAX
175 #define MPI3_CI_MANIFEST_MPI_MAX                               (1)
176 #endif  /* MPI3_CI_MANIFEST_MPI_MAX */
177 
178 typedef struct _MPI3_CI_MANIFEST_MPI_COMP_IMAGE_REF
179 {
180     U32                                Signature1;                                    /* 0x00 */
181     U32                                Reserved04[3];                                 /* 0x04 */
182     MPI3_COMP_IMAGE_VERSION            ComponentImageVersion;                         /* 0x10 */
183     U32                                ComponentImageVersionStringOffset;             /* 0x18 */
184     U32                                CRC;                                           /* 0x1C */
185 } MPI3_CI_MANIFEST_MPI_COMP_IMAGE_REF, MPI3_POINTER PTR_MPI3_CI_MANIFEST_MPI_COMP_IMAGE_REF,
186   Mpi3CIManifestMpiCompImageRef_t, MPI3_POINTER pMpi3CIManifestMpiCompImageRef_t;
187 
188 typedef struct _MPI3_CI_MANIFEST_MPI
189 {
190     U8                                    ManifestType;                                  /* 0x00 */
191     U8                                    Reserved01[3];                                 /* 0x01 */
192     U32                                   Reserved04[3];                                 /* 0x04 */
193     U8                                    NumImageReferences;                            /* 0x10 */
194     U8                                    ReleaseLevel;                                  /* 0x11 */
195     U16                                   Reserved12;                                    /* 0x12 */
196     U16                                   Reserved14;                                    /* 0x14 */
197     U16                                   Flags;                                         /* 0x16 */
198     U32                                   Reserved18[2];                                 /* 0x18 */
199     U16                                   VendorID;                                      /* 0x20 */
200     U16                                   DeviceID;                                      /* 0x22 */
201     U16                                   SubsystemVendorID;                             /* 0x24 */
202     U16                                   SubsystemID;                                   /* 0x26 */
203     U32                                   Reserved28[2];                                 /* 0x28 */
204     MPI3_VERSION_UNION                    PackageSecurityVersion;                        /* 0x30 */
205     U32                                   Reserved34;                                    /* 0x34 */
206     MPI3_COMP_IMAGE_VERSION               PackageVersion;                                /* 0x38 */
207     U32                                   PackageVersionStringOffset;                    /* 0x40 */
208     U32                                   PackageBuildDateStringOffset;                  /* 0x44 */
209     U32                                   PackageBuildTimeStringOffset;                  /* 0x48 */
210     U32                                   Reserved4C;                                    /* 0x4C */
211     U32                                   DiagAuthorizationIdentifier[16];               /* 0x50 */
212     MPI3_CI_MANIFEST_MPI_COMP_IMAGE_REF   ComponentImageRef[MPI3_CI_MANIFEST_MPI_MAX];   /* 0x90 */    /* variable length */
213     /*                                    StringData - offset of this field must be calculated   */    /* variable length */
214 } MPI3_CI_MANIFEST_MPI, MPI3_POINTER PTR_MPI3_CI_MANIFEST_MPI,
215   Mpi3CIManifestMpi_t, MPI3_POINTER pMpi3CIManifestMpi_t;
216 
217 /* defines for the ReleaseLevel field */
218 #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_DEV                        (0x00)
219 #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_PREALPHA                   (0x10)
220 #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_ALPHA                      (0x20)
221 #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_BETA                       (0x30)
222 #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_RC                         (0x40)
223 #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_GCA                        (0x50)
224 #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_POINT                      (0x60)
225 
226 /* defines for the Flags field */
227 #define MPI3_CI_MANIFEST_MPI_FLAGS_DIAG_AUTHORIZATION                 (0x01)
228 
229 /* defines for the SubsystemID field */
230 #define MPI3_CI_MANIFEST_MPI_SUBSYSTEMID_IGNORED                   (0xFFFF)
231 
232 /* defines for the PackageVersionStringOffset field */
233 #define MPI3_CI_MANIFEST_MPI_PKG_VER_STR_OFF_UNSPECIFIED           (0x00000000)
234 
235 /* defines for the PackageBuildDateStringOffset field */
236 #define MPI3_CI_MANIFEST_MPI_PKG_BUILD_DATE_STR_OFF_UNSPECIFIED    (0x00000000)
237 
238 /* defines for the PackageBuildTimeStringOffset field */
239 #define MPI3_CI_MANIFEST_MPI_PKG_BUILD_TIME_STR_OFF_UNSPECIFIED    (0x00000000)
240 
241 typedef union _MPI3_CI_MANIFEST
242 {
243     MPI3_CI_MANIFEST_MPI               Mpi;
244     U32                                Dword[1];
245 } MPI3_CI_MANIFEST, MPI3_POINTER PTR_MPI3_CI_MANIFEST,
246   Mpi3CIManifest_t, MPI3_POINTER pMpi3CIManifest_t;
247 
248 /* defines for ManifestType field */
249 #define MPI3_CI_MANIFEST_TYPE_MPI                                  (0x00)
250 
251 
252 /*****************************************************************************
253  *              Extended Image Data                                          *
254  *****************************************************************************/
255 
256 /* Extended Image Header */
257 typedef struct _MPI3_EXTENDED_IMAGE_HEADER
258 {
259     U8                             ImageType;                   /* 0x00 */
260     U8                             Reserved01[3];               /* 0x01 */
261     U32                            Checksum;                    /* 0x04 */
262     U32                            ImageSize;                   /* 0x08 */
263     U32                            NextImageHeaderOffset;       /* 0x0C */
264     U32                            Reserved10[4];               /* 0x10 */
265     U32                            IdentifyString[8];           /* 0x20 */
266 } MPI3_EXTENDED_IMAGE_HEADER, MPI3_POINTER PTR_MPI3_EXTENDED_IMAGE_HEADER,
267   Mpi3ExtendedImageHeader_t, MPI3_POINTER pMpi3ExtendedImageHeader_t;
268 
269 /* useful offsets */
270 #define MPI3_EXT_IMAGE_IMAGETYPE_OFFSET         (0x00)
271 #define MPI3_EXT_IMAGE_IMAGESIZE_OFFSET         (0x08)
272 #define MPI3_EXT_IMAGE_NEXTIMAGE_OFFSET         (0x0C)
273 
274 #define MPI3_EXT_IMAGE_HEADER_SIZE              (0x40)
275 
276 /* defines for the ImageType field */
277 #define MPI3_EXT_IMAGE_TYPE_UNSPECIFIED             (0x00)
278 #define MPI3_EXT_IMAGE_TYPE_NVDATA                  (0x03)
279 #define MPI3_EXT_IMAGE_TYPE_SUPPORTED_DEVICES       (0x07)
280 #define MPI3_EXT_IMAGE_TYPE_ENCRYPTED_HASH          (0x09)
281 #define MPI3_EXT_IMAGE_TYPE_RDE                     (0x0A)
282 #define MPI3_EXT_IMAGE_TYPE_AUXILIARY_PROCESSOR     (0x0B)
283 #define MPI3_EXT_IMAGE_TYPE_MIN_PRODUCT_SPECIFIC    (0x80)
284 #define MPI3_EXT_IMAGE_TYPE_MAX_PRODUCT_SPECIFIC    (0xFF)
285 
286 
287 /* Supported Device Data Format */
288 typedef struct _MPI3_SUPPORTED_DEVICE
289 {
290     U16                     DeviceID;                   /* 0x00 */
291     U16                     VendorID;                   /* 0x02 */
292     U16                     DeviceIDMask;               /* 0x04 */
293     U16                     Reserved06;                 /* 0x06 */
294     U8                      LowPCIRev;                  /* 0x08 */
295     U8                      HighPCIRev;                 /* 0x09 */
296     U16                     Reserved0A;                 /* 0x0A */
297     U32                     Reserved0C;                 /* 0x0C */
298 } MPI3_SUPPORTED_DEVICE, MPI3_POINTER PTR_MPI3_SUPPORTED_DEVICE,
299   Mpi3SupportedDevice_t, MPI3_POINTER pMpi3SupportedDevice_t;
300 
301 #ifndef MPI3_SUPPORTED_DEVICE_MAX
302 #define MPI3_SUPPORTED_DEVICE_MAX                      (1)
303 #endif  /* MPI3_SUPPORTED_DEVICE_MAX */
304 
305 /* Supported Devices Extended Image Data */
306 typedef struct _MPI3_SUPPORTED_DEVICES_DATA
307 {
308     U8                      ImageVersion;                                   /* 0x00 */
309     U8                      Reserved01;                                     /* 0x01 */
310     U8                      NumDevices;                                     /* 0x02 */
311     U8                      Reserved03;                                     /* 0x03 */
312     U32                     Reserved04;                                     /* 0x04 */
313     MPI3_SUPPORTED_DEVICE   SupportedDevice[MPI3_SUPPORTED_DEVICE_MAX];     /* 0x08 */    /* variable length */
314 } MPI3_SUPPORTED_DEVICES_DATA, MPI3_POINTER PTR_MPI3_SUPPORTED_DEVICES_DATA,
315   Mpi3SupportedDevicesData_t, MPI3_POINTER pMpi3SupportedDevicesData_t;
316 
317 #ifndef MPI3_ENCRYPTED_HASH_MAX
318 #define MPI3_ENCRYPTED_HASH_MAX                      (1)
319 #endif  /* MPI3_ENCRYPTED_HASH_MAX */
320 
321 /* Encrypted Hash Entry Format */
322 typedef struct _MPI3_ENCRYPTED_HASH_ENTRY
323 {
324     U8                      HashImageType;                                  /* 0x00 */
325     U8                      HashAlgorithm;                                  /* 0x01 */
326     U8                      EncryptionAlgorithm;                            /* 0x02 */
327     U8                      Reserved03;                                     /* 0x03 */
328     U32                     Reserved04;                                     /* 0x04 */
329     U32                     EncryptedHash[MPI3_ENCRYPTED_HASH_MAX];         /* 0x08 */   /* variable length */
330 } MPI3_ENCRYPTED_HASH_ENTRY, MPI3_POINTER PTR_MPI3_ENCRYPTED_HASH_ENTRY,
331   Mpi3EncryptedHashEntry_t, MPI3_POINTER pMpi3EncryptedHashEntry_t;
332 
333 
334 /* defines for the HashImageType field */
335 #define MPI3_HASH_IMAGE_TYPE_KEY_WITH_SIGNATURE      (0x03)
336 
337 /* defines for the HashAlgorithm field */
338 #define MPI3_HASH_ALGORITHM_VERSION_MASK             (0xE0)
339 #define MPI3_HASH_ALGORITHM_VERSION_NONE             (0x00)
340 #define MPI3_HASH_ALGORITHM_VERSION_SHA1             (0x20)   /* Obsolete */
341 #define MPI3_HASH_ALGORITHM_VERSION_SHA2             (0x40)
342 #define MPI3_HASH_ALGORITHM_VERSION_SHA3             (0x60)
343 
344 #define MPI3_HASH_ALGORITHM_SIZE_MASK                (0x1F)
345 #define MPI3_HASH_ALGORITHM_SIZE_UNUSED              (0x00)
346 #define MPI3_HASH_ALGORITHM_SIZE_SHA256              (0x01)
347 #define MPI3_HASH_ALGORITHM_SIZE_SHA512              (0x02)
348 #define MPI3_HASH_ALGORITHM_SIZE_SHA384              (0x03)
349 
350 /* defines for the EncryptionAlgorithm field */
351 #define MPI3_ENCRYPTION_ALGORITHM_UNUSED             (0x00)
352 #define MPI3_ENCRYPTION_ALGORITHM_RSA256             (0x01)   /* Obsolete */
353 #define MPI3_ENCRYPTION_ALGORITHM_RSA512             (0x02)   /* Obsolete */
354 #define MPI3_ENCRYPTION_ALGORITHM_RSA1024            (0x03)   /* Obsolete */
355 #define MPI3_ENCRYPTION_ALGORITHM_RSA2048            (0x04)
356 #define MPI3_ENCRYPTION_ALGORITHM_RSA4096            (0x05)
357 #define MPI3_ENCRYPTION_ALGORITHM_RSA3072            (0x06)
358 #define MPI3_ENCRYPTION_ALGORITHM_ECDSA_P256         (0x07)   /* NIST secp256r1 curve */
359 #define MPI3_ENCRYPTION_ALGORITHM_ECDSA_P384         (0x08)   /* NIST secp384r1 curve */
360 #define MPI3_ENCRYPTION_ALGORITHM_ECDSA_P521         (0x09)   /* NIST secp521r1 curve */
361 
362 
363 #ifndef MPI3_PUBLIC_KEY_MAX
364 #define MPI3_PUBLIC_KEY_MAX                          (1)
365 #endif  /* MPI3_PUBLIC_KEY_MAX */
366 
367 /* Encrypted Key with Hash Entry Format */
368 typedef struct _MPI3_ENCRYPTED_KEY_WITH_HASH_ENTRY
369 {
370     U8                      HashImageType;                                  /* 0x00 */
371     U8                      HashAlgorithm;                                  /* 0x01 */
372     U8                      EncryptionAlgorithm;                            /* 0x02 */
373     U8                      Reserved03;                                     /* 0x03 */
374     U32                     Reserved04;                                     /* 0x04 */
375     U32                     PublicKey[MPI3_PUBLIC_KEY_MAX];                 /* 0x08 */     /* variable length */
376     /*                      EncryptedHash - offset of this field must be calculated */     /* variable length */
377 } MPI3_ENCRYPTED_KEY_WITH_HASH_ENTRY, MPI3_POINTER PTR_MPI3_ENCRYPTED_KEY_WITH_HASH_ENTRY,
378   Mpi3EncryptedKeyWithHashEntry_t, MPI3_POINTER pMpi3EncryptedKeyWithHashEntry_t;
379 
380 #ifndef MPI3_ENCRYPTED_HASH_ENTRY_MAX
381 #define MPI3_ENCRYPTED_HASH_ENTRY_MAX               (1)
382 #endif  /* MPI3_ENCRYPTED_HASH_ENTRY_MAX */
383 
384 /* Encrypted Hash Image Data */
385 typedef struct _MPI3_ENCRYPTED_HASH_DATA
386 {
387     U8                               ImageVersion;                                          /* 0x00 */
388     U8                               NumHash;                                               /* 0x01 */
389     U16                              Reserved02;                                            /* 0x02 */
390     U32                              Reserved04;                                            /* 0x04 */
391     MPI3_ENCRYPTED_HASH_ENTRY        EncryptedHashEntry[MPI3_ENCRYPTED_HASH_ENTRY_MAX];     /* 0x08 */   /* variable length */
392 } MPI3_ENCRYPTED_HASH_DATA, MPI3_POINTER PTR_MPI3_ENCRYPTED_HASH_DATA,
393   Mpi3EncryptedHashData_t, MPI3_POINTER pMpi3EncryptedHashData_t;
394 
395 
396 #ifndef MPI3_AUX_PROC_DATA_MAX
397 #define MPI3_AUX_PROC_DATA_MAX               (1)
398 #endif  /* MPI3_ENCRYPTED_HASH_ENTRY_MAX */
399 
400 /* Auxiliary Processor Extended Image Data */
401 typedef struct _MPI3_AUX_PROCESSOR_DATA
402 {
403     U8                      BootMethod;                               /* 0x00 */
404     U8                      NumLoadAddr;                              /* 0x01 */
405     U8                      Reserved02;                               /* 0x02 */
406     U8                      Type;                                     /* 0x03 */
407     U32                     Version;                                  /* 0x04 */
408     U32                     LoadAddress[8];                           /* 0x08 */
409     U32                     Reserved28[22];                           /* 0x28 */
410     U32                     AuxProcessorData[MPI3_AUX_PROC_DATA_MAX]; /* 0x80 */   /* variable length */
411 } MPI3_AUX_PROCESSOR_DATA, MPI3_POINTER PTR_MPI3_AUX_PROCESSOR_DATA,
412   Mpi3AuxProcessorData_t, MPI3_POINTER pMpi3AuxProcessorData_t;
413 
414 #define MPI3_AUX_PROC_DATA_OFFSET                                     (0x80)
415 
416 /* defines for the BootMethod field */
417 #define MPI3_AUXPROCESSOR_BOOT_METHOD_MO_MSG                          (0x00)
418 #define MPI3_AUXPROCESSOR_BOOT_METHOD_MO_DOORBELL                     (0x01)
419 #define MPI3_AUXPROCESSOR_BOOT_METHOD_COMPONENT                       (0x02)
420 
421 /* defines for the Type field */
422 #define MPI3_AUXPROCESSOR_TYPE_ARM_A15                                (0x00)
423 #define MPI3_AUXPROCESSOR_TYPE_ARM_M0                                 (0x01)
424 #define MPI3_AUXPROCESSOR_TYPE_ARM_R4                                 (0x02)
425 
426 #endif /* MPI30_IMAGE_H */
427