Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/cardbus Initialise all function's latency timer and ...



details:   https://anonhg.NetBSD.org/src/rev/990f18b23d8f
branches:  trunk
changeset: 509043:990f18b23d8f
user:      haya <haya%NetBSD.org@localhost>
date:      Wed Apr 25 09:29:36 2001 +0000

description:
Initialise all function's latency timer and cacheline size.

diffstat:

 sys/dev/cardbus/cardbus.c |  28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diffs (49 lines):

diff -r 3a189a4f5cb9 -r 990f18b23d8f sys/dev/cardbus/cardbus.c
--- a/sys/dev/cardbus/cardbus.c Wed Apr 25 09:20:32 2001 +0000
+++ b/sys/dev/cardbus/cardbus.c Wed Apr 25 09:29:36 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cardbus.c,v 1.31 2001/04/25 09:20:32 haya Exp $        */
+/*     $NetBSD: cardbus.c,v 1.32 2001/04/25 09:29:36 haya Exp $        */
 
 /*
  * Copyright (c) 1997, 1998, 1999 and 2000
@@ -441,13 +441,6 @@
                }
        }
 
-       bhlc = cardbus_conf_read(cc, cf, tag, CARDBUS_BHLC_REG);
-       if (CARDBUS_LATTIMER(bhlc) < 0x10) {
-               bhlc &= ~(CARDBUS_LATTIMER_MASK << CARDBUS_LATTIMER_SHIFT);
-               bhlc |= (0x10 << CARDBUS_LATTIMER_SHIFT);
-               cardbus_conf_write(cc, cf, tag, CARDBUS_BHLC_REG, bhlc);
-       }
-
        nfunction = CARDBUS_HDRTYPE_MULTIFN(bhlc) ? 8 : 1;
 
        for (function = 0; function < nfunction; function++) {
@@ -480,6 +473,25 @@
                cardbus_conf_write(cc, cf, tag, CARDBUS_BASE5_REG, 0);
                cardbus_conf_write(cc, cf, tag, CARDBUS_ROM_REG, 0);
 
+               /* set initial latency and cacheline size */
+               bhlc = cardbus_conf_read(cc, cf, tag, CARDBUS_BHLC_REG);
+               DPRINTF(("%s func%d bhlc 0x%08x -> ", sc->sc_dev.dv_xname,
+                   function, bhlc));
+               bhlc &= ~((CARDBUS_LATTIMER_MASK << CARDBUS_LATTIMER_SHIFT) |
+                   (CARDBUS_CACHELINE_MASK << CARDBUS_CACHELINE_SHIFT));
+               bhlc |= ((sc->sc_cacheline & CARDBUS_CACHELINE_MASK) << CARDBUS_CACHELINE_SHIFT);
+               bhlc |= ((sc->sc_lattimer & CARDBUS_LATTIMER_MASK) << CARDBUS_LATTIMER_SHIFT);
+
+               cardbus_conf_write(cc, cf, tag, CARDBUS_BHLC_REG, bhlc);
+               bhlc = cardbus_conf_read(cc, cf, tag, CARDBUS_BHLC_REG);
+               DPRINTF(("0x%08x\n", bhlc));
+               
+               if (CARDBUS_LATTIMER(bhlc) < 0x10) {
+                       bhlc &= ~(CARDBUS_LATTIMER_MASK << CARDBUS_LATTIMER_SHIFT);
+                       bhlc |= (0x10 << CARDBUS_LATTIMER_SHIFT);
+                       cardbus_conf_write(cc, cf, tag, CARDBUS_BHLC_REG, bhlc);
+               }
+
                /*
                 * We need to allocate the ct here, since we might
                 * need it when reading the CIS



Home | Main Index | Thread Index | Old Index