diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-29 05:12:30 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-29 05:12:30 -0400 |
commit | 2cba582a49f1535c1a12a687cfb3dab713c22cc4 (patch) | |
tree | de96780844fe9181e8e63f72d7af50ef8b18ec49 /drivers/scsi | |
parent | 02b3e4e2d71b6058ec11cc01c72ac651eb3ded2b (diff) |
[libata sata_promise] Do not attempt to use SATA phy on PATA controllers
Diffstat (limited to 'drivers/scsi')
-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 919fb314ad1..ad31b8afec6 100644 --- a/drivers/scsi/sata_promise.c +++ b/drivers/scsi/sata_promise.c | |||
@@ -79,7 +79,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); | 79 | static void pdc_eng_timeout(struct ata_port *ap); |
80 | static int pdc_port_start(struct ata_port *ap); | 80 | static int pdc_port_start(struct ata_port *ap); |
81 | static void pdc_port_stop(struct ata_port *ap); | 81 | static void pdc_port_stop(struct ata_port *ap); |
82 | static void pdc_phy_reset(struct ata_port *ap); | 82 | static void pdc_pata_phy_reset(struct ata_port *ap); |
83 | static void pdc_sata_phy_reset(struct ata_port *ap); | ||
83 | static void pdc_qc_prep(struct ata_queued_cmd *qc); | 84 | 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); | 85 | 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); | 86 | static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf); |
@@ -106,19 +107,22 @@ static Scsi_Host_Template pdc_ata_sht = { | |||
106 | .ordered_flush = 1, | 107 | .ordered_flush = 1, |
107 | }; | 108 | }; |
108 | 109 | ||
109 | static struct ata_port_operations pdc_ata_ops = { | 110 | static struct ata_port_operations pdc_sata_ops = { |
110 | .port_disable = ata_port_disable, | 111 | .port_disable = ata_port_disable, |
111 | .tf_load = pdc_tf_load_mmio, | 112 | .tf_load = pdc_tf_load_mmio, |
112 | .tf_read = ata_tf_read, | 113 | .tf_read = ata_tf_read, |
113 | .check_status = ata_check_status, | 114 | .check_status = ata_check_status, |
114 | .exec_command = pdc_exec_command_mmio, | 115 | .exec_command = pdc_exec_command_mmio, |
115 | .dev_select = ata_std_dev_select, | 116 | .dev_select = ata_std_dev_select, |
116 | .phy_reset = pdc_phy_reset, | 117 | |
118 | .phy_reset = pdc_sata_phy_reset, | ||
119 | |||
117 | .qc_prep = pdc_qc_prep, | 120 | .qc_prep = pdc_qc_prep, |
118 | .qc_issue = pdc_qc_issue_prot, | 121 | .qc_issue = pdc_qc_issue_prot, |
119 | .eng_timeout = pdc_eng_timeout, | 122 | .eng_timeout = pdc_eng_timeout, |
120 | .irq_handler = pdc_interrupt, | 123 | .irq_handler = pdc_interrupt, |
121 | .irq_clear = pdc_irq_clear, | 124 | .irq_clear = pdc_irq_clear, |
125 | |||
122 | .scr_read = pdc_sata_scr_read, | 126 | .scr_read = pdc_sata_scr_read, |
123 | .scr_write = pdc_sata_scr_write, | 127 | .scr_write = pdc_sata_scr_write, |
124 | .port_start = pdc_port_start, | 128 | .port_start = pdc_port_start, |
@@ -126,6 +130,27 @@ static struct ata_port_operations pdc_ata_ops = { | |||
126 | .host_stop = ata_host_stop, | 130 | .host_stop = ata_host_stop, |
127 | }; | 131 | }; |
128 | 132 | ||
133 | static struct ata_port_operations pdc_pata_ops = { | ||
134 | .port_disable = ata_port_disable, | ||
135 | .tf_load = pdc_tf_load_mmio, | ||
136 | .tf_read = ata_tf_read, | ||
137 | .check_status = ata_check_status, | ||
138 | .exec_command = pdc_exec_command_mmio, | ||
139 | .dev_select = ata_std_dev_select, | ||
140 | |||
141 | .phy_reset = pdc_pata_phy_reset, | ||
142 | |||
143 | .qc_prep = pdc_qc_prep, | ||
144 | .qc_issue = pdc_qc_issue_prot, | ||
145 | .eng_timeout = pdc_eng_timeout, | ||
146 | .irq_handler = pdc_interrupt, | ||
147 | .irq_clear = pdc_irq_clear, | ||
148 | |||
149 | .port_start = pdc_port_start, | ||
150 | .port_stop = pdc_port_stop, | ||
151 | .host_stop = ata_host_stop, | ||
152 | }; | ||
153 | |||
129 | static struct ata_port_info pdc_port_info[] = { | 154 | static struct ata_port_info pdc_port_info[] = { |
130 | /* board_2037x */ | 155 | /* board_2037x */ |
131 | { | 156 | { |
@@ -135,7 +160,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
135 | .pio_mask = 0x1f, /* pio0-4 */ | 160 | .pio_mask = 0x1f, /* pio0-4 */ |
136 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 161 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
137 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 162 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
138 | .port_ops = &pdc_ata_ops, | 163 | .port_ops = &pdc_sata_ops, |
139 | }, | 164 | }, |
140 | 165 | ||
141 | /* board_20319 */ | 166 | /* board_20319 */ |
@@ -146,7 +171,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
146 | .pio_mask = 0x1f, /* pio0-4 */ | 171 | .pio_mask = 0x1f, /* pio0-4 */ |
147 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 172 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
148 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 173 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
149 | .port_ops = &pdc_ata_ops, | 174 | .port_ops = &pdc_sata_ops, |
150 | }, | 175 | }, |
151 | 176 | ||
152 | /* board_20619 */ | 177 | /* board_20619 */ |
@@ -157,7 +182,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
157 | .pio_mask = 0x1f, /* pio0-4 */ | 182 | .pio_mask = 0x1f, /* pio0-4 */ |
158 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 183 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
159 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 184 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
160 | .port_ops = &pdc_ata_ops, | 185 | .port_ops = &pdc_pata_ops, |
161 | }, | 186 | }, |
162 | }; | 187 | }; |
163 | 188 | ||
@@ -268,12 +293,23 @@ static void pdc_reset_port(struct ata_port *ap) | |||
268 | readl(mmio); /* flush */ | 293 | readl(mmio); /* flush */ |
269 | } | 294 | } |
270 | 295 | ||
271 | static void pdc_phy_reset(struct ata_port *ap) | 296 | static void pdc_sata_phy_reset(struct ata_port *ap) |
272 | { | 297 | { |
273 | pdc_reset_port(ap); | 298 | pdc_reset_port(ap); |
274 | sata_phy_reset(ap); | 299 | sata_phy_reset(ap); |
275 | } | 300 | } |
276 | 301 | ||
302 | static void pdc_pata_phy_reset(struct ata_port *ap) | ||
303 | { | ||
304 | /* FIXME: add cable detect. Don't assume 40-pin cable */ | ||
305 | ap->cbl = ATA_CBL_PATA40; | ||
306 | ap->udma_mask &= ATA_UDMA_MASK_40C; | ||
307 | |||
308 | pdc_reset_port(ap); | ||
309 | ata_port_probe(ap); | ||
310 | ata_bus_reset(ap); | ||
311 | } | ||
312 | |||
277 | static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) | 313 | static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) |
278 | { | 314 | { |
279 | if (sc_reg > SCR_CONTROL) | 315 | if (sc_reg > SCR_CONTROL) |