1 /****************************************************************************
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  *
21  * Copyright 2014 QLogic Corporation
22  * The contents of this file are subject to the terms of the
23  * QLogic End User License (the "License").
24  * You may not use this file except in compliance with the License.
25  *
26  * You can obtain a copy of the License at
27  * http://www.qlogic.com/Resources/Documents/DriverDownloadHelp/
28  * QLogic_End_User_Software_License.txt
29  * See the License for the specific language governing permissions
30  * and limitations under the License.
31  *
32  *
33  * Name:        append.h
34  *
35  * Description:
36  *      This is a utility to append firmware and other images into a
37  *      single file. The primary use of this is to combine two phases
38  *      of the bootcode into a single file. It appends some header
39  *      information (used for parsing the file) and the input image to
40  *      the output file. (If the output file does not yet exist, it'll
41  *      create one.)
42  *      This header file defines the image header information.
43  *
44  * $Date: 2014/01/02 $       $Revision: #44 $
45  *
46  ****************************************************************************/
47 
48 #ifndef APPEND_H
49 #define APPEND_H
50 
51 #include "bcmtype.h"
52 
53 #pragma pack(push, 1)
54 
55 typedef struct _image_header_t
56 {
57     u32_t magic;
58         #define FILE_MAGIC                       0x669955aa
59 
60     u32_t version;
61         #define FORMAT_VERSION_1                 0x1
62         #define FORMAT_VERSION_2                 0x2
63         #define LATEST_FORMAT_VERSION            FORMAT_VERSION_2
64 
65     u32_t type;
66         #define IMAGE_HDR_TYPE_BC1                       0x31636200   /* -bc1  */
67         #define IMAGE_HDR_TYPE_BC2                       0x32636200   /* -bc2  */
68         #define IMAGE_HDR_TYPE_NCSI_CMN                  0x6d63636e   /* -nccm */
69         #define IMAGE_HDR_TYPE_NCSI_LIB_XI               0x786c636e   /* -nclx */
70         #define IMAGE_HDR_TYPE_NCSI_LIB_EV               0x656c636e   /* -ncle */
71         #define IMAGE_HDR_TYPE_MODULES_PN                0x706d7500   /* -m_pn */
72         #define IMAGE_HDR_TYPE_IPMI                      0x696d7069   /* -ipmi */
73         #define IMAGE_HDR_TYPE_MBA                       0x61626d00   /* -mba  */
74         #define IMAGE_HDR_TYPE_L2T                       0x74326c00   /* -l2t  */
75         #define IMAGE_HDR_TYPE_L2C                       0x63326c00   /* -l2c  */
76         #define IMAGE_HDR_TYPE_L2X                       0x78326c00   /* -l2x  */
77         #define IMAGE_HDR_TYPE_L2U                       0x75326c00   /* -l2u  */
78         #define IMAGE_HDR_TYPE_ISCSI_BOOT                0x62690000   /* -ib   */
79         #define IMAGE_HDR_TYPE_ISCSI_BOOT_CFG            0x63626900   /* -ibc  */
80         #define IMAGE_HDR_TYPE_ISCSI_BOOT_CPRG           0x65706269   /* -ibpe */
81         #define IMAGE_HDR_TYPE_ISCSI_BOOT_IPV6           0x36626900   /* -ib6  */
82         #define IMAGE_HDR_TYPE_ISCSI_BOOT_CFG_V2         0x36636269   /* -ibcv2 */
83         #define IMAGE_HDR_TYPE_ISCSI_BOOT_IPV4N6         0x6e346269   /* -ib4n6 */
84         #define IMAGE_HDR_TYPE_FCOE_BOOT                 0x62656600   /* -feb */
85         #define IMAGE_HDR_TYPE_FCOE_BOOT_CFG             0x63626566   /* -febc */
86         #define IMAGE_HDR_TYPE_FCOE_BOOT_CPRG            0x70626566   /* -febp */
87         #define IMAGE_HDR_TYPE_FCOE_BOOT_CPRG_LGCY       0x6c706266   /* -febpl */
88         #define IMAGE_HDR_TYPE_FCOE_BOOT_CPRG_EVRST      0x65706266   /* -febpe */
89         #define IMAGE_HDR_TYPE_BOOT_CFG_SHADOW           0x6363caca   /* -bootsh */
90         #define IMAGE_HDR_TYPE_NIC_PARTITION_CFG         0x7063696e   /* -nicp */
91         #define IMAGE_HDR_TYPE_VPD_TABLE                 0x44505600   /* -vpd */
92         #define IMAGE_HDR_TYPE_E3_WC                     0x63773365   /* -e3wc */
93         #define IMAGE_HDR_TYPE_E3_PCIE                   0x65703365   /* -e3pe */
94         #define IMAGE_HDR_TYPE_NIV_CFG                   0x6e69760a   /* -niv */
95         #define IMAGE_HDR_TYPE_NIV_PROFILES_CFG          0x6e6976bb   /* -nivprofiles */
96         #define IMAGE_HDR_TYPE_CFG_EXTENDED_SHARED       0x73686172   /* -cfg_extended_shared */
97         #define IMAGE_HDR_TYPE_SWIM1                     0x73776949   /* -swi1 */
98         #define IMAGE_HDR_TYPE_SWIM2                     0x73776950   /* -swi2 */
99         #define IMAGE_HDR_TYPE_SWIM3                     0x73776951   /* -swi3 */
100         #define IMAGE_HDR_TYPE_SWIM4                     0x73776952   /* -swi4 */
101         #define IMAGE_HDR_TYPE_SWIM5                     0x73776953   /* -swi5 */
102         #define IMAGE_HDR_TYPE_SWIM6                     0x73776954   /* -swi6 */
103         #define IMAGE_HDR_TYPE_SWIM7                     0x73776955   /* -swi7 */
104         #define IMAGE_HDR_TYPE_SWIM8                     0x73776956   /* -swi8 */
105         #define IMAGE_HDR_TYPE_SWIM1_B                   0x73776957   /* -swi1b */
106         #define IMAGE_HDR_TYPE_SWIM2_B                   0x73776958   /* -swi2b */
107         #define IMAGE_HDR_TYPE_SWIM3_B                   0x73776959   /* -swi3b */
108         #define IMAGE_HDR_TYPE_SWIM4_B                   0x73776960   /* -swi4b */
109         #define IMAGE_HDR_TYPE_SWIM5_B                   0x73776961   /* -swi5b */
110         #define IMAGE_HDR_TYPE_SWIM6_B                   0x73776962   /* -swi6b */
111         #define IMAGE_HDR_TYPE_SWIM7_B                   0x73776963   /* -swi7b */
112         #define IMAGE_HDR_TYPE_SWIM8_B                   0x73776964   /* -swi8b */
113         #define IMAGE_HDR_TYPE_MFW1                      0x3177666d   /* -mfw1 */
114         #define IMAGE_HDR_TYPE_MFW2                      0x3277666d   /* -mfw2 */
115         #define IMAGE_HDR_TYPE_MFW2_A                    0x3377666d   /* -mfw2_a */
116         #define IMAGE_HDR_TYPE_OCNVM                     0x766e636f   /* -ocnv */
117         #define IMAGE_HDR_TYPE_E3_WCV2                   0x32766377   /* -wcv2 */
118         #define IMAGE_HDR_TYPE_E3_PCIEV2                 0x32766570   /* -pev2 */
119         #define IMAGE_HDR_TYPE_CCM                       0x6d636300   /* -ccm */
120         #define IMAGE_HDR_TYPE_HW_SET                    0x706d7501   /* -hw_set */
121         #define IMAGE_HDR_TYPE_USR_BLK                   0x60627275   /* -usrblk */
122         #define IMAGE_HDR_TYPE_ISCSI_PERS                0x70657273   /* -ipers */
123         #define IMAGE_HDR_TYPE_BDN                       0x6e646200   /* -bdn */
124 
125 
126     u32_t image_info;
127         /* not defined bits */
128         #define IMAGE_INFO_REVERSED_MASK         0xff00ffff
129 
130         /* bit 23:16 define which devices it can support
131          * These are bit fields */
132         #define IMAGE_INFO_CHIP_MASK             0x00ff0000
133         #define IMAGE_INFO_CHIP_5706             0x00010000
134         #define IMAGE_INFO_CHIP_5708             0x00020000
135         #define IMAGE_INFO_CHIP_5709             0x00040000
136         #define IMAGE_INFO_CHIP_57710            0x00080000
137         #define IMAGE_INFO_CHIP_57711            0x00100000
138         #define IMAGE_INFO_CHIP_57712            0x00200000
139         #define IMAGE_INFO_CHIP_57840            0x00400000
140 
141     u32_t byte_cnt;
142 } image_header_t;
143 
144 #pragma pack(pop)
145 
146 #endif /*APPEND_H*/
147