diff options
author | sos <sos@FreeBSD.org> | 2002-02-12 16:59:28 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2002-02-12 16:59:28 +0000 |
commit | 79c2c9546e985ee4f1bf87770d1a63626a96bbe6 (patch) | |
tree | f3f69e2344e614b385c79a93d37645240410c98d /sys/dev/ata/ata-dma.c | |
parent | 9a70288cc2bc3b188dd262ed6bc1ca68d45d146b (diff) | |
download | FreeBSD-src-79c2c9546e985ee4f1bf87770d1a63626a96bbe6.zip FreeBSD-src-79c2c9546e985ee4f1bf87770d1a63626a96bbe6.tar.gz |
Add support for the Cenatek Rocket Drive.
Diffstat (limited to 'sys/dev/ata/ata-dma.c')
-rw-r--r-- | sys/dev/ata/ata-dma.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c index b4328db..c587010 100644 --- a/sys/dev/ata/ata-dma.c +++ b/sys/dev/ata/ata-dma.c @@ -1004,6 +1004,15 @@ via_82c586: atadev->mode = ATA_PIO0 + apiomode; return; + case 0x000116ca: /* Cenatek Rocket Drive controller */ + if (wdmamode >= 0 && + (ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) & + ((device==ATA_MASTER)?ATA_BMSTAT_DMA_MASTER:ATA_BMSTAT_DMA_SLAVE))) + atadev->mode = ATA_DMA; + else + atadev->mode = ATA_PIO; + return; + default: /* unknown controller chip */ /* better not try generic DMA on ATAPI devices it almost never works */ if ((device == ATA_MASTER && ch->devices & ATA_ATAPI_MASTER) || @@ -1012,7 +1021,7 @@ via_82c586: /* if controller says its setup for DMA take the easy way out */ /* the downside is we dont know what DMA mode we are in */ - if ((udmamode >= 0 || wdmamode > 1) && + if ((udmamode >= 0 || wdmamode >= 2) && (ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) & ((device==ATA_MASTER) ? ATA_BMSTAT_DMA_MASTER : ATA_BMSTAT_DMA_SLAVE))) { @@ -1034,7 +1043,7 @@ via_82c586: } } error = ata_command(atadev, ATA_C_SETFEATURES, 0, ATA_PIO0 + apiomode, - ATA_C_F_SETXFER,ATA_WAIT_READY); + ATA_C_F_SETXFER, ATA_WAIT_READY); if (bootverbose) ata_prtdev(atadev, "%s setting PIO%d on generic chip\n", (error) ? "failed" : "success", apiomode < 0 ? 0 : apiomode); |