xref: /titanic_41/usr/src/cmd/fwflash/plugins/hdrs/MELLANOX.h (revision bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2eb)
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 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _HDRS_MELLANOX_H
28 #define	_HDRS_MELLANOX_H
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /*
36  * MELLANOX.h
37  *
38  * This file contain common information related to Mellanox technologies
39  * HCA cards.
40  */
41 #define	SUNW_OUI		0x0003baULL
42 #define	MLX_OUI			0x0002c9ULL
43 #define	MLX_DEFAULT_NODE_GUID	0x2c9000100d050ULL
44 #define	MLX_DEFAULT_P1_GUID	0x2c9000100d051ULL
45 #define	MLX_DEFAULT_P2_GUID	0x2c9000100d052ULL
46 #define	MLX_DEFAULT_SYSIMG_GUID	0x2c9000100d053ULL
47 
48 /* How many bits to shift and leave just the OUI */
49 #define	OUISHIFT		40
50 
51 #define	MLX_VPR_VIDLEN		9	/* "MELLANOX" + '\0' */
52 #define	MLX_VPR_REVLEN		21	/* "%04x.%04x.%04x: %04x" + '\0' */
53 
54 #define	FWFLASH_IB_MAGIC_NUMBER		0xF00B0021
55 
56 /* Numerically largest OUI that's presently assigned */
57 #define	TAVOR_MAX_OUI			0xacde48
58 
59 #define	FWFLASH_IB_STATE_NONE		0x00
60 #define	FWFLASH_IB_STATE_IMAGE_PRI	0x01
61 #define	FWFLASH_IB_STATE_IMAGE_SEC	0x02
62 #define	FWFLASH_IB_STATE_MMAP		0x04
63 #define	FWFLASH_IB_STATE_GUIDN		0x10
64 #define	FWFLASH_IB_STATE_GUID1		0x20
65 #define	FWFLASH_IB_STATE_GUID2		0x40
66 #define	FWFLASH_IB_STATE_GUIDS		0x80
67 
68 #define	FWFLASH_IB_STATE_IMAGE		FWFLASH_IB_STATE_IMAGE_PRI
69 
70 #define	FWFLASH_IB_STATE_PFI_IMAGE	FWFLASH_IB_STATE_IMAGE_PRI
71 #define	FWFLASH_IB_STATE_SFI_IMAGE	FWFLASH_IB_STATE_IMAGE_SEC
72 
73 /*
74  * Structure to hold the part number, PSID, and string ID
75  * for an HCA card.
76  */
77 typedef struct mlx_mdr_s {
78 	char *mlx_pn;
79 	char *mlx_psid;
80 	char *mlx_id;
81 } mlx_mdr_t;
82 
83 /*
84  * Magic decoder ring for matching HCA hardware/firmware.
85  * Part Number / PSID / String ID
86  */
87 mlx_mdr_t mlx_mdr[] = {
88 	/* Part No		PSID			Card ID */
89 	{ "MHEA28-XS",		"MT_0250000001",	"Lion mini" },
90 	{ "MHEA28-XSC",		"MT_0390110001",	"Lion mini" },
91 	{ "MHEA28-XT",		"MT_0150000001",	"Lion mini" },
92 	{ "MHEA28-XTC",		"MT_0370110001",	"Lion mini" },
93 	{ "MHGA28-XT",		"MT_0150000002",	"Lion mini" },
94 	{ "MHGA28-XTC",		"MT_0370110002",	"Lion mini" },
95 	{ "MHGA28-XTC",		"MT_0370130002",	"Lion mini" },
96 	{ "MHGA28-XS",		"MT_0250000002",	"Lion mini" },
97 	{ "MHGA28-XSC",		"MT_0390110002",	"Lion mini" },
98 	{ "MHGA28-XSC",		"MT_0390130002",	"Lion mini" },
99 	{ "MHEL-CF128",		"MT_0190000001",	"Lion cub" },
100 	{ "MHEL-CF128-T",	"MT_00A0000001",	"Lion cub" },
101 	{ "MTLP25208-CF128T",	"MT_00A0000001",	"Lion cub" },
102 	{ "MHEL-CF128-TC",	"MT_00A0010001",	"Lion cub" },
103 	{ "MHEL-CF128-TC",	"MT_0140010001",	"Lion cub" },
104 	{ "MHEL-CF128-SC",	"MT_0190010001",	"Lion cub" },
105 	{ "MHEA28-1TC",		"MT_02F0110001",	"Lion cub" },
106 	{ "MHEA28-1SC",		"MT_0330110001",	"Lion cub" },
107 	{ "MHGA28-1T",		"MT_0200000001",	"Lion cub" },
108 	{ "MHGA28-1TC",		"MT_02F0110002",	"Lion cub" },
109 	{ "MHGA28-1SC",		"MT_0330110002",	"Lion cub" },
110 	{ "MHGA28-1S",		"MT_0430000001",	"Lion cub" },
111 	{ "MHEL-CF256-T",	"MT_00B0000001",	"Lion cub" },
112 	{ "MTLP25208-CF256T",	"MT_00B0000001",	"Lion cub" },
113 	{ "MHEL-CF256-TC",	"MT_00B0010001",	"Lion cub" },
114 	{ "MHEA28-2TC",		"MT_0300110001",	"Lion cub" },
115 	{ "MHEA28-2SC",		"MT_0340110001",	"Lion cub" },
116 	{ "MHGA28-2T",		"MT_0210000001",	"Lion cub" },
117 	{ "MHGA28-2TC",		"MT_0300110002",	"Lion cub" },
118 	{ "MHGA28-2SC",		"MT_0340110002",	"Lion cub" },
119 	{ "MHEL-CF512-T",	"MT_00C0000001",	"Lion cub" },
120 	{ "MTLP25208-CF512T",	"MT_00C0000001",	"Lion cub" },
121 	{ "MHGA28-5T",		"MT_0220000001",	"Lion cub" },
122 	{ "375-3382-01",	"SUN0030000001",	"Sun Lion cub DDR" },
123 	{ "MHES14-XSC",		"MT_0410110001",	"Tiger" },
124 	{ "MHES14-XT",		"MT_01F0000001",	"Tiger" },
125 	{ "MHES14-XTC",		"MT_03F0110001",	"Tiger" },
126 	{ "MHES18-XS",		"MT_0260000001",	"Cheetah" },
127 	{ "MHES18-XS",		"MT_0260010001",	"Cheetah" },
128 	{ "MHES18-XSC",		"MT_03D0110001",	"Cheetah" },
129 	{ "MHES18-XSC",		"MT_03D0120001",	"Cheetah" },
130 	{ "MHES18-XSC",		"MT_03D0130001",	"Cheetah" },
131 	{ "MHES18-XT",		"MT_0230000002",	"Cheetah" },
132 	{ "MHES18-XT",		"MT_0230010002",	"Cheetah" },
133 	{ "MHES18-XTC",		"MT_03B0110001",	"Cheetah" },
134 	{ "MHES18-XTC",		"MT_03B0120001",	"Cheetah" },
135 	{ "MHES18-XTC",		"MT_03B0140001",	"Cheetah" },
136 	{ "MHGS18-XS",		"MT_0260000002",	"Cheetah" },
137 	{ "MHGS18-XSC",		"MT_03D0110002",	"Cheetah" },
138 	{ "MHGS18-XSC",		"MT_03D0120002",	"Cheetah" },
139 	{ "MHGS18-XSC",		"MT_03D0130002",	"Cheetah" },
140 	{ "MHGS18-XT",		"MT_0230000001",	"Cheetah" },
141 	{ "MHGS18-XTC",		"MT_03B0110002",	"Cheetah" },
142 	{ "MHGS18-XTC",		"MT_03B0120002",	"Cheetah" },
143 	{ "MHGS18-XTC",		"MT_03B0140002",	"Cheetah" },
144 	{ "MHXL-CF128",		"MT_0180000001",	"Cougar Cub 128" },
145 	{ "MHXL-CF128-T",	"MT_0030000001",	"Cougar Cub 128" },
146 	{ "MTLP23108-CF128T",	"MT_0030000001",	"Cougar Cub 128" },
147 	{ "MHET2X-1SC",		"MT_0280110001",	"Cougar Cub 128" },
148 	{ "MHET2X-1SC",		"MT_0280120001",	"Cougar Cub 128" },
149 	{ "MHET2X-1TC",		"MT_0270110001",	"Cougar Cub 128" },
150 	{ "MHET2X-1TC",		"MT_0270120001",	"Cougar Cub 128" },
151 	{ "MHXL-CF256-T",	"MT_0040000001",	"Cougar Cub 256" },
152 	{ "MHET2X-2SC",		"MT_02D0110001",	"Cougar Cub 256" },
153 	{ "MHET2X-2SC",		"MT_02D0120001",	"Cougar Cub 256" },
154 	{ "MHET2X-2TC",		"MT_02B0110001",	"Cougar Cub 256" },
155 	{ "MHET2X-2TC",		"MT_02B0120001",	"Cougar Cub 256" },
156 	{ "375-3481-01",	"SUN0040000001",	"Sun Cougar Cub SDR" },
157 	{ "MHX-CE128-T",	"MT_0000000001",	"Cougar 128" },
158 	{ "MTPB23108-CE128",	"MT_0000000001",	"Cougar 128" },
159 	{ "MHX-CE256-T",	"MT_0010000001",	"Cougar 256" },
160 	{ "MTPB23108-CE256",	"MT_0010000001",	"Cougar 256" },
161 	{ "MHX-CE512-T",	"MT_0050000001",	"Cougar 512" },
162 	{ "MTPB23108-CE512",	"MT_0050000001",	"Cougar 512" },
163 	{ "MHEH28-XSC",		"MT_04C0110001",	"Eagle SDR" },
164 	{ "MHEH28-XSC",		"MT_04C0130005",	"Eagle SDR" },
165 	{ "MHEH28-XTC",		"MT_04A0110001",	"Eagle SDR" },
166 	{ "MHEH28-XTC",		"MT_04A0130005",	"Eagle SDR" },
167 	{ "MHGH28-XSC",		"MT_04C0110002",	"Eagle DDR" },
168 	{ "MHGH28-XSC",		"MT_04C0120002",	"Eagle DDR" },
169 	{ "MHGH28-XSC",		"MT_04C0140005",	"Eagle DDR" },
170 	{ "MHGH28-XTC",		"MT_04A0110002",	"Eagle DDR" },
171 	{ "MHGH28-XTC",		"MT_04A0120002",	"Eagle DDR" },
172 	{ "MHGH28-XTC",		"MT_04A0140005",	"Eagle DDR" },
173 	{ "X1289A-Z",		"SUN0010010001",	"Sun IB NEM DDR" },
174 	{ "375-3548-01",	"SUN0060000001", "Sun IB EM DDR X4216A-Z" },
175 	{ "375-3549-01",	"SUN0070000001", "Sun PCIe DDR X4217A" },
176 	{ "375-3481-01",	"SUN0050000001",	"Sun PCIe EM SDR" },
177 	{ "MHGH29-XSC",		"MT_0A60110002", "Eagle DDR PCIe Gen 2.0" },
178 	{ "MHGH29-XSC",		"MT_0A60120005", "Eagle DDR PCIe Gen 2.0" },
179 	{ "MHGH29-XTC",		"MT_0A50110002", "Eagle DDR PCIe Gen 2.0" },
180 	{ "MHGH29-XTC",		"MT_0A50120005", "Eagle DDR PCIe Gen 2.0" },
181 	{ "375-3605-01",	"SUN0160000001",	"Sun Mirage QDR" },
182 	{ "375-3606-01",	"SUN0150000001",	"Sun Falcon QDR" },
183 	{ "MHJH29-XTC",		"MT_04E0110003",	"Eagle QDR" },
184 	{ "MHJH29-XSC",		"MT_0500120005", "Eagle QDR PCIe Gen 2.0" },
185 	{ "MHQH29-XTC",		"MT_04E0120005", "Eagle QDR PCIe Gen 2.0" },
186 	{ "MHQH19-XTC",		"MT_0C40110009", "Falcon QDR PCIe Gen 2.0" },
187 	{ "MHQH29-XTC",		"MT_0BB0110003", "Falcon QDR PCIe Gen 2.0" },
188 	{ "MHQH29-XTC",		"MT_0BB0120003", "Falcon QDR PCIe Gen 2.0" },
189 	{ "375-3551-05",	"SUN0080000001",	"Sun C48-IB-NEM" }
190 };
191 
192 /* Get mlx_mdr[] array size */
193 #define	MLX_SZ_MLX_MDR		sizeof (mlx_mdr)
194 #define	MLX_SZ_MLX_MDR_STRUCT	sizeof (mlx_mdr[0])
195 
196 #define	MLX_MAX_ID		MLX_SZ_MLX_MDR/MLX_SZ_MLX_MDR_STRUCT
197 #define	MLX_PSID_SZ		16
198 #define	MLX_STR_ID_SZ		64
199 
200 #ifdef __cplusplus
201 }
202 #endif
203 
204 #endif /* _HDRS_MELLANOX_H */
205