diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2002-11-15 03:33:26 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2002-11-15 03:33:26 +0000 |
commit | be0e0aff0213033461f386d5563ebe54d5a2d784 (patch) | |
tree | 1eaf6b2057c43a4f1d66f0dc16619a52361f4058 /sys | |
parent | 553b85fe21ff47263d144742eebe21b2fce37de6 (diff) |
o add support for VIA VT8233 and VT8235
VT8233 tested by jolan@cryptonomicon.org, VT8235 untested
o correct VIA timings for UDMA 5
o don't set the APO_UDMA_CLK66 bit for UDMA 5 capable chipset
from NetBSD
gluk@ ok
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/pciide.c | 19 | ||||
-rw-r--r-- | sys/dev/pci/pciide_apollo_reg.h | 5 |
2 files changed, 17 insertions, 7 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c index 079eb2f3ee7..22ccae9daea 100644 --- a/sys/dev/pci/pciide.c +++ b/sys/dev/pci/pciide.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciide.c,v 1.94 2002/11/08 11:44:59 gluk Exp $ */ +/* $OpenBSD: pciide.c,v 1.95 2002/11/15 03:33:25 grange Exp $ */ /* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */ /* @@ -2246,12 +2246,20 @@ apollo_chip_map(sc, pa) printf(": ATA100"); sc->sc_wdcdev.UDMA_cap = 5; break; + case PCI_PRODUCT_VIATECH_VT8233_ISA: + printf(": ATA133"); + sc->sc_wdcdev.UDMA_cap = 6; + break; + case PCI_PRODUCT_VIATECH_VT8235_ISA: + printf(": ATA133"); + sc->sc_wdcdev.UDMA_cap = 6; + break; default: printf(": DMA"); sc->sc_wdcdev.UDMA_cap = 0; break; } - + pciide_mapreg_dma(sc, pa); sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 | WDC_CAPABILITY_MODE; @@ -2370,10 +2378,11 @@ apollo_setup_channel(chp) drvp->drive_flags &= ~DRIVE_DMA; udmatim_reg |= APO_UDMA_EN(chp->channel, drive) | APO_UDMA_EN_MTH(chp->channel, drive); - - if (sc->sc_wdcdev.UDMA_cap == 5) { + if (sc->sc_wdcdev.UDMA_cap == 6) { + udmatim_reg |= APO_UDMA_TIME(chp->channel, + drive, apollo_udma133_tim[drvp->UDMA_mode]); + } else if (sc->sc_wdcdev.UDMA_cap == 5) { /* 686b */ - udmatim_reg |= APO_UDMA_CLK66(chp->channel); udmatim_reg |= APO_UDMA_TIME(chp->channel, drive, apollo_udma100_tim[drvp->UDMA_mode]); } else if (sc->sc_wdcdev.UDMA_cap == 4) { diff --git a/sys/dev/pci/pciide_apollo_reg.h b/sys/dev/pci/pciide_apollo_reg.h index 07bbad4b104..a5369a31012 100644 --- a/sys/dev/pci/pciide_apollo_reg.h +++ b/sys/dev/pci/pciide_apollo_reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pciide_apollo_reg.h,v 1.5 2001/07/20 05:56:25 csapuntz Exp $ */ +/* $OpenBSD: pciide_apollo_reg.h,v 1.6 2002/11/15 03:33:25 grange Exp $ */ /* $NetBSD: pciide_apollo_reg.h,v 1.8 2001/01/05 18:04:43 bouyer Exp $ */ /* @@ -98,7 +98,8 @@ (((1 - (channel)) << 4) + ((1 - (drive)) << 3))) #define APO_UDMA_CLK66(channel) (0x08 << ((1 - (channel)) << 4)) -static int8_t apollo_udma100_tim[] = {0x0f, 0x07, 0x04, 0x02, 0x01, 0x00}; +static int8_t apollo_udma133_tim[] = {0x07, 0x07, 0x06, 0x04, 0x02, 0x01, 0x00}; +static int8_t apollo_udma100_tim[] = {0x07, 0x07, 0x04, 0x02, 0x01, 0x00}; static int8_t apollo_udma66_tim[] = {0x03, 0x03, 0x02, 0x01, 0x00}; static int8_t apollo_udma33_tim[] = {0x03, 0x02, 0x00}; static int8_t apollo_pio_set[] = {0x0a, 0x0a, 0x0a, 0x02, 0x02}; |