diff options
Diffstat (limited to 'drivers/scsi/sata_promise.c')
-rw-r--r-- | drivers/scsi/sata_promise.c | 83 |
1 files changed, 62 insertions, 21 deletions
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c index b8dc49fed769..7c4f6ecc1cc9 100644 --- a/drivers/scsi/sata_promise.c +++ b/drivers/scsi/sata_promise.c | |||
@@ -7,21 +7,26 @@ | |||
7 | * | 7 | * |
8 | * Copyright 2003-2004 Red Hat, Inc. | 8 | * Copyright 2003-2004 Red Hat, Inc. |
9 | * | 9 | * |
10 | * The contents of this file are subject to the Open | ||
11 | * Software License version 1.1 that can be found at | ||
12 | * http://www.opensource.org/licenses/osl-1.1.txt and is included herein | ||
13 | * by reference. | ||
14 | * | 10 | * |
15 | * Alternatively, the contents of this file may be used under the terms | 11 | * This program is free software; you can redistribute it and/or modify |
16 | * of the GNU General Public License version 2 (the "GPL") as distributed | 12 | * it under the terms of the GNU General Public License as published by |
17 | * in the kernel source COPYING file, in which case the provisions of | 13 | * the Free Software Foundation; either version 2, or (at your option) |
18 | * the GPL are applicable instead of the above. If you wish to allow | 14 | * any later version. |
19 | * the use of your version of this file only under the terms of the | 15 | * |
20 | * GPL and not to allow others to use your version of this file under | 16 | * This program is distributed in the hope that it will be useful, |
21 | * the OSL, indicate your decision by deleting the provisions above and | 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
22 | * replace them with the notice and other provisions required by the GPL. | 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23 | * If you do not delete the provisions above, a recipient may use your | 19 | * GNU General Public License for more details. |
24 | * version of this file under either the OSL or the GPL. | 20 | * |
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; see the file COPYING. If not, write to | ||
23 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | * | ||
25 | * | ||
26 | * libata documentation is available via 'make {ps|pdf}docs', | ||
27 | * as Documentation/DocBook/libata.* | ||
28 | * | ||
29 | * Hardware information only available under NDA. | ||
25 | * | 30 | * |
26 | */ | 31 | */ |
27 | 32 | ||
@@ -79,7 +84,8 @@ static irqreturn_t pdc_interrupt (int irq, void *dev_instance, struct pt_regs *r | |||
79 | static void pdc_eng_timeout(struct ata_port *ap); | 84 | static void pdc_eng_timeout(struct ata_port *ap); |
80 | static int pdc_port_start(struct ata_port *ap); | 85 | static int pdc_port_start(struct ata_port *ap); |
81 | static void pdc_port_stop(struct ata_port *ap); | 86 | static void pdc_port_stop(struct ata_port *ap); |
82 | static void pdc_phy_reset(struct ata_port *ap); | 87 | static void pdc_pata_phy_reset(struct ata_port *ap); |
88 | static void pdc_sata_phy_reset(struct ata_port *ap); | ||
83 | static void pdc_qc_prep(struct ata_queued_cmd *qc); | 89 | static void pdc_qc_prep(struct ata_queued_cmd *qc); |
84 | static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf); | 90 | static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf); |
85 | static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf); | 91 | static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf); |
@@ -106,19 +112,22 @@ static Scsi_Host_Template pdc_ata_sht = { | |||
106 | .ordered_flush = 1, | 112 | .ordered_flush = 1, |
107 | }; | 113 | }; |
108 | 114 | ||
109 | static struct ata_port_operations pdc_ata_ops = { | 115 | static struct ata_port_operations pdc_sata_ops = { |
110 | .port_disable = ata_port_disable, | 116 | .port_disable = ata_port_disable, |
111 | .tf_load = pdc_tf_load_mmio, | 117 | .tf_load = pdc_tf_load_mmio, |
112 | .tf_read = ata_tf_read, | 118 | .tf_read = ata_tf_read, |
113 | .check_status = ata_check_status, | 119 | .check_status = ata_check_status, |
114 | .exec_command = pdc_exec_command_mmio, | 120 | .exec_command = pdc_exec_command_mmio, |
115 | .dev_select = ata_std_dev_select, | 121 | .dev_select = ata_std_dev_select, |
116 | .phy_reset = pdc_phy_reset, | 122 | |
123 | .phy_reset = pdc_sata_phy_reset, | ||
124 | |||
117 | .qc_prep = pdc_qc_prep, | 125 | .qc_prep = pdc_qc_prep, |
118 | .qc_issue = pdc_qc_issue_prot, | 126 | .qc_issue = pdc_qc_issue_prot, |
119 | .eng_timeout = pdc_eng_timeout, | 127 | .eng_timeout = pdc_eng_timeout, |
120 | .irq_handler = pdc_interrupt, | 128 | .irq_handler = pdc_interrupt, |
121 | .irq_clear = pdc_irq_clear, | 129 | .irq_clear = pdc_irq_clear, |
130 | |||
122 | .scr_read = pdc_sata_scr_read, | 131 | .scr_read = pdc_sata_scr_read, |
123 | .scr_write = pdc_sata_scr_write, | 132 | .scr_write = pdc_sata_scr_write, |
124 | .port_start = pdc_port_start, | 133 | .port_start = pdc_port_start, |
@@ -126,6 +135,27 @@ static struct ata_port_operations pdc_ata_ops = { | |||
126 | .host_stop = ata_host_stop, | 135 | .host_stop = ata_host_stop, |
127 | }; | 136 | }; |
128 | 137 | ||
138 | static struct ata_port_operations pdc_pata_ops = { | ||
139 | .port_disable = ata_port_disable, | ||
140 | .tf_load = pdc_tf_load_mmio, | ||
141 | .tf_read = ata_tf_read, | ||
142 | .check_status = ata_check_status, | ||
143 | .exec_command = pdc_exec_command_mmio, | ||
144 | .dev_select = ata_std_dev_select, | ||
145 | |||
146 | .phy_reset = pdc_pata_phy_reset, | ||
147 | |||
148 | .qc_prep = pdc_qc_prep, | ||
149 | .qc_issue = pdc_qc_issue_prot, | ||
150 | .eng_timeout = pdc_eng_timeout, | ||
151 | .irq_handler = pdc_interrupt, | ||
152 | .irq_clear = pdc_irq_clear, | ||
153 | |||
154 | .port_start = pdc_port_start, | ||
155 | .port_stop = pdc_port_stop, | ||
156 | .host_stop = ata_host_stop, | ||
157 | }; | ||
158 | |||
129 | static struct ata_port_info pdc_port_info[] = { | 159 | static struct ata_port_info pdc_port_info[] = { |
130 | /* board_2037x */ | 160 | /* board_2037x */ |
131 | { | 161 | { |
@@ -135,7 +165,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
135 | .pio_mask = 0x1f, /* pio0-4 */ | 165 | .pio_mask = 0x1f, /* pio0-4 */ |
136 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 166 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
137 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 167 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
138 | .port_ops = &pdc_ata_ops, | 168 | .port_ops = &pdc_sata_ops, |
139 | }, | 169 | }, |
140 | 170 | ||
141 | /* board_20319 */ | 171 | /* board_20319 */ |
@@ -146,7 +176,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
146 | .pio_mask = 0x1f, /* pio0-4 */ | 176 | .pio_mask = 0x1f, /* pio0-4 */ |
147 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 177 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
148 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 178 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
149 | .port_ops = &pdc_ata_ops, | 179 | .port_ops = &pdc_sata_ops, |
150 | }, | 180 | }, |
151 | 181 | ||
152 | /* board_20619 */ | 182 | /* board_20619 */ |
@@ -157,7 +187,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
157 | .pio_mask = 0x1f, /* pio0-4 */ | 187 | .pio_mask = 0x1f, /* pio0-4 */ |
158 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 188 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
159 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 189 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
160 | .port_ops = &pdc_ata_ops, | 190 | .port_ops = &pdc_pata_ops, |
161 | }, | 191 | }, |
162 | }; | 192 | }; |
163 | 193 | ||
@@ -272,12 +302,23 @@ static void pdc_reset_port(struct ata_port *ap) | |||
272 | readl(mmio); /* flush */ | 302 | readl(mmio); /* flush */ |
273 | } | 303 | } |
274 | 304 | ||
275 | static void pdc_phy_reset(struct ata_port *ap) | 305 | static void pdc_sata_phy_reset(struct ata_port *ap) |
276 | { | 306 | { |
277 | pdc_reset_port(ap); | 307 | pdc_reset_port(ap); |
278 | sata_phy_reset(ap); | 308 | sata_phy_reset(ap); |
279 | } | 309 | } |
280 | 310 | ||
311 | static void pdc_pata_phy_reset(struct ata_port *ap) | ||
312 | { | ||
313 | /* FIXME: add cable detect. Don't assume 40-pin cable */ | ||
314 | ap->cbl = ATA_CBL_PATA40; | ||
315 | ap->udma_mask &= ATA_UDMA_MASK_40C; | ||
316 | |||
317 | pdc_reset_port(ap); | ||
318 | ata_port_probe(ap); | ||
319 | ata_bus_reset(ap); | ||
320 | } | ||
321 | |||
281 | static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) | 322 | static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) |
282 | { | 323 | { |
283 | if (sc_reg > SCR_CONTROL) | 324 | if (sc_reg > SCR_CONTROL) |