Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci From chris%openbsd.org@localhost:



details:   https://anonhg.NetBSD.org/src/rev/8a9f0602205b
branches:  trunk
changeset: 480615:8a9f0602205b
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Jan 16 21:31:28 2000 +0000

description:
>From chris%openbsd.org@localhost:
"Don't enable UDMA modes for revisions of SiS 5513 < 0xd0
The only revisions I know which don't actually support UDMA are 0x09 and below..
But the only revision I know which does support UDMA is 0xd0 (and presumably
above that)"

diffstat:

 sys/dev/pci/pciide.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r d792d157747a -r 8a9f0602205b sys/dev/pci/pciide.c
--- a/sys/dev/pci/pciide.c      Sun Jan 16 21:19:44 2000 +0000
+++ b/sys/dev/pci/pciide.c      Sun Jan 16 21:31:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciide.c,v 1.50 1999/12/26 21:46:23 soren Exp $        */
+/*     $NetBSD: pciide.c,v 1.51 2000/01/16 21:31:28 bouyer Exp $       */
 
 
 /*
@@ -2135,6 +2135,7 @@
 {
        struct pciide_channel *cp;
        int channel;
+       u_int32_t rev;
        u_int8_t sis_ctr0 = pciide_pci_read(sc->sc_pc, sc->sc_tag, SIS_CTRL0);
        pcireg_t interface = PCI_INTERFACE(pci_conf_read(sc->sc_pc,
                                    sc->sc_tag, PCI_CLASS_REG));
@@ -2146,14 +2147,20 @@
            sc->sc_wdcdev.sc_dev.dv_xname);
        pciide_mapreg_dma(sc, pa);
        printf("\n");
-       if (sc->sc_dma_ok)
-               sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
+       rev = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_CLASS_REG) & \
+           PCI_REVISION_MASK;
+       if (sc->sc_dma_ok) {
+               sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
+               if (rev >= 0xd0)
+                       sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
+       }
 
        sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
            WDC_CAPABILITY_MODE;
        sc->sc_wdcdev.PIO_cap = 4;
        sc->sc_wdcdev.DMA_cap = 2;
-       sc->sc_wdcdev.UDMA_cap = 2;
+       if (sc->sc_wdcdev.cap & WDC_CAPABILITY_UDMA)
+               sc->sc_wdcdev.UDMA_cap = 2;
        sc->sc_wdcdev.set_modes = sis_setup_channel;
 
        sc->sc_wdcdev.channels = sc->wdc_chanarray;



Home | Main Index | Thread Index | Old Index