Home | History | Annotate | Line # | Download | only in nubus
grf_nubus.c revision 1.39
      1 /*	$NetBSD: grf_nubus.c,v 1.39 1998/01/12 19:22:06 thorpej Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1995 Allen Briggs.  All rights reserved.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  * 3. All advertising materials mentioning features or use of this software
     15  *    must display the following acknowledgement:
     16  *	This product includes software developed by Allen Briggs.
     17  * 4. The name of the author may not be used to endorse or promote products
     18  *    derived from this software without specific prior written permission.
     19  *
     20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30  */
     31 /*
     32  * Device-specific routines for handling Nubus-based video cards.
     33  */
     34 
     35 #include <sys/param.h>
     36 
     37 #include <sys/device.h>
     38 #include <sys/ioctl.h>
     39 #include <sys/file.h>
     40 #include <sys/malloc.h>
     41 #include <sys/mman.h>
     42 #include <sys/proc.h>
     43 #include <sys/systm.h>
     44 
     45 #include <machine/bus.h>
     46 #include <machine/cpu.h>
     47 #include <machine/grfioctl.h>
     48 #include <machine/viareg.h>
     49 
     50 #include <mac68k/dev/nubus.h>
     51 #include <mac68k/dev/grfvar.h>
     52 
     53 static void	load_image_data __P((caddr_t data, struct image_data *image));
     54 
     55 static void	grfmv_intr_generic_write1 __P((void *vsc, int slot));
     56 static void	grfmv_intr_generic_write4 __P((void *vsc, int slot));
     57 static void	grfmv_intr_generic_or4 __P((void *vsc, int slot));
     58 
     59 static void	grfmv_intr_cb264 __P((void *vsc, int slot));
     60 static void	grfmv_intr_cb364 __P((void *vsc, int slot));
     61 static void	grfmv_intr_cmax __P((void *vsc, int slot));
     62 static void	grfmv_intr_cti __P((void *vsc, int slot));
     63 static void	grfmv_intr_radius __P((void *vsc, int slot));
     64 static void	grfmv_intr_supermacgfx __P((void *vsc, int slot));
     65 static void	grfmv_intr_lapis __P((void *vsc, int slot));
     66 
     67 static int	grfmv_mode __P((struct grf_softc *gp, int cmd, void *arg));
     68 static caddr_t	grfmv_phys __P((struct grf_softc *gp));
     69 static int	grfmv_match __P((struct device *, struct cfdata *, void *));
     70 static void	grfmv_attach __P((struct device *, struct device *, void *));
     71 
     72 struct cfattach macvid_ca = {
     73 	sizeof(struct grfbus_softc), grfmv_match, grfmv_attach
     74 };
     75 
     76 static void
     77 load_image_data(data, image)
     78 	caddr_t	data;
     79 	struct	image_data *image;
     80 {
     81 	bcopy(data     , &image->size,       4);
     82 	bcopy(data +  4, &image->offset,     4);
     83 	bcopy(data +  8, &image->rowbytes,   2);
     84 	bcopy(data + 10, &image->top,        2);
     85 	bcopy(data + 12, &image->left,       2);
     86 	bcopy(data + 14, &image->bottom,     2);
     87 	bcopy(data + 16, &image->right,      2);
     88 	bcopy(data + 18, &image->version,    2);
     89 	bcopy(data + 20, &image->packType,   2);
     90 	bcopy(data + 22, &image->packSize,   4);
     91 	bcopy(data + 26, &image->hRes,       4);
     92 	bcopy(data + 30, &image->vRes,       4);
     93 	bcopy(data + 34, &image->pixelType,  2);
     94 	bcopy(data + 36, &image->pixelSize,  2);
     95 	bcopy(data + 38, &image->cmpCount,   2);
     96 	bcopy(data + 40, &image->cmpSize,    2);
     97 	bcopy(data + 42, &image->planeBytes, 4);
     98 }
     99 
    100 
    101 static int
    102 grfmv_match(parent, cf, aux)
    103 	struct device *parent;
    104 	struct cfdata *cf;
    105 	void *aux;
    106 {
    107 	struct nubus_attach_args *na = (struct nubus_attach_args *)aux;
    108 
    109 	if (na->category != NUBUS_CATEGORY_DISPLAY)
    110 		return 0;
    111 
    112 	if (na->type != NUBUS_TYPE_VIDEO)
    113 		return 0;
    114 
    115 	if (na->drsw != NUBUS_DRSW_APPLE)
    116 		return 0;
    117 
    118 	/*
    119 	 * If we've gotten this far, then we're dealing with a real-live
    120 	 * Apple QuickDraw-compatible display card resource.  Now, how to
    121 	 * determine that this is an active resource???  Dunno.  But we'll
    122 	 * proceed like it is.
    123 	 */
    124 
    125 	return 1;
    126 }
    127 
    128 static void
    129 grfmv_attach(parent, self, aux)
    130 	struct device *parent, *self;
    131 	void *aux;
    132 {
    133 	struct grfbus_softc *sc = (struct grfbus_softc *)self;
    134 	struct nubus_attach_args *na = (struct nubus_attach_args *)aux;
    135 	struct image_data image_store, image;
    136 	struct grfmode *gm;
    137 	char cardname[CARD_NAME_LEN];
    138 	nubus_dirent dirent;
    139 	nubus_dir dir, mode_dir;
    140 	int mode;
    141 
    142 	sc->sc_tag = na->na_tag;
    143 	sc->card_id = na->drhw;
    144 
    145 	bcopy(na->fmt, &sc->sc_slot, sizeof(nubus_slot));
    146 
    147 	if (bus_space_map(sc->sc_tag,
    148 	    NUBUS_SLOT2PA(na->slot), NBMEMSIZE, 0, &sc->sc_handle)) {
    149 		printf(": grfmv_attach: failed to map slot %d\n", na->slot);
    150 		return;
    151 	}
    152 
    153 	nubus_get_main_dir(&sc->sc_slot, &dir);
    154 
    155 	if (nubus_find_rsrc(sc->sc_tag, sc->sc_handle,
    156 	    &sc->sc_slot, &dir, na->rsrcid, &dirent) <= 0) {
    157 bad:
    158 		bus_space_unmap(sc->sc_tag, sc->sc_handle, NBMEMSIZE);
    159 		return;
    160 	}
    161 
    162 	nubus_get_dir_from_rsrc(&sc->sc_slot, &dirent, &sc->board_dir);
    163 
    164 	if (nubus_find_rsrc(sc->sc_tag, sc->sc_handle,
    165 	    &sc->sc_slot, &sc->board_dir, NUBUS_RSRC_TYPE, &dirent) <= 0)
    166 		if ((na->rsrcid != 128) ||
    167 		    (nubus_find_rsrc(sc->sc_tag, sc->sc_handle,
    168 		    &sc->sc_slot, &dir, 129, &dirent) <= 0))
    169 			goto bad;
    170 
    171 	mode = NUBUS_RSRC_FIRSTMODE;
    172 	if (nubus_find_rsrc(sc->sc_tag, sc->sc_handle,
    173 	    &sc->sc_slot, &sc->board_dir, mode, &dirent) <= 0) {
    174 		printf(": probe failed to get board rsrc.\n");
    175 		goto bad;
    176 	}
    177 
    178 	nubus_get_dir_from_rsrc(&sc->sc_slot, &dirent, &mode_dir);
    179 
    180 	if (nubus_find_rsrc(sc->sc_tag, sc->sc_handle,
    181 	    &sc->sc_slot, &mode_dir, VID_PARAMS, &dirent) <= 0) {
    182 		printf(": probe failed to get mode dir.\n");
    183 		goto bad;
    184 	}
    185 
    186 	if (nubus_get_ind_data(sc->sc_tag, sc->sc_handle, &sc->sc_slot,
    187 	    &dirent, (caddr_t)&image_store, sizeof(struct image_data)) <= 0) {
    188 		printf(": probe failed to get indirect mode data.\n");
    189 		goto bad;
    190 	}
    191 
    192 	/* Need to load display info (and driver?), etc... (?) */
    193 
    194 	load_image_data((caddr_t)&image_store, &image);
    195 
    196 	gm = &sc->curr_mode;
    197 	gm->mode_id = mode;
    198 	gm->fbbase = (caddr_t)sc->sc_handle; /* XXX evil! */
    199 	gm->fboff = image.offset;
    200 	gm->rowbytes = image.rowbytes;
    201 	gm->width = image.right - image.left;
    202 	gm->height = image.bottom - image.top;
    203 	gm->fbsize = gm->height * gm->rowbytes;
    204 	gm->hres = image.hRes;
    205 	gm->vres = image.vRes;
    206 	gm->ptype = image.pixelType;
    207 	gm->psize = image.pixelSize;
    208 
    209 	strncpy(cardname, nubus_get_card_name(sc->sc_tag, sc->sc_handle,
    210 	    &sc->sc_slot), CARD_NAME_LEN);
    211 	cardname[CARD_NAME_LEN-1] = '\0';
    212 	printf(": %s\n", cardname);
    213 
    214 	if (sc->card_id == NUBUS_DRHW_TFB) {
    215 		/*
    216 		 * This is the Toby card, but apparently some manufacturers
    217 		 * (like Cornerstone) didn't bother to get/use their own
    218 		 * value here, even though the cards are different, so we
    219 		 * so we try to differentiate here.
    220 		 */
    221 		if (strncmp(cardname, "Samsung 768", 11) == 0)
    222 			sc->card_id = NUBUS_DRHW_SAM768;
    223 		else if (strncmp(cardname, "Toby frame", 10) != 0)
    224 			printf("%s: This display card pretends to be a TFB!\n",
    225 			    sc->sc_dev.dv_xname);
    226 	}
    227 
    228 	switch (sc->card_id) {
    229 	case NUBUS_DRHW_TFB:
    230 	case NUBUS_DRHW_M2HRVC:
    231 	case NUBUS_DRHW_PVC:
    232 		sc->cli_offset = 0xa0000;
    233 		sc->cli_value = 0;
    234 		add_nubus_intr(na->slot, grfmv_intr_generic_write1, sc);
    235 		break;
    236 	case NUBUS_DRHW_WVC:
    237 		sc->cli_offset = 0xa00000;
    238 		sc->cli_value = 0;
    239 		add_nubus_intr(na->slot, grfmv_intr_generic_write1, sc);
    240 		break;
    241 	case NUBUS_DRHW_COLORMAX:
    242 		add_nubus_intr(na->slot, grfmv_intr_cmax, sc);
    243 		break;
    244 	case NUBUS_DRHW_SE30:
    245 		/* Do nothing--SE/30 interrupts are disabled */
    246 		break;
    247 	case NUBUS_DRHW_MDC:
    248 		sc->cli_offset = 0x200148;
    249 		sc->cli_value = 1;
    250 		add_nubus_intr(na->slot, grfmv_intr_generic_write4, sc);
    251 
    252 		/* Enable interrupts; to disable, write 0x7 to this location */
    253 		bus_space_write_4(sc->sc_tag, sc->sc_handle, 0x20013C, 5);
    254 		break;
    255 	case NUBUS_DRHW_CB264:
    256 		add_nubus_intr(na->slot, grfmv_intr_cb264, sc);
    257 		break;
    258 	case NUBUS_DRHW_CB364:
    259 		add_nubus_intr(na->slot, grfmv_intr_cb364, sc);
    260 		break;
    261 	case NUBUS_DRHW_RPC8:
    262 		sc->cli_offset = 0xfdff8f;
    263 		sc->cli_value = 0xff;
    264 		add_nubus_intr(na->slot, grfmv_intr_generic_write1, sc);
    265 		break;
    266 	case NUBUS_DRHW_RPC8XJ:
    267 		add_nubus_intr(na->slot, grfmv_intr_radius, sc);
    268 		break;
    269 	case NUBUS_DRHW_FIILX:
    270 	case NUBUS_DRHW_FIISXDSP:
    271 	case NUBUS_DRHW_FUTURASX:
    272 		sc->cli_offset = 0xf05000;
    273 		sc->cli_value = 0x80;
    274 		add_nubus_intr(na->slot, grfmv_intr_generic_write1, sc);
    275 		break;
    276 	case NUBUS_DRHW_SAM768:
    277 		add_nubus_intr(na->slot, grfmv_intr_cti, sc);
    278 		break;
    279 	case NUBUS_DRHW_SUPRGFX:
    280 		add_nubus_intr(na->slot, grfmv_intr_supermacgfx, sc);
    281 		break;
    282 	case NUBUS_DRHW_SPECTRM8:
    283 		sc->cli_offset = 0x0de178;
    284 		sc->cli_value = 0x80;
    285 		add_nubus_intr(na->slot, grfmv_intr_generic_or4, sc);
    286 		break;
    287 	case NUBUS_DRHW_LAPIS:
    288 		add_nubus_intr(na->slot, grfmv_intr_lapis, sc);
    289 		break;
    290 	case NUBUS_DRHW_MICRON:
    291 		/* What do we know about this one? */
    292 	default:
    293 		printf("%s: Unknown video card ID 0x%x --",
    294 		    sc->sc_dev.dv_xname, sc->card_id);
    295 		printf(" Not installing interrupt routine.\n");
    296 		break;
    297 	}
    298 
    299 	/* Perform common video attachment. */
    300 	grf_establish(sc, &sc->sc_slot, grfmv_mode, grfmv_phys);
    301 }
    302 
    303 static int
    304 grfmv_mode(gp, cmd, arg)
    305 	struct grf_softc *gp;
    306 	int cmd;
    307 	void *arg;
    308 {
    309 	switch (cmd) {
    310 	case GM_GRFON:
    311 	case GM_GRFOFF:
    312 		return 0;
    313 	case GM_CURRMODE:
    314 		break;
    315 	case GM_NEWMODE:
    316 		break;
    317 	case GM_LISTMODES:
    318 		break;
    319 	}
    320 	return EINVAL;
    321 }
    322 
    323 static caddr_t
    324 grfmv_phys(gp)
    325 	struct grf_softc *gp;
    326 {
    327 	return (caddr_t)NUBUS_SLOT2PA(gp->sc_slot->slot);
    328 }
    329 
    330 /* Interrupt handlers... */
    331 /*
    332  * Generic routine to clear interrupts for cards where it simply takes
    333  * a MOV.B to clear the interrupt.  The offset and value of this byte
    334  * varies between cards.
    335  */
    336 /*ARGSUSED*/
    337 static void
    338 grfmv_intr_generic_write1(vsc, slot)
    339 	void	*vsc;
    340 	int	slot;
    341 {
    342 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
    343 
    344 	bus_space_write_1(sc->sc_tag, sc->sc_handle,
    345 	    sc->cli_offset, (u_int8_t)sc->cli_value);
    346 }
    347 
    348 /*
    349  * Generic routine to clear interrupts for cards where it simply takes
    350  * a MOV.L to clear the interrupt.  The offset and value of this byte
    351  * varies between cards.
    352  */
    353 /*ARGSUSED*/
    354 static void
    355 grfmv_intr_generic_write4(vsc, slot)
    356 	void	*vsc;
    357 	int	slot;
    358 {
    359 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
    360 
    361 	bus_space_write_4(sc->sc_tag, sc->sc_handle,
    362 	    sc->cli_offset, sc->cli_value);
    363 }
    364 
    365 /*
    366  * Generic routine to clear interrupts for cards where it simply takes
    367  * an OR.L to clear the interrupt.  The offset and value of this byte
    368  * varies between cards.
    369  */
    370 /*ARGSUSED*/
    371 static void
    372 grfmv_intr_generic_or4(vsc, slot)
    373 	void	*vsc;
    374 	int	slot;
    375 {
    376 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
    377 	unsigned long	scratch;
    378 
    379 	scratch = bus_space_read_4(sc->sc_tag, sc->sc_handle, sc->cli_offset);
    380 	scratch |= 0x80;
    381 	bus_space_write_4(sc->sc_tag, sc->sc_handle, sc->cli_offset, scratch);
    382 }
    383 
    384 /*
    385  * Routine to clear interrupts for the Radius PrecisionColor 8xj card.
    386  */
    387 /*ARGSUSED*/
    388 static void
    389 grfmv_intr_radius(vsc, slot)
    390 	void	*vsc;
    391 	int	slot;
    392 {
    393 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
    394 	u_int8_t c;
    395 
    396 	/*
    397 	 * The value 0x66 was the observed value on one	card.  It is read
    398 	 * from the driver's information block, so this may not be sufficient.
    399 	 * Then again, we're not setting up any other interrupts...
    400 	 */
    401 	c = 0x66;
    402 
    403 	c |= 0x80;
    404 	bus_space_write_1(sc->sc_tag, sc->sc_handle, 0xd00403, c);
    405 	c &= 0x7f;
    406 	bus_space_write_1(sc->sc_tag, sc->sc_handle, 0xd00403, c);
    407 }
    408 
    409 /*
    410  * Routine to clear interrupts on Samsung 768x1006 video controller.
    411  * This controller was manufactured by Cornerstone Technology, Inc.,
    412  * now known as Cornerstone Imaging.
    413  *
    414  * To clear this interrupt, we apparently have to set, then clear,
    415  * bit 2 at byte offset 0x80000 from the card's base.
    416  *	Information for this provided by Brad Salai <bsalai (at) servtech.com>
    417  */
    418 /*ARGSUSED*/
    419 static void
    420 grfmv_intr_cti(vsc, slot)
    421 	void	*vsc;
    422 	int	slot;
    423 {
    424 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
    425 	u_int8_t c;
    426 
    427 	c = bus_space_read_1(sc->sc_tag, sc->sc_handle, 0x80000);
    428 	c |= 0x02;
    429 	bus_space_write_1(sc->sc_tag, sc->sc_handle, 0x80000, c);
    430 	c &= 0xfd;
    431 	bus_space_write_1(sc->sc_tag, sc->sc_handle, 0x80000, c);
    432 }
    433 
    434 /*ARGSUSED*/
    435 static void
    436 grfmv_intr_cb264(vsc, slot)
    437 	void	*vsc;
    438 	int	slot;
    439 {
    440 	struct grfbus_softc *sc;
    441 	volatile char *slotbase;
    442 
    443 	sc = (struct grfbus_softc *)vsc;
    444 	slotbase = (volatile char *)sc->sc_handle;	/* XXX evil hack */
    445 	asm volatile("	movl	%0,a0
    446 			movl	a0@(0xff6028),d0
    447 			andl	#0x2,d0
    448 			beq	_mv_intr0
    449 			movql	#0x3,d0
    450 		_mv_intr0:
    451 			movl	a0@(0xff600c),d1
    452 			andl	#0x3,d1
    453 			cmpl	d1,d0
    454 			beq	_mv_intr_fin
    455 			movl	d0,a0@(0xff600c)
    456 			nop
    457 			tstb	d0
    458 			beq	_mv_intr1
    459 			movl	#0x0002,a0@(0xff6040)
    460 			movl	#0x0102,a0@(0xff6044)
    461 			movl	#0x0105,a0@(0xff6048)
    462 			movl	#0x000e,a0@(0xff604c)
    463 			movl	#0x001c,a0@(0xff6050)
    464 			movl	#0x00bc,a0@(0xff6054)
    465 			movl	#0x00c3,a0@(0xff6058)
    466 			movl	#0x0061,a0@(0xff605c)
    467 			movl	#0x0012,a0@(0xff6060)
    468 			bra	_mv_intr_fin
    469 		_mv_intr1:
    470 			movl	#0x0002,a0@(0xff6040)
    471 			movl	#0x0209,a0@(0xff6044)
    472 			movl	#0x020c,a0@(0xff6048)
    473 			movl	#0x000f,a0@(0xff604c)
    474 			movl	#0x0027,a0@(0xff6050)
    475 			movl	#0x00c7,a0@(0xff6054)
    476 			movl	#0x00d7,a0@(0xff6058)
    477 			movl	#0x006b,a0@(0xff605c)
    478 			movl	#0x0029,a0@(0xff6060)
    479 		_mv_intr_fin:
    480 			movl	#0x1,a0@(0xff6014)"
    481 		: : "g" (slotbase) : "a0","d0","d1");
    482 }
    483 
    484 /*
    485  * Support for the Colorboard 364 might be more complex than it needs to
    486  * be.  If we can find more information about this card, this might be
    487  * significantly simplified.  Contributions welcome...  :-)
    488  */
    489 /*ARGSUSED*/
    490 static void
    491 grfmv_intr_cb364(vsc, slot)
    492 	void	*vsc;
    493 	int	slot;
    494 {
    495 	struct grfbus_softc *sc;
    496 	volatile char *slotbase;
    497 
    498 	sc = (struct grfbus_softc *)vsc;
    499 	slotbase = (volatile char *)sc->sc_handle;	/* XXX evil hack */
    500 	asm volatile("	movl	%0,a0
    501 			movl	a0@(0xfe6028),d0
    502 			andl	#0x2,d0
    503 			beq	_cb364_intr4
    504 			movql	#0x3,d0
    505 			movl	a0@(0xfe6018),d1
    506 			movl	#0x3,a0@(0xfe6018)
    507 			movw	a0@(0xfe7010),d2
    508 			movl	d1,a0@(0xfe6018)
    509 			movl	a0@(0xfe6020),d1
    510 			btst	#0x06,d2
    511 			beq	_cb364_intr0
    512 			btst	#0x00,d1
    513 			beq	_cb364_intr5
    514 			bsr	_cb364_intr1
    515 			bra	_cb364_intr_out
    516 		_cb364_intr0:
    517 			btst	#0x00,d1
    518 			bne	_cb364_intr5
    519 			bsr	_cb364_intr1
    520 			bra	_cb364_intr_out
    521 		_cb364_intr1:
    522 			movl	d0,a0@(0xfe600c)
    523 			nop
    524 			tstb	d0
    525 			beq	_cb364_intr3
    526 			movl	#0x0002,a0@(0xfe6040)
    527 			movl	#0x0105,a0@(0xfe6048)
    528 			movl	#0x000e,a0@(0xfe604c)
    529 			movl	#0x00c3,a0@(0xfe6058)
    530 			movl	#0x0061,a0@(0xfe605c)
    531 			btst	#0x06,d2
    532 			beq	_cb364_intr2
    533 			movl	#0x001c,a0@(0xfe6050)
    534 			movl	#0x00bc,a0@(0xfe6054)
    535 			movl	#0x0012,a0@(0xfe6060)
    536 			movl	#0x000e,a0@(0xfe6044)
    537 			movl	#0x00c3,a0@(0xfe6064)
    538 			movl	#0x0061,a0@(0xfe6020)
    539 			rts
    540 		_cb364_intr2:
    541 			movl	#0x0016,a0@(0xfe6050)
    542 			movl	#0x00b6,a0@(0xfe6054)
    543 			movl	#0x0011,a0@(0xfe6060)
    544 			movl	#0x0101,a0@(0xfe6044)
    545 			movl	#0x00bf,a0@(0xfe6064)
    546 			movl	#0x0001,a0@(0xfe6020)
    547 			rts
    548 		_cb364_intr3:
    549 			movl	#0x0002,a0@(0xfe6040)
    550 			movl	#0x0209,a0@(0xfe6044)
    551 			movl	#0x020c,a0@(0xfe6048)
    552 			movl	#0x000f,a0@(0xfe604c)
    553 			movl	#0x0027,a0@(0xfe6050)
    554 			movl	#0x00c7,a0@(0xfe6054)
    555 			movl	#0x00d7,a0@(0xfe6058)
    556 			movl	#0x006b,a0@(0xfe605c)
    557 			movl	#0x0029,a0@(0xfe6060)
    558 			oril	#0x0040,a0@(0xfe6064)
    559 			movl	#0x0000,a0@(0xfe6020)
    560 			rts
    561 		_cb364_intr4:
    562 			movq	#0x00,d0
    563 		_cb364_intr5:
    564 			movl	a0@(0xfe600c),d1
    565 			andl	#0x3,d1
    566 			cmpl	d1,d0
    567 			beq	_cb364_intr_out
    568 			bsr	_cb364_intr1
    569 		_cb364_intr_out:
    570 			movl	#0x1,a0@(0xfe6014)
    571 		_cb364_intr_quit:
    572 		" : : "g" (slotbase) : "a0","d0","d1","d2");
    573 }
    574 
    575 /*
    576  * Interrupt clearing routine for SuperMac GFX card.
    577  */
    578 /*ARGSUSED*/
    579 static void
    580 grfmv_intr_supermacgfx(vsc, slot)
    581 	void	*vsc;
    582 	int	slot;
    583 {
    584 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
    585 	u_int8_t dummy;
    586 
    587 	dummy = bus_space_read_1(sc->sc_tag, sc->sc_handle, 0xE70D3);
    588 }
    589 
    590 /*
    591  * Routine to clear interrupts for the Sigma Designs ColorMax card.
    592  */
    593 /*ARGSUSED*/
    594 static void
    595 grfmv_intr_cmax(vsc, slot)
    596 	void	*vsc;
    597 	int	slot;
    598 {
    599 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
    600 	u_int32_t dummy;
    601 
    602 	dummy = bus_space_read_4(sc->sc_tag, sc->sc_handle, 0xf501c);
    603 	dummy = bus_space_read_4(sc->sc_tag, sc->sc_handle, 0xf5018);
    604 }
    605 
    606 /*
    607  * Routine to clear interrupts for the Lapis ProColorServer 8 PDS card
    608  * (for the SE/30).
    609  */
    610 /*ARGSUSED*/
    611 static void
    612 grfmv_intr_lapis(vsc, slot)
    613 	void	*vsc;
    614 	int	slot;
    615 {
    616 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
    617 
    618 	bus_space_write_1(sc->sc_tag, sc->sc_handle, 0xff7000, 0x08);
    619 	bus_space_write_1(sc->sc_tag, sc->sc_handle, 0xff7000, 0x0C);
    620 }
    621