162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * MGA Millennium (MGA2064W) functions
462306a36Sopenharmony_ci * MGA Mystique (MGA1064SG) functions
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright 1996 The XFree86 Project, Inc.
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Authors
962306a36Sopenharmony_ci *		Dirk Hohndel
1062306a36Sopenharmony_ci *			hohndel@XFree86.Org
1162306a36Sopenharmony_ci *		David Dawes
1262306a36Sopenharmony_ci *			dawes@XFree86.Org
1362306a36Sopenharmony_ci * Contributors:
1462306a36Sopenharmony_ci *		Guy DESBIEF, Aix-en-provence, France
1562306a36Sopenharmony_ci *			g.desbief@aix.pacwan.net
1662306a36Sopenharmony_ci *		MGA1064SG Mystique register file
1762306a36Sopenharmony_ci */
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#ifndef _MGA_REG_H_
2062306a36Sopenharmony_ci#define _MGA_REG_H_
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci#include <linux/bits.h>
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#define	MGAREG_DWGCTL		0x1c00
2562306a36Sopenharmony_ci#define	MGAREG_MACCESS		0x1c04
2662306a36Sopenharmony_ci/* the following is a mystique only register */
2762306a36Sopenharmony_ci#define MGAREG_MCTLWTST		0x1c08
2862306a36Sopenharmony_ci#define	MGAREG_ZORG		0x1c0c
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci#define	MGAREG_PAT0		0x1c10
3162306a36Sopenharmony_ci#define	MGAREG_PAT1		0x1c14
3262306a36Sopenharmony_ci#define	MGAREG_PLNWT		0x1c1c
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#define	MGAREG_BCOL		0x1c20
3562306a36Sopenharmony_ci#define	MGAREG_FCOL		0x1c24
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#define	MGAREG_SRC0		0x1c30
3862306a36Sopenharmony_ci#define	MGAREG_SRC1		0x1c34
3962306a36Sopenharmony_ci#define	MGAREG_SRC2		0x1c38
4062306a36Sopenharmony_ci#define	MGAREG_SRC3		0x1c3c
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci#define	MGAREG_XYSTRT		0x1c40
4362306a36Sopenharmony_ci#define	MGAREG_XYEND		0x1c44
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#define	MGAREG_SHIFT		0x1c50
4662306a36Sopenharmony_ci/* the following is a mystique only register */
4762306a36Sopenharmony_ci#define MGAREG_DMAPAD		0x1c54
4862306a36Sopenharmony_ci#define	MGAREG_SGN		0x1c58
4962306a36Sopenharmony_ci#define	MGAREG_LEN		0x1c5c
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci#define	MGAREG_AR0		0x1c60
5262306a36Sopenharmony_ci#define	MGAREG_AR1		0x1c64
5362306a36Sopenharmony_ci#define	MGAREG_AR2		0x1c68
5462306a36Sopenharmony_ci#define	MGAREG_AR3		0x1c6c
5562306a36Sopenharmony_ci#define	MGAREG_AR4		0x1c70
5662306a36Sopenharmony_ci#define	MGAREG_AR5		0x1c74
5762306a36Sopenharmony_ci#define	MGAREG_AR6		0x1c78
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define	MGAREG_CXBNDRY		0x1c80
6062306a36Sopenharmony_ci#define	MGAREG_FXBNDRY		0x1c84
6162306a36Sopenharmony_ci#define	MGAREG_YDSTLEN		0x1c88
6262306a36Sopenharmony_ci#define	MGAREG_PITCH		0x1c8c
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci#define	MGAREG_YDST		0x1c90
6562306a36Sopenharmony_ci#define	MGAREG_YDSTORG		0x1c94
6662306a36Sopenharmony_ci#define	MGAREG_YTOP		0x1c98
6762306a36Sopenharmony_ci#define	MGAREG_YBOT		0x1c9c
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#define	MGAREG_CXLEFT		0x1ca0
7062306a36Sopenharmony_ci#define	MGAREG_CXRIGHT		0x1ca4
7162306a36Sopenharmony_ci#define	MGAREG_FXLEFT		0x1ca8
7262306a36Sopenharmony_ci#define	MGAREG_FXRIGHT		0x1cac
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#define	MGAREG_XDST		0x1cb0
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci#define	MGAREG_DR0		0x1cc0
7762306a36Sopenharmony_ci#define	MGAREG_DR1		0x1cc4
7862306a36Sopenharmony_ci#define	MGAREG_DR2		0x1cc8
7962306a36Sopenharmony_ci#define	MGAREG_DR3		0x1ccc
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci#define	MGAREG_DR4		0x1cd0
8262306a36Sopenharmony_ci#define	MGAREG_DR5		0x1cd4
8362306a36Sopenharmony_ci#define	MGAREG_DR6		0x1cd8
8462306a36Sopenharmony_ci#define	MGAREG_DR7		0x1cdc
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci#define	MGAREG_DR8		0x1ce0
8762306a36Sopenharmony_ci#define	MGAREG_DR9		0x1ce4
8862306a36Sopenharmony_ci#define	MGAREG_DR10		0x1ce8
8962306a36Sopenharmony_ci#define	MGAREG_DR11		0x1cec
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci#define	MGAREG_DR12		0x1cf0
9262306a36Sopenharmony_ci#define	MGAREG_DR13		0x1cf4
9362306a36Sopenharmony_ci#define	MGAREG_DR14		0x1cf8
9462306a36Sopenharmony_ci#define	MGAREG_DR15		0x1cfc
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci#define MGAREG_SRCORG		0x2cb4
9762306a36Sopenharmony_ci#define MGAREG_DSTORG		0x2cb8
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci/* add or this to one of the previous "power registers" to start
10062306a36Sopenharmony_ci   the drawing engine */
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci#define MGAREG_EXEC		0x0100
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci#define	MGAREG_FIFOSTATUS	0x1e10
10562306a36Sopenharmony_ci#define	MGAREG_Status		0x1e14
10662306a36Sopenharmony_ci#define MGAREG_CACHEFLUSH       0x1fff
10762306a36Sopenharmony_ci#define	MGAREG_ICLEAR		0x1e18
10862306a36Sopenharmony_ci#define	MGAREG_IEN		0x1e1c
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci#define	MGAREG_VCOUNT		0x1e20
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci#define	MGAREG_Reset		0x1e40
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ci#define	MGAREG_OPMODE		0x1e54
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci/* Warp Registers */
11762306a36Sopenharmony_ci#define MGAREG_WIADDR           0x1dc0
11862306a36Sopenharmony_ci#define MGAREG_WIADDR2          0x1dd8
11962306a36Sopenharmony_ci#define MGAREG_WGETMSB          0x1dc8
12062306a36Sopenharmony_ci#define MGAREG_WVRTXSZ          0x1dcc
12162306a36Sopenharmony_ci#define MGAREG_WACCEPTSEQ       0x1dd4
12262306a36Sopenharmony_ci#define MGAREG_WMISC            0x1e70
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_ci#define MGAREG_MEMCTL           0x2e08
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci/* OPMODE register additives */
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci#define MGAOPM_DMA_GENERAL	(0x00 << 2)
12962306a36Sopenharmony_ci#define MGAOPM_DMA_BLIT		(0x01 << 2)
13062306a36Sopenharmony_ci#define MGAOPM_DMA_VECTOR	(0x10 << 2)
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ci/* MACCESS register additives */
13362306a36Sopenharmony_ci#define MGAMAC_PW8               0x00
13462306a36Sopenharmony_ci#define MGAMAC_PW16              0x01
13562306a36Sopenharmony_ci#define MGAMAC_PW24              0x03 /* not a typo */
13662306a36Sopenharmony_ci#define MGAMAC_PW32              0x02 /* not a typo */
13762306a36Sopenharmony_ci#define MGAMAC_BYPASS332         0x10000000
13862306a36Sopenharmony_ci#define MGAMAC_NODITHER          0x40000000
13962306a36Sopenharmony_ci#define MGAMAC_DIT555            0x80000000
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci/* DWGCTL register additives */
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci/* Lines */
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ci#define MGADWG_LINE_OPEN	0x00
14662306a36Sopenharmony_ci#define MGADWG_AUTOLINE_OPEN	0x01
14762306a36Sopenharmony_ci#define MGADWG_LINE_CLOSE	0x02
14862306a36Sopenharmony_ci#define MGADWG_AUTOLINE_CLOSE	0x03
14962306a36Sopenharmony_ci
15062306a36Sopenharmony_ci/* Trapezoids */
15162306a36Sopenharmony_ci#define MGADWG_TRAP		0x04
15262306a36Sopenharmony_ci#define MGADWG_TEXTURE_TRAP	0x06
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci/* BitBlts */
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ci#define MGADWG_BITBLT		0x08
15762306a36Sopenharmony_ci#define MGADWG_FBITBLT		0x0c
15862306a36Sopenharmony_ci#define MGADWG_ILOAD		0x09
15962306a36Sopenharmony_ci#define MGADWG_ILOAD_SCALE	0x0d
16062306a36Sopenharmony_ci#define MGADWG_ILOAD_FILTER	0x0f
16162306a36Sopenharmony_ci#define MGADWG_ILOAD_HIQH	0x07
16262306a36Sopenharmony_ci#define MGADWG_ILOAD_HIQHV	0x0e
16362306a36Sopenharmony_ci#define MGADWG_IDUMP		0x0a
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ci/* atype access to WRAM */
16662306a36Sopenharmony_ci
16762306a36Sopenharmony_ci#define MGADWG_RPL		( 0x00 << 4 )
16862306a36Sopenharmony_ci#define MGADWG_RSTR		( 0x01 << 4 )
16962306a36Sopenharmony_ci#define MGADWG_ZI		( 0x03 << 4 )
17062306a36Sopenharmony_ci#define MGADWG_BLK 		( 0x04 << 4 )
17162306a36Sopenharmony_ci#define MGADWG_I		( 0x07 << 4 )
17262306a36Sopenharmony_ci
17362306a36Sopenharmony_ci/* specifies whether bit blits are linear or xy */
17462306a36Sopenharmony_ci#define MGADWG_LINEAR		( 0x01 << 7 )
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ci/* z drawing mode. use MGADWG_NOZCMP for always */
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ci#define MGADWG_NOZCMP		( 0x00 << 8 )
17962306a36Sopenharmony_ci#define MGADWG_ZE		( 0x02 << 8 )
18062306a36Sopenharmony_ci#define MGADWG_ZNE		( 0x03 << 8 )
18162306a36Sopenharmony_ci#define MGADWG_ZLT		( 0x04 << 8 )
18262306a36Sopenharmony_ci#define MGADWG_ZLTE		( 0x05 << 8 )
18362306a36Sopenharmony_ci#define MGADWG_GT		( 0x06 << 8 )
18462306a36Sopenharmony_ci#define MGADWG_GTE		( 0x07 << 8 )
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ci/* use this to force colour expansion circuitry to do its stuff */
18762306a36Sopenharmony_ci
18862306a36Sopenharmony_ci#define MGADWG_SOLID		( 0x01 << 11 )
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci/* ar register at zero */
19162306a36Sopenharmony_ci
19262306a36Sopenharmony_ci#define MGADWG_ARZERO		( 0x01 << 12 )
19362306a36Sopenharmony_ci
19462306a36Sopenharmony_ci#define MGADWG_SGNZERO		( 0x01 << 13 )
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci#define MGADWG_SHIFTZERO	( 0x01 << 14 )
19762306a36Sopenharmony_ci
19862306a36Sopenharmony_ci/* See table on 4-43 for bop ALU operations */
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci/* See table on 4-44 for translucidity masks */
20162306a36Sopenharmony_ci
20262306a36Sopenharmony_ci#define MGADWG_BMONOLEF		( 0x00 << 25 )
20362306a36Sopenharmony_ci#define MGADWG_BMONOWF		( 0x04 << 25 )
20462306a36Sopenharmony_ci#define MGADWG_BPLAN		( 0x01 << 25 )
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_ci/* note that if bfcol is specified and you're doing a bitblt, it causes
20762306a36Sopenharmony_ci   a fbitblt to be performed, so check that you obey the fbitblt rules */
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci#define MGADWG_BFCOL   		( 0x02 << 25 )
21062306a36Sopenharmony_ci#define MGADWG_BUYUV		( 0x0e << 25 )
21162306a36Sopenharmony_ci#define MGADWG_BU32BGR		( 0x03 << 25 )
21262306a36Sopenharmony_ci#define MGADWG_BU32RGB		( 0x07 << 25 )
21362306a36Sopenharmony_ci#define MGADWG_BU24BGR		( 0x0b << 25 )
21462306a36Sopenharmony_ci#define MGADWG_BU24RGB		( 0x0f << 25 )
21562306a36Sopenharmony_ci
21662306a36Sopenharmony_ci#define MGADWG_PATTERN		( 0x01 << 29 )
21762306a36Sopenharmony_ci#define MGADWG_TRANSC		( 0x01 << 30 )
21862306a36Sopenharmony_ci#define MGAREG_MISC_WRITE	0x3c2
21962306a36Sopenharmony_ci#define MGAREG_MISC_READ	0x3cc
22062306a36Sopenharmony_ci#define MGAREG_MEM_MISC_WRITE       0x1fc2
22162306a36Sopenharmony_ci#define MGAREG_MEM_MISC_READ        0x1fcc
22262306a36Sopenharmony_ci
22362306a36Sopenharmony_ci#define MGAREG_MISC_IOADSEL	(0x1 << 0)
22462306a36Sopenharmony_ci#define MGAREG_MISC_RAMMAPEN	(0x1 << 1)
22562306a36Sopenharmony_ci#define MGAREG_MISC_CLKSEL_MASK		GENMASK(3, 2)
22662306a36Sopenharmony_ci#define MGAREG_MISC_CLKSEL_VGA25	(0x0 << 2)
22762306a36Sopenharmony_ci#define MGAREG_MISC_CLKSEL_VGA28	(0x1 << 2)
22862306a36Sopenharmony_ci#define MGAREG_MISC_CLKSEL_MGA		(0x3 << 2)
22962306a36Sopenharmony_ci#define MGAREG_MISC_VIDEO_DIS	(0x1 << 4)
23062306a36Sopenharmony_ci#define MGAREG_MISC_HIGH_PG_SEL	(0x1 << 5)
23162306a36Sopenharmony_ci#define MGAREG_MISC_HSYNCPOL		BIT(6)
23262306a36Sopenharmony_ci#define MGAREG_MISC_VSYNCPOL		BIT(7)
23362306a36Sopenharmony_ci
23462306a36Sopenharmony_ci/* MMIO VGA registers */
23562306a36Sopenharmony_ci#define MGAREG_SEQ_INDEX	0x1fc4
23662306a36Sopenharmony_ci#define MGAREG_SEQ_DATA		0x1fc5
23762306a36Sopenharmony_ci
23862306a36Sopenharmony_ci#define MGAREG_SEQ0_ASYNCRST	BIT(0)
23962306a36Sopenharmony_ci#define MGAREG_SEQ0_SYNCRST	BIT(1)
24062306a36Sopenharmony_ci
24162306a36Sopenharmony_ci#define MGAREG_SEQ1_SCROFF	BIT(5)
24262306a36Sopenharmony_ci
24362306a36Sopenharmony_ci#define MGAREG_CRTC_INDEX	0x1fd4
24462306a36Sopenharmony_ci#define MGAREG_CRTC_DATA	0x1fd5
24562306a36Sopenharmony_ci
24662306a36Sopenharmony_ci#define MGAREG_CRTC11_VINTCLR		BIT(4)
24762306a36Sopenharmony_ci#define MGAREG_CRTC11_VINTEN		BIT(5)
24862306a36Sopenharmony_ci#define MGAREG_CRTC11_CRTCPROTECT	BIT(7)
24962306a36Sopenharmony_ci
25062306a36Sopenharmony_ci#define MGAREG_CRTCEXT_INDEX	0x1fde
25162306a36Sopenharmony_ci#define MGAREG_CRTCEXT_DATA	0x1fdf
25262306a36Sopenharmony_ci
25362306a36Sopenharmony_ci#define MGAREG_CRTCEXT0_OFFSET_MASK	GENMASK(5, 4)
25462306a36Sopenharmony_ci
25562306a36Sopenharmony_ci#define MGAREG_CRTCEXT1_VRSTEN		BIT(7)
25662306a36Sopenharmony_ci#define MGAREG_CRTCEXT1_VSYNCOFF	BIT(5)
25762306a36Sopenharmony_ci#define MGAREG_CRTCEXT1_HSYNCOFF	BIT(4)
25862306a36Sopenharmony_ci#define MGAREG_CRTCEXT1_HRSTEN		BIT(3)
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_ci#define MGAREG_CRTCEXT3_MGAMODE		BIT(7)
26162306a36Sopenharmony_ci
26262306a36Sopenharmony_ci/* Cursor X and Y position */
26362306a36Sopenharmony_ci#define MGA_CURPOSXL 0x3c0c
26462306a36Sopenharmony_ci#define MGA_CURPOSXH 0x3c0d
26562306a36Sopenharmony_ci#define MGA_CURPOSYL 0x3c0e
26662306a36Sopenharmony_ci#define MGA_CURPOSYH 0x3c0f
26762306a36Sopenharmony_ci
26862306a36Sopenharmony_ci/* MGA bits for registers PCI_OPTION_REG */
26962306a36Sopenharmony_ci#define MGA1064_OPT_SYS_CLK_PCI   		( 0x00 << 0 )
27062306a36Sopenharmony_ci#define MGA1064_OPT_SYS_CLK_PLL   		( 0x01 << 0 )
27162306a36Sopenharmony_ci#define MGA1064_OPT_SYS_CLK_EXT   		( 0x02 << 0 )
27262306a36Sopenharmony_ci#define MGA1064_OPT_SYS_CLK_MSK   		( 0x03 << 0 )
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_ci#define MGA1064_OPT_SYS_CLK_DIS   		( 0x01 << 2 )
27562306a36Sopenharmony_ci#define MGA1064_OPT_G_CLK_DIV_1   		( 0x01 << 3 )
27662306a36Sopenharmony_ci#define MGA1064_OPT_M_CLK_DIV_1   		( 0x01 << 4 )
27762306a36Sopenharmony_ci
27862306a36Sopenharmony_ci#define MGA1064_OPT_SYS_PLL_PDN   		( 0x01 << 5 )
27962306a36Sopenharmony_ci#define MGA1064_OPT_VGA_ION   		( 0x01 << 8 )
28062306a36Sopenharmony_ci
28162306a36Sopenharmony_ci/* MGA registers in PCI config space */
28262306a36Sopenharmony_ci#define PCI_MGA_INDEX		0x44
28362306a36Sopenharmony_ci#define PCI_MGA_DATA		0x48
28462306a36Sopenharmony_ci#define PCI_MGA_OPTION		0x40
28562306a36Sopenharmony_ci#define PCI_MGA_OPTION2		0x50
28662306a36Sopenharmony_ci#define PCI_MGA_OPTION3		0x54
28762306a36Sopenharmony_ci
28862306a36Sopenharmony_ci#define PCI_MGA_OPTION_HARDPWMSK	BIT(14)
28962306a36Sopenharmony_ci
29062306a36Sopenharmony_ci#define RAMDAC_OFFSET		0x3c00
29162306a36Sopenharmony_ci
29262306a36Sopenharmony_ci/* TVP3026 direct registers */
29362306a36Sopenharmony_ci
29462306a36Sopenharmony_ci#define TVP3026_INDEX		0x00
29562306a36Sopenharmony_ci#define TVP3026_WADR_PAL	0x00
29662306a36Sopenharmony_ci#define TVP3026_COL_PAL		0x01
29762306a36Sopenharmony_ci#define TVP3026_PIX_RD_MSK	0x02
29862306a36Sopenharmony_ci#define TVP3026_RADR_PAL	0x03
29962306a36Sopenharmony_ci#define TVP3026_CUR_COL_ADDR	0x04
30062306a36Sopenharmony_ci#define TVP3026_CUR_COL_DATA	0x05
30162306a36Sopenharmony_ci#define TVP3026_DATA		0x0a
30262306a36Sopenharmony_ci#define TVP3026_CUR_RAM		0x0b
30362306a36Sopenharmony_ci#define TVP3026_CUR_XLOW	0x0c
30462306a36Sopenharmony_ci#define TVP3026_CUR_XHI		0x0d
30562306a36Sopenharmony_ci#define TVP3026_CUR_YLOW	0x0e
30662306a36Sopenharmony_ci#define TVP3026_CUR_YHI		0x0f
30762306a36Sopenharmony_ci
30862306a36Sopenharmony_ci/* TVP3026 indirect registers */
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ci#define TVP3026_SILICON_REV	0x01
31162306a36Sopenharmony_ci#define TVP3026_CURSOR_CTL	0x06
31262306a36Sopenharmony_ci#define TVP3026_LATCH_CTL	0x0f
31362306a36Sopenharmony_ci#define TVP3026_TRUE_COLOR_CTL	0x18
31462306a36Sopenharmony_ci#define TVP3026_MUX_CTL		0x19
31562306a36Sopenharmony_ci#define TVP3026_CLK_SEL		0x1a
31662306a36Sopenharmony_ci#define TVP3026_PAL_PAGE	0x1c
31762306a36Sopenharmony_ci#define TVP3026_GEN_CTL		0x1d
31862306a36Sopenharmony_ci#define TVP3026_MISC_CTL	0x1e
31962306a36Sopenharmony_ci#define TVP3026_GEN_IO_CTL	0x2a
32062306a36Sopenharmony_ci#define TVP3026_GEN_IO_DATA	0x2b
32162306a36Sopenharmony_ci#define TVP3026_PLL_ADDR	0x2c
32262306a36Sopenharmony_ci#define TVP3026_PIX_CLK_DATA	0x2d
32362306a36Sopenharmony_ci#define TVP3026_MEM_CLK_DATA	0x2e
32462306a36Sopenharmony_ci#define TVP3026_LOAD_CLK_DATA	0x2f
32562306a36Sopenharmony_ci#define TVP3026_KEY_RED_LOW	0x32
32662306a36Sopenharmony_ci#define TVP3026_KEY_RED_HI	0x33
32762306a36Sopenharmony_ci#define TVP3026_KEY_GREEN_LOW	0x34
32862306a36Sopenharmony_ci#define TVP3026_KEY_GREEN_HI	0x35
32962306a36Sopenharmony_ci#define TVP3026_KEY_BLUE_LOW	0x36
33062306a36Sopenharmony_ci#define TVP3026_KEY_BLUE_HI	0x37
33162306a36Sopenharmony_ci#define TVP3026_KEY_CTL		0x38
33262306a36Sopenharmony_ci#define TVP3026_MCLK_CTL	0x39
33362306a36Sopenharmony_ci#define TVP3026_SENSE_TEST	0x3a
33462306a36Sopenharmony_ci#define TVP3026_TEST_DATA	0x3b
33562306a36Sopenharmony_ci#define TVP3026_CRC_LSB		0x3c
33662306a36Sopenharmony_ci#define TVP3026_CRC_MSB		0x3d
33762306a36Sopenharmony_ci#define TVP3026_CRC_CTL		0x3e
33862306a36Sopenharmony_ci#define TVP3026_ID		0x3f
33962306a36Sopenharmony_ci#define TVP3026_RESET		0xff
34062306a36Sopenharmony_ci
34162306a36Sopenharmony_ci
34262306a36Sopenharmony_ci/* MGA1064 DAC Register file */
34362306a36Sopenharmony_ci/* MGA1064 direct registers */
34462306a36Sopenharmony_ci
34562306a36Sopenharmony_ci#define MGA1064_INDEX		0x00
34662306a36Sopenharmony_ci#define MGA1064_WADR_PAL	0x00
34762306a36Sopenharmony_ci#define MGA1064_SPAREREG        0x00
34862306a36Sopenharmony_ci#define MGA1064_COL_PAL		0x01
34962306a36Sopenharmony_ci#define MGA1064_PIX_RD_MSK	0x02
35062306a36Sopenharmony_ci#define MGA1064_RADR_PAL	0x03
35162306a36Sopenharmony_ci#define MGA1064_DATA		0x0a
35262306a36Sopenharmony_ci
35362306a36Sopenharmony_ci#define MGA1064_CUR_XLOW	0x0c
35462306a36Sopenharmony_ci#define MGA1064_CUR_XHI		0x0d
35562306a36Sopenharmony_ci#define MGA1064_CUR_YLOW	0x0e
35662306a36Sopenharmony_ci#define MGA1064_CUR_YHI		0x0f
35762306a36Sopenharmony_ci
35862306a36Sopenharmony_ci/* MGA1064 indirect registers */
35962306a36Sopenharmony_ci#define MGA1064_DVI_PIPE_CTL    0x03
36062306a36Sopenharmony_ci#define MGA1064_CURSOR_BASE_ADR_LOW	0x04
36162306a36Sopenharmony_ci#define MGA1064_CURSOR_BASE_ADR_HI	0x05
36262306a36Sopenharmony_ci#define MGA1064_CURSOR_CTL	0x06
36362306a36Sopenharmony_ci#define MGA1064_CURSOR_COL0_RED	0x08
36462306a36Sopenharmony_ci#define MGA1064_CURSOR_COL0_GREEN	0x09
36562306a36Sopenharmony_ci#define MGA1064_CURSOR_COL0_BLUE	0x0a
36662306a36Sopenharmony_ci
36762306a36Sopenharmony_ci#define MGA1064_CURSOR_COL1_RED	0x0c
36862306a36Sopenharmony_ci#define MGA1064_CURSOR_COL1_GREEN	0x0d
36962306a36Sopenharmony_ci#define MGA1064_CURSOR_COL1_BLUE	0x0e
37062306a36Sopenharmony_ci
37162306a36Sopenharmony_ci#define MGA1064_CURSOR_COL2_RED	0x010
37262306a36Sopenharmony_ci#define MGA1064_CURSOR_COL2_GREEN	0x011
37362306a36Sopenharmony_ci#define MGA1064_CURSOR_COL2_BLUE	0x012
37462306a36Sopenharmony_ci
37562306a36Sopenharmony_ci#define MGA1064_VREF_CTL	0x018
37662306a36Sopenharmony_ci
37762306a36Sopenharmony_ci#define MGA1064_MUL_CTL		0x19
37862306a36Sopenharmony_ci#define MGA1064_MUL_CTL_8bits		0x0
37962306a36Sopenharmony_ci#define MGA1064_MUL_CTL_15bits		0x01
38062306a36Sopenharmony_ci#define MGA1064_MUL_CTL_16bits		0x02
38162306a36Sopenharmony_ci#define MGA1064_MUL_CTL_24bits		0x03
38262306a36Sopenharmony_ci#define MGA1064_MUL_CTL_32bits		0x04
38362306a36Sopenharmony_ci#define MGA1064_MUL_CTL_2G8V16bits		0x05
38462306a36Sopenharmony_ci#define MGA1064_MUL_CTL_G16V16bits		0x06
38562306a36Sopenharmony_ci#define MGA1064_MUL_CTL_32_24bits		0x07
38662306a36Sopenharmony_ci
38762306a36Sopenharmony_ci#define MGA1064_PIX_CLK_CTL		0x1a
38862306a36Sopenharmony_ci#define MGA1064_PIX_CLK_CTL_CLK_DIS		( 0x01 << 2 )
38962306a36Sopenharmony_ci#define MGA1064_PIX_CLK_CTL_CLK_POW_DOWN	( 0x01 << 3 )
39062306a36Sopenharmony_ci#define MGA1064_PIX_CLK_CTL_SEL_PCI		( 0x00 << 0 )
39162306a36Sopenharmony_ci#define MGA1064_PIX_CLK_CTL_SEL_PLL		( 0x01 << 0 )
39262306a36Sopenharmony_ci#define MGA1064_PIX_CLK_CTL_SEL_EXT		( 0x02 << 0 )
39362306a36Sopenharmony_ci#define MGA1064_PIX_CLK_CTL_SEL_MSK		( 0x03 << 0 )
39462306a36Sopenharmony_ci
39562306a36Sopenharmony_ci#define MGA1064_GEN_CTL		0x1d
39662306a36Sopenharmony_ci#define MGA1064_GEN_CTL_SYNC_ON_GREEN_DIS      (0x01 << 5)
39762306a36Sopenharmony_ci#define MGA1064_MISC_CTL	0x1e
39862306a36Sopenharmony_ci#define MGA1064_MISC_CTL_DAC_EN                ( 0x01 << 0 )
39962306a36Sopenharmony_ci#define MGA1064_MISC_CTL_VGA   		( 0x01 << 1 )
40062306a36Sopenharmony_ci#define MGA1064_MISC_CTL_DIS_CON   		( 0x03 << 1 )
40162306a36Sopenharmony_ci#define MGA1064_MISC_CTL_MAFC   		( 0x02 << 1 )
40262306a36Sopenharmony_ci#define MGA1064_MISC_CTL_VGA8   		( 0x01 << 3 )
40362306a36Sopenharmony_ci#define MGA1064_MISC_CTL_DAC_RAM_CS   		( 0x01 << 4 )
40462306a36Sopenharmony_ci
40562306a36Sopenharmony_ci#define MGA1064_GEN_IO_CTL2	0x29
40662306a36Sopenharmony_ci#define MGA1064_GEN_IO_CTL	0x2a
40762306a36Sopenharmony_ci#define MGA1064_GEN_IO_DATA	0x2b
40862306a36Sopenharmony_ci#define MGA1064_SYS_PLL_M	0x2c
40962306a36Sopenharmony_ci#define MGA1064_SYS_PLL_N	0x2d
41062306a36Sopenharmony_ci#define MGA1064_SYS_PLL_P	0x2e
41162306a36Sopenharmony_ci#define MGA1064_SYS_PLL_STAT	0x2f
41262306a36Sopenharmony_ci
41362306a36Sopenharmony_ci#define MGA1064_REMHEADCTL     0x30
41462306a36Sopenharmony_ci#define MGA1064_REMHEADCTL_CLKDIS ( 0x01 << 0 )
41562306a36Sopenharmony_ci#define MGA1064_REMHEADCTL_CLKSL_OFF ( 0x00 << 1 )
41662306a36Sopenharmony_ci#define MGA1064_REMHEADCTL_CLKSL_PLL ( 0x01 << 1 )
41762306a36Sopenharmony_ci#define MGA1064_REMHEADCTL_CLKSL_PCI ( 0x02 << 1 )
41862306a36Sopenharmony_ci#define MGA1064_REMHEADCTL_CLKSL_MSK ( 0x03 << 1 )
41962306a36Sopenharmony_ci
42062306a36Sopenharmony_ci#define MGA1064_REMHEADCTL2     0x31
42162306a36Sopenharmony_ci
42262306a36Sopenharmony_ci#define MGA1064_ZOOM_CTL	0x38
42362306a36Sopenharmony_ci#define MGA1064_SENSE_TST	0x3a
42462306a36Sopenharmony_ci
42562306a36Sopenharmony_ci#define MGA1064_CRC_LSB		0x3c
42662306a36Sopenharmony_ci#define MGA1064_CRC_MSB		0x3d
42762306a36Sopenharmony_ci#define MGA1064_CRC_CTL		0x3e
42862306a36Sopenharmony_ci#define MGA1064_COL_KEY_MSK_LSB		0x40
42962306a36Sopenharmony_ci#define MGA1064_COL_KEY_MSK_MSB		0x41
43062306a36Sopenharmony_ci#define MGA1064_COL_KEY_LSB		0x42
43162306a36Sopenharmony_ci#define MGA1064_COL_KEY_MSB		0x43
43262306a36Sopenharmony_ci#define MGA1064_PIX_PLLA_M	0x44
43362306a36Sopenharmony_ci#define MGA1064_PIX_PLLA_N	0x45
43462306a36Sopenharmony_ci#define MGA1064_PIX_PLLA_P	0x46
43562306a36Sopenharmony_ci#define MGA1064_PIX_PLLB_M	0x48
43662306a36Sopenharmony_ci#define MGA1064_PIX_PLLB_N	0x49
43762306a36Sopenharmony_ci#define MGA1064_PIX_PLLB_P	0x4a
43862306a36Sopenharmony_ci#define MGA1064_PIX_PLLC_M	0x4c
43962306a36Sopenharmony_ci#define MGA1064_PIX_PLLC_N	0x4d
44062306a36Sopenharmony_ci#define MGA1064_PIX_PLLC_P	0x4e
44162306a36Sopenharmony_ci
44262306a36Sopenharmony_ci#define MGA1064_PIX_PLL_STAT	0x4f
44362306a36Sopenharmony_ci
44462306a36Sopenharmony_ci/*Added for G450 dual head*/
44562306a36Sopenharmony_ci
44662306a36Sopenharmony_ci#define MGA1064_VID_PLL_STAT    0x8c
44762306a36Sopenharmony_ci#define MGA1064_VID_PLL_P       0x8D
44862306a36Sopenharmony_ci#define MGA1064_VID_PLL_M       0x8E
44962306a36Sopenharmony_ci#define MGA1064_VID_PLL_N       0x8F
45062306a36Sopenharmony_ci
45162306a36Sopenharmony_ci/* Modified PLL for G200 Winbond (G200WB) */
45262306a36Sopenharmony_ci#define MGA1064_WB_PIX_PLLC_M	0xb7
45362306a36Sopenharmony_ci#define MGA1064_WB_PIX_PLLC_N	0xb6
45462306a36Sopenharmony_ci#define MGA1064_WB_PIX_PLLC_P	0xb8
45562306a36Sopenharmony_ci
45662306a36Sopenharmony_ci/* Modified PLL for G200 Maxim (G200EV) */
45762306a36Sopenharmony_ci#define MGA1064_EV_PIX_PLLC_M	0xb6
45862306a36Sopenharmony_ci#define MGA1064_EV_PIX_PLLC_N	0xb7
45962306a36Sopenharmony_ci#define MGA1064_EV_PIX_PLLC_P	0xb8
46062306a36Sopenharmony_ci
46162306a36Sopenharmony_ci/* Modified PLL for G200 EH */
46262306a36Sopenharmony_ci#define MGA1064_EH_PIX_PLLC_M   0xb6
46362306a36Sopenharmony_ci#define MGA1064_EH_PIX_PLLC_N   0xb7
46462306a36Sopenharmony_ci#define MGA1064_EH_PIX_PLLC_P   0xb8
46562306a36Sopenharmony_ci
46662306a36Sopenharmony_ci/* Modified PLL for G200 Maxim (G200ER) */
46762306a36Sopenharmony_ci#define MGA1064_ER_PIX_PLLC_M	0xb7
46862306a36Sopenharmony_ci#define MGA1064_ER_PIX_PLLC_N	0xb6
46962306a36Sopenharmony_ci#define MGA1064_ER_PIX_PLLC_P	0xb8
47062306a36Sopenharmony_ci
47162306a36Sopenharmony_ci#define MGA1064_DISP_CTL        0x8a
47262306a36Sopenharmony_ci#define MGA1064_DISP_CTL_DAC1OUTSEL_MASK       0x01
47362306a36Sopenharmony_ci#define MGA1064_DISP_CTL_DAC1OUTSEL_DIS        0x00
47462306a36Sopenharmony_ci#define MGA1064_DISP_CTL_DAC1OUTSEL_EN         0x01
47562306a36Sopenharmony_ci#define MGA1064_DISP_CTL_DAC2OUTSEL_MASK       (0x03 << 2)
47662306a36Sopenharmony_ci#define MGA1064_DISP_CTL_DAC2OUTSEL_DIS        0x00
47762306a36Sopenharmony_ci#define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1      (0x01 << 2)
47862306a36Sopenharmony_ci#define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC2      (0x02 << 2)
47962306a36Sopenharmony_ci#define MGA1064_DISP_CTL_DAC2OUTSEL_TVE        (0x03 << 2)
48062306a36Sopenharmony_ci#define MGA1064_DISP_CTL_PANOUTSEL_MASK        (0x03 << 5)
48162306a36Sopenharmony_ci#define MGA1064_DISP_CTL_PANOUTSEL_DIS         0x00
48262306a36Sopenharmony_ci#define MGA1064_DISP_CTL_PANOUTSEL_CRTC1       (0x01 << 5)
48362306a36Sopenharmony_ci#define MGA1064_DISP_CTL_PANOUTSEL_CRTC2RGB    (0x02 << 5)
48462306a36Sopenharmony_ci#define MGA1064_DISP_CTL_PANOUTSEL_CRTC2656    (0x03 << 5)
48562306a36Sopenharmony_ci
48662306a36Sopenharmony_ci#define MGA1064_SYNC_CTL        0x8b
48762306a36Sopenharmony_ci
48862306a36Sopenharmony_ci#define MGA1064_PWR_CTL         0xa0
48962306a36Sopenharmony_ci#define MGA1064_PWR_CTL_DAC2_EN                (0x01 << 0)
49062306a36Sopenharmony_ci#define MGA1064_PWR_CTL_VID_PLL_EN             (0x01 << 1)
49162306a36Sopenharmony_ci#define MGA1064_PWR_CTL_PANEL_EN               (0x01 << 2)
49262306a36Sopenharmony_ci#define MGA1064_PWR_CTL_RFIFO_EN               (0x01 << 3)
49362306a36Sopenharmony_ci#define MGA1064_PWR_CTL_CFIFO_EN               (0x01 << 4)
49462306a36Sopenharmony_ci
49562306a36Sopenharmony_ci#define MGA1064_PAN_CTL         0xa2
49662306a36Sopenharmony_ci
49762306a36Sopenharmony_ci/* Using crtc2 */
49862306a36Sopenharmony_ci#define MGAREG2_C2CTL            0x10
49962306a36Sopenharmony_ci#define MGAREG2_C2HPARAM         0x14
50062306a36Sopenharmony_ci#define MGAREG2_C2HSYNC          0x18
50162306a36Sopenharmony_ci#define MGAREG2_C2VPARAM         0x1c
50262306a36Sopenharmony_ci#define MGAREG2_C2VSYNC          0x20
50362306a36Sopenharmony_ci#define MGAREG2_C2STARTADD0      0x28
50462306a36Sopenharmony_ci
50562306a36Sopenharmony_ci#define MGAREG2_C2OFFSET         0x40
50662306a36Sopenharmony_ci#define MGAREG2_C2DATACTL        0x4c
50762306a36Sopenharmony_ci
50862306a36Sopenharmony_ci#define MGAREG_C2CTL            0x3c10
50962306a36Sopenharmony_ci#define MGAREG_C2CTL_C2_EN                     0x01
51062306a36Sopenharmony_ci
51162306a36Sopenharmony_ci#define MGAREG_C2_HIPRILVL_M                   (0x07 << 4)
51262306a36Sopenharmony_ci#define MGAREG_C2_MAXHIPRI_M                   (0x07 << 8)
51362306a36Sopenharmony_ci
51462306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKSEL_MASK            (0x03 << 1)
51562306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKSELH_MASK           (0x01 << 14)
51662306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKSEL_PCICLK          0x00
51762306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKSEL_VDOCLK          (0x01 << 1)
51862306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKSEL_PIXELPLL        (0x02 << 1)
51962306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKSEL_VIDEOPLL        (0x03 << 1)
52062306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKSEL_VDCLK           (0x01 << 14)
52162306a36Sopenharmony_ci
52262306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKSEL_CRISTAL         (0x01 << 1) | (0x01 << 14)
52362306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKSEL_SYSTEMPLL       (0x02 << 1) | (0x01 << 14)
52462306a36Sopenharmony_ci
52562306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKDIS_MASK            (0x01 << 3)
52662306a36Sopenharmony_ci#define MGAREG_C2CTL_PIXCLKDIS_DISABLE         (0x01 << 3)
52762306a36Sopenharmony_ci
52862306a36Sopenharmony_ci#define MGAREG_C2CTL_CRTCDACSEL_MASK           (0x01 << 20)
52962306a36Sopenharmony_ci#define MGAREG_C2CTL_CRTCDACSEL_CRTC1          0x00
53062306a36Sopenharmony_ci#define MGAREG_C2CTL_CRTCDACSEL_CRTC2          (0x01 << 20)
53162306a36Sopenharmony_ci
53262306a36Sopenharmony_ci#define MGAREG_C2HPARAM         0x3c14
53362306a36Sopenharmony_ci#define MGAREG_C2HSYNC          0x3c18
53462306a36Sopenharmony_ci#define MGAREG_C2VPARAM         0x3c1c
53562306a36Sopenharmony_ci#define MGAREG_C2VSYNC          0x3c20
53662306a36Sopenharmony_ci#define MGAREG_C2STARTADD0      0x3c28
53762306a36Sopenharmony_ci
53862306a36Sopenharmony_ci#define MGAREG_C2OFFSET         0x3c40
53962306a36Sopenharmony_ci#define MGAREG_C2DATACTL        0x3c4c
54062306a36Sopenharmony_ci
54162306a36Sopenharmony_ci/* video register */
54262306a36Sopenharmony_ci
54362306a36Sopenharmony_ci#define MGAREG_BESA1C3ORG	0x3d60
54462306a36Sopenharmony_ci#define MGAREG_BESA1CORG	0x3d10
54562306a36Sopenharmony_ci#define MGAREG_BESA1ORG		0x3d00
54662306a36Sopenharmony_ci#define MGAREG_BESCTL		0x3d20
54762306a36Sopenharmony_ci#define MGAREG_BESGLOBCTL	0x3dc0
54862306a36Sopenharmony_ci#define MGAREG_BESHCOORD	0x3d28
54962306a36Sopenharmony_ci#define MGAREG_BESHISCAL	0x3d30
55062306a36Sopenharmony_ci#define MGAREG_BESHSRCEND	0x3d3c
55162306a36Sopenharmony_ci#define MGAREG_BESHSRCLST	0x3d50
55262306a36Sopenharmony_ci#define MGAREG_BESHSRCST	0x3d38
55362306a36Sopenharmony_ci#define MGAREG_BESLUMACTL	0x3d40
55462306a36Sopenharmony_ci#define MGAREG_BESPITCH		0x3d24
55562306a36Sopenharmony_ci#define MGAREG_BESV1SRCLST	0x3d54
55662306a36Sopenharmony_ci#define MGAREG_BESV1WGHT	0x3d48
55762306a36Sopenharmony_ci#define MGAREG_BESVCOORD	0x3d2c
55862306a36Sopenharmony_ci#define MGAREG_BESVISCAL	0x3d34
55962306a36Sopenharmony_ci
56062306a36Sopenharmony_ci/* texture engine registers */
56162306a36Sopenharmony_ci
56262306a36Sopenharmony_ci#define MGAREG_TMR0		0x2c00
56362306a36Sopenharmony_ci#define MGAREG_TMR1		0x2c04
56462306a36Sopenharmony_ci#define MGAREG_TMR2		0x2c08
56562306a36Sopenharmony_ci#define MGAREG_TMR3		0x2c0c
56662306a36Sopenharmony_ci#define MGAREG_TMR4		0x2c10
56762306a36Sopenharmony_ci#define MGAREG_TMR5		0x2c14
56862306a36Sopenharmony_ci#define MGAREG_TMR6		0x2c18
56962306a36Sopenharmony_ci#define MGAREG_TMR7		0x2c1c
57062306a36Sopenharmony_ci#define MGAREG_TMR8		0x2c20
57162306a36Sopenharmony_ci#define MGAREG_TEXORG		0x2c24
57262306a36Sopenharmony_ci#define MGAREG_TEXWIDTH		0x2c28
57362306a36Sopenharmony_ci#define MGAREG_TEXHEIGHT	0x2c2c
57462306a36Sopenharmony_ci#define MGAREG_TEXCTL		0x2c30
57562306a36Sopenharmony_ci#    define MGA_TW4                             (0x00000000)
57662306a36Sopenharmony_ci#    define MGA_TW8                             (0x00000001)
57762306a36Sopenharmony_ci#    define MGA_TW15                            (0x00000002)
57862306a36Sopenharmony_ci#    define MGA_TW16                            (0x00000003)
57962306a36Sopenharmony_ci#    define MGA_TW12                            (0x00000004)
58062306a36Sopenharmony_ci#    define MGA_TW32                            (0x00000006)
58162306a36Sopenharmony_ci#    define MGA_TW8A                            (0x00000007)
58262306a36Sopenharmony_ci#    define MGA_TW8AL                           (0x00000008)
58362306a36Sopenharmony_ci#    define MGA_TW422                           (0x0000000A)
58462306a36Sopenharmony_ci#    define MGA_TW422UYVY                       (0x0000000B)
58562306a36Sopenharmony_ci#    define MGA_PITCHLIN                        (0x00000100)
58662306a36Sopenharmony_ci#    define MGA_NOPERSPECTIVE                   (0x00200000)
58762306a36Sopenharmony_ci#    define MGA_TAKEY                           (0x02000000)
58862306a36Sopenharmony_ci#    define MGA_TAMASK                          (0x04000000)
58962306a36Sopenharmony_ci#    define MGA_CLAMPUV                         (0x18000000)
59062306a36Sopenharmony_ci#    define MGA_TEXMODULATE                     (0x20000000)
59162306a36Sopenharmony_ci#define MGAREG_TEXCTL2		0x2c3c
59262306a36Sopenharmony_ci#    define MGA_G400_TC2_MAGIC                  (0x00008000)
59362306a36Sopenharmony_ci#    define MGA_TC2_DECALBLEND                  (0x00000001)
59462306a36Sopenharmony_ci#    define MGA_TC2_IDECAL                      (0x00000002)
59562306a36Sopenharmony_ci#    define MGA_TC2_DECALDIS                    (0x00000004)
59662306a36Sopenharmony_ci#    define MGA_TC2_CKSTRANSDIS                 (0x00000010)
59762306a36Sopenharmony_ci#    define MGA_TC2_BORDEREN                    (0x00000020)
59862306a36Sopenharmony_ci#    define MGA_TC2_SPECEN                      (0x00000040)
59962306a36Sopenharmony_ci#    define MGA_TC2_DUALTEX                     (0x00000080)
60062306a36Sopenharmony_ci#    define MGA_TC2_TABLEFOG                    (0x00000100)
60162306a36Sopenharmony_ci#    define MGA_TC2_BUMPMAP                     (0x00000200)
60262306a36Sopenharmony_ci#    define MGA_TC2_SELECT_TMU1                 (0x80000000)
60362306a36Sopenharmony_ci#define MGAREG_TEXTRANS		0x2c34
60462306a36Sopenharmony_ci#define MGAREG_TEXTRANSHIGH	0x2c38
60562306a36Sopenharmony_ci#define MGAREG_TEXFILTER	0x2c58
60662306a36Sopenharmony_ci#    define MGA_MIN_NRST                        (0x00000000)
60762306a36Sopenharmony_ci#    define MGA_MIN_BILIN                       (0x00000002)
60862306a36Sopenharmony_ci#    define MGA_MIN_ANISO                       (0x0000000D)
60962306a36Sopenharmony_ci#    define MGA_MAG_NRST                        (0x00000000)
61062306a36Sopenharmony_ci#    define MGA_MAG_BILIN                       (0x00000020)
61162306a36Sopenharmony_ci#    define MGA_FILTERALPHA                     (0x00100000)
61262306a36Sopenharmony_ci#define MGAREG_ALPHASTART	0x2c70
61362306a36Sopenharmony_ci#define MGAREG_ALPHAXINC	0x2c74
61462306a36Sopenharmony_ci#define MGAREG_ALPHAYINC	0x2c78
61562306a36Sopenharmony_ci#define MGAREG_ALPHACTRL	0x2c7c
61662306a36Sopenharmony_ci#    define MGA_SRC_ZERO                        (0x00000000)
61762306a36Sopenharmony_ci#    define MGA_SRC_ONE                         (0x00000001)
61862306a36Sopenharmony_ci#    define MGA_SRC_DST_COLOR                   (0x00000002)
61962306a36Sopenharmony_ci#    define MGA_SRC_ONE_MINUS_DST_COLOR         (0x00000003)
62062306a36Sopenharmony_ci#    define MGA_SRC_ALPHA                       (0x00000004)
62162306a36Sopenharmony_ci#    define MGA_SRC_ONE_MINUS_SRC_ALPHA         (0x00000005)
62262306a36Sopenharmony_ci#    define MGA_SRC_DST_ALPHA                   (0x00000006)
62362306a36Sopenharmony_ci#    define MGA_SRC_ONE_MINUS_DST_ALPHA         (0x00000007)
62462306a36Sopenharmony_ci#    define MGA_SRC_SRC_ALPHA_SATURATE          (0x00000008)
62562306a36Sopenharmony_ci#    define MGA_SRC_BLEND_MASK                  (0x0000000f)
62662306a36Sopenharmony_ci#    define MGA_DST_ZERO                        (0x00000000)
62762306a36Sopenharmony_ci#    define MGA_DST_ONE                         (0x00000010)
62862306a36Sopenharmony_ci#    define MGA_DST_SRC_COLOR                   (0x00000020)
62962306a36Sopenharmony_ci#    define MGA_DST_ONE_MINUS_SRC_COLOR         (0x00000030)
63062306a36Sopenharmony_ci#    define MGA_DST_SRC_ALPHA                   (0x00000040)
63162306a36Sopenharmony_ci#    define MGA_DST_ONE_MINUS_SRC_ALPHA         (0x00000050)
63262306a36Sopenharmony_ci#    define MGA_DST_DST_ALPHA                   (0x00000060)
63362306a36Sopenharmony_ci#    define MGA_DST_ONE_MINUS_DST_ALPHA         (0x00000070)
63462306a36Sopenharmony_ci#    define MGA_DST_BLEND_MASK                  (0x00000070)
63562306a36Sopenharmony_ci#    define MGA_ALPHACHANNEL                    (0x00000100)
63662306a36Sopenharmony_ci#    define MGA_VIDEOALPHA                      (0x00000200)
63762306a36Sopenharmony_ci#    define MGA_DIFFUSEDALPHA                   (0x01000000)
63862306a36Sopenharmony_ci#    define MGA_MODULATEDALPHA                  (0x02000000)
63962306a36Sopenharmony_ci#define MGAREG_TDUALSTAGE0                      (0x2CF8)
64062306a36Sopenharmony_ci#define MGAREG_TDUALSTAGE1                      (0x2CFC)
64162306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG2_DIFFUSE          (0x00000000)
64262306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG2_SPECULAR         (0x00000001)
64362306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG2_FCOL             (0x00000002)
64462306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG2_PREVSTAGE        (0x00000003)
64562306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ALPHA_DIFFUSE         (0x00000000)
64662306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ALPHA_FCOL            (0x00000004)
64762306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ALPHA_CURRTEX         (0x00000008)
64862306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ALPHA_PREVTEX         (0x0000000c)
64962306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ALPHA_PREVSTAGE       (0x00000010)
65062306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG1_REPLICATEALPHA   (0x00000020)
65162306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG1_INV              (0x00000040)
65262306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG2_REPLICATEALPHA   (0x00000080)
65362306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG2_INV              (0x00000100)
65462306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ALPHA1INV             (0x00000200)
65562306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ALPHA2INV             (0x00000400)
65662306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG1MUL_ALPHA1        (0x00000800)
65762306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG2MUL_ALPHA2        (0x00001000)
65862306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG1ADD_MULOUT        (0x00002000)
65962306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ARG2ADD_MULOUT        (0x00004000)
66062306a36Sopenharmony_ci#    define MGA_TDS_COLOR_MODBRIGHT_2X          (0x00008000)
66162306a36Sopenharmony_ci#    define MGA_TDS_COLOR_MODBRIGHT_4X          (0x00010000)
66262306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ADD_SUB               (0x00000000)
66362306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ADD_ADD               (0x00020000)
66462306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ADD2X                 (0x00040000)
66562306a36Sopenharmony_ci#    define MGA_TDS_COLOR_ADDBIAS               (0x00080000)
66662306a36Sopenharmony_ci#    define MGA_TDS_COLOR_BLEND                 (0x00100000)
66762306a36Sopenharmony_ci#    define MGA_TDS_COLOR_SEL_ARG1              (0x00000000)
66862306a36Sopenharmony_ci#    define MGA_TDS_COLOR_SEL_ARG2              (0x00200000)
66962306a36Sopenharmony_ci#    define MGA_TDS_COLOR_SEL_ADD               (0x00400000)
67062306a36Sopenharmony_ci#    define MGA_TDS_COLOR_SEL_MUL               (0x00600000)
67162306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_ARG1_INV              (0x00800000)
67262306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_ARG2_DIFFUSE          (0x00000000)
67362306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_ARG2_FCOL             (0x01000000)
67462306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_ARG2_PREVTEX          (0x02000000)
67562306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_ARG2_PREVSTAGE        (0x03000000)
67662306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_ARG2_INV              (0x04000000)
67762306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_ADD                   (0x08000000)
67862306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_ADDBIAS               (0x10000000)
67962306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_ADD2X                 (0x20000000)
68062306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_SEL_ARG1              (0x00000000)
68162306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_SEL_ARG2              (0x40000000)
68262306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_SEL_ADD               (0x80000000)
68362306a36Sopenharmony_ci#    define MGA_TDS_ALPHA_SEL_MUL               (0xc0000000)
68462306a36Sopenharmony_ci
68562306a36Sopenharmony_ci#define MGAREG_DWGSYNC		0x2c4c
68662306a36Sopenharmony_ci
68762306a36Sopenharmony_ci#define MGAREG_AGP_PLL		0x1e4c
68862306a36Sopenharmony_ci#define MGA_AGP2XPLL_ENABLE		0x1
68962306a36Sopenharmony_ci#define MGA_AGP2XPLL_DISABLE		0x0
69062306a36Sopenharmony_ci
69162306a36Sopenharmony_ci#endif
692