diff options
| author | haya <haya@NetBSD.org> | 2001-04-25 09:29:36 +0000 |
|---|---|---|
| committer | haya <haya@NetBSD.org> | 2001-04-25 09:29:36 +0000 |
| commit | 94e69e110fb2b6ef524cbcdf620cbca651f85dfa (patch) | |
| tree | 1311f2b1733f20a372e9397bc94657cd623ed865 /sys/dev | |
| parent | 3d8f9a4f4fba4f155f3a526476951df7fe6d6078 (diff) | |
Initialise all function's latency timer and cacheline size.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/cardbus/cardbus.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 01608da9f9b..d25c2a512c6 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -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 @@ cardbus_attach_card(struct cardbus_softc *sc) } } - 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_attach_card(struct cardbus_softc *sc) 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 |
