summaryrefslogtreecommitdiffstats
path: root/sys/dev/exca
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2009-02-05 18:51:14 +0000
committerimp <imp@FreeBSD.org>2009-02-05 18:51:14 +0000
commit1d8d2a7ac9007ac071ab68dab51c9d698a62e0e1 (patch)
treef5daa133dc8de1dd33d3ff74276498021631530a /sys/dev/exca
parent062d78912fbe54b3dcbdb9fe7897c9791a1946f5 (diff)
downloadFreeBSD-src-1d8d2a7ac9007ac071ab68dab51c9d698a62e0e1.zip
FreeBSD-src-1d8d2a7ac9007ac071ab68dab51c9d698a62e0e1.tar.gz
Add some additional debugging for the memory code.
Diffstat (limited to 'sys/dev/exca')
-rw-r--r--sys/dev/exca/exca.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/sys/dev/exca/exca.c b/sys/dev/exca/exca.c
index f1150d3..9725e09 100644
--- a/sys/dev/exca/exca.c
+++ b/sys/dev/exca/exca.c
@@ -209,12 +209,9 @@ exca_do_mem_map(struct exca_softc *sc, int win)
exca_putb(sc, map->cardmem_msb, ((offset >> 8) &
EXCA_CARDMEM_ADDRX_MSB_ADDR_MASK) | attrmem);
-#ifdef EXCA_DEBUG
- if (mem->kind & PCCARD_MEM_ATTR)
- printf("attribtue memory\n");
- else
- printf("common memory\n");
-#endif
+ DPRINTF("%s %d-bit memory",
+ mem->kind & PCCARD_MEM_ATTR ? "attrubute" : "common",
+ mem->kind & PCCARD_MEM_16BIT ? 16 : 8);
exca_setb(sc, EXCA_ADDRWIN_ENABLE, map->memenable |
EXCA_ADDRWIN_ENABLE_MEMCS16);
@@ -229,11 +226,11 @@ exca_do_mem_map(struct exca_softc *sc, int win)
r5 = exca_getb(sc, map->cardmem_msb);
r6 = exca_getb(sc, map->cardmem_lsb);
r7 = exca_getb(sc, map->sysmem_win);
- printf("exca_do_mem_map win %d: %02x%02x %02x%02x "
- "%02x%02x %02x (%08x+%06x.%06x*%06x)\n",
+ printf("exca_do_mem_map win %d: %#02x%#02x %#02x%#02x "
+ "%#02x%#02x %#02x (%#08x+%#06x.%#06x*%#06x) flags %#x\n",
win, r1, r2, r3, r4, r5, r6, r7,
mem->addr, mem->size, mem->realsize,
- mem->cardaddr);
+ mem->cardaddr, mem->kind);
}
#endif
}
@@ -259,10 +256,18 @@ exca_mem_map(struct exca_softc *sc, int kind, struct resource *res)
}
if (win >= EXCA_MEM_WINS)
return (ENOSPC);
- if (((rman_get_start(res) >> EXCA_MEMREG_WIN_SHIFT) & 0xff) != 0 &&
- (sc->flags & EXCA_HAS_MEMREG_WIN) == 0) {
- device_printf(sc->dev, "Does not support mapping above 24M.");
- return (EINVAL);
+ if (sc->flags & EXCA_HAS_MEMREG_WIN) {
+ if (rman_get_start(res) >> (EXCA_MEMREG_WIN_SHIFT + 8) != 0) {
+ device_printf(sc->dev,
+ "Does not support mapping above 4GB.");
+ return (EINVAL);
+ }
+ } else {
+ if (rman_get_start(res) >> EXCA_MEMREG_WIN_SHIFT != 0) {
+ device_printf(sc->dev,
+ "Does not support mapping above 16M.");
+ return (EINVAL);
+ }
}
sc->mem[win].cardaddr = 0;
OpenPOWER on IntegriCloud