Home | History | Annotate | Line # | Download | only in dev
grf_ulreg.h revision 1.8
      1  1.8    perry /*	$NetBSD: grf_ulreg.h,v 1.8 2005/12/24 20:06:47 perry Exp $	*/
      2  1.1   chopps 
      3  1.5       is /*-
      4  1.6       is  * Copyright (c) 1995 The NetBSD Foundation, Inc.
      5  1.1   chopps  * All rights reserved.
      6  1.1   chopps  *
      7  1.5       is  * This code is derived from software contributed to The NetBSD Foundation
      8  1.5       is  * by Ignatios Souvatzis.
      9  1.5       is  *
     10  1.1   chopps  * Redistribution and use in source and binary forms, with or without
     11  1.1   chopps  * modification, are permitted provided that the following conditions
     12  1.1   chopps  * are met:
     13  1.1   chopps  * 1. Redistributions of source code must retain the above copyright
     14  1.1   chopps  *    notice, this list of conditions and the following disclaimer.
     15  1.1   chopps  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1   chopps  *    notice, this list of conditions and the following disclaimer in the
     17  1.1   chopps  *    documentation and/or other materials provided with the distribution.
     18  1.1   chopps  * 3. All advertising materials mentioning features or use of this software
     19  1.1   chopps  *    must display the following acknowledgement:
     20  1.5       is  *        This product includes software developed by the NetBSD
     21  1.5       is  *        Foundation, Inc. and its contributors.
     22  1.5       is  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.5       is  *    contributors may be used to endorse or promote products derived
     24  1.5       is  *    from this software without specific prior written permission.
     25  1.1   chopps  *
     26  1.5       is  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.5       is  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.5       is  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.5       is  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.5       is  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.5       is  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.5       is  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.5       is  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.5       is  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.5       is  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.5       is  * POSSIBILITY OF SUCH DAMAGE.
     37  1.1   chopps  */
     38  1.5       is 
     39  1.1   chopps /*
     40  1.1   chopps  * Registers etc. for the University of Lowell graphics board.
     41  1.1   chopps  */
     42  1.1   chopps 
     43  1.1   chopps struct gspregs {
     44  1.1   chopps 	/*
     45  1.7  aymeric 	 * alas, they didn't invert the A1 bit, so we have to write the
     46  1.1   chopps 	 * address pointer in two parts
     47  1.1   chopps 	 */
     48  1.8    perry 	volatile u_short hstadrl;
     49  1.8    perry 	volatile u_short hstadrh;
     50  1.8    perry 	volatile u_short data;
     51  1.8    perry 	volatile u_short ctrl;
     52  1.1   chopps };
     53  1.1   chopps 
     54  1.1   chopps /* Bits in ctrl */
     55  1.1   chopps #define HLT	0x8000
     56  1.1   chopps #define CF	0x4000
     57  1.1   chopps #define LBL	0x2000
     58  1.1   chopps #define INCR	0x1000
     59  1.1   chopps #define INCW	0x0800
     60  1.1   chopps #define NMIM	0x0200
     61  1.1   chopps #define NMI	0x0100
     62  1.1   chopps 
     63  1.1   chopps #define INTOUT	0x0080
     64  1.1   chopps #define MSGOUT	0x0070
     65  1.1   chopps #define INTIN	0x0008
     66  1.1   chopps #define	MSGIN	0x0007
     67  1.1   chopps 
     68  1.1   chopps /* address macros */
     69  1.1   chopps 
     70  1.3   chopps #define GSPSETHADRS(gsp,adrs)	do {	\
     71  1.3   chopps     (gsp)->hstadrh = (adrs) >> 16;	\
     72  1.3   chopps     (gsp)->hstadrl = (adrs) & 0xFFFF;	\
     73  1.3   chopps     } while (0)
     74  1.3   chopps #define GSPGETHADRS(gsp)	((gsp)->hstadrh << 16 | (gsp)->hstadrl)
     75  1.1   chopps 
     76  1.1   chopps /* Standard addresses in GSP memory */
     77  1.1   chopps 
     78  1.1   chopps #define PUT_PTR_ADRS    0xFFA20000	/* put pointer in ring buffer */
     79  1.1   chopps #define PUT_HI_PTR_ADRS 0xFFA20010	/* put pointer high word */
     80  1.1   chopps #define GET_PTR_ADRS    0xFFA20020	/* get pointer (low word) */
     81  1.1   chopps #define GSP_MODE_ADRS   0xFFA20040	/* GSP mode word */
     82  1.1   chopps 
     83  1.1   chopps /* Bits in GSP mode word */
     84  1.1   chopps #define GMODE_HOLD      1               /* hold screen */
     85  1.1   chopps #define GMODE_FLUSH     2               /* flush GSP input queue */
     86  1.1   chopps #define GMODE_ALTSCRN   4               /* use alternate screen */
     87  1.1   chopps #define GMODE_DISPCTRL  8               /* display control chars */
     88  1.1   chopps 
     89  1.1   chopps /* command words */
     90  1.1   chopps #define GCMD_CMD_MSK	0x000F
     91  1.1   chopps #define GCMD_PAR_MSK	0xFFF0
     92  1.1   chopps 
     93  1.1   chopps #define GCMD_NOP	0
     94  1.1   chopps #define GCMD_CHAR	1	/* char, fg, bg, x, y */
     95  1.1   chopps #define GCMD_FILL	2	/* fg, x, y, w, h, ppop */
     96  1.1   chopps #define GCMD_PIXBLT	3	/* x, y, w, h, dx, dy */
     97  1.1   chopps #define GCMD_FNTMIR	4	/* */
     98  1.1   chopps #define GCMD_CMAP	5	/* overlay==1, index, red, green, blue */
     99  1.1   chopps #define GCMD_MCHG	6	/* width, height, baseh, basel, pitch, depth */
    100  1.1   chopps 
    101  1.1   chopps struct grf_ul_softc {
    102  1.1   chopps 	struct grf_softc	gus_sc;
    103  1.1   chopps 	u_int8_t		gus_imcmap[768];
    104  1.1   chopps 	u_int8_t		gus_ovcmap[12];
    105  1.1   chopps 	u_int8_t		gus_ovslct;
    106  1.1   chopps 	/* realconfig stuff assumes this is last, else it would get copied: */
    107  1.1   chopps 	struct isr		gus_isr;
    108  1.1   chopps };
    109  1.1   chopps 
    110  1.1   chopps #ifdef _KERNEL
    111  1.1   chopps void gsp_write(struct gspregs *gsp, u_int16_t *data, size_t size);
    112  1.2   chopps int grful_cnprobe(void);
    113  1.2   chopps void grful_iteinit(struct grf_softc *gp);
    114  1.1   chopps #endif
    115  1.1   chopps 
    116