diff options
Diffstat (limited to 'drivers/scsi/mvsas/mv_defs.h')
-rw-r--r-- | drivers/scsi/mvsas/mv_defs.h | 502 |
1 files changed, 502 insertions, 0 deletions
diff --git a/drivers/scsi/mvsas/mv_defs.h b/drivers/scsi/mvsas/mv_defs.h new file mode 100644 index 000000000000..f8cb9defb961 --- /dev/null +++ b/drivers/scsi/mvsas/mv_defs.h | |||
@@ -0,0 +1,502 @@ | |||
1 | /* | ||
2 | * Marvell 88SE64xx/88SE94xx const head file | ||
3 | * | ||
4 | * Copyright 2007 Red Hat, Inc. | ||
5 | * Copyright 2008 Marvell. <kewei@marvell.com> | ||
6 | * | ||
7 | * This file is licensed under GPLv2. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License as | ||
11 | * published by the Free Software Foundation; version 2 of the | ||
12 | * License. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | * General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
22 | * USA | ||
23 | */ | ||
24 | |||
25 | #ifndef _MV_DEFS_H_ | ||
26 | #define _MV_DEFS_H_ | ||
27 | |||
28 | |||
29 | enum chip_flavors { | ||
30 | chip_6320, | ||
31 | chip_6440, | ||
32 | chip_6485, | ||
33 | chip_9480, | ||
34 | chip_9180, | ||
35 | }; | ||
36 | |||
37 | /* driver compile-time configuration */ | ||
38 | enum driver_configuration { | ||
39 | MVS_SLOTS = 512, /* command slots */ | ||
40 | MVS_TX_RING_SZ = 1024, /* TX ring size (12-bit) */ | ||
41 | MVS_RX_RING_SZ = 1024, /* RX ring size (12-bit) */ | ||
42 | /* software requires power-of-2 | ||
43 | ring size */ | ||
44 | MVS_SOC_SLOTS = 64, | ||
45 | MVS_SOC_TX_RING_SZ = MVS_SOC_SLOTS * 2, | ||
46 | MVS_SOC_RX_RING_SZ = MVS_SOC_SLOTS * 2, | ||
47 | |||
48 | MVS_SLOT_BUF_SZ = 8192, /* cmd tbl + IU + status + PRD */ | ||
49 | MVS_SSP_CMD_SZ = 64, /* SSP command table buffer size */ | ||
50 | MVS_ATA_CMD_SZ = 96, /* SATA command table buffer size */ | ||
51 | MVS_OAF_SZ = 64, /* Open address frame buffer size */ | ||
52 | MVS_QUEUE_SIZE = 32, /* Support Queue depth */ | ||
53 | MVS_CAN_QUEUE = MVS_SLOTS - 2, /* SCSI Queue depth */ | ||
54 | MVS_SOC_CAN_QUEUE = MVS_SOC_SLOTS - 2, | ||
55 | }; | ||
56 | |||
57 | /* unchangeable hardware details */ | ||
58 | enum hardware_details { | ||
59 | MVS_MAX_PHYS = 8, /* max. possible phys */ | ||
60 | MVS_MAX_PORTS = 8, /* max. possible ports */ | ||
61 | MVS_SOC_PHYS = 4, /* soc phys */ | ||
62 | MVS_SOC_PORTS = 4, /* soc phys */ | ||
63 | MVS_MAX_DEVICES = 1024, /* max supported device */ | ||
64 | }; | ||
65 | |||
66 | /* peripheral registers (BAR2) */ | ||
67 | enum peripheral_registers { | ||
68 | SPI_CTL = 0x10, /* EEPROM control */ | ||
69 | SPI_CMD = 0x14, /* EEPROM command */ | ||
70 | SPI_DATA = 0x18, /* EEPROM data */ | ||
71 | }; | ||
72 | |||
73 | enum peripheral_register_bits { | ||
74 | TWSI_RDY = (1U << 7), /* EEPROM interface ready */ | ||
75 | TWSI_RD = (1U << 4), /* EEPROM read access */ | ||
76 | |||
77 | SPI_ADDR_MASK = 0x3ffff, /* bits 17:0 */ | ||
78 | }; | ||
79 | |||
80 | enum hw_register_bits { | ||
81 | /* MVS_GBL_CTL */ | ||
82 | INT_EN = (1U << 1), /* Global int enable */ | ||
83 | HBA_RST = (1U << 0), /* HBA reset */ | ||
84 | |||
85 | /* MVS_GBL_INT_STAT */ | ||
86 | INT_XOR = (1U << 4), /* XOR engine event */ | ||
87 | INT_SAS_SATA = (1U << 0), /* SAS/SATA event */ | ||
88 | |||
89 | /* MVS_GBL_PORT_TYPE */ /* shl for ports 1-3 */ | ||
90 | SATA_TARGET = (1U << 16), /* port0 SATA target enable */ | ||
91 | MODE_AUTO_DET_PORT7 = (1U << 15), /* port0 SAS/SATA autodetect */ | ||
92 | MODE_AUTO_DET_PORT6 = (1U << 14), | ||
93 | MODE_AUTO_DET_PORT5 = (1U << 13), | ||
94 | MODE_AUTO_DET_PORT4 = (1U << 12), | ||
95 | MODE_AUTO_DET_PORT3 = (1U << 11), | ||
96 | MODE_AUTO_DET_PORT2 = (1U << 10), | ||
97 | MODE_AUTO_DET_PORT1 = (1U << 9), | ||
98 | MODE_AUTO_DET_PORT0 = (1U << 8), | ||
99 | MODE_AUTO_DET_EN = MODE_AUTO_DET_PORT0 | MODE_AUTO_DET_PORT1 | | ||
100 | MODE_AUTO_DET_PORT2 | MODE_AUTO_DET_PORT3 | | ||
101 | MODE_AUTO_DET_PORT4 | MODE_AUTO_DET_PORT5 | | ||
102 | MODE_AUTO_DET_PORT6 | MODE_AUTO_DET_PORT7, | ||
103 | MODE_SAS_PORT7_MASK = (1U << 7), /* port0 SAS(1), SATA(0) mode */ | ||
104 | MODE_SAS_PORT6_MASK = (1U << 6), | ||
105 | MODE_SAS_PORT5_MASK = (1U << 5), | ||
106 | MODE_SAS_PORT4_MASK = (1U << 4), | ||
107 | MODE_SAS_PORT3_MASK = (1U << 3), | ||
108 | MODE_SAS_PORT2_MASK = (1U << 2), | ||
109 | MODE_SAS_PORT1_MASK = (1U << 1), | ||
110 | MODE_SAS_PORT0_MASK = (1U << 0), | ||
111 | MODE_SAS_SATA = MODE_SAS_PORT0_MASK | MODE_SAS_PORT1_MASK | | ||
112 | MODE_SAS_PORT2_MASK | MODE_SAS_PORT3_MASK | | ||
113 | MODE_SAS_PORT4_MASK | MODE_SAS_PORT5_MASK | | ||
114 | MODE_SAS_PORT6_MASK | MODE_SAS_PORT7_MASK, | ||
115 | |||
116 | /* SAS_MODE value may be | ||
117 | * dictated (in hw) by values | ||
118 | * of SATA_TARGET & AUTO_DET | ||
119 | */ | ||
120 | |||
121 | /* MVS_TX_CFG */ | ||
122 | TX_EN = (1U << 16), /* Enable TX */ | ||
123 | TX_RING_SZ_MASK = 0xfff, /* TX ring size, bits 11:0 */ | ||
124 | |||
125 | /* MVS_RX_CFG */ | ||
126 | RX_EN = (1U << 16), /* Enable RX */ | ||
127 | RX_RING_SZ_MASK = 0xfff, /* RX ring size, bits 11:0 */ | ||
128 | |||
129 | /* MVS_INT_COAL */ | ||
130 | COAL_EN = (1U << 16), /* Enable int coalescing */ | ||
131 | |||
132 | /* MVS_INT_STAT, MVS_INT_MASK */ | ||
133 | CINT_I2C = (1U << 31), /* I2C event */ | ||
134 | CINT_SW0 = (1U << 30), /* software event 0 */ | ||
135 | CINT_SW1 = (1U << 29), /* software event 1 */ | ||
136 | CINT_PRD_BC = (1U << 28), /* PRD BC err for read cmd */ | ||
137 | CINT_DMA_PCIE = (1U << 27), /* DMA to PCIE timeout */ | ||
138 | CINT_MEM = (1U << 26), /* int mem parity err */ | ||
139 | CINT_I2C_SLAVE = (1U << 25), /* slave I2C event */ | ||
140 | CINT_SRS = (1U << 3), /* SRS event */ | ||
141 | CINT_CI_STOP = (1U << 1), /* cmd issue stopped */ | ||
142 | CINT_DONE = (1U << 0), /* cmd completion */ | ||
143 | |||
144 | /* shl for ports 1-3 */ | ||
145 | CINT_PORT_STOPPED = (1U << 16), /* port0 stopped */ | ||
146 | CINT_PORT = (1U << 8), /* port0 event */ | ||
147 | CINT_PORT_MASK_OFFSET = 8, | ||
148 | CINT_PORT_MASK = (0xFF << CINT_PORT_MASK_OFFSET), | ||
149 | CINT_PHY_MASK_OFFSET = 4, | ||
150 | CINT_PHY_MASK = (0x0F << CINT_PHY_MASK_OFFSET), | ||
151 | |||
152 | /* TX (delivery) ring bits */ | ||
153 | TXQ_CMD_SHIFT = 29, | ||
154 | TXQ_CMD_SSP = 1, /* SSP protocol */ | ||
155 | TXQ_CMD_SMP = 2, /* SMP protocol */ | ||
156 | TXQ_CMD_STP = 3, /* STP/SATA protocol */ | ||
157 | TXQ_CMD_SSP_FREE_LIST = 4, /* add to SSP targ free list */ | ||
158 | TXQ_CMD_SLOT_RESET = 7, /* reset command slot */ | ||
159 | TXQ_MODE_I = (1U << 28), /* mode: 0=target,1=initiator */ | ||
160 | TXQ_MODE_TARGET = 0, | ||
161 | TXQ_MODE_INITIATOR = 1, | ||
162 | TXQ_PRIO_HI = (1U << 27), /* priority: 0=normal, 1=high */ | ||
163 | TXQ_PRI_NORMAL = 0, | ||
164 | TXQ_PRI_HIGH = 1, | ||
165 | TXQ_SRS_SHIFT = 20, /* SATA register set */ | ||
166 | TXQ_SRS_MASK = 0x7f, | ||
167 | TXQ_PHY_SHIFT = 12, /* PHY bitmap */ | ||
168 | TXQ_PHY_MASK = 0xff, | ||
169 | TXQ_SLOT_MASK = 0xfff, /* slot number */ | ||
170 | |||
171 | /* RX (completion) ring bits */ | ||
172 | RXQ_GOOD = (1U << 23), /* Response good */ | ||
173 | RXQ_SLOT_RESET = (1U << 21), /* Slot reset complete */ | ||
174 | RXQ_CMD_RX = (1U << 20), /* target cmd received */ | ||
175 | RXQ_ATTN = (1U << 19), /* attention */ | ||
176 | RXQ_RSP = (1U << 18), /* response frame xfer'd */ | ||
177 | RXQ_ERR = (1U << 17), /* err info rec xfer'd */ | ||
178 | RXQ_DONE = (1U << 16), /* cmd complete */ | ||
179 | RXQ_SLOT_MASK = 0xfff, /* slot number */ | ||
180 | |||
181 | /* mvs_cmd_hdr bits */ | ||
182 | MCH_PRD_LEN_SHIFT = 16, /* 16-bit PRD table len */ | ||
183 | MCH_SSP_FR_TYPE_SHIFT = 13, /* SSP frame type */ | ||
184 | |||
185 | /* SSP initiator only */ | ||
186 | MCH_SSP_FR_CMD = 0x0, /* COMMAND frame */ | ||
187 | |||
188 | /* SSP initiator or target */ | ||
189 | MCH_SSP_FR_TASK = 0x1, /* TASK frame */ | ||
190 | |||
191 | /* SSP target only */ | ||
192 | MCH_SSP_FR_XFER_RDY = 0x4, /* XFER_RDY frame */ | ||
193 | MCH_SSP_FR_RESP = 0x5, /* RESPONSE frame */ | ||
194 | MCH_SSP_FR_READ = 0x6, /* Read DATA frame(s) */ | ||
195 | MCH_SSP_FR_READ_RESP = 0x7, /* ditto, plus RESPONSE */ | ||
196 | |||
197 | MCH_SSP_MODE_PASSTHRU = 1, | ||
198 | MCH_SSP_MODE_NORMAL = 0, | ||
199 | MCH_PASSTHRU = (1U << 12), /* pass-through (SSP) */ | ||
200 | MCH_FBURST = (1U << 11), /* first burst (SSP) */ | ||
201 | MCH_CHK_LEN = (1U << 10), /* chk xfer len (SSP) */ | ||
202 | MCH_RETRY = (1U << 9), /* tport layer retry (SSP) */ | ||
203 | MCH_PROTECTION = (1U << 8), /* protection info rec (SSP) */ | ||
204 | MCH_RESET = (1U << 7), /* Reset (STP/SATA) */ | ||
205 | MCH_FPDMA = (1U << 6), /* First party DMA (STP/SATA) */ | ||
206 | MCH_ATAPI = (1U << 5), /* ATAPI (STP/SATA) */ | ||
207 | MCH_BIST = (1U << 4), /* BIST activate (STP/SATA) */ | ||
208 | MCH_PMP_MASK = 0xf, /* PMP from cmd FIS (STP/SATA)*/ | ||
209 | |||
210 | CCTL_RST = (1U << 5), /* port logic reset */ | ||
211 | |||
212 | /* 0(LSB first), 1(MSB first) */ | ||
213 | CCTL_ENDIAN_DATA = (1U << 3), /* PRD data */ | ||
214 | CCTL_ENDIAN_RSP = (1U << 2), /* response frame */ | ||
215 | CCTL_ENDIAN_OPEN = (1U << 1), /* open address frame */ | ||
216 | CCTL_ENDIAN_CMD = (1U << 0), /* command table */ | ||
217 | |||
218 | /* MVS_Px_SER_CTLSTAT (per-phy control) */ | ||
219 | PHY_SSP_RST = (1U << 3), /* reset SSP link layer */ | ||
220 | PHY_BCAST_CHG = (1U << 2), /* broadcast(change) notif */ | ||
221 | PHY_RST_HARD = (1U << 1), /* hard reset + phy reset */ | ||
222 | PHY_RST = (1U << 0), /* phy reset */ | ||
223 | PHY_READY_MASK = (1U << 20), | ||
224 | |||
225 | /* MVS_Px_INT_STAT, MVS_Px_INT_MASK (per-phy events) */ | ||
226 | PHYEV_DEC_ERR = (1U << 24), /* Phy Decoding Error */ | ||
227 | PHYEV_DCDR_ERR = (1U << 23), /* STP Deocder Error */ | ||
228 | PHYEV_CRC_ERR = (1U << 22), /* STP CRC Error */ | ||
229 | PHYEV_UNASSOC_FIS = (1U << 19), /* unassociated FIS rx'd */ | ||
230 | PHYEV_AN = (1U << 18), /* SATA async notification */ | ||
231 | PHYEV_BIST_ACT = (1U << 17), /* BIST activate FIS */ | ||
232 | PHYEV_SIG_FIS = (1U << 16), /* signature FIS */ | ||
233 | PHYEV_POOF = (1U << 12), /* phy ready from 1 -> 0 */ | ||
234 | PHYEV_IU_BIG = (1U << 11), /* IU too long err */ | ||
235 | PHYEV_IU_SMALL = (1U << 10), /* IU too short err */ | ||
236 | PHYEV_UNK_TAG = (1U << 9), /* unknown tag */ | ||
237 | PHYEV_BROAD_CH = (1U << 8), /* broadcast(CHANGE) */ | ||
238 | PHYEV_COMWAKE = (1U << 7), /* COMWAKE rx'd */ | ||
239 | PHYEV_PORT_SEL = (1U << 6), /* port selector present */ | ||
240 | PHYEV_HARD_RST = (1U << 5), /* hard reset rx'd */ | ||
241 | PHYEV_ID_TMOUT = (1U << 4), /* identify timeout */ | ||
242 | PHYEV_ID_FAIL = (1U << 3), /* identify failed */ | ||
243 | PHYEV_ID_DONE = (1U << 2), /* identify done */ | ||
244 | PHYEV_HARD_RST_DONE = (1U << 1), /* hard reset done */ | ||
245 | PHYEV_RDY_CH = (1U << 0), /* phy ready changed state */ | ||
246 | |||
247 | /* MVS_PCS */ | ||
248 | PCS_EN_SATA_REG_SHIFT = (16), /* Enable SATA Register Set */ | ||
249 | PCS_EN_PORT_XMT_SHIFT = (12), /* Enable Port Transmit */ | ||
250 | PCS_EN_PORT_XMT_SHIFT2 = (8), /* For 6485 */ | ||
251 | PCS_SATA_RETRY = (1U << 8), /* retry ctl FIS on R_ERR */ | ||
252 | PCS_RSP_RX_EN = (1U << 7), /* raw response rx */ | ||
253 | PCS_SATA_RETRY_2 = (1U << 6), /* For 9180 */ | ||
254 | PCS_SELF_CLEAR = (1U << 5), /* self-clearing int mode */ | ||
255 | PCS_FIS_RX_EN = (1U << 4), /* FIS rx enable */ | ||
256 | PCS_CMD_STOP_ERR = (1U << 3), /* cmd stop-on-err enable */ | ||
257 | PCS_CMD_RST = (1U << 1), /* reset cmd issue */ | ||
258 | PCS_CMD_EN = (1U << 0), /* enable cmd issue */ | ||
259 | |||
260 | /* Port n Attached Device Info */ | ||
261 | PORT_DEV_SSP_TRGT = (1U << 19), | ||
262 | PORT_DEV_SMP_TRGT = (1U << 18), | ||
263 | PORT_DEV_STP_TRGT = (1U << 17), | ||
264 | PORT_DEV_SSP_INIT = (1U << 11), | ||
265 | PORT_DEV_SMP_INIT = (1U << 10), | ||
266 | PORT_DEV_STP_INIT = (1U << 9), | ||
267 | PORT_PHY_ID_MASK = (0xFFU << 24), | ||
268 | PORT_SSP_TRGT_MASK = (0x1U << 19), | ||
269 | PORT_SSP_INIT_MASK = (0x1U << 11), | ||
270 | PORT_DEV_TRGT_MASK = (0x7U << 17), | ||
271 | PORT_DEV_INIT_MASK = (0x7U << 9), | ||
272 | PORT_DEV_TYPE_MASK = (0x7U << 0), | ||
273 | |||
274 | /* Port n PHY Status */ | ||
275 | PHY_RDY = (1U << 2), | ||
276 | PHY_DW_SYNC = (1U << 1), | ||
277 | PHY_OOB_DTCTD = (1U << 0), | ||
278 | |||
279 | /* VSR */ | ||
280 | /* PHYMODE 6 (CDB) */ | ||
281 | PHY_MODE6_LATECLK = (1U << 29), /* Lock Clock */ | ||
282 | PHY_MODE6_DTL_SPEED = (1U << 27), /* Digital Loop Speed */ | ||
283 | PHY_MODE6_FC_ORDER = (1U << 26), /* Fibre Channel Mode Order*/ | ||
284 | PHY_MODE6_MUCNT_EN = (1U << 24), /* u Count Enable */ | ||
285 | PHY_MODE6_SEL_MUCNT_LEN = (1U << 22), /* Training Length Select */ | ||
286 | PHY_MODE6_SELMUPI = (1U << 20), /* Phase Multi Select (init) */ | ||
287 | PHY_MODE6_SELMUPF = (1U << 18), /* Phase Multi Select (final) */ | ||
288 | PHY_MODE6_SELMUFF = (1U << 16), /* Freq Loop Multi Sel(final) */ | ||
289 | PHY_MODE6_SELMUFI = (1U << 14), /* Freq Loop Multi Sel(init) */ | ||
290 | PHY_MODE6_FREEZE_LOOP = (1U << 12), /* Freeze Rx CDR Loop */ | ||
291 | PHY_MODE6_INT_RXFOFFS = (1U << 3), /* Rx CDR Freq Loop Enable */ | ||
292 | PHY_MODE6_FRC_RXFOFFS = (1U << 2), /* Initial Rx CDR Offset */ | ||
293 | PHY_MODE6_STAU_0D8 = (1U << 1), /* Rx CDR Freq Loop Saturate */ | ||
294 | PHY_MODE6_RXSAT_DIS = (1U << 0), /* Saturate Ctl */ | ||
295 | }; | ||
296 | |||
297 | /* SAS/SATA configuration port registers, aka phy registers */ | ||
298 | enum sas_sata_config_port_regs { | ||
299 | PHYR_IDENTIFY = 0x00, /* info for IDENTIFY frame */ | ||
300 | PHYR_ADDR_LO = 0x04, /* my SAS address (low) */ | ||
301 | PHYR_ADDR_HI = 0x08, /* my SAS address (high) */ | ||
302 | PHYR_ATT_DEV_INFO = 0x0C, /* attached device info */ | ||
303 | PHYR_ATT_ADDR_LO = 0x10, /* attached dev SAS addr (low) */ | ||
304 | PHYR_ATT_ADDR_HI = 0x14, /* attached dev SAS addr (high) */ | ||
305 | PHYR_SATA_CTL = 0x18, /* SATA control */ | ||
306 | PHYR_PHY_STAT = 0x1C, /* PHY status */ | ||
307 | PHYR_SATA_SIG0 = 0x20, /*port SATA signature FIS(Byte 0-3) */ | ||
308 | PHYR_SATA_SIG1 = 0x24, /*port SATA signature FIS(Byte 4-7) */ | ||
309 | PHYR_SATA_SIG2 = 0x28, /*port SATA signature FIS(Byte 8-11) */ | ||
310 | PHYR_SATA_SIG3 = 0x2c, /*port SATA signature FIS(Byte 12-15) */ | ||
311 | PHYR_R_ERR_COUNT = 0x30, /* port R_ERR count register */ | ||
312 | PHYR_CRC_ERR_COUNT = 0x34, /* port CRC error count register */ | ||
313 | PHYR_WIDE_PORT = 0x38, /* wide port participating */ | ||
314 | PHYR_CURRENT0 = 0x80, /* current connection info 0 */ | ||
315 | PHYR_CURRENT1 = 0x84, /* current connection info 1 */ | ||
316 | PHYR_CURRENT2 = 0x88, /* current connection info 2 */ | ||
317 | CONFIG_ID_FRAME0 = 0x100, /* Port device ID frame register 0 */ | ||
318 | CONFIG_ID_FRAME1 = 0x104, /* Port device ID frame register 1 */ | ||
319 | CONFIG_ID_FRAME2 = 0x108, /* Port device ID frame register 2 */ | ||
320 | CONFIG_ID_FRAME3 = 0x10c, /* Port device ID frame register 3 */ | ||
321 | CONFIG_ID_FRAME4 = 0x110, /* Port device ID frame register 4 */ | ||
322 | CONFIG_ID_FRAME5 = 0x114, /* Port device ID frame register 5 */ | ||
323 | CONFIG_ID_FRAME6 = 0x118, /* Port device ID frame register 6 */ | ||
324 | CONFIG_ATT_ID_FRAME0 = 0x11c, /* attached ID frame register 0 */ | ||
325 | CONFIG_ATT_ID_FRAME1 = 0x120, /* attached ID frame register 1 */ | ||
326 | CONFIG_ATT_ID_FRAME2 = 0x124, /* attached ID frame register 2 */ | ||
327 | CONFIG_ATT_ID_FRAME3 = 0x128, /* attached ID frame register 3 */ | ||
328 | CONFIG_ATT_ID_FRAME4 = 0x12c, /* attached ID frame register 4 */ | ||
329 | CONFIG_ATT_ID_FRAME5 = 0x130, /* attached ID frame register 5 */ | ||
330 | CONFIG_ATT_ID_FRAME6 = 0x134, /* attached ID frame register 6 */ | ||
331 | }; | ||
332 | |||
333 | enum sas_cmd_port_registers { | ||
334 | CMD_CMRST_OOB_DET = 0x100, /* COMRESET OOB detect register */ | ||
335 | CMD_CMWK_OOB_DET = 0x104, /* COMWAKE OOB detect register */ | ||
336 | CMD_CMSAS_OOB_DET = 0x108, /* COMSAS OOB detect register */ | ||
337 | CMD_BRST_OOB_DET = 0x10c, /* burst OOB detect register */ | ||
338 | CMD_OOB_SPACE = 0x110, /* OOB space control register */ | ||
339 | CMD_OOB_BURST = 0x114, /* OOB burst control register */ | ||
340 | CMD_PHY_TIMER = 0x118, /* PHY timer control register */ | ||
341 | CMD_PHY_CONFIG0 = 0x11c, /* PHY config register 0 */ | ||
342 | CMD_PHY_CONFIG1 = 0x120, /* PHY config register 1 */ | ||
343 | CMD_SAS_CTL0 = 0x124, /* SAS control register 0 */ | ||
344 | CMD_SAS_CTL1 = 0x128, /* SAS control register 1 */ | ||
345 | CMD_SAS_CTL2 = 0x12c, /* SAS control register 2 */ | ||
346 | CMD_SAS_CTL3 = 0x130, /* SAS control register 3 */ | ||
347 | CMD_ID_TEST = 0x134, /* ID test register */ | ||
348 | CMD_PL_TIMER = 0x138, /* PL timer register */ | ||
349 | CMD_WD_TIMER = 0x13c, /* WD timer register */ | ||
350 | CMD_PORT_SEL_COUNT = 0x140, /* port selector count register */ | ||
351 | CMD_APP_MEM_CTL = 0x144, /* Application Memory Control */ | ||
352 | CMD_XOR_MEM_CTL = 0x148, /* XOR Block Memory Control */ | ||
353 | CMD_DMA_MEM_CTL = 0x14c, /* DMA Block Memory Control */ | ||
354 | CMD_PORT_MEM_CTL0 = 0x150, /* Port Memory Control 0 */ | ||
355 | CMD_PORT_MEM_CTL1 = 0x154, /* Port Memory Control 1 */ | ||
356 | CMD_SATA_PORT_MEM_CTL0 = 0x158, /* SATA Port Memory Control 0 */ | ||
357 | CMD_SATA_PORT_MEM_CTL1 = 0x15c, /* SATA Port Memory Control 1 */ | ||
358 | CMD_XOR_MEM_BIST_CTL = 0x160, /* XOR Memory BIST Control */ | ||
359 | CMD_XOR_MEM_BIST_STAT = 0x164, /* XOR Memroy BIST Status */ | ||
360 | CMD_DMA_MEM_BIST_CTL = 0x168, /* DMA Memory BIST Control */ | ||
361 | CMD_DMA_MEM_BIST_STAT = 0x16c, /* DMA Memory BIST Status */ | ||
362 | CMD_PORT_MEM_BIST_CTL = 0x170, /* Port Memory BIST Control */ | ||
363 | CMD_PORT_MEM_BIST_STAT0 = 0x174, /* Port Memory BIST Status 0 */ | ||
364 | CMD_PORT_MEM_BIST_STAT1 = 0x178, /* Port Memory BIST Status 1 */ | ||
365 | CMD_STP_MEM_BIST_CTL = 0x17c, /* STP Memory BIST Control */ | ||
366 | CMD_STP_MEM_BIST_STAT0 = 0x180, /* STP Memory BIST Status 0 */ | ||
367 | CMD_STP_MEM_BIST_STAT1 = 0x184, /* STP Memory BIST Status 1 */ | ||
368 | CMD_RESET_COUNT = 0x188, /* Reset Count */ | ||
369 | CMD_MONTR_DATA_SEL = 0x18C, /* Monitor Data/Select */ | ||
370 | CMD_PLL_PHY_CONFIG = 0x190, /* PLL/PHY Configuration */ | ||
371 | CMD_PHY_CTL = 0x194, /* PHY Control and Status */ | ||
372 | CMD_PHY_TEST_COUNT0 = 0x198, /* Phy Test Count 0 */ | ||
373 | CMD_PHY_TEST_COUNT1 = 0x19C, /* Phy Test Count 1 */ | ||
374 | CMD_PHY_TEST_COUNT2 = 0x1A0, /* Phy Test Count 2 */ | ||
375 | CMD_APP_ERR_CONFIG = 0x1A4, /* Application Error Configuration */ | ||
376 | CMD_PND_FIFO_CTL0 = 0x1A8, /* Pending FIFO Control 0 */ | ||
377 | CMD_HOST_CTL = 0x1AC, /* Host Control Status */ | ||
378 | CMD_HOST_WR_DATA = 0x1B0, /* Host Write Data */ | ||
379 | CMD_HOST_RD_DATA = 0x1B4, /* Host Read Data */ | ||
380 | CMD_PHY_MODE_21 = 0x1B8, /* Phy Mode 21 */ | ||
381 | CMD_SL_MODE0 = 0x1BC, /* SL Mode 0 */ | ||
382 | CMD_SL_MODE1 = 0x1C0, /* SL Mode 1 */ | ||
383 | CMD_PND_FIFO_CTL1 = 0x1C4, /* Pending FIFO Control 1 */ | ||
384 | }; | ||
385 | |||
386 | enum mvs_info_flags { | ||
387 | MVF_MSI = (1U << 0), /* MSI is enabled */ | ||
388 | MVF_PHY_PWR_FIX = (1U << 1), /* bug workaround */ | ||
389 | MVF_FLAG_SOC = (1U << 2), /* SoC integrated controllers */ | ||
390 | }; | ||
391 | |||
392 | enum mvs_event_flags { | ||
393 | PHY_PLUG_EVENT = (3U), | ||
394 | PHY_PLUG_IN = (1U << 0), /* phy plug in */ | ||
395 | PHY_PLUG_OUT = (1U << 1), /* phy plug out */ | ||
396 | }; | ||
397 | |||
398 | enum mvs_port_type { | ||
399 | PORT_TGT_MASK = (1U << 5), | ||
400 | PORT_INIT_PORT = (1U << 4), | ||
401 | PORT_TGT_PORT = (1U << 3), | ||
402 | PORT_INIT_TGT_PORT = (PORT_INIT_PORT | PORT_TGT_PORT), | ||
403 | PORT_TYPE_SAS = (1U << 1), | ||
404 | PORT_TYPE_SATA = (1U << 0), | ||
405 | }; | ||
406 | |||
407 | /* Command Table Format */ | ||
408 | enum ct_format { | ||
409 | /* SSP */ | ||
410 | SSP_F_H = 0x00, | ||
411 | SSP_F_IU = 0x18, | ||
412 | SSP_F_MAX = 0x4D, | ||
413 | /* STP */ | ||
414 | STP_CMD_FIS = 0x00, | ||
415 | STP_ATAPI_CMD = 0x40, | ||
416 | STP_F_MAX = 0x10, | ||
417 | /* SMP */ | ||
418 | SMP_F_T = 0x00, | ||
419 | SMP_F_DEP = 0x01, | ||
420 | SMP_F_MAX = 0x101, | ||
421 | }; | ||
422 | |||
423 | enum status_buffer { | ||
424 | SB_EIR_OFF = 0x00, /* Error Information Record */ | ||
425 | SB_RFB_OFF = 0x08, /* Response Frame Buffer */ | ||
426 | SB_RFB_MAX = 0x400, /* RFB size*/ | ||
427 | }; | ||
428 | |||
429 | enum error_info_rec { | ||
430 | CMD_ISS_STPD = (1U << 31), /* Cmd Issue Stopped */ | ||
431 | CMD_PI_ERR = (1U << 30), /* Protection info error. see flags2 */ | ||
432 | RSP_OVER = (1U << 29), /* rsp buffer overflow */ | ||
433 | RETRY_LIM = (1U << 28), /* FIS/frame retry limit exceeded */ | ||
434 | UNK_FIS = (1U << 27), /* unknown FIS */ | ||
435 | DMA_TERM = (1U << 26), /* DMA terminate primitive rx'd */ | ||
436 | SYNC_ERR = (1U << 25), /* SYNC rx'd during frame xmit */ | ||
437 | TFILE_ERR = (1U << 24), /* SATA taskfile Error bit set */ | ||
438 | R_ERR = (1U << 23), /* SATA returned R_ERR prim */ | ||
439 | RD_OFS = (1U << 20), /* Read DATA frame invalid offset */ | ||
440 | XFER_RDY_OFS = (1U << 19), /* XFER_RDY offset error */ | ||
441 | UNEXP_XFER_RDY = (1U << 18), /* unexpected XFER_RDY error */ | ||
442 | DATA_OVER_UNDER = (1U << 16), /* data overflow/underflow */ | ||
443 | INTERLOCK = (1U << 15), /* interlock error */ | ||
444 | NAK = (1U << 14), /* NAK rx'd */ | ||
445 | ACK_NAK_TO = (1U << 13), /* ACK/NAK timeout */ | ||
446 | CXN_CLOSED = (1U << 12), /* cxn closed w/out ack/nak */ | ||
447 | OPEN_TO = (1U << 11), /* I_T nexus lost, open cxn timeout */ | ||
448 | PATH_BLOCKED = (1U << 10), /* I_T nexus lost, pathway blocked */ | ||
449 | NO_DEST = (1U << 9), /* I_T nexus lost, no destination */ | ||
450 | STP_RES_BSY = (1U << 8), /* STP resources busy */ | ||
451 | BREAK = (1U << 7), /* break received */ | ||
452 | BAD_DEST = (1U << 6), /* bad destination */ | ||
453 | BAD_PROTO = (1U << 5), /* protocol not supported */ | ||
454 | BAD_RATE = (1U << 4), /* cxn rate not supported */ | ||
455 | WRONG_DEST = (1U << 3), /* wrong destination error */ | ||
456 | CREDIT_TO = (1U << 2), /* credit timeout */ | ||
457 | WDOG_TO = (1U << 1), /* watchdog timeout */ | ||
458 | BUF_PAR = (1U << 0), /* buffer parity error */ | ||
459 | }; | ||
460 | |||
461 | enum error_info_rec_2 { | ||
462 | SLOT_BSY_ERR = (1U << 31), /* Slot Busy Error */ | ||
463 | GRD_CHK_ERR = (1U << 14), /* Guard Check Error */ | ||
464 | APP_CHK_ERR = (1U << 13), /* Application Check error */ | ||
465 | REF_CHK_ERR = (1U << 12), /* Reference Check Error */ | ||
466 | USR_BLK_NM = (1U << 0), /* User Block Number */ | ||
467 | }; | ||
468 | |||
469 | enum pci_cfg_register_bits { | ||
470 | PCTL_PWR_OFF = (0xFU << 24), | ||
471 | PCTL_COM_ON = (0xFU << 20), | ||
472 | PCTL_LINK_RST = (0xFU << 16), | ||
473 | PCTL_LINK_OFFS = (16), | ||
474 | PCTL_PHY_DSBL = (0xFU << 12), | ||
475 | PCTL_PHY_DSBL_OFFS = (12), | ||
476 | PRD_REQ_SIZE = (0x4000), | ||
477 | PRD_REQ_MASK = (0x00007000), | ||
478 | PLS_NEG_LINK_WD = (0x3FU << 4), | ||
479 | PLS_NEG_LINK_WD_OFFS = 4, | ||
480 | PLS_LINK_SPD = (0x0FU << 0), | ||
481 | PLS_LINK_SPD_OFFS = 0, | ||
482 | }; | ||
483 | |||
484 | enum open_frame_protocol { | ||
485 | PROTOCOL_SMP = 0x0, | ||
486 | PROTOCOL_SSP = 0x1, | ||
487 | PROTOCOL_STP = 0x2, | ||
488 | }; | ||
489 | |||
490 | /* define for response frame datapres field */ | ||
491 | enum datapres_field { | ||
492 | NO_DATA = 0, | ||
493 | RESPONSE_DATA = 1, | ||
494 | SENSE_DATA = 2, | ||
495 | }; | ||
496 | |||
497 | /* define task management IU */ | ||
498 | struct mvs_tmf_task{ | ||
499 | u8 tmf; | ||
500 | u16 tag_of_task_to_be_managed; | ||
501 | }; | ||
502 | #endif | ||