xref: /titanic_41/usr/src/cmd/fwflash/plugins/hdrs/MELLANOX.h (revision 6a634c9dca3093f3922e4b7ab826d7bdf17bf78e)
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 
22 /*
23  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
24  */
25 
26 #ifndef _HDRS_MELLANOX_H
27 #define	_HDRS_MELLANOX_H
28 
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  * MELLANOX.h
36  *
37  * This file contain common information related to Mellanox technologies
38  * HCA cards.
39  */
40 #define	SUNW_OUI		0x0003baULL
41 #define	MLX_OUI			0x0002c9ULL
42 #define	MLX_DEFAULT_NODE_GUID	0x2c9000100d050ULL
43 #define	MLX_DEFAULT_P1_GUID	0x2c9000100d051ULL
44 #define	MLX_DEFAULT_P2_GUID	0x2c9000100d052ULL
45 #define	MLX_DEFAULT_SYSIMG_GUID	0x2c9000100d053ULL
46 
47 /* How many bits to shift and leave just the OUI */
48 #define	OUISHIFT		40
49 
50 #define	MLX_VPR_VIDLEN		9	/* "MELLANOX" + '\0' */
51 #define	MLX_VPR_REVLEN		21	/* "%04x.%04x.%04x: %04x" + '\0' */
52 
53 #define	FWFLASH_IB_MAGIC_NUMBER		0xF00B0021
54 
55 /* Numerically largest OUI that's presently assigned */
56 #define	TAVOR_MAX_OUI			0xacde48
57 
58 #define	FWFLASH_IB_STATE_NONE		0x00
59 #define	FWFLASH_IB_STATE_IMAGE_PRI	0x01
60 #define	FWFLASH_IB_STATE_IMAGE_SEC	0x02
61 #define	FWFLASH_IB_STATE_MMAP		0x04
62 #define	FWFLASH_IB_STATE_GUIDN		0x10
63 #define	FWFLASH_IB_STATE_GUID1		0x20
64 #define	FWFLASH_IB_STATE_GUID2		0x40
65 #define	FWFLASH_IB_STATE_GUIDS		0x80
66 
67 #define	FWFLASH_IB_STATE_IMAGE		FWFLASH_IB_STATE_IMAGE_PRI
68 
69 #define	FWFLASH_IB_STATE_PFI_IMAGE	FWFLASH_IB_STATE_IMAGE_PRI
70 #define	FWFLASH_IB_STATE_SFI_IMAGE	FWFLASH_IB_STATE_IMAGE_SEC
71 
72 /*
73  * Structure to hold the part number, PSID, and string ID
74  * for an HCA card.
75  */
76 typedef struct mlx_mdr_s {
77 	char *mlx_pn;
78 	char *mlx_psid;
79 	char *mlx_id;
80 } mlx_mdr_t;
81 
82 /*
83  * Magic decoder ring for matching HCA hardware/firmware.
84  * Part Number / PSID / String ID
85  */
86 mlx_mdr_t mlx_mdr[] = {
87 	/* Part No		PSID			Card ID */
88 	{ "MHEA28-XS",		"MT_0250000001",	"Lion mini" },
89 	{ "MHEA28-XSC",		"MT_0390110001",	"Lion mini" },
90 	{ "MHEA28-XT",		"MT_0150000001",	"Lion mini" },
91 	{ "MHEA28-XTC",		"MT_0370110001",	"Lion mini" },
92 	{ "MHGA28-XT",		"MT_0150000002",	"Lion mini" },
93 	{ "MHGA28-XTC",		"MT_0370110002",	"Lion mini" },
94 	{ "MHGA28-XTC",		"MT_0370130002",	"Lion mini" },
95 	{ "MHGA28-XS",		"MT_0250000002",	"Lion mini" },
96 	{ "MHGA28-XSC",		"MT_0390110002",	"Lion mini" },
97 	{ "MHGA28-XSC",		"MT_0390130002",	"Lion mini" },
98 	{ "MHEL-CF128",		"MT_0190000001",	"Lion cub" },
99 	{ "MHEL-CF128-T",	"MT_00A0000001",	"Lion cub" },
100 	{ "MTLP25208-CF128T",	"MT_00A0000001",	"Lion cub" },
101 	{ "MHEL-CF128-TC",	"MT_00A0010001",	"Lion cub" },
102 	{ "MHEL-CF128-TC",	"MT_0140010001",	"Lion cub" },
103 	{ "MHEL-CF128-SC",	"MT_0190010001",	"Lion cub" },
104 	{ "MHEA28-1TC",		"MT_02F0110001",	"Lion cub" },
105 	{ "MHEA28-1SC",		"MT_0330110001",	"Lion cub" },
106 	{ "MHGA28-1T",		"MT_0200000001",	"Lion cub" },
107 	{ "MHGA28-1TC",		"MT_02F0110002",	"Lion cub" },
108 	{ "MHGA28-1SC",		"MT_0330110002",	"Lion cub" },
109 	{ "MHGA28-1S",		"MT_0430000001",	"Lion cub" },
110 	{ "MHEL-CF256-T",	"MT_00B0000001",	"Lion cub" },
111 	{ "MTLP25208-CF256T",	"MT_00B0000001",	"Lion cub" },
112 	{ "MHEL-CF256-TC",	"MT_00B0010001",	"Lion cub" },
113 	{ "MHEA28-2TC",		"MT_0300110001",	"Lion cub" },
114 	{ "MHEA28-2SC",		"MT_0340110001",	"Lion cub" },
115 	{ "MHGA28-2T",		"MT_0210000001",	"Lion cub" },
116 	{ "MHGA28-2TC",		"MT_0300110002",	"Lion cub" },
117 	{ "MHGA28-2SC",		"MT_0340110002",	"Lion cub" },
118 	{ "MHEL-CF512-T",	"MT_00C0000001",	"Lion cub" },
119 	{ "MTLP25208-CF512T",	"MT_00C0000001",	"Lion cub" },
120 	{ "MHGA28-5T",		"MT_0220000001",	"Lion cub" },
121 	{ "375-3382-01",	"SUN0030000001",	"Sun Lion cub DDR" },
122 	{ "MHES14-XSC",		"MT_0410110001",	"Tiger" },
123 	{ "MHES14-XT",		"MT_01F0000001",	"Tiger" },
124 	{ "MHES14-XTC",		"MT_03F0110001",	"Tiger" },
125 	{ "MHES18-XS",		"MT_0260000001",	"Cheetah" },
126 	{ "MHES18-XS",		"MT_0260010001",	"Cheetah" },
127 	{ "MHES18-XSC",		"MT_03D0110001",	"Cheetah" },
128 	{ "MHES18-XSC",		"MT_03D0120001",	"Cheetah" },
129 	{ "MHES18-XSC",		"MT_03D0130001",	"Cheetah" },
130 	{ "MHES18-XT",		"MT_0230000002",	"Cheetah" },
131 	{ "MHES18-XT",		"MT_0230010002",	"Cheetah" },
132 	{ "MHES18-XTC",		"MT_03B0110001",	"Cheetah" },
133 	{ "MHES18-XTC",		"MT_03B0120001",	"Cheetah" },
134 	{ "MHES18-XTC",		"MT_03B0140001",	"Cheetah" },
135 	{ "MHGS18-XS",		"MT_0260000002",	"Cheetah" },
136 	{ "MHGS18-XSC",		"MT_03D0110002",	"Cheetah" },
137 	{ "MHGS18-XSC",		"MT_03D0120002",	"Cheetah" },
138 	{ "MHGS18-XSC",		"MT_03D0130002",	"Cheetah" },
139 	{ "MHGS18-XT",		"MT_0230000001",	"Cheetah" },
140 	{ "MHGS18-XTC",		"MT_03B0110002",	"Cheetah" },
141 	{ "MHGS18-XTC",		"MT_03B0120002",	"Cheetah" },
142 	{ "MHGS18-XTC",		"MT_03B0140002",	"Cheetah" },
143 	{ "MHXL-CF128",		"MT_0180000001",	"Cougar Cub 128" },
144 	{ "MHXL-CF128-T",	"MT_0030000001",	"Cougar Cub 128" },
145 	{ "MTLP23108-CF128T",	"MT_0030000001",	"Cougar Cub 128" },
146 	{ "MHET2X-1SC",		"MT_0280110001",	"Cougar Cub 128" },
147 	{ "MHET2X-1SC",		"MT_0280120001",	"Cougar Cub 128" },
148 	{ "MHET2X-1TC",		"MT_0270110001",	"Cougar Cub 128" },
149 	{ "MHET2X-1TC",		"MT_0270120001",	"Cougar Cub 128" },
150 	{ "MHXL-CF256-T",	"MT_0040000001",	"Cougar Cub 256" },
151 	{ "MHET2X-2SC",		"MT_02D0110001",	"Cougar Cub 256" },
152 	{ "MHET2X-2SC",		"MT_02D0120001",	"Cougar Cub 256" },
153 	{ "MHET2X-2TC",		"MT_02B0110001",	"Cougar Cub 256" },
154 	{ "MHET2X-2TC",		"MT_02B0120001",	"Cougar Cub 256" },
155 	{ "375-3481-01",	"SUN0040000001",	"Sun Cougar Cub SDR" },
156 	{ "375-3418-01",	"SUN0040000001",	"Sun Cougar Cub SDR" },
157 	{ "375-3259-01",	"SUN0010000001",	"Sun Cougar Cub 256" },
158 	{ "375-3259-03",	"SUN0010000001",	"Sun Cougar Cub 256" },
159 	{ "375-3260-03",	"SUN0020000001",	"Sun Cougar Cub 256" },
160 	{ "MHX-CE128-T",	"MT_0000000001",	"Cougar 128" },
161 	{ "MTPB23108-CE128",	"MT_0000000001",	"Cougar 128" },
162 	{ "MHX-CE256-T",	"MT_0010000001",	"Cougar 256" },
163 	{ "MTPB23108-CE256",	"MT_0010000001",	"Cougar 256" },
164 	{ "MHX-CE512-T",	"MT_0050000001",	"Cougar 512" },
165 	{ "MTPB23108-CE512",	"MT_0050000001",	"Cougar 512" },
166 	{ "MHEH28-XSC",		"MT_04C0110001",	"Eagle SDR" },
167 	{ "MHEH28-XSC",		"MT_04C0130005",	"Eagle SDR" },
168 	{ "MHEH28-XTC",		"MT_04A0110001",	"Eagle SDR" },
169 	{ "MHEH28-XTC",		"MT_04A0130005",	"Eagle SDR" },
170 	{ "MHGH28-XSC",		"MT_04C0110002",	"Eagle DDR" },
171 	{ "MHGH28-XSC",		"MT_04C0120002",	"Eagle DDR" },
172 	{ "MHGH28-XSC",		"MT_04C0140005",	"Eagle DDR" },
173 	{ "MHGH28-XTC",		"MT_04A0110002",	"Eagle DDR" },
174 	{ "MHGH28-XTC",		"MT_04A0120002",	"Eagle DDR" },
175 	{ "MHGH28-XTC",		"MT_04A0140005",	"Eagle DDR" },
176 	{ "X1289A-Z",		"SUN0010010001",	"Sun IB NEM DDR" },
177 	{ "375-3548-01",	"SUN0060000001", "Sun IB EM DDR X4216A-Z" },
178 	{ "375-3549-01",	"SUN0070000001", "Sun PCIe DDR X4217A" },
179 	{ "375-3549-01",	"SUN0070130001", "Sun Eagle DDR" },
180 	{ "375-3481-01",	"SUN0050000001",	"Sun PCIe EM SDR" },
181 	{ "375-3439-01",	"SUN0051000001",	"Sun PUMA" },
182 	{ "MHGH29-XSC",		"MT_0A60110002", "Eagle DDR PCIe Gen 2.0" },
183 	{ "MHGH29-XSC",		"MT_0A60120005", "Eagle DDR PCIe Gen 2.0" },
184 	{ "MHGH29-XTC",		"MT_0A50110002", "Eagle DDR PCIe Gen 2.0" },
185 	{ "MHGH29-XTC",		"MT_0A50120005", "Eagle DDR PCIe Gen 2.0" },
186 	{ "375-3605-01",	"SUN0160000001",	"Sun QMirage " },
187 	{ "375-3605-01",	"SUN0160000002",	"Sun QMirage " },
188 	{ "375-3697-01",	"SUN0160000002",	"Sun QMirage " },
189 	{ "375-3606-01",	"SUN0150000001",	"Sun Falcon QDR" },
190 	{ "375-3606-02",	"SUN0150000009",	"Sun Falcon QDR" },
191 	{ "375-3606-03",	"SUN0150000009",	"Sun Falcon QDR" },
192 	{ "375-3606-02",	"SUN0170000009",	"Sun Falcon QDR" },
193 	{ "375-3696-01",	"SUN0170000009",	"Sun Falcon QDR" },
194 	{ "MHJH29-XTC",		"MT_04E0110003",	"Eagle QDR" },
195 	{ "MHJH29-XSC",		"MT_0500120005", "Eagle QDR PCIe Gen 2.0" },
196 	{ "MHQH29-XTC",		"MT_04E0120005", "Eagle QDR PCIe Gen 2.0" },
197 	{ "MHQH19-XTC",		"MT_0C40110009", "Falcon QDR PCIe Gen 2.0" },
198 	{ "MHQH29-XTC",		"MT_0BB0110003", "Falcon QDR PCIe Gen 2.0" },
199 	{ "MHQH29-XTC",		"MT_0BB0120003", "Falcon QDR PCIe Gen 2.0" },
200 	{ "375-3551-05",	"SUN0080000001",	"Sun C48-IB-NEM" },
201 	{ "MHEH28B-XSR",	"MT_0D10110001", "Osprey CX-2 PCIe Gen 2.0" },
202 	{ "MHEH28B-XTR",	"MT_0D20110001", "Osprey CX-2 PCIe Gen 2.0" },
203 	{ "MHGH28B-XSR",	"MT_0D10110002", "Osprey CX-2 PCIe Gen 2.0" },
204 	{ "MHGH28B-XTR",	"MT_0D20110002", "Osprey CX-2 PCIe Gen 2.0" },
205 	{ "MHGH18B-XTR",	"MT_0D30110002", "Osprey CX-2 PCIe Gen 2.0" },
206 	{ "MNEH28B-XSR",	"MT_0D40110004", "Osprey CX-2 PCIe Gen 2.0" },
207 	{ "MNEH28B-XTR",	"MT_0D50110004", "Osprey CX-2 PCIe Gen 2.0" },
208 	{ "MNEH29B-XSR",	"MT_0D40110010", "Osprey CX-2 PCIe Gen 2.0" },
209 	{ "MNEH29B-XTR",	"MT_0D50110010", "Osprey CX-2 PCIe Gen 2.0" },
210 	{ "MHGH29B-XSR",	"MT_0D10110008", "Osprey CX-2 PCIe Gen 2.0" },
211 	{ "MHGH29B-XTR",	"MT_0D20110008", "Osprey CX-2 PCIe Gen 2.0" },
212 	{ "MHJH29B-XSR",	"MT_0D10110009", "Osprey CX-2 PCIe Gen 2.0" },
213 	{ "MHJH29B-XSR",	"MT_0D10120009", "Osprey CX-2 PCIe Gen 2.0" },
214 	{ "MHJH29B-XTR",	"MT_0D20110009", "Osprey CX-2 PCIe Gen 2.0" },
215 	{ "MHJH29B-XTR",	"MT_0D20120009", "Osprey CX-2 PCIe Gen 2.0" },
216 	{ "MHGH19B-XSR",	"MT_0D60110008", "Osprey CX-2 PCIe Gen 2.0" },
217 	{ "MHGH19B-XTR",	"MT_0D30110008", "Osprey CX-2 PCIe Gen 2.0" },
218 	{ "MHJH19B-XTR",	"MT_0D30110009", "Osprey CX-2 PCIe Gen 2.0" },
219 	{ "MHQH29B-XSR",	"MT_0D70110009", "Osprey CX-2 PCIe Gen 2.0" },
220 	{ "MHQH29B-XTR",	"MT_0D80110009", "Osprey CX-2 PCIe Gen 2.0" },
221 	{ "MHQH29B-XTR",	"MT_0D80120009", "Osprey CX-2 PCIe Gen 2.0" },
222 	{ "MHQH29B-XTR",	"MT_0D80130009", "Osprey CX-2 PCIe Gen 2.0" },
223 	{ "MHQH29B-XTR",	"MT_0E30110009", "Osprey CX-2 PCIe Gen 2.0" },
224 	{ "MHRH29B-XSR",	"MT_0D70110008", "Osprey CX-2 PCIe Gen 2.0" },
225 	{ "MHRH29B-XTR",	"MT_0D80110008", "Osprey CX-2 PCIe Gen 2.0" },
226 	{ "MHQH19B-XTR",	"MT_0D90110009", "Osprey CX-2 PCIe Gen 2.0" },
227 	{ "MHRH19B-XSR",	"MT_0E40110009", "Osprey CX-2 PCIe Gen 2.0" },
228 	{ "MHRH19B-XTR",	"MT_0D90110008", "Osprey CX-2 PCIe Gen 2.0" },
229 	{ "MNPH28C-XSR",	"MT_0DA0110004", "Osprey CX-2 PCIe Gen 2.0" },
230 	{ "MNPH28C-XTR",	"MT_0DB0110004", "Osprey CX-2 PCIe Gen 2.0" },
231 	{ "MNPH29C-XSR",	"MT_0DA0110010", "Osprey CX-2 PCIe Gen 2.0" },
232 	{ "MNPH29C-XTR",	"MT_0DB0110010", "Osprey CX-2 PCIe Gen 2.0" },
233 	{ "MNPH29C-XTR",	"MT_0DB0120010", "Osprey CX-2 PCIe Gen 2.0" },
234 	{ "MNPH29C-XTR",	"MT_0DB0130010", "Osprey CX-2 PCIe Gen 2.0" },
235 	{ "MNZH29-XSR",		"MT_0DC0110009", "Osprey CX-2 PCIe Gen 2.0" },
236 	{ "MNZH29-XTR",		"MT_0DD0110009", "Osprey CX-2 PCIe Gen 2.0" },
237 	{ "MNZH29-XTR",		"MT_0DD0120009", "Osprey CX-2 PCIe Gen 2.0" },
238 	{ "MHQH19B-XNR",	"MT_0DF0110009", "Osprey CX-2 PCIe Gen 2.0" },
239 	{ "MHQH19B-XNR",	"MT_0DF0120009", "Osprey CX-2 PCIe Gen 2.0" },
240 	{ "MNQH19-XTR",		"MT_0D80110017", "Osprey CX-2 PCIe Gen 2.0" },
241 	{ "MNQH19C-XTR",	"MT_0E20110017", "Osprey CX-2 PCIe Gen 2.0" },
242 	{ "MHZH29B-XSR",	"MT_0E80110009", "Osprey CX-2 PCIe Gen 2.0" },
243 	{ "MHZH29B-XTR",	"MT_0E90110009", "Osprey CX-2 PCIe Gen 2.0" },
244 	{ "MHZH29B-XTR",	"MT_0E90110009", "Osprey CX-2 PCIe Gen 2.0" },
245 	{ "MHQA19-XTR",		"MT_0EA0110009", "Osprey CX-2 PCIe Gen 2.0" },
246 	{ "MHRA19-XTR",		"MT_0EB0110008", "Osprey CX-2 PCIe Gen 2.0" },
247 	{ "MHQH29C-XTR",	"MT_0EF0110009", "Osprey CX-2 PCIe Gen 2.0" },
248 	{ "MHQH29C-XSR",	"MT_0F00110009", "Osprey CX-2 PCIe Gen 2.0" },
249 	{ "MHRH29C-XTR",	"MT_0F10110008", "Osprey CX-2 PCIe Gen 2.0" },
250 	{ "MHRH29C-XSR",	"MT_0F20110008", "Osprey CX-2 PCIe Gen 2.0" },
251 	{ "MHPH29D-XTR",	"MT_0F30110010", "Osprey CX-2 PCIe Gen 2.0" },
252 	{ "MHPH29D-XSR",	"MT_0F40110010", "Osprey CX-2 PCIe Gen 2.0" },
253 	{ "MNPA19-XTR",		"MT_0F60110010", "Osprey CX-2 PCIe Gen 2.0" },
254 	{ "MNPA19-XSR",		"MT_0F70110010", "Osprey CX-2 PCIe Gen 2.0" }
255 };
256 
257 /* Get mlx_mdr[] array size */
258 #define	MLX_SZ_MLX_MDR		sizeof (mlx_mdr)
259 #define	MLX_SZ_MLX_MDR_STRUCT	sizeof (mlx_mdr[0])
260 
261 #define	MLX_MAX_ID		MLX_SZ_MLX_MDR/MLX_SZ_MLX_MDR_STRUCT
262 #define	MLX_PSID_SZ		16
263 #define	MLX_STR_ID_SZ		64
264 
265 #ifdef __cplusplus
266 }
267 #endif
268 
269 #endif /* _HDRS_MELLANOX_H */
270