|
Lines 79-84
static void pdc_eng_timeout(struct ata_p
Link Here
|
| 79 |
static int pdc_port_start(struct ata_port *ap); |
79 |
static int pdc_port_start(struct ata_port *ap); |
| 80 |
static void pdc_port_stop(struct ata_port *ap); |
80 |
static void pdc_port_stop(struct ata_port *ap); |
| 81 |
static void pdc_phy_reset(struct ata_port *ap); |
81 |
static void pdc_phy_reset(struct ata_port *ap); |
|
|
82 |
static void pdc_pata_phy_reset(struct ata_port *ap); |
| 83 |
static void pdc_pata_cbl_detect(struct ata_port *ap); |
| 82 |
static void pdc_qc_prep(struct ata_queued_cmd *qc); |
84 |
static void pdc_qc_prep(struct ata_queued_cmd *qc); |
| 83 |
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); |
| 84 |
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); |
|
Lines 128-134
static struct ata_port_info pdc_port_inf
Link Here
|
| 128 |
/* board_2037x */ |
130 |
/* board_2037x */ |
| 129 |
{ |
131 |
{ |
| 130 |
.sht = &pdc_ata_sht, |
132 |
.sht = &pdc_ata_sht, |
| 131 |
.host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
133 |
.host_flags = /* ATA_FLAG_SATA | */ ATA_FLAG_NO_LEGACY | |
| 132 |
ATA_FLAG_SRST | ATA_FLAG_MMIO, |
134 |
ATA_FLAG_SRST | ATA_FLAG_MMIO, |
| 133 |
.pio_mask = 0x1f, /* pio0-4 */ |
135 |
.pio_mask = 0x1f, /* pio0-4 */ |
| 134 |
.mwdma_mask = 0x07, /* mwdma0-2 */ |
136 |
.mwdma_mask = 0x07, /* mwdma0-2 */ |
|
Lines 253-259
static void pdc_reset_port(struct ata_po
Link Here
|
| 253 |
static void pdc_phy_reset(struct ata_port *ap) |
255 |
static void pdc_phy_reset(struct ata_port *ap) |
| 254 |
{ |
256 |
{ |
| 255 |
pdc_reset_port(ap); |
257 |
pdc_reset_port(ap); |
| 256 |
sata_phy_reset(ap); |
258 |
if (ap->flags & ATA_FLAG_SATA) |
|
|
259 |
sata_phy_reset(ap); |
| 260 |
else |
| 261 |
pdc_pata_phy_reset(ap); |
| 262 |
} |
| 263 |
|
| 264 |
static void pdc_pata_cbl_detect(struct ata_port *ap) |
| 265 |
{ |
| 266 |
u8 tmp; |
| 267 |
void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; |
| 268 |
|
| 269 |
tmp = readb(mmio); |
| 270 |
|
| 271 |
if (tmp & 0x01) |
| 272 |
{ |
| 273 |
ap->cbl = ATA_CBL_PATA40; |
| 274 |
ap->udma_mask &= ATA_UDMA_MASK_40C; |
| 275 |
} |
| 276 |
else |
| 277 |
ap->cbl = ATA_CBL_PATA80; |
| 278 |
} |
| 279 |
|
| 280 |
static void pdc_pata_phy_reset(struct ata_port *ap) |
| 281 |
{ |
| 282 |
pdc_pata_cbl_detect(ap); |
| 283 |
|
| 284 |
ata_port_probe(ap); |
| 285 |
|
| 286 |
ata_bus_reset(ap); |
| 257 |
} |
287 |
} |
| 258 |
|
288 |
|
| 259 |
static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) |
289 |
static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) |
|
Lines 559-564
static int pdc_ata_init_one (struct pci_
Link Here
|
| 559 |
unsigned int board_idx = (unsigned int) ent->driver_data; |
589 |
unsigned int board_idx = (unsigned int) ent->driver_data; |
| 560 |
int pci_dev_busy = 0; |
590 |
int pci_dev_busy = 0; |
| 561 |
int rc; |
591 |
int rc; |
|
|
592 |
u8 tmp; |
| 562 |
|
593 |
|
| 563 |
if (!printed_version++) |
594 |
if (!printed_version++) |
| 564 |
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); |
595 |
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); |
|
Lines 619-624
static int pdc_ata_init_one (struct pci_
Link Here
|
| 619 |
probe_ent->port[0].scr_addr = base + 0x400; |
650 |
probe_ent->port[0].scr_addr = base + 0x400; |
| 620 |
probe_ent->port[1].scr_addr = base + 0x500; |
651 |
probe_ent->port[1].scr_addr = base + 0x500; |
| 621 |
|
652 |
|
|
|
653 |
probe_ent->port_flags[0] = ATA_FLAG_SATA; |
| 654 |
probe_ent->port_flags[1] = ATA_FLAG_SATA; |
| 655 |
|
| 622 |
/* notice 4-port boards */ |
656 |
/* notice 4-port boards */ |
| 623 |
switch (board_idx) { |
657 |
switch (board_idx) { |
| 624 |
case board_20319: |
658 |
case board_20319: |
|
Lines 629-637
static int pdc_ata_init_one (struct pci_
Link Here
|
| 629 |
|
663 |
|
| 630 |
probe_ent->port[2].scr_addr = base + 0x600; |
664 |
probe_ent->port[2].scr_addr = base + 0x600; |
| 631 |
probe_ent->port[3].scr_addr = base + 0x700; |
665 |
probe_ent->port[3].scr_addr = base + 0x700; |
|
|
666 |
|
| 667 |
probe_ent->port_flags[2] = ATA_FLAG_SATA; |
| 668 |
probe_ent->port_flags[3] = ATA_FLAG_SATA; |
| 632 |
break; |
669 |
break; |
| 633 |
case board_2037x: |
670 |
case board_2037x: |
| 634 |
probe_ent->n_ports = 2; |
671 |
/* Some boards have also PATA port */ |
|
|
672 |
tmp = readb(mmio_base + PDC_FLASH_CTL+1); |
| 673 |
if (!(tmp & 0x80)) |
| 674 |
{ |
| 675 |
probe_ent->n_ports = 3; |
| 676 |
|
| 677 |
pdc_ata_setup_port(&probe_ent->port[2], base + 0x300); |
| 678 |
|
| 679 |
probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS; |
| 680 |
|
| 681 |
printk(KERN_INFO DRV_NAME " PATA port found\n"); |
| 682 |
} |
| 683 |
else |
| 684 |
probe_ent->n_ports = 2; |
| 635 |
break; |
685 |
break; |
| 636 |
default: |
686 |
default: |
| 637 |
BUG(); |
687 |
BUG(); |