blob: 130d8036a2b5fa364b282b666dd902867891934f [file] [log] [blame]
Andy Yan20b09c22009-05-08 17:46:40 -04001/*
2 * Marvell 88SE94xx hardware specific
3 *
4 * Copyright 2007 Red Hat, Inc.
5 * Copyright 2008 Marvell. <kewei@marvell.com>
Xiangliang Yu0b15fb12011-04-26 06:36:51 -07006 * Copyright 2009-2011 Marvell. <yuxiangl@marvell.com>
Andy Yan20b09c22009-05-08 17:46:40 -04007 *
8 * This file is licensed under GPLv2.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; version 2 of the
13 * License.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * USA
24*/
25
26#include "mv_sas.h"
27#include "mv_94xx.h"
28#include "mv_chips.h"
29
30static void mvs_94xx_detect_porttype(struct mvs_info *mvi, int i)
31{
32 u32 reg;
33 struct mvs_phy *phy = &mvi->phy[i];
34 u32 phy_status;
35
36 mvs_write_port_vsr_addr(mvi, i, VSR_PHY_MODE3);
37 reg = mvs_read_port_vsr_data(mvi, i);
38 phy_status = ((reg & 0x3f0000) >> 16) & 0xff;
39 phy->phy_type &= ~(PORT_TYPE_SAS | PORT_TYPE_SATA);
40 switch (phy_status) {
41 case 0x10:
42 phy->phy_type |= PORT_TYPE_SAS;
43 break;
44 case 0x1d:
45 default:
46 phy->phy_type |= PORT_TYPE_SATA;
47 break;
48 }
49}
50
Xiangliang Yuf1f82a92011-05-24 22:28:31 +080051void set_phy_tuning(struct mvs_info *mvi, int phy_id,
52 struct phy_tuning phy_tuning)
53{
54 u32 tmp, setting_0 = 0, setting_1 = 0;
55 u8 i;
56
57 /* Remap information for B0 chip:
58 *
59 * R0Ch -> R118h[15:0] (Adapted DFE F3 - F5 coefficient)
60 * R0Dh -> R118h[31:16] (Generation 1 Setting 0)
61 * R0Eh -> R11Ch[15:0] (Generation 1 Setting 1)
62 * R0Fh -> R11Ch[31:16] (Generation 2 Setting 0)
63 * R10h -> R120h[15:0] (Generation 2 Setting 1)
64 * R11h -> R120h[31:16] (Generation 3 Setting 0)
65 * R12h -> R124h[15:0] (Generation 3 Setting 1)
66 * R13h -> R124h[31:16] (Generation 4 Setting 0 (Reserved))
67 */
68
69 /* A0 has a different set of registers */
70 if (mvi->pdev->revision == VANIR_A0_REV)
71 return;
72
73 for (i = 0; i < 3; i++) {
74 /* loop 3 times, set Gen 1, Gen 2, Gen 3 */
75 switch (i) {
76 case 0:
77 setting_0 = GENERATION_1_SETTING;
78 setting_1 = GENERATION_1_2_SETTING;
79 break;
80 case 1:
81 setting_0 = GENERATION_1_2_SETTING;
82 setting_1 = GENERATION_2_3_SETTING;
83 break;
84 case 2:
85 setting_0 = GENERATION_2_3_SETTING;
86 setting_1 = GENERATION_3_4_SETTING;
87 break;
88 }
89
90 /* Set:
91 *
92 * Transmitter Emphasis Enable
93 * Transmitter Emphasis Amplitude
94 * Transmitter Amplitude
95 */
96 mvs_write_port_vsr_addr(mvi, phy_id, setting_0);
97 tmp = mvs_read_port_vsr_data(mvi, phy_id);
98 tmp &= ~(0xFBE << 16);
99 tmp |= (((phy_tuning.trans_emp_en << 11) |
100 (phy_tuning.trans_emp_amp << 7) |
101 (phy_tuning.trans_amp << 1)) << 16);
102 mvs_write_port_vsr_data(mvi, phy_id, tmp);
103
104 /* Set Transmitter Amplitude Adjust */
105 mvs_write_port_vsr_addr(mvi, phy_id, setting_1);
106 tmp = mvs_read_port_vsr_data(mvi, phy_id);
107 tmp &= ~(0xC000);
108 tmp |= (phy_tuning.trans_amp_adj << 14);
109 mvs_write_port_vsr_data(mvi, phy_id, tmp);
110 }
111}
112
113void set_phy_ffe_tuning(struct mvs_info *mvi, int phy_id,
114 struct ffe_control ffe)
115{
116 u32 tmp;
117
118 /* Don't run this if A0/B0 */
119 if ((mvi->pdev->revision == VANIR_A0_REV)
120 || (mvi->pdev->revision == VANIR_B0_REV))
121 return;
122
123 /* FFE Resistor and Capacitor */
124 /* R10Ch DFE Resolution Control/Squelch and FFE Setting
125 *
126 * FFE_FORCE [7]
127 * FFE_RES_SEL [6:4]
128 * FFE_CAP_SEL [3:0]
129 */
130 mvs_write_port_vsr_addr(mvi, phy_id, VSR_PHY_FFE_CONTROL);
131 tmp = mvs_read_port_vsr_data(mvi, phy_id);
132 tmp &= ~0xFF;
133
134 /* Read from HBA_Info_Page */
135 tmp |= ((0x1 << 7) |
136 (ffe.ffe_rss_sel << 4) |
137 (ffe.ffe_cap_sel << 0));
138
139 mvs_write_port_vsr_data(mvi, phy_id, tmp);
140
141 /* R064h PHY Mode Register 1
142 *
143 * DFE_DIS 18
144 */
145 mvs_write_port_vsr_addr(mvi, phy_id, VSR_REF_CLOCK_CRTL);
146 tmp = mvs_read_port_vsr_data(mvi, phy_id);
147 tmp &= ~0x40001;
148 /* Hard coding */
149 /* No defines in HBA_Info_Page */
150 tmp |= (0 << 18);
151 mvs_write_port_vsr_data(mvi, phy_id, tmp);
152
153 /* R110h DFE F0-F1 Coefficient Control/DFE Update Control
154 *
155 * DFE_UPDATE_EN [11:6]
156 * DFE_FX_FORCE [5:0]
157 */
158 mvs_write_port_vsr_addr(mvi, phy_id, VSR_PHY_DFE_UPDATE_CRTL);
159 tmp = mvs_read_port_vsr_data(mvi, phy_id);
160 tmp &= ~0xFFF;
161 /* Hard coding */
162 /* No defines in HBA_Info_Page */
163 tmp |= ((0x3F << 6) | (0x0 << 0));
164 mvs_write_port_vsr_data(mvi, phy_id, tmp);
165
166 /* R1A0h Interface and Digital Reference Clock Control/Reserved_50h
167 *
168 * FFE_TRAIN_EN 3
169 */
170 mvs_write_port_vsr_addr(mvi, phy_id, VSR_REF_CLOCK_CRTL);
171 tmp = mvs_read_port_vsr_data(mvi, phy_id);
172 tmp &= ~0x8;
173 /* Hard coding */
174 /* No defines in HBA_Info_Page */
175 tmp |= (0 << 3);
176 mvs_write_port_vsr_data(mvi, phy_id, tmp);
177}
178
179/*Notice: this function must be called when phy is disabled*/
180void set_phy_rate(struct mvs_info *mvi, int phy_id, u8 rate)
181{
182 union reg_phy_cfg phy_cfg, phy_cfg_tmp;
183 mvs_write_port_vsr_addr(mvi, phy_id, VSR_PHY_MODE2);
184 phy_cfg_tmp.v = mvs_read_port_vsr_data(mvi, phy_id);
185 phy_cfg.v = 0;
186 phy_cfg.u.disable_phy = phy_cfg_tmp.u.disable_phy;
187 phy_cfg.u.sas_support = 1;
188 phy_cfg.u.sata_support = 1;
189 phy_cfg.u.sata_host_mode = 1;
190
191 switch (rate) {
192 case 0x0:
193 /* support 1.5 Gbps */
194 phy_cfg.u.speed_support = 1;
195 phy_cfg.u.snw_3_support = 0;
196 phy_cfg.u.tx_lnk_parity = 1;
197 phy_cfg.u.tx_spt_phs_lnk_rate = 0x30;
198 break;
199 case 0x1:
200
201 /* support 1.5, 3.0 Gbps */
202 phy_cfg.u.speed_support = 3;
203 phy_cfg.u.tx_spt_phs_lnk_rate = 0x3c;
204 phy_cfg.u.tx_lgcl_lnk_rate = 0x08;
205 break;
206 case 0x2:
207 default:
208 /* support 1.5, 3.0, 6.0 Gbps */
209 phy_cfg.u.speed_support = 7;
210 phy_cfg.u.snw_3_support = 1;
211 phy_cfg.u.tx_lnk_parity = 1;
212 phy_cfg.u.tx_spt_phs_lnk_rate = 0x3f;
213 phy_cfg.u.tx_lgcl_lnk_rate = 0x09;
214 break;
215 }
216 mvs_write_port_vsr_data(mvi, phy_id, phy_cfg.v);
217}
218
219static void __devinit
220mvs_94xx_config_reg_from_hba(struct mvs_info *mvi, int phy_id)
221{
222 u32 temp;
223 temp = (u32)(*(u32 *)&mvi->hba_info_param.phy_tuning[phy_id]);
224 if (temp == 0xFFFFFFFFL) {
225 mvi->hba_info_param.phy_tuning[phy_id].trans_emp_amp = 0x6;
226 mvi->hba_info_param.phy_tuning[phy_id].trans_amp = 0x1A;
227 mvi->hba_info_param.phy_tuning[phy_id].trans_amp_adj = 0x3;
228 }
229
230 temp = (u8)(*(u8 *)&mvi->hba_info_param.ffe_ctl[phy_id]);
231 if (temp == 0xFFL) {
232 switch (mvi->pdev->revision) {
233 case VANIR_A0_REV:
234 case VANIR_B0_REV:
235 mvi->hba_info_param.ffe_ctl[phy_id].ffe_rss_sel = 0x7;
236 mvi->hba_info_param.ffe_ctl[phy_id].ffe_cap_sel = 0x7;
237 break;
238 case VANIR_C0_REV:
239 case VANIR_C1_REV:
240 case VANIR_C2_REV:
241 default:
242 mvi->hba_info_param.ffe_ctl[phy_id].ffe_rss_sel = 0x7;
243 mvi->hba_info_param.ffe_ctl[phy_id].ffe_cap_sel = 0xC;
244 break;
245 }
246 }
247
248 temp = (u8)(*(u8 *)&mvi->hba_info_param.phy_rate[phy_id]);
249 if (temp == 0xFFL)
250 /*set default phy_rate = 6Gbps*/
251 mvi->hba_info_param.phy_rate[phy_id] = 0x2;
252
253 set_phy_tuning(mvi, phy_id,
254 mvi->hba_info_param.phy_tuning[phy_id]);
255 set_phy_ffe_tuning(mvi, phy_id,
256 mvi->hba_info_param.ffe_ctl[phy_id]);
257 set_phy_rate(mvi, phy_id,
258 mvi->hba_info_param.phy_rate[phy_id]);
259}
260
Andy Yan20b09c22009-05-08 17:46:40 -0400261static void __devinit mvs_94xx_enable_xmt(struct mvs_info *mvi, int phy_id)
262{
263 void __iomem *regs = mvi->regs;
264 u32 tmp;
265
266 tmp = mr32(MVS_PCS);
267 tmp |= 1 << (phy_id + PCS_EN_PORT_XMT_SHIFT2);
268 mw32(MVS_PCS, tmp);
269}
270
271static void mvs_94xx_phy_reset(struct mvs_info *mvi, u32 phy_id, int hard)
272{
273 u32 tmp;
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800274 u32 delay = 5000;
275 if (hard == MVS_PHY_TUNE) {
276 mvs_write_port_cfg_addr(mvi, phy_id, PHYR_SATA_CTL);
277 tmp = mvs_read_port_cfg_data(mvi, phy_id);
278 mvs_write_port_cfg_data(mvi, phy_id, tmp|0x20000000);
279 mvs_write_port_cfg_data(mvi, phy_id, tmp|0x100000);
280 return;
281 }
Andy Yan20b09c22009-05-08 17:46:40 -0400282 tmp = mvs_read_port_irq_stat(mvi, phy_id);
283 tmp &= ~PHYEV_RDY_CH;
284 mvs_write_port_irq_stat(mvi, phy_id, tmp);
285 if (hard) {
286 tmp = mvs_read_phy_ctl(mvi, phy_id);
287 tmp |= PHY_RST_HARD;
288 mvs_write_phy_ctl(mvi, phy_id, tmp);
289 do {
290 tmp = mvs_read_phy_ctl(mvi, phy_id);
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800291 udelay(10);
292 delay--;
293 } while ((tmp & PHY_RST_HARD) && delay);
294 if (!delay)
295 mv_dprintk("phy hard reset failed.\n");
Andy Yan20b09c22009-05-08 17:46:40 -0400296 } else {
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800297 tmp = mvs_read_phy_ctl(mvi, phy_id);
Andy Yan20b09c22009-05-08 17:46:40 -0400298 tmp |= PHY_RST;
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800299 mvs_write_phy_ctl(mvi, phy_id, tmp);
Andy Yan20b09c22009-05-08 17:46:40 -0400300 }
301}
302
303static void mvs_94xx_phy_disable(struct mvs_info *mvi, u32 phy_id)
304{
305 u32 tmp;
306 mvs_write_port_vsr_addr(mvi, phy_id, VSR_PHY_MODE2);
307 tmp = mvs_read_port_vsr_data(mvi, phy_id);
308 mvs_write_port_vsr_data(mvi, phy_id, tmp | 0x00800000);
309}
310
311static void mvs_94xx_phy_enable(struct mvs_info *mvi, u32 phy_id)
312{
Xiangliang Yuf1f82a92011-05-24 22:28:31 +0800313 u32 tmp;
314 u8 revision = 0;
315
316 revision = mvi->pdev->revision;
317 if (revision == VANIR_A0_REV) {
318 mvs_write_port_vsr_addr(mvi, phy_id, CMD_HOST_RD_DATA);
319 mvs_write_port_vsr_data(mvi, phy_id, 0x8300ffc1);
320 }
321 if (revision == VANIR_B0_REV) {
322 mvs_write_port_vsr_addr(mvi, phy_id, CMD_APP_MEM_CTL);
323 mvs_write_port_vsr_data(mvi, phy_id, 0x08001006);
324 mvs_write_port_vsr_addr(mvi, phy_id, CMD_HOST_RD_DATA);
325 mvs_write_port_vsr_data(mvi, phy_id, 0x0000705f);
326 }
327
Andy Yan20b09c22009-05-08 17:46:40 -0400328 mvs_write_port_vsr_addr(mvi, phy_id, VSR_PHY_MODE2);
Xiangliang Yuf1f82a92011-05-24 22:28:31 +0800329 tmp = mvs_read_port_vsr_data(mvi, phy_id);
330 tmp |= bit(0);
331 mvs_write_port_vsr_data(mvi, phy_id, tmp & 0xfd7fffff);
Andy Yan20b09c22009-05-08 17:46:40 -0400332}
333
334static int __devinit mvs_94xx_init(struct mvs_info *mvi)
335{
336 void __iomem *regs = mvi->regs;
337 int i;
338 u32 tmp, cctl;
Xiangliang Yuf1f82a92011-05-24 22:28:31 +0800339 u8 revision;
Andy Yan20b09c22009-05-08 17:46:40 -0400340
Xiangliang Yuf1f82a92011-05-24 22:28:31 +0800341 revision = mvi->pdev->revision;
Andy Yan20b09c22009-05-08 17:46:40 -0400342 mvs_show_pcie_usage(mvi);
343 if (mvi->flags & MVF_FLAG_SOC) {
344 tmp = mr32(MVS_PHY_CTL);
345 tmp &= ~PCTL_PWR_OFF;
346 tmp |= PCTL_PHY_DSBL;
347 mw32(MVS_PHY_CTL, tmp);
348 }
349
350 /* Init Chip */
351 /* make sure RST is set; HBA_RST /should/ have done that for us */
352 cctl = mr32(MVS_CTL) & 0xFFFF;
353 if (cctl & CCTL_RST)
354 cctl &= ~CCTL_RST;
355 else
356 mw32_f(MVS_CTL, cctl | CCTL_RST);
357
358 if (mvi->flags & MVF_FLAG_SOC) {
359 tmp = mr32(MVS_PHY_CTL);
360 tmp &= ~PCTL_PWR_OFF;
361 tmp |= PCTL_COM_ON;
362 tmp &= ~PCTL_PHY_DSBL;
363 tmp |= PCTL_LINK_RST;
364 mw32(MVS_PHY_CTL, tmp);
365 msleep(100);
366 tmp &= ~PCTL_LINK_RST;
367 mw32(MVS_PHY_CTL, tmp);
368 msleep(100);
369 }
370
Xiangliang Yuf1f82a92011-05-24 22:28:31 +0800371 /* disable Multiplexing, enable phy implemented */
372 mw32(MVS_PORTS_IMP, 0xFF);
373
374 if (revision == VANIR_A0_REV) {
375 mw32(MVS_PA_VSR_ADDR, CMD_CMWK_OOB_DET);
376 mw32(MVS_PA_VSR_PORT, 0x00018080);
377 }
378 mw32(MVS_PA_VSR_ADDR, VSR_PHY_MODE2);
379 if (revision == VANIR_A0_REV || revision == VANIR_B0_REV)
380 /* set 6G/3G/1.5G, multiplexing, without SSC */
381 mw32(MVS_PA_VSR_PORT, 0x0084d4fe);
382 else
383 /* set 6G/3G/1.5G, multiplexing, with and without SSC */
384 mw32(MVS_PA_VSR_PORT, 0x0084fffe);
385
386 if (revision == VANIR_B0_REV) {
387 mw32(MVS_PA_VSR_ADDR, CMD_APP_MEM_CTL);
388 mw32(MVS_PA_VSR_PORT, 0x08001006);
389 mw32(MVS_PA_VSR_ADDR, CMD_HOST_RD_DATA);
390 mw32(MVS_PA_VSR_PORT, 0x0000705f);
391 }
392
Andy Yan20b09c22009-05-08 17:46:40 -0400393 /* reset control */
394 mw32(MVS_PCS, 0); /* MVS_PCS */
395 mw32(MVS_STP_REG_SET_0, 0);
396 mw32(MVS_STP_REG_SET_1, 0);
397
398 /* init phys */
399 mvs_phy_hacks(mvi);
400
Xiangliang Yu07f098e2011-09-29 00:34:11 -0700401 /* disable non data frame retry */
402 tmp = mvs_cr32(mvi, CMD_SAS_CTL1);
403 if ((revision == VANIR_A0_REV) ||
404 (revision == VANIR_B0_REV) ||
405 (revision == VANIR_C0_REV)) {
406 tmp &= ~0xffff;
407 tmp |= 0x007f;
408 mvs_cw32(mvi, CMD_SAS_CTL1, tmp);
409 }
410
Andy Yan20b09c22009-05-08 17:46:40 -0400411 /* set LED blink when IO*/
Xiangliang Yua4632aa2011-05-24 22:36:02 +0800412 mw32(MVS_PA_VSR_ADDR, VSR_PHY_ACT_LED);
Andy Yan20b09c22009-05-08 17:46:40 -0400413 tmp = mr32(MVS_PA_VSR_PORT);
414 tmp &= 0xFFFF00FF;
415 tmp |= 0x00003300;
416 mw32(MVS_PA_VSR_PORT, tmp);
417
418 mw32(MVS_CMD_LIST_LO, mvi->slot_dma);
419 mw32(MVS_CMD_LIST_HI, (mvi->slot_dma >> 16) >> 16);
420
421 mw32(MVS_RX_FIS_LO, mvi->rx_fis_dma);
422 mw32(MVS_RX_FIS_HI, (mvi->rx_fis_dma >> 16) >> 16);
423
424 mw32(MVS_TX_CFG, MVS_CHIP_SLOT_SZ);
425 mw32(MVS_TX_LO, mvi->tx_dma);
426 mw32(MVS_TX_HI, (mvi->tx_dma >> 16) >> 16);
427
428 mw32(MVS_RX_CFG, MVS_RX_RING_SZ);
429 mw32(MVS_RX_LO, mvi->rx_dma);
430 mw32(MVS_RX_HI, (mvi->rx_dma >> 16) >> 16);
431
432 for (i = 0; i < mvi->chip->n_phy; i++) {
433 mvs_94xx_phy_disable(mvi, i);
434 /* set phy local SAS address */
435 mvs_set_sas_addr(mvi, i, CONFIG_ID_FRAME3, CONFIG_ID_FRAME4,
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800436 cpu_to_le64(mvi->phy[i].dev_sas_addr));
Andy Yan20b09c22009-05-08 17:46:40 -0400437
438 mvs_94xx_enable_xmt(mvi, i);
Xiangliang Yuf1f82a92011-05-24 22:28:31 +0800439 mvs_94xx_config_reg_from_hba(mvi, i);
Andy Yan20b09c22009-05-08 17:46:40 -0400440 mvs_94xx_phy_enable(mvi, i);
441
Xiangliang Yua4632aa2011-05-24 22:36:02 +0800442 mvs_94xx_phy_reset(mvi, i, PHY_RST_HARD);
Andy Yan20b09c22009-05-08 17:46:40 -0400443 msleep(500);
444 mvs_94xx_detect_porttype(mvi, i);
445 }
446
447 if (mvi->flags & MVF_FLAG_SOC) {
448 /* set select registers */
449 writel(0x0E008000, regs + 0x000);
450 writel(0x59000008, regs + 0x004);
451 writel(0x20, regs + 0x008);
452 writel(0x20, regs + 0x00c);
453 writel(0x20, regs + 0x010);
454 writel(0x20, regs + 0x014);
455 writel(0x20, regs + 0x018);
456 writel(0x20, regs + 0x01c);
457 }
458 for (i = 0; i < mvi->chip->n_phy; i++) {
459 /* clear phy int status */
460 tmp = mvs_read_port_irq_stat(mvi, i);
461 tmp &= ~PHYEV_SIG_FIS;
462 mvs_write_port_irq_stat(mvi, i, tmp);
463
464 /* set phy int mask */
465 tmp = PHYEV_RDY_CH | PHYEV_BROAD_CH |
466 PHYEV_ID_DONE | PHYEV_DCDR_ERR | PHYEV_CRC_ERR ;
467 mvs_write_port_irq_mask(mvi, i, tmp);
468
469 msleep(100);
470 mvs_update_phyinfo(mvi, i, 1);
471 }
472
Andy Yan20b09c22009-05-08 17:46:40 -0400473 /* little endian for open address and command table, etc. */
Andy Yan20b09c22009-05-08 17:46:40 -0400474 cctl = mr32(MVS_CTL);
475 cctl |= CCTL_ENDIAN_CMD;
Andy Yan20b09c22009-05-08 17:46:40 -0400476 cctl &= ~CCTL_ENDIAN_OPEN;
477 cctl |= CCTL_ENDIAN_RSP;
478 mw32_f(MVS_CTL, cctl);
479
480 /* reset CMD queue */
481 tmp = mr32(MVS_PCS);
482 tmp |= PCS_CMD_RST;
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800483 tmp &= ~PCS_SELF_CLEAR;
Andy Yan20b09c22009-05-08 17:46:40 -0400484 mw32(MVS_PCS, tmp);
Xiangliang Yue144f7e2011-05-24 22:38:10 +0800485 /*
486 * the max count is 0x1ff, while our max slot is 0x200,
Andy Yan20b09c22009-05-08 17:46:40 -0400487 * it will make count 0.
488 */
489 tmp = 0;
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800490 if (MVS_CHIP_SLOT_SZ > 0x1ff)
491 mw32(MVS_INT_COAL, 0x1ff | COAL_EN);
492 else
493 mw32(MVS_INT_COAL, MVS_CHIP_SLOT_SZ | COAL_EN);
Andy Yan20b09c22009-05-08 17:46:40 -0400494
Xiangliang Yue144f7e2011-05-24 22:38:10 +0800495 /* default interrupt coalescing time is 128us */
Xiangliang Yu83c7b612011-05-24 22:31:47 +0800496 tmp = 0x10000 | interrupt_coalescing;
Andy Yan20b09c22009-05-08 17:46:40 -0400497 mw32(MVS_INT_COAL_TMOUT, tmp);
498
499 /* ladies and gentlemen, start your engines */
500 mw32(MVS_TX_CFG, 0);
501 mw32(MVS_TX_CFG, MVS_CHIP_SLOT_SZ | TX_EN);
502 mw32(MVS_RX_CFG, MVS_RX_RING_SZ | RX_EN);
503 /* enable CMD/CMPL_Q/RESP mode */
504 mw32(MVS_PCS, PCS_SATA_RETRY_2 | PCS_FIS_RX_EN |
505 PCS_CMD_EN | PCS_CMD_STOP_ERR);
506
507 /* enable completion queue interrupt */
508 tmp = (CINT_PORT_MASK | CINT_DONE | CINT_MEM | CINT_SRS | CINT_CI_STOP |
Xiangliang Yu534ff102011-05-24 22:26:50 +0800509 CINT_DMA_PCIE | CINT_NON_SPEC_NCQ_ERROR);
Andy Yan20b09c22009-05-08 17:46:40 -0400510 tmp |= CINT_PHY_MASK;
511 mw32(MVS_INT_MASK, tmp);
512
Xiangliang Yu3a4b7ef2011-09-29 00:34:55 -0700513 /* tune STP performance */
514 tmp = 0x003F003F;
515 mvs_cw32(mvi, CMD_PL_TIMER, tmp);
516
517 /* This can improve expander large block size seq write performance */
518 tmp = mvs_cr32(mvi, CMD_PORT_LAYER_TIMER1);
519 tmp |= 0xFFFF007F;
520 mvs_cw32(mvi, CMD_PORT_LAYER_TIMER1, tmp);
521
Xiangliang Yuaa117dd2011-09-29 00:34:32 -0700522 /* change the connection open-close behavior (bit 9)
523 * set bit8 to 1 for performance tuning */
524 tmp = mvs_cr32(mvi, CMD_SL_MODE0);
525 tmp |= 0x00000300;
526 /* set bit0 to 0 to enable retry for no_dest reject case */
527 tmp &= 0xFFFFFFFE;
528 mvs_cw32(mvi, CMD_SL_MODE0, tmp);
529
Andy Yan20b09c22009-05-08 17:46:40 -0400530 /* Enable SRS interrupt */
531 mw32(MVS_INT_MASK_SRS_0, 0xFFFF);
532
533 return 0;
534}
535
536static int mvs_94xx_ioremap(struct mvs_info *mvi)
537{
538 if (!mvs_ioremap(mvi, 2, -1)) {
539 mvi->regs_ex = mvi->regs + 0x10200;
540 mvi->regs += 0x20000;
541 if (mvi->id == 1)
542 mvi->regs += 0x4000;
543 return 0;
544 }
545 return -1;
546}
547
548static void mvs_94xx_iounmap(struct mvs_info *mvi)
549{
550 if (mvi->regs) {
551 mvi->regs -= 0x20000;
552 if (mvi->id == 1)
553 mvi->regs -= 0x4000;
554 mvs_iounmap(mvi->regs);
555 }
556}
557
558static void mvs_94xx_interrupt_enable(struct mvs_info *mvi)
559{
560 void __iomem *regs = mvi->regs_ex;
561 u32 tmp;
562
563 tmp = mr32(MVS_GBL_CTL);
564 tmp |= (IRQ_SAS_A | IRQ_SAS_B);
565 mw32(MVS_GBL_INT_STAT, tmp);
566 writel(tmp, regs + 0x0C);
567 writel(tmp, regs + 0x10);
568 writel(tmp, regs + 0x14);
569 writel(tmp, regs + 0x18);
570 mw32(MVS_GBL_CTL, tmp);
571}
572
573static void mvs_94xx_interrupt_disable(struct mvs_info *mvi)
574{
575 void __iomem *regs = mvi->regs_ex;
576 u32 tmp;
577
578 tmp = mr32(MVS_GBL_CTL);
579
580 tmp &= ~(IRQ_SAS_A | IRQ_SAS_B);
581 mw32(MVS_GBL_INT_STAT, tmp);
582 writel(tmp, regs + 0x0C);
583 writel(tmp, regs + 0x10);
584 writel(tmp, regs + 0x14);
585 writel(tmp, regs + 0x18);
586 mw32(MVS_GBL_CTL, tmp);
587}
588
589static u32 mvs_94xx_isr_status(struct mvs_info *mvi, int irq)
590{
591 void __iomem *regs = mvi->regs_ex;
592 u32 stat = 0;
593 if (!(mvi->flags & MVF_FLAG_SOC)) {
594 stat = mr32(MVS_GBL_INT_STAT);
595
596 if (!(stat & (IRQ_SAS_A | IRQ_SAS_B)))
597 return 0;
598 }
599 return stat;
600}
601
602static irqreturn_t mvs_94xx_isr(struct mvs_info *mvi, int irq, u32 stat)
603{
604 void __iomem *regs = mvi->regs;
605
606 if (((stat & IRQ_SAS_A) && mvi->id == 0) ||
607 ((stat & IRQ_SAS_B) && mvi->id == 1)) {
608 mw32_f(MVS_INT_STAT, CINT_DONE);
Xiangliang Yu6f8ac162011-06-30 22:27:36 +0800609
Andy Yan20b09c22009-05-08 17:46:40 -0400610 spin_lock(&mvi->lock);
Andy Yan20b09c22009-05-08 17:46:40 -0400611 mvs_int_full(mvi);
Andy Yan20b09c22009-05-08 17:46:40 -0400612 spin_unlock(&mvi->lock);
Andy Yan20b09c22009-05-08 17:46:40 -0400613 }
614 return IRQ_HANDLED;
615}
616
617static void mvs_94xx_command_active(struct mvs_info *mvi, u32 slot_idx)
618{
619 u32 tmp;
Xiangliang Yua4632aa2011-05-24 22:36:02 +0800620 tmp = mvs_cr32(mvi, MVS_COMMAND_ACTIVE+(slot_idx >> 3));
621 if (tmp && 1 << (slot_idx % 32)) {
622 mv_printk("command active %08X, slot [%x].\n", tmp, slot_idx);
623 mvs_cw32(mvi, MVS_COMMAND_ACTIVE + (slot_idx >> 3),
624 1 << (slot_idx % 32));
625 do {
626 tmp = mvs_cr32(mvi,
627 MVS_COMMAND_ACTIVE + (slot_idx >> 3));
628 } while (tmp & 1 << (slot_idx % 32));
629 }
630}
631
632void mvs_94xx_clear_srs_irq(struct mvs_info *mvi, u8 reg_set, u8 clear_all)
633{
634 void __iomem *regs = mvi->regs;
635 u32 tmp;
636
637 if (clear_all) {
638 tmp = mr32(MVS_INT_STAT_SRS_0);
639 if (tmp) {
640 mv_dprintk("check SRS 0 %08X.\n", tmp);
641 mw32(MVS_INT_STAT_SRS_0, tmp);
642 }
643 tmp = mr32(MVS_INT_STAT_SRS_1);
644 if (tmp) {
645 mv_dprintk("check SRS 1 %08X.\n", tmp);
646 mw32(MVS_INT_STAT_SRS_1, tmp);
647 }
648 } else {
649 if (reg_set > 31)
650 tmp = mr32(MVS_INT_STAT_SRS_1);
651 else
652 tmp = mr32(MVS_INT_STAT_SRS_0);
653
654 if (tmp & (1 << (reg_set % 32))) {
655 mv_dprintk("register set 0x%x was stopped.\n", reg_set);
656 if (reg_set > 31)
657 mw32(MVS_INT_STAT_SRS_1, 1 << (reg_set % 32));
658 else
659 mw32(MVS_INT_STAT_SRS_0, 1 << (reg_set % 32));
660 }
661 }
Andy Yan20b09c22009-05-08 17:46:40 -0400662}
663
664static void mvs_94xx_issue_stop(struct mvs_info *mvi, enum mvs_port_type type,
665 u32 tfs)
666{
667 void __iomem *regs = mvi->regs;
668 u32 tmp;
Xiangliang Yua4632aa2011-05-24 22:36:02 +0800669 mvs_94xx_clear_srs_irq(mvi, 0, 1);
Andy Yan20b09c22009-05-08 17:46:40 -0400670
Xiangliang Yua4632aa2011-05-24 22:36:02 +0800671 tmp = mr32(MVS_INT_STAT);
672 mw32(MVS_INT_STAT, tmp | CINT_CI_STOP);
Andy Yan20b09c22009-05-08 17:46:40 -0400673 tmp = mr32(MVS_PCS) | 0xFF00;
674 mw32(MVS_PCS, tmp);
675}
676
Xiangliang Yu534ff102011-05-24 22:26:50 +0800677static void mvs_94xx_non_spec_ncq_error(struct mvs_info *mvi)
678{
679 void __iomem *regs = mvi->regs;
680 u32 err_0, err_1;
681 u8 i;
682 struct mvs_device *device;
683
684 err_0 = mr32(MVS_NON_NCQ_ERR_0);
685 err_1 = mr32(MVS_NON_NCQ_ERR_1);
686
687 mv_dprintk("non specific ncq error err_0:%x,err_1:%x.\n",
688 err_0, err_1);
689 for (i = 0; i < 32; i++) {
690 if (err_0 & bit(i)) {
691 device = mvs_find_dev_by_reg_set(mvi, i);
692 if (device)
693 mvs_release_task(mvi, device->sas_device);
694 }
695 if (err_1 & bit(i)) {
696 device = mvs_find_dev_by_reg_set(mvi, i+32);
697 if (device)
698 mvs_release_task(mvi, device->sas_device);
699 }
700 }
701
702 mw32(MVS_NON_NCQ_ERR_0, err_0);
703 mw32(MVS_NON_NCQ_ERR_1, err_1);
704}
705
Andy Yan20b09c22009-05-08 17:46:40 -0400706static void mvs_94xx_free_reg_set(struct mvs_info *mvi, u8 *tfs)
707{
708 void __iomem *regs = mvi->regs;
Andy Yan20b09c22009-05-08 17:46:40 -0400709 u8 reg_set = *tfs;
710
711 if (*tfs == MVS_ID_NOT_MAPPED)
712 return;
713
714 mvi->sata_reg_set &= ~bit(reg_set);
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800715 if (reg_set < 32)
Andy Yan20b09c22009-05-08 17:46:40 -0400716 w_reg_set_enable(reg_set, (u32)mvi->sata_reg_set);
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800717 else
718 w_reg_set_enable(reg_set, (u32)(mvi->sata_reg_set >> 32));
Andy Yan20b09c22009-05-08 17:46:40 -0400719
720 *tfs = MVS_ID_NOT_MAPPED;
721
722 return;
723}
724
725static u8 mvs_94xx_assign_reg_set(struct mvs_info *mvi, u8 *tfs)
726{
727 int i;
728 void __iomem *regs = mvi->regs;
729
730 if (*tfs != MVS_ID_NOT_MAPPED)
731 return 0;
732
733 i = mv_ffc64(mvi->sata_reg_set);
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800734 if (i >= 32) {
Andy Yan20b09c22009-05-08 17:46:40 -0400735 mvi->sata_reg_set |= bit(i);
736 w_reg_set_enable(i, (u32)(mvi->sata_reg_set >> 32));
737 *tfs = i;
738 return 0;
739 } else if (i >= 0) {
740 mvi->sata_reg_set |= bit(i);
741 w_reg_set_enable(i, (u32)mvi->sata_reg_set);
742 *tfs = i;
743 return 0;
744 }
745 return MVS_ID_NOT_MAPPED;
746}
747
748static void mvs_94xx_make_prd(struct scatterlist *scatter, int nr, void *prd)
749{
750 int i;
751 struct scatterlist *sg;
752 struct mvs_prd *buf_prd = prd;
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800753 struct mvs_prd_imt im_len;
754 *(u32 *)&im_len = 0;
Andy Yan20b09c22009-05-08 17:46:40 -0400755 for_each_sg(scatter, sg, nr, i) {
756 buf_prd->addr = cpu_to_le64(sg_dma_address(sg));
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800757 im_len.len = sg_dma_len(sg);
758 buf_prd->im_len = cpu_to_le32(*(u32 *)&im_len);
Andy Yan20b09c22009-05-08 17:46:40 -0400759 buf_prd++;
760 }
761}
762
763static int mvs_94xx_oob_done(struct mvs_info *mvi, int i)
764{
765 u32 phy_st;
766 phy_st = mvs_read_phy_ctl(mvi, i);
Xiangliang Yue144f7e2011-05-24 22:38:10 +0800767 if (phy_st & PHY_READY_MASK)
Andy Yan20b09c22009-05-08 17:46:40 -0400768 return 1;
769 return 0;
770}
771
772static void mvs_94xx_get_dev_identify_frame(struct mvs_info *mvi, int port_id,
773 struct sas_identify_frame *id)
774{
775 int i;
776 u32 id_frame[7];
777
778 for (i = 0; i < 7; i++) {
779 mvs_write_port_cfg_addr(mvi, port_id,
780 CONFIG_ID_FRAME0 + i * 4);
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800781 id_frame[i] = cpu_to_le32(mvs_read_port_cfg_data(mvi, port_id));
Andy Yan20b09c22009-05-08 17:46:40 -0400782 }
783 memcpy(id, id_frame, 28);
784}
785
786static void mvs_94xx_get_att_identify_frame(struct mvs_info *mvi, int port_id,
787 struct sas_identify_frame *id)
788{
789 int i;
790 u32 id_frame[7];
791
Andy Yan20b09c22009-05-08 17:46:40 -0400792 for (i = 0; i < 7; i++) {
793 mvs_write_port_cfg_addr(mvi, port_id,
794 CONFIG_ATT_ID_FRAME0 + i * 4);
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800795 id_frame[i] = cpu_to_le32(mvs_read_port_cfg_data(mvi, port_id));
Andy Yan20b09c22009-05-08 17:46:40 -0400796 mv_dprintk("94xx phy %d atta frame %d %x.\n",
797 port_id + mvi->id * mvi->chip->n_phy, i, id_frame[i]);
798 }
Andy Yan20b09c22009-05-08 17:46:40 -0400799 memcpy(id, id_frame, 28);
800}
801
802static u32 mvs_94xx_make_dev_info(struct sas_identify_frame *id)
803{
804 u32 att_dev_info = 0;
805
806 att_dev_info |= id->dev_type;
807 if (id->stp_iport)
808 att_dev_info |= PORT_DEV_STP_INIT;
809 if (id->smp_iport)
810 att_dev_info |= PORT_DEV_SMP_INIT;
811 if (id->ssp_iport)
812 att_dev_info |= PORT_DEV_SSP_INIT;
813 if (id->stp_tport)
814 att_dev_info |= PORT_DEV_STP_TRGT;
815 if (id->smp_tport)
816 att_dev_info |= PORT_DEV_SMP_TRGT;
817 if (id->ssp_tport)
818 att_dev_info |= PORT_DEV_SSP_TRGT;
819
820 att_dev_info |= (u32)id->phy_id<<24;
821 return att_dev_info;
822}
823
824static u32 mvs_94xx_make_att_info(struct sas_identify_frame *id)
825{
826 return mvs_94xx_make_dev_info(id);
827}
828
829static void mvs_94xx_fix_phy_info(struct mvs_info *mvi, int i,
830 struct sas_identify_frame *id)
831{
832 struct mvs_phy *phy = &mvi->phy[i];
833 struct asd_sas_phy *sas_phy = &phy->sas_phy;
834 mv_dprintk("get all reg link rate is 0x%x\n", phy->phy_status);
835 sas_phy->linkrate =
836 (phy->phy_status & PHY_NEG_SPP_PHYS_LINK_RATE_MASK) >>
837 PHY_NEG_SPP_PHYS_LINK_RATE_MASK_OFFSET;
838 sas_phy->linkrate += 0x8;
839 mv_dprintk("get link rate is %d\n", sas_phy->linkrate);
840 phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS;
841 phy->maximum_linkrate = SAS_LINK_RATE_6_0_GBPS;
842 mvs_94xx_get_dev_identify_frame(mvi, i, id);
843 phy->dev_info = mvs_94xx_make_dev_info(id);
844
845 if (phy->phy_type & PORT_TYPE_SAS) {
846 mvs_94xx_get_att_identify_frame(mvi, i, id);
847 phy->att_dev_info = mvs_94xx_make_att_info(id);
848 phy->att_dev_sas_addr = *(u64 *)id->sas_addr;
849 } else {
850 phy->att_dev_info = PORT_DEV_STP_TRGT | 1;
851 }
852
Xiangliang Yu477f6d12011-09-29 00:33:49 -0700853 /* enable spin up bit */
854 mvs_write_port_cfg_addr(mvi, i, PHYR_PHY_STAT);
855 mvs_write_port_cfg_data(mvi, i, 0x04);
856
Andy Yan20b09c22009-05-08 17:46:40 -0400857}
858
859void mvs_94xx_phy_set_link_rate(struct mvs_info *mvi, u32 phy_id,
860 struct sas_phy_linkrates *rates)
861{
Xiangliang Yua4632aa2011-05-24 22:36:02 +0800862 u32 lrmax = 0;
863 u32 tmp;
864
865 tmp = mvs_read_phy_ctl(mvi, phy_id);
866 lrmax = (rates->maximum_linkrate - SAS_LINK_RATE_1_5_GBPS) << 12;
867
868 if (lrmax) {
869 tmp &= ~(0x3 << 12);
870 tmp |= lrmax;
871 }
872 mvs_write_phy_ctl(mvi, phy_id, tmp);
873 mvs_94xx_phy_reset(mvi, phy_id, PHY_RST_HARD);
Andy Yan20b09c22009-05-08 17:46:40 -0400874}
875
876static void mvs_94xx_clear_active_cmds(struct mvs_info *mvi)
877{
878 u32 tmp;
879 void __iomem *regs = mvi->regs;
880 tmp = mr32(MVS_STP_REG_SET_0);
881 mw32(MVS_STP_REG_SET_0, 0);
882 mw32(MVS_STP_REG_SET_0, tmp);
883 tmp = mr32(MVS_STP_REG_SET_1);
884 mw32(MVS_STP_REG_SET_1, 0);
885 mw32(MVS_STP_REG_SET_1, tmp);
886}
887
888
889u32 mvs_94xx_spi_read_data(struct mvs_info *mvi)
890{
891 void __iomem *regs = mvi->regs_ex - 0x10200;
892 return mr32(SPI_RD_DATA_REG_94XX);
893}
894
895void mvs_94xx_spi_write_data(struct mvs_info *mvi, u32 data)
896{
897 void __iomem *regs = mvi->regs_ex - 0x10200;
898 mw32(SPI_RD_DATA_REG_94XX, data);
899}
900
901
902int mvs_94xx_spi_buildcmd(struct mvs_info *mvi,
903 u32 *dwCmd,
904 u8 cmd,
905 u8 read,
906 u8 length,
907 u32 addr
908 )
909{
910 void __iomem *regs = mvi->regs_ex - 0x10200;
911 u32 dwTmp;
912
913 dwTmp = ((u32)cmd << 8) | ((u32)length << 4);
914 if (read)
915 dwTmp |= SPI_CTRL_READ_94XX;
916
917 if (addr != MV_MAX_U32) {
918 mw32(SPI_ADDR_REG_94XX, (addr & 0x0003FFFFL));
919 dwTmp |= SPI_ADDR_VLD_94XX;
920 }
921
922 *dwCmd = dwTmp;
923 return 0;
924}
925
926
927int mvs_94xx_spi_issuecmd(struct mvs_info *mvi, u32 cmd)
928{
929 void __iomem *regs = mvi->regs_ex - 0x10200;
930 mw32(SPI_CTRL_REG_94XX, cmd | SPI_CTRL_SpiStart_94XX);
931
932 return 0;
933}
934
935int mvs_94xx_spi_waitdataready(struct mvs_info *mvi, u32 timeout)
936{
937 void __iomem *regs = mvi->regs_ex - 0x10200;
938 u32 i, dwTmp;
939
940 for (i = 0; i < timeout; i++) {
941 dwTmp = mr32(SPI_CTRL_REG_94XX);
942 if (!(dwTmp & SPI_CTRL_SpiStart_94XX))
943 return 0;
944 msleep(10);
945 }
946
947 return -1;
948}
949
Xiangliang Yu8882f082011-05-24 22:33:11 +0800950void mvs_94xx_fix_dma(struct mvs_info *mvi, u32 phy_mask,
951 int buf_len, int from, void *prd)
Andy Yan20b09c22009-05-08 17:46:40 -0400952{
953 int i;
954 struct mvs_prd *buf_prd = prd;
Xiangliang Yu8882f082011-05-24 22:33:11 +0800955 dma_addr_t buf_dma;
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800956 struct mvs_prd_imt im_len;
957
958 *(u32 *)&im_len = 0;
Andy Yan20b09c22009-05-08 17:46:40 -0400959 buf_prd += from;
Xiangliang Yu8882f082011-05-24 22:33:11 +0800960
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800961#define PRD_CHAINED_ENTRY 0x01
Xiangliang Yu8882f082011-05-24 22:33:11 +0800962 if ((mvi->pdev->revision == VANIR_A0_REV) ||
963 (mvi->pdev->revision == VANIR_B0_REV))
964 buf_dma = (phy_mask <= 0x08) ?
965 mvi->bulk_buffer_dma : mvi->bulk_buffer_dma1;
966 else
967 return;
968
Xiangliang Yu84fbd0c2011-05-24 22:37:25 +0800969 for (i = from; i < MAX_SG_ENTRY; i++, ++buf_prd) {
970 if (i == MAX_SG_ENTRY - 1) {
971 buf_prd->addr = cpu_to_le64(virt_to_phys(buf_prd - 1));
972 im_len.len = 2;
973 im_len.misc_ctl = PRD_CHAINED_ENTRY;
974 } else {
975 buf_prd->addr = cpu_to_le64(buf_dma);
976 im_len.len = buf_len;
977 }
978 buf_prd->im_len = cpu_to_le32(*(u32 *)&im_len);
Andy Yan20b09c22009-05-08 17:46:40 -0400979 }
980}
Andy Yan20b09c22009-05-08 17:46:40 -0400981
Xiangliang Yu83c7b612011-05-24 22:31:47 +0800982static void mvs_94xx_tune_interrupt(struct mvs_info *mvi, u32 time)
983{
984 void __iomem *regs = mvi->regs;
985 u32 tmp = 0;
Xiangliang Yue144f7e2011-05-24 22:38:10 +0800986 /*
987 * the max count is 0x1ff, while our max slot is 0x200,
Xiangliang Yu83c7b612011-05-24 22:31:47 +0800988 * it will make count 0.
989 */
990 if (time == 0) {
991 mw32(MVS_INT_COAL, 0);
992 mw32(MVS_INT_COAL_TMOUT, 0x10000);
993 } else {
994 if (MVS_CHIP_SLOT_SZ > 0x1ff)
995 mw32(MVS_INT_COAL, 0x1ff|COAL_EN);
996 else
997 mw32(MVS_INT_COAL, MVS_CHIP_SLOT_SZ|COAL_EN);
998
999 tmp = 0x10000 | time;
1000 mw32(MVS_INT_COAL_TMOUT, tmp);
1001 }
1002
1003}
1004
Andy Yan20b09c22009-05-08 17:46:40 -04001005const struct mvs_dispatch mvs_94xx_dispatch = {
1006 "mv94xx",
1007 mvs_94xx_init,
1008 NULL,
1009 mvs_94xx_ioremap,
1010 mvs_94xx_iounmap,
1011 mvs_94xx_isr,
1012 mvs_94xx_isr_status,
1013 mvs_94xx_interrupt_enable,
1014 mvs_94xx_interrupt_disable,
1015 mvs_read_phy_ctl,
1016 mvs_write_phy_ctl,
1017 mvs_read_port_cfg_data,
1018 mvs_write_port_cfg_data,
1019 mvs_write_port_cfg_addr,
1020 mvs_read_port_vsr_data,
1021 mvs_write_port_vsr_data,
1022 mvs_write_port_vsr_addr,
1023 mvs_read_port_irq_stat,
1024 mvs_write_port_irq_stat,
1025 mvs_read_port_irq_mask,
1026 mvs_write_port_irq_mask,
Andy Yan20b09c22009-05-08 17:46:40 -04001027 mvs_94xx_command_active,
Srinivas9dc9fd92010-02-15 00:00:00 -06001028 mvs_94xx_clear_srs_irq,
Andy Yan20b09c22009-05-08 17:46:40 -04001029 mvs_94xx_issue_stop,
1030 mvs_start_delivery,
1031 mvs_rx_update,
1032 mvs_int_full,
1033 mvs_94xx_assign_reg_set,
1034 mvs_94xx_free_reg_set,
1035 mvs_get_prd_size,
1036 mvs_get_prd_count,
1037 mvs_94xx_make_prd,
1038 mvs_94xx_detect_porttype,
1039 mvs_94xx_oob_done,
1040 mvs_94xx_fix_phy_info,
1041 NULL,
1042 mvs_94xx_phy_set_link_rate,
1043 mvs_hw_max_link_rate,
1044 mvs_94xx_phy_disable,
1045 mvs_94xx_phy_enable,
1046 mvs_94xx_phy_reset,
1047 NULL,
1048 mvs_94xx_clear_active_cmds,
1049 mvs_94xx_spi_read_data,
1050 mvs_94xx_spi_write_data,
1051 mvs_94xx_spi_buildcmd,
1052 mvs_94xx_spi_issuecmd,
1053 mvs_94xx_spi_waitdataready,
Andy Yan20b09c22009-05-08 17:46:40 -04001054 mvs_94xx_fix_dma,
Xiangliang Yu83c7b612011-05-24 22:31:47 +08001055 mvs_94xx_tune_interrupt,
Xiangliang Yu534ff102011-05-24 22:26:50 +08001056 mvs_94xx_non_spec_ncq_error,
Andy Yan20b09c22009-05-08 17:46:40 -04001057};
1058