cg6_regs.h revision 5eefee25
1/*
2 * GX and Turbo GX framebuffer - hardware registers.
3 *
4 * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19 * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23/* $XFree86$ */
24
25#ifndef CG6_REGS_H
26#define CG6_REGS_H
27
28/* FHC definitions */
29#define CG6_FHC_FBID_SHIFT           24
30#define CG6_FHC_FBID_MASK            255
31#define CG6_FHC_REV_SHIFT            20
32#define CG6_FHC_REV_MASK             15
33#define CG6_FHC_FROP_DISABLE         (1 << 19)
34#define CG6_FHC_ROW_DISABLE          (1 << 18)
35#define CG6_FHC_SRC_DISABLE          (1 << 17)
36#define CG6_FHC_DST_DISABLE          (1 << 16)
37#define CG6_FHC_RESET                (1 << 15)
38#define CG6_FHC_LITTLE_ENDIAN        (1 << 13)
39#define CG6_FHC_RES_MASK             (3 << 11)
40#define CG6_FHC_1024                 (0 << 11)
41#define CG6_FHC_1152                 (1 << 11)
42#define CG6_FHC_1280                 (2 << 11)
43#define CG6_FHC_1600                 (3 << 11)
44#define CG6_FHC_CPU_MASK             (3 << 9)
45#define CG6_FHC_CPU_SPARC            (0 << 9)
46#define CG6_FHC_CPU_68020            (1 << 9)
47#define CG6_FHC_CPU_386              (2 << 9)
48#define CG6_FHC_TEST		     (1 << 8)
49#define CG6_FHC_TEST_X_SHIFT	     4
50#define CG6_FHC_TEST_X_MASK	     15
51#define CG6_FHC_TEST_Y_SHIFT	     0
52#define CG6_FHC_TEST_Y_MASK	     15
53
54/* FBC mode definitions */
55#define CG6_FBC_BLIT_IGNORE		0x00000000
56#define CG6_FBC_BLIT_NOSRC		0x00100000
57#define CG6_FBC_BLIT_SRC		0x00200000
58#define CG6_FBC_BLIT_ILLEGAL		0x00300000
59#define CG6_FBC_BLIT_MASK		0x00300000
60
61#define CG6_FBC_VBLANK			0x00080000
62
63#define CG6_FBC_MODE_IGNORE		0x00000000
64#define CG6_FBC_MODE_COLOR8		0x00020000
65#define CG6_FBC_MODE_COLOR1		0x00040000
66#define CG6_FBC_MODE_HRMONO		0x00060000
67#define CG6_FBC_MODE_MASK		0x00060000
68
69#define CG6_FBC_DRAW_IGNORE		0x00000000
70#define CG6_FBC_DRAW_RENDER		0x00008000
71#define CG6_FBC_DRAW_PICK		0x00010000
72#define CG6_FBC_DRAW_ILLEGAL		0x00018000
73#define CG6_FBC_DRAW_MASK		0x00018000
74
75#define CG6_FBC_BWRITE0_IGNORE		0x00000000
76#define CG6_FBC_BWRITE0_ENABLE		0x00002000
77#define CG6_FBC_BWRITE0_DISABLE		0x00004000
78#define CG6_FBC_BWRITE0_ILLEGAL		0x00006000
79#define CG6_FBC_BWRITE0_MASK		0x00006000
80
81#define CG6_FBC_BWRITE1_IGNORE		0x00000000
82#define CG6_FBC_BWRITE1_ENABLE		0x00000800
83#define CG6_FBC_BWRITE1_DISABLE		0x00001000
84#define CG6_FBC_BWRITE1_ILLEGAL		0x00001800
85#define CG6_FBC_BWRITE1_MASK		0x00001800
86
87#define CG6_FBC_BREAD_IGNORE		0x00000000
88#define CG6_FBC_BREAD_0			0x00000200
89#define CG6_FBC_BREAD_1			0x00000400
90#define CG6_FBC_BREAD_ILLEGAL		0x00000600
91#define CG6_FBC_BREAD_MASK		0x00000600
92
93#define CG6_FBC_BDISP_IGNORE		0x00000000
94#define CG6_FBC_BDISP_0			0x00000080
95#define CG6_FBC_BDISP_1			0x00000100
96#define CG6_FBC_BDISP_ILLEGAL		0x00000180
97#define CG6_FBC_BDISP_MASK		0x00000180
98
99#define CG6_FBC_INDEX_MOD		0x00000040
100#define CG6_FBC_INDEX_MASK		0x00000030
101
102/* THC definitions */
103#define CG6_THC_MISC_REV_SHIFT       16
104#define CG6_THC_MISC_REV_MASK        15
105#define CG6_THC_MISC_RESET           (1 << 12)
106#define CG6_THC_MISC_VIDEO           (1 << 10)
107#define CG6_THC_MISC_SYNC            (1 << 9)
108#define CG6_THC_MISC_VSYNC           (1 << 8)
109#define CG6_THC_MISC_SYNC_ENAB       (1 << 7)
110#define CG6_THC_MISC_CURS_RES        (1 << 6)
111#define CG6_THC_MISC_INT_ENAB        (1 << 5)
112#define CG6_THC_MISC_INT             (1 << 4)
113#define CG6_THC_MISC_INIT            0x9f
114
115typedef struct cg6_tec {
116	volatile unsigned int	tec_matrix;
117	volatile unsigned int	tec_clip;
118	volatile unsigned int	tec_vdc;
119} Cg6Tec, *Cg6TecPtr;
120
121typedef struct cg6_thc {
122        unsigned int		thc_pad0[512];
123	volatile unsigned int	thc_hs;		/* hsync timing */
124	volatile unsigned int	thc_hsdvs;
125	volatile unsigned int	thc_hd;
126	volatile unsigned int	thc_vs;		/* vsync timing */
127	volatile unsigned int	thc_vd;
128	volatile unsigned int	thc_refresh;
129	volatile unsigned int	thc_misc;
130	unsigned int		thc_pad1[56];
131	volatile unsigned int	thc_cursxy;	/* cursor x,y position (16 bits each) */
132	volatile unsigned int	thc_cursmask[32];/* cursor mask bits */
133	volatile unsigned int	thc_cursbits[32];/* what to show where mask enabled */
134} Cg6Thc, *Cg6ThcPtr;
135
136typedef struct cg6_fbc {
137	unsigned int		xxx0[1];
138	volatile unsigned int	mode;
139	volatile unsigned int	clip;
140	unsigned int		xxx1[1];
141	volatile unsigned int	s;
142	volatile unsigned int	draw;
143	volatile unsigned int	blit;
144	volatile unsigned int	font;
145	unsigned int		xxx2[24];
146	volatile unsigned int	x0, y0, z0, color0;
147	volatile unsigned int	x1, y1, z1, color1;
148	volatile unsigned int	x2, y2, z2, color2;
149	volatile unsigned int	x3, y3, z3, color3;
150	volatile unsigned int	offx, offy;
151	unsigned int		xxx3[2];
152	volatile unsigned int	incx, incy;
153	unsigned int		xxx4[2];
154	volatile unsigned int	clipminx, clipminy;
155	unsigned int		xxx5[2];
156	volatile unsigned int	clipmaxx, clipmaxy;
157	unsigned int		xxx6[2];
158	volatile unsigned int	fg;
159	volatile unsigned int	bg;
160	volatile unsigned int	alu;
161	volatile unsigned int	pm;
162	volatile unsigned int	pixelm;
163	unsigned int		xxx7[2];
164	volatile unsigned int	patalign;
165	volatile unsigned int	pattern[8];
166	unsigned int		xxx8[432];
167	volatile unsigned int	apointx, apointy, apointz;
168	unsigned int		xxx9[1];
169	volatile unsigned int	rpointx, rpointy, rpointz;
170	unsigned int		xxx10[5];
171	volatile unsigned int	pointr, pointg, pointb, pointa;
172	volatile unsigned int	alinex, aliney, alinez;
173	unsigned int		xxx11[1];
174	volatile unsigned int	rlinex, rliney, rlinez;
175	unsigned int		xxx12[5];
176	volatile unsigned int	liner, lineg, lineb, linea;
177	volatile unsigned int	atrix, atriy, atriz;
178	unsigned int		xxx13[1];
179	volatile unsigned int	rtrix, rtriy, rtriz;
180	unsigned int		xxx14[5];
181	volatile unsigned int	trir, trig, trib, tria;
182	volatile unsigned int	aquadx, aquady, aquadz;
183	unsigned int		xxx15[1];
184	volatile unsigned int	rquadx, rquady, rquadz;
185	unsigned int		xxx16[5];
186	volatile unsigned int	quadr, quadg, quadb, quada;
187	volatile unsigned int	arectx, arecty, arectz;
188	unsigned int		xxx17[1];
189	volatile unsigned int	rrectx, rrecty, rrectz;
190	unsigned int		xxx18[5];
191	volatile unsigned int	rectr, rectg, rectb, recta;
192} Cg6Fbc, *Cg6FbcPtr;
193
194#endif /* CG6_REGS_H */
195