aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mvsas/mv_64xx.h
diff options
context:
space:
mode:
authorAndy Yan <ayan@marvell.com>2009-05-08 17:46:40 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-05-20 18:21:12 -0400
commit20b09c2992fefbe78f8cede7b404fb143a413c52 (patch)
treec7e2368e4dd3f38b66db95fa4982ef009e2df00a /drivers/scsi/mvsas/mv_64xx.h
parentdd4969a892ea522ecf9d7d826ba1531ce044d46f (diff)
[SCSI] mvsas: add support for 94xx; layout change; bug fixes
This version contains following main changes - Switch to new layout to support more types of ASIC. - SSP TMF supported and related Error Handing enhanced. - Support flash feature with delay 2*HZ when PHY changed. - Support Marvell 94xx series ASIC for 6G SAS/SATA, which has 2 88SE64xx chips but any different register description. - Support SPI flash for HBA-related configuration info. - Other patch enhanced from kernel side such as increasing PHY type [jejb: fold back in DMA_BIT_MASK changes] Signed-off-by: Ying Chu <jasonchu@marvell.com> Signed-off-by: Andy Yan <ayan@marvell.com> Signed-off-by: Ke Wei <kewei@marvell.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/mvsas/mv_64xx.h')
-rw-r--r--drivers/scsi/mvsas/mv_64xx.h75
1 files changed, 67 insertions, 8 deletions
diff --git a/drivers/scsi/mvsas/mv_64xx.h b/drivers/scsi/mvsas/mv_64xx.h
index c9f399ebc926..42e947d9795e 100644
--- a/drivers/scsi/mvsas/mv_64xx.h
+++ b/drivers/scsi/mvsas/mv_64xx.h
@@ -1,11 +1,43 @@
1/*
2 * Marvell 88SE64xx hardware specific 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
1#ifndef _MVS64XX_REG_H_ 25#ifndef _MVS64XX_REG_H_
2#define _MVS64XX_REG_H_ 26#define _MVS64XX_REG_H_
3 27
28#include <linux/types.h>
29
30#define MAX_LINK_RATE SAS_LINK_RATE_3_0_GBPS
31
4/* enhanced mode registers (BAR4) */ 32/* enhanced mode registers (BAR4) */
5enum hw_registers { 33enum hw_registers {
6 MVS_GBL_CTL = 0x04, /* global control */ 34 MVS_GBL_CTL = 0x04, /* global control */
7 MVS_GBL_INT_STAT = 0x08, /* global irq status */ 35 MVS_GBL_INT_STAT = 0x08, /* global irq status */
8 MVS_GBL_PI = 0x0C, /* ports implemented bitmask */ 36 MVS_GBL_PI = 0x0C, /* ports implemented bitmask */
37
38 MVS_PHY_CTL = 0x40, /* SOC PHY Control */
39 MVS_PORTS_IMP = 0x9C, /* SOC Port Implemented */
40
9 MVS_GBL_PORT_TYPE = 0xa0, /* port type */ 41 MVS_GBL_PORT_TYPE = 0xa0, /* port type */
10 42
11 MVS_CTL = 0x100, /* SAS/SATA port configuration */ 43 MVS_CTL = 0x100, /* SAS/SATA port configuration */
@@ -30,17 +62,19 @@ enum hw_registers {
30 MVS_INT_COAL_TMOUT = 0x14C, /* Int coalescing timeout */ 62 MVS_INT_COAL_TMOUT = 0x14C, /* Int coalescing timeout */
31 MVS_INT_STAT = 0x150, /* Central int status */ 63 MVS_INT_STAT = 0x150, /* Central int status */
32 MVS_INT_MASK = 0x154, /* Central int enable */ 64 MVS_INT_MASK = 0x154, /* Central int enable */
33 MVS_INT_STAT_SRS = 0x158, /* SATA register set status */ 65 MVS_INT_STAT_SRS_0 = 0x158, /* SATA register set status */
34 MVS_INT_MASK_SRS = 0x15C, 66 MVS_INT_MASK_SRS_0 = 0x15C,
35 67
36 /* ports 1-3 follow after this */ 68 /* ports 1-3 follow after this */
37 MVS_P0_INT_STAT = 0x160, /* port0 interrupt status */ 69 MVS_P0_INT_STAT = 0x160, /* port0 interrupt status */
38 MVS_P0_INT_MASK = 0x164, /* port0 interrupt mask */ 70 MVS_P0_INT_MASK = 0x164, /* port0 interrupt mask */
39 MVS_P4_INT_STAT = 0x200, /* Port 4 interrupt status */ 71 /* ports 5-7 follow after this */
40 MVS_P4_INT_MASK = 0x204, /* Port 4 interrupt enable mask */ 72 MVS_P4_INT_STAT = 0x200, /* Port4 interrupt status */
73 MVS_P4_INT_MASK = 0x204, /* Port4 interrupt enable mask */
41 74
42 /* ports 1-3 follow after this */ 75 /* ports 1-3 follow after this */
43 MVS_P0_SER_CTLSTAT = 0x180, /* port0 serial control/status */ 76 MVS_P0_SER_CTLSTAT = 0x180, /* port0 serial control/status */
77 /* ports 5-7 follow after this */
44 MVS_P4_SER_CTLSTAT = 0x220, /* port4 serial control/status */ 78 MVS_P4_SER_CTLSTAT = 0x220, /* port4 serial control/status */
45 79
46 MVS_CMD_ADDR = 0x1B8, /* Command register port (addr) */ 80 MVS_CMD_ADDR = 0x1B8, /* Command register port (addr) */
@@ -49,20 +83,23 @@ enum hw_registers {
49 /* ports 1-3 follow after this */ 83 /* ports 1-3 follow after this */
50 MVS_P0_CFG_ADDR = 0x1C0, /* port0 phy register address */ 84 MVS_P0_CFG_ADDR = 0x1C0, /* port0 phy register address */
51 MVS_P0_CFG_DATA = 0x1C4, /* port0 phy register data */ 85 MVS_P0_CFG_DATA = 0x1C4, /* port0 phy register data */
52 MVS_P4_CFG_ADDR = 0x230, /* Port 4 config address */ 86 /* ports 5-7 follow after this */
53 MVS_P4_CFG_DATA = 0x234, /* Port 4 config data */ 87 MVS_P4_CFG_ADDR = 0x230, /* Port4 config address */
88 MVS_P4_CFG_DATA = 0x234, /* Port4 config data */
54 89
55 /* ports 1-3 follow after this */ 90 /* ports 1-3 follow after this */
56 MVS_P0_VSR_ADDR = 0x1E0, /* port0 VSR address */ 91 MVS_P0_VSR_ADDR = 0x1E0, /* port0 VSR address */
57 MVS_P0_VSR_DATA = 0x1E4, /* port0 VSR data */ 92 MVS_P0_VSR_DATA = 0x1E4, /* port0 VSR data */
58 MVS_P4_VSR_ADDR = 0x250, /* port 4 VSR addr */ 93 /* ports 5-7 follow after this */
59 MVS_P4_VSR_DATA = 0x254, /* port 4 VSR data */ 94 MVS_P4_VSR_ADDR = 0x250, /* port4 VSR addr */
95 MVS_P4_VSR_DATA = 0x254, /* port4 VSR data */
60}; 96};
61 97
62enum pci_cfg_registers { 98enum pci_cfg_registers {
63 PCR_PHY_CTL = 0x40, 99 PCR_PHY_CTL = 0x40,
64 PCR_PHY_CTL2 = 0x90, 100 PCR_PHY_CTL2 = 0x90,
65 PCR_DEV_CTRL = 0xE8, 101 PCR_DEV_CTRL = 0xE8,
102 PCR_LINK_STAT = 0xF2,
66}; 103};
67 104
68/* SAS/SATA Vendor Specific Port Registers */ 105/* SAS/SATA Vendor Specific Port Registers */
@@ -83,10 +120,32 @@ enum sas_sata_vsp_regs {
83 VSR_PHY_VS1 = 0x0D, /* Vednor Specific 1 */ 120 VSR_PHY_VS1 = 0x0D, /* Vednor Specific 1 */
84}; 121};
85 122
123enum chip_register_bits {
124 PHY_MIN_SPP_PHYS_LINK_RATE_MASK = (0xF << 8),
125 PHY_MAX_SPP_PHYS_LINK_RATE_MASK = (0xF << 12),
126 PHY_NEG_SPP_PHYS_LINK_RATE_MASK_OFFSET = (16),
127 PHY_NEG_SPP_PHYS_LINK_RATE_MASK =
128 (0xF << PHY_NEG_SPP_PHYS_LINK_RATE_MASK_OFFSET),
129};
130
131#define MAX_SG_ENTRY 64
132
86struct mvs_prd { 133struct mvs_prd {
87 __le64 addr; /* 64-bit buffer address */ 134 __le64 addr; /* 64-bit buffer address */
88 __le32 reserved; 135 __le32 reserved;
89 __le32 len; /* 16-bit length */ 136 __le32 len; /* 16-bit length */
90}; 137};
91 138
139#define SPI_CTRL_REG 0xc0
140#define SPI_CTRL_VENDOR_ENABLE (1U<<29)
141#define SPI_CTRL_SPIRDY (1U<<22)
142#define SPI_CTRL_SPISTART (1U<<20)
143
144#define SPI_CMD_REG 0xc4
145#define SPI_DATA_REG 0xc8
146
147#define SPI_CTRL_REG_64XX 0x10
148#define SPI_CMD_REG_64XX 0x14
149#define SPI_DATA_REG_64XX 0x18
150
92#endif 151#endif