diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-30 01:04:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-30 01:04:58 -0400 |
commit | a8e4f435d9ea38bfe9171d7458b2057d440825b1 (patch) | |
tree | 817ed67ed85f04e821f5ad980fc53ed76fb57d06 | |
parent | 8bc2bee26bc7ba77eb1ffc3e3282002d9893cf09 (diff) | |
parent | 502c7f1dd566e7ca8aabdb755182664c5fdaebf1 (diff) |
Merge refs/heads/upstream from master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
-rw-r--r-- | drivers/scsi/sata_promise.c | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c index 4d8201422a12..7c4f6ecc1cc9 100644 --- a/drivers/scsi/sata_promise.c +++ b/drivers/scsi/sata_promise.c | |||
@@ -84,7 +84,8 @@ static irqreturn_t pdc_interrupt (int irq, void *dev_instance, struct pt_regs *r | |||
84 | static void pdc_eng_timeout(struct ata_port *ap); | 84 | static void pdc_eng_timeout(struct ata_port *ap); |
85 | static int pdc_port_start(struct ata_port *ap); | 85 | static int pdc_port_start(struct ata_port *ap); |
86 | static void pdc_port_stop(struct ata_port *ap); | 86 | static void pdc_port_stop(struct ata_port *ap); |
87 | 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); | ||
88 | static void pdc_qc_prep(struct ata_queued_cmd *qc); | 89 | static void pdc_qc_prep(struct ata_queued_cmd *qc); |
89 | 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); |
90 | 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); |
@@ -111,19 +112,22 @@ static Scsi_Host_Template pdc_ata_sht = { | |||
111 | .ordered_flush = 1, | 112 | .ordered_flush = 1, |
112 | }; | 113 | }; |
113 | 114 | ||
114 | static struct ata_port_operations pdc_ata_ops = { | 115 | static struct ata_port_operations pdc_sata_ops = { |
115 | .port_disable = ata_port_disable, | 116 | .port_disable = ata_port_disable, |
116 | .tf_load = pdc_tf_load_mmio, | 117 | .tf_load = pdc_tf_load_mmio, |
117 | .tf_read = ata_tf_read, | 118 | .tf_read = ata_tf_read, |
118 | .check_status = ata_check_status, | 119 | .check_status = ata_check_status, |
119 | .exec_command = pdc_exec_command_mmio, | 120 | .exec_command = pdc_exec_command_mmio, |
120 | .dev_select = ata_std_dev_select, | 121 | .dev_select = ata_std_dev_select, |
121 | .phy_reset = pdc_phy_reset, | 122 | |
123 | .phy_reset = pdc_sata_phy_reset, | ||
124 | |||
122 | .qc_prep = pdc_qc_prep, | 125 | .qc_prep = pdc_qc_prep, |
123 | .qc_issue = pdc_qc_issue_prot, | 126 | .qc_issue = pdc_qc_issue_prot, |
124 | .eng_timeout = pdc_eng_timeout, | 127 | .eng_timeout = pdc_eng_timeout, |
125 | .irq_handler = pdc_interrupt, | 128 | .irq_handler = pdc_interrupt, |
126 | .irq_clear = pdc_irq_clear, | 129 | .irq_clear = pdc_irq_clear, |
130 | |||
127 | .scr_read = pdc_sata_scr_read, | 131 | .scr_read = pdc_sata_scr_read, |
128 | .scr_write = pdc_sata_scr_write, | 132 | .scr_write = pdc_sata_scr_write, |
129 | .port_start = pdc_port_start, | 133 | .port_start = pdc_port_start, |
@@ -131,6 +135,27 @@ static struct ata_port_operations pdc_ata_ops = { | |||
131 | .host_stop = ata_host_stop, | 135 | .host_stop = ata_host_stop, |
132 | }; | 136 | }; |
133 | 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 | |||
134 | static struct ata_port_info pdc_port_info[] = { | 159 | static struct ata_port_info pdc_port_info[] = { |
135 | /* board_2037x */ | 160 | /* board_2037x */ |
136 | { | 161 | { |
@@ -140,7 +165,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
140 | .pio_mask = 0x1f, /* pio0-4 */ | 165 | .pio_mask = 0x1f, /* pio0-4 */ |
141 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 166 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
142 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 167 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
143 | .port_ops = &pdc_ata_ops, | 168 | .port_ops = &pdc_sata_ops, |
144 | }, | 169 | }, |
145 | 170 | ||
146 | /* board_20319 */ | 171 | /* board_20319 */ |
@@ -151,7 +176,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
151 | .pio_mask = 0x1f, /* pio0-4 */ | 176 | .pio_mask = 0x1f, /* pio0-4 */ |
152 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 177 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
153 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 178 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
154 | .port_ops = &pdc_ata_ops, | 179 | .port_ops = &pdc_sata_ops, |
155 | }, | 180 | }, |
156 | 181 | ||
157 | /* board_20619 */ | 182 | /* board_20619 */ |
@@ -162,7 +187,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
162 | .pio_mask = 0x1f, /* pio0-4 */ | 187 | .pio_mask = 0x1f, /* pio0-4 */ |
163 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 188 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
164 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 189 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
165 | .port_ops = &pdc_ata_ops, | 190 | .port_ops = &pdc_pata_ops, |
166 | }, | 191 | }, |
167 | }; | 192 | }; |
168 | 193 | ||
@@ -277,12 +302,23 @@ static void pdc_reset_port(struct ata_port *ap) | |||
277 | readl(mmio); /* flush */ | 302 | readl(mmio); /* flush */ |
278 | } | 303 | } |
279 | 304 | ||
280 | static void pdc_phy_reset(struct ata_port *ap) | 305 | static void pdc_sata_phy_reset(struct ata_port *ap) |
281 | { | 306 | { |
282 | pdc_reset_port(ap); | 307 | pdc_reset_port(ap); |
283 | sata_phy_reset(ap); | 308 | sata_phy_reset(ap); |
284 | } | 309 | } |
285 | 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 | |||
286 | 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) |
287 | { | 323 | { |
288 | if (sc_reg > SCR_CONTROL) | 324 | if (sc_reg > SCR_CONTROL) |