From 98f6aab0a210e093d82725405a0106e5f2fb129c Mon Sep 17 00:00:00 2001 From: Dale Rahn Date: Tue, 26 Mar 2002 16:50:13 +0000 Subject: On the wdc_obio controller if one device is UDMA capable and one is not, downgrade the UDMA device to DMA. Works around a problem with old combo drives on some Apple machines. --- sys/arch/macppc/dev/wdc_obio.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/arch/macppc/dev/wdc_obio.c b/sys/arch/macppc/dev/wdc_obio.c index c1b046b63ae..d7b40dbd250 100644 --- a/sys/arch/macppc/dev/wdc_obio.c +++ b/sys/arch/macppc/dev/wdc_obio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdc_obio.c,v 1.5 2002/03/14 01:26:36 millert Exp $ */ +/* $OpenBSD: wdc_obio.c,v 1.6 2002/03/26 16:50:12 drahn Exp $ */ /* $NetBSD: wdc_obio.c,v 1.15 2001/07/25 20:26:33 bouyer Exp $ */ /*- @@ -365,6 +365,8 @@ wdc_obio_ata4_adjust_timing(chp) if (drvp->drive_flags & DRIVE_UDMA) { if (udmamode == -1 || udmamode > drvp->UDMA_mode) udmamode = drvp->UDMA_mode; + } else { + udmamode = -2; } } if (piomode == -1) @@ -375,10 +377,19 @@ wdc_obio_ata4_adjust_timing(chp) drvp->PIO_mode = piomode; if (drvp->drive_flags & DRIVE_DMA) drvp->DMA_mode = dmamode; - if (drvp->drive_flags & DRIVE_UDMA) - drvp->UDMA_mode = udmamode; + if (drvp->drive_flags & DRIVE_UDMA) { + if (udmamode == -2) { + drvp->drive_flags &= ~DRIVE_UDMA; + } else { + drvp->UDMA_mode = udmamode; + } + } } } + + if (udmamode == -2) + udmamode = -1; + min_cycle = pio_timing[piomode].cycle; min_active = pio_timing[piomode].active; -- cgit v1.2.3