From 4c421a34f878bd6571afd4405d4be6d6521ef664 Mon Sep 17 00:00:00 2001 From: bde Date: Sat, 16 Jan 1999 19:48:01 +0000 Subject: [PATCH] Fixed a 1-bit error in initializing UDMA mode for VIA chipsets. Instead of initializing UDMA mode, we turned it off and made sure that it stays off by turning on the "UDMA enable by SET FEATURES" disable. The damage was limited by bugs in cookie lookup, and suitable initialization by some BIOSes. The cookie list has slaves before masters, and the unit number is ignored when cookies are looked up, so cookie lookup always finds cookies for slaves and the bug only clobbers slaves, so the bug was harmless for common configurations with no slaves or only non-UDMA slaves. UDMA initialization for masters actually worked if the BIOS turns on the UDMA mode bit and turns off the "UDMA enable by SET FEATURES" disable. --- sys/pci/ide_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/pci/ide_pci.c b/sys/pci/ide_pci.c index 5a6ad0b4535b..583ecbc00a5a 100644 --- a/sys/pci/ide_pci.c +++ b/sys/pci/ide_pci.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ide_pci.c,v 1.24 1999/01/16 00:36:53 msmith Exp $ + * $Id: ide_pci.c,v 1.25 1999/01/16 03:55:46 msmith Exp $ */ #include "pci.h" @@ -404,7 +404,7 @@ via_571_dmainit(struct ide_pci_cookie *cookie, /* UDMA enable by SET FEATURES, DMA cycles, cycle time 2T */ mask = 0xe3000000 >> (unitno * 8); - new = 0x80000000 >> (unitno * 8); + new = 0x40000000 >> (unitno * 8); word50 &= ~mask; word50 |= new;