xref: /linux/drivers/gpu/drm/mgag200/mgag200_reg.h (revision 72a03a358c1c3d334e16b940448e3b32137e6597)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2414c4531SDave Airlie /*
3414c4531SDave Airlie  * MGA Millennium (MGA2064W) functions
4414c4531SDave Airlie  * MGA Mystique (MGA1064SG) functions
5414c4531SDave Airlie  *
6414c4531SDave Airlie  * Copyright 1996 The XFree86 Project, Inc.
7414c4531SDave Airlie  *
8414c4531SDave Airlie  * Authors
9414c4531SDave Airlie  *		Dirk Hohndel
10414c4531SDave Airlie  *			hohndel@XFree86.Org
11414c4531SDave Airlie  *		David Dawes
12414c4531SDave Airlie  *			dawes@XFree86.Org
13414c4531SDave Airlie  * Contributors:
14414c4531SDave Airlie  *		Guy DESBIEF, Aix-en-provence, France
15414c4531SDave Airlie  *			g.desbief@aix.pacwan.net
16414c4531SDave Airlie  *		MGA1064SG Mystique register file
17414c4531SDave Airlie  */
18414c4531SDave Airlie 
19414c4531SDave Airlie #ifndef _MGA_REG_H_
20414c4531SDave Airlie #define _MGA_REG_H_
21414c4531SDave Airlie 
22db05f8d3SThomas Zimmermann #include <linux/bits.h>
23db05f8d3SThomas Zimmermann 
24414c4531SDave Airlie #define	MGAREG_DWGCTL		0x1c00
25414c4531SDave Airlie #define	MGAREG_MACCESS		0x1c04
26414c4531SDave Airlie /* the following is a mystique only register */
27414c4531SDave Airlie #define MGAREG_MCTLWTST		0x1c08
28414c4531SDave Airlie #define	MGAREG_ZORG		0x1c0c
29414c4531SDave Airlie 
30414c4531SDave Airlie #define	MGAREG_PAT0		0x1c10
31414c4531SDave Airlie #define	MGAREG_PAT1		0x1c14
32414c4531SDave Airlie #define	MGAREG_PLNWT		0x1c1c
33414c4531SDave Airlie 
34414c4531SDave Airlie #define	MGAREG_BCOL		0x1c20
35414c4531SDave Airlie #define	MGAREG_FCOL		0x1c24
36414c4531SDave Airlie 
37414c4531SDave Airlie #define	MGAREG_SRC0		0x1c30
38414c4531SDave Airlie #define	MGAREG_SRC1		0x1c34
39414c4531SDave Airlie #define	MGAREG_SRC2		0x1c38
40414c4531SDave Airlie #define	MGAREG_SRC3		0x1c3c
41414c4531SDave Airlie 
42414c4531SDave Airlie #define	MGAREG_XYSTRT		0x1c40
43414c4531SDave Airlie #define	MGAREG_XYEND		0x1c44
44414c4531SDave Airlie 
45414c4531SDave Airlie #define	MGAREG_SHIFT		0x1c50
46414c4531SDave Airlie /* the following is a mystique only register */
47414c4531SDave Airlie #define MGAREG_DMAPAD		0x1c54
48414c4531SDave Airlie #define	MGAREG_SGN		0x1c58
49414c4531SDave Airlie #define	MGAREG_LEN		0x1c5c
50414c4531SDave Airlie 
51414c4531SDave Airlie #define	MGAREG_AR0		0x1c60
52414c4531SDave Airlie #define	MGAREG_AR1		0x1c64
53414c4531SDave Airlie #define	MGAREG_AR2		0x1c68
54414c4531SDave Airlie #define	MGAREG_AR3		0x1c6c
55414c4531SDave Airlie #define	MGAREG_AR4		0x1c70
56414c4531SDave Airlie #define	MGAREG_AR5		0x1c74
57414c4531SDave Airlie #define	MGAREG_AR6		0x1c78
58414c4531SDave Airlie 
59414c4531SDave Airlie #define	MGAREG_CXBNDRY		0x1c80
60414c4531SDave Airlie #define	MGAREG_FXBNDRY		0x1c84
61414c4531SDave Airlie #define	MGAREG_YDSTLEN		0x1c88
62414c4531SDave Airlie #define	MGAREG_PITCH		0x1c8c
63414c4531SDave Airlie 
64414c4531SDave Airlie #define	MGAREG_YDST		0x1c90
65414c4531SDave Airlie #define	MGAREG_YDSTORG		0x1c94
66414c4531SDave Airlie #define	MGAREG_YTOP		0x1c98
67414c4531SDave Airlie #define	MGAREG_YBOT		0x1c9c
68414c4531SDave Airlie 
69414c4531SDave Airlie #define	MGAREG_CXLEFT		0x1ca0
70414c4531SDave Airlie #define	MGAREG_CXRIGHT		0x1ca4
71414c4531SDave Airlie #define	MGAREG_FXLEFT		0x1ca8
72414c4531SDave Airlie #define	MGAREG_FXRIGHT		0x1cac
73414c4531SDave Airlie 
74414c4531SDave Airlie #define	MGAREG_XDST		0x1cb0
75414c4531SDave Airlie 
76414c4531SDave Airlie #define	MGAREG_DR0		0x1cc0
77414c4531SDave Airlie #define	MGAREG_DR1		0x1cc4
78414c4531SDave Airlie #define	MGAREG_DR2		0x1cc8
79414c4531SDave Airlie #define	MGAREG_DR3		0x1ccc
80414c4531SDave Airlie 
81414c4531SDave Airlie #define	MGAREG_DR4		0x1cd0
82414c4531SDave Airlie #define	MGAREG_DR5		0x1cd4
83414c4531SDave Airlie #define	MGAREG_DR6		0x1cd8
84414c4531SDave Airlie #define	MGAREG_DR7		0x1cdc
85414c4531SDave Airlie 
86414c4531SDave Airlie #define	MGAREG_DR8		0x1ce0
87414c4531SDave Airlie #define	MGAREG_DR9		0x1ce4
88414c4531SDave Airlie #define	MGAREG_DR10		0x1ce8
89414c4531SDave Airlie #define	MGAREG_DR11		0x1cec
90414c4531SDave Airlie 
91414c4531SDave Airlie #define	MGAREG_DR12		0x1cf0
92414c4531SDave Airlie #define	MGAREG_DR13		0x1cf4
93414c4531SDave Airlie #define	MGAREG_DR14		0x1cf8
94414c4531SDave Airlie #define	MGAREG_DR15		0x1cfc
95414c4531SDave Airlie 
96414c4531SDave Airlie #define MGAREG_SRCORG		0x2cb4
97414c4531SDave Airlie #define MGAREG_DSTORG		0x2cb8
98414c4531SDave Airlie 
99414c4531SDave Airlie /* add or or this to one of the previous "power registers" to start
100414c4531SDave Airlie    the drawing engine */
101414c4531SDave Airlie 
102414c4531SDave Airlie #define MGAREG_EXEC		0x0100
103414c4531SDave Airlie 
104414c4531SDave Airlie #define	MGAREG_FIFOSTATUS	0x1e10
105414c4531SDave Airlie #define	MGAREG_Status		0x1e14
106414c4531SDave Airlie #define MGAREG_CACHEFLUSH       0x1fff
107414c4531SDave Airlie #define	MGAREG_ICLEAR		0x1e18
108414c4531SDave Airlie #define	MGAREG_IEN		0x1e1c
109414c4531SDave Airlie 
110414c4531SDave Airlie #define	MGAREG_VCOUNT		0x1e20
111414c4531SDave Airlie 
112414c4531SDave Airlie #define	MGAREG_Reset		0x1e40
113414c4531SDave Airlie 
114414c4531SDave Airlie #define	MGAREG_OPMODE		0x1e54
115414c4531SDave Airlie 
116414c4531SDave Airlie /* Warp Registers */
117414c4531SDave Airlie #define MGAREG_WIADDR           0x1dc0
118414c4531SDave Airlie #define MGAREG_WIADDR2          0x1dd8
119414c4531SDave Airlie #define MGAREG_WGETMSB          0x1dc8
120414c4531SDave Airlie #define MGAREG_WVRTXSZ          0x1dcc
121414c4531SDave Airlie #define MGAREG_WACCEPTSEQ       0x1dd4
122414c4531SDave Airlie #define MGAREG_WMISC            0x1e70
123414c4531SDave Airlie 
124414c4531SDave Airlie #define MGAREG_MEMCTL           0x2e08
125414c4531SDave Airlie 
126414c4531SDave Airlie /* OPMODE register additives */
127414c4531SDave Airlie 
128414c4531SDave Airlie #define MGAOPM_DMA_GENERAL	(0x00 << 2)
129414c4531SDave Airlie #define MGAOPM_DMA_BLIT		(0x01 << 2)
130414c4531SDave Airlie #define MGAOPM_DMA_VECTOR	(0x10 << 2)
131414c4531SDave Airlie 
132414c4531SDave Airlie /* MACCESS register additives */
133414c4531SDave Airlie #define MGAMAC_PW8               0x00
134414c4531SDave Airlie #define MGAMAC_PW16              0x01
135414c4531SDave Airlie #define MGAMAC_PW24              0x03 /* not a typo */
136414c4531SDave Airlie #define MGAMAC_PW32              0x02 /* not a typo */
137414c4531SDave Airlie #define MGAMAC_BYPASS332         0x10000000
138414c4531SDave Airlie #define MGAMAC_NODITHER          0x40000000
139414c4531SDave Airlie #define MGAMAC_DIT555            0x80000000
140414c4531SDave Airlie 
141414c4531SDave Airlie /* DWGCTL register additives */
142414c4531SDave Airlie 
143414c4531SDave Airlie /* Lines */
144414c4531SDave Airlie 
145414c4531SDave Airlie #define MGADWG_LINE_OPEN	0x00
146414c4531SDave Airlie #define MGADWG_AUTOLINE_OPEN	0x01
147414c4531SDave Airlie #define MGADWG_LINE_CLOSE	0x02
148414c4531SDave Airlie #define MGADWG_AUTOLINE_CLOSE	0x03
149414c4531SDave Airlie 
150414c4531SDave Airlie /* Trapezoids */
151414c4531SDave Airlie #define MGADWG_TRAP		0x04
152414c4531SDave Airlie #define MGADWG_TEXTURE_TRAP	0x06
153414c4531SDave Airlie 
154414c4531SDave Airlie /* BitBlts */
155414c4531SDave Airlie 
156414c4531SDave Airlie #define MGADWG_BITBLT		0x08
157414c4531SDave Airlie #define MGADWG_FBITBLT		0x0c
158414c4531SDave Airlie #define MGADWG_ILOAD		0x09
159414c4531SDave Airlie #define MGADWG_ILOAD_SCALE	0x0d
160414c4531SDave Airlie #define MGADWG_ILOAD_FILTER	0x0f
161414c4531SDave Airlie #define MGADWG_ILOAD_HIQH	0x07
162414c4531SDave Airlie #define MGADWG_ILOAD_HIQHV	0x0e
163414c4531SDave Airlie #define MGADWG_IDUMP		0x0a
164414c4531SDave Airlie 
165414c4531SDave Airlie /* atype access to WRAM */
166414c4531SDave Airlie 
167414c4531SDave Airlie #define MGADWG_RPL		( 0x00 << 4 )
168414c4531SDave Airlie #define MGADWG_RSTR		( 0x01 << 4 )
169414c4531SDave Airlie #define MGADWG_ZI		( 0x03 << 4 )
170414c4531SDave Airlie #define MGADWG_BLK 		( 0x04 << 4 )
171414c4531SDave Airlie #define MGADWG_I		( 0x07 << 4 )
172414c4531SDave Airlie 
173414c4531SDave Airlie /* specifies whether bit blits are linear or xy */
174414c4531SDave Airlie #define MGADWG_LINEAR		( 0x01 << 7 )
175414c4531SDave Airlie 
176414c4531SDave Airlie /* z drawing mode. use MGADWG_NOZCMP for always */
177414c4531SDave Airlie 
178414c4531SDave Airlie #define MGADWG_NOZCMP		( 0x00 << 8 )
179414c4531SDave Airlie #define MGADWG_ZE		( 0x02 << 8 )
180414c4531SDave Airlie #define MGADWG_ZNE		( 0x03 << 8 )
181414c4531SDave Airlie #define MGADWG_ZLT		( 0x04 << 8 )
182414c4531SDave Airlie #define MGADWG_ZLTE		( 0x05 << 8 )
183414c4531SDave Airlie #define MGADWG_GT		( 0x06 << 8 )
184414c4531SDave Airlie #define MGADWG_GTE		( 0x07 << 8 )
185414c4531SDave Airlie 
186414c4531SDave Airlie /* use this to force colour expansion circuitry to do its stuff */
187414c4531SDave Airlie 
188414c4531SDave Airlie #define MGADWG_SOLID		( 0x01 << 11 )
189414c4531SDave Airlie 
190414c4531SDave Airlie /* ar register at zero */
191414c4531SDave Airlie 
192414c4531SDave Airlie #define MGADWG_ARZERO		( 0x01 << 12 )
193414c4531SDave Airlie 
194414c4531SDave Airlie #define MGADWG_SGNZERO		( 0x01 << 13 )
195414c4531SDave Airlie 
196414c4531SDave Airlie #define MGADWG_SHIFTZERO	( 0x01 << 14 )
197414c4531SDave Airlie 
198414c4531SDave Airlie /* See table on 4-43 for bop ALU operations */
199414c4531SDave Airlie 
200414c4531SDave Airlie /* See table on 4-44 for translucidity masks */
201414c4531SDave Airlie 
202414c4531SDave Airlie #define MGADWG_BMONOLEF		( 0x00 << 25 )
203414c4531SDave Airlie #define MGADWG_BMONOWF		( 0x04 << 25 )
204414c4531SDave Airlie #define MGADWG_BPLAN		( 0x01 << 25 )
205414c4531SDave Airlie 
206414c4531SDave Airlie /* note that if bfcol is specified and you're doing a bitblt, it causes
207414c4531SDave Airlie    a fbitblt to be performed, so check that you obey the fbitblt rules */
208414c4531SDave Airlie 
209414c4531SDave Airlie #define MGADWG_BFCOL   		( 0x02 << 25 )
210414c4531SDave Airlie #define MGADWG_BUYUV		( 0x0e << 25 )
211414c4531SDave Airlie #define MGADWG_BU32BGR		( 0x03 << 25 )
212414c4531SDave Airlie #define MGADWG_BU32RGB		( 0x07 << 25 )
213414c4531SDave Airlie #define MGADWG_BU24BGR		( 0x0b << 25 )
214414c4531SDave Airlie #define MGADWG_BU24RGB		( 0x0f << 25 )
215414c4531SDave Airlie 
216414c4531SDave Airlie #define MGADWG_PATTERN		( 0x01 << 29 )
217414c4531SDave Airlie #define MGADWG_TRANSC		( 0x01 << 30 )
218414c4531SDave Airlie #define MGAREG_MISC_WRITE	0x3c2
219414c4531SDave Airlie #define MGAREG_MISC_READ	0x3cc
220414c4531SDave Airlie #define MGAREG_MEM_MISC_WRITE       0x1fc2
221414c4531SDave Airlie #define MGAREG_MEM_MISC_READ        0x1fcc
222414c4531SDave Airlie 
223414c4531SDave Airlie #define MGAREG_MISC_IOADSEL	(0x1 << 0)
224414c4531SDave Airlie #define MGAREG_MISC_RAMMAPEN	(0x1 << 1)
225db05f8d3SThomas Zimmermann #define MGAREG_MISC_CLK_SEL_MASK	GENMASK(3, 2)
226414c4531SDave Airlie #define MGAREG_MISC_CLK_SEL_VGA25	(0x0 << 2)
227414c4531SDave Airlie #define MGAREG_MISC_CLK_SEL_VGA28	(0x1 << 2)
228414c4531SDave Airlie #define MGAREG_MISC_CLK_SEL_MGA_PIX	(0x2 << 2)
229414c4531SDave Airlie #define MGAREG_MISC_CLK_SEL_MGA_MSK	(0x3 << 2)
230414c4531SDave Airlie #define MGAREG_MISC_VIDEO_DIS	(0x1 << 4)
231414c4531SDave Airlie #define MGAREG_MISC_HIGH_PG_SEL	(0x1 << 5)
232db05f8d3SThomas Zimmermann #define MGAREG_MISC_HSYNCPOL		BIT(6)
233db05f8d3SThomas Zimmermann #define MGAREG_MISC_VSYNCPOL		BIT(7)
234414c4531SDave Airlie 
235414c4531SDave Airlie /* MMIO VGA registers */
236414c4531SDave Airlie #define MGAREG_SEQ_INDEX	0x1fc4
237414c4531SDave Airlie #define MGAREG_SEQ_DATA		0x1fc5
238414c4531SDave Airlie #define MGAREG_CRTC_INDEX	0x1fd4
239414c4531SDave Airlie #define MGAREG_CRTC_DATA	0x1fd5
240414c4531SDave Airlie #define MGAREG_CRTCEXT_INDEX	0x1fde
241414c4531SDave Airlie #define MGAREG_CRTCEXT_DATA	0x1fdf
242414c4531SDave Airlie 
243*72a03a35SThomas Zimmermann #define MGAREG_CRTCEXT0_OFFSET_MASK	GENMASK(5, 4)
244*72a03a35SThomas Zimmermann 
245a080db9fSChristopher Harvey /* Cursor X and Y position */
246a080db9fSChristopher Harvey #define MGA_CURPOSXL 0x3c0c
247a080db9fSChristopher Harvey #define MGA_CURPOSXH 0x3c0d
248a080db9fSChristopher Harvey #define MGA_CURPOSYL 0x3c0e
249a080db9fSChristopher Harvey #define MGA_CURPOSYH 0x3c0f
250414c4531SDave Airlie 
251414c4531SDave Airlie /* MGA bits for registers PCI_OPTION_REG */
252414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_PCI   		( 0x00 << 0 )
253414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_PLL   		( 0x01 << 0 )
254414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_EXT   		( 0x02 << 0 )
255414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_MSK   		( 0x03 << 0 )
256414c4531SDave Airlie 
257414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_DIS   		( 0x01 << 2 )
258414c4531SDave Airlie #define MGA1064_OPT_G_CLK_DIV_1   		( 0x01 << 3 )
259414c4531SDave Airlie #define MGA1064_OPT_M_CLK_DIV_1   		( 0x01 << 4 )
260414c4531SDave Airlie 
261414c4531SDave Airlie #define MGA1064_OPT_SYS_PLL_PDN   		( 0x01 << 5 )
262414c4531SDave Airlie #define MGA1064_OPT_VGA_ION   		( 0x01 << 8 )
263414c4531SDave Airlie 
264414c4531SDave Airlie /* MGA registers in PCI config space */
265414c4531SDave Airlie #define PCI_MGA_INDEX		0x44
266414c4531SDave Airlie #define PCI_MGA_DATA		0x48
267414c4531SDave Airlie #define PCI_MGA_OPTION		0x40
268414c4531SDave Airlie #define PCI_MGA_OPTION2		0x50
269414c4531SDave Airlie #define PCI_MGA_OPTION3		0x54
270414c4531SDave Airlie 
271414c4531SDave Airlie #define RAMDAC_OFFSET		0x3c00
272414c4531SDave Airlie 
273414c4531SDave Airlie /* TVP3026 direct registers */
274414c4531SDave Airlie 
275414c4531SDave Airlie #define TVP3026_INDEX		0x00
276414c4531SDave Airlie #define TVP3026_WADR_PAL	0x00
277414c4531SDave Airlie #define TVP3026_COL_PAL		0x01
278414c4531SDave Airlie #define TVP3026_PIX_RD_MSK	0x02
279414c4531SDave Airlie #define TVP3026_RADR_PAL	0x03
280414c4531SDave Airlie #define TVP3026_CUR_COL_ADDR	0x04
281414c4531SDave Airlie #define TVP3026_CUR_COL_DATA	0x05
282414c4531SDave Airlie #define TVP3026_DATA		0x0a
283414c4531SDave Airlie #define TVP3026_CUR_RAM		0x0b
284414c4531SDave Airlie #define TVP3026_CUR_XLOW	0x0c
285414c4531SDave Airlie #define TVP3026_CUR_XHI		0x0d
286414c4531SDave Airlie #define TVP3026_CUR_YLOW	0x0e
287414c4531SDave Airlie #define TVP3026_CUR_YHI		0x0f
288414c4531SDave Airlie 
289414c4531SDave Airlie /* TVP3026 indirect registers */
290414c4531SDave Airlie 
291414c4531SDave Airlie #define TVP3026_SILICON_REV	0x01
292414c4531SDave Airlie #define TVP3026_CURSOR_CTL	0x06
293414c4531SDave Airlie #define TVP3026_LATCH_CTL	0x0f
294414c4531SDave Airlie #define TVP3026_TRUE_COLOR_CTL	0x18
295414c4531SDave Airlie #define TVP3026_MUX_CTL		0x19
296414c4531SDave Airlie #define TVP3026_CLK_SEL		0x1a
297414c4531SDave Airlie #define TVP3026_PAL_PAGE	0x1c
298414c4531SDave Airlie #define TVP3026_GEN_CTL		0x1d
299414c4531SDave Airlie #define TVP3026_MISC_CTL	0x1e
300414c4531SDave Airlie #define TVP3026_GEN_IO_CTL	0x2a
301414c4531SDave Airlie #define TVP3026_GEN_IO_DATA	0x2b
302414c4531SDave Airlie #define TVP3026_PLL_ADDR	0x2c
303414c4531SDave Airlie #define TVP3026_PIX_CLK_DATA	0x2d
304414c4531SDave Airlie #define TVP3026_MEM_CLK_DATA	0x2e
305414c4531SDave Airlie #define TVP3026_LOAD_CLK_DATA	0x2f
306414c4531SDave Airlie #define TVP3026_KEY_RED_LOW	0x32
307414c4531SDave Airlie #define TVP3026_KEY_RED_HI	0x33
308414c4531SDave Airlie #define TVP3026_KEY_GREEN_LOW	0x34
309414c4531SDave Airlie #define TVP3026_KEY_GREEN_HI	0x35
310414c4531SDave Airlie #define TVP3026_KEY_BLUE_LOW	0x36
311414c4531SDave Airlie #define TVP3026_KEY_BLUE_HI	0x37
312414c4531SDave Airlie #define TVP3026_KEY_CTL		0x38
313414c4531SDave Airlie #define TVP3026_MCLK_CTL	0x39
314414c4531SDave Airlie #define TVP3026_SENSE_TEST	0x3a
315414c4531SDave Airlie #define TVP3026_TEST_DATA	0x3b
316414c4531SDave Airlie #define TVP3026_CRC_LSB		0x3c
317414c4531SDave Airlie #define TVP3026_CRC_MSB		0x3d
318414c4531SDave Airlie #define TVP3026_CRC_CTL		0x3e
319414c4531SDave Airlie #define TVP3026_ID		0x3f
320414c4531SDave Airlie #define TVP3026_RESET		0xff
321414c4531SDave Airlie 
322414c4531SDave Airlie 
323414c4531SDave Airlie /* MGA1064 DAC Register file */
324414c4531SDave Airlie /* MGA1064 direct registers */
325414c4531SDave Airlie 
326414c4531SDave Airlie #define MGA1064_INDEX		0x00
327414c4531SDave Airlie #define MGA1064_WADR_PAL	0x00
328414c4531SDave Airlie #define MGA1064_SPAREREG        0x00
329414c4531SDave Airlie #define MGA1064_COL_PAL		0x01
330414c4531SDave Airlie #define MGA1064_PIX_RD_MSK	0x02
331414c4531SDave Airlie #define MGA1064_RADR_PAL	0x03
332414c4531SDave Airlie #define MGA1064_DATA		0x0a
333414c4531SDave Airlie 
334414c4531SDave Airlie #define MGA1064_CUR_XLOW	0x0c
335414c4531SDave Airlie #define MGA1064_CUR_XHI		0x0d
336414c4531SDave Airlie #define MGA1064_CUR_YLOW	0x0e
337414c4531SDave Airlie #define MGA1064_CUR_YHI		0x0f
338414c4531SDave Airlie 
339414c4531SDave Airlie /* MGA1064 indirect registers */
340414c4531SDave Airlie #define MGA1064_DVI_PIPE_CTL    0x03
341414c4531SDave Airlie #define MGA1064_CURSOR_BASE_ADR_LOW	0x04
342414c4531SDave Airlie #define MGA1064_CURSOR_BASE_ADR_HI	0x05
343414c4531SDave Airlie #define MGA1064_CURSOR_CTL	0x06
344414c4531SDave Airlie #define MGA1064_CURSOR_COL0_RED	0x08
345414c4531SDave Airlie #define MGA1064_CURSOR_COL0_GREEN	0x09
346414c4531SDave Airlie #define MGA1064_CURSOR_COL0_BLUE	0x0a
347414c4531SDave Airlie 
348414c4531SDave Airlie #define MGA1064_CURSOR_COL1_RED	0x0c
349414c4531SDave Airlie #define MGA1064_CURSOR_COL1_GREEN	0x0d
350414c4531SDave Airlie #define MGA1064_CURSOR_COL1_BLUE	0x0e
351414c4531SDave Airlie 
352414c4531SDave Airlie #define MGA1064_CURSOR_COL2_RED	0x010
353414c4531SDave Airlie #define MGA1064_CURSOR_COL2_GREEN	0x011
354414c4531SDave Airlie #define MGA1064_CURSOR_COL2_BLUE	0x012
355414c4531SDave Airlie 
356414c4531SDave Airlie #define MGA1064_VREF_CTL	0x018
357414c4531SDave Airlie 
358414c4531SDave Airlie #define MGA1064_MUL_CTL		0x19
359414c4531SDave Airlie #define MGA1064_MUL_CTL_8bits		0x0
360414c4531SDave Airlie #define MGA1064_MUL_CTL_15bits		0x01
361414c4531SDave Airlie #define MGA1064_MUL_CTL_16bits		0x02
362414c4531SDave Airlie #define MGA1064_MUL_CTL_24bits		0x03
363414c4531SDave Airlie #define MGA1064_MUL_CTL_32bits		0x04
364414c4531SDave Airlie #define MGA1064_MUL_CTL_2G8V16bits		0x05
365414c4531SDave Airlie #define MGA1064_MUL_CTL_G16V16bits		0x06
366414c4531SDave Airlie #define MGA1064_MUL_CTL_32_24bits		0x07
367414c4531SDave Airlie 
368414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL		0x1a
369414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_CLK_DIS		( 0x01 << 2 )
370414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_CLK_POW_DOWN	( 0x01 << 3 )
371414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_PCI		( 0x00 << 0 )
372414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_PLL		( 0x01 << 0 )
373414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_EXT		( 0x02 << 0 )
374414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_MSK		( 0x03 << 0 )
375414c4531SDave Airlie 
376414c4531SDave Airlie #define MGA1064_GEN_CTL		0x1d
377414c4531SDave Airlie #define MGA1064_GEN_CTL_SYNC_ON_GREEN_DIS      (0x01 << 5)
378414c4531SDave Airlie #define MGA1064_MISC_CTL	0x1e
379414c4531SDave Airlie #define MGA1064_MISC_CTL_DAC_EN                ( 0x01 << 0 )
380414c4531SDave Airlie #define MGA1064_MISC_CTL_VGA   		( 0x01 << 1 )
381414c4531SDave Airlie #define MGA1064_MISC_CTL_DIS_CON   		( 0x03 << 1 )
382414c4531SDave Airlie #define MGA1064_MISC_CTL_MAFC   		( 0x02 << 1 )
383414c4531SDave Airlie #define MGA1064_MISC_CTL_VGA8   		( 0x01 << 3 )
384414c4531SDave Airlie #define MGA1064_MISC_CTL_DAC_RAM_CS   		( 0x01 << 4 )
385414c4531SDave Airlie 
386414c4531SDave Airlie #define MGA1064_GEN_IO_CTL2	0x29
387414c4531SDave Airlie #define MGA1064_GEN_IO_CTL	0x2a
388414c4531SDave Airlie #define MGA1064_GEN_IO_DATA	0x2b
389414c4531SDave Airlie #define MGA1064_SYS_PLL_M	0x2c
390414c4531SDave Airlie #define MGA1064_SYS_PLL_N	0x2d
391414c4531SDave Airlie #define MGA1064_SYS_PLL_P	0x2e
392414c4531SDave Airlie #define MGA1064_SYS_PLL_STAT	0x2f
393414c4531SDave Airlie 
394414c4531SDave Airlie #define MGA1064_REMHEADCTL     0x30
395414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKDIS ( 0x01 << 0 )
396414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_OFF ( 0x00 << 1 )
397414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_PLL ( 0x01 << 1 )
398414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_PCI ( 0x02 << 1 )
399414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_MSK ( 0x03 << 1 )
400414c4531SDave Airlie 
401414c4531SDave Airlie #define MGA1064_REMHEADCTL2     0x31
402414c4531SDave Airlie 
403414c4531SDave Airlie #define MGA1064_ZOOM_CTL	0x38
404414c4531SDave Airlie #define MGA1064_SENSE_TST	0x3a
405414c4531SDave Airlie 
406414c4531SDave Airlie #define MGA1064_CRC_LSB		0x3c
407414c4531SDave Airlie #define MGA1064_CRC_MSB		0x3d
408414c4531SDave Airlie #define MGA1064_CRC_CTL		0x3e
409414c4531SDave Airlie #define MGA1064_COL_KEY_MSK_LSB		0x40
410414c4531SDave Airlie #define MGA1064_COL_KEY_MSK_MSB		0x41
411414c4531SDave Airlie #define MGA1064_COL_KEY_LSB		0x42
412414c4531SDave Airlie #define MGA1064_COL_KEY_MSB		0x43
413414c4531SDave Airlie #define MGA1064_PIX_PLLA_M	0x44
414414c4531SDave Airlie #define MGA1064_PIX_PLLA_N	0x45
415414c4531SDave Airlie #define MGA1064_PIX_PLLA_P	0x46
416414c4531SDave Airlie #define MGA1064_PIX_PLLB_M	0x48
417414c4531SDave Airlie #define MGA1064_PIX_PLLB_N	0x49
418414c4531SDave Airlie #define MGA1064_PIX_PLLB_P	0x4a
419414c4531SDave Airlie #define MGA1064_PIX_PLLC_M	0x4c
420414c4531SDave Airlie #define MGA1064_PIX_PLLC_N	0x4d
421414c4531SDave Airlie #define MGA1064_PIX_PLLC_P	0x4e
422414c4531SDave Airlie 
423414c4531SDave Airlie #define MGA1064_PIX_PLL_STAT	0x4f
424414c4531SDave Airlie 
425414c4531SDave Airlie /*Added for G450 dual head*/
426414c4531SDave Airlie 
427414c4531SDave Airlie #define MGA1064_VID_PLL_STAT    0x8c
428414c4531SDave Airlie #define MGA1064_VID_PLL_P       0x8D
429414c4531SDave Airlie #define MGA1064_VID_PLL_M       0x8E
430414c4531SDave Airlie #define MGA1064_VID_PLL_N       0x8F
431414c4531SDave Airlie 
432414c4531SDave Airlie /* Modified PLL for G200 Winbond (G200WB) */
433414c4531SDave Airlie #define MGA1064_WB_PIX_PLLC_M	0xb7
434414c4531SDave Airlie #define MGA1064_WB_PIX_PLLC_N	0xb6
435414c4531SDave Airlie #define MGA1064_WB_PIX_PLLC_P	0xb8
436414c4531SDave Airlie 
437414c4531SDave Airlie /* Modified PLL for G200 Maxim (G200EV) */
438414c4531SDave Airlie #define MGA1064_EV_PIX_PLLC_M	0xb6
439414c4531SDave Airlie #define MGA1064_EV_PIX_PLLC_N	0xb7
440414c4531SDave Airlie #define MGA1064_EV_PIX_PLLC_P	0xb8
441414c4531SDave Airlie 
442414c4531SDave Airlie /* Modified PLL for G200 EH */
443414c4531SDave Airlie #define MGA1064_EH_PIX_PLLC_M   0xb6
444414c4531SDave Airlie #define MGA1064_EH_PIX_PLLC_N   0xb7
445414c4531SDave Airlie #define MGA1064_EH_PIX_PLLC_P   0xb8
446414c4531SDave Airlie 
447414c4531SDave Airlie /* Modified PLL for G200 Maxim (G200ER) */
448414c4531SDave Airlie #define MGA1064_ER_PIX_PLLC_M	0xb7
449414c4531SDave Airlie #define MGA1064_ER_PIX_PLLC_N	0xb6
450414c4531SDave Airlie #define MGA1064_ER_PIX_PLLC_P	0xb8
451414c4531SDave Airlie 
452414c4531SDave Airlie #define MGA1064_DISP_CTL        0x8a
453414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC1OUTSEL_MASK       0x01
454414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC1OUTSEL_DIS        0x00
455414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC1OUTSEL_EN         0x01
456414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_MASK       (0x03 << 2)
457414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_DIS        0x00
458414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1      (0x01 << 2)
459414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC2      (0x02 << 2)
460414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_TVE        (0x03 << 2)
461414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_MASK        (0x03 << 5)
462414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_DIS         0x00
463414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_CRTC1       (0x01 << 5)
464414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_CRTC2RGB    (0x02 << 5)
465414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_CRTC2656    (0x03 << 5)
466414c4531SDave Airlie 
467414c4531SDave Airlie #define MGA1064_SYNC_CTL        0x8b
468414c4531SDave Airlie 
469414c4531SDave Airlie #define MGA1064_PWR_CTL         0xa0
470414c4531SDave Airlie #define MGA1064_PWR_CTL_DAC2_EN                (0x01 << 0)
471414c4531SDave Airlie #define MGA1064_PWR_CTL_VID_PLL_EN             (0x01 << 1)
472414c4531SDave Airlie #define MGA1064_PWR_CTL_PANEL_EN               (0x01 << 2)
473414c4531SDave Airlie #define MGA1064_PWR_CTL_RFIFO_EN               (0x01 << 3)
474414c4531SDave Airlie #define MGA1064_PWR_CTL_CFIFO_EN               (0x01 << 4)
475414c4531SDave Airlie 
476414c4531SDave Airlie #define MGA1064_PAN_CTL         0xa2
477414c4531SDave Airlie 
478414c4531SDave Airlie /* Using crtc2 */
479414c4531SDave Airlie #define MGAREG2_C2CTL            0x10
480414c4531SDave Airlie #define MGAREG2_C2HPARAM         0x14
481414c4531SDave Airlie #define MGAREG2_C2HSYNC          0x18
482414c4531SDave Airlie #define MGAREG2_C2VPARAM         0x1c
483414c4531SDave Airlie #define MGAREG2_C2VSYNC          0x20
484414c4531SDave Airlie #define MGAREG2_C2STARTADD0      0x28
485414c4531SDave Airlie 
486414c4531SDave Airlie #define MGAREG2_C2OFFSET         0x40
487414c4531SDave Airlie #define MGAREG2_C2DATACTL        0x4c
488414c4531SDave Airlie 
489414c4531SDave Airlie #define MGAREG_C2CTL            0x3c10
490414c4531SDave Airlie #define MGAREG_C2CTL_C2_EN                     0x01
491414c4531SDave Airlie 
492414c4531SDave Airlie #define MGAREG_C2_HIPRILVL_M                   (0x07 << 4)
493414c4531SDave Airlie #define MGAREG_C2_MAXHIPRI_M                   (0x07 << 8)
494414c4531SDave Airlie 
495414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_MASK            (0x03 << 1)
496414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSELH_MASK           (0x01 << 14)
497414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_PCICLK          0x00
498414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_VDOCLK          (0x01 << 1)
499414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_PIXELPLL        (0x02 << 1)
500414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_VIDEOPLL        (0x03 << 1)
501414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_VDCLK           (0x01 << 14)
502414c4531SDave Airlie 
503414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_CRISTAL         (0x01 << 1) | (0x01 << 14)
504414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_SYSTEMPLL       (0x02 << 1) | (0x01 << 14)
505414c4531SDave Airlie 
506414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKDIS_MASK            (0x01 << 3)
507414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKDIS_DISABLE         (0x01 << 3)
508414c4531SDave Airlie 
509414c4531SDave Airlie #define MGAREG_C2CTL_CRTCDACSEL_MASK           (0x01 << 20)
510414c4531SDave Airlie #define MGAREG_C2CTL_CRTCDACSEL_CRTC1          0x00
511414c4531SDave Airlie #define MGAREG_C2CTL_CRTCDACSEL_CRTC2          (0x01 << 20)
512414c4531SDave Airlie 
513414c4531SDave Airlie #define MGAREG_C2HPARAM         0x3c14
514414c4531SDave Airlie #define MGAREG_C2HSYNC          0x3c18
515414c4531SDave Airlie #define MGAREG_C2VPARAM         0x3c1c
516414c4531SDave Airlie #define MGAREG_C2VSYNC          0x3c20
517414c4531SDave Airlie #define MGAREG_C2STARTADD0      0x3c28
518414c4531SDave Airlie 
519414c4531SDave Airlie #define MGAREG_C2OFFSET         0x3c40
520414c4531SDave Airlie #define MGAREG_C2DATACTL        0x3c4c
521414c4531SDave Airlie 
522414c4531SDave Airlie /* video register */
523414c4531SDave Airlie 
524414c4531SDave Airlie #define MGAREG_BESA1C3ORG	0x3d60
525414c4531SDave Airlie #define MGAREG_BESA1CORG	0x3d10
526414c4531SDave Airlie #define MGAREG_BESA1ORG		0x3d00
527414c4531SDave Airlie #define MGAREG_BESCTL		0x3d20
528414c4531SDave Airlie #define MGAREG_BESGLOBCTL	0x3dc0
529414c4531SDave Airlie #define MGAREG_BESHCOORD	0x3d28
530414c4531SDave Airlie #define MGAREG_BESHISCAL	0x3d30
531414c4531SDave Airlie #define MGAREG_BESHSRCEND	0x3d3c
532414c4531SDave Airlie #define MGAREG_BESHSRCLST	0x3d50
533414c4531SDave Airlie #define MGAREG_BESHSRCST	0x3d38
534414c4531SDave Airlie #define MGAREG_BESLUMACTL	0x3d40
535414c4531SDave Airlie #define MGAREG_BESPITCH		0x3d24
536414c4531SDave Airlie #define MGAREG_BESV1SRCLST	0x3d54
537414c4531SDave Airlie #define MGAREG_BESV1WGHT	0x3d48
538414c4531SDave Airlie #define MGAREG_BESVCOORD	0x3d2c
539414c4531SDave Airlie #define MGAREG_BESVISCAL	0x3d34
540414c4531SDave Airlie 
541414c4531SDave Airlie /* texture engine registers */
542414c4531SDave Airlie 
543414c4531SDave Airlie #define MGAREG_TMR0		0x2c00
544414c4531SDave Airlie #define MGAREG_TMR1		0x2c04
545414c4531SDave Airlie #define MGAREG_TMR2		0x2c08
546414c4531SDave Airlie #define MGAREG_TMR3		0x2c0c
547414c4531SDave Airlie #define MGAREG_TMR4		0x2c10
548414c4531SDave Airlie #define MGAREG_TMR5		0x2c14
549414c4531SDave Airlie #define MGAREG_TMR6		0x2c18
550414c4531SDave Airlie #define MGAREG_TMR7		0x2c1c
551414c4531SDave Airlie #define MGAREG_TMR8		0x2c20
552414c4531SDave Airlie #define MGAREG_TEXORG		0x2c24
553414c4531SDave Airlie #define MGAREG_TEXWIDTH		0x2c28
554414c4531SDave Airlie #define MGAREG_TEXHEIGHT	0x2c2c
555414c4531SDave Airlie #define MGAREG_TEXCTL		0x2c30
556414c4531SDave Airlie #    define MGA_TW4                             (0x00000000)
557414c4531SDave Airlie #    define MGA_TW8                             (0x00000001)
558414c4531SDave Airlie #    define MGA_TW15                            (0x00000002)
559414c4531SDave Airlie #    define MGA_TW16                            (0x00000003)
560414c4531SDave Airlie #    define MGA_TW12                            (0x00000004)
561414c4531SDave Airlie #    define MGA_TW32                            (0x00000006)
562414c4531SDave Airlie #    define MGA_TW8A                            (0x00000007)
563414c4531SDave Airlie #    define MGA_TW8AL                           (0x00000008)
564414c4531SDave Airlie #    define MGA_TW422                           (0x0000000A)
565414c4531SDave Airlie #    define MGA_TW422UYVY                       (0x0000000B)
566414c4531SDave Airlie #    define MGA_PITCHLIN                        (0x00000100)
567414c4531SDave Airlie #    define MGA_NOPERSPECTIVE                   (0x00200000)
568414c4531SDave Airlie #    define MGA_TAKEY                           (0x02000000)
569414c4531SDave Airlie #    define MGA_TAMASK                          (0x04000000)
570414c4531SDave Airlie #    define MGA_CLAMPUV                         (0x18000000)
571414c4531SDave Airlie #    define MGA_TEXMODULATE                     (0x20000000)
572414c4531SDave Airlie #define MGAREG_TEXCTL2		0x2c3c
573414c4531SDave Airlie #    define MGA_G400_TC2_MAGIC                  (0x00008000)
574414c4531SDave Airlie #    define MGA_TC2_DECALBLEND                  (0x00000001)
575414c4531SDave Airlie #    define MGA_TC2_IDECAL                      (0x00000002)
576414c4531SDave Airlie #    define MGA_TC2_DECALDIS                    (0x00000004)
577414c4531SDave Airlie #    define MGA_TC2_CKSTRANSDIS                 (0x00000010)
578414c4531SDave Airlie #    define MGA_TC2_BORDEREN                    (0x00000020)
579414c4531SDave Airlie #    define MGA_TC2_SPECEN                      (0x00000040)
580414c4531SDave Airlie #    define MGA_TC2_DUALTEX                     (0x00000080)
581414c4531SDave Airlie #    define MGA_TC2_TABLEFOG                    (0x00000100)
582414c4531SDave Airlie #    define MGA_TC2_BUMPMAP                     (0x00000200)
583414c4531SDave Airlie #    define MGA_TC2_SELECT_TMU1                 (0x80000000)
584414c4531SDave Airlie #define MGAREG_TEXTRANS		0x2c34
585414c4531SDave Airlie #define MGAREG_TEXTRANSHIGH	0x2c38
586414c4531SDave Airlie #define MGAREG_TEXFILTER	0x2c58
587414c4531SDave Airlie #    define MGA_MIN_NRST                        (0x00000000)
588414c4531SDave Airlie #    define MGA_MIN_BILIN                       (0x00000002)
589414c4531SDave Airlie #    define MGA_MIN_ANISO                       (0x0000000D)
590414c4531SDave Airlie #    define MGA_MAG_NRST                        (0x00000000)
591414c4531SDave Airlie #    define MGA_MAG_BILIN                       (0x00000020)
592414c4531SDave Airlie #    define MGA_FILTERALPHA                     (0x00100000)
593414c4531SDave Airlie #define MGAREG_ALPHASTART	0x2c70
594414c4531SDave Airlie #define MGAREG_ALPHAXINC	0x2c74
595414c4531SDave Airlie #define MGAREG_ALPHAYINC	0x2c78
596414c4531SDave Airlie #define MGAREG_ALPHACTRL	0x2c7c
597414c4531SDave Airlie #    define MGA_SRC_ZERO                        (0x00000000)
598414c4531SDave Airlie #    define MGA_SRC_ONE                         (0x00000001)
599414c4531SDave Airlie #    define MGA_SRC_DST_COLOR                   (0x00000002)
600414c4531SDave Airlie #    define MGA_SRC_ONE_MINUS_DST_COLOR         (0x00000003)
601414c4531SDave Airlie #    define MGA_SRC_ALPHA                       (0x00000004)
602414c4531SDave Airlie #    define MGA_SRC_ONE_MINUS_SRC_ALPHA         (0x00000005)
603414c4531SDave Airlie #    define MGA_SRC_DST_ALPHA                   (0x00000006)
604414c4531SDave Airlie #    define MGA_SRC_ONE_MINUS_DST_ALPHA         (0x00000007)
605414c4531SDave Airlie #    define MGA_SRC_SRC_ALPHA_SATURATE          (0x00000008)
606414c4531SDave Airlie #    define MGA_SRC_BLEND_MASK                  (0x0000000f)
607414c4531SDave Airlie #    define MGA_DST_ZERO                        (0x00000000)
608414c4531SDave Airlie #    define MGA_DST_ONE                         (0x00000010)
609414c4531SDave Airlie #    define MGA_DST_SRC_COLOR                   (0x00000020)
610414c4531SDave Airlie #    define MGA_DST_ONE_MINUS_SRC_COLOR         (0x00000030)
611414c4531SDave Airlie #    define MGA_DST_SRC_ALPHA                   (0x00000040)
612414c4531SDave Airlie #    define MGA_DST_ONE_MINUS_SRC_ALPHA         (0x00000050)
613414c4531SDave Airlie #    define MGA_DST_DST_ALPHA                   (0x00000060)
614414c4531SDave Airlie #    define MGA_DST_ONE_MINUS_DST_ALPHA         (0x00000070)
615414c4531SDave Airlie #    define MGA_DST_BLEND_MASK                  (0x00000070)
616414c4531SDave Airlie #    define MGA_ALPHACHANNEL                    (0x00000100)
617414c4531SDave Airlie #    define MGA_VIDEOALPHA                      (0x00000200)
618414c4531SDave Airlie #    define MGA_DIFFUSEDALPHA                   (0x01000000)
619414c4531SDave Airlie #    define MGA_MODULATEDALPHA                  (0x02000000)
620414c4531SDave Airlie #define MGAREG_TDUALSTAGE0                      (0x2CF8)
621414c4531SDave Airlie #define MGAREG_TDUALSTAGE1                      (0x2CFC)
622414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG2_DIFFUSE          (0x00000000)
623414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG2_SPECULAR         (0x00000001)
624414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG2_FCOL             (0x00000002)
625414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG2_PREVSTAGE        (0x00000003)
626414c4531SDave Airlie #    define MGA_TDS_COLOR_ALPHA_DIFFUSE         (0x00000000)
627414c4531SDave Airlie #    define MGA_TDS_COLOR_ALPHA_FCOL            (0x00000004)
628414c4531SDave Airlie #    define MGA_TDS_COLOR_ALPHA_CURRTEX         (0x00000008)
629414c4531SDave Airlie #    define MGA_TDS_COLOR_ALPHA_PREVTEX         (0x0000000c)
630414c4531SDave Airlie #    define MGA_TDS_COLOR_ALPHA_PREVSTAGE       (0x00000010)
631414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG1_REPLICATEALPHA   (0x00000020)
632414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG1_INV              (0x00000040)
633414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG2_REPLICATEALPHA   (0x00000080)
634414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG2_INV              (0x00000100)
635414c4531SDave Airlie #    define MGA_TDS_COLOR_ALPHA1INV             (0x00000200)
636414c4531SDave Airlie #    define MGA_TDS_COLOR_ALPHA2INV             (0x00000400)
637414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG1MUL_ALPHA1        (0x00000800)
638414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG2MUL_ALPHA2        (0x00001000)
639414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG1ADD_MULOUT        (0x00002000)
640414c4531SDave Airlie #    define MGA_TDS_COLOR_ARG2ADD_MULOUT        (0x00004000)
641414c4531SDave Airlie #    define MGA_TDS_COLOR_MODBRIGHT_2X          (0x00008000)
642414c4531SDave Airlie #    define MGA_TDS_COLOR_MODBRIGHT_4X          (0x00010000)
643414c4531SDave Airlie #    define MGA_TDS_COLOR_ADD_SUB               (0x00000000)
644414c4531SDave Airlie #    define MGA_TDS_COLOR_ADD_ADD               (0x00020000)
645414c4531SDave Airlie #    define MGA_TDS_COLOR_ADD2X                 (0x00040000)
646414c4531SDave Airlie #    define MGA_TDS_COLOR_ADDBIAS               (0x00080000)
647414c4531SDave Airlie #    define MGA_TDS_COLOR_BLEND                 (0x00100000)
648414c4531SDave Airlie #    define MGA_TDS_COLOR_SEL_ARG1              (0x00000000)
649414c4531SDave Airlie #    define MGA_TDS_COLOR_SEL_ARG2              (0x00200000)
650414c4531SDave Airlie #    define MGA_TDS_COLOR_SEL_ADD               (0x00400000)
651414c4531SDave Airlie #    define MGA_TDS_COLOR_SEL_MUL               (0x00600000)
652414c4531SDave Airlie #    define MGA_TDS_ALPHA_ARG1_INV              (0x00800000)
653414c4531SDave Airlie #    define MGA_TDS_ALPHA_ARG2_DIFFUSE          (0x00000000)
654414c4531SDave Airlie #    define MGA_TDS_ALPHA_ARG2_FCOL             (0x01000000)
655414c4531SDave Airlie #    define MGA_TDS_ALPHA_ARG2_PREVTEX          (0x02000000)
656414c4531SDave Airlie #    define MGA_TDS_ALPHA_ARG2_PREVSTAGE        (0x03000000)
657414c4531SDave Airlie #    define MGA_TDS_ALPHA_ARG2_INV              (0x04000000)
658414c4531SDave Airlie #    define MGA_TDS_ALPHA_ADD                   (0x08000000)
659414c4531SDave Airlie #    define MGA_TDS_ALPHA_ADDBIAS               (0x10000000)
660414c4531SDave Airlie #    define MGA_TDS_ALPHA_ADD2X                 (0x20000000)
661414c4531SDave Airlie #    define MGA_TDS_ALPHA_SEL_ARG1              (0x00000000)
662414c4531SDave Airlie #    define MGA_TDS_ALPHA_SEL_ARG2              (0x40000000)
663414c4531SDave Airlie #    define MGA_TDS_ALPHA_SEL_ADD               (0x80000000)
664414c4531SDave Airlie #    define MGA_TDS_ALPHA_SEL_MUL               (0xc0000000)
665414c4531SDave Airlie 
666414c4531SDave Airlie #define MGAREG_DWGSYNC		0x2c4c
667414c4531SDave Airlie 
668414c4531SDave Airlie #define MGAREG_AGP_PLL		0x1e4c
669414c4531SDave Airlie #define MGA_AGP2XPLL_ENABLE		0x1
670414c4531SDave Airlie #define MGA_AGP2XPLL_DISABLE		0x0
671414c4531SDave Airlie 
672414c4531SDave Airlie #endif
673