aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pccbb/pccbb.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2005-12-27 19:18:11 +0000
committerWarner Losh <imp@FreeBSD.org>2005-12-27 19:18:11 +0000
commit0e6e3c1384c73ab8f54270c2d4b7c49c84e0d507 (patch)
treec221364878e01c0f5daa1a61fcd66675eddb6ee7 /sys/dev/pccbb/pccbb.c
parent0780312f3d5cd9bdebc0f009f94196d4d6696939 (diff)
downloadsrc-0e6e3c1384c73ab8f54270c2d4b7c49c84e0d507.tar.gz
src-0e6e3c1384c73ab8f54270c2d4b7c49c84e0d507.zip
Ensure that we're aligned at leas tto the size of the resource being requested.
When cbb_debug is on, print the windows that we're mapping.
Notes
Notes: svn path=/head/; revision=153757
Diffstat (limited to 'sys/dev/pccbb/pccbb.c')
-rw-r--r--sys/dev/pccbb/pccbb.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index 74ba08cf39d9..012e8620bf06 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -1145,9 +1145,27 @@ cbb_cardbus_auto_open(struct cbb_softc *sc, int type)
reg |= (prefetchable[0]?CBBM_BRIDGECTRL_PREFETCH_0:0)|
(prefetchable[1]?CBBM_BRIDGECTRL_PREFETCH_1:0);
pci_write_config(sc->dev, CBBR_BRIDGECTRL, reg, 2);
+ if (cbb_debug) {
+ if (starts[0] != 0xffffffff)
+ device_printf(sc->dev, "Memory window 0:"
+ " %#x-%#x%s\n", starts[0], ends[0],
+ prefetchable[0] ? " prefetch" : "");
+ if (starts[1] != 0xffffffff)
+ device_printf(sc->dev, "Memory window 1:"
+ " %#x-%#x%s\n", starts[1], ends[1],
+ prefetchable[1] ? " prefetch" : "");
+ }
} else if (type == SYS_RES_IOPORT) {
cbb_cardbus_io_open(sc->dev, 0, starts[0], ends[0]);
cbb_cardbus_io_open(sc->dev, 1, starts[1], ends[1]);
+ if (cbb_debug) {
+ if (starts[0] != 0xffffffff)
+ device_printf(sc->dev, "I/O window 0:"
+ " %#x-%#x\n", starts[0], ends[0]);
+ if (starts[1] != 0xffffffff)
+ device_printf(sc->dev, "I/O window 1:"
+ " %#x-%#x\n", starts[1], ends[1]);
+ }
}
}
@@ -1205,6 +1223,9 @@ cbb_cardbus_alloc_resource(device_t brdev, device_t child, int type,
start = cbb_start_32_io;
if (end < start)
end = start;
+ if (count > (1 << RF_ALIGNMENT(flags)))
+ flags = (flags & ~RF_ALIGNMENT_MASK) |
+ rman_make_alignment_flags(count);
break;
case SYS_RES_MEMORY:
if (start <= cbb_start_mem)