summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Reindl <martin@cvs.openbsd.org>2005-09-27 09:45:49 +0000
committerMartin Reindl <martin@cvs.openbsd.org>2005-09-27 09:45:49 +0000
commit5b0ded8882c45f0354de00df4051db48007bb8e8 (patch)
tree05e8f2434336b3b65ceb68e86aebf23fa23a95dd /sys
parentb57a927948b35976c223c87b0e42ce62c1285227 (diff)
- don't mess with SCSI controller bits here, only map the two regions
we need - unmap Valkyrie register space after matching, we don't use it later from NetBSD
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mac68k/dev/grf_iv.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/sys/arch/mac68k/dev/grf_iv.c b/sys/arch/mac68k/dev/grf_iv.c
index 152a64bfb6d..d00d3e28936 100644
--- a/sys/arch/mac68k/dev/grf_iv.c
+++ b/sys/arch/mac68k/dev/grf_iv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grf_iv.c,v 1.30 2005/09/27 07:15:19 martin Exp $ */
+/* $OpenBSD: grf_iv.c,v 1.31 2005/09/27 09:45:48 martin Exp $ */
/* $NetBSD: grf_iv.c,v 1.17 1997/02/20 00:23:27 scottr Exp $ */
/*
@@ -130,6 +130,8 @@ grfiv_match(parent, vcf, aux)
/* Disable interrupts */
bus_space_write_1(oa->oa_tag, bsh, 0x18, 0x1);
+
+ bus_space_unmap(oa->oa_tag, bsh, 0x40);
break;
}
/*
@@ -149,27 +151,33 @@ grfiv_match(parent, vcf, aux)
*/
base = DAFB_CONTROL_BASE;
- if (bus_space_map(oa->oa_tag, base, 0x1000, 0, &bsh))
+ if (bus_space_map(oa->oa_tag, base, 0x20, 0, &bsh))
return 0;
if (mac68k_bus_space_probe(oa->oa_tag, bsh, 0x1c, 4) == 0) {
- bus_space_unmap(oa->oa_tag, bsh, PAGE_SIZE);
+ bus_space_unmap(oa->oa_tag, bsh, 0x20);
return 0;
}
- /* Set "Turbo SCSI" configuration to default */
- bus_space_write_4(oa->oa_tag, bsh, 0x24, 0x1d1); /* ch0 */
- bus_space_write_4(oa->oa_tag, bsh, 0x28, 0x1d1); /* ch1 */
+ bus_space_unmap(oa->oa_tag, bsh, 0x20);
+
+ if (bus_space_map(oa->oa_tag, base + 0x100, 0x20, 0, &bsh))
+ return 0;
+
+ if (mac68k_bus_space_probe(oa->oa_tag, bsh, 0x04, 4) == 0) {
+ bus_space_unmap(oa->oa_tag, bsh, 0x20);
+ return 0;
+ }
/* Disable interrupts */
- bus_space_write_4(oa->oa_tag, bsh, 0x104, 0);
+ bus_space_write_4(oa->oa_tag, bsh, 0x04, 0);
/* Clear any interrupts */
- bus_space_write_4(oa->oa_tag, bsh, 0x10C, 0);
- bus_space_write_4(oa->oa_tag, bsh, 0x110, 0);
- bus_space_write_4(oa->oa_tag, bsh, 0x114, 0);
+ bus_space_write_4(oa->oa_tag, bsh, 0x0C, 0);
+ bus_space_write_4(oa->oa_tag, bsh, 0x10, 0);
+ bus_space_write_4(oa->oa_tag, bsh, 0x14, 0);
- bus_space_unmap(oa->oa_tag, bsh, PAGE_SIZE);
+ bus_space_unmap(oa->oa_tag, bsh, 0x20);
break;
case MACH_CLASSAV:
base = CIVIC_CONTROL_BASE;
@@ -235,7 +243,7 @@ grfiv_attach(parent, self, aux)
case MACH_CLASSQ:
base = DAFB_CONTROL_BASE;
sc->sc_tag = oa->oa_tag;
- if (bus_space_map(sc->sc_tag, base, 0x1000, 0, &sc->sc_regh)) {
+ if (bus_space_map(sc->sc_tag, base, 0x20, 0, &sc->sc_regh)) {
printf(": failed to map DAFB register space\n");
return;
}
@@ -272,7 +280,7 @@ grfiv_attach(parent, self, aux)
printf(": DAFB: monitor sense %x\n",
(bus_space_read_4(sc->sc_tag, sc->sc_regh, 0x1c) & 0x7));
- bus_space_unmap(sc->sc_tag, sc->sc_regh, 0x1000);
+ bus_space_unmap(sc->sc_tag, sc->sc_regh, 0x20);
break;
case MACH_CLASSAV:
sc->sc_basepa = CIVIC_BASE;