1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright 2000-2014 Avago Technologies. All rights reserved.
7 * Title: MPI diagnostic tool structures and definitions
8 * Creation Date: March 26, 2007
10 * mpi2_tool.h Version: 02.00.14
15 * Date Version Description
16 * -------- -------- ------------------------------------------------------
17 * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A.
18 * 12-18-07 02.00.01 Added Diagnostic Buffer Post and Diagnostic Release
19 * structures and defines.
20 * 02-29-08 02.00.02 Modified various names to make them 32-character unique.
21 * 05-06-09 02.00.03 Added ISTWI Read Write Tool and Diagnostic CLI Tool.
22 * 07-30-09 02.00.04 Added ExtendedType field to DiagnosticBufferPost request
24 * Added MPI2_DIAG_BUF_TYPE_EXTENDED.
25 * Incremented MPI2_DIAG_BUF_TYPE_COUNT.
26 * 05-12-10 02.00.05 Added Diagnostic Data Upload tool.
27 * 08-11-10 02.00.06 Added defines that were missing for Diagnostic Buffer
29 * 05-25-11 02.00.07 Added Flags field and related defines to
30 * MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST.
31 * 11-18-11 02.00.08 Incorporating additions for MPI v2.5.
32 * 07-10-12 02.00.09 Add MPI v2.5 Toolbox Diagnostic CLI Tool Request
34 * 07-26-12 02.00.10 Modified MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST so that
35 * it uses MPI Chain SGE as well as MPI Simple SGE.
36 * 08-19-13 02.00.11 Added MPI2_TOOLBOX_TEXT_DISPLAY_TOOL and related info.
37 * 01-08-14 02.00.12 Added MPI2_TOOLBOX_CLEAN_BIT26_PRODUCT_SPECIFIC.
38 * 11-18-14 02.00.13 Updated copyright information.
39 * 08-25-16 02.00.14 Added new values for the Flags field of Toolbox Clean
40 * Tool Request Message.
41 * --------------------------------------------------------------------------
47 /*****************************************************************************
51 *****************************************************************************/
53 /*defines for the Tools */
54 #define MPI2_TOOLBOX_CLEAN_TOOL (0x00)
55 #define MPI2_TOOLBOX_MEMORY_MOVE_TOOL (0x01)
56 #define MPI2_TOOLBOX_DIAG_DATA_UPLOAD_TOOL (0x02)
57 #define MPI2_TOOLBOX_ISTWI_READ_WRITE_TOOL (0x03)
58 #define MPI2_TOOLBOX_BEACON_TOOL (0x05)
59 #define MPI2_TOOLBOX_DIAGNOSTIC_CLI_TOOL (0x06)
60 #define MPI2_TOOLBOX_TEXT_DISPLAY_TOOL (0x07)
62 /****************************************************************************
64 ****************************************************************************/
66 typedef struct _MPI2_TOOLBOX_REPLY
{
68 U8 Reserved1
; /*0x01 */
69 U8 MsgLength
; /*0x02 */
70 U8 Function
; /*0x03 */
71 U16 Reserved2
; /*0x04 */
72 U8 Reserved3
; /*0x06 */
73 U8 MsgFlags
; /*0x07 */
76 U16 Reserved4
; /*0x0A */
77 U16 Reserved5
; /*0x0C */
78 U16 IOCStatus
; /*0x0E */
79 U32 IOCLogInfo
; /*0x10 */
80 } MPI2_TOOLBOX_REPLY
, *PTR_MPI2_TOOLBOX_REPLY
,
81 Mpi2ToolboxReply_t
, *pMpi2ToolboxReply_t
;
83 /****************************************************************************
84 * Toolbox Clean Tool request
85 ****************************************************************************/
87 typedef struct _MPI2_TOOLBOX_CLEAN_REQUEST
{
89 U8 Reserved1
; /*0x01 */
90 U8 ChainOffset
; /*0x02 */
91 U8 Function
; /*0x03 */
92 U16 Reserved2
; /*0x04 */
93 U8 Reserved3
; /*0x06 */
94 U8 MsgFlags
; /*0x07 */
97 U16 Reserved4
; /*0x0A */
99 } MPI2_TOOLBOX_CLEAN_REQUEST
, *PTR_MPI2_TOOLBOX_CLEAN_REQUEST
,
100 Mpi2ToolboxCleanRequest_t
, *pMpi2ToolboxCleanRequest_t
;
102 /*values for the Flags field */
103 #define MPI2_TOOLBOX_CLEAN_BOOT_SERVICES (0x80000000)
104 #define MPI2_TOOLBOX_CLEAN_PERSIST_MANUFACT_PAGES (0x40000000)
105 #define MPI2_TOOLBOX_CLEAN_OTHER_PERSIST_PAGES (0x20000000)
106 #define MPI2_TOOLBOX_CLEAN_FW_CURRENT (0x10000000)
107 #define MPI2_TOOLBOX_CLEAN_FW_BACKUP (0x08000000)
108 #define MPI2_TOOLBOX_CLEAN_BIT26_PRODUCT_SPECIFIC (0x04000000)
109 #define MPI2_TOOLBOX_CLEAN_MEGARAID (0x02000000)
110 #define MPI2_TOOLBOX_CLEAN_INITIALIZATION (0x01000000)
111 #define MPI2_TOOLBOX_CLEAN_SBR (0x00800000)
112 #define MPI2_TOOLBOX_CLEAN_SBR_BACKUP (0x00400000)
113 #define MPI2_TOOLBOX_CLEAN_HIIM (0x00200000)
114 #define MPI2_TOOLBOX_CLEAN_HIIA (0x00100000)
115 #define MPI2_TOOLBOX_CLEAN_CTLR (0x00080000)
116 #define MPI2_TOOLBOX_CLEAN_IMR_FIRMWARE (0x00040000)
117 #define MPI2_TOOLBOX_CLEAN_MR_NVDATA (0x00020000)
118 #define MPI2_TOOLBOX_CLEAN_RESERVED_5_16 (0x0001FFE0)
119 #define MPI2_TOOLBOX_CLEAN_ALL_BUT_MPB (0x00000010)
120 #define MPI2_TOOLBOX_CLEAN_ENTIRE_FLASH (0x00000008)
121 #define MPI2_TOOLBOX_CLEAN_FLASH (0x00000004)
122 #define MPI2_TOOLBOX_CLEAN_SEEPROM (0x00000002)
123 #define MPI2_TOOLBOX_CLEAN_NVSRAM (0x00000001)
125 /****************************************************************************
126 * Toolbox Memory Move request
127 ****************************************************************************/
129 typedef struct _MPI2_TOOLBOX_MEM_MOVE_REQUEST
{
131 U8 Reserved1
; /*0x01 */
132 U8 ChainOffset
; /*0x02 */
133 U8 Function
; /*0x03 */
134 U16 Reserved2
; /*0x04 */
135 U8 Reserved3
; /*0x06 */
136 U8 MsgFlags
; /*0x07 */
139 U16 Reserved4
; /*0x0A */
140 MPI2_SGE_SIMPLE_UNION SGL
; /*0x0C */
141 } MPI2_TOOLBOX_MEM_MOVE_REQUEST
, *PTR_MPI2_TOOLBOX_MEM_MOVE_REQUEST
,
142 Mpi2ToolboxMemMoveRequest_t
, *pMpi2ToolboxMemMoveRequest_t
;
144 /****************************************************************************
145 * Toolbox Diagnostic Data Upload request
146 ****************************************************************************/
148 typedef struct _MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST
{
150 U8 Reserved1
; /*0x01 */
151 U8 ChainOffset
; /*0x02 */
152 U8 Function
; /*0x03 */
153 U16 Reserved2
; /*0x04 */
154 U8 Reserved3
; /*0x06 */
155 U8 MsgFlags
; /*0x07 */
158 U16 Reserved4
; /*0x0A */
159 U8 SGLFlags
; /*0x0C */
160 U8 Reserved5
; /*0x0D */
161 U16 Reserved6
; /*0x0E */
163 U32 DataLength
; /*0x14 */
164 MPI2_SGE_SIMPLE_UNION SGL
; /*0x18 */
165 } MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST
,
166 *PTR_MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST
,
167 Mpi2ToolboxDiagDataUploadRequest_t
,
168 *pMpi2ToolboxDiagDataUploadRequest_t
;
170 /*use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
172 typedef struct _MPI2_DIAG_DATA_UPLOAD_HEADER
{
173 U32 DiagDataLength
; /*00h */
174 U8 FormatCode
; /*04h */
175 U8 Reserved1
; /*05h */
176 U16 Reserved2
; /*06h */
177 } MPI2_DIAG_DATA_UPLOAD_HEADER
, *PTR_MPI2_DIAG_DATA_UPLOAD_HEADER
,
178 Mpi2DiagDataUploadHeader_t
, *pMpi2DiagDataUploadHeader_t
;
180 /****************************************************************************
181 * Toolbox ISTWI Read Write Tool
182 ****************************************************************************/
184 /*Toolbox ISTWI Read Write Tool request message */
185 typedef struct _MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST
{
187 U8 Reserved1
; /*0x01 */
188 U8 ChainOffset
; /*0x02 */
189 U8 Function
; /*0x03 */
190 U16 Reserved2
; /*0x04 */
191 U8 Reserved3
; /*0x06 */
192 U8 MsgFlags
; /*0x07 */
195 U16 Reserved4
; /*0x0A */
196 U32 Reserved5
; /*0x0C */
197 U32 Reserved6
; /*0x10 */
198 U8 DevIndex
; /*0x14 */
200 U8 SGLFlags
; /*0x16 */
202 U16 TxDataLength
; /*0x18 */
203 U16 RxDataLength
; /*0x1A */
204 U32 Reserved8
; /*0x1C */
205 U32 Reserved9
; /*0x20 */
206 U32 Reserved10
; /*0x24 */
207 U32 Reserved11
; /*0x28 */
208 U32 Reserved12
; /*0x2C */
209 MPI2_SGE_SIMPLE_UNION SGL
; /*0x30 */
210 } MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST
,
211 *PTR_MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST
,
212 Mpi2ToolboxIstwiReadWriteRequest_t
,
213 *pMpi2ToolboxIstwiReadWriteRequest_t
;
215 /*values for the Action field */
216 #define MPI2_TOOL_ISTWI_ACTION_READ_DATA (0x01)
217 #define MPI2_TOOL_ISTWI_ACTION_WRITE_DATA (0x02)
218 #define MPI2_TOOL_ISTWI_ACTION_SEQUENCE (0x03)
219 #define MPI2_TOOL_ISTWI_ACTION_RESERVE_BUS (0x10)
220 #define MPI2_TOOL_ISTWI_ACTION_RELEASE_BUS (0x11)
221 #define MPI2_TOOL_ISTWI_ACTION_RESET (0x12)
223 /*use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
225 /*values for the Flags field */
226 #define MPI2_TOOL_ISTWI_FLAG_AUTO_RESERVE_RELEASE (0x80)
227 #define MPI2_TOOL_ISTWI_FLAG_PAGE_ADDR_MASK (0x07)
229 /*Toolbox ISTWI Read Write Tool reply message */
230 typedef struct _MPI2_TOOLBOX_ISTWI_REPLY
{
232 U8 Reserved1
; /*0x01 */
233 U8 MsgLength
; /*0x02 */
234 U8 Function
; /*0x03 */
235 U16 Reserved2
; /*0x04 */
236 U8 Reserved3
; /*0x06 */
237 U8 MsgFlags
; /*0x07 */
240 U16 Reserved4
; /*0x0A */
241 U16 Reserved5
; /*0x0C */
242 U16 IOCStatus
; /*0x0E */
243 U32 IOCLogInfo
; /*0x10 */
244 U8 DevIndex
; /*0x14 */
246 U8 IstwiStatus
; /*0x16 */
247 U8 Reserved6
; /*0x17 */
248 U16 TxDataCount
; /*0x18 */
249 U16 RxDataCount
; /*0x1A */
250 } MPI2_TOOLBOX_ISTWI_REPLY
, *PTR_MPI2_TOOLBOX_ISTWI_REPLY
,
251 Mpi2ToolboxIstwiReply_t
, *pMpi2ToolboxIstwiReply_t
;
253 /****************************************************************************
254 * Toolbox Beacon Tool request
255 ****************************************************************************/
257 typedef struct _MPI2_TOOLBOX_BEACON_REQUEST
{
259 U8 Reserved1
; /*0x01 */
260 U8 ChainOffset
; /*0x02 */
261 U8 Function
; /*0x03 */
262 U16 Reserved2
; /*0x04 */
263 U8 Reserved3
; /*0x06 */
264 U8 MsgFlags
; /*0x07 */
267 U16 Reserved4
; /*0x0A */
268 U8 Reserved5
; /*0x0C */
269 U8 PhysicalPort
; /*0x0D */
270 U8 Reserved6
; /*0x0E */
272 } MPI2_TOOLBOX_BEACON_REQUEST
, *PTR_MPI2_TOOLBOX_BEACON_REQUEST
,
273 Mpi2ToolboxBeaconRequest_t
, *pMpi2ToolboxBeaconRequest_t
;
275 /*values for the Flags field */
276 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_OFF (0x00)
277 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_ON (0x01)
279 /****************************************************************************
280 * Toolbox Diagnostic CLI Tool
281 ****************************************************************************/
283 #define MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH (0x5C)
285 /*MPI v2.0 Toolbox Diagnostic CLI Tool request message */
286 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
{
288 U8 Reserved1
; /*0x01 */
289 U8 ChainOffset
; /*0x02 */
290 U8 Function
; /*0x03 */
291 U16 Reserved2
; /*0x04 */
292 U8 Reserved3
; /*0x06 */
293 U8 MsgFlags
; /*0x07 */
296 U16 Reserved4
; /*0x0A */
297 U8 SGLFlags
; /*0x0C */
298 U8 Reserved5
; /*0x0D */
299 U16 Reserved6
; /*0x0E */
300 U32 DataLength
; /*0x10 */
301 U8 DiagnosticCliCommand
[MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH
];/*0x14 */
302 MPI2_MPI_SGE_IO_UNION SGL
; /*0x70 */
303 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
,
304 *PTR_MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
,
305 Mpi2ToolboxDiagnosticCliRequest_t
,
306 *pMpi2ToolboxDiagnosticCliRequest_t
;
308 /*use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
310 /*MPI v2.5 Toolbox Diagnostic CLI Tool request message */
311 typedef struct _MPI25_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
{
313 U8 Reserved1
; /*0x01 */
314 U8 ChainOffset
; /*0x02 */
315 U8 Function
; /*0x03 */
316 U16 Reserved2
; /*0x04 */
317 U8 Reserved3
; /*0x06 */
318 U8 MsgFlags
; /*0x07 */
321 U16 Reserved4
; /*0x0A */
322 U32 Reserved5
; /*0x0C */
323 U32 DataLength
; /*0x10 */
324 U8 DiagnosticCliCommand
[MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH
];/*0x14 */
325 MPI25_SGE_IO_UNION SGL
; /* 0x70 */
326 } MPI25_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
,
327 *PTR_MPI25_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
,
328 Mpi25ToolboxDiagnosticCliRequest_t
,
329 *pMpi25ToolboxDiagnosticCliRequest_t
;
331 /*Toolbox Diagnostic CLI Tool reply message */
332 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY
{
334 U8 Reserved1
; /*0x01 */
335 U8 MsgLength
; /*0x02 */
336 U8 Function
; /*0x03 */
337 U16 Reserved2
; /*0x04 */
338 U8 Reserved3
; /*0x06 */
339 U8 MsgFlags
; /*0x07 */
342 U16 Reserved4
; /*0x0A */
343 U16 Reserved5
; /*0x0C */
344 U16 IOCStatus
; /*0x0E */
345 U32 IOCLogInfo
; /*0x10 */
346 U32 ReturnedDataLength
; /*0x14 */
347 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY
,
348 *PTR_MPI2_TOOLBOX_DIAG_CLI_REPLY
,
349 Mpi2ToolboxDiagnosticCliReply_t
,
350 *pMpi2ToolboxDiagnosticCliReply_t
;
353 /****************************************************************************
354 * Toolbox Console Text Display Tool
355 ****************************************************************************/
357 /* Toolbox Console Text Display Tool request message */
358 typedef struct _MPI2_TOOLBOX_TEXT_DISPLAY_REQUEST
{
360 U8 Reserved1
; /* 0x01 */
361 U8 ChainOffset
; /* 0x02 */
362 U8 Function
; /* 0x03 */
363 U16 Reserved2
; /* 0x04 */
364 U8 Reserved3
; /* 0x06 */
365 U8 MsgFlags
; /* 0x07 */
368 U16 Reserved4
; /* 0x0A */
369 U8 Console
; /* 0x0C */
371 U16 Reserved6
; /* 0x0E */
372 U8 TextToDisplay
[4]; /* 0x10 */
373 } MPI2_TOOLBOX_TEXT_DISPLAY_REQUEST
,
374 *PTR_MPI2_TOOLBOX_TEXT_DISPLAY_REQUEST
,
375 Mpi2ToolboxTextDisplayRequest_t
,
376 *pMpi2ToolboxTextDisplayRequest_t
;
378 /* defines for the Console field */
379 #define MPI2_TOOLBOX_CONSOLE_TYPE_MASK (0xF0)
380 #define MPI2_TOOLBOX_CONSOLE_TYPE_DEFAULT (0x00)
381 #define MPI2_TOOLBOX_CONSOLE_TYPE_UART (0x10)
382 #define MPI2_TOOLBOX_CONSOLE_TYPE_ETHERNET (0x20)
384 #define MPI2_TOOLBOX_CONSOLE_NUMBER_MASK (0x0F)
386 /* defines for the Flags field */
387 #define MPI2_TOOLBOX_CONSOLE_FLAG_TIMESTAMP (0x01)
391 /*****************************************************************************
393 * Diagnostic Buffer Messages
395 *****************************************************************************/
397 /****************************************************************************
398 * Diagnostic Buffer Post request
399 ****************************************************************************/
401 typedef struct _MPI2_DIAG_BUFFER_POST_REQUEST
{
402 U8 ExtendedType
; /*0x00 */
403 U8 BufferType
; /*0x01 */
404 U8 ChainOffset
; /*0x02 */
405 U8 Function
; /*0x03 */
406 U16 Reserved2
; /*0x04 */
407 U8 Reserved3
; /*0x06 */
408 U8 MsgFlags
; /*0x07 */
411 U16 Reserved4
; /*0x0A */
412 U64 BufferAddress
; /*0x0C */
413 U32 BufferLength
; /*0x14 */
414 U32 Reserved5
; /*0x18 */
415 U32 Reserved6
; /*0x1C */
417 U32 ProductSpecific
[23]; /*0x24 */
418 } MPI2_DIAG_BUFFER_POST_REQUEST
, *PTR_MPI2_DIAG_BUFFER_POST_REQUEST
,
419 Mpi2DiagBufferPostRequest_t
, *pMpi2DiagBufferPostRequest_t
;
421 /*values for the ExtendedType field */
422 #define MPI2_DIAG_EXTENDED_TYPE_UTILIZATION (0x02)
424 /*values for the BufferType field */
425 #define MPI2_DIAG_BUF_TYPE_TRACE (0x00)
426 #define MPI2_DIAG_BUF_TYPE_SNAPSHOT (0x01)
427 #define MPI2_DIAG_BUF_TYPE_EXTENDED (0x02)
428 /*count of the number of buffer types */
429 #define MPI2_DIAG_BUF_TYPE_COUNT (0x03)
431 /*values for the Flags field */
432 #define MPI2_DIAG_BUF_FLAG_RELEASE_ON_FULL (0x00000002)
433 #define MPI2_DIAG_BUF_FLAG_IMMEDIATE_RELEASE (0x00000001)
435 /****************************************************************************
436 * Diagnostic Buffer Post reply
437 ****************************************************************************/
439 typedef struct _MPI2_DIAG_BUFFER_POST_REPLY
{
440 U8 ExtendedType
; /*0x00 */
441 U8 BufferType
; /*0x01 */
442 U8 MsgLength
; /*0x02 */
443 U8 Function
; /*0x03 */
444 U16 Reserved2
; /*0x04 */
445 U8 Reserved3
; /*0x06 */
446 U8 MsgFlags
; /*0x07 */
449 U16 Reserved4
; /*0x0A */
450 U16 Reserved5
; /*0x0C */
451 U16 IOCStatus
; /*0x0E */
452 U32 IOCLogInfo
; /*0x10 */
453 U32 TransferLength
; /*0x14 */
454 } MPI2_DIAG_BUFFER_POST_REPLY
, *PTR_MPI2_DIAG_BUFFER_POST_REPLY
,
455 Mpi2DiagBufferPostReply_t
, *pMpi2DiagBufferPostReply_t
;
457 /****************************************************************************
458 * Diagnostic Release request
459 ****************************************************************************/
461 typedef struct _MPI2_DIAG_RELEASE_REQUEST
{
462 U8 Reserved1
; /*0x00 */
463 U8 BufferType
; /*0x01 */
464 U8 ChainOffset
; /*0x02 */
465 U8 Function
; /*0x03 */
466 U16 Reserved2
; /*0x04 */
467 U8 Reserved3
; /*0x06 */
468 U8 MsgFlags
; /*0x07 */
471 U16 Reserved4
; /*0x0A */
472 } MPI2_DIAG_RELEASE_REQUEST
, *PTR_MPI2_DIAG_RELEASE_REQUEST
,
473 Mpi2DiagReleaseRequest_t
, *pMpi2DiagReleaseRequest_t
;
475 /****************************************************************************
476 * Diagnostic Buffer Post reply
477 ****************************************************************************/
479 typedef struct _MPI2_DIAG_RELEASE_REPLY
{
480 U8 Reserved1
; /*0x00 */
481 U8 BufferType
; /*0x01 */
482 U8 MsgLength
; /*0x02 */
483 U8 Function
; /*0x03 */
484 U16 Reserved2
; /*0x04 */
485 U8 Reserved3
; /*0x06 */
486 U8 MsgFlags
; /*0x07 */
489 U16 Reserved4
; /*0x0A */
490 U16 Reserved5
; /*0x0C */
491 U16 IOCStatus
; /*0x0E */
492 U32 IOCLogInfo
; /*0x10 */
493 } MPI2_DIAG_RELEASE_REPLY
, *PTR_MPI2_DIAG_RELEASE_REPLY
,
494 Mpi2DiagReleaseReply_t
, *pMpi2DiagReleaseReply_t
;