[libata sata_promise] Do not attempt to use SATA phy on PATA controllers

+43 -7
+43 -7
drivers/scsi/sata_promise.c
··· 79 79 static void pdc_eng_timeout(struct ata_port *ap); 80 80 static int pdc_port_start(struct ata_port *ap); 81 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 84 static void pdc_qc_prep(struct ata_queued_cmd *qc); 84 85 static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf); 85 86 static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf); ··· 107 106 .ordered_flush = 1, 108 107 }; 109 108 110 - static struct ata_port_operations pdc_ata_ops = { 109 + static struct ata_port_operations pdc_sata_ops = { 111 110 .port_disable = ata_port_disable, 112 111 .tf_load = pdc_tf_load_mmio, 113 112 .tf_read = ata_tf_read, 114 113 .check_status = ata_check_status, 115 114 .exec_command = pdc_exec_command_mmio, 116 115 .dev_select = ata_std_dev_select, 117 - .phy_reset = pdc_phy_reset, 116 + 117 + .phy_reset = pdc_sata_phy_reset, 118 + 118 119 .qc_prep = pdc_qc_prep, 119 120 .qc_issue = pdc_qc_issue_prot, 120 121 .eng_timeout = pdc_eng_timeout, 121 122 .irq_handler = pdc_interrupt, 122 123 .irq_clear = pdc_irq_clear, 124 + 123 125 .scr_read = pdc_sata_scr_read, 124 126 .scr_write = pdc_sata_scr_write, 127 + .port_start = pdc_port_start, 128 + .port_stop = pdc_port_stop, 129 + .host_stop = ata_host_stop, 130 + }; 131 + 132 + static struct ata_port_operations pdc_pata_ops = { 133 + .port_disable = ata_port_disable, 134 + .tf_load = pdc_tf_load_mmio, 135 + .tf_read = ata_tf_read, 136 + .check_status = ata_check_status, 137 + .exec_command = pdc_exec_command_mmio, 138 + .dev_select = ata_std_dev_select, 139 + 140 + .phy_reset = pdc_pata_phy_reset, 141 + 142 + .qc_prep = pdc_qc_prep, 143 + .qc_issue = pdc_qc_issue_prot, 144 + .eng_timeout = pdc_eng_timeout, 145 + .irq_handler = pdc_interrupt, 146 + .irq_clear = pdc_irq_clear, 147 + 125 148 .port_start = pdc_port_start, 126 149 .port_stop = pdc_port_stop, 127 150 .host_stop = ata_host_stop, ··· 160 135 .pio_mask = 0x1f, /* pio0-4 */ 161 136 .mwdma_mask = 0x07, /* mwdma0-2 */ 162 137 .udma_mask = 0x7f, /* udma0-6 ; FIXME */ 163 - .port_ops = &pdc_ata_ops, 138 + .port_ops = &pdc_sata_ops, 164 139 }, 165 140 166 141 /* board_20319 */ ··· 171 146 .pio_mask = 0x1f, /* pio0-4 */ 172 147 .mwdma_mask = 0x07, /* mwdma0-2 */ 173 148 .udma_mask = 0x7f, /* udma0-6 ; FIXME */ 174 - .port_ops = &pdc_ata_ops, 149 + .port_ops = &pdc_sata_ops, 175 150 }, 176 151 177 152 /* board_20619 */ ··· 182 157 .pio_mask = 0x1f, /* pio0-4 */ 183 158 .mwdma_mask = 0x07, /* mwdma0-2 */ 184 159 .udma_mask = 0x7f, /* udma0-6 ; FIXME */ 185 - .port_ops = &pdc_ata_ops, 160 + .port_ops = &pdc_pata_ops, 186 161 }, 187 162 }; 188 163 ··· 293 268 readl(mmio); /* flush */ 294 269 } 295 270 296 - static void pdc_phy_reset(struct ata_port *ap) 271 + static void pdc_sata_phy_reset(struct ata_port *ap) 297 272 { 298 273 pdc_reset_port(ap); 299 274 sata_phy_reset(ap); 275 + } 276 + 277 + static void pdc_pata_phy_reset(struct ata_port *ap) 278 + { 279 + /* FIXME: add cable detect. Don't assume 40-pin cable */ 280 + ap->cbl = ATA_CBL_PATA40; 281 + ap->udma_mask &= ATA_UDMA_MASK_40C; 282 + 283 + pdc_reset_port(ap); 284 + ata_port_probe(ap); 285 + ata_bus_reset(ap); 300 286 } 301 287 302 288 static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)