From e76987f8c513aa5384eadcaef18ec260659d4113 Mon Sep 17 00:00:00 2001 From: briggs Date: Mon, 21 Apr 1997 00:58:14 +0000 Subject: [PATCH] Take care when accessing DAFB--some quadra-class machines use other video controllers. --- sys/arch/mac68k/dev/grf_iv.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/arch/mac68k/dev/grf_iv.c b/sys/arch/mac68k/dev/grf_iv.c index 07a3d2943f6..8082cf0113c 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.14 1997/03/30 22:44:03 briggs Exp $ */ +/* $OpenBSD: grf_iv.c,v 1.15 1997/04/21 00:58:14 briggs Exp $ */ /* $NetBSD: grf_iv.c,v 1.17 1997/02/20 00:23:27 scottr Exp $ */ /* @@ -89,16 +89,25 @@ grfiv_match(parent, vcf, aux) found = 1; switch (current_mac_model->class) { - case MACH_CLASSQ: - case MACH_CLASSQ2: + case MACH_CLASSQ: + case MACH_CLASSQ2: - /* Assume DAFB for all of these */ + /* + * Assume DAFB for all of these, unless we can't + * access the memory. + */ if (bus_space_map(oa->oa_tag, QUADRA_DAFB_BASE, 0x1000, 0, &bsh)) { panic("failed to map space for DAFB regs.\n"); } + if (bus_probe(oa->oa_tag, bsh, 0x1C, 4) == 0) { + bus_space_unmap(oa->oa_tag, bsh, 0x1000); + found = 0; + goto nodafb; + } + sense = (bus_space_read_4(oa->oa_tag, bsh, 0x1C) & 7); if (sense == 0) @@ -121,6 +130,7 @@ grfiv_match(parent, vcf, aux) break; default: +nodafb: if (mac68k_vidlog == 0) { found = 0; } -- 2.20.1