crmfbreg.h revision 1.9 1 1.9 macallan /* $NetBSD: crmfbreg.h,v 1.9 2008/11/06 22:16:03 macallan Exp $ */
2 1.1 macallan
3 1.1 macallan /*-
4 1.1 macallan * Copyright (c) 2007 Jared D. McNeill <jmcneill (at) invisible.ca>
5 1.5 macallan * 2008 Michael Lorenz <macallan (at) netbsd.org>
6 1.1 macallan * All rights reserved.
7 1.1 macallan *
8 1.1 macallan * Redistribution and use in source and binary forms, with or without
9 1.1 macallan * modification, are permitted provided that the following conditions
10 1.1 macallan * are met:
11 1.1 macallan * 1. Redistributions of source code must retain the above copyright
12 1.1 macallan * notice, this list of conditions and the following disclaimer.
13 1.1 macallan * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 macallan * notice, this list of conditions and the following disclaimer in the
15 1.1 macallan * documentation and/or other materials provided with the distribution.
16 1.1 macallan *
17 1.1 macallan * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 1.1 macallan * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 1.1 macallan * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 1.1 macallan * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 1.1 macallan * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 1.1 macallan * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 1.1 macallan * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 1.1 macallan * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 1.1 macallan * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 1.1 macallan * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 1.1 macallan * POSSIBILITY OF SUCH DAMAGE.
28 1.1 macallan */
29 1.1 macallan
30 1.1 macallan /*
31 1.1 macallan * SGI-CRM (O2) Framebuffer driver, register definitions
32 1.1 macallan */
33 1.1 macallan
34 1.1 macallan #ifndef CRMFBREG_H
35 1.1 macallan #define CRMFBREG_H
36 1.1 macallan
37 1.1 macallan #define CRMFB_DOTCLOCK 0x00000004
38 1.1 macallan #define CRMFB_DOTCLOCK_CLKRUN_SHIFT 20
39 1.1 macallan #define CRMFB_VT_XY 0x00010000
40 1.1 macallan #define CRMFB_VT_XY_FREEZE_SHIFT 31
41 1.3 sekiya #define CRMFB_VT_FLAGS 0x00010018
42 1.3 sekiya #define CRMFB_VT_FLAGS_SYNC_LOW_MSB 5
43 1.3 sekiya #define CRMFB_VT_FLAGS_SYNC_LOW_LSB 5
44 1.1 macallan #define CRMFB_VT_INTR01 0x00010020
45 1.1 macallan #define CRMFB_VT_INTR01_EN 0xffffffff
46 1.1 macallan #define CRMFB_VT_INTR23 0x00010024
47 1.1 macallan #define CRMFB_VT_INTR23_EN 0xffffffff
48 1.1 macallan #define CRMFB_VT_VPIX_EN 0x00010038
49 1.1 macallan #define CRMFB_VT_VPIX_EN_OFF_SHIFT 0
50 1.2 jmcneill #define CRMFB_VT_HCMAP 0x0001003c
51 1.2 jmcneill #define CRMFB_VT_HCMAP_ON_SHIFT 12
52 1.2 jmcneill #define CRMFB_VT_VCMAP 0x00010040
53 1.1 macallan #define CRMFB_VT_VCMAP_ON_SHIFT 12
54 1.1 macallan #define CRMFB_OVR_WIDTH_TILE 0x00020000
55 1.1 macallan #define CRMFB_OVR_CONTROL 0x00020008
56 1.1 macallan #define CRMFB_OVR_CONTROL_DMAEN_SHIFT 0
57 1.1 macallan #define CRMFB_FRM_TILESIZE 0x00030000
58 1.1 macallan #define CRMFB_FRM_TILESIZE_RHS_SHIFT 0
59 1.1 macallan #define CRMFB_FRM_TILESIZE_WIDTH_SHIFT 5
60 1.1 macallan #define CRMFB_FRM_TILESIZE_DEPTH_SHIFT 13
61 1.1 macallan #define CRMFB_FRM_TILESIZE_DEPTH_8 0
62 1.1 macallan #define CRMFB_FRM_TILESIZE_DEPTH_16 1
63 1.1 macallan #define CRMFB_FRM_TILESIZE_DEPTH_32 2
64 1.1 macallan #define CRMFB_FRM_TILESIZE_FIFOR_SHIFT 15
65 1.1 macallan #define CRMFB_FRM_PIXSIZE 0x00030004
66 1.1 macallan #define CRMFB_FRM_PIXSIZE_HEIGHT_SHIFT 16
67 1.1 macallan #define CRMFB_FRM_CONTROL 0x0003000c
68 1.1 macallan #define CRMFB_FRM_CONTROL_DMAEN_SHIFT 0
69 1.1 macallan #define CRMFB_FRM_CONTROL_LINEAR_SHIFT 1
70 1.1 macallan #define CRMFB_FRM_CONTROL_TILEPTR_SHIFT 9
71 1.1 macallan #define CRMFB_DID_CONTROL 0x00040004
72 1.1 macallan #define CRMFB_DID_CONTROL_DMAEN_SHIFT 0
73 1.1 macallan #define CRMFB_MODE 0x00048000
74 1.1 macallan #define CRMFB_MODE_TYP_SHIFT 2
75 1.1 macallan #define CRMFB_MODE_TYP_I8 0
76 1.1 macallan #define CRMFB_MODE_TYP_ARGB5 4
77 1.1 macallan #define CRMFB_MODE_TYP_RGB8 5
78 1.1 macallan #define CRMFB_MODE_BUF_SHIFT 0
79 1.1 macallan #define CRMFB_MODE_BUF_BOTH 3
80 1.1 macallan #define CRMFB_CMAP 0x00050000
81 1.1 macallan #define CRMFB_CMAP_FIFO 0x00058000
82 1.1 macallan #define CRMFB_GMAP 0x00060000
83 1.1 macallan #define CRMFB_CURSOR_POS 0x00070000
84 1.1 macallan /*
85 1.1 macallan * upper 16 bit are Y, lower 16 bit are X - both signed so there's no need for
86 1.1 macallan * a hotspot register
87 1.1 macallan */
88 1.1 macallan #define CRMFB_CURSOR_CONTROL 0x00070004
89 1.1 macallan #define CRMFB_CURSOR_ON 0x00000001
90 1.1 macallan #define CRMFB_CURSOR_CMAP0 0x00070008
91 1.1 macallan #define CRMFB_CURSOR_CMAP1 0x0007000c
92 1.1 macallan #define CRMFB_CURSOR_CMAP2 0x00070010
93 1.1 macallan #define CRMFB_CURSOR_BITMAP 0x00078000
94 1.1 macallan /* two bit deep cursor image, zero is transparent */
95 1.1 macallan
96 1.1 macallan /* rendering engine registers */
97 1.6 macallan /* these TLBs define 16x16 tiles, 64kB each, upper 16 bit only */
98 1.1 macallan #define CRIME_RE_TLB_A 0x1000
99 1.1 macallan #define CRIME_RE_TLB_B 0x1200
100 1.1 macallan #define CRIME_RE_TLB_C 0x1400
101 1.1 macallan #define CRIME_RE_TEX 0x1600
102 1.1 macallan #define CRIME_RE_CLIP_IDS 0x16e0
103 1.6 macallan /* 32bit entries, 4kB page address >> 12 | 0x80000000 */
104 1.1 macallan #define CRIME_RE_LINEAR_A 0x1700
105 1.1 macallan #define CRIME_RE_LINEAR_B 0x1780
106 1.1 macallan
107 1.1 macallan /* memory transfer engine from 0x3000*/
108 1.1 macallan #define CRIME_MTE_MODE 0x3000
109 1.1 macallan #define CRIME_MTE_BYTEMASK 0x3008
110 1.1 macallan #define CRIME_MTE_STIPPLEMASK 0x3010
111 1.1 macallan #define CRIME_MTE_BG 0x3018
112 1.4 macallan #define CRIME_MTE_SRC0 0x3020 /* start */
113 1.4 macallan #define CRIME_MTE_SRC1 0x3028 /* end */
114 1.4 macallan #define CRIME_MTE_DST0 0x3030 /* start */
115 1.4 macallan #define CRIME_MTE_DST1 0x3038 /* end */
116 1.7 macallan #define CRIME_MTE_SRC_Y_STEP 0x3040
117 1.7 macallan #define CRIME_MTE_DST_Y_STEP 0x3048
118 1.1 macallan #define CRIME_MTE_NULL 0x3070
119 1.1 macallan #define CRIME_MTE_FLUSH 0x3078
120 1.1 macallan
121 1.4 macallan /* CRIME_MTE_MODE */
122 1.4 macallan #define MTE_MODE_DST_ECC 0x00000001 /* enable ECC in DST */
123 1.6 macallan #define MTE_MODE_SRC_ECC 0x00000002 /* enable ECC in SRC */
124 1.4 macallan #define MTE_MODE_DST_BUF_MASK 0x0000001c
125 1.4 macallan #define MTE_TLB_A 0
126 1.4 macallan #define MTE_TLB_B 1
127 1.4 macallan #define MTE_TLB_C 2
128 1.4 macallan #define MTE_TLB_TEX 3
129 1.4 macallan #define MTE_TLB_LIN_A 4
130 1.4 macallan #define MTE_TLB_LIN_B 5
131 1.4 macallan #define MTE_TLB_CLIP 6
132 1.4 macallan #define MTE_DST_TLB_SHIFT 2
133 1.4 macallan #define MTE_MODE_SRC_BUF_MASK 0x000000e0
134 1.4 macallan #define MTE_SRC_TLB_SHIFT 5
135 1.4 macallan #define MTE_MODE_DEPTH_MASK 0x00000300
136 1.4 macallan #define MTE_DEPTH_8 0
137 1.4 macallan #define MTE_DEPTH_16 1
138 1.4 macallan #define MTE_DEPTH_32 2
139 1.4 macallan #define MTE_DEPTH_SHIFT 8
140 1.4 macallan #define MTE_MODE_STIPPLE 0x00000400
141 1.4 macallan #define MTE_MODE_COPY 0x00000800 /* 1 - copy, 0 - clear dst */
142 1.4 macallan
143 1.4 macallan /* drawing engine from 0x2000 */
144 1.4 macallan #define CRIME_DE_MODE_SRC 0x2000
145 1.4 macallan #define CRIME_DE_MODE_DST 0x2008
146 1.4 macallan #define CRIME_DE_CLIPMODE 0x2010
147 1.4 macallan #define CRIME_DE_DRAWMODE 0x2018
148 1.4 macallan #define CRIME_DE_SCRMASK0 0x2020
149 1.4 macallan #define CRIME_DE_SCRMASK1 0x2028
150 1.4 macallan #define CRIME_DE_SCRMASK2 0x2030
151 1.4 macallan #define CRIME_DE_SCRMASK3 0x2038
152 1.4 macallan #define CRIME_DE_SCRMASK4 0x2040
153 1.4 macallan #define CRIME_DE_SCISSOR 0x2048
154 1.4 macallan #define CRIME_DE_WINOFFSET_SRC 0x2050 /* x in upper, y in lower 16 bit */
155 1.4 macallan #define CRIME_DE_WINOFFSET_DST 0x2058
156 1.4 macallan #define CRIME_DE_PRIMITIVE 0x2060
157 1.4 macallan #define CRIME_DE_X_VERTEX_0 0x2070
158 1.4 macallan #define CRIME_DE_X_VERTEX_1 0x2074
159 1.4 macallan #define CRIME_DE_X_VERTEX_2 0x2078
160 1.4 macallan #define CRIME_DE_GL_VERTEX_0_X 0x2080
161 1.4 macallan #define CRIME_DE_GL_VERTEX_0_Y 0x2084
162 1.4 macallan #define CRIME_DE_GL_VERTEX_1_X 0x2088
163 1.4 macallan #define CRIME_DE_GL_VERTEX_1_Y 0x208c
164 1.4 macallan #define CRIME_DE_GL_VERTEX_2_X 0x2090
165 1.4 macallan #define CRIME_DE_GL_VERTEX_2_Y 0x2094
166 1.4 macallan #define CRIME_DE_XFER_ADDR_SRC 0x20a0
167 1.6 macallan #define CRIME_DE_XFER_STRD_SRC 0x20a4
168 1.4 macallan #define CRIME_DE_XFER_STEP_X 0x20a8
169 1.4 macallan #define CRIME_DE_XFER_STEP_Y 0x20ac
170 1.6 macallan #define CRIME_DE_XFER_ADDR_DST 0x20b0
171 1.6 macallan #define CRIME_DE_XFER_STRD_DST 0x20b4
172 1.4 macallan #define CRIME_DE_STIPPLE_MODE 0x20c0
173 1.4 macallan #define CRIME_DE_STIPPLE_PAT 0x20c4
174 1.4 macallan #define CRIME_DE_FG 0x20d0
175 1.4 macallan #define CRIME_DE_BG 0x20d8
176 1.9 macallan #define CRIME_DE_ALPHA_COLOR 0x21a0 /* constant colour for alpha */
177 1.9 macallan #define CRIME_DE_ALPHA_FUNC 0x21a8 /* blend function */
178 1.4 macallan #define CRIME_DE_ROP 0x21b0
179 1.4 macallan #define CRIME_DE_PLANEMASK 0x21b8
180 1.4 macallan
181 1.4 macallan #define CRIME_DE_NULL 0x21f0
182 1.4 macallan #define CRIME_DE_FLUSH 0x21f8
183 1.4 macallan
184 1.4 macallan #define CRIME_DE_START 0x0800 /* OR this to a register address in
185 1.4 macallan * order to start a command */
186 1.4 macallan
187 1.4 macallan /* CRIME_DE_MODE_* */
188 1.4 macallan #define DE_MODE_TLB_A 0x00000000
189 1.4 macallan #define DE_MODE_TLB_B 0x00000400
190 1.4 macallan #define DE_MODE_TLB_C 0x00000800
191 1.4 macallan #define DE_MODE_LIN_A 0x00001000
192 1.4 macallan #define DE_MODE_LIN_B 0x00001400
193 1.4 macallan #define DE_MODE_BUFDEPTH_8 0x00000000
194 1.4 macallan #define DE_MODE_BUFDEPTH_16 0x00000100
195 1.4 macallan #define DE_MODE_BUFDEPTH_32 0x00000200
196 1.4 macallan #define DE_MODE_TYPE_CI 0x00000000
197 1.4 macallan #define DE_MODE_TYPE_RGB 0x00000010
198 1.4 macallan #define DE_MODE_TYPE_RGBA 0x00000020
199 1.4 macallan #define DE_MODE_TYPE_ABGR 0x00000030
200 1.4 macallan #define DE_MODE_TYPE_YCRCB 0x000000f0
201 1.4 macallan #define DE_MODE_PIXDEPTH_8 0x00000000
202 1.4 macallan #define DE_MODE_PIXDEPTH_16 0x00000004
203 1.4 macallan #define DE_MODE_PIXDEPTH_32 0x00000008
204 1.4 macallan #define DE_MODE_DOUBLE_PIX 0x00000002
205 1.4 macallan #define DE_MODE_DOUBLE_SELECT 0x00000001
206 1.4 macallan
207 1.4 macallan /* clip mode */
208 1.4 macallan #define DE_CLIPMODE_ENABLE 0x00000800
209 1.4 macallan
210 1.4 macallan /* draw mode */
211 1.4 macallan #define DE_DRAWMODE_NO_CONF 0x00800000 /* disable coherency testing */
212 1.4 macallan #define DE_DRAWMODE_X11 0x00000000
213 1.4 macallan #define DE_DRAWMODE_GL 0x00400000
214 1.4 macallan #define DE_DRAWMODE_XFER_EN 0x00200000
215 1.4 macallan #define DE_DRAWMODE_SCISSOR_EN 0x00100000
216 1.4 macallan #define DE_DRAWMODE_LINE_STIP 0x00080000
217 1.4 macallan #define DE_DRAWMODE_POLY_STIP 0x00040000
218 1.4 macallan #define DE_DRAWMODE_OPAQUE_STIP 0x00020000
219 1.4 macallan #define DE_DRAWMODE_SHADE 0x00010000 /* smooth shading enable */
220 1.4 macallan #define DE_DRAWMODE_TEXTURE 0x00008000
221 1.4 macallan #define DE_DRAWMODE_FOG 0x00004000
222 1.4 macallan #define DE_DRAWMODE_COVERAGE 0x00002000
223 1.4 macallan #define DE_DRAWMODE_LINE_AA 0x00001000
224 1.4 macallan #define DE_DRAWMODE_ALPHA_TEST 0x00000800
225 1.4 macallan #define DE_DRAWMODE_ALPHA_BLEND 0x00000400
226 1.4 macallan #define DE_DRAWMODE_ROP 0x00000200
227 1.4 macallan #define DE_DRAWMODE_DITHER 0x00000100
228 1.4 macallan #define DE_DRAWMODE_PLANEMASK 0x00000080
229 1.4 macallan #define DE_DRAWMODE_BYTEMASK 0x00000078
230 1.4 macallan #define DE_DRAWMODE_DEPTH_TEST 0x00000004
231 1.4 macallan #define DE_DRAWMODE_DEPTH_MASK 0x00000002
232 1.4 macallan #define DE_DRAWMODE_STENCIL 0x00000001
233 1.4 macallan
234 1.4 macallan /* primitive */
235 1.4 macallan #define DE_PRIM_POINT 0x00000000
236 1.4 macallan #define DE_PRIM_LINE 0x01000000
237 1.4 macallan #define DE_PRIM_TRIANGLE 0x02000000
238 1.4 macallan #define DE_PRIM_RECTANGLE 0x03000000
239 1.4 macallan #define DE_PRIM_LINE_SKIP_END 0x00040000
240 1.4 macallan #define DE_PRIM_LR 0x00000000 /* left to right */
241 1.4 macallan #define DE_PRIM_RL 0x00010000 /* right to left */
242 1.4 macallan #define DE_PRIM_BT 0x00000000 /* bottom to top */
243 1.4 macallan #define DE_PRIM_TB 0x00020000 /* top to bottom */
244 1.4 macallan #define DE_PRIM_LINE_WIDTH_MASK 0x0000ffff /* in half pixels */
245 1.4 macallan
246 1.9 macallan /* alpha function register */
247 1.9 macallan #define DE_ALPHA_ADD 0x00000000
248 1.9 macallan #define DE_ALPHA_MIN 0x00000100
249 1.9 macallan #define DE_ALPHA_MAX 0x00000200
250 1.9 macallan #define DE_ALPHA_SUB 0x00000300
251 1.9 macallan #define DE_ALPHA_REV_SUB 0x00000400
252 1.9 macallan
253 1.9 macallan #define DE_ALPHA_OP_ZERO 0
254 1.9 macallan #define DE_ALPHA_OP_ONE 1
255 1.9 macallan #define DE_ALPHA_OP_DST_COLOR 2
256 1.9 macallan #define DE_ALPHA_OP_1_MINUS_DST_COLOR 3
257 1.9 macallan #define DE_ALPHA_OP_SRC_ALPHA 4
258 1.9 macallan #define DE_ALPHA_OP_1_MINUS_SRC_ALPHA 5
259 1.9 macallan #define DE_ALPHA_OP_DST_ALPHA 6
260 1.9 macallan #define DE_ALPHA_OP_1_MINUS_DST_APLHA 7
261 1.9 macallan #define DE_ALPHA_OP_CONSTANT_COLOR 8
262 1.9 macallan #define DE_ALPHA_OP_1_MINUS_CONST_COLOR 9
263 1.9 macallan #define DE_ALPHA_OP_CONSTANT_ALPHA 10
264 1.9 macallan #define DE_ALPHA_OP_1_MINUS_CONST_ALPHA 11
265 1.9 macallan #define DE_ALPHA_OP_SRC_ALPHA_SATURATE 12
266 1.9 macallan
267 1.9 macallan #define DE_ALPHA_OP_SRC_SHIFT 4
268 1.9 macallan #define DE_ALPHA_OP_DST_SHIFT 0
269 1.9 macallan
270 1.4 macallan /* status register */
271 1.4 macallan #define CRIME_DE_STATUS 0x4000
272 1.4 macallan #define CRIME_DE_IDLE 0x10000000
273 1.9 macallan #define CRIME_DE_READY 0x02000000
274 1.4 macallan
275 1.1 macallan #endif /* CRMFBREG_H */
276