From 107bba179ca31354757f406c1b2e70a5c01f9fc1 Mon Sep 17 00:00:00 2001
From: briggs <briggs@cvs.openbsd.org>
Date: Fri, 2 May 1997 00:59:53 +0000
Subject: Thanks to Tobias Beal <tbeal41@maine.maine.edu>, we can clear
 interrupts on at least one Radius Precisioncolor 8 board.

---
 sys/arch/mac68k/dev/grf_mv.c | 42 ++++++++++++++++++++++++++++++++++++++----
 sys/arch/mac68k/dev/nubus.h  |  5 +++--
 2 files changed, 41 insertions(+), 6 deletions(-)

(limited to 'sys/arch')

diff --git a/sys/arch/mac68k/dev/grf_mv.c b/sys/arch/mac68k/dev/grf_mv.c
index e12e5fca56b..df032d7e6bc 100644
--- a/sys/arch/mac68k/dev/grf_mv.c
+++ b/sys/arch/mac68k/dev/grf_mv.c
@@ -1,5 +1,5 @@
-/*	$OpenBSD: grf_mv.c,v 1.14 1997/05/01 03:36:51 briggs Exp $	*/
-/*	$NetBSD: grf_mv.c,v 1.17 1997/02/24 06:20:06 scottr Exp $	*/
+/*	$OpenBSD: grf_mv.c,v 1.15 1997/05/02 00:59:52 briggs Exp $	*/
+/*	$NetBSD: grf_mv.c,v 1.23 1997/05/02 00:54:29 briggs Exp $	*/
 
 /*
  * Copyright (c) 1995 Allen Briggs.  All rights reserved.
@@ -54,6 +54,7 @@
 static void	load_image_data __P((caddr_t data, struct image_data *image));
 
 static void	grfmv_intr_generic __P((void *vsc, int slot));
+static void	grfmv_intr_radius __P((void *vsc, int slot));
 static void	grfmv_intr_cti __P((void *vsc, int slot));
 static void	grfmv_intr_cb264 __P((void *vsc, int slot));
 
@@ -224,6 +225,9 @@ grfmv_attach(parent, self, aux)
 		sc->cli_value = 0;
 		add_nubus_intr(sc->sc_slot.slot, grfmv_intr_generic, sc);
 		break;
+	case NUBUS_DRHW_RPC8XJ:
+		add_nubus_intr(sc->sc_slot.slot, grfmv_intr_radius, sc);
+		break;
 	case NUBUS_DRHW_FIILX:
 	case NUBUS_DRHW_FIISXDSP:
 		sc->cli_offset = 0xF05000;
@@ -294,13 +298,43 @@ grfmv_intr_generic(vsc, slot)
 	void	*vsc;
 	int	slot;
 {
-	static char zero = 0;
 	struct grfbus_softc *sc;
 	volatile char *slotbase;
 
 	sc = (struct grfbus_softc *)vsc;
 	slotbase = (volatile char *)sc->sc_slot.virtual_base;
-	slotbase[sc->cli_offset] = zero;
+	slotbase[sc->cli_offset] = sc->cli_value;
+}
+
+/*
+ * Generic routine to clear interrupts for cards where it simply takes
+ * a CLR.B to clear the interrupt.  The offset of this byte varies between
+ * cards.
+ */
+/*ARGSUSED*/
+static void
+grfmv_intr_radius(vsc, slot)
+	void	*vsc;
+	int	slot;
+{
+	unsigned char	c;
+	struct grfbus_softc *sc;
+	volatile char *slotbase;
+
+	sc = (struct grfbus_softc *)vsc;
+	slotbase = (volatile char *)sc->sc_slot.virtual_base;
+
+	/*
+	 * The value 0x66 was the observed value on one	card.  It is read
+	 * from the driver's information block, so this may not be sufficient.
+	 * Then again, we're not setting up any other interrupts...
+	 */
+	c = 0x66;
+
+	c |= 0x80;
+	slotbase[0xD00403] = c;
+	c &= 0x7F;
+	slotbase[0xD00403] = c;
 }
 
 /*
diff --git a/sys/arch/mac68k/dev/nubus.h b/sys/arch/mac68k/dev/nubus.h
index af2e978147d..a84c2154755 100644
--- a/sys/arch/mac68k/dev/nubus.h
+++ b/sys/arch/mac68k/dev/nubus.h
@@ -1,5 +1,5 @@
-/*	$OpenBSD: nubus.h,v 1.14 1997/05/01 18:32:50 briggs Exp $	*/
-/*	$NetBSD: nubus.h,v 1.24 1997/05/01 18:17:18 briggs Exp $	*/
+/*	$OpenBSD: nubus.h,v 1.15 1997/05/02 00:59:51 briggs Exp $	*/
+/*	$NetBSD: nubus.h,v 1.25 1997/05/02 00:54:28 briggs Exp $	*/
 
 /*
  * Copyright (c) 1995 Allen Briggs.  All rights reserved.
@@ -60,6 +60,7 @@
 #define    NUBUS_DRHW_MICRON	0x0146
 #define    NUBUS_DRHW_CB364	0x026F	/* RasterOps ColorBoard 364 */
 #define    NUBUS_DRHW_THUNDER24	0x02CB	/* SuperMac Thunder/24 */
+#define	   NUBUS_DRHW_RPC8XJ	0x040B	/* Radius PrecisionColor 8xj */
 #define	   NUBUS_DRHW_FIILX	0x0417	/* Futura II LX */
 #define	   NUBUS_DRHW_FIISXDSP	0x042F	/* Futura II SX/DSP */
 
-- 
cgit v1.2.3