|
Lines 79-84
Link Here
|
| 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_pata_cbl_detect(struct ata_port *ap); |
| 83 |
static void pdc_pata_phy_reset(struct ata_port *ap); |
| 82 |
static void pdc_phy_reset(struct ata_port *ap); |
84 |
static void pdc_phy_reset(struct ata_port *ap); |
| 83 |
static void pdc_qc_prep(struct ata_queued_cmd *qc); |
85 |
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); |
86 |
static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf); |
|
Lines 132-138
Link Here
|
| 132 |
/* board_2037x */ |
134 |
/* board_2037x */ |
| 133 |
{ |
135 |
{ |
| 134 |
.sht = &pdc_ata_sht, |
136 |
.sht = &pdc_ata_sht, |
| 135 |
.host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
137 |
.host_flags = /*ATA_FLAG_SATA |*/ ATA_FLAG_NO_LEGACY | |
| 136 |
ATA_FLAG_SRST | ATA_FLAG_MMIO, |
138 |
ATA_FLAG_SRST | ATA_FLAG_MMIO, |
| 137 |
.pio_mask = 0x1f, /* pio0-4 */ |
139 |
.pio_mask = 0x1f, /* pio0-4 */ |
| 138 |
.mwdma_mask = 0x07, /* mwdma0-2 */ |
140 |
.mwdma_mask = 0x07, /* mwdma0-2 */ |
|
Lines 275-283
Link Here
|
| 275 |
static void pdc_phy_reset(struct ata_port *ap) |
277 |
static void pdc_phy_reset(struct ata_port *ap) |
| 276 |
{ |
278 |
{ |
| 277 |
pdc_reset_port(ap); |
279 |
pdc_reset_port(ap); |
| 278 |
sata_phy_reset(ap); |
280 |
if (ap->flags & ATA_FLAG_SATA) |
|
|
281 |
sata_phy_reset(ap); |
| 282 |
else |
| 283 |
pdc_pata_phy_reset(ap); |
| 284 |
} |
| 285 |
|
| 286 |
static void pdc_pata_cbl_detect(struct ata_port *ap) |
| 287 |
{ |
| 288 |
u8 tmp; |
| 289 |
void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; |
| 290 |
|
| 291 |
tmp = readb(mmio); |
| 292 |
|
| 293 |
if (tmp & 0x01) |
| 294 |
{ |
| 295 |
ap->cbl = ATA_CBL_PATA40; |
| 296 |
ap->udma_mask &= ATA_UDMA_MASK_40C; |
| 297 |
} |
| 298 |
else |
| 299 |
ap->cbl = ATA_CBL_PATA80; |
| 279 |
} |
300 |
} |
| 280 |
|
301 |
|
|
|
302 |
static void pdc_pata_phy_reset(struct ata_port *ap) |
| 303 |
{ |
| 304 |
pdc_pata_cbl_detect(ap); |
| 305 |
ata_port_probe(ap); |
| 306 |
ata_bus_reset(ap); |
| 307 |
} |
| 308 |
|
| 309 |
|
| 281 |
static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) |
310 |
static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) |
| 282 |
{ |
311 |
{ |
| 283 |
if (sc_reg > SCR_CONTROL) |
312 |
if (sc_reg > SCR_CONTROL) |
|
Lines 587-592
Link Here
|
| 587 |
unsigned int board_idx = (unsigned int) ent->driver_data; |
616 |
unsigned int board_idx = (unsigned int) ent->driver_data; |
| 588 |
int pci_dev_busy = 0; |
617 |
int pci_dev_busy = 0; |
| 589 |
int rc; |
618 |
int rc; |
|
|
619 |
u8 tmp; |
| 590 |
|
620 |
|
| 591 |
if (!printed_version++) |
621 |
if (!printed_version++) |
| 592 |
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); |
622 |
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); |
|
Lines 647-652
Link Here
|
| 647 |
probe_ent->port[0].scr_addr = base + 0x400; |
677 |
probe_ent->port[0].scr_addr = base + 0x400; |
| 648 |
probe_ent->port[1].scr_addr = base + 0x500; |
678 |
probe_ent->port[1].scr_addr = base + 0x500; |
| 649 |
|
679 |
|
|
|
680 |
probe_ent->port_flags[0] = ATA_FLAG_SATA; |
| 681 |
probe_ent->port_flags[1] = ATA_FLAG_SATA; |
| 682 |
|
| 650 |
/* notice 4-port boards */ |
683 |
/* notice 4-port boards */ |
| 651 |
switch (board_idx) { |
684 |
switch (board_idx) { |
| 652 |
case board_20319: |
685 |
case board_20319: |
|
Lines 657-665
Link Here
|
| 657 |
|
690 |
|
| 658 |
probe_ent->port[2].scr_addr = base + 0x600; |
691 |
probe_ent->port[2].scr_addr = base + 0x600; |
| 659 |
probe_ent->port[3].scr_addr = base + 0x700; |
692 |
probe_ent->port[3].scr_addr = base + 0x700; |
|
|
693 |
|
| 694 |
probe_ent->port_flags[2] = ATA_FLAG_SATA; |
| 695 |
probe_ent->port_flags[3] = ATA_FLAG_SATA; |
| 660 |
break; |
696 |
break; |
| 661 |
case board_2037x: |
697 |
case board_2037x: |
| 662 |
probe_ent->n_ports = 2; |
698 |
/* Some boards have also PATA port */ |
|
|
699 |
tmp = readb(mmio_base + PDC_FLASH_CTL+1); |
| 700 |
if (!(tmp & 0x80)) |
| 701 |
{ |
| 702 |
probe_ent->n_ports = 3; |
| 703 |
|
| 704 |
pdc_ata_setup_port(&probe_ent->port[2], base + 0x300); |
| 705 |
|
| 706 |
probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS; |
| 707 |
|
| 708 |
printk(KERN_INFO DRV_NAME " PATA port found\n"); |
| 709 |
} |
| 710 |
else |
| 711 |
probe_ent->n_ports = 2; |
| 663 |
break; |
712 |
break; |
| 664 |
case board_20619: |
713 |
case board_20619: |
| 665 |
probe_ent->n_ports = 4; |
714 |
probe_ent->n_ports = 4; |