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