xref: /haiku/headers/private/graphics/radeon_hd/r500_reg.h (revision 5cf44dda39962b528f9791e7bfc2f98a9e882478)
1*5cf44ddaSAlexander von Gluck IV /*
2*5cf44ddaSAlexander von Gluck IV  * Copyright 2008 Advanced Micro Devices, Inc.
3*5cf44ddaSAlexander von Gluck IV  * Copyright 2008 Red Hat Inc.
4*5cf44ddaSAlexander von Gluck IV  * Copyright 2009 Jerome Glisse.
5*5cf44ddaSAlexander von Gluck IV  *
6*5cf44ddaSAlexander von Gluck IV  * Permission is hereby granted, free of charge, to any person obtaining a
7*5cf44ddaSAlexander von Gluck IV  * copy of this software and associated documentation files (the "Software"),
8*5cf44ddaSAlexander von Gluck IV  * to deal in the Software without restriction, including without limitation
9*5cf44ddaSAlexander von Gluck IV  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10*5cf44ddaSAlexander von Gluck IV  * and/or sell copies of the Software, and to permit persons to whom the
11*5cf44ddaSAlexander von Gluck IV  * Software is furnished to do so, subject to the following conditions:
12*5cf44ddaSAlexander von Gluck IV  *
13*5cf44ddaSAlexander von Gluck IV  * The above copyright notice and this permission notice shall be included in
14*5cf44ddaSAlexander von Gluck IV  * all copies or substantial portions of the Software.
15*5cf44ddaSAlexander von Gluck IV  *
16*5cf44ddaSAlexander von Gluck IV  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17*5cf44ddaSAlexander von Gluck IV  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18*5cf44ddaSAlexander von Gluck IV  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19*5cf44ddaSAlexander von Gluck IV  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20*5cf44ddaSAlexander von Gluck IV  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21*5cf44ddaSAlexander von Gluck IV  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22*5cf44ddaSAlexander von Gluck IV  * OTHER DEALINGS IN THE SOFTWARE.
23*5cf44ddaSAlexander von Gluck IV  *
24*5cf44ddaSAlexander von Gluck IV  * Authors: Dave Airlie
25*5cf44ddaSAlexander von Gluck IV  *          Alex Deucher
26*5cf44ddaSAlexander von Gluck IV  *          Jerome Glisse
27*5cf44ddaSAlexander von Gluck IV  */
28*5cf44ddaSAlexander von Gluck IV #ifndef __R500_REG_H__
29*5cf44ddaSAlexander von Gluck IV #define __R500_REG_H__
30*5cf44ddaSAlexander von Gluck IV 
31*5cf44ddaSAlexander von Gluck IV /* pipe config regs */
32*5cf44ddaSAlexander von Gluck IV #define R300_GA_POLY_MODE				0x4288
33*5cf44ddaSAlexander von Gluck IV #       define R300_FRONT_PTYPE_POINT                   (0 << 4)
34*5cf44ddaSAlexander von Gluck IV #       define R300_FRONT_PTYPE_LINE                    (1 << 4)
35*5cf44ddaSAlexander von Gluck IV #       define R300_FRONT_PTYPE_TRIANGE                 (2 << 4)
36*5cf44ddaSAlexander von Gluck IV #       define R300_BACK_PTYPE_POINT                    (0 << 7)
37*5cf44ddaSAlexander von Gluck IV #       define R300_BACK_PTYPE_LINE                     (1 << 7)
38*5cf44ddaSAlexander von Gluck IV #       define R300_BACK_PTYPE_TRIANGE                  (2 << 7)
39*5cf44ddaSAlexander von Gluck IV #define R300_GA_ROUND_MODE				0x428c
40*5cf44ddaSAlexander von Gluck IV #       define R300_GEOMETRY_ROUND_TRUNC                (0 << 0)
41*5cf44ddaSAlexander von Gluck IV #       define R300_GEOMETRY_ROUND_NEAREST              (1 << 0)
42*5cf44ddaSAlexander von Gluck IV #       define R300_COLOR_ROUND_TRUNC                   (0 << 2)
43*5cf44ddaSAlexander von Gluck IV #       define R300_COLOR_ROUND_NEAREST                 (1 << 2)
44*5cf44ddaSAlexander von Gluck IV #define R300_GB_MSPOS0				        0x4010
45*5cf44ddaSAlexander von Gluck IV #       define R300_MS_X0_SHIFT                         0
46*5cf44ddaSAlexander von Gluck IV #       define R300_MS_Y0_SHIFT                         4
47*5cf44ddaSAlexander von Gluck IV #       define R300_MS_X1_SHIFT                         8
48*5cf44ddaSAlexander von Gluck IV #       define R300_MS_Y1_SHIFT                         12
49*5cf44ddaSAlexander von Gluck IV #       define R300_MS_X2_SHIFT                         16
50*5cf44ddaSAlexander von Gluck IV #       define R300_MS_Y2_SHIFT                         20
51*5cf44ddaSAlexander von Gluck IV #       define R300_MSBD0_Y_SHIFT                       24
52*5cf44ddaSAlexander von Gluck IV #       define R300_MSBD0_X_SHIFT                       28
53*5cf44ddaSAlexander von Gluck IV #define R300_GB_MSPOS1				        0x4014
54*5cf44ddaSAlexander von Gluck IV #       define R300_MS_X3_SHIFT                         0
55*5cf44ddaSAlexander von Gluck IV #       define R300_MS_Y3_SHIFT                         4
56*5cf44ddaSAlexander von Gluck IV #       define R300_MS_X4_SHIFT                         8
57*5cf44ddaSAlexander von Gluck IV #       define R300_MS_Y4_SHIFT                         12
58*5cf44ddaSAlexander von Gluck IV #       define R300_MS_X5_SHIFT                         16
59*5cf44ddaSAlexander von Gluck IV #       define R300_MS_Y5_SHIFT                         20
60*5cf44ddaSAlexander von Gluck IV #       define R300_MSBD1_SHIFT                         24
61*5cf44ddaSAlexander von Gluck IV 
62*5cf44ddaSAlexander von Gluck IV #define R300_GA_ENHANCE				        0x4274
63*5cf44ddaSAlexander von Gluck IV #       define R300_GA_DEADLOCK_CNTL                    (1 << 0)
64*5cf44ddaSAlexander von Gluck IV #       define R300_GA_FASTSYNC_CNTL                    (1 << 1)
65*5cf44ddaSAlexander von Gluck IV #define R300_RB3D_DSTCACHE_CTLSTAT              0x4e4c
66*5cf44ddaSAlexander von Gluck IV #	define R300_RB3D_DC_FLUSH		(2 << 0)
67*5cf44ddaSAlexander von Gluck IV #	define R300_RB3D_DC_FREE		(2 << 2)
68*5cf44ddaSAlexander von Gluck IV #	define R300_RB3D_DC_FINISH		(1 << 4)
69*5cf44ddaSAlexander von Gluck IV #define R300_RB3D_ZCACHE_CTLSTAT			0x4f18
70*5cf44ddaSAlexander von Gluck IV #       define R300_ZC_FLUSH                            (1 << 0)
71*5cf44ddaSAlexander von Gluck IV #       define R300_ZC_FREE                             (1 << 1)
72*5cf44ddaSAlexander von Gluck IV #       define R300_ZC_FLUSH_ALL                        0x3
73*5cf44ddaSAlexander von Gluck IV #define R400_GB_PIPE_SELECT             0x402c
74*5cf44ddaSAlexander von Gluck IV #define R500_DYN_SCLK_PWMEM_PIPE        0x000d /* PLL */
75*5cf44ddaSAlexander von Gluck IV #define R500_SU_REG_DEST                0x42c8
76*5cf44ddaSAlexander von Gluck IV #define R300_GB_TILE_CONFIG             0x4018
77*5cf44ddaSAlexander von Gluck IV #       define R300_ENABLE_TILING       (1 << 0)
78*5cf44ddaSAlexander von Gluck IV #       define R300_PIPE_COUNT_RV350    (0 << 1)
79*5cf44ddaSAlexander von Gluck IV #       define R300_PIPE_COUNT_R300     (3 << 1)
80*5cf44ddaSAlexander von Gluck IV #       define R300_PIPE_COUNT_R420_3P  (6 << 1)
81*5cf44ddaSAlexander von Gluck IV #       define R300_PIPE_COUNT_R420     (7 << 1)
82*5cf44ddaSAlexander von Gluck IV #       define R300_TILE_SIZE_8         (0 << 4)
83*5cf44ddaSAlexander von Gluck IV #       define R300_TILE_SIZE_16        (1 << 4)
84*5cf44ddaSAlexander von Gluck IV #       define R300_TILE_SIZE_32        (2 << 4)
85*5cf44ddaSAlexander von Gluck IV #       define R300_SUBPIXEL_1_12       (0 << 16)
86*5cf44ddaSAlexander von Gluck IV #       define R300_SUBPIXEL_1_16       (1 << 16)
87*5cf44ddaSAlexander von Gluck IV #define R300_DST_PIPE_CONFIG            0x170c
88*5cf44ddaSAlexander von Gluck IV #       define R300_PIPE_AUTO_CONFIG    (1 << 31)
89*5cf44ddaSAlexander von Gluck IV #define R300_RB2D_DSTCACHE_MODE         0x3428
90*5cf44ddaSAlexander von Gluck IV #       define R300_DC_AUTOFLUSH_ENABLE (1 << 8)
91*5cf44ddaSAlexander von Gluck IV #       define R300_DC_DC_DISABLE_IGNORE_PE (1 << 17)
92*5cf44ddaSAlexander von Gluck IV 
93*5cf44ddaSAlexander von Gluck IV #define RADEON_CP_STAT		0x7C0
94*5cf44ddaSAlexander von Gluck IV #define RADEON_RBBM_CMDFIFO_ADDR	0xE70
95*5cf44ddaSAlexander von Gluck IV #define RADEON_RBBM_CMDFIFO_DATA	0xE74
96*5cf44ddaSAlexander von Gluck IV #define RADEON_ISYNC_CNTL		0x1724
97*5cf44ddaSAlexander von Gluck IV #	define RADEON_ISYNC_ANY2D_IDLE3D	(1 << 0)
98*5cf44ddaSAlexander von Gluck IV #	define RADEON_ISYNC_ANY3D_IDLE2D	(1 << 1)
99*5cf44ddaSAlexander von Gluck IV #	define RADEON_ISYNC_TRIG2D_IDLE3D	(1 << 2)
100*5cf44ddaSAlexander von Gluck IV #	define RADEON_ISYNC_TRIG3D_IDLE2D	(1 << 3)
101*5cf44ddaSAlexander von Gluck IV #	define RADEON_ISYNC_WAIT_IDLEGUI	(1 << 4)
102*5cf44ddaSAlexander von Gluck IV #	define RADEON_ISYNC_CPSCRATCH_IDLEGUI	(1 << 5)
103*5cf44ddaSAlexander von Gluck IV 
104*5cf44ddaSAlexander von Gluck IV #define RS480_NB_MC_INDEX               0x168
105*5cf44ddaSAlexander von Gluck IV #	define RS480_NB_MC_IND_WR_EN	(1 << 8)
106*5cf44ddaSAlexander von Gluck IV #define RS480_NB_MC_DATA                0x16c
107*5cf44ddaSAlexander von Gluck IV 
108*5cf44ddaSAlexander von Gluck IV /*
109*5cf44ddaSAlexander von Gluck IV  * RS690
110*5cf44ddaSAlexander von Gluck IV  */
111*5cf44ddaSAlexander von Gluck IV #define RS690_MCCFG_FB_LOCATION		0x100
112*5cf44ddaSAlexander von Gluck IV #define		RS690_MC_FB_START_MASK		0x0000FFFF
113*5cf44ddaSAlexander von Gluck IV #define		RS690_MC_FB_START_SHIFT		0
114*5cf44ddaSAlexander von Gluck IV #define		RS690_MC_FB_TOP_MASK		0xFFFF0000
115*5cf44ddaSAlexander von Gluck IV #define		RS690_MC_FB_TOP_SHIFT		16
116*5cf44ddaSAlexander von Gluck IV #define RS690_MCCFG_AGP_LOCATION	0x101
117*5cf44ddaSAlexander von Gluck IV #define		RS690_MC_AGP_START_MASK		0x0000FFFF
118*5cf44ddaSAlexander von Gluck IV #define		RS690_MC_AGP_START_SHIFT	0
119*5cf44ddaSAlexander von Gluck IV #define		RS690_MC_AGP_TOP_MASK		0xFFFF0000
120*5cf44ddaSAlexander von Gluck IV #define		RS690_MC_AGP_TOP_SHIFT		16
121*5cf44ddaSAlexander von Gluck IV #define RS690_MCCFG_AGP_BASE		0x102
122*5cf44ddaSAlexander von Gluck IV #define RS690_MCCFG_AGP_BASE_2		0x103
123*5cf44ddaSAlexander von Gluck IV #define RS690_MC_INIT_MISC_LAT_TIMER            0x104
124*5cf44ddaSAlexander von Gluck IV #define RS690_HDP_FB_LOCATION		0x0134
125*5cf44ddaSAlexander von Gluck IV #define RS690_MC_INDEX				0x78
126*5cf44ddaSAlexander von Gluck IV #	define RS690_MC_INDEX_MASK		0x1ff
127*5cf44ddaSAlexander von Gluck IV #	define RS690_MC_INDEX_WR_EN		(1 << 9)
128*5cf44ddaSAlexander von Gluck IV #	define RS690_MC_INDEX_WR_ACK		0x7f
129*5cf44ddaSAlexander von Gluck IV #define RS690_MC_DATA				0x7c
130*5cf44ddaSAlexander von Gluck IV #define RS690_MC_STATUS                         0x90
131*5cf44ddaSAlexander von Gluck IV #define RS690_MC_STATUS_IDLE                    (1 << 0)
132*5cf44ddaSAlexander von Gluck IV #define RS480_AGP_BASE_2		0x0164
133*5cf44ddaSAlexander von Gluck IV #define RS480_MC_MISC_CNTL              0x18
134*5cf44ddaSAlexander von Gluck IV #	define RS480_DISABLE_GTW	(1 << 1)
135*5cf44ddaSAlexander von Gluck IV #	define RS480_GART_INDEX_REG_EN	(1 << 12)
136*5cf44ddaSAlexander von Gluck IV #	define RS690_BLOCK_GFX_D3_EN	(1 << 14)
137*5cf44ddaSAlexander von Gluck IV #define RS480_GART_FEATURE_ID           0x2b
138*5cf44ddaSAlexander von Gluck IV #	define RS480_HANG_EN	        (1 << 11)
139*5cf44ddaSAlexander von Gluck IV #	define RS480_TLB_ENABLE	        (1 << 18)
140*5cf44ddaSAlexander von Gluck IV #	define RS480_P2P_ENABLE	        (1 << 19)
141*5cf44ddaSAlexander von Gluck IV #	define RS480_GTW_LAC_EN	        (1 << 25)
142*5cf44ddaSAlexander von Gluck IV #	define RS480_2LEVEL_GART	(0 << 30)
143*5cf44ddaSAlexander von Gluck IV #	define RS480_1LEVEL_GART	(1 << 30)
144*5cf44ddaSAlexander von Gluck IV #	define RS480_PDC_EN	        (1 << 31)
145*5cf44ddaSAlexander von Gluck IV #define RS480_GART_BASE                 0x2c
146*5cf44ddaSAlexander von Gluck IV #define RS480_GART_CACHE_CNTRL          0x2e
147*5cf44ddaSAlexander von Gluck IV #	define RS480_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */
148*5cf44ddaSAlexander von Gluck IV #define RS480_AGP_ADDRESS_SPACE_SIZE    0x38
149*5cf44ddaSAlexander von Gluck IV #	define RS480_GART_EN	        (1 << 0)
150*5cf44ddaSAlexander von Gluck IV #	define RS480_VA_SIZE_32MB	(0 << 1)
151*5cf44ddaSAlexander von Gluck IV #	define RS480_VA_SIZE_64MB	(1 << 1)
152*5cf44ddaSAlexander von Gluck IV #	define RS480_VA_SIZE_128MB	(2 << 1)
153*5cf44ddaSAlexander von Gluck IV #	define RS480_VA_SIZE_256MB	(3 << 1)
154*5cf44ddaSAlexander von Gluck IV #	define RS480_VA_SIZE_512MB	(4 << 1)
155*5cf44ddaSAlexander von Gluck IV #	define RS480_VA_SIZE_1GB	(5 << 1)
156*5cf44ddaSAlexander von Gluck IV #	define RS480_VA_SIZE_2GB	(6 << 1)
157*5cf44ddaSAlexander von Gluck IV #define RS480_AGP_MODE_CNTL             0x39
158*5cf44ddaSAlexander von Gluck IV #	define RS480_POST_GART_Q_SIZE	(1 << 18)
159*5cf44ddaSAlexander von Gluck IV #	define RS480_NONGART_SNOOP	(1 << 19)
160*5cf44ddaSAlexander von Gluck IV #	define RS480_AGP_RD_BUF_SIZE	(1 << 20)
161*5cf44ddaSAlexander von Gluck IV #	define RS480_REQ_TYPE_SNOOP_SHIFT 22
162*5cf44ddaSAlexander von Gluck IV #	define RS480_REQ_TYPE_SNOOP_MASK  0x3
163*5cf44ddaSAlexander von Gluck IV #	define RS480_REQ_TYPE_SNOOP_DIS	(1 << 24)
164*5cf44ddaSAlexander von Gluck IV 
165*5cf44ddaSAlexander von Gluck IV #define RS690_AIC_CTRL_SCRATCH		0x3A
166*5cf44ddaSAlexander von Gluck IV #	define RS690_DIS_OUT_OF_PCI_GART_ACCESS	(1 << 1)
167*5cf44ddaSAlexander von Gluck IV 
168*5cf44ddaSAlexander von Gluck IV /*
169*5cf44ddaSAlexander von Gluck IV  * RS600
170*5cf44ddaSAlexander von Gluck IV  */
171*5cf44ddaSAlexander von Gluck IV #define RS600_MC_STATUS                         0x0
172*5cf44ddaSAlexander von Gluck IV #define RS600_MC_STATUS_IDLE                    (1 << 0)
173*5cf44ddaSAlexander von Gluck IV #define RS600_MC_INDEX                          0x70
174*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_ADDR_MASK               0xffff
175*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_IND_SEQ_RBS_0           (1 << 16)
176*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_IND_SEQ_RBS_1           (1 << 17)
177*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_IND_SEQ_RBS_2           (1 << 18)
178*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_IND_SEQ_RBS_3           (1 << 19)
179*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_IND_AIC_RBS             (1 << 20)
180*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_IND_CITF_ARB0           (1 << 21)
181*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_IND_CITF_ARB1           (1 << 22)
182*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_IND_WR_EN               (1 << 23)
183*5cf44ddaSAlexander von Gluck IV #define RS600_MC_DATA                           0x74
184*5cf44ddaSAlexander von Gluck IV #define RS600_MC_STATUS                         0x0
185*5cf44ddaSAlexander von Gluck IV #       define RS600_MC_IDLE                    (1 << 1)
186*5cf44ddaSAlexander von Gluck IV #define RS600_MC_FB_LOCATION                    0x4
187*5cf44ddaSAlexander von Gluck IV #define		RS600_MC_FB_START_MASK		0x0000FFFF
188*5cf44ddaSAlexander von Gluck IV #define		RS600_MC_FB_START_SHIFT		0
189*5cf44ddaSAlexander von Gluck IV #define		RS600_MC_FB_TOP_MASK		0xFFFF0000
190*5cf44ddaSAlexander von Gluck IV #define		RS600_MC_FB_TOP_SHIFT		16
191*5cf44ddaSAlexander von Gluck IV #define RS600_MC_AGP_LOCATION                   0x5
192*5cf44ddaSAlexander von Gluck IV #define		RS600_MC_AGP_START_MASK		0x0000FFFF
193*5cf44ddaSAlexander von Gluck IV #define		RS600_MC_AGP_START_SHIFT	0
194*5cf44ddaSAlexander von Gluck IV #define		RS600_MC_AGP_TOP_MASK		0xFFFF0000
195*5cf44ddaSAlexander von Gluck IV #define		RS600_MC_AGP_TOP_SHIFT		16
196*5cf44ddaSAlexander von Gluck IV #define RS600_MC_AGP_BASE                          0x6
197*5cf44ddaSAlexander von Gluck IV #define RS600_MC_AGP_BASE_2                        0x7
198*5cf44ddaSAlexander von Gluck IV #define RS600_MC_CNTL1                          0x9
199*5cf44ddaSAlexander von Gluck IV #       define RS600_ENABLE_PAGE_TABLES         (1 << 26)
200*5cf44ddaSAlexander von Gluck IV #define RS600_MC_PT0_CNTL                       0x100
201*5cf44ddaSAlexander von Gluck IV #       define RS600_ENABLE_PT                  (1 << 0)
202*5cf44ddaSAlexander von Gluck IV #       define RS600_EFFECTIVE_L2_CACHE_SIZE(x) ((x) << 15)
203*5cf44ddaSAlexander von Gluck IV #       define RS600_EFFECTIVE_L2_QUEUE_SIZE(x) ((x) << 21)
204*5cf44ddaSAlexander von Gluck IV #       define RS600_INVALIDATE_ALL_L1_TLBS     (1 << 28)
205*5cf44ddaSAlexander von Gluck IV #       define RS600_INVALIDATE_L2_CACHE        (1 << 29)
206*5cf44ddaSAlexander von Gluck IV #define RS600_MC_PT0_CONTEXT0_CNTL              0x102
207*5cf44ddaSAlexander von Gluck IV #       define RS600_ENABLE_PAGE_TABLE          (1 << 0)
208*5cf44ddaSAlexander von Gluck IV #       define RS600_PAGE_TABLE_TYPE_FLAT       (0 << 1)
209*5cf44ddaSAlexander von Gluck IV #define RS600_MC_PT0_SYSTEM_APERTURE_LOW_ADDR   0x112
210*5cf44ddaSAlexander von Gluck IV #define RS600_MC_PT0_SYSTEM_APERTURE_HIGH_ADDR  0x114
211*5cf44ddaSAlexander von Gluck IV #define RS600_MC_PT0_CONTEXT0_DEFAULT_READ_ADDR 0x11c
212*5cf44ddaSAlexander von Gluck IV #define RS600_MC_PT0_CONTEXT0_FLAT_BASE_ADDR    0x12c
213*5cf44ddaSAlexander von Gluck IV #define RS600_MC_PT0_CONTEXT0_FLAT_START_ADDR   0x13c
214*5cf44ddaSAlexander von Gluck IV #define RS600_MC_PT0_CONTEXT0_FLAT_END_ADDR     0x14c
215*5cf44ddaSAlexander von Gluck IV #define RS600_MC_PT0_CLIENT0_CNTL               0x16c
216*5cf44ddaSAlexander von Gluck IV #       define RS600_ENABLE_TRANSLATION_MODE_OVERRIDE       (1 << 0)
217*5cf44ddaSAlexander von Gluck IV #       define RS600_TRANSLATION_MODE_OVERRIDE              (1 << 1)
218*5cf44ddaSAlexander von Gluck IV #       define RS600_SYSTEM_ACCESS_MODE_MASK                (3 << 8)
219*5cf44ddaSAlexander von Gluck IV #       define RS600_SYSTEM_ACCESS_MODE_PA_ONLY             (0 << 8)
220*5cf44ddaSAlexander von Gluck IV #       define RS600_SYSTEM_ACCESS_MODE_USE_SYS_MAP         (1 << 8)
221*5cf44ddaSAlexander von Gluck IV #       define RS600_SYSTEM_ACCESS_MODE_IN_SYS              (2 << 8)
222*5cf44ddaSAlexander von Gluck IV #       define RS600_SYSTEM_ACCESS_MODE_NOT_IN_SYS          (3 << 8)
223*5cf44ddaSAlexander von Gluck IV #       define RS600_SYSTEM_APERTURE_UNMAPPED_ACCESS_PASSTHROUGH        (0 << 10)
224*5cf44ddaSAlexander von Gluck IV #       define RS600_SYSTEM_APERTURE_UNMAPPED_ACCESS_DEFAULT_PAGE       (1 << 10)
225*5cf44ddaSAlexander von Gluck IV #       define RS600_EFFECTIVE_L1_CACHE_SIZE(x) ((x) << 11)
226*5cf44ddaSAlexander von Gluck IV #       define RS600_ENABLE_FRAGMENT_PROCESSING (1 << 14)
227*5cf44ddaSAlexander von Gluck IV #       define RS600_EFFECTIVE_L1_QUEUE_SIZE(x) ((x) << 15)
228*5cf44ddaSAlexander von Gluck IV #       define RS600_INVALIDATE_L1_TLB          (1 << 20)
229*5cf44ddaSAlexander von Gluck IV /* rs600/rs690/rs740 */
230*5cf44ddaSAlexander von Gluck IV #	define RS600_BUS_MASTER_DIS		(1 << 14)
231*5cf44ddaSAlexander von Gluck IV #	define RS600_MSI_REARM		        (1 << 20)
232*5cf44ddaSAlexander von Gluck IV /* see RS400_MSI_REARM in AIC_CNTL for rs480 */
233*5cf44ddaSAlexander von Gluck IV 
234*5cf44ddaSAlexander von Gluck IV 
235*5cf44ddaSAlexander von Gluck IV 
236*5cf44ddaSAlexander von Gluck IV #define RV515_MC_FB_LOCATION		0x01
237*5cf44ddaSAlexander von Gluck IV #define		RV515_MC_FB_START_MASK		0x0000FFFF
238*5cf44ddaSAlexander von Gluck IV #define		RV515_MC_FB_START_SHIFT		0
239*5cf44ddaSAlexander von Gluck IV #define		RV515_MC_FB_TOP_MASK		0xFFFF0000
240*5cf44ddaSAlexander von Gluck IV #define		RV515_MC_FB_TOP_SHIFT		16
241*5cf44ddaSAlexander von Gluck IV #define RV515_MC_AGP_LOCATION		0x02
242*5cf44ddaSAlexander von Gluck IV #define		RV515_MC_AGP_START_MASK		0x0000FFFF
243*5cf44ddaSAlexander von Gluck IV #define		RV515_MC_AGP_START_SHIFT	0
244*5cf44ddaSAlexander von Gluck IV #define		RV515_MC_AGP_TOP_MASK		0xFFFF0000
245*5cf44ddaSAlexander von Gluck IV #define		RV515_MC_AGP_TOP_SHIFT		16
246*5cf44ddaSAlexander von Gluck IV #define RV515_MC_AGP_BASE		0x03
247*5cf44ddaSAlexander von Gluck IV #define RV515_MC_AGP_BASE_2		0x04
248*5cf44ddaSAlexander von Gluck IV 
249*5cf44ddaSAlexander von Gluck IV #define R520_MC_FB_LOCATION		0x04
250*5cf44ddaSAlexander von Gluck IV #define		R520_MC_FB_START_MASK		0x0000FFFF
251*5cf44ddaSAlexander von Gluck IV #define		R520_MC_FB_START_SHIFT		0
252*5cf44ddaSAlexander von Gluck IV #define		R520_MC_FB_TOP_MASK		0xFFFF0000
253*5cf44ddaSAlexander von Gluck IV #define		R520_MC_FB_TOP_SHIFT		16
254*5cf44ddaSAlexander von Gluck IV #define R520_MC_AGP_LOCATION		0x05
255*5cf44ddaSAlexander von Gluck IV #define		R520_MC_AGP_START_MASK		0x0000FFFF
256*5cf44ddaSAlexander von Gluck IV #define		R520_MC_AGP_START_SHIFT		0
257*5cf44ddaSAlexander von Gluck IV #define		R520_MC_AGP_TOP_MASK		0xFFFF0000
258*5cf44ddaSAlexander von Gluck IV #define		R520_MC_AGP_TOP_SHIFT		16
259*5cf44ddaSAlexander von Gluck IV #define R520_MC_AGP_BASE		0x06
260*5cf44ddaSAlexander von Gluck IV #define R520_MC_AGP_BASE_2		0x07
261*5cf44ddaSAlexander von Gluck IV 
262*5cf44ddaSAlexander von Gluck IV 
263*5cf44ddaSAlexander von Gluck IV #define AVIVO_MC_INDEX						0x0070
264*5cf44ddaSAlexander von Gluck IV #define R520_MC_STATUS 0x00
265*5cf44ddaSAlexander von Gluck IV #define R520_MC_STATUS_IDLE (1<<1)
266*5cf44ddaSAlexander von Gluck IV #define RV515_MC_STATUS 0x08
267*5cf44ddaSAlexander von Gluck IV #define RV515_MC_STATUS_IDLE (1<<4)
268*5cf44ddaSAlexander von Gluck IV #define RV515_MC_INIT_MISC_LAT_TIMER            0x09
269*5cf44ddaSAlexander von Gluck IV #define AVIVO_MC_DATA						0x0074
270*5cf44ddaSAlexander von Gluck IV 
271*5cf44ddaSAlexander von Gluck IV #define R520_MC_IND_INDEX 0x70
272*5cf44ddaSAlexander von Gluck IV #define R520_MC_IND_WR_EN (1 << 24)
273*5cf44ddaSAlexander von Gluck IV #define R520_MC_IND_DATA  0x74
274*5cf44ddaSAlexander von Gluck IV 
275*5cf44ddaSAlexander von Gluck IV #define RV515_MC_CNTL          0x5
276*5cf44ddaSAlexander von Gluck IV #	define RV515_MEM_NUM_CHANNELS_MASK  0x3
277*5cf44ddaSAlexander von Gluck IV #define R520_MC_CNTL0          0x8
278*5cf44ddaSAlexander von Gluck IV #	define R520_MEM_NUM_CHANNELS_MASK  (0x3 << 24)
279*5cf44ddaSAlexander von Gluck IV #	define R520_MEM_NUM_CHANNELS_SHIFT  24
280*5cf44ddaSAlexander von Gluck IV #	define R520_MC_CHANNEL_SIZE  (1 << 23)
281*5cf44ddaSAlexander von Gluck IV 
282*5cf44ddaSAlexander von Gluck IV #define AVIVO_CP_DYN_CNTL                              0x000f /* PLL */
283*5cf44ddaSAlexander von Gluck IV #       define AVIVO_CP_FORCEON                        (1 << 0)
284*5cf44ddaSAlexander von Gluck IV #define AVIVO_E2_DYN_CNTL                              0x0011 /* PLL */
285*5cf44ddaSAlexander von Gluck IV #       define AVIVO_E2_FORCEON                        (1 << 0)
286*5cf44ddaSAlexander von Gluck IV #define AVIVO_IDCT_DYN_CNTL                            0x0013 /* PLL */
287*5cf44ddaSAlexander von Gluck IV #       define AVIVO_IDCT_FORCEON                      (1 << 0)
288*5cf44ddaSAlexander von Gluck IV 
289*5cf44ddaSAlexander von Gluck IV #define AVIVO_HDP_FB_LOCATION 0x134
290*5cf44ddaSAlexander von Gluck IV 
291*5cf44ddaSAlexander von Gluck IV #define AVIVO_VGA_RENDER_CONTROL				0x0300
292*5cf44ddaSAlexander von Gluck IV #       define AVIVO_VGA_VSTATUS_CNTL_MASK                      (3 << 16)
293*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1VGA_CONTROL					0x0330
294*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DVGA_CONTROL_MODE_ENABLE (1<<0)
295*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DVGA_CONTROL_TIMING_SELECT (1<<8)
296*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DVGA_CONTROL_SYNC_POLARITY_SELECT (1<<9)
297*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DVGA_CONTROL_OVERSCAN_TIMING_SELECT (1<<10)
298*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DVGA_CONTROL_OVERSCAN_COLOR_EN (1<<16)
299*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DVGA_CONTROL_ROTATE (1<<24)
300*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2VGA_CONTROL					0x0338
301*5cf44ddaSAlexander von Gluck IV 
302*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT1_PPLL_REF_DIV_SRC                             0x400
303*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT1_PPLL_REF_DIV                                 0x404
304*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT1_PPLL_UPDATE_LOCK                             0x408
305*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT1_PPLL_UPDATE_CNTL                             0x40c
306*5cf44ddaSAlexander von Gluck IV 
307*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT2_PPLL_REF_DIV_SRC                             0x410
308*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT2_PPLL_REF_DIV                                 0x414
309*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT2_PPLL_UPDATE_LOCK                             0x418
310*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT2_PPLL_UPDATE_CNTL                             0x41c
311*5cf44ddaSAlexander von Gluck IV 
312*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT1_PPLL_FB_DIV                                   0x430
313*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT2_PPLL_FB_DIV                                   0x434
314*5cf44ddaSAlexander von Gluck IV 
315*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT1_PPLL_POST_DIV_SRC                                 0x438
316*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT1_PPLL_POST_DIV                                     0x43c
317*5cf44ddaSAlexander von Gluck IV 
318*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT2_PPLL_POST_DIV_SRC                                 0x440
319*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT2_PPLL_POST_DIV                                     0x444
320*5cf44ddaSAlexander von Gluck IV 
321*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT1_PPLL_CNTL                                    0x448
322*5cf44ddaSAlexander von Gluck IV #define AVIVO_EXT2_PPLL_CNTL                                    0x44c
323*5cf44ddaSAlexander von Gluck IV 
324*5cf44ddaSAlexander von Gluck IV #define AVIVO_P1PLL_CNTL                                        0x450
325*5cf44ddaSAlexander von Gluck IV #define AVIVO_P2PLL_CNTL                                        0x454
326*5cf44ddaSAlexander von Gluck IV #define AVIVO_P1PLL_INT_SS_CNTL                                 0x458
327*5cf44ddaSAlexander von Gluck IV #define AVIVO_P2PLL_INT_SS_CNTL                                 0x45c
328*5cf44ddaSAlexander von Gluck IV #define AVIVO_P1PLL_TMDSA_CNTL                                  0x460
329*5cf44ddaSAlexander von Gluck IV #define AVIVO_P2PLL_LVTMA_CNTL                                  0x464
330*5cf44ddaSAlexander von Gluck IV 
331*5cf44ddaSAlexander von Gluck IV #define AVIVO_PCLK_CRTC1_CNTL                                   0x480
332*5cf44ddaSAlexander von Gluck IV #define AVIVO_PCLK_CRTC2_CNTL                                   0x484
333*5cf44ddaSAlexander von Gluck IV 
334*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_H_TOTAL					0x6000
335*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_H_BLANK_START_END                          0x6004
336*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_H_SYNC_A                                   0x6008
337*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_H_SYNC_A_CNTL                              0x600c
338*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_H_SYNC_B                                   0x6010
339*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_H_SYNC_B_CNTL                              0x6014
340*5cf44ddaSAlexander von Gluck IV 
341*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_V_TOTAL					0x6020
342*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_V_BLANK_START_END                          0x6024
343*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_V_SYNC_A                                   0x6028
344*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_V_SYNC_A_CNTL                              0x602c
345*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_V_SYNC_B                                   0x6030
346*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_V_SYNC_B_CNTL                              0x6034
347*5cf44ddaSAlexander von Gluck IV 
348*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_CONTROL                                    0x6080
349*5cf44ddaSAlexander von Gluck IV #       define AVIVO_CRTC_EN                                    (1 << 0)
350*5cf44ddaSAlexander von Gluck IV #       define AVIVO_CRTC_DISP_READ_REQUEST_DISABLE             (1 << 24)
351*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_BLANK_CONTROL                              0x6084
352*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_INTERLACE_CONTROL                          0x6088
353*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_INTERLACE_STATUS                           0x608c
354*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_STATUS_POSITION                            0x60a0
355*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_FRAME_COUNT                                0x60a4
356*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CRTC_STEREO_CONTROL                             0x60c4
357*5cf44ddaSAlexander von Gluck IV 
358*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_MASTER_UPDATE_MODE                         0x60e4
359*5cf44ddaSAlexander von Gluck IV 
360*5cf44ddaSAlexander von Gluck IV /* master controls */
361*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_CRTC_MASTER_EN                                 0x60f8
362*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_CRTC_TV_CONTROL                                0x60fc
363*5cf44ddaSAlexander von Gluck IV 
364*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_ENABLE                                     0x6100
365*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_CONTROL                                    0x6104
366*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_DEPTH_8BPP                  (0 << 0)
367*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_DEPTH_16BPP                 (1 << 0)
368*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_DEPTH_32BPP                 (2 << 0)
369*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_DEPTH_64BPP                 (3 << 0)
370*5cf44ddaSAlexander von Gluck IV 
371*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_8BPP_INDEXED                (0 << 8)
372*5cf44ddaSAlexander von Gluck IV 
373*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555              (0 << 8)
374*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_16BPP_RGB565                (1 << 8)
375*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444              (2 << 8)
376*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_16BPP_AI88                  (3 << 8)
377*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_16BPP_MONO16                (4 << 8)
378*5cf44ddaSAlexander von Gluck IV 
379*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888              (0 << 8)
380*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010           (1 << 8)
381*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_32BPP_DIGITAL               (2 << 8)
382*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_32BPP_8B_ARGB2101010        (3 << 8)
383*5cf44ddaSAlexander von Gluck IV 
384*5cf44ddaSAlexander von Gluck IV 
385*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_CONTROL_64BPP_ARGB16161616          (0 << 8)
386*5cf44ddaSAlexander von Gluck IV 
387*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_SWAP_RB                             (1 << 16)
388*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_TILED                               (1 << 20)
389*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_MACRO_ADDRESS_MODE                  (1 << 21)
390*5cf44ddaSAlexander von Gluck IV 
391*5cf44ddaSAlexander von Gluck IV #       define R600_D1GRPH_ARRAY_MODE_LINEAR_GENERAL            (0 << 20)
392*5cf44ddaSAlexander von Gluck IV #       define R600_D1GRPH_ARRAY_MODE_LINEAR_ALIGNED            (1 << 20)
393*5cf44ddaSAlexander von Gluck IV #       define R600_D1GRPH_ARRAY_MODE_1D_TILED_THIN1            (2 << 20)
394*5cf44ddaSAlexander von Gluck IV #       define R600_D1GRPH_ARRAY_MODE_2D_TILED_THIN1            (4 << 20)
395*5cf44ddaSAlexander von Gluck IV 
396*5cf44ddaSAlexander von Gluck IV /* The R7xx *_HIGH surface regs are backwards; the D1 regs are in the D2
397*5cf44ddaSAlexander von Gluck IV  * block and vice versa.  This applies to GRPH, CUR, etc.
398*5cf44ddaSAlexander von Gluck IV  */
399*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_LUT_SEL                                    0x6108
400*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS                    0x6110
401*5cf44ddaSAlexander von Gluck IV #define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH                0x6914
402*5cf44ddaSAlexander von Gluck IV #define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH                0x6114
403*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS                  0x6118
404*5cf44ddaSAlexander von Gluck IV #define R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH              0x691c
405*5cf44ddaSAlexander von Gluck IV #define R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH              0x611c
406*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_PITCH                                      0x6120
407*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_SURFACE_OFFSET_X                           0x6124
408*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_SURFACE_OFFSET_Y                           0x6128
409*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_X_START                                    0x612c
410*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_Y_START                                    0x6130
411*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_X_END                                      0x6134
412*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_Y_END                                      0x6138
413*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_UPDATE                                     0x6144
414*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_SURFACE_UPDATE_PENDING              (1 << 2)
415*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_UPDATE_LOCK                         (1 << 16)
416*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1GRPH_FLIP_CONTROL                               0x6148
417*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN         (1 << 0)
418*5cf44ddaSAlexander von Gluck IV 
419*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CUR_CONTROL                     0x6400
420*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1CURSOR_EN                (1 << 0)
421*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1CURSOR_MODE_SHIFT        8
422*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1CURSOR_MODE_MASK         (3 << 8)
423*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1CURSOR_MODE_24BPP        2
424*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CUR_SURFACE_ADDRESS             0x6408
425*5cf44ddaSAlexander von Gluck IV #define R700_D1CUR_SURFACE_ADDRESS_HIGH         0x6c0c
426*5cf44ddaSAlexander von Gluck IV #define R700_D2CUR_SURFACE_ADDRESS_HIGH         0x640c
427*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CUR_SIZE                        0x6410
428*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CUR_POSITION                    0x6414
429*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CUR_HOT_SPOT                    0x6418
430*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1CUR_UPDATE                      0x6424
431*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1CURSOR_UPDATE_LOCK       (1 << 16)
432*5cf44ddaSAlexander von Gluck IV 
433*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUT_RW_SELECT                  0x6480
434*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUT_RW_MODE                    0x6484
435*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUT_RW_INDEX                   0x6488
436*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUT_SEQ_COLOR                  0x648c
437*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUT_PWL_DATA                   0x6490
438*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUT_30_COLOR                   0x6494
439*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUT_READ_PIPE_SELECT           0x6498
440*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUT_WRITE_EN_MASK              0x649c
441*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUT_AUTOFILL                   0x64a0
442*5cf44ddaSAlexander von Gluck IV 
443*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUTA_CONTROL                   0x64c0
444*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE         0x64c4
445*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN        0x64c8
446*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUTA_BLACK_OFFSET_RED          0x64cc
447*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE         0x64d0
448*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN        0x64d4
449*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LUTA_WHITE_OFFSET_RED          0x64d8
450*5cf44ddaSAlexander von Gluck IV 
451*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_LB_MEMORY_SPLIT                0x6520
452*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DC_LB_MEMORY_SPLIT_MASK    0x3
453*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT   0
454*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF  0
455*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q    1
456*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY        2
457*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q    3
458*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2)
459*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DC_LB_DISP1_END_ADR_SHIFT  4
460*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DC_LB_DISP1_END_ADR_MASK   0x7ff
461*5cf44ddaSAlexander von Gluck IV 
462*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_DATA_FORMAT                0x6528
463*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1MODE_INTERLEAVE_EN       (1 << 0)
464*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_DESKTOP_HEIGHT             0x652C
465*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_VBLANK_STATUS              0x6534
466*5cf44ddaSAlexander von Gluck IV #       define AVIVO_VBLANK_ACK                 (1 << 4)
467*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_VLINE_START_END            0x6538
468*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_VLINE_STATUS               0x653c
469*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1MODE_VLINE_STAT          (1 << 12)
470*5cf44ddaSAlexander von Gluck IV #define AVIVO_DxMODE_INT_MASK                   0x6540
471*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1MODE_INT_MASK            (1 << 0)
472*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D2MODE_INT_MASK            (1 << 8)
473*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_VIEWPORT_START             0x6580
474*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_VIEWPORT_SIZE              0x6584
475*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT    0x6588
476*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1MODE_EXT_OVERSCAN_TOP_BOTTOM    0x658c
477*5cf44ddaSAlexander von Gluck IV 
478*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1SCL_SCALER_ENABLE               0x6590
479*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1SCL_SCALER_TAP_CONTROL		0x6594
480*5cf44ddaSAlexander von Gluck IV #define AVIVO_D1SCL_UPDATE                      0x65cc
481*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1SCL_UPDATE_LOCK          (1 << 16)
482*5cf44ddaSAlexander von Gluck IV 
483*5cf44ddaSAlexander von Gluck IV /* second crtc */
484*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_H_TOTAL					0x6800
485*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_H_BLANK_START_END                          0x6804
486*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_H_SYNC_A                                   0x6808
487*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_H_SYNC_A_CNTL                              0x680c
488*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_H_SYNC_B                                   0x6810
489*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_H_SYNC_B_CNTL                              0x6814
490*5cf44ddaSAlexander von Gluck IV 
491*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_V_TOTAL					0x6820
492*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_V_BLANK_START_END                          0x6824
493*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_V_SYNC_A                                   0x6828
494*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_V_SYNC_A_CNTL                              0x682c
495*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_V_SYNC_B                                   0x6830
496*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_V_SYNC_B_CNTL                              0x6834
497*5cf44ddaSAlexander von Gluck IV 
498*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_CONTROL                                    0x6880
499*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_BLANK_CONTROL                              0x6884
500*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_INTERLACE_CONTROL                          0x6888
501*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_INTERLACE_STATUS                           0x688c
502*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_STATUS_POSITION                            0x68a0
503*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_FRAME_COUNT                                0x68a4
504*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CRTC_STEREO_CONTROL                             0x68c4
505*5cf44ddaSAlexander von Gluck IV 
506*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_ENABLE                                     0x6900
507*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_CONTROL                                    0x6904
508*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_LUT_SEL                                    0x6908
509*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_PRIMARY_SURFACE_ADDRESS                    0x6910
510*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_SECONDARY_SURFACE_ADDRESS                  0x6918
511*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_PITCH                                      0x6920
512*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_SURFACE_OFFSET_X                           0x6924
513*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_SURFACE_OFFSET_Y                           0x6928
514*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_X_START                                    0x692c
515*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_Y_START                                    0x6930
516*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_X_END                                      0x6934
517*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_Y_END                                      0x6938
518*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_UPDATE                                     0x6944
519*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2GRPH_FLIP_CONTROL                               0x6948
520*5cf44ddaSAlexander von Gluck IV 
521*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CUR_CONTROL                     0x6c00
522*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CUR_SURFACE_ADDRESS             0x6c08
523*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CUR_SIZE                        0x6c10
524*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2CUR_POSITION                    0x6c14
525*5cf44ddaSAlexander von Gluck IV 
526*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2MODE_VBLANK_STATUS              0x6d34
527*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2MODE_VLINE_START_END            0x6d38
528*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2MODE_VLINE_STATUS               0x6d3c
529*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2MODE_VIEWPORT_START             0x6d80
530*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2MODE_VIEWPORT_SIZE              0x6d84
531*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT    0x6d88
532*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2MODE_EXT_OVERSCAN_TOP_BOTTOM    0x6d8c
533*5cf44ddaSAlexander von Gluck IV 
534*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2SCL_SCALER_ENABLE               0x6d90
535*5cf44ddaSAlexander von Gluck IV #define AVIVO_D2SCL_SCALER_TAP_CONTROL		0x6d94
536*5cf44ddaSAlexander von Gluck IV 
537*5cf44ddaSAlexander von Gluck IV #define AVIVO_DDIA_BIT_DEPTH_CONTROL				0x7214
538*5cf44ddaSAlexander von Gluck IV 
539*5cf44ddaSAlexander von Gluck IV #define AVIVO_DACA_ENABLE					0x7800
540*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DAC_ENABLE				(1 << 0)
541*5cf44ddaSAlexander von Gluck IV #define AVIVO_DACA_SOURCE_SELECT				0x7804
542*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DAC_SOURCE_CRTC1                   (0 << 0)
543*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DAC_SOURCE_CRTC2                   (1 << 0)
544*5cf44ddaSAlexander von Gluck IV #       define AVIVO_DAC_SOURCE_TV                      (2 << 0)
545*5cf44ddaSAlexander von Gluck IV 
546*5cf44ddaSAlexander von Gluck IV #define AVIVO_DACA_FORCE_OUTPUT_CNTL				0x783c
547*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_FORCE_OUTPUT_CNTL_FORCE_DATA_EN             (1 << 0)
548*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT            (8)
549*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE             (1 << 0)
550*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN            (1 << 1)
551*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_RED              (1 << 2)
552*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY       (1 << 24)
553*5cf44ddaSAlexander von Gluck IV #define AVIVO_DACA_POWERDOWN					0x7850
554*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_POWERDOWN_POWERDOWN                         (1 << 0)
555*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_POWERDOWN_BLUE                              (1 << 8)
556*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_POWERDOWN_GREEN                             (1 << 16)
557*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACA_POWERDOWN_RED                               (1 << 24)
558*5cf44ddaSAlexander von Gluck IV 
559*5cf44ddaSAlexander von Gluck IV #define AVIVO_DACB_ENABLE					0x7a00
560*5cf44ddaSAlexander von Gluck IV #define AVIVO_DACB_SOURCE_SELECT				0x7a04
561*5cf44ddaSAlexander von Gluck IV #define AVIVO_DACB_FORCE_OUTPUT_CNTL				0x7a3c
562*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_FORCE_OUTPUT_CNTL_FORCE_DATA_EN             (1 << 0)
563*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT            (8)
564*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE             (1 << 0)
565*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN            (1 << 1)
566*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_RED              (1 << 2)
567*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY       (1 << 24)
568*5cf44ddaSAlexander von Gluck IV #define AVIVO_DACB_POWERDOWN					0x7a50
569*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_POWERDOWN_POWERDOWN                         (1 << 0)
570*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_POWERDOWN_BLUE                              (1 << 8)
571*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_POWERDOWN_GREEN                             (1 << 16)
572*5cf44ddaSAlexander von Gluck IV # define AVIVO_DACB_POWERDOWN_RED
573*5cf44ddaSAlexander von Gluck IV 
574*5cf44ddaSAlexander von Gluck IV #define AVIVO_TMDSA_CNTL                    0x7880
575*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_CNTL_ENABLE               (1 << 0)
576*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_CNTL_HPD_MASK             (1 << 4)
577*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_CNTL_HPD_SELECT           (1 << 8)
578*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_CNTL_SYNC_PHASE           (1 << 12)
579*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_CNTL_PIXEL_ENCODING       (1 << 16)
580*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_CNTL_DUAL_LINK_ENABLE     (1 << 24)
581*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_CNTL_SWAP                 (1 << 28)
582*5cf44ddaSAlexander von Gluck IV #define AVIVO_TMDSA_SOURCE_SELECT				0x7884
583*5cf44ddaSAlexander von Gluck IV /* 78a8 appears to be some kind of (reasonably tolerant) clock?
584*5cf44ddaSAlexander von Gluck IV  * 78d0 definitely hits the transmitter, definitely clock. */
585*5cf44ddaSAlexander von Gluck IV /* MYSTERY1 This appears to control dithering? */
586*5cf44ddaSAlexander von Gluck IV #define AVIVO_TMDSA_BIT_DEPTH_CONTROL		0x7894
587*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_EN           (1 << 0)
588*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH        (1 << 4)
589*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN     (1 << 8)
590*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH  (1 << 12)
591*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN    (1 << 16)
592*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20)
593*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL        (1 << 24)
594*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26)
595*5cf44ddaSAlexander von Gluck IV #define AVIVO_TMDSA_DCBALANCER_CONTROL                  0x78d0
596*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_DCBALANCER_CONTROL_EN                  (1 << 0)
597*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_EN             (1 << 8)
598*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_IN_SHIFT       (16)
599*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_DCBALANCER_CONTROL_FORCE               (1 << 24)
600*5cf44ddaSAlexander von Gluck IV #define AVIVO_TMDSA_DATA_SYNCHRONIZATION                0x78d8
601*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_DATA_SYNCHRONIZATION_DSYNSEL           (1 << 0)
602*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_DATA_SYNCHRONIZATION_PFREQCHG          (1 << 8)
603*5cf44ddaSAlexander von Gluck IV #define AVIVO_TMDSA_CLOCK_ENABLE            0x7900
604*5cf44ddaSAlexander von Gluck IV #define AVIVO_TMDSA_TRANSMITTER_ENABLE              0x7904
605*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX0_ENABLE          (1 << 0)
606*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKC0EN             (1 << 1)
607*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD00EN            (1 << 2)
608*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD01EN            (1 << 3)
609*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD02EN            (1 << 4)
610*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX1_ENABLE          (1 << 8)
611*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD10EN            (1 << 10)
612*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD11EN            (1 << 11)
613*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD12EN            (1 << 12)
614*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX_ENABLE_HPD_MASK  (1 << 16)
615*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK     (1 << 17)
616*5cf44ddaSAlexander von Gluck IV #   define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK     (1 << 18)
617*5cf44ddaSAlexander von Gluck IV 
618*5cf44ddaSAlexander von Gluck IV #define AVIVO_TMDSA_TRANSMITTER_CONTROL				0x7910
619*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_ENABLE	(1 << 0)
620*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_RESET	(1 << 1)
621*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT	(2)
622*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_IDSCKSEL	        (1 << 4)
623*5cf44ddaSAlexander von Gluck IV #       define AVIVO_TMDSA_TRANSMITTER_CONTROL_BGSLEEP          (1 << 5)
624*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN	(1 << 6)
625*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK	        (1 << 8)
626*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS	(1 << 13)
627*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK	        (1 << 14)
628*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS	(1 << 15)
629*5cf44ddaSAlexander von Gluck IV #       define AVIVO_TMDSA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16)
630*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_BYPASS_PLL	(1 << 28)
631*5cf44ddaSAlexander von Gluck IV #       define AVIVO_TMDSA_TRANSMITTER_CONTROL_USE_CLK_DATA     (1 << 29)
632*5cf44ddaSAlexander von Gluck IV #	define AVIVO_TMDSA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL	(1 << 31)
633*5cf44ddaSAlexander von Gluck IV 
634*5cf44ddaSAlexander von Gluck IV #define AVIVO_LVTMA_CNTL					0x7a80
635*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_CNTL_ENABLE               (1 << 0)
636*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_CNTL_HPD_MASK             (1 << 4)
637*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_CNTL_HPD_SELECT           (1 << 8)
638*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_CNTL_SYNC_PHASE           (1 << 12)
639*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_CNTL_PIXEL_ENCODING       (1 << 16)
640*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_CNTL_DUAL_LINK_ENABLE     (1 << 24)
641*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_CNTL_SWAP                 (1 << 28)
642*5cf44ddaSAlexander von Gluck IV #define AVIVO_LVTMA_SOURCE_SELECT                               0x7a84
643*5cf44ddaSAlexander von Gluck IV #define AVIVO_LVTMA_COLOR_FORMAT                                0x7a88
644*5cf44ddaSAlexander von Gluck IV #define AVIVO_LVTMA_BIT_DEPTH_CONTROL                           0x7a94
645*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_EN           (1 << 0)
646*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH        (1 << 4)
647*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN     (1 << 8)
648*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH  (1 << 12)
649*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN    (1 << 16)
650*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20)
651*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL        (1 << 24)
652*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26)
653*5cf44ddaSAlexander von Gluck IV 
654*5cf44ddaSAlexander von Gluck IV 
655*5cf44ddaSAlexander von Gluck IV 
656*5cf44ddaSAlexander von Gluck IV #define AVIVO_LVTMA_DCBALANCER_CONTROL                  0x7ad0
657*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_DCBALANCER_CONTROL_EN                  (1 << 0)
658*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_EN             (1 << 8)
659*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_IN_SHIFT       (16)
660*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_DCBALANCER_CONTROL_FORCE               (1 << 24)
661*5cf44ddaSAlexander von Gluck IV 
662*5cf44ddaSAlexander von Gluck IV #define AVIVO_LVTMA_DATA_SYNCHRONIZATION                0x78d8
663*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_DATA_SYNCHRONIZATION_DSYNSEL           (1 << 0)
664*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_DATA_SYNCHRONIZATION_PFREQCHG          (1 << 8)
665*5cf44ddaSAlexander von Gluck IV #define R500_LVTMA_CLOCK_ENABLE			0x7b00
666*5cf44ddaSAlexander von Gluck IV #define R600_LVTMA_CLOCK_ENABLE			0x7b04
667*5cf44ddaSAlexander von Gluck IV 
668*5cf44ddaSAlexander von Gluck IV #define R500_LVTMA_TRANSMITTER_ENABLE              0x7b04
669*5cf44ddaSAlexander von Gluck IV #define R600_LVTMA_TRANSMITTER_ENABLE              0x7b08
670*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC0EN             (1 << 1)
671*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD00EN            (1 << 2)
672*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD01EN            (1 << 3)
673*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD02EN            (1 << 4)
674*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD03EN            (1 << 5)
675*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC1EN             (1 << 9)
676*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD10EN            (1 << 10)
677*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD11EN            (1 << 11)
678*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD12EN            (1 << 12)
679*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK     (1 << 17)
680*5cf44ddaSAlexander von Gluck IV #   define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK     (1 << 18)
681*5cf44ddaSAlexander von Gluck IV 
682*5cf44ddaSAlexander von Gluck IV #define R500_LVTMA_TRANSMITTER_CONTROL			        0x7b10
683*5cf44ddaSAlexander von Gluck IV #define R600_LVTMA_TRANSMITTER_CONTROL			        0x7b14
684*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_ENABLE	  (1 << 0)
685*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_RESET	  (1 << 1)
686*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2)
687*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_IDSCKSEL	          (1 << 4)
688*5cf44ddaSAlexander von Gluck IV #       define AVIVO_LVTMA_TRANSMITTER_CONTROL_BGSLEEP            (1 << 5)
689*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN	  (1 << 6)
690*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK	          (1 << 8)
691*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS	  (1 << 13)
692*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK	          (1 << 14)
693*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS	  (1 << 15)
694*5cf44ddaSAlexander von Gluck IV #       define AVIVO_LVTMA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT  (16)
695*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_BYPASS_PLL	  (1 << 28)
696*5cf44ddaSAlexander von Gluck IV #       define AVIVO_LVTMA_TRANSMITTER_CONTROL_USE_CLK_DATA       (1 << 29)
697*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31)
698*5cf44ddaSAlexander von Gluck IV 
699*5cf44ddaSAlexander von Gluck IV #define R500_LVTMA_PWRSEQ_CNTL						0x7af0
700*5cf44ddaSAlexander von Gluck IV #define R600_LVTMA_PWRSEQ_CNTL						0x7af4
701*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_PWRSEQ_EN					    (1 << 0)
702*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_PWRSEQ_PLL_ENABLE_MASK			    (1 << 2)
703*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_PWRSEQ_PLL_RESET_MASK			    (1 << 3)
704*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_PWRSEQ_TARGET_STATE				    (1 << 4)
705*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_SYNCEN					    (1 << 8)
706*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_SYNCEN_OVRD					    (1 << 9)
707*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_SYNCEN_POL					    (1 << 10)
708*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_DIGON					    (1 << 16)
709*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_DIGON_OVRD					    (1 << 17)
710*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_DIGON_POL					    (1 << 18)
711*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_BLON						    (1 << 24)
712*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_BLON_OVRD					    (1 << 25)
713*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVTMA_BLON_POL					    (1 << 26)
714*5cf44ddaSAlexander von Gluck IV 
715*5cf44ddaSAlexander von Gluck IV #define R500_LVTMA_PWRSEQ_STATE                        0x7af4
716*5cf44ddaSAlexander von Gluck IV #define R600_LVTMA_PWRSEQ_STATE                        0x7af8
717*5cf44ddaSAlexander von Gluck IV #       define AVIVO_LVTMA_PWRSEQ_STATE_TARGET_STATE_R          (1 << 0)
718*5cf44ddaSAlexander von Gluck IV #       define AVIVO_LVTMA_PWRSEQ_STATE_DIGON                   (1 << 1)
719*5cf44ddaSAlexander von Gluck IV #       define AVIVO_LVTMA_PWRSEQ_STATE_SYNCEN                  (1 << 2)
720*5cf44ddaSAlexander von Gluck IV #       define AVIVO_LVTMA_PWRSEQ_STATE_BLON                    (1 << 3)
721*5cf44ddaSAlexander von Gluck IV #       define AVIVO_LVTMA_PWRSEQ_STATE_DONE                    (1 << 4)
722*5cf44ddaSAlexander von Gluck IV #       define AVIVO_LVTMA_PWRSEQ_STATE_STATUS_SHIFT            (8)
723*5cf44ddaSAlexander von Gluck IV 
724*5cf44ddaSAlexander von Gluck IV #define AVIVO_LVDS_BACKLIGHT_CNTL			0x7af8
725*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVDS_BACKLIGHT_CNTL_EN			(1 << 0)
726*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVDS_BACKLIGHT_LEVEL_MASK		0x0000ff00
727*5cf44ddaSAlexander von Gluck IV #	define AVIVO_LVDS_BACKLIGHT_LEVEL_SHIFT		8
728*5cf44ddaSAlexander von Gluck IV 
729*5cf44ddaSAlexander von Gluck IV #define AVIVO_DVOA_BIT_DEPTH_CONTROL			0x7988
730*5cf44ddaSAlexander von Gluck IV 
731*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_HPD_A                 0x7e94
732*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_HPD_Y                 0x7e9c
733*5cf44ddaSAlexander von Gluck IV 
734*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_I2C_STATUS1				0x7d30
735*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_DONE			(1 << 0)
736*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_NACK			(1 << 1)
737*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_HALT			(1 << 2)
738*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_GO			        (1 << 3)
739*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_I2C_RESET 				0x7d34
740*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_SOFT_RESET			(1 << 0)
741*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_ABORT			(1 << 8)
742*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_I2C_CONTROL1 				0x7d38
743*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_START			(1 << 0)
744*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_STOP			(1 << 1)
745*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_RECEIVE			(1 << 2)
746*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_EN			        (1 << 8)
747*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_PIN_SELECT(x)		((x) << 16)
748*5cf44ddaSAlexander von Gluck IV #	define AVIVO_SEL_DDC1			        0
749*5cf44ddaSAlexander von Gluck IV #	define AVIVO_SEL_DDC2			        1
750*5cf44ddaSAlexander von Gluck IV #	define AVIVO_SEL_DDC3			        2
751*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_I2C_CONTROL2 				0x7d3c
752*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_ADDR_COUNT(x)		((x) << 0)
753*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_DATA_COUNT(x)		((x) << 8)
754*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_I2C_CONTROL3 				0x7d40
755*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_DATA_DRIVE_EN		(1 << 0)
756*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_DATA_DRIVE_SEL		(1 << 1)
757*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_CLK_DRIVE_EN		(1 << 7)
758*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_RD_INTRA_BYTE_DELAY(x)      ((x) << 8)
759*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_WR_INTRA_BYTE_DELAY(x)	((x) << 16)
760*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_TIME_LIMIT(x)		((x) << 24)
761*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_I2C_DATA 				0x7d44
762*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_I2C_INTERRUPT_CONTROL 			0x7d48
763*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_INTERRUPT_STATUS		(1 << 0)
764*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_INTERRUPT_AK		(1 << 8)
765*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_INTERRUPT_ENABLE		(1 << 16)
766*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_I2C_ARBITRATION 			0x7d50
767*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_SW_WANTS_TO_USE_I2C		(1 << 0)
768*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_SW_CAN_USE_I2C		(1 << 1)
769*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_SW_DONE_USING_I2C		(1 << 8)
770*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_HW_NEEDS_I2C		(1 << 9)
771*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_ABORT_HDCP_I2C		(1 << 16)
772*5cf44ddaSAlexander von Gluck IV #	define AVIVO_DC_I2C_HW_USING_I2C		(1 << 17)
773*5cf44ddaSAlexander von Gluck IV 
774*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC1_MASK 		        0x7e40
775*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC1_A 		                0x7e44
776*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC1_EN 		                0x7e48
777*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC1_Y 		                0x7e4c
778*5cf44ddaSAlexander von Gluck IV 
779*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC2_MASK 		        0x7e50
780*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC2_A 		                0x7e54
781*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC2_EN 		                0x7e58
782*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC2_Y 		                0x7e5c
783*5cf44ddaSAlexander von Gluck IV 
784*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC3_MASK 		        0x7e60
785*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC3_A 		                0x7e64
786*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC3_EN 		                0x7e68
787*5cf44ddaSAlexander von Gluck IV #define AVIVO_DC_GPIO_DDC3_Y 		                0x7e6c
788*5cf44ddaSAlexander von Gluck IV 
789*5cf44ddaSAlexander von Gluck IV #define AVIVO_DISP_INTERRUPT_STATUS                             0x7edc
790*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D1_VBLANK_INTERRUPT                        (1 << 4)
791*5cf44ddaSAlexander von Gluck IV #       define AVIVO_D2_VBLANK_INTERRUPT                        (1 << 5)
792*5cf44ddaSAlexander von Gluck IV 
793*5cf44ddaSAlexander von Gluck IV #endif
794