diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/sata_promise.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c index bb000438cb6c..285ab0263d91 100644 --- a/drivers/scsi/sata_promise.c +++ b/drivers/scsi/sata_promise.c | |||
@@ -364,12 +364,23 @@ static void pdc_sata_phy_reset(struct ata_port *ap) | |||
364 | sata_phy_reset(ap); | 364 | sata_phy_reset(ap); |
365 | } | 365 | } |
366 | 366 | ||
367 | static void pdc_pata_phy_reset(struct ata_port *ap) | 367 | static void pdc_pata_cbl_detect(struct ata_port *ap) |
368 | { | 368 | { |
369 | /* FIXME: add cable detect. Don't assume 40-pin cable */ | 369 | u8 tmp; |
370 | ap->cbl = ATA_CBL_PATA40; | 370 | void __iomem *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; |
371 | ap->udma_mask &= ATA_UDMA_MASK_40C; | 371 | |
372 | tmp = readb(mmio); | ||
373 | |||
374 | if (tmp & 0x01) { | ||
375 | ap->cbl = ATA_CBL_PATA40; | ||
376 | ap->udma_mask &= ATA_UDMA_MASK_40C; | ||
377 | } else | ||
378 | ap->cbl = ATA_CBL_PATA80; | ||
379 | } | ||
372 | 380 | ||
381 | static void pdc_pata_phy_reset(struct ata_port *ap) | ||
382 | { | ||
383 | pdc_pata_cbl_detect(ap); | ||
373 | pdc_reset_port(ap); | 384 | pdc_reset_port(ap); |
374 | ata_port_probe(ap); | 385 | ata_port_probe(ap); |
375 | ata_bus_reset(ap); | 386 | ata_bus_reset(ap); |