xref: /netbsd/sys/arch/sparc64/dev/ffbreg.h (revision 6550d01e)
1 /*	$NetBSD: ffbreg.h,v 1.6 2006/09/14 16:05:18 martin Exp $	*/
2 /*	$OpenBSD: creatorreg.h,v 1.5 2002/07/29 06:21:45 jason Exp $	*/
3 
4 /*
5  * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. All advertising materials mentioning features or use of this software
17  *    must display the following acknowledgement:
18  *	This product includes software developed by Jason L. Wright
19  * 4. The name of the author may not be used to endorse or promote products
20  *    derived from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
26  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef FFB_REG_H
36 #define FFB_REG_H
37 
38 /* Number of register sets */
39 #define	FFB_NREGS		24
40 
41 /* Register set numbers */
42 #define	FFB_REG_PROM		0
43 #define	FFB_REG_DAC		1
44 #define	FFB_REG_FBC		2
45 #define	FFB_REG_DFB8R		3
46 #define	FFB_REG_DFB8G		4
47 #define	FFB_REG_DFB8B		5
48 #define	FFB_REG_DFB8X		6
49 #define	FFB_REG_DFB24		7
50 #define	FFB_REG_DFB32		8
51 #define	FFB_REG_SFB8R		9
52 #define	FFB_REG_SFB8G		10
53 #define	FFB_REG_SFB8B		11
54 #define	FFB_REG_SFB8X		12
55 #define	FFB_REG_SFB32		13
56 #define	FFB_REG_SFB64		14
57 #define	FFB_REG_DFB422A		15
58 
59 #define	FFB_DAC_TYPE		0x0
60 #define	FFB_DAC_VALUE		0x4
61 #define	FFB_DAC_TYPE2		0x8
62 #define	FFB_DAC_VALUE2		0xc
63 
64 /* DAC "TYPE" commands */
65 #define	FFB_DAC_SCMAP		0x2000	/* set (load) cmap */
66 #define	FFB_DAC_GSBLANK		0x6000	/* get/set blanking */
67 #define	FFB_DAC_GVERS		0x8000	/* get DAC version */
68 
69 #define	FFB_DAC_BLANK_OFF		0x1
70 #define	FFB_DAC_BLANK_HSYNC_DISABLE	0x4
71 #define	FFB_DAC_BLANK_VSYNC_DISABLE	0x8
72 
73 /* DAC "TYPE2" commands */
74 #define	FFB_DAC_CURSENAB	0x100	/* cursor enable */
75 #define	FFB_DAC_CURSECMAP	0x102	/* set cursor colormap */
76 #define	FFB_DAC_CURSEPOS	0x104	/* set cursor position */
77 
78 #define	FFB_FBC_ALPHA		0x00c
79 #define	FFB_FBC_RED		0x010
80 #define	FFB_FBC_GREEN		0x014
81 #define	FFB_FBC_BLUE		0x018
82 #define	FFB_FBC_DEPTH		0x01c
83 #define	FFB_FBC_Y		0x020
84 #define	FFB_FBC_X		0x024
85 #define	FFB_FBC_RYF		0x030
86 #define	FFB_FBC_RXF		0x034
87 #define	FFB_FBC_DMYF		0x040
88 #define	FFB_FBC_DMXF		0x044
89 #define	FFB_FBC_EBYI		0x050
90 #define	FFB_FBC_EBXI		0x054
91 #define	FFB_FBC_BY		0x060
92 #define	FFB_FBC_BX		0x064
93 #define	FFB_FBC_DY		0x068
94 #define	FFB_FBC_DX		0x06c
95 #define	FFB_FBC_BH		0x070
96 #define	FFB_FBC_BW		0x074
97 #define	FFB_FBC_SUVTX		0x100
98 #define	FFB_FBC_PPC		0x200	/* pixel processor control */
99 #define	FFB_FBC_WID		0x204	/* current WID */
100 #define	FFB_FBC_FG		0x208
101 #define	FFB_FBC_BG		0x20c
102 #define	FFB_FBC_CONSTY		0x210
103 #define	FFB_FBC_CONSTZ		0x214
104 #define	FFB_FBC_XCLIP		0x218
105 #define	FFB_FBC_DCSS		0x21c
106 #define	FFB_FBC_VCLIPMIN	0x220	/* Viewclip XY Min Bounds */
107 #define	FFB_FBC_VCLIPMAX	0x224
108 #define	FFB_FBC_VCLIPZMIN	0x228
109 #define	FFB_FBC_VCLIPZMAX	0x22c
110 #define	FFB_FBC_DCSF		0x230
111 #define	FFB_FBC_DCSB		0x234
112 #define	FFB_FBC_DCZF		0x238
113 #define	FFB_FBC_DCZB		0x23c
114 #define	FFB_FBC_BLENDC		0x244
115 #define	FFB_FBC_BLENDC1		0x248
116 #define	FFB_FBC_BLENDC2		0x24c
117 #define	FFB_FBC_FBRAMITC	0x250
118 #define	FFB_FBC_FBC		0x254	/* Frame Buffer Control	*/
119 #define	FFB_FBC_ROP		0x258	/* Raster OPeration */
120 #define	FFB_FBC_CMP		0x25c	/* Frame Buffer Compare */
121 #define	FFB_FBC_MATCHAB		0x260	/* Buffer AB Match Mask	*/
122 #define	FFB_FBC_MATCHC		0x264
123 #define	FFB_FBC_MAGNAB		0x268	/* Buffer AB Magnitude Mask */
124 #define	FFB_FBC_MAGNC		0x26c
125 #define	FFB_FBC_FBCFG0		0x270
126 #define	FFB_FBC_FBCFG1		0x274
127 #define	FFB_FBC_FBCFG2		0x278
128 #define	FFB_FBC_FBCFG3		0x27c
129 #define	FFB_FBC_PPCFG		0x280
130 #define	FFB_FBC_PICK		0x284
131 #define	FFB_FBC_FILLMODE	0x288
132 #define	FFB_FBC_FBRAMWAC	0x28c	/* FB RAM Write Address Control */
133 #define	FFB_FBC_PMASK		0x290	/* RGB Plane Mask */
134 #define	FFB_FBC_XPMASK		0x294	/* X PlaneMask */
135 #define	FFB_FBC_YPMASK		0x298
136 #define	FFB_FBC_ZPMASK		0x29c
137 #define	FFB_FBC_CLIP0MIN	0x2a0	/* Auxilliary Viewport Clips */
138 #define	FFB_FBC_CLIP0MAX	0x2a4
139 #define	FFB_FBC_CLIP1MIN	0x2a8
140 #define	FFB_FBC_CLIP1MAX	0x2ac
141 #define	FFB_FBC_CLIP2MIN	0x2b0
142 #define	FFB_FBC_CLIP2MAX	0x2b4
143 #define	FFB_FBC_CLIP3MIN	0x2b8
144 #define	FFB_FBC_CLIP3MAX	0x2bc
145 #define	FFB_FBC_RAWBLEND2	0x2c0
146 #define	FFB_FBC_RAWPREBLEND	0x2c4
147 #define	FFB_FBC_RAWSTENCIL	0x2c8
148 #define	FFB_FBC_RAWSTENCILCTL	0x2cc
149 #define	FFB_FBC_THREEDRAM1	0x2d0
150 #define	FFB_FBC_THREEDRAM2	0x2d4
151 #define	FFB_FBC_PASSIN		0x2d8
152 #define	FFB_FBC_RAWCLRDEPTH	0x2dc
153 #define	FFB_FBC_RAWPMASK	0x2e0
154 #define	FFB_FBC_RAWCSRC		0x2e4
155 #define	FFB_FBC_RAWMATCH	0x2e8
156 #define	FFB_FBC_RAWMAGN		0x2ec
157 #define	FFB_FBC_RAWROPBLEND	0x2f0
158 #define	FFB_FBC_RAWCMP		0x2f4
159 #define	FFB_FBC_RAWWAC		0x2f8
160 #define	FFB_FBC_FBRAMID		0x2fc
161 #define	FFB_FBC_DRAWOP		0x300	/* Draw OPeration */
162 #define	FFB_FBC_FONTLPAT	0x30c	/* Line Pattern control */
163 #define	FFB_FBC_FONTXY		0x314	/* XY Font coordinate */
164 #define	FFB_FBC_FONTW		0x318	/* Font Width */
165 #define	FFB_FBC_FONTINC		0x31c	/* Font Increment */
166 #define	FFB_FBC_FONT		0x320
167 #define	FFB_FBC_BLEND2		0x330
168 #define	FFB_FBC_PREBLEND	0x334
169 #define	FFB_FBC_STENCIL		0x338
170 #define	FFB_FBC_STENCILCTL	0x33c
171 #define	FFB_FBC_DCSS1		0x350
172 #define	FFB_FBC_DCSS2		0x354
173 #define	FFB_FBC_DCSS3		0x358
174 #define	FFB_FBC_WIDPMASK	0x35c
175 #define	FFB_FBC_DCS2		0x360
176 #define	FFB_FBC_DCS3		0x364
177 #define	FFB_FBC_DCS4		0x368
178 #define	FFB_FBC_DCD2		0x370
179 #define	FFB_FBC_DCD3		0x374
180 #define	FFB_FBC_DCD4		0x378
181 #define	FFB_FBC_PATTERN		0x380
182 #define	FFB_FBC_DEVID		0x800
183 #define	FFB_FBC_UCSR		0x900	/* User Control & Status */
184 #define	FFB_FBC_MER		0x980
185 
186 #define	FFB_FBC_WB_A		0x20000000
187 #define	FFB_FBC_WM_COMBINED	0x00080000
188 #define	FFB_FBC_RB_A		0x00004000
189 #define	FFB_FBC_SB_BOTH		0x00003000
190 #define	FFB_FBC_ZE_OFF		0x00000400
191 #define	FFB_FBC_YE_OFF		0x00000100
192 #define	FFB_FBC_XE_ON		0x00000080
193 #define	FFB_FBC_XE_OFF		0x00000040
194 #define	FFB_FBC_RGBE_ON		0x0000002a
195 #define	FFB_FBC_RGBE_MASK	0x0000003f
196 
197 #define	FBC_PPC_FW_DIS		0x00800000	/* force wid disable */
198 #define	FBC_PPC_FW_ENA		0x00c00000	/* force wid enable */
199 #define	FBC_PPC_ACE_DIS		0x00040000	/* aux clip disable */
200 #define	FBC_PPC_ACE_AUXSUB	0x00080000	/* aux clip add */
201 #define	FBC_PPC_ACE_AUXADD	0x000c0000	/* aux clip subtract */
202 #define	FBC_PPC_DCE_DIS		0x00020000	/* depth cue disable */
203 #define	FBC_PPC_DCE_ENA		0x00020000	/* depth cue enable */
204 #define	FBC_PPC_ABE_DIS		0x00008000	/* alpha blend disable */
205 #define	FBC_PPC_ABE_ENA		0x0000c000	/* alpha blend enable */
206 #define	FBC_PPC_VCE_DIS		0x00001000	/* view clip disable */
207 #define	FBC_PPC_VCE_2D		0x00002000	/* view clip 2d */
208 #define	FBC_PPC_VCE_3D		0x00003000	/* view clip 3d */
209 #define	FBC_PPC_APE_DIS		0x00000800	/* area pattern disable */
210 #define	FBC_PPC_APE_ENA		0x00000c00	/* area pattern enable */
211 #define	FBC_PPC_TBE_OPAQUE	0x00000200	/* opaque background */
212 #define	FBC_PPC_TBE_TRANSPAR	0x00000300	/* transparent background */
213 #define	FBC_PPC_ZS_VAR		0x00000080	/* z source ??? */
214 #define	FBC_PPC_ZS_CONST	0x000000c0	/* z source ??? */
215 #define	FBC_PPC_YS_VAR		0x00000020	/* y source ??? */
216 #define	FBC_PPC_YS_CONST	0x00000030	/* y source ??? */
217 #define	FBC_PPC_XS_WID		0x00000004	/* x source ??? */
218 #define	FBC_PPC_XS_VAR		0x00000008	/* x source ??? */
219 #define	FBC_PPC_XS_CONST	0x0000000c	/* x source ??? */
220 #define	FBC_PPC_CS_VAR		0x00000002	/* color source ??? */
221 #define	FBC_PPC_CS_CONST	0x00000003	/* color source ??? */
222 
223 #define	FBC_ROP_NEW		0x83
224 #define	FBC_ROP_OLD		0x85
225 
226 #define	FBC_UCSR_FIFO_MASK	0x00000fff
227 #define	FBC_UCSR_FB_BUSY	0x01000000
228 #define	FBC_UCSR_RP_BUSY	0x02000000
229 #define	FBC_UCSR_READ_ERR	0x40000000
230 #define	FBC_UCSR_FIFO_OVFL	0x80000000
231 
232 #define	FBC_DRAWOP_DOT		0x00
233 #define	FBC_DRAWOP_AADOT	0x01
234 #define	FBC_DRAWOP_BRLINECAP	0x02
235 #define	FBC_DRAWOP_BRLINEOPEN	0x03
236 #define	FBC_DRAWOP_DDLINE	0x04
237 #define	FBC_DRAWOP_AALINE	0x05
238 #define	FBC_DRAWOP_TRIANGLE	0x06
239 #define	FBC_DRAWOP_POLYGON	0x07
240 #define	FBC_DRAWOP_RECTANGLE	0x08
241 #define	FBC_DRAWOP_FASTFILL	0x09
242 #define	FBC_DRAWOP_BCOPY	0x0a	/* block copy: not implemented */
243 #define	FBC_DRAWOP_VSCROLL	0x0b	/* vertical scroll */
244 
245 #endif /* FFB_REG_H */
246