xref: /illumos-gate/usr/src/cmd/fwflash/plugins/hdrs/MELLANOX.h (revision 8d0c3d29bb99f6521f2dc5058a7e4debebad7899)
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-3259-01",	"SUN0010000001",	"Sun Cougar Cub 256" },
157 	{ "375-3259-03",	"SUN0010000001",	"Sun Cougar Cub 256" },
158 	{ "375-3260-03",	"SUN0020000001",	"Sun Cougar Cub 256" },
159 	{ "MHX-CE128-T",	"MT_0000000001",	"Cougar 128" },
160 	{ "MTPB23108-CE128",	"MT_0000000001",	"Cougar 128" },
161 	{ "MHX-CE256-T",	"MT_0010000001",	"Cougar 256" },
162 	{ "MTPB23108-CE256",	"MT_0010000001",	"Cougar 256" },
163 	{ "MHX-CE512-T",	"MT_0050000001",	"Cougar 512" },
164 	{ "MTPB23108-CE512",	"MT_0050000001",	"Cougar 512" },
165 	{ "MHEH28-XSC",		"MT_04C0110001",	"Eagle SDR" },
166 	{ "MHEH28-XSC",		"MT_04C0130005",	"Eagle SDR" },
167 	{ "MHEH28-XTC",		"MT_04A0110001",	"Eagle SDR" },
168 	{ "MHEH28-XTC",		"MT_04A0130005",	"Eagle SDR" },
169 	{ "MHGH28-XSC",		"MT_04C0110002",	"Eagle DDR" },
170 	{ "MHGH28-XSC",		"MT_04C0120002",	"Eagle DDR" },
171 	{ "MHGH28-XSC",		"MT_04C0140005",	"Eagle DDR" },
172 	{ "MHGH28-XTC",		"MT_04A0110002",	"Eagle DDR" },
173 	{ "MHGH28-XTC",		"MT_04A0120002",	"Eagle DDR" },
174 	{ "MHGH28-XTC",		"MT_04A0140005",	"Eagle DDR" },
175 	{ "X1289A-Z",		"SUN0010010001",	"Sun IB NEM DDR" },
176 	{ "375-3548-01",	"SUN0060000001", "Sun IB EM DDR X4216A-Z" },
177 	{ "375-3549-01",	"SUN0070000001", "Sun PCIe DDR X4217A" },
178 	{ "375-3549-01",	"SUN0070130001", "Sun Eagle DDR" },
179 	{ "375-3481-01",	"SUN0050000001",	"Sun PCIe EM SDR" },
180 	{ "375-3439-01",	"SUN0051000001",	"Sun PUMA" },
181 	{ "MHGH29-XSC",		"MT_0A60110002", "Eagle DDR PCIe Gen 2.0" },
182 	{ "MHGH29-XSC",		"MT_0A60120005", "Eagle DDR PCIe Gen 2.0" },
183 	{ "MHGH29-XTC",		"MT_0A50110002", "Eagle DDR PCIe Gen 2.0" },
184 	{ "MHGH29-XTC",		"MT_0A50120005", "Eagle DDR PCIe Gen 2.0" },
185 	{ "375-3605-01",	"SUN0160000001",	"Sun Mirage QDR" },
186 	{ "375-3606-01",	"SUN0150000001",	"Sun Falcon QDR" },
187 	{ "375-3606-02",	"SUN0150000009",	"Sun Falcon QDR" },
188 	{ "375-3606-03",	"SUN0150000009",	"Sun Falcon QDR" },
189 	{ "MHJH29-XTC",		"MT_04E0110003",	"Eagle QDR" },
190 	{ "MHJH29-XSC",		"MT_0500120005", "Eagle QDR PCIe Gen 2.0" },
191 	{ "MHQH29-XTC",		"MT_04E0120005", "Eagle QDR PCIe Gen 2.0" },
192 	{ "MHQH19-XTC",		"MT_0C40110009", "Falcon QDR PCIe Gen 2.0" },
193 	{ "MHQH29-XTC",		"MT_0BB0110003", "Falcon QDR PCIe Gen 2.0" },
194 	{ "MHQH29-XTC",		"MT_0BB0120003", "Falcon QDR PCIe Gen 2.0" },
195 	{ "375-3551-05",	"SUN0080000001",	"Sun C48-IB-NEM" },
196 	{ "MHEH28B-XSR",	"MT_0D10110001", "Osprey CX-2 PCIe Gen 2.0" },
197 	{ "MHEH28B-XTR",	"MT_0D20110001", "Osprey CX-2 PCIe Gen 2.0" },
198 	{ "MHGH28B-XSR",	"MT_0D10110002", "Osprey CX-2 PCIe Gen 2.0" },
199 	{ "MHGH28B-XTR",	"MT_0D20110002", "Osprey CX-2 PCIe Gen 2.0" },
200 	{ "MHGH18B-XTR",	"MT_0D30110002", "Osprey CX-2 PCIe Gen 2.0" },
201 	{ "MNEH28B-XSR",	"MT_0D40110004", "Osprey CX-2 PCIe Gen 2.0" },
202 	{ "MNEH28B-XTR",	"MT_0D50110004", "Osprey CX-2 PCIe Gen 2.0" },
203 	{ "MNEH29B-XSR",	"MT_0D40110010", "Osprey CX-2 PCIe Gen 2.0" },
204 	{ "MNEH29B-XTR",	"MT_0D50110010", "Osprey CX-2 PCIe Gen 2.0" },
205 	{ "MHGH29B-XSR",	"MT_0D10110008", "Osprey CX-2 PCIe Gen 2.0" },
206 	{ "MHGH29B-XTR",	"MT_0D20110008", "Osprey CX-2 PCIe Gen 2.0" },
207 	{ "MHJH29B-XSR",	"MT_0D10110009", "Osprey CX-2 PCIe Gen 2.0" },
208 	{ "MHJH29B-XTR",	"MT_0D20110009", "Osprey CX-2 PCIe Gen 2.0" },
209 	{ "MHGH19B-XSR",	"MT_0D60110008", "Osprey CX-2 PCIe Gen 2.0" },
210 	{ "MHGH19B-XTR",	"MT_0D30110008", "Osprey CX-2 PCIe Gen 2.0" },
211 	{ "MHJH19B-XTR",	"MT_0D30110009", "Osprey CX-2 PCIe Gen 2.0" },
212 	{ "MHQH29B-XSR",	"MT_0D70110009", "Osprey CX-2 PCIe Gen 2.0" },
213 	{ "MHQH29B-XTR",	"MT_0D80110009", "Osprey CX-2 PCIe Gen 2.0" },
214 	{ "MHRH29B-XSR",	"MT_0D70110008", "Osprey CX-2 PCIe Gen 2.0" },
215 	{ "MHRH29B-XTR",	"MT_0D80110008", "Osprey CX-2 PCIe Gen 2.0" },
216 	{ "MHQH19B-XTR",	"MT_0D90110009", "Osprey CX-2 PCIe Gen 2.0" },
217 	{ "MHRH19B-XTR",	"MT_0D90110008", "Osprey CX-2 PCIe Gen 2.0" },
218 	{ "MNPH28C-XSR",	"MT_0DA0110004", "Osprey CX-2 PCIe Gen 2.0" },
219 	{ "MNPH28C-XTR",	"MT_0DB0110004", "Osprey CX-2 PCIe Gen 2.0" },
220 	{ "MNPH29C-XSR",	"MT_0DA0110010", "Osprey CX-2 PCIe Gen 2.0" },
221 	{ "MNPH29C-XTR",	"MT_0DB0110010", "Osprey CX-2 PCIe Gen 2.0" },
222 	{ "MNZH29-XSR",		"MT_0DC0110009", "Osprey CX-2 PCIe Gen 2.0" },
223 	{ "MNZH29-XTR",		"MT_0DD0110009", "Osprey CX-2 PCIe Gen 2.0" },
224 	{ "MHQH19B-XNR",	"MT_0DF0110009", "Osprey CX-2 PCIe Gen 2.0" },
225 	{ "MNQH19-XTR",		"MT_0D80110017", "Osprey CX-2 PCIe Gen 2.0" }
226 };
227 
228 /* Get mlx_mdr[] array size */
229 #define	MLX_SZ_MLX_MDR		sizeof (mlx_mdr)
230 #define	MLX_SZ_MLX_MDR_STRUCT	sizeof (mlx_mdr[0])
231 
232 #define	MLX_MAX_ID		MLX_SZ_MLX_MDR/MLX_SZ_MLX_MDR_STRUCT
233 #define	MLX_PSID_SZ		16
234 #define	MLX_STR_ID_SZ		64
235 
236 #ifdef __cplusplus
237 }
238 #endif
239 
240 #endif /* _HDRS_MELLANOX_H */
241