aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_mv.c
diff options
context:
space:
mode:
authorMark Lord <liml@rtr.ca>2009-03-10 18:51:04 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-03-24 22:35:32 -0400
commit40f21b1124a9552bc093469280eb8239dc5f73d7 (patch)
tree0ce8b6e163fd97033b177e288823c3cddec31419 /drivers/ata/sata_mv.c
parent9223d01b2fdf638a73888ad73a1784fca3454c1e (diff)
sata_mv: cosmetic preparations for IRQ coalescing
Various cosmetic changes in preparation for the IRQ coalescing feature. Note that the various MV_IRQ_COAL_* definitions are restored/renamed in the folloup patch which adds IRQ coalescing to the driver. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r--drivers/ata/sata_mv.c62
1 files changed, 27 insertions, 35 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 8cad3b2fe554..206220ec5820 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1,10 +1,13 @@
1/* 1/*
2 * sata_mv.c - Marvell SATA support 2 * sata_mv.c - Marvell SATA support
3 * 3 *
4 * Copyright 2008: Marvell Corporation, all rights reserved. 4 * Copyright 2008-2009: Marvell Corporation, all rights reserved.
5 * Copyright 2005: EMC Corporation, all rights reserved. 5 * Copyright 2005: EMC Corporation, all rights reserved.
6 * Copyright 2005 Red Hat, Inc. All rights reserved. 6 * Copyright 2005 Red Hat, Inc. All rights reserved.
7 * 7 *
8 * Originally written by Brett Russ.
9 * Extensive overhaul and enhancement by Mark Lord <mlord@pobox.com>.
10 *
8 * Please ALWAYS copy linux-ide@vger.kernel.org on emails. 11 * Please ALWAYS copy linux-ide@vger.kernel.org on emails.
9 * 12 *
10 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
@@ -25,8 +28,6 @@
25/* 28/*
26 * sata_mv TODO list: 29 * sata_mv TODO list:
27 * 30 *
28 * --> Errata workaround for NCQ device errors.
29 *
30 * --> More errata workarounds for PCI-X. 31 * --> More errata workarounds for PCI-X.
31 * 32 *
32 * --> Complete a full errata audit for all chipsets to identify others. 33 * --> Complete a full errata audit for all chipsets to identify others.
@@ -68,6 +69,16 @@
68#define DRV_NAME "sata_mv" 69#define DRV_NAME "sata_mv"
69#define DRV_VERSION "1.26" 70#define DRV_VERSION "1.26"
70 71
72/*
73 * module options
74 */
75
76static int msi;
77#ifdef CONFIG_PCI
78module_param(msi, int, S_IRUGO);
79MODULE_PARM_DESC(msi, "Enable use of PCI MSI (0=off, 1=on)");
80#endif
81
71enum { 82enum {
72 /* BAR's are enumerated in terms of pci_resource_start() terms */ 83 /* BAR's are enumerated in terms of pci_resource_start() terms */
73 MV_PRIMARY_BAR = 0, /* offset 0x10: memory space */ 84 MV_PRIMARY_BAR = 0, /* offset 0x10: memory space */
@@ -78,12 +89,6 @@ enum {
78 MV_MINOR_REG_AREA_SZ = 0x2000, /* 8KB */ 89 MV_MINOR_REG_AREA_SZ = 0x2000, /* 8KB */
79 90
80 MV_PCI_REG_BASE = 0, 91 MV_PCI_REG_BASE = 0,
81 MV_IRQ_COAL_REG_BASE = 0x18000, /* 6xxx part only */
82 MV_IRQ_COAL_CAUSE = (MV_IRQ_COAL_REG_BASE + 0x08),
83 MV_IRQ_COAL_CAUSE_LO = (MV_IRQ_COAL_REG_BASE + 0x88),
84 MV_IRQ_COAL_CAUSE_HI = (MV_IRQ_COAL_REG_BASE + 0x8c),
85 MV_IRQ_COAL_THRESHOLD = (MV_IRQ_COAL_REG_BASE + 0xcc),
86 MV_IRQ_COAL_TIME_THRESHOLD = (MV_IRQ_COAL_REG_BASE + 0xd0),
87 92
88 MV_SATAHC0_REG_BASE = 0x20000, 93 MV_SATAHC0_REG_BASE = 0x20000,
89 MV_FLASH_CTL_OFS = 0x1046c, 94 MV_FLASH_CTL_OFS = 0x1046c,
@@ -115,16 +120,14 @@ enum {
115 120
116 /* Host Flags */ 121 /* Host Flags */
117 MV_FLAG_DUAL_HC = (1 << 30), /* two SATA Host Controllers */ 122 MV_FLAG_DUAL_HC = (1 << 30), /* two SATA Host Controllers */
118 MV_FLAG_IRQ_COALESCE = (1 << 29), /* IRQ coalescing capability */
119 123
120 MV_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 124 MV_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
121 ATA_FLAG_MMIO | ATA_FLAG_PIO_POLLING, 125 ATA_FLAG_MMIO | ATA_FLAG_PIO_POLLING,
122 126
123 MV_GEN_I_FLAGS = MV_COMMON_FLAGS | ATA_FLAG_NO_ATAPI, 127 MV_GEN_I_FLAGS = MV_COMMON_FLAGS | ATA_FLAG_NO_ATAPI,
124 128
125 MV_GEN_II_FLAGS = MV_COMMON_FLAGS | MV_FLAG_IRQ_COALESCE | 129 MV_GEN_II_FLAGS = MV_COMMON_FLAGS | ATA_FLAG_NCQ |
126 ATA_FLAG_PMP | ATA_FLAG_ACPI_SATA | 130 ATA_FLAG_PMP | ATA_FLAG_ACPI_SATA,
127 ATA_FLAG_NCQ,
128 131
129 MV_GEN_IIE_FLAGS = MV_GEN_II_FLAGS | ATA_FLAG_AN, 132 MV_GEN_IIE_FLAGS = MV_GEN_II_FLAGS | ATA_FLAG_AN,
130 133
@@ -179,16 +182,16 @@ enum {
179 PCI_HC_MAIN_IRQ_MASK_OFS = 0x1d64, 182 PCI_HC_MAIN_IRQ_MASK_OFS = 0x1d64,
180 SOC_HC_MAIN_IRQ_CAUSE_OFS = 0x20020, 183 SOC_HC_MAIN_IRQ_CAUSE_OFS = 0x20020,
181 SOC_HC_MAIN_IRQ_MASK_OFS = 0x20024, 184 SOC_HC_MAIN_IRQ_MASK_OFS = 0x20024,
182 ERR_IRQ = (1 << 0), /* shift by port # */ 185 ERR_IRQ = (1 << 0), /* shift by (2 * port #) */
183 DONE_IRQ = (1 << 1), /* shift by port # */ 186 DONE_IRQ = (1 << 1), /* shift by (2 * port #) */
184 HC0_IRQ_PEND = 0x1ff, /* bits 0-8 = HC0's ports */ 187 HC0_IRQ_PEND = 0x1ff, /* bits 0-8 = HC0's ports */
185 HC_SHIFT = 9, /* bits 9-17 = HC1's ports */ 188 HC_SHIFT = 9, /* bits 9-17 = HC1's ports */
186 PCI_ERR = (1 << 18), 189 PCI_ERR = (1 << 18),
187 TRAN_LO_DONE = (1 << 19), /* 6xxx: IRQ coalescing */ 190 TRAN_COAL_LO_DONE = (1 << 19), /* transaction coalescing */
188 TRAN_HI_DONE = (1 << 20), /* 6xxx: IRQ coalescing */ 191 TRAN_COAL_HI_DONE = (1 << 20), /* transaction coalescing */
189 PORTS_0_3_COAL_DONE = (1 << 8), 192 PORTS_0_3_COAL_DONE = (1 << 8), /* HC0 IRQ coalescing */
190 PORTS_4_7_COAL_DONE = (1 << 17), 193 PORTS_4_7_COAL_DONE = (1 << 17), /* HC1 IRQ coalescing */
191 PORTS_0_7_COAL_DONE = (1 << 21), /* 6xxx: IRQ coalescing */ 194 ALL_PORTS_COAL_DONE = (1 << 21), /* GEN_II(E) IRQ coalescing */
192 GPIO_INT = (1 << 22), 195 GPIO_INT = (1 << 22),
193 SELF_INT = (1 << 23), 196 SELF_INT = (1 << 23),
194 TWSI_INT = (1 << 24), 197 TWSI_INT = (1 << 24),
@@ -621,7 +624,7 @@ static struct ata_port_operations mv6_ops = {
621 .softreset = mv_softreset, 624 .softreset = mv_softreset,
622 .error_handler = mv_pmp_error_handler, 625 .error_handler = mv_pmp_error_handler,
623 626
624 .sff_check_status = mv_sff_check_status, 627 .sff_check_status = mv_sff_check_status,
625 .sff_irq_clear = mv_sff_irq_clear, 628 .sff_irq_clear = mv_sff_irq_clear,
626 .check_atapi_dma = mv_check_atapi_dma, 629 .check_atapi_dma = mv_check_atapi_dma,
627 .bmdma_setup = mv_bmdma_setup, 630 .bmdma_setup = mv_bmdma_setup,
@@ -1255,8 +1258,8 @@ static void mv_60x1_errata_sata25(struct ata_port *ap, int want_ncq)
1255} 1258}
1256 1259
1257/** 1260/**
1258 * mv_bmdma_enable - set a magic bit on GEN_IIE to allow bmdma 1261 * mv_bmdma_enable - set a magic bit on GEN_IIE to allow bmdma
1259 * @ap: Port being initialized 1262 * @ap: Port being initialized
1260 * 1263 *
1261 * There are two DMA modes on these chips: basic DMA, and EDMA. 1264 * There are two DMA modes on these chips: basic DMA, and EDMA.
1262 * 1265 *
@@ -2000,7 +2003,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
2000 struct mv_host_priv *hpriv = ap->host->private_data; 2003 struct mv_host_priv *hpriv = ap->host->private_data;
2001 /* 2004 /*
2002 * Workaround for 88SX60x1 FEr SATA#25 (part 2). 2005 * Workaround for 88SX60x1 FEr SATA#25 (part 2).
2003 * 2006 *
2004 * After any NCQ error, the READ_LOG_EXT command 2007 * After any NCQ error, the READ_LOG_EXT command
2005 * from libata-eh *must* use mv_qc_issue_fis(). 2008 * from libata-eh *must* use mv_qc_issue_fis().
2006 * Otherwise it might fail, due to chip errata. 2009 * Otherwise it might fail, due to chip errata.
@@ -3704,12 +3707,6 @@ static struct pci_driver mv_pci_driver = {
3704 .remove = ata_pci_remove_one, 3707 .remove = ata_pci_remove_one,
3705}; 3708};
3706 3709
3707/*
3708 * module options
3709 */
3710static int msi; /* Use PCI msi; either zero (off, default) or non-zero */
3711
3712
3713/* move to PCI layer or libata core? */ 3710/* move to PCI layer or libata core? */
3714static int pci_go_64(struct pci_dev *pdev) 3711static int pci_go_64(struct pci_dev *pdev)
3715{ 3712{
@@ -3891,10 +3888,5 @@ MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
3891MODULE_VERSION(DRV_VERSION); 3888MODULE_VERSION(DRV_VERSION);
3892MODULE_ALIAS("platform:" DRV_NAME); 3889MODULE_ALIAS("platform:" DRV_NAME);
3893 3890
3894#ifdef CONFIG_PCI
3895module_param(msi, int, 0444);
3896MODULE_PARM_DESC(msi, "Enable use of PCI MSI (0=off, 1=on)");
3897#endif
3898
3899module_init(mv_init); 3891module_init(mv_init);
3900module_exit(mv_exit); 3892module_exit(mv_exit);