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

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