diff options
author | Søren Schmidt <sos@FreeBSD.org> | 2001-04-06 19:18:35 +0000 |
---|---|---|
committer | Søren Schmidt <sos@FreeBSD.org> | 2001-04-06 19:18:35 +0000 |
commit | 8018014f592282becdfdb06e9a14c6ecb6f68e27 (patch) | |
tree | 9a4a2aa26aa2c586b87edf0d3a8eeec285e6a8f1 /sys/dev | |
parent | da813eae92f3805f64b99c98d1b1a93437bc5897 (diff) | |
download | src-8018014f592282becdfdb06e9a14c6ecb6f68e27.tar.gz src-8018014f592282becdfdb06e9a14c6ecb6f68e27.zip |
Add ATA66 and ATA100 mode support for Acer chipsets.
MFC candidate :)
Notes
Notes:
svn path=/head/; revision=75271
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/ata-dma.c | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c index e6cf1ca72c87..fbb4fb7106a4 100644 --- a/sys/dev/ata/ata-dma.c +++ b/sys/dev/ata/ata-dma.c @@ -284,15 +284,56 @@ ata_dmainit(struct ata_softc *scp, int device, break; case 0x522910b9: /* AcerLabs Aladdin IV/V */ - /* the Aladdin doesn't support ATAPI DMA on both master & slave */ - if (scp->devices & ATA_ATAPI_MASTER && scp->devices & ATA_ATAPI_SLAVE) { + /* the older Aladdin doesn't support ATAPI DMA on both master & slave */ + if (pci_get_revid(parent) < 0xC2 && + scp->devices & ATA_ATAPI_MASTER && scp->devices & ATA_ATAPI_SLAVE) { ata_printf(scp, device, "Aladdin: two atapi devices on this channel, no DMA\n"); break; } - if (udmamode >= 2 && pci_get_revid(parent) >= 0x20) { - int32_t word54 = pci_read_config(parent, 0x54, 4); + if (udmamode >= 5 && pci_get_revid(parent) >= 0xC4) { + error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, + ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY); + if (bootverbose) + ata_printf(scp, device, + "%s setting UDMA5 on Aladdin chip\n", + (error) ? "failed" : "success"); + if (!error) { + int32_t word54 = pci_read_config(parent, 0x54, 4); + + pci_write_config(parent, 0x4b, + pci_read_config(parent, 0x4b, 1) | 0x01, 1); + word54 &= ~(0x000f000f << (devno << 2)); + word54 |= (0x000f0005 << (devno << 2)); + pci_write_config(parent, 0x54, word54, 4); + pci_write_config(parent, 0x53, + pci_read_config(parent, 0x53, 1) | 0x03, 1); + scp->mode[ATA_DEV(device)] = ATA_UDMA5; + return; + } + } + if (udmamode >= 4 && pci_get_revid(parent) >= 0xC2) { + error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, + ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY); + if (bootverbose) + ata_printf(scp, device, + "%s setting UDMA4 on Aladdin chip\n", + (error) ? "failed" : "success"); + if (!error) { + int32_t word54 = pci_read_config(parent, 0x54, 4); + pci_write_config(parent, 0x4b, + pci_read_config(parent, 0x4b, 1) | 0x01, 1); + word54 &= ~(0x000f000f << (devno << 2)); + word54 |= (0x00080005 << (devno << 2)); + pci_write_config(parent, 0x54, word54, 4); + pci_write_config(parent, 0x53, + pci_read_config(parent, 0x53, 1) | 0x03, 1); + scp->mode[ATA_DEV(device)] = ATA_UDMA4; + return; + } + } + if (udmamode >= 2 && pci_get_revid(parent) >= 0x20) { error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY); if (bootverbose) @@ -300,6 +341,8 @@ ata_dmainit(struct ata_softc *scp, int device, "%s setting UDMA2 on Aladdin chip\n", (error) ? "failed" : "success"); if (!error) { + int32_t word54 = pci_read_config(parent, 0x54, 4); + word54 &= ~(0x000f000f << (devno << 2)); word54 |= (0x000a0005 << (devno << 2)); pci_write_config(parent, 0x54, word54, 4); |