diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c index b4328db6300f..c587010dd429 100644 --- a/sys/dev/ata/ata-dma.c +++ b/sys/dev/ata/ata-dma.c @@ -1004,6 +1004,15 @@ ata_dmainit(struct ata_channel *ch, int device, 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 @@ ata_dmainit(struct ata_channel *ch, int device, /* 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 @@ ata_dmainit(struct ata_channel *ch, int device, } } 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); diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index d24a24e469c4..dd1f15ba70a1 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -283,6 +283,9 @@ ata_pci_match(device_t dev) } return NULL; + case 0x000116ca: + return "Cenatek Rocket Drive controller"; + /* unsupported but known chipsets, generic DMA only */ case 0x10001042: case 0x10011042: