summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-06-17 13:59:09 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-06-17 13:59:09 +0000
commitfcc9c413fbd826a46db7f895e5d99e46836078f6 (patch)
treede8d37e04a0698481890e909182bbec66cfd8ee8 /sys
parente98ecd1ee47c889e8c2387a3042c124d72b69294 (diff)
We can not consider the first sti region as always mapped, since on pci
cards it is no longer the rom image. This lets sti@pci work on non-dino bridges. Found by and ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/sti.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c
index 84906ce8dc7..2f6787b7ba9 100644
--- a/sys/dev/ic/sti.c
+++ b/sys/dev/ic/sti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sti.c,v 1.54 2007/06/17 13:57:44 miod Exp $ */
+/* $OpenBSD: sti.c,v 1.55 2007/06/17 13:59:08 miod Exp $ */
/*
* Copyright (c) 2000-2003 Michael Shalayeff
@@ -373,24 +373,23 @@ sti_screen_setup(struct sti_screen *scr, bus_space_tag_t iot,
STI_ENABLE_ROM(scr->scr_main);
#endif
- /* rom has already been mapped */
- if (p != cc->regions) {
- if (bus_space_map(memt, *p,
- r.length << PGSHIFT,
- r.cache ? BUS_SPACE_MAP_CACHEABLE : 0,
- &fbh)) {
+ /* skip rom if it has already been mapped */
+ if (p == cc->regions && romh == bases[0])
+ continue;
+
+ if (bus_space_map(memt, *p, r.length << PGSHIFT,
+ r.cache ? BUS_SPACE_MAP_CACHEABLE : 0, &fbh)) {
#ifdef STIDEBUG
- STI_DISABLE_ROM(scr->scr_main);
- printf("already mapped region\n");
- STI_ENABLE_ROM(scr->scr_main);
+ STI_DISABLE_ROM(scr->scr_main);
+ printf("already mapped region\n");
+ STI_ENABLE_ROM(scr->scr_main);
#endif
- } else {
- if (p - cc->regions == 1) {
- scr->fbaddr = *p;
- scr->fblen = r.length << PGSHIFT;
- }
- *p = fbh;
+ } else {
+ if (p - cc->regions == 1) {
+ scr->fbaddr = *p;
+ scr->fblen = r.length << PGSHIFT;
}
+ *p = fbh;
}
}