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