diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/pciide.c | 19 | ||||
-rw-r--r-- | sys/dev/pci/pciide_amd_reg.h | 7 |
2 files changed, 20 insertions, 6 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c index c1e72fe876a..6257f350367 100644 --- a/sys/dev/pci/pciide.c +++ b/sys/dev/pci/pciide.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciide.c,v 1.56 2001/06/27 05:22:31 deraadt Exp $ */ +/* $OpenBSD: pciide.c,v 1.57 2001/07/19 18:16:22 csapuntz Exp $ */ /* $NetBSD: pciide.c,v 1.110 2001/03/20 17:56:46 bouyer Exp $ */ /* @@ -305,6 +305,10 @@ const struct pciide_product_desc pciide_amd_products[] = { 0, amd756_chip_map }, + { PCI_PRODUCT_AMD_766_IDE, /* AMD 766 */ + 0, + amd756_chip_map + }, }; #ifdef notyet @@ -1880,7 +1884,14 @@ amd756_chip_map(sc, pa) } sc->sc_wdcdev.PIO_cap = 4; sc->sc_wdcdev.DMA_cap = 2; - sc->sc_wdcdev.UDMA_cap = 4; + switch (sc->sc_pp->ide_product) { + case PCI_PRODUCT_AMD_766_IDE: + sc->sc_wdcdev.UDMA_cap = 5; + break; + default: + sc->sc_wdcdev.UDMA_cap = 4; + break; + } sc->sc_wdcdev.set_modes = amd756_setup_channel; sc->sc_wdcdev.channels = sc->wdc_chanarray; sc->sc_wdcdev.nchannels = PCIIDE_NUM_CHANNELS; @@ -1931,6 +1942,8 @@ amd756_setup_channel(chp) struct pciide_channel *cp = (struct pciide_channel*)chp; struct pciide_softc *sc = (struct pciide_softc *)cp->wdc_channel.wdc; #ifndef PCIIDE_AMD756_ENABLEDMA + int product = PCI_PRODUCT( + pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_ID_REG)); int rev = PCI_REVISION( pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_CLASS_REG)); #endif @@ -1975,7 +1988,7 @@ amd756_setup_channel(chp) * PCIIDE_AMD756_ENABLEDMA. It causes a hard hang if * triggered. */ - if (AMD756_CHIPREV_DISABLEDMA(rev)) { + if (AMD756_CHIPREV_DISABLEDMA(product, rev)) { printf("%s:%d:%d: multi-word DMA disabled due " "to chip revision\n", sc->sc_wdcdev.sc_dev.dv_xname, diff --git a/sys/dev/pci/pciide_amd_reg.h b/sys/dev/pci/pciide_amd_reg.h index 5bf8012c77e..ca94a951592 100644 --- a/sys/dev/pci/pciide_amd_reg.h +++ b/sys/dev/pci/pciide_amd_reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pciide_amd_reg.h,v 1.3 2001/04/04 07:02:52 csapuntz Exp $ */ +/* $OpenBSD: pciide_amd_reg.h,v 1.4 2001/07/19 18:16:22 csapuntz Exp $ */ /* $NetBSD: pciide_amd_reg.h,v 1.2 2000/07/06 15:08:11 bouyer Exp $ */ /* @@ -51,7 +51,8 @@ * * See: http://www.amd.com/products/cpg/athlon/techdocs/pdf/22591.pdf */ -#define AMD756_CHIPREV_DISABLEDMA(rev) ((rev) <= AMD756_CHIPREV_D2) +#define AMD756_CHIPREV_DISABLEDMA(product, rev) \ + ((product) == PCI_PRODUCT_AMD_PBC756_IDE && (rev) <= AMD756_CHIPREV_D2) /* Channel enable */ #define AMD756_CHANSTATUS_EN 0x40 @@ -78,4 +79,4 @@ static const int8_t amd756_pio_rec[] = {0x08, 0x08, 0x08, 0x02, 0x00}; #define AMD756_UDMA_EN_MTH(channel, drive) (0x80 << \ (((1 - (channel)) << 4) + ((1 - (drive)) << 3))) -static const int8_t amd756_udma_tim[] = {0x02, 0x01, 0x00, 0x04, 0x05}; +static const int8_t amd756_udma_tim[] = {0x02, 0x01, 0x00, 0x04, 0x05, 0x06}; |