svn commit: r188167 - head/sys/dev/exca
Warner Losh
imp at FreeBSD.org
Thu Feb 5 10:51:15 PST 2009
Author: imp
Date: Thu Feb 5 18:51:14 2009
New Revision: 188167
URL: http://svn.freebsd.org/changeset/base/188167
Log:
Add some additional debugging for the memory code.
Modified:
head/sys/dev/exca/exca.c
Modified: head/sys/dev/exca/exca.c
==============================================================================
--- head/sys/dev/exca/exca.c Thu Feb 5 18:46:01 2009 (r188166)
+++ head/sys/dev/exca/exca.c Thu Feb 5 18:51:14 2009 (r188167)
@@ -209,12 +209,9 @@ exca_do_mem_map(struct exca_softc *sc, i
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, i
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
}
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;
More information about the svn-src-all
mailing list