|
Lines 165-171
Link Here
|
| 165 |
/* board_2037x */ |
165 |
/* board_2037x */ |
| 166 |
{ |
166 |
{ |
| 167 |
.sht = &pdc_ata_sht, |
167 |
.sht = &pdc_ata_sht, |
| 168 |
.host_flags = PDC_COMMON_FLAGS | ATA_FLAG_SATA, |
168 |
.host_flags = PDC_COMMON_FLAGS /* | ATA_FLAG_SATA */, |
| 169 |
.pio_mask = 0x1f, /* pio0-4 */ |
169 |
.pio_mask = 0x1f, /* pio0-4 */ |
| 170 |
.mwdma_mask = 0x07, /* mwdma0-2 */ |
170 |
.mwdma_mask = 0x07, /* mwdma0-2 */ |
| 171 |
.udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
171 |
.udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
|
Lines 323-339
Link Here
|
| 323 |
static void pdc_sata_phy_reset(struct ata_port *ap) |
323 |
static void pdc_sata_phy_reset(struct ata_port *ap) |
| 324 |
{ |
324 |
{ |
| 325 |
pdc_reset_port(ap); |
325 |
pdc_reset_port(ap); |
| 326 |
sata_phy_reset(ap); |
326 |
if (ap->flags & ATA_FLAG_SATA) |
|
|
327 |
sata_phy_reset(ap); |
| 328 |
else |
| 329 |
pdc_pata_phy_reset(ap); |
| 330 |
} |
| 331 |
|
| 332 |
static void pdc_pata_cbl_detect(struct ata_port *ap) |
| 333 |
{ |
| 334 |
u8 tmp; |
| 335 |
void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; |
| 336 |
|
| 337 |
tmp = readb(mmio); |
| 338 |
|
| 339 |
if (tmp & 0x01) |
| 340 |
{ |
| 341 |
ap->cbl = ATA_CBL_PATA40; |
| 342 |
ap->udma_mask &= ATA_UDMA_MASK_40C; |
| 343 |
} |
| 344 |
else |
| 345 |
ap->cbl = ATA_CBL_PATA80; |
| 327 |
} |
346 |
} |
| 328 |
|
347 |
|
| 329 |
static void pdc_pata_phy_reset(struct ata_port *ap) |
348 |
static void pdc_pata_phy_reset(struct ata_port *ap) |
| 330 |
{ |
349 |
{ |
| 331 |
/* FIXME: add cable detect. Don't assume 40-pin cable */ |
350 |
pdc_pata_cbl_detect(ap); |
| 332 |
ap->cbl = ATA_CBL_PATA40; |
351 |
|
| 333 |
ap->udma_mask &= ATA_UDMA_MASK_40C; |
|
|
| 334 |
|
| 335 |
pdc_reset_port(ap); |
| 336 |
ata_port_probe(ap); |
352 |
ata_port_probe(ap); |
|
|
353 |
|
| 337 |
ata_bus_reset(ap); |
354 |
ata_bus_reset(ap); |
| 338 |
} |
355 |
} |
| 339 |
|
356 |
|
|
Lines 646-651
Link Here
|
| 646 |
unsigned int board_idx = (unsigned int) ent->driver_data; |
663 |
unsigned int board_idx = (unsigned int) ent->driver_data; |
| 647 |
int pci_dev_busy = 0; |
664 |
int pci_dev_busy = 0; |
| 648 |
int rc; |
665 |
int rc; |
|
|
666 |
u8 tmp; |
| 649 |
|
667 |
|
| 650 |
if (!printed_version++) |
668 |
if (!printed_version++) |
| 651 |
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); |
669 |
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); |
|
Lines 704-709
Link Here
|
| 704 |
|
722 |
|
| 705 |
probe_ent->port[0].scr_addr = base + 0x400; |
723 |
probe_ent->port[0].scr_addr = base + 0x400; |
| 706 |
probe_ent->port[1].scr_addr = base + 0x500; |
724 |
probe_ent->port[1].scr_addr = base + 0x500; |
|
|
725 |
|
| 726 |
probe_ent->port_flags[0] = ATA_FLAG_SATA; |
| 727 |
probe_ent->port_flags[1] = ATA_FLAG_SATA; |
| 707 |
|
728 |
|
| 708 |
/* notice 4-port boards */ |
729 |
/* notice 4-port boards */ |
| 709 |
switch (board_idx) { |
730 |
switch (board_idx) { |
|
Lines 717-723
Link Here
|
| 717 |
probe_ent->port[3].scr_addr = base + 0x700; |
738 |
probe_ent->port[3].scr_addr = base + 0x700; |
| 718 |
break; |
739 |
break; |
| 719 |
case board_2037x: |
740 |
case board_2037x: |
| 720 |
probe_ent->n_ports = 2; |
741 |
/* Some boards have also PATA port */ |
|
|
742 |
tmp = readb(mmio_base + PDC_FLASH_CTL+1); |
| 743 |
if (!(tmp & 0x80)) |
| 744 |
{ |
| 745 |
probe_ent->n_ports = 3; |
| 746 |
|
| 747 |
pdc_ata_setup_port(&probe_ent->port[2], base + 0x300); |
| 748 |
|
| 749 |
probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS; |
| 750 |
|
| 751 |
printk(KERN_INFO DRV_NAME " PATA port found\n"); |
| 752 |
} |
| 753 |
else |
| 754 |
probe_ent->n_ports = 2; |
| 721 |
break; |
755 |
break; |
| 722 |
case board_20771: |
756 |
case board_20771: |
| 723 |
probe_ent->n_ports = 2; |
757 |
probe_ent->n_ports = 2; |
|
Lines 730-735
Link Here
|
| 730 |
|
764 |
|
| 731 |
probe_ent->port[2].scr_addr = base + 0x600; |
765 |
probe_ent->port[2].scr_addr = base + 0x600; |
| 732 |
probe_ent->port[3].scr_addr = base + 0x700; |
766 |
probe_ent->port[3].scr_addr = base + 0x700; |
|
|
767 |
|
| 768 |
probe_ent->port_flags[2] = ATA_FLAG_SATA; |
| 769 |
probe_ent->port_flags[3] = ATA_FLAG_SATA; |
| 733 |
break; |
770 |
break; |
| 734 |
default: |
771 |
default: |
| 735 |
BUG(); |
772 |
BUG(); |