]> Pileus Git - ~andy/linux/blob - drivers/scsi/pm8001/pm80xx_hwi.h
[SCSI] pm80xx: Device id changes to support series 8 controllers.
[~andy/linux] / drivers / scsi / pm8001 / pm80xx_hwi.h
1 /*
2  * PMC-Sierra SPCv/ve 8088/8089 SAS/SATA based host adapters driver
3  *
4  * Copyright (c) 2008-2009 USI Co., Ltd.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *      notice, this list of conditions, and the following disclaimer,
12  *      without modification.
13  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
14  *      substantially similar to the "NO WARRANTY" disclaimer below
15  *      ("Disclaimer") and any redistribution must be conditioned upon
16  *      including a substantially similar Disclaimer requirement for further
17  *      binary redistribution.
18  * 3. Neither the names of the above-listed copyright holders nor the names
19  *      of any contributors may be used to endorse or promote products derived
20  *      from this software without specific prior written permission.
21  *
22  * Alternatively, this software may be distributed under the terms of the
23  * GNU General Public License ("GPL") version 2 as published by the Free
24  * Software Foundation.
25  *
26  * NO WARRANTY
27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
30  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
35  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
36  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37  * POSSIBILITY OF SUCH DAMAGES.
38  *
39  */
40
41 #ifndef _PMC8001_REG_H_
42 #define _PMC8001_REG_H_
43
44 #include <linux/types.h>
45 #include <scsi/libsas.h>
46
47 /* for Request Opcode of IOMB */
48 #define OPC_INB_ECHO                            1       /* 0x000 */
49 #define OPC_INB_PHYSTART                        4       /* 0x004 */
50 #define OPC_INB_PHYSTOP                         5       /* 0x005 */
51 #define OPC_INB_SSPINIIOSTART                   6       /* 0x006 */
52 #define OPC_INB_SSPINITMSTART                   7       /* 0x007 */
53 /* 0x8 RESV IN SPCv */
54 #define OPC_INB_RSVD                            8       /* 0x008 */
55 #define OPC_INB_DEV_HANDLE_ACCEPT               9       /* 0x009 */
56 #define OPC_INB_SSPTGTIOSTART                   10      /* 0x00A */
57 #define OPC_INB_SSPTGTRSPSTART                  11      /* 0x00B */
58 /* 0xC, 0xD, 0xE removed in SPCv */
59 #define OPC_INB_SSP_ABORT                       15      /* 0x00F */
60 #define OPC_INB_DEREG_DEV_HANDLE                16      /* 0x010 */
61 #define OPC_INB_GET_DEV_HANDLE                  17      /* 0x011 */
62 #define OPC_INB_SMP_REQUEST                     18      /* 0x012 */
63 /* 0x13 SMP_RESPONSE is removed in SPCv */
64 #define OPC_INB_SMP_ABORT                       20      /* 0x014 */
65 /* 0x16 RESV IN SPCv */
66 #define OPC_INB_RSVD1                           22      /* 0x016 */
67 #define OPC_INB_SATA_HOST_OPSTART               23      /* 0x017 */
68 #define OPC_INB_SATA_ABORT                      24      /* 0x018 */
69 #define OPC_INB_LOCAL_PHY_CONTROL               25      /* 0x019 */
70 /* 0x1A RESV IN SPCv */
71 #define OPC_INB_RSVD2                           26      /* 0x01A */
72 #define OPC_INB_FW_FLASH_UPDATE                 32      /* 0x020 */
73 #define OPC_INB_GPIO                            34      /* 0x022 */
74 #define OPC_INB_SAS_DIAG_MODE_START_END         35      /* 0x023 */
75 #define OPC_INB_SAS_DIAG_EXECUTE                36      /* 0x024 */
76 /* 0x25 RESV IN SPCv */
77 #define OPC_INB_RSVD3                           37      /* 0x025 */
78 #define OPC_INB_GET_TIME_STAMP                  38      /* 0x026 */
79 #define OPC_INB_PORT_CONTROL                    39      /* 0x027 */
80 #define OPC_INB_GET_NVMD_DATA                   40      /* 0x028 */
81 #define OPC_INB_SET_NVMD_DATA                   41      /* 0x029 */
82 #define OPC_INB_SET_DEVICE_STATE                42      /* 0x02A */
83 #define OPC_INB_GET_DEVICE_STATE                43      /* 0x02B */
84 #define OPC_INB_SET_DEV_INFO                    44      /* 0x02C */
85 /* 0x2D RESV IN SPCv */
86 #define OPC_INB_RSVD4                           45      /* 0x02D */
87 #define OPC_INB_SGPIO_REGISTER                  46      /* 0x02E */
88 #define OPC_INB_PCIE_DIAG_EXEC                  47      /* 0x02F */
89 #define OPC_INB_SET_CONTROLLER_CONFIG           48      /* 0x030 */
90 #define OPC_INB_GET_CONTROLLER_CONFIG           49      /* 0x031 */
91 #define OPC_INB_REG_DEV                         50      /* 0x032 */
92 #define OPC_INB_SAS_HW_EVENT_ACK                51      /* 0x033 */
93 #define OPC_INB_GET_DEVICE_INFO                 52      /* 0x034 */
94 #define OPC_INB_GET_PHY_PROFILE                 53      /* 0x035 */
95 #define OPC_INB_FLASH_OP_EXT                    54      /* 0x036 */
96 #define OPC_INB_SET_PHY_PROFILE                 55      /* 0x037 */
97 #define OPC_INB_KEK_MANAGEMENT                  256     /* 0x100 */
98 #define OPC_INB_DEK_MANAGEMENT                  257     /* 0x101 */
99 #define OPC_INB_SSP_INI_DIF_ENC_IO              258     /* 0x102 */
100 #define OPC_INB_SATA_DIF_ENC_IO                 259     /* 0x103 */
101
102 /* for Response Opcode of IOMB */
103 #define OPC_OUB_ECHO                                    1       /* 0x001 */
104 #define OPC_OUB_RSVD                                    4       /* 0x004 */
105 #define OPC_OUB_SSP_COMP                                5       /* 0x005 */
106 #define OPC_OUB_SMP_COMP                                6       /* 0x006 */
107 #define OPC_OUB_LOCAL_PHY_CNTRL                         7       /* 0x007 */
108 #define OPC_OUB_RSVD1                                   10      /* 0x00A */
109 #define OPC_OUB_DEREG_DEV                               11      /* 0x00B */
110 #define OPC_OUB_GET_DEV_HANDLE                          12      /* 0x00C */
111 #define OPC_OUB_SATA_COMP                               13      /* 0x00D */
112 #define OPC_OUB_SATA_EVENT                              14      /* 0x00E */
113 #define OPC_OUB_SSP_EVENT                               15      /* 0x00F */
114 #define OPC_OUB_RSVD2                                   16      /* 0x010 */
115 /* 0x11 - SMP_RECEIVED Notification removed in SPCv*/
116 #define OPC_OUB_SSP_RECV_EVENT                          18      /* 0x012 */
117 #define OPC_OUB_RSVD3                                   19      /* 0x013 */
118 #define OPC_OUB_FW_FLASH_UPDATE                         20      /* 0x014 */
119 #define OPC_OUB_GPIO_RESPONSE                           22      /* 0x016 */
120 #define OPC_OUB_GPIO_EVENT                              23      /* 0x017 */
121 #define OPC_OUB_GENERAL_EVENT                           24      /* 0x018 */
122 #define OPC_OUB_SSP_ABORT_RSP                           26      /* 0x01A */
123 #define OPC_OUB_SATA_ABORT_RSP                          27      /* 0x01B */
124 #define OPC_OUB_SAS_DIAG_MODE_START_END                 28      /* 0x01C */
125 #define OPC_OUB_SAS_DIAG_EXECUTE                        29      /* 0x01D */
126 #define OPC_OUB_GET_TIME_STAMP                          30      /* 0x01E */
127 #define OPC_OUB_RSVD4                                   31      /* 0x01F */
128 #define OPC_OUB_PORT_CONTROL                            32      /* 0x020 */
129 #define OPC_OUB_SKIP_ENTRY                              33      /* 0x021 */
130 #define OPC_OUB_SMP_ABORT_RSP                           34      /* 0x022 */
131 #define OPC_OUB_GET_NVMD_DATA                           35      /* 0x023 */
132 #define OPC_OUB_SET_NVMD_DATA                           36      /* 0x024 */
133 #define OPC_OUB_DEVICE_HANDLE_REMOVAL                   37      /* 0x025 */
134 #define OPC_OUB_SET_DEVICE_STATE                        38      /* 0x026 */
135 #define OPC_OUB_GET_DEVICE_STATE                        39      /* 0x027 */
136 #define OPC_OUB_SET_DEV_INFO                            40      /* 0x028 */
137 #define OPC_OUB_RSVD5                                   41      /* 0x029 */
138 #define OPC_OUB_HW_EVENT                                1792    /* 0x700 */
139 #define OPC_OUB_DEV_HANDLE_ARRIV                        1824    /* 0x720 */
140 #define OPC_OUB_THERM_HW_EVENT                          1840    /* 0x730 */
141 #define OPC_OUB_SGPIO_RESP                              2094    /* 0x82E */
142 #define OPC_OUB_PCIE_DIAG_EXECUTE                       2095    /* 0x82F */
143 #define OPC_OUB_DEV_REGIST                              2098    /* 0x832 */
144 #define OPC_OUB_SAS_HW_EVENT_ACK                        2099    /* 0x833 */
145 #define OPC_OUB_GET_DEVICE_INFO                         2100    /* 0x834 */
146 /* spcv specific commands */
147 #define OPC_OUB_PHY_START_RESP                          2052    /* 0x804 */
148 #define OPC_OUB_PHY_STOP_RESP                           2053    /* 0x805 */
149 #define OPC_OUB_SET_CONTROLLER_CONFIG                   2096    /* 0x830 */
150 #define OPC_OUB_GET_CONTROLLER_CONFIG                   2097    /* 0x831 */
151 #define OPC_OUB_GET_PHY_PROFILE                         2101    /* 0x835 */
152 #define OPC_OUB_FLASH_OP_EXT                            2102    /* 0x836 */
153 #define OPC_OUB_SET_PHY_PROFILE                         2103    /* 0x837 */
154 #define OPC_OUB_KEK_MANAGEMENT_RESP                     2304    /* 0x900 */
155 #define OPC_OUB_DEK_MANAGEMENT_RESP                     2305    /* 0x901 */
156 #define OPC_OUB_SSP_COALESCED_COMP_RESP                 2306    /* 0x902 */
157
158 /* for phy start*/
159 #define SSC_DISABLE_15                  (0x01 << 16)
160 #define SSC_DISABLE_30                  (0x02 << 16)
161 #define SSC_DISABLE_60                  (0x04 << 16)
162 #define SAS_ASE                         (0x01 << 15)
163 #define SPINHOLD_DISABLE                (0x00 << 14)
164 #define SPINHOLD_ENABLE                 (0x01 << 14)
165 #define LINKMODE_SAS                    (0x01 << 12)
166 #define LINKMODE_DSATA                  (0x02 << 12)
167 #define LINKMODE_AUTO                   (0x03 << 12)
168 #define LINKRATE_15                     (0x01 << 8)
169 #define LINKRATE_30                     (0x02 << 8)
170 #define LINKRATE_60                     (0x06 << 8)
171 #define LINKRATE_120                    (0x08 << 8)
172
173 /* Thermal related */
174 #define THERMAL_ENABLE                  0x1
175 #define THERMAL_LOG_ENABLE              0x1
176 #define THERMAL_OP_CODE                 0x6
177 #define LTEMPHIL                         70
178 #define RTEMPHIL                        100
179
180 /* Encryption info */
181 #define SCRATCH_PAD3_ENC_DISABLED       0x00000000
182 #define SCRATCH_PAD3_ENC_DIS_ERR        0x00000001
183 #define SCRATCH_PAD3_ENC_ENA_ERR        0x00000002
184 #define SCRATCH_PAD3_ENC_READY          0x00000003
185 #define SCRATCH_PAD3_ENC_MASK           SCRATCH_PAD3_ENC_READY
186
187 #define SCRATCH_PAD3_XTS_ENABLED                (1 << 14)
188 #define SCRATCH_PAD3_SMA_ENABLED                (1 << 4)
189 #define SCRATCH_PAD3_SMB_ENABLED                (1 << 5)
190 #define SCRATCH_PAD3_SMF_ENABLED                0
191 #define SCRATCH_PAD3_SM_MASK                    0x000000F0
192 #define SCRATCH_PAD3_ERR_CODE                   0x00FF0000
193
194 #define SEC_MODE_SMF                            0x0
195 #define SEC_MODE_SMA                            0x100
196 #define SEC_MODE_SMB                            0x200
197 #define CIPHER_MODE_ECB                         0x00000001
198 #define CIPHER_MODE_XTS                         0x00000002
199 #define KEK_MGMT_SUBOP_KEYCARDUPDATE            0x4
200
201 /* SAS protocol timer configuration page */
202 #define SAS_PROTOCOL_TIMER_CONFIG_PAGE  0x04
203 #define STP_MCT_TMO                     32
204 #define SSP_MCT_TMO                     32
205 #define SAS_MAX_OPEN_TIME                               5
206 #define SMP_MAX_CONN_TIMER              0xFF
207 #define STP_FRM_TIMER                   0
208 #define STP_IDLE_TIME                   5 /* 5 us; controller default */
209 #define SAS_MFD                         0
210 #define SAS_OPNRJT_RTRY_INTVL           2
211 #define SAS_DOPNRJT_RTRY_TMO            128
212 #define SAS_COPNRJT_RTRY_TMO            128
213
214 /*
215   Making ORR bigger than IT NEXUS LOSS which is 2000000us = 2 second.
216   Assuming a bigger value 3 second, 3000000/128 = 23437.5 where 128
217   is DOPNRJT_RTRY_TMO
218 */
219 #define SAS_DOPNRJT_RTRY_THR            23438
220 #define SAS_COPNRJT_RTRY_THR            23438
221 #define SAS_MAX_AIP                     0x200000
222 #define IT_NEXUS_TIMEOUT       0x7D0
223 #define PORT_RECOVERY_TIMEOUT  ((IT_NEXUS_TIMEOUT/100) + 30)
224
225 struct mpi_msg_hdr {
226         __le32  header; /* Bits [11:0] - Message operation code */
227         /* Bits [15:12] - Message Category */
228         /* Bits [21:16] - Outboundqueue ID for the
229         operation completion message */
230         /* Bits [23:22] - Reserved */
231         /* Bits [28:24] - Buffer Count, indicates how
232         many buffer are allocated for the massage */
233         /* Bits [30:29] - Reserved */
234         /* Bits [31] - Message Valid bit */
235 } __attribute__((packed, aligned(4)));
236
237 /*
238  * brief the data structure of PHY Start Command
239  * use to describe enable the phy (128 bytes)
240  */
241 struct phy_start_req {
242         __le32  tag;
243         __le32  ase_sh_lm_slr_phyid;
244         struct sas_identify_frame sas_identify; /* 28 Bytes */
245         __le32 spasti;
246         u32     reserved[21];
247 } __attribute__((packed, aligned(4)));
248
249 /*
250  * brief the data structure of PHY Start Command
251  * use to disable the phy (128 bytes)
252  */
253 struct phy_stop_req {
254         __le32  tag;
255         __le32  phy_id;
256         u32     reserved[29];
257 } __attribute__((packed, aligned(4)));
258
259 /* set device bits fis - device to host */
260 struct set_dev_bits_fis {
261         u8      fis_type;       /* 0xA1*/
262         u8      n_i_pmport;
263         /* b7 : n Bit. Notification bit. If set device needs attention. */
264         /* b6 : i Bit. Interrupt Bit */
265         /* b5-b4: reserved2 */
266         /* b3-b0: PM Port */
267         u8      status;
268         u8      error;
269         u32     _r_a;
270 } __attribute__ ((packed));
271 /* PIO setup FIS - device to host */
272 struct pio_setup_fis {
273         u8      fis_type;       /* 0x5f */
274         u8      i_d_pmPort;
275         /* b7 : reserved */
276         /* b6 : i bit. Interrupt bit */
277         /* b5 : d bit. data transfer direction. set to 1 for device to host
278         xfer */
279         /* b4 : reserved */
280         /* b3-b0: PM Port */
281         u8      status;
282         u8      error;
283         u8      lbal;
284         u8      lbam;
285         u8      lbah;
286         u8      device;
287         u8      lbal_exp;
288         u8      lbam_exp;
289         u8      lbah_exp;
290         u8      _r_a;
291         u8      sector_count;
292         u8      sector_count_exp;
293         u8      _r_b;
294         u8      e_status;
295         u8      _r_c[2];
296         u8      transfer_count;
297 } __attribute__ ((packed));
298
299 /*
300  * brief the data structure of SATA Completion Response
301  * use to describe the sata task response (64 bytes)
302  */
303 struct sata_completion_resp {
304         __le32  tag;
305         __le32  status;
306         __le32  param;
307         u32     sata_resp[12];
308 } __attribute__((packed, aligned(4)));
309
310 /*
311  * brief the data structure of SAS HW Event Notification
312  * use to alert the host about the hardware event(64 bytes)
313  */
314 /* updated outbound struct for spcv */
315
316 struct hw_event_resp {
317         __le32  lr_status_evt_portid;
318         __le32  evt_param;
319         __le32  phyid_npip_portstate;
320         struct sas_identify_frame       sas_identify;
321         struct dev_to_host_fis  sata_fis;
322 } __attribute__((packed, aligned(4)));
323
324 /*
325  * brief the data structure for thermal event notification
326  */
327
328 struct thermal_hw_event {
329         __le32  thermal_event;
330         __le32  rht_lht;
331 } __attribute__((packed, aligned(4)));
332
333 /*
334  * brief the data structure of REGISTER DEVICE Command
335  * use to describe MPI REGISTER DEVICE Command (64 bytes)
336  */
337
338 struct reg_dev_req {
339         __le32  tag;
340         __le32  phyid_portid;
341         __le32  dtype_dlr_mcn_ir_retry;
342         __le32  firstburstsize_ITNexustimeout;
343         u8      sas_addr[SAS_ADDR_SIZE];
344         __le32  upper_device_id;
345         u32     reserved[24];
346 } __attribute__((packed, aligned(4)));
347
348 /*
349  * brief the data structure of DEREGISTER DEVICE Command
350  * use to request spc to remove all internal resources associated
351  * with the device id (64 bytes)
352  */
353
354 struct dereg_dev_req {
355         __le32  tag;
356         __le32  device_id;
357         u32     reserved[29];
358 } __attribute__((packed, aligned(4)));
359
360 /*
361  * brief the data structure of DEVICE_REGISTRATION Response
362  * use to notify the completion of the device registration (64 bytes)
363  */
364 struct dev_reg_resp {
365         __le32  tag;
366         __le32  status;
367         __le32  device_id;
368         u32     reserved[12];
369 } __attribute__((packed, aligned(4)));
370
371 /*
372  * brief the data structure of Local PHY Control Command
373  * use to issue PHY CONTROL to local phy (64 bytes)
374  */
375 struct local_phy_ctl_req {
376         __le32  tag;
377         __le32  phyop_phyid;
378         u32     reserved1[29];
379 } __attribute__((packed, aligned(4)));
380
381 /**
382  * brief the data structure of Local Phy Control Response
383  * use to describe MPI Local Phy Control Response (64 bytes)
384  */
385  struct local_phy_ctl_resp {
386         __le32  tag;
387         __le32  phyop_phyid;
388         __le32  status;
389         u32     reserved[12];
390 } __attribute__((packed, aligned(4)));
391
392 #define OP_BITS 0x0000FF00
393 #define ID_BITS 0x000000FF
394
395 /*
396  * brief the data structure of PORT Control Command
397  * use to control port properties (64 bytes)
398  */
399
400 struct port_ctl_req {
401         __le32  tag;
402         __le32  portop_portid;
403         __le32  param0;
404         __le32  param1;
405         u32     reserved1[27];
406 } __attribute__((packed, aligned(4)));
407
408 /*
409  * brief the data structure of HW Event Ack Command
410  * use to acknowledge receive HW event (64 bytes)
411  */
412 struct hw_event_ack_req {
413         __le32  tag;
414         __le32  phyid_sea_portid;
415         __le32  param0;
416         __le32  param1;
417         u32     reserved1[27];
418 } __attribute__((packed, aligned(4)));
419
420 /*
421  * brief the data structure of PHY_START Response Command
422  * indicates the completion of PHY_START command (64 bytes)
423  */
424 struct phy_start_resp {
425         __le32  tag;
426         __le32  status;
427         __le32  phyid;
428         u32     reserved[12];
429 } __attribute__((packed, aligned(4)));
430
431 /*
432  * brief the data structure of PHY_STOP Response Command
433  * indicates the completion of PHY_STOP command (64 bytes)
434  */
435 struct phy_stop_resp {
436         __le32  tag;
437         __le32  status;
438         __le32  phyid;
439         u32     reserved[12];
440 } __attribute__((packed, aligned(4)));
441
442 /*
443  * brief the data structure of SSP Completion Response
444  * use to indicate a SSP Completion (n bytes)
445  */
446 struct ssp_completion_resp {
447         __le32  tag;
448         __le32  status;
449         __le32  param;
450         __le32  ssptag_rescv_rescpad;
451         struct ssp_response_iu ssp_resp_iu;
452         __le32  residual_count;
453 } __attribute__((packed, aligned(4)));
454
455 #define SSP_RESCV_BIT   0x00010000
456
457 /*
458  * brief the data structure of SATA EVNET response
459  * use to indicate a SATA Completion (64 bytes)
460  */
461 struct sata_event_resp {
462         __le32 tag;
463         __le32 event;
464         __le32 port_id;
465         __le32 device_id;
466         u32 reserved;
467         __le32 event_param0;
468         __le32 event_param1;
469         __le32 sata_addr_h32;
470         __le32 sata_addr_l32;
471         __le32 e_udt1_udt0_crc;
472         __le32 e_udt5_udt4_udt3_udt2;
473         __le32 a_udt1_udt0_crc;
474         __le32 a_udt5_udt4_udt3_udt2;
475         __le32 hwdevid_diferr;
476         __le32 err_framelen_byteoffset;
477         __le32 err_dataframe;
478 } __attribute__((packed, aligned(4)));
479
480 /*
481  * brief the data structure of SSP EVNET esponse
482  * use to indicate a SSP Completion (64 bytes)
483  */
484 struct ssp_event_resp {
485         __le32 tag;
486         __le32 event;
487         __le32 port_id;
488         __le32 device_id;
489         __le32 ssp_tag;
490         __le32 event_param0;
491         __le32 event_param1;
492         __le32 sas_addr_h32;
493         __le32 sas_addr_l32;
494         __le32 e_udt1_udt0_crc;
495         __le32 e_udt5_udt4_udt3_udt2;
496         __le32 a_udt1_udt0_crc;
497         __le32 a_udt5_udt4_udt3_udt2;
498         __le32 hwdevid_diferr;
499         __le32 err_framelen_byteoffset;
500         __le32 err_dataframe;
501 } __attribute__((packed, aligned(4)));
502
503 /**
504  * brief the data structure of General Event Notification Response
505  * use to describe MPI General Event Notification Response (64 bytes)
506  */
507 struct general_event_resp {
508         __le32  status;
509         __le32  inb_IOMB_payload[14];
510 } __attribute__((packed, aligned(4)));
511
512 #define GENERAL_EVENT_PAYLOAD   14
513 #define OPCODE_BITS     0x00000fff
514
515 /*
516  * brief the data structure of SMP Request Command
517  * use to describe MPI SMP REQUEST Command (64 bytes)
518  */
519 struct smp_req {
520         __le32  tag;
521         __le32  device_id;
522         __le32  len_ip_ir;
523         /* Bits [0] - Indirect response */
524         /* Bits [1] - Indirect Payload */
525         /* Bits [15:2] - Reserved */
526         /* Bits [23:16] - direct payload Len */
527         /* Bits [31:24] - Reserved */
528         u8      smp_req16[16];
529         union {
530                 u8      smp_req[32];
531                 struct {
532                         __le64 long_req_addr;/* sg dma address, LE */
533                         __le32 long_req_size;/* LE */
534                         u32     _r_a;
535                         __le64 long_resp_addr;/* sg dma address, LE */
536                         __le32 long_resp_size;/* LE */
537                         u32     _r_b;
538                         } long_smp_req;/* sequencer extension */
539         };
540         __le32  rsvd[16];
541 } __attribute__((packed, aligned(4)));
542 /*
543  * brief the data structure of SMP Completion Response
544  * use to describe MPI SMP Completion Response (64 bytes)
545  */
546 struct smp_completion_resp {
547         __le32  tag;
548         __le32  status;
549         __le32  param;
550         u8      _r_a[252];
551 } __attribute__((packed, aligned(4)));
552
553 /*
554  *brief the data structure of SSP SMP SATA Abort Command
555  * use to describe MPI SSP SMP & SATA Abort Command (64 bytes)
556  */
557 struct task_abort_req {
558         __le32  tag;
559         __le32  device_id;
560         __le32  tag_to_abort;
561         __le32  abort_all;
562         u32     reserved[27];
563 } __attribute__((packed, aligned(4)));
564
565 /* These flags used for SSP SMP & SATA Abort */
566 #define ABORT_MASK              0x3
567 #define ABORT_SINGLE            0x0
568 #define ABORT_ALL               0x1
569
570 /**
571  * brief the data structure of SSP SATA SMP Abort Response
572  * use to describe SSP SMP & SATA Abort Response ( 64 bytes)
573  */
574 struct task_abort_resp {
575         __le32  tag;
576         __le32  status;
577         __le32  scp;
578         u32     reserved[12];
579 } __attribute__((packed, aligned(4)));
580
581 /**
582  * brief the data structure of SAS Diagnostic Start/End Command
583  * use to describe MPI SAS Diagnostic Start/End Command (64 bytes)
584  */
585 struct sas_diag_start_end_req {
586         __le32  tag;
587         __le32  operation_phyid;
588         u32     reserved[29];
589 } __attribute__((packed, aligned(4)));
590
591 /**
592  * brief the data structure of SAS Diagnostic Execute Command
593  * use to describe MPI SAS Diagnostic Execute Command (64 bytes)
594  */
595 struct sas_diag_execute_req {
596         __le32  tag;
597         __le32  cmdtype_cmddesc_phyid;
598         __le32  pat1_pat2;
599         __le32  threshold;
600         __le32  codepat_errmsk;
601         __le32  pmon;
602         __le32  pERF1CTL;
603         u32     reserved[24];
604 } __attribute__((packed, aligned(4)));
605
606 #define SAS_DIAG_PARAM_BYTES 24
607
608 /*
609  * brief the data structure of Set Device State Command
610  * use to describe MPI Set Device State Command (64 bytes)
611  */
612 struct set_dev_state_req {
613         __le32  tag;
614         __le32  device_id;
615         __le32  nds;
616         u32     reserved[28];
617 } __attribute__((packed, aligned(4)));
618
619 /*
620  * brief the data structure of SATA Start Command
621  * use to describe MPI SATA IO Start Command (64 bytes)
622  * Note: This structure is common for normal / encryption I/O
623  */
624
625 struct sata_start_req {
626         __le32  tag;
627         __le32  device_id;
628         __le32  data_len;
629         __le32  ncqtag_atap_dir_m_dad;
630         struct host_to_dev_fis  sata_fis;
631         u32     reserved1;
632         u32     reserved2;      /* dword 11. rsvd for normal I/O. */
633                                 /* EPLE Descl for enc I/O */
634         u32     addr_low;       /* dword 12. rsvd for enc I/O */
635         u32     addr_high;      /* dword 13. reserved for enc I/O */
636         __le32  len;            /* dword 14: length for normal I/O. */
637                                 /* EPLE Desch for enc I/O */
638         __le32  esgl;           /* dword 15. rsvd for enc I/O */
639         __le32  atapi_scsi_cdb[4];      /* dword 16-19. rsvd for enc I/O */
640         /* The below fields are reserved for normal I/O */
641         __le32  key_index_mode; /* dword 20 */
642         __le32  sector_cnt_enss;/* dword 21 */
643         __le32  keytagl;        /* dword 22 */
644         __le32  keytagh;        /* dword 23 */
645         __le32  twk_val0;       /* dword 24 */
646         __le32  twk_val1;       /* dword 25 */
647         __le32  twk_val2;       /* dword 26 */
648         __le32  twk_val3;       /* dword 27 */
649         __le32  enc_addr_low;   /* dword 28. Encryption SGL address high */
650         __le32  enc_addr_high;  /* dword 29. Encryption SGL address low */
651         __le32  enc_len;        /* dword 30. Encryption length */
652         __le32  enc_esgl;       /* dword 31. Encryption esgl bit */
653 } __attribute__((packed, aligned(4)));
654
655 /**
656  * brief the data structure of SSP INI TM Start Command
657  * use to describe MPI SSP INI TM Start Command (64 bytes)
658  */
659 struct ssp_ini_tm_start_req {
660         __le32  tag;
661         __le32  device_id;
662         __le32  relate_tag;
663         __le32  tmf;
664         u8      lun[8];
665         __le32  ds_ads_m;
666         u32     reserved[24];
667 } __attribute__((packed, aligned(4)));
668
669 struct ssp_info_unit {
670         u8      lun[8];/* SCSI Logical Unit Number */
671         u8      reserved1;/* reserved */
672         u8      efb_prio_attr;
673         /* B7 : enabledFirstBurst */
674         /* B6-3 : taskPriority */
675         /* B2-0 : taskAttribute */
676         u8      reserved2;      /* reserved */
677         u8      additional_cdb_len;
678         /* B7-2 : additional_cdb_len */
679         /* B1-0 : reserved */
680         u8      cdb[16];/* The SCSI CDB up to 16 bytes length */
681 } __attribute__((packed, aligned(4)));
682
683 /**
684  * brief the data structure of SSP INI IO Start Command
685  * use to describe MPI SSP INI IO Start Command (64 bytes)
686  * Note: This structure is common for normal / encryption I/O
687  */
688 struct ssp_ini_io_start_req {
689         __le32  tag;
690         __le32  device_id;
691         __le32  data_len;
692         __le32  dad_dir_m_tlr;
693         struct ssp_info_unit    ssp_iu;
694         __le32  addr_low;       /* dword 12: sgl low for normal I/O. */
695                                 /* epl_descl for encryption I/O */
696         __le32  addr_high;      /* dword 13: sgl hi for normal I/O */
697                                 /* dpl_descl for encryption I/O */
698         __le32  len;            /* dword 14: len for normal I/O. */
699                                 /* edpl_desch for encryption I/O */
700         __le32  esgl;           /* dword 15: ESGL bit for normal I/O. */
701                                 /* user defined tag mask for enc I/O */
702         /* The below fields are reserved for normal I/O */
703         u8      udt[12];        /* dword 16-18 */
704         __le32  sectcnt_ios;    /* dword 19 */
705         __le32  key_cmode;      /* dword 20 */
706         __le32  ks_enss;        /* dword 21 */
707         __le32  keytagl;        /* dword 22 */
708         __le32  keytagh;        /* dword 23 */
709         __le32  twk_val0;       /* dword 24 */
710         __le32  twk_val1;       /* dword 25 */
711         __le32  twk_val2;       /* dword 26 */
712         __le32  twk_val3;       /* dword 27 */
713         __le32  enc_addr_low;   /* dword 28: Encryption sgl addr low */
714         __le32  enc_addr_high;  /* dword 29: Encryption sgl addr hi */
715         __le32  enc_len;        /* dword 30: Encryption length */
716         __le32  enc_esgl;       /* dword 31: ESGL bit for encryption */
717 } __attribute__((packed, aligned(4)));
718
719 /**
720  * brief the data structure for SSP_INI_DIF_ENC_IO COMMAND
721  * use to initiate SSP I/O operation with optional DIF/ENC
722  */
723 struct ssp_dif_enc_io_req {
724         __le32  tag;
725         __le32  device_id;
726         __le32  data_len;
727         __le32  dirMTlr;
728         __le32  sspiu0;
729         __le32  sspiu1;
730         __le32  sspiu2;
731         __le32  sspiu3;
732         __le32  sspiu4;
733         __le32  sspiu5;
734         __le32  sspiu6;
735         __le32  epl_des;
736         __le32  dpl_desl_ndplr;
737         __le32  dpl_desh;
738         __le32  uum_uuv_bss_difbits;
739         u8      udt[12];
740         __le32  sectcnt_ios;
741         __le32  key_cmode;
742         __le32  ks_enss;
743         __le32  keytagl;
744         __le32  keytagh;
745         __le32  twk_val0;
746         __le32  twk_val1;
747         __le32  twk_val2;
748         __le32  twk_val3;
749         __le32  addr_low;
750         __le32  addr_high;
751         __le32  len;
752         __le32  esgl;
753 } __attribute__((packed, aligned(4)));
754
755 /**
756  * brief the data structure of Firmware download
757  * use to describe MPI FW DOWNLOAD Command (64 bytes)
758  */
759 struct fw_flash_Update_req {
760         __le32  tag;
761         __le32  cur_image_offset;
762         __le32  cur_image_len;
763         __le32  total_image_len;
764         u32     reserved0[7];
765         __le32  sgl_addr_lo;
766         __le32  sgl_addr_hi;
767         __le32  len;
768         __le32  ext_reserved;
769         u32     reserved1[16];
770 } __attribute__((packed, aligned(4)));
771
772 #define FWFLASH_IOMB_RESERVED_LEN 0x07
773 /**
774  * brief the data structure of FW_FLASH_UPDATE Response
775  * use to describe MPI FW_FLASH_UPDATE Response (64 bytes)
776  *
777  */
778  struct fw_flash_Update_resp {
779         __le32  tag;
780         __le32  status;
781         u32     reserved[13];
782 } __attribute__((packed, aligned(4)));
783
784 /**
785  * brief the data structure of Get NVM Data Command
786  * use to get data from NVM in HBA(64 bytes)
787  */
788 struct get_nvm_data_req {
789         __le32  tag;
790         __le32  len_ir_vpdd;
791         __le32  vpd_offset;
792         u32     reserved[8];
793         __le32  resp_addr_lo;
794         __le32  resp_addr_hi;
795         __le32  resp_len;
796         u32     reserved1[17];
797 } __attribute__((packed, aligned(4)));
798
799 struct set_nvm_data_req {
800         __le32  tag;
801         __le32  len_ir_vpdd;
802         __le32  vpd_offset;
803         u32     reserved[8];
804         __le32  resp_addr_lo;
805         __le32  resp_addr_hi;
806         __le32  resp_len;
807         u32     reserved1[17];
808 } __attribute__((packed, aligned(4)));
809
810 /**
811  * brief the data structure for SET CONTROLLER CONFIG COMMAND
812  * use to modify controller configuration
813  */
814 struct set_ctrl_cfg_req {
815         __le32  tag;
816         __le32  cfg_pg[14];
817         u32     reserved[16];
818 } __attribute__((packed, aligned(4)));
819
820 /**
821  * brief the data structure for GET CONTROLLER CONFIG COMMAND
822  * use to get controller configuration page
823  */
824 struct get_ctrl_cfg_req {
825         __le32  tag;
826         __le32  pgcd;
827         __le32  int_vec;
828         u32     reserved[28];
829 } __attribute__((packed, aligned(4)));
830
831 /**
832  * brief the data structure for KEK_MANAGEMENT COMMAND
833  * use for KEK management
834  */
835 struct kek_mgmt_req {
836         __le32  tag;
837         __le32  new_curidx_ksop;
838         u32     reserved;
839         __le32  kblob[12];
840         u32     reserved1[16];
841 } __attribute__((packed, aligned(4)));
842
843 /**
844  * brief the data structure for DEK_MANAGEMENT COMMAND
845  * use for DEK management
846  */
847 struct dek_mgmt_req {
848         __le32  tag;
849         __le32  kidx_dsop;
850         __le32  dekidx;
851         __le32  addr_l;
852         __le32  addr_h;
853         __le32  nent;
854         __le32  dbf_tblsize;
855         u32     reserved[24];
856 } __attribute__((packed, aligned(4)));
857
858 /**
859  * brief the data structure for SET PHY PROFILE COMMAND
860  * use to retrive phy specific information
861  */
862 struct set_phy_profile_req {
863         __le32  tag;
864         __le32  ppc_phyid;
865         u32     reserved[29];
866 } __attribute__((packed, aligned(4)));
867
868 /**
869  * brief the data structure for GET PHY PROFILE COMMAND
870  * use to retrive phy specific information
871  */
872 struct get_phy_profile_req {
873         __le32  tag;
874         __le32  ppc_phyid;
875         __le32  profile[29];
876 } __attribute__((packed, aligned(4)));
877
878 /**
879  * brief the data structure for EXT FLASH PARTITION
880  * use to manage ext flash partition
881  */
882 struct ext_flash_partition_req {
883         __le32  tag;
884         __le32  cmd;
885         __le32  offset;
886         __le32  len;
887         u32     reserved[7];
888         __le32  addr_low;
889         __le32  addr_high;
890         __le32  len1;
891         __le32  ext;
892         u32     reserved1[16];
893 } __attribute__((packed, aligned(4)));
894
895 #define TWI_DEVICE      0x0
896 #define C_SEEPROM       0x1
897 #define VPD_FLASH       0x4
898 #define AAP1_RDUMP      0x5
899 #define IOP_RDUMP       0x6
900 #define EXPAN_ROM       0x7
901
902 #define IPMode          0x80000000
903 #define NVMD_TYPE       0x0000000F
904 #define NVMD_STAT       0x0000FFFF
905 #define NVMD_LEN        0xFF000000
906 /**
907  * brief the data structure of Get NVMD Data Response
908  * use to describe MPI Get NVMD Data Response (64 bytes)
909  */
910 struct get_nvm_data_resp {
911         __le32          tag;
912         __le32          ir_tda_bn_dps_das_nvm;
913         __le32          dlen_status;
914         __le32          nvm_data[12];
915 } __attribute__((packed, aligned(4)));
916
917 /**
918  * brief the data structure of SAS Diagnostic Start/End Response
919  * use to describe MPI SAS Diagnostic Start/End Response (64 bytes)
920  *
921  */
922 struct sas_diag_start_end_resp {
923         __le32          tag;
924         __le32          status;
925         u32             reserved[13];
926 } __attribute__((packed, aligned(4)));
927
928 /**
929  * brief the data structure of SAS Diagnostic Execute Response
930  * use to describe MPI SAS Diagnostic Execute Response (64 bytes)
931  *
932  */
933 struct sas_diag_execute_resp {
934         __le32          tag;
935         __le32          cmdtype_cmddesc_phyid;
936         __le32          Status;
937         __le32          ReportData;
938         u32             reserved[11];
939 } __attribute__((packed, aligned(4)));
940
941 /**
942  * brief the data structure of Set Device State Response
943  * use to describe MPI Set Device State Response (64 bytes)
944  *
945  */
946 struct set_dev_state_resp {
947         __le32          tag;
948         __le32          status;
949         __le32          device_id;
950         __le32          pds_nds;
951         u32             reserved[11];
952 } __attribute__((packed, aligned(4)));
953
954 /* new outbound structure for spcv - begins */
955 /**
956  * brief the data structure for SET CONTROLLER CONFIG COMMAND
957  * use to modify controller configuration
958  */
959 struct set_ctrl_cfg_resp {
960         __le32 tag;
961         __le32 status;
962         __le32 err_qlfr_pgcd;
963         u32 reserved[12];
964 } __attribute__((packed, aligned(4)));
965
966 struct get_ctrl_cfg_resp {
967         __le32 tag;
968         __le32 status;
969         __le32 err_qlfr;
970         __le32 confg_page[12];
971 } __attribute__((packed, aligned(4)));
972
973 struct kek_mgmt_resp {
974         __le32 tag;
975         __le32 status;
976         __le32 kidx_new_curr_ksop;
977         __le32 err_qlfr;
978         u32 reserved[11];
979 } __attribute__((packed, aligned(4)));
980
981 struct dek_mgmt_resp {
982         __le32 tag;
983         __le32 status;
984         __le32 kekidx_tbls_dsop;
985         __le32 dekidx;
986         __le32 err_qlfr;
987         u32 reserved[10];
988 } __attribute__((packed, aligned(4)));
989
990 struct get_phy_profile_resp {
991         __le32 tag;
992         __le32 status;
993         __le32 ppc_phyid;
994         __le32 ppc_specific_rsp[12];
995 } __attribute__((packed, aligned(4)));
996
997 struct flash_op_ext_resp {
998         __le32 tag;
999         __le32 cmd;
1000         __le32 status;
1001         __le32 epart_size;
1002         __le32 epart_sect_size;
1003         u32 reserved[10];
1004 } __attribute__((packed, aligned(4)));
1005
1006 struct set_phy_profile_resp {
1007         __le32 tag;
1008         __le32 status;
1009         __le32 ppc_phyid;
1010         __le32 ppc_specific_rsp[12];
1011 } __attribute__((packed, aligned(4)));
1012
1013 struct ssp_coalesced_comp_resp {
1014         __le32 coal_cnt;
1015         __le32 tag0;
1016         __le32 ssp_tag0;
1017         __le32 tag1;
1018         __le32 ssp_tag1;
1019         __le32 add_tag_ssp_tag[10];
1020 } __attribute__((packed, aligned(4)));
1021
1022 /* new outbound structure for spcv - ends */
1023
1024 /* brief data structure for SAS protocol timer configuration page.
1025  *
1026  */
1027 struct SASProtocolTimerConfig {
1028         __le32 pageCode;                        /* 0 */
1029         __le32 MST_MSI;                         /* 1 */
1030         __le32 STP_SSP_MCT_TMO;                 /* 2 */
1031         __le32 STP_FRM_TMO;                     /* 3 */
1032         __le32 STP_IDLE_TMO;                    /* 4 */
1033         __le32 OPNRJT_RTRY_INTVL;               /* 5 */
1034         __le32 Data_Cmd_OPNRJT_RTRY_TMO;        /* 6 */
1035         __le32 Data_Cmd_OPNRJT_RTRY_THR;        /* 7 */
1036         __le32 MAX_AIP;                         /* 8 */
1037 } __attribute__((packed, aligned(4)));
1038
1039 typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t;
1040
1041 #define NDS_BITS 0x0F
1042 #define PDS_BITS 0xF0
1043
1044 /*
1045  * HW Events type
1046  */
1047
1048 #define HW_EVENT_RESET_START                    0x01
1049 #define HW_EVENT_CHIP_RESET_COMPLETE            0x02
1050 #define HW_EVENT_PHY_STOP_STATUS                0x03
1051 #define HW_EVENT_SAS_PHY_UP                     0x04
1052 #define HW_EVENT_SATA_PHY_UP                    0x05
1053 #define HW_EVENT_SATA_SPINUP_HOLD               0x06
1054 #define HW_EVENT_PHY_DOWN                       0x07
1055 #define HW_EVENT_PORT_INVALID                   0x08
1056 #define HW_EVENT_BROADCAST_CHANGE               0x09
1057 #define HW_EVENT_PHY_ERROR                      0x0A
1058 #define HW_EVENT_BROADCAST_SES                  0x0B
1059 #define HW_EVENT_INBOUND_CRC_ERROR              0x0C
1060 #define HW_EVENT_HARD_RESET_RECEIVED            0x0D
1061 #define HW_EVENT_MALFUNCTION                    0x0E
1062 #define HW_EVENT_ID_FRAME_TIMEOUT               0x0F
1063 #define HW_EVENT_BROADCAST_EXP                  0x10
1064 #define HW_EVENT_PHY_START_STATUS               0x11
1065 #define HW_EVENT_LINK_ERR_INVALID_DWORD         0x12
1066 #define HW_EVENT_LINK_ERR_DISPARITY_ERROR       0x13
1067 #define HW_EVENT_LINK_ERR_CODE_VIOLATION        0x14
1068 #define HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH   0x15
1069 #define HW_EVENT_LINK_ERR_PHY_RESET_FAILED      0x16
1070 #define HW_EVENT_PORT_RECOVERY_TIMER_TMO        0x17
1071 #define HW_EVENT_PORT_RECOVER                   0x18
1072 #define HW_EVENT_PORT_RESET_TIMER_TMO           0x19
1073 #define HW_EVENT_PORT_RESET_COMPLETE            0x20
1074 #define EVENT_BROADCAST_ASYNCH_EVENT            0x21
1075
1076 /* port state */
1077 #define PORT_NOT_ESTABLISHED                    0x00
1078 #define PORT_VALID                              0x01
1079 #define PORT_LOSTCOMM                           0x02
1080 #define PORT_IN_RESET                           0x04
1081 #define PORT_3RD_PARTY_RESET                    0x07
1082 #define PORT_INVALID                            0x08
1083
1084 /*
1085  * SSP/SMP/SATA IO Completion Status values
1086  */
1087
1088 #define IO_SUCCESS                              0x00
1089 #define IO_ABORTED                              0x01
1090 #define IO_OVERFLOW                             0x02
1091 #define IO_UNDERFLOW                            0x03
1092 #define IO_FAILED                               0x04
1093 #define IO_ABORT_RESET                          0x05
1094 #define IO_NOT_VALID                            0x06
1095 #define IO_NO_DEVICE                            0x07
1096 #define IO_ILLEGAL_PARAMETER                    0x08
1097 #define IO_LINK_FAILURE                         0x09
1098 #define IO_PROG_ERROR                           0x0A
1099
1100 #define IO_EDC_IN_ERROR                         0x0B
1101 #define IO_EDC_OUT_ERROR                        0x0C
1102 #define IO_ERROR_HW_TIMEOUT                     0x0D
1103 #define IO_XFER_ERROR_BREAK                     0x0E
1104 #define IO_XFER_ERROR_PHY_NOT_READY             0x0F
1105 #define IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED        0x10
1106 #define IO_OPEN_CNX_ERROR_ZONE_VIOLATION                0x11
1107 #define IO_OPEN_CNX_ERROR_BREAK                         0x12
1108 #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS                 0x13
1109 #define IO_OPEN_CNX_ERROR_BAD_DESTINATION               0x14
1110 #define IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED 0x15
1111 #define IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY            0x16
1112 #define IO_OPEN_CNX_ERROR_WRONG_DESTINATION             0x17
1113 /* This error code 0x18 is not used on SPCv */
1114 #define IO_OPEN_CNX_ERROR_UNKNOWN_ERROR                 0x18
1115 #define IO_XFER_ERROR_NAK_RECEIVED                      0x19
1116 #define IO_XFER_ERROR_ACK_NAK_TIMEOUT                   0x1A
1117 #define IO_XFER_ERROR_PEER_ABORTED                      0x1B
1118 #define IO_XFER_ERROR_RX_FRAME                          0x1C
1119 #define IO_XFER_ERROR_DMA                               0x1D
1120 #define IO_XFER_ERROR_CREDIT_TIMEOUT                    0x1E
1121 #define IO_XFER_ERROR_SATA_LINK_TIMEOUT                 0x1F
1122 #define IO_XFER_ERROR_SATA                              0x20
1123
1124 /* This error code 0x22 is not used on SPCv */
1125 #define IO_XFER_ERROR_ABORTED_DUE_TO_SRST               0x22
1126 #define IO_XFER_ERROR_REJECTED_NCQ_MODE                 0x21
1127 #define IO_XFER_ERROR_ABORTED_NCQ_MODE                  0x23
1128 #define IO_XFER_OPEN_RETRY_TIMEOUT                      0x24
1129 /* This error code 0x25 is not used on SPCv */
1130 #define IO_XFER_SMP_RESP_CONNECTION_ERROR               0x25
1131 #define IO_XFER_ERROR_UNEXPECTED_PHASE                  0x26
1132 #define IO_XFER_ERROR_XFER_RDY_OVERRUN                  0x27
1133 #define IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED             0x28
1134 #define IO_XFER_ERROR_CMD_ISSUE_ACK_NAK_TIMEOUT         0x30
1135
1136 /* The following error code 0x31 and 0x32 are not using (obsolete) */
1137 #define IO_XFER_ERROR_CMD_ISSUE_BREAK_BEFORE_ACK_NAK    0x31
1138 #define IO_XFER_ERROR_CMD_ISSUE_PHY_DOWN_BEFORE_ACK_NAK 0x32
1139
1140 #define IO_XFER_ERROR_OFFSET_MISMATCH                   0x34
1141 #define IO_XFER_ERROR_XFER_ZERO_DATA_LEN                0x35
1142 #define IO_XFER_CMD_FRAME_ISSUED                        0x36
1143 #define IO_ERROR_INTERNAL_SMP_RESOURCE                  0x37
1144 #define IO_PORT_IN_RESET                                0x38
1145 #define IO_DS_NON_OPERATIONAL                           0x39
1146 #define IO_DS_IN_RECOVERY                               0x3A
1147 #define IO_TM_TAG_NOT_FOUND                             0x3B
1148 #define IO_XFER_PIO_SETUP_ERROR                         0x3C
1149 #define IO_SSP_EXT_IU_ZERO_LEN_ERROR                    0x3D
1150 #define IO_DS_IN_ERROR                                  0x3E
1151 #define IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY              0x3F
1152 #define IO_ABORT_IN_PROGRESS                            0x40
1153 #define IO_ABORT_DELAYED                                0x41
1154 #define IO_INVALID_LENGTH                               0x42
1155
1156 /********** additional response event values *****************/
1157
1158 #define IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT          0x43
1159 #define IO_XFER_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED    0x44
1160 #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO        0x45
1161 #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST         0x46
1162 #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE    0x47
1163 #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED 0x48
1164 #define IO_DS_INVALID                                   0x49
1165 /* WARNING: the value is not contiguous from here */
1166 #define IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR     0x52
1167 #define IO_XFER_DMA_ACTIVATE_TIMEOUT            0x53
1168 #define IO_XFER_ERROR_INTERNAL_CRC_ERROR        0x54
1169 #define MPI_IO_RQE_BUSY_FULL                    0x55
1170 #define IO_XFER_ERR_EOB_DATA_OVERRUN            0x56
1171 #define IO_XFR_ERROR_INVALID_SSP_RSP_FRAME      0x57
1172 #define IO_OPEN_CNX_ERROR_OPEN_PREEMPTED        0x58
1173
1174 #define MPI_ERR_IO_RESOURCE_UNAVAILABLE         0x1004
1175 #define MPI_ERR_ATAPI_DEVICE_BUSY               0x1024
1176
1177 #define IO_XFR_ERROR_DEK_KEY_CACHE_MISS         0x2040
1178 /*
1179  * An encryption IO request failed due to DEK Key Tag mismatch.
1180  * The key tag supplied in the encryption IOMB does not match with
1181  * the Key Tag in the referenced DEK Entry.
1182  */
1183 #define IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH       0x2041
1184 #define IO_XFR_ERROR_CIPHER_MODE_INVALID        0x2042
1185 /*
1186  * An encryption I/O request failed because the initial value (IV)
1187  * in the unwrapped DEK blob didn't match the IV used to unwrap it.
1188  */
1189 #define IO_XFR_ERROR_DEK_IV_MISMATCH            0x2043
1190 /* An encryption I/O request failed due to an internal RAM ECC or
1191  * interface error while unwrapping the DEK. */
1192 #define IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR    0x2044
1193 /* An encryption I/O request failed due to an internal RAM ECC or
1194  * interface error while unwrapping the DEK. */
1195 #define IO_XFR_ERROR_INTERNAL_RAM               0x2045
1196 /*
1197  * An encryption I/O request failed
1198  * because the DEK index specified in the I/O was outside the bounds of
1199  * the total number of entries in the host DEK table.
1200  */
1201 #define IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS0x2046
1202
1203 /* define DIF IO response error status code */
1204 #define IO_XFR_ERROR_DIF_MISMATCH                       0x3000
1205 #define IO_XFR_ERROR_DIF_APPLICATION_TAG_MISMATCH       0x3001
1206 #define IO_XFR_ERROR_DIF_REFERENCE_TAG_MISMATCH         0x3002
1207 #define IO_XFR_ERROR_DIF_CRC_MISMATCH                   0x3003
1208
1209 /* define operator management response status and error qualifier code */
1210 #define OPR_MGMT_OP_NOT_SUPPORTED                       0x2060
1211 #define OPR_MGMT_MPI_ENC_ERR_OPR_PARAM_ILLEGAL          0x2061
1212 #define OPR_MGMT_MPI_ENC_ERR_OPR_ID_NOT_FOUND           0x2062
1213 #define OPR_MGMT_MPI_ENC_ERR_OPR_ROLE_NOT_MATCH         0x2063
1214 #define OPR_MGMT_MPI_ENC_ERR_OPR_MAX_NUM_EXCEEDED       0x2064
1215 #define OPR_MGMT_MPI_ENC_ERR_KEK_UNWRAP_FAIL            0x2022
1216 #define OPR_MGMT_MPI_ENC_ERR_NVRAM_OPERATION_FAILURE    0x2023
1217 /***************** additional response event values ***************/
1218
1219 /* WARNING: This error code must always be the last number.
1220  * If you add error code, modify this code also
1221  * It is used as an index
1222  */
1223 #define IO_ERROR_UNKNOWN_GENERIC                        0x2023
1224
1225 /* MSGU CONFIGURATION TABLE*/
1226
1227 #define SPCv_MSGU_CFG_TABLE_UPDATE              0x001
1228 #define SPCv_MSGU_CFG_TABLE_RESET               0x002
1229 #define SPCv_MSGU_CFG_TABLE_FREEZE              0x004
1230 #define SPCv_MSGU_CFG_TABLE_UNFREEZE            0x008
1231 #define MSGU_IBDB_SET                           0x00
1232 #define MSGU_HOST_INT_STATUS                    0x08
1233 #define MSGU_HOST_INT_MASK                      0x0C
1234 #define MSGU_IOPIB_INT_STATUS                   0x18
1235 #define MSGU_IOPIB_INT_MASK                     0x1C
1236 #define MSGU_IBDB_CLEAR                         0x20
1237
1238 #define MSGU_MSGU_CONTROL                       0x24
1239 #define MSGU_ODR                                0x20
1240 #define MSGU_ODCR                               0x28
1241
1242 #define MSGU_ODMR                               0x30
1243 #define MSGU_ODMR_U                             0x34
1244 #define MSGU_ODMR_CLR                           0x38
1245 #define MSGU_ODMR_CLR_U                         0x3C
1246 #define MSGU_OD_RSVD                            0x40
1247
1248 #define MSGU_SCRATCH_PAD_0                      0x44
1249 #define MSGU_SCRATCH_PAD_1                      0x48
1250 #define MSGU_SCRATCH_PAD_2                      0x4C
1251 #define MSGU_SCRATCH_PAD_3                      0x50
1252 #define MSGU_HOST_SCRATCH_PAD_0                 0x54
1253 #define MSGU_HOST_SCRATCH_PAD_1                 0x58
1254 #define MSGU_HOST_SCRATCH_PAD_2                 0x5C
1255 #define MSGU_HOST_SCRATCH_PAD_3                 0x60
1256 #define MSGU_HOST_SCRATCH_PAD_4                 0x64
1257 #define MSGU_HOST_SCRATCH_PAD_5                 0x68
1258 #define MSGU_HOST_SCRATCH_PAD_6                 0x6C
1259 #define MSGU_HOST_SCRATCH_PAD_7                 0x70
1260
1261 /* bit definition for ODMR register */
1262 #define ODMR_MASK_ALL                   0xFFFFFFFF/* mask all
1263                                         interrupt vector */
1264 #define ODMR_CLEAR_ALL                  0       /* clear all
1265                                         interrupt vector */
1266 /* bit definition for ODCR register */
1267 #define ODCR_CLEAR_ALL                  0xFFFFFFFF /* mask all
1268                                         interrupt vector*/
1269 /* MSIX Interupts */
1270 #define MSIX_TABLE_OFFSET               0x2000
1271 #define MSIX_TABLE_ELEMENT_SIZE         0x10
1272 #define MSIX_INTERRUPT_CONTROL_OFFSET   0xC
1273 #define MSIX_TABLE_BASE                 (MSIX_TABLE_OFFSET + \
1274                                         MSIX_INTERRUPT_CONTROL_OFFSET)
1275 #define MSIX_INTERRUPT_DISABLE          0x1
1276 #define MSIX_INTERRUPT_ENABLE           0x0
1277
1278 /* state definition for Scratch Pad1 register */
1279 #define SCRATCH_PAD_RAAE_READY          0x3
1280 #define SCRATCH_PAD_ILA_READY           0xC
1281 #define SCRATCH_PAD_BOOT_LOAD_SUCCESS   0x0
1282 #define SCRATCH_PAD_IOP0_READY          0xC00
1283 #define SCRATCH_PAD_IOP1_READY          0x3000
1284
1285 /* boot loader state */
1286 #define SCRATCH_PAD1_BOOTSTATE_MASK             0x70    /* Bit 4-6 */
1287 #define SCRATCH_PAD1_BOOTSTATE_SUCESS           0x0     /* Load successful */
1288 #define SCRATCH_PAD1_BOOTSTATE_HDA_SEEPROM      0x10    /* HDA SEEPROM */
1289 #define SCRATCH_PAD1_BOOTSTATE_HDA_BOOTSTRAP    0x20    /* HDA BootStrap Pins */
1290 #define SCRATCH_PAD1_BOOTSTATE_HDA_SOFTRESET    0x30    /* HDA Soft Reset */
1291 #define SCRATCH_PAD1_BOOTSTATE_CRIT_ERROR       0x40    /* HDA critical error */
1292 #define SCRATCH_PAD1_BOOTSTATE_R1               0x50    /* Reserved */
1293 #define SCRATCH_PAD1_BOOTSTATE_R2               0x60    /* Reserved */
1294 #define SCRATCH_PAD1_BOOTSTATE_FATAL            0x70    /* Fatal Error */
1295
1296  /* state definition for Scratch Pad2 register */
1297 #define SCRATCH_PAD2_POR                0x00    /* power on state */
1298 #define SCRATCH_PAD2_SFR                0x01    /* soft reset state */
1299 #define SCRATCH_PAD2_ERR                0x02    /* error state */
1300 #define SCRATCH_PAD2_RDY                0x03    /* ready state */
1301 #define SCRATCH_PAD2_FWRDY_RST          0x04    /* FW rdy for soft reset flag */
1302 #define SCRATCH_PAD2_IOPRDY_RST         0x08    /* IOP ready for soft reset */
1303 #define SCRATCH_PAD2_STATE_MASK         0xFFFFFFF4 /* ScratchPad 2
1304  Mask, bit1-0 State */
1305 #define SCRATCH_PAD2_RESERVED           0x000003FC/* Scratch Pad1
1306  Reserved bit 2 to 9 */
1307
1308 #define SCRATCH_PAD_ERROR_MASK          0xFFFFFC00 /* Error mask bits */
1309 #define SCRATCH_PAD_STATE_MASK          0x00000003 /* State Mask bits */
1310
1311 /* main configuration offset - byte offset */
1312 #define MAIN_SIGNATURE_OFFSET           0x00 /* DWORD 0x00 */
1313 #define MAIN_INTERFACE_REVISION         0x04 /* DWORD 0x01 */
1314 #define MAIN_FW_REVISION                0x08 /* DWORD 0x02 */
1315 #define MAIN_MAX_OUTSTANDING_IO_OFFSET  0x0C /* DWORD 0x03 */
1316 #define MAIN_MAX_SGL_OFFSET             0x10 /* DWORD 0x04 */
1317 #define MAIN_CNTRL_CAP_OFFSET           0x14 /* DWORD 0x05 */
1318 #define MAIN_GST_OFFSET                 0x18 /* DWORD 0x06 */
1319 #define MAIN_IBQ_OFFSET                 0x1C /* DWORD 0x07 */
1320 #define MAIN_OBQ_OFFSET                 0x20 /* DWORD 0x08 */
1321 #define MAIN_IQNPPD_HPPD_OFFSET         0x24 /* DWORD 0x09 */
1322
1323 /* 0x28 - 0x4C - RSVD */
1324 #define MAIN_EVENT_CRC_CHECK            0x48 /* DWORD 0x12 */
1325 #define MAIN_EVENT_LOG_ADDR_HI          0x50 /* DWORD 0x14 */
1326 #define MAIN_EVENT_LOG_ADDR_LO          0x54 /* DWORD 0x15 */
1327 #define MAIN_EVENT_LOG_BUFF_SIZE        0x58 /* DWORD 0x16 */
1328 #define MAIN_EVENT_LOG_OPTION           0x5C /* DWORD 0x17 */
1329 #define MAIN_PCS_EVENT_LOG_ADDR_HI      0x60 /* DWORD 0x18 */
1330 #define MAIN_PCS_EVENT_LOG_ADDR_LO      0x64 /* DWORD 0x19 */
1331 #define MAIN_PCS_EVENT_LOG_BUFF_SIZE    0x68 /* DWORD 0x1A */
1332 #define MAIN_PCS_EVENT_LOG_OPTION       0x6C /* DWORD 0x1B */
1333 #define MAIN_FATAL_ERROR_INTERRUPT      0x70 /* DWORD 0x1C */
1334 #define MAIN_FATAL_ERROR_RDUMP0_OFFSET  0x74 /* DWORD 0x1D */
1335 #define MAIN_FATAL_ERROR_RDUMP0_LENGTH  0x78 /* DWORD 0x1E */
1336 #define MAIN_FATAL_ERROR_RDUMP1_OFFSET  0x7C /* DWORD 0x1F */
1337 #define MAIN_FATAL_ERROR_RDUMP1_LENGTH  0x80 /* DWORD 0x20 */
1338 #define MAIN_GPIO_LED_FLAGS_OFFSET      0x84 /* DWORD 0x21 */
1339 #define MAIN_ANALOG_SETUP_OFFSET        0x88 /* DWORD 0x22 */
1340
1341 #define MAIN_INT_VECTOR_TABLE_OFFSET    0x8C /* DWORD 0x23 */
1342 #define MAIN_SAS_PHY_ATTR_TABLE_OFFSET  0x90 /* DWORD 0x24 */
1343 #define MAIN_PORT_RECOVERY_TIMER        0x94 /* DWORD 0x25 */
1344 #define MAIN_INT_REASSERTION_DELAY      0x98 /* DWORD 0x26 */
1345
1346 /* Gereral Status Table offset - byte offset */
1347 #define GST_GSTLEN_MPIS_OFFSET          0x00
1348 #define GST_IQ_FREEZE_STATE0_OFFSET     0x04
1349 #define GST_IQ_FREEZE_STATE1_OFFSET     0x08
1350 #define GST_MSGUTCNT_OFFSET             0x0C
1351 #define GST_IOPTCNT_OFFSET              0x10
1352 /* 0x14 - 0x34 - RSVD */
1353 #define GST_GPIO_INPUT_VAL              0x38
1354 /* 0x3c - 0x40 - RSVD */
1355 #define GST_RERRINFO_OFFSET0            0x44
1356 #define GST_RERRINFO_OFFSET1            0x48
1357 #define GST_RERRINFO_OFFSET2            0x4c
1358 #define GST_RERRINFO_OFFSET3            0x50
1359 #define GST_RERRINFO_OFFSET4            0x54
1360 #define GST_RERRINFO_OFFSET5            0x58
1361 #define GST_RERRINFO_OFFSET6            0x5c
1362 #define GST_RERRINFO_OFFSET7            0x60
1363
1364 /* General Status Table - MPI state */
1365 #define GST_MPI_STATE_UNINIT            0x00
1366 #define GST_MPI_STATE_INIT              0x01
1367 #define GST_MPI_STATE_TERMINATION       0x02
1368 #define GST_MPI_STATE_ERROR             0x03
1369 #define GST_MPI_STATE_MASK              0x07
1370
1371 /* Per SAS PHY Attributes */
1372
1373 #define PSPA_PHYSTATE0_OFFSET           0x00 /* Dword V */
1374 #define PSPA_OB_HW_EVENT_PID0_OFFSET    0x04 /* DWORD V+1 */
1375 #define PSPA_PHYSTATE1_OFFSET           0x08 /* Dword V+2 */
1376 #define PSPA_OB_HW_EVENT_PID1_OFFSET    0x0C /* DWORD V+3 */
1377 #define PSPA_PHYSTATE2_OFFSET           0x10 /* Dword V+4 */
1378 #define PSPA_OB_HW_EVENT_PID2_OFFSET    0x14 /* DWORD V+5 */
1379 #define PSPA_PHYSTATE3_OFFSET           0x18 /* Dword V+6 */
1380 #define PSPA_OB_HW_EVENT_PID3_OFFSET    0x1C /* DWORD V+7 */
1381 #define PSPA_PHYSTATE4_OFFSET           0x20 /* Dword V+8 */
1382 #define PSPA_OB_HW_EVENT_PID4_OFFSET    0x24 /* DWORD V+9 */
1383 #define PSPA_PHYSTATE5_OFFSET           0x28 /* Dword V+10 */
1384 #define PSPA_OB_HW_EVENT_PID5_OFFSET    0x2C /* DWORD V+11 */
1385 #define PSPA_PHYSTATE6_OFFSET           0x30 /* Dword V+12 */
1386 #define PSPA_OB_HW_EVENT_PID6_OFFSET    0x34 /* DWORD V+13 */
1387 #define PSPA_PHYSTATE7_OFFSET           0x38 /* Dword V+14 */
1388 #define PSPA_OB_HW_EVENT_PID7_OFFSET    0x3C /* DWORD V+15 */
1389 #define PSPA_PHYSTATE8_OFFSET           0x40 /* DWORD V+16 */
1390 #define PSPA_OB_HW_EVENT_PID8_OFFSET    0x44 /* DWORD V+17 */
1391 #define PSPA_PHYSTATE9_OFFSET           0x48 /* DWORD V+18 */
1392 #define PSPA_OB_HW_EVENT_PID9_OFFSET    0x4C /* DWORD V+19 */
1393 #define PSPA_PHYSTATE10_OFFSET          0x50 /* DWORD V+20 */
1394 #define PSPA_OB_HW_EVENT_PID10_OFFSET   0x54 /* DWORD V+21 */
1395 #define PSPA_PHYSTATE11_OFFSET          0x58 /* DWORD V+22 */
1396 #define PSPA_OB_HW_EVENT_PID11_OFFSET   0x5C /* DWORD V+23 */
1397 #define PSPA_PHYSTATE12_OFFSET          0x60 /* DWORD V+24 */
1398 #define PSPA_OB_HW_EVENT_PID12_OFFSET   0x64 /* DWORD V+25 */
1399 #define PSPA_PHYSTATE13_OFFSET          0x68 /* DWORD V+26 */
1400 #define PSPA_OB_HW_EVENT_PID13_OFFSET   0x6c /* DWORD V+27 */
1401 #define PSPA_PHYSTATE14_OFFSET          0x70 /* DWORD V+28 */
1402 #define PSPA_OB_HW_EVENT_PID14_OFFSET   0x74 /* DWORD V+29 */
1403 #define PSPA_PHYSTATE15_OFFSET          0x78 /* DWORD V+30 */
1404 #define PSPA_OB_HW_EVENT_PID15_OFFSET   0x7c /* DWORD V+31 */
1405 /* end PSPA */
1406
1407 /* inbound queue configuration offset - byte offset */
1408 #define IB_PROPERITY_OFFSET             0x00
1409 #define IB_BASE_ADDR_HI_OFFSET          0x04
1410 #define IB_BASE_ADDR_LO_OFFSET          0x08
1411 #define IB_CI_BASE_ADDR_HI_OFFSET       0x0C
1412 #define IB_CI_BASE_ADDR_LO_OFFSET       0x10
1413 #define IB_PIPCI_BAR                    0x14
1414 #define IB_PIPCI_BAR_OFFSET             0x18
1415 #define IB_RESERVED_OFFSET              0x1C
1416
1417 /* outbound queue configuration offset - byte offset */
1418 #define OB_PROPERITY_OFFSET             0x00
1419 #define OB_BASE_ADDR_HI_OFFSET          0x04
1420 #define OB_BASE_ADDR_LO_OFFSET          0x08
1421 #define OB_PI_BASE_ADDR_HI_OFFSET       0x0C
1422 #define OB_PI_BASE_ADDR_LO_OFFSET       0x10
1423 #define OB_CIPCI_BAR                    0x14
1424 #define OB_CIPCI_BAR_OFFSET             0x18
1425 #define OB_INTERRUPT_COALES_OFFSET      0x1C
1426 #define OB_DYNAMIC_COALES_OFFSET        0x20
1427 #define OB_PROPERTY_INT_ENABLE          0x40000000
1428
1429 #define MBIC_NMI_ENABLE_VPE0_IOP        0x000418
1430 #define MBIC_NMI_ENABLE_VPE0_AAP1       0x000418
1431 /* PCIE registers - BAR2(0x18), BAR1(win) 0x010000 */
1432 #define PCIE_EVENT_INTERRUPT_ENABLE     0x003040
1433 #define PCIE_EVENT_INTERRUPT            0x003044
1434 #define PCIE_ERROR_INTERRUPT_ENABLE     0x003048
1435 #define PCIE_ERROR_INTERRUPT            0x00304C
1436
1437 /* SPCV soft reset */
1438 #define SPC_REG_SOFT_RESET 0x00001000
1439 #define SPCv_NORMAL_RESET_VALUE         0x1
1440
1441 #define SPCv_SOFT_RESET_READ_MASK               0xC0
1442 #define SPCv_SOFT_RESET_NO_RESET                0x0
1443 #define SPCv_SOFT_RESET_NORMAL_RESET_OCCURED    0x40
1444 #define SPCv_SOFT_RESET_HDA_MODE_OCCURED        0x80
1445 #define SPCv_SOFT_RESET_CHIP_RESET_OCCURED      0xC0
1446
1447 /* signature definition for host scratch pad0 register */
1448 #define SPC_SOFT_RESET_SIGNATURE        0x252acbcd
1449 /* Signature for Soft Reset */
1450
1451 /* SPC Reset register - BAR4(0x20), BAR2(win) (need dynamic mapping) */
1452 #define SPC_REG_RESET                   0x000000/* reset register */
1453
1454 /* bit definition for SPC_RESET register */
1455 #define SPC_REG_RESET_OSSP              0x00000001
1456 #define SPC_REG_RESET_RAAE              0x00000002
1457 #define SPC_REG_RESET_PCS_SPBC          0x00000004
1458 #define SPC_REG_RESET_PCS_IOP_SS        0x00000008
1459 #define SPC_REG_RESET_PCS_AAP1_SS       0x00000010
1460 #define SPC_REG_RESET_PCS_AAP2_SS       0x00000020
1461 #define SPC_REG_RESET_PCS_LM            0x00000040
1462 #define SPC_REG_RESET_PCS               0x00000080
1463 #define SPC_REG_RESET_GSM               0x00000100
1464 #define SPC_REG_RESET_DDR2              0x00010000
1465 #define SPC_REG_RESET_BDMA_CORE         0x00020000
1466 #define SPC_REG_RESET_BDMA_SXCBI        0x00040000
1467 #define SPC_REG_RESET_PCIE_AL_SXCBI     0x00080000
1468 #define SPC_REG_RESET_PCIE_PWR          0x00100000
1469 #define SPC_REG_RESET_PCIE_SFT          0x00200000
1470 #define SPC_REG_RESET_PCS_SXCBI         0x00400000
1471 #define SPC_REG_RESET_LMS_SXCBI         0x00800000
1472 #define SPC_REG_RESET_PMIC_SXCBI        0x01000000
1473 #define SPC_REG_RESET_PMIC_CORE         0x02000000
1474 #define SPC_REG_RESET_PCIE_PC_SXCBI     0x04000000
1475 #define SPC_REG_RESET_DEVICE            0x80000000
1476
1477 /* registers for BAR Shifting - BAR2(0x18), BAR1(win) */
1478 #define SPCV_IBW_AXI_TRANSLATION_LOW    0x001010
1479
1480 #define MBIC_AAP1_ADDR_BASE             0x060000
1481 #define MBIC_IOP_ADDR_BASE              0x070000
1482 #define GSM_ADDR_BASE                   0x0700000
1483 /* Dynamic map through Bar4 - 0x00700000 */
1484 #define GSM_CONFIG_RESET                0x00000000
1485 #define RAM_ECC_DB_ERR                  0x00000018
1486 #define GSM_READ_ADDR_PARITY_INDIC      0x00000058
1487 #define GSM_WRITE_ADDR_PARITY_INDIC     0x00000060
1488 #define GSM_WRITE_DATA_PARITY_INDIC     0x00000068
1489 #define GSM_READ_ADDR_PARITY_CHECK      0x00000038
1490 #define GSM_WRITE_ADDR_PARITY_CHECK     0x00000040
1491 #define GSM_WRITE_DATA_PARITY_CHECK     0x00000048
1492
1493 #define RB6_ACCESS_REG                  0x6A0000
1494 #define HDAC_EXEC_CMD                   0x0002
1495 #define HDA_C_PA                        0xcb
1496 #define HDA_SEQ_ID_BITS                 0x00ff0000
1497 #define HDA_GSM_OFFSET_BITS             0x00FFFFFF
1498 #define HDA_GSM_CMD_OFFSET_BITS         0x42C0
1499 #define HDA_GSM_RSP_OFFSET_BITS         0x42E0
1500
1501 #define MBIC_AAP1_ADDR_BASE             0x060000
1502 #define MBIC_IOP_ADDR_BASE              0x070000
1503 #define GSM_ADDR_BASE                   0x0700000
1504 #define SPC_TOP_LEVEL_ADDR_BASE         0x000000
1505 #define GSM_CONFIG_RESET_VALUE          0x00003b00
1506 #define GPIO_ADDR_BASE                  0x00090000
1507 #define GPIO_GPIO_0_0UTPUT_CTL_OFFSET   0x0000010c
1508
1509 /* RB6 offset */
1510 #define SPC_RB6_OFFSET                  0x80C0
1511 /* Magic number of soft reset for RB6 */
1512 #define RB6_MAGIC_NUMBER_RST            0x1234
1513
1514 /* Device Register status */
1515 #define DEVREG_SUCCESS                                  0x00
1516 #define DEVREG_FAILURE_OUT_OF_RESOURCE                  0x01
1517 #define DEVREG_FAILURE_DEVICE_ALREADY_REGISTERED        0x02
1518 #define DEVREG_FAILURE_INVALID_PHY_ID                   0x03
1519 #define DEVREG_FAILURE_PHY_ID_ALREADY_REGISTERED        0x04
1520 #define DEVREG_FAILURE_PORT_ID_OUT_OF_RANGE             0x05
1521 #define DEVREG_FAILURE_PORT_NOT_VALID_STATE             0x06
1522 #define DEVREG_FAILURE_DEVICE_TYPE_NOT_VALID            0x07
1523
1524 #endif