summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-04-04 18:25:08 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-04-04 18:25:08 +0000
commitffd960f5677e076bfcf53140c93f766efdd1142a (patch)
tree58abadf68c0b202d3d0907e707fe85637234a82c /sys
parent091b6df9712c1af8662eea2a1ee86d3be67c0fb9 (diff)
Disable ATAPI DMA on Promise controllers and some ALi controllers.
Change Bus Master DMA Stop to not trust what we read from the device.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/pciide.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index ae181f83d73..ab7f87f3f5d 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide.c,v 1.49 2001/04/04 07:02:51 csapuntz Exp $ */
+/* $OpenBSD: pciide.c,v 1.50 2001/04/04 18:25:07 csapuntz Exp $ */
/* $NetBSD: pciide.c,v 1.110 2001/03/20 17:56:46 bouyer Exp $ */
/*
@@ -373,14 +373,12 @@ const struct pciide_product_desc pciide_sis_products[] = {
}
};
-#ifdef notyet
const struct pciide_product_desc pciide_acer_products[] = {
{ PCI_PRODUCT_ALI_M5229, /* Acer Labs M5229 UDMA IDE */
0,
acer_chip_map
}
};
-#endif
const struct pciide_product_desc pciide_triones_products[] = {
{ PCI_PRODUCT_TRIONES_HPT366, /* Highpoint HPT36x/37x IDE */
@@ -431,10 +429,8 @@ const struct pciide_vendor_desc pciide_vendors[] = {
sizeof(pciide_cypress_products)/sizeof(pciide_cypress_products[0]) },
{ PCI_VENDOR_SIS, pciide_sis_products,
sizeof(pciide_sis_products)/sizeof(pciide_sis_products[0]) },
-#ifdef notyet
{ PCI_VENDOR_ALI, pciide_acer_products,
sizeof(pciide_acer_products)/sizeof(pciide_acer_products[0]) },
-#endif
{ PCI_VENDOR_TRIONES, pciide_triones_products,
sizeof(pciide_triones_products)/sizeof(pciide_triones_products[0]) },
{ PCI_VENDOR_PROMISE, pciide_promise_products,
@@ -1066,8 +1062,8 @@ pciide_dma_finish(v, channel, drive)
/* stop DMA channel */
bus_space_write_1(sc->sc_dma_iot, sc->sc_dma_ioh,
IDEDMA_CMD + IDEDMA_SCH_OFFSET * channel,
- bus_space_read_1(sc->sc_dma_iot, sc->sc_dma_ioh,
- IDEDMA_CMD + IDEDMA_SCH_OFFSET * channel) & ~IDEDMA_CMD_START);
+ (dma_maps->dma_flags & WDC_DMA_READ) ?
+ 0x00 : IDEDMA_CMD_WRITE);
/* Unload the map of the data buffer */
#ifndef __OpenBSD__
@@ -2844,6 +2840,10 @@ acer_chip_map(sc, pa)
pciide_mapreg_dma(sc, pa);
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
+
+ if (rev < 0xC4)
+ sc->sc_wdcdev.cap |= WDC_CAPABILITY_NO_ATAPI_DMA;
+
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
if (rev >= 0x20)
@@ -3042,6 +3042,7 @@ hpt_chip_map(sc, pa)
printf(": DMA");
pciide_mapreg_dma(sc, pa);
+ printf("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
if (sc->sc_dma_ok) {
@@ -3259,7 +3260,7 @@ pdc202xx_chip_map(sc, pa)
pciide_mapreg_dma(sc, pa);
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
- WDC_CAPABILITY_MODE;
+ WDC_CAPABILITY_MODE | WDC_CAPABILITY_NO_ATAPI_DMA;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;