blob: 2ba460b5b62f56dedd2b1c431b652b0c56b2d013 [file] [log] [blame]
Jerome Glisse3ce0a232009-09-08 10:10:24 +10001/*
2 * Copyright 2009 Advanced Micro Devices, Inc.
3 * Copyright 2009 Red Hat Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 *
23 * Authors: Dave Airlie
24 * Alex Deucher
25 * Jerome Glisse
26 */
27#ifndef R600D_H
28#define R600D_H
29
30#define CP_PACKET2 0x80000000
31#define PACKET2_PAD_SHIFT 0
32#define PACKET2_PAD_MASK (0x3fffffff << 0)
33
34#define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
35
36#define R6XX_MAX_SH_GPRS 256
37#define R6XX_MAX_TEMP_GPRS 16
38#define R6XX_MAX_SH_THREADS 256
39#define R6XX_MAX_SH_STACK_ENTRIES 4096
40#define R6XX_MAX_BACKENDS 8
41#define R6XX_MAX_BACKENDS_MASK 0xff
42#define R6XX_MAX_SIMDS 8
43#define R6XX_MAX_SIMDS_MASK 0xff
44#define R6XX_MAX_PIPES 8
45#define R6XX_MAX_PIPES_MASK 0xff
46
47/* PTE flags */
48#define PTE_VALID (1 << 0)
49#define PTE_SYSTEM (1 << 1)
50#define PTE_SNOOPED (1 << 2)
51#define PTE_READABLE (1 << 5)
52#define PTE_WRITEABLE (1 << 6)
53
Alex Deucher16790562010-11-14 20:24:35 -050054/* tiling bits */
55#define ARRAY_LINEAR_GENERAL 0x00000000
56#define ARRAY_LINEAR_ALIGNED 0x00000001
57#define ARRAY_1D_TILED_THIN1 0x00000002
58#define ARRAY_2D_TILED_THIN1 0x00000004
59
Jerome Glisse3ce0a232009-09-08 10:10:24 +100060/* Registers */
61#define ARB_POP 0x2418
62#define ENABLE_TC128 (1 << 30)
63#define ARB_GDEC_RD_CNTL 0x246C
64
65#define CC_GC_SHADER_PIPE_CONFIG 0x8950
66#define CC_RB_BACKEND_DISABLE 0x98F4
67#define BACKEND_DISABLE(x) ((x) << 16)
68
69#define CB_COLOR0_BASE 0x28040
70#define CB_COLOR1_BASE 0x28044
71#define CB_COLOR2_BASE 0x28048
72#define CB_COLOR3_BASE 0x2804C
73#define CB_COLOR4_BASE 0x28050
74#define CB_COLOR5_BASE 0x28054
75#define CB_COLOR6_BASE 0x28058
76#define CB_COLOR7_BASE 0x2805C
77#define CB_COLOR7_FRAG 0x280FC
78
79#define CB_COLOR0_SIZE 0x28060
80#define CB_COLOR0_VIEW 0x28080
Jerome Glisse285484e2011-12-16 17:03:42 -050081#define R_028080_CB_COLOR0_VIEW 0x028080
82#define S_028080_SLICE_START(x) (((x) & 0x7FF) << 0)
83#define G_028080_SLICE_START(x) (((x) >> 0) & 0x7FF)
84#define C_028080_SLICE_START 0xFFFFF800
85#define S_028080_SLICE_MAX(x) (((x) & 0x7FF) << 13)
86#define G_028080_SLICE_MAX(x) (((x) >> 13) & 0x7FF)
87#define C_028080_SLICE_MAX 0xFF001FFF
88#define R_028084_CB_COLOR1_VIEW 0x028084
89#define R_028088_CB_COLOR2_VIEW 0x028088
90#define R_02808C_CB_COLOR3_VIEW 0x02808C
91#define R_028090_CB_COLOR4_VIEW 0x028090
92#define R_028094_CB_COLOR5_VIEW 0x028094
93#define R_028098_CB_COLOR6_VIEW 0x028098
94#define R_02809C_CB_COLOR7_VIEW 0x02809C
Jerome Glisse3ce0a232009-09-08 10:10:24 +100095#define CB_COLOR0_INFO 0x280a0
Ilija Hadzic3a386122011-10-12 23:29:37 -040096# define CB_FORMAT(x) ((x) << 2)
97# define CB_ARRAY_MODE(x) ((x) << 8)
98# define CB_SOURCE_FORMAT(x) ((x) << 27)
99# define CB_SF_EXPORT_FULL 0
100# define CB_SF_EXPORT_NORM 1
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000101#define CB_COLOR0_TILE 0x280c0
102#define CB_COLOR0_FRAG 0x280e0
103#define CB_COLOR0_MASK 0x28100
104
Alex Deucher5f77df32010-03-26 14:52:32 -0400105#define SQ_ALU_CONST_CACHE_PS_0 0x28940
106#define SQ_ALU_CONST_CACHE_PS_1 0x28944
107#define SQ_ALU_CONST_CACHE_PS_2 0x28948
108#define SQ_ALU_CONST_CACHE_PS_3 0x2894c
109#define SQ_ALU_CONST_CACHE_PS_4 0x28950
110#define SQ_ALU_CONST_CACHE_PS_5 0x28954
111#define SQ_ALU_CONST_CACHE_PS_6 0x28958
112#define SQ_ALU_CONST_CACHE_PS_7 0x2895c
113#define SQ_ALU_CONST_CACHE_PS_8 0x28960
114#define SQ_ALU_CONST_CACHE_PS_9 0x28964
115#define SQ_ALU_CONST_CACHE_PS_10 0x28968
116#define SQ_ALU_CONST_CACHE_PS_11 0x2896c
117#define SQ_ALU_CONST_CACHE_PS_12 0x28970
118#define SQ_ALU_CONST_CACHE_PS_13 0x28974
119#define SQ_ALU_CONST_CACHE_PS_14 0x28978
120#define SQ_ALU_CONST_CACHE_PS_15 0x2897c
121#define SQ_ALU_CONST_CACHE_VS_0 0x28980
122#define SQ_ALU_CONST_CACHE_VS_1 0x28984
123#define SQ_ALU_CONST_CACHE_VS_2 0x28988
124#define SQ_ALU_CONST_CACHE_VS_3 0x2898c
125#define SQ_ALU_CONST_CACHE_VS_4 0x28990
126#define SQ_ALU_CONST_CACHE_VS_5 0x28994
127#define SQ_ALU_CONST_CACHE_VS_6 0x28998
128#define SQ_ALU_CONST_CACHE_VS_7 0x2899c
129#define SQ_ALU_CONST_CACHE_VS_8 0x289a0
130#define SQ_ALU_CONST_CACHE_VS_9 0x289a4
131#define SQ_ALU_CONST_CACHE_VS_10 0x289a8
132#define SQ_ALU_CONST_CACHE_VS_11 0x289ac
133#define SQ_ALU_CONST_CACHE_VS_12 0x289b0
134#define SQ_ALU_CONST_CACHE_VS_13 0x289b4
135#define SQ_ALU_CONST_CACHE_VS_14 0x289b8
136#define SQ_ALU_CONST_CACHE_VS_15 0x289bc
137#define SQ_ALU_CONST_CACHE_GS_0 0x289c0
138#define SQ_ALU_CONST_CACHE_GS_1 0x289c4
139#define SQ_ALU_CONST_CACHE_GS_2 0x289c8
140#define SQ_ALU_CONST_CACHE_GS_3 0x289cc
141#define SQ_ALU_CONST_CACHE_GS_4 0x289d0
142#define SQ_ALU_CONST_CACHE_GS_5 0x289d4
143#define SQ_ALU_CONST_CACHE_GS_6 0x289d8
144#define SQ_ALU_CONST_CACHE_GS_7 0x289dc
145#define SQ_ALU_CONST_CACHE_GS_8 0x289e0
146#define SQ_ALU_CONST_CACHE_GS_9 0x289e4
147#define SQ_ALU_CONST_CACHE_GS_10 0x289e8
148#define SQ_ALU_CONST_CACHE_GS_11 0x289ec
149#define SQ_ALU_CONST_CACHE_GS_12 0x289f0
150#define SQ_ALU_CONST_CACHE_GS_13 0x289f4
151#define SQ_ALU_CONST_CACHE_GS_14 0x289f8
152#define SQ_ALU_CONST_CACHE_GS_15 0x289fc
153
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000154#define CONFIG_MEMSIZE 0x5428
Dave Airlie28d52042009-09-21 14:33:58 +1000155#define CONFIG_CNTL 0x5424
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000156#define CP_STAT 0x8680
157#define CP_COHER_BASE 0x85F8
158#define CP_DEBUG 0xC1FC
159#define R_0086D8_CP_ME_CNTL 0x86D8
160#define S_0086D8_CP_ME_HALT(x) (((x) & 1)<<28)
161#define C_0086D8_CP_ME_HALT(x) ((x) & 0xEFFFFFFF)
162#define CP_ME_RAM_DATA 0xC160
163#define CP_ME_RAM_RADDR 0xC158
164#define CP_ME_RAM_WADDR 0xC15C
165#define CP_MEQ_THRESHOLDS 0x8764
166#define MEQ_END(x) ((x) << 16)
167#define ROQ_END(x) ((x) << 24)
168#define CP_PERFMON_CNTL 0x87FC
169#define CP_PFP_UCODE_ADDR 0xC150
170#define CP_PFP_UCODE_DATA 0xC154
171#define CP_QUEUE_THRESHOLDS 0x8760
172#define ROQ_IB1_START(x) ((x) << 0)
173#define ROQ_IB2_START(x) ((x) << 8)
174#define CP_RB_BASE 0xC100
175#define CP_RB_CNTL 0xC104
Cédric Cano4eace7f2011-02-11 19:45:38 -0500176#define RB_BUFSZ(x) ((x) << 0)
177#define RB_BLKSZ(x) ((x) << 8)
178#define RB_NO_UPDATE (1 << 27)
179#define RB_RPTR_WR_ENA (1 << 31)
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000180#define BUF_SWAP_32BIT (2 << 16)
181#define CP_RB_RPTR 0x8700
182#define CP_RB_RPTR_ADDR 0xC10C
Cédric Cano4eace7f2011-02-11 19:45:38 -0500183#define RB_RPTR_SWAP(x) ((x) << 0)
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000184#define CP_RB_RPTR_ADDR_HI 0xC110
185#define CP_RB_RPTR_WR 0xC108
186#define CP_RB_WPTR 0xC114
187#define CP_RB_WPTR_ADDR 0xC118
188#define CP_RB_WPTR_ADDR_HI 0xC11C
189#define CP_RB_WPTR_DELAY 0x8704
190#define CP_ROQ_IB1_STAT 0x8784
191#define CP_ROQ_IB2_STAT 0x8788
192#define CP_SEM_WAIT_TIMER 0x85BC
193
194#define DB_DEBUG 0x9830
195#define PREZ_MUST_WAIT_FOR_POSTZ_DONE (1 << 31)
196#define DB_DEPTH_BASE 0x2800C
Alex Deuchera39533b2009-11-09 16:41:21 -0500197#define DB_HTILE_DATA_BASE 0x28014
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000198#define DB_WATERMARKS 0x9838
199#define DEPTH_FREE(x) ((x) << 0)
200#define DEPTH_FLUSH(x) ((x) << 5)
201#define DEPTH_PENDING_FREE(x) ((x) << 15)
202#define DEPTH_CACHELINE_FREE(x) ((x) << 20)
203
204#define DCP_TILING_CONFIG 0x6CA0
205#define PIPE_TILING(x) ((x) << 1)
206#define BANK_TILING(x) ((x) << 4)
207#define GROUP_SIZE(x) ((x) << 6)
208#define ROW_TILING(x) ((x) << 8)
209#define BANK_SWAPS(x) ((x) << 11)
210#define SAMPLE_SPLIT(x) ((x) << 14)
211#define BACKEND_MAP(x) ((x) << 16)
212
213#define GB_TILING_CONFIG 0x98F0
214
215#define GC_USER_SHADER_PIPE_CONFIG 0x8954
216#define INACTIVE_QD_PIPES(x) ((x) << 8)
217#define INACTIVE_QD_PIPES_MASK 0x0000FF00
218#define INACTIVE_SIMDS(x) ((x) << 16)
219#define INACTIVE_SIMDS_MASK 0x00FF0000
220
221#define SQ_CONFIG 0x8c00
222# define VC_ENABLE (1 << 0)
223# define EXPORT_SRC_C (1 << 1)
224# define DX9_CONSTS (1 << 2)
225# define ALU_INST_PREFER_VECTOR (1 << 3)
226# define DX10_CLAMP (1 << 4)
227# define CLAUSE_SEQ_PRIO(x) ((x) << 8)
228# define PS_PRIO(x) ((x) << 24)
229# define VS_PRIO(x) ((x) << 26)
230# define GS_PRIO(x) ((x) << 28)
231# define ES_PRIO(x) ((x) << 30)
232#define SQ_GPR_RESOURCE_MGMT_1 0x8c04
233# define NUM_PS_GPRS(x) ((x) << 0)
234# define NUM_VS_GPRS(x) ((x) << 16)
235# define NUM_CLAUSE_TEMP_GPRS(x) ((x) << 28)
236#define SQ_GPR_RESOURCE_MGMT_2 0x8c08
237# define NUM_GS_GPRS(x) ((x) << 0)
238# define NUM_ES_GPRS(x) ((x) << 16)
239#define SQ_THREAD_RESOURCE_MGMT 0x8c0c
240# define NUM_PS_THREADS(x) ((x) << 0)
241# define NUM_VS_THREADS(x) ((x) << 8)
242# define NUM_GS_THREADS(x) ((x) << 16)
243# define NUM_ES_THREADS(x) ((x) << 24)
244#define SQ_STACK_RESOURCE_MGMT_1 0x8c10
245# define NUM_PS_STACK_ENTRIES(x) ((x) << 0)
246# define NUM_VS_STACK_ENTRIES(x) ((x) << 16)
247#define SQ_STACK_RESOURCE_MGMT_2 0x8c14
248# define NUM_GS_STACK_ENTRIES(x) ((x) << 0)
249# define NUM_ES_STACK_ENTRIES(x) ((x) << 16)
Alex Deuchera39533b2009-11-09 16:41:21 -0500250#define SQ_ESGS_RING_BASE 0x8c40
251#define SQ_GSVS_RING_BASE 0x8c48
252#define SQ_ESTMP_RING_BASE 0x8c50
253#define SQ_GSTMP_RING_BASE 0x8c58
254#define SQ_VSTMP_RING_BASE 0x8c60
255#define SQ_PSTMP_RING_BASE 0x8c68
256#define SQ_FBUF_RING_BASE 0x8c70
257#define SQ_REDUC_RING_BASE 0x8c78
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000258
259#define GRBM_CNTL 0x8000
260# define GRBM_READ_TIMEOUT(x) ((x) << 0)
261#define GRBM_STATUS 0x8010
262#define CMDFIFO_AVAIL_MASK 0x0000001F
263#define GUI_ACTIVE (1<<31)
264#define GRBM_STATUS2 0x8014
265#define GRBM_SOFT_RESET 0x8020
266#define SOFT_RESET_CP (1<<0)
267
Alex Deucher21a81222010-07-02 12:58:16 -0400268#define CG_THERMAL_STATUS 0x7F4
269#define ASIC_T(x) ((x) << 0)
270#define ASIC_T_MASK 0x1FF
271#define ASIC_T_SHIFT 0
272
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000273#define HDP_HOST_PATH_CNTL 0x2C00
274#define HDP_NONSURFACE_BASE 0x2C04
275#define HDP_NONSURFACE_INFO 0x2C08
276#define HDP_NONSURFACE_SIZE 0x2C0C
277#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0
278#define HDP_TILING_CONFIG 0x2F3C
Alex Deucher812d0462010-07-26 18:51:53 -0400279#define HDP_DEBUG1 0x2F34
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000280
281#define MC_VM_AGP_TOP 0x2184
282#define MC_VM_AGP_BOT 0x2188
283#define MC_VM_AGP_BASE 0x218C
284#define MC_VM_FB_LOCATION 0x2180
285#define MC_VM_L1_TLB_MCD_RD_A_CNTL 0x219C
286#define ENABLE_L1_TLB (1 << 0)
287#define ENABLE_L1_FRAGMENT_PROCESSING (1 << 1)
288#define ENABLE_L1_STRICT_ORDERING (1 << 2)
289#define SYSTEM_ACCESS_MODE_MASK 0x000000C0
290#define SYSTEM_ACCESS_MODE_SHIFT 6
291#define SYSTEM_ACCESS_MODE_PA_ONLY (0 << 6)
292#define SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 6)
293#define SYSTEM_ACCESS_MODE_IN_SYS (2 << 6)
294#define SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 6)
295#define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 8)
296#define SYSTEM_APERTURE_UNMAPPED_ACCESS_DEFAULT_PAGE (1 << 8)
297#define ENABLE_SEMAPHORE_MODE (1 << 10)
298#define ENABLE_WAIT_L2_QUERY (1 << 11)
299#define EFFECTIVE_L1_TLB_SIZE(x) (((x) & 7) << 12)
300#define EFFECTIVE_L1_TLB_SIZE_MASK 0x00007000
301#define EFFECTIVE_L1_TLB_SIZE_SHIFT 12
302#define EFFECTIVE_L1_QUEUE_SIZE(x) (((x) & 7) << 15)
303#define EFFECTIVE_L1_QUEUE_SIZE_MASK 0x00038000
304#define EFFECTIVE_L1_QUEUE_SIZE_SHIFT 15
305#define MC_VM_L1_TLB_MCD_RD_B_CNTL 0x21A0
306#define MC_VM_L1_TLB_MCB_RD_GFX_CNTL 0x21FC
307#define MC_VM_L1_TLB_MCB_RD_HDP_CNTL 0x2204
308#define MC_VM_L1_TLB_MCB_RD_PDMA_CNTL 0x2208
309#define MC_VM_L1_TLB_MCB_RD_SEM_CNTL 0x220C
310#define MC_VM_L1_TLB_MCB_RD_SYS_CNTL 0x2200
311#define MC_VM_L1_TLB_MCD_WR_A_CNTL 0x21A4
312#define MC_VM_L1_TLB_MCD_WR_B_CNTL 0x21A8
313#define MC_VM_L1_TLB_MCB_WR_GFX_CNTL 0x2210
314#define MC_VM_L1_TLB_MCB_WR_HDP_CNTL 0x2218
315#define MC_VM_L1_TLB_MCB_WR_PDMA_CNTL 0x221C
316#define MC_VM_L1_TLB_MCB_WR_SEM_CNTL 0x2220
317#define MC_VM_L1_TLB_MCB_WR_SYS_CNTL 0x2214
318#define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2190
319#define LOGICAL_PAGE_NUMBER_MASK 0x000FFFFF
320#define LOGICAL_PAGE_NUMBER_SHIFT 0
321#define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2194
322#define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x2198
323
324#define PA_CL_ENHANCE 0x8A14
325#define CLIP_VTX_REORDER_ENA (1 << 0)
326#define NUM_CLIP_SEQ(x) ((x) << 1)
327#define PA_SC_AA_CONFIG 0x28C04
328#define PA_SC_AA_SAMPLE_LOCS_2S 0x8B40
329#define PA_SC_AA_SAMPLE_LOCS_4S 0x8B44
330#define PA_SC_AA_SAMPLE_LOCS_8S_WD0 0x8B48
331#define PA_SC_AA_SAMPLE_LOCS_8S_WD1 0x8B4C
332#define S0_X(x) ((x) << 0)
333#define S0_Y(x) ((x) << 4)
334#define S1_X(x) ((x) << 8)
335#define S1_Y(x) ((x) << 12)
336#define S2_X(x) ((x) << 16)
337#define S2_Y(x) ((x) << 20)
338#define S3_X(x) ((x) << 24)
339#define S3_Y(x) ((x) << 28)
340#define S4_X(x) ((x) << 0)
341#define S4_Y(x) ((x) << 4)
342#define S5_X(x) ((x) << 8)
343#define S5_Y(x) ((x) << 12)
344#define S6_X(x) ((x) << 16)
345#define S6_Y(x) ((x) << 20)
346#define S7_X(x) ((x) << 24)
347#define S7_Y(x) ((x) << 28)
348#define PA_SC_CLIPRECT_RULE 0x2820c
349#define PA_SC_ENHANCE 0x8BF0
350#define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0)
351#define FORCE_EOV_MAX_TILE_CNT(x) ((x) << 12)
352#define PA_SC_LINE_STIPPLE 0x28A0C
353#define PA_SC_LINE_STIPPLE_STATE 0x8B10
354#define PA_SC_MODE_CNTL 0x28A4C
355#define PA_SC_MULTI_CHIP_CNTL 0x8B20
356
357#define PA_SC_SCREEN_SCISSOR_TL 0x28030
358#define PA_SC_GENERIC_SCISSOR_TL 0x28240
359#define PA_SC_WINDOW_SCISSOR_TL 0x28204
360
361#define PCIE_PORT_INDEX 0x0038
362#define PCIE_PORT_DATA 0x003C
363
Alex Deucher5885b7a2009-10-19 17:23:33 -0400364#define CHMAP 0x2004
365#define NOOFCHAN_SHIFT 12
366#define NOOFCHAN_MASK 0x00003000
367
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000368#define RAMCFG 0x2408
369#define NOOFBANK_SHIFT 0
370#define NOOFBANK_MASK 0x00000001
371#define NOOFRANK_SHIFT 1
372#define NOOFRANK_MASK 0x00000002
373#define NOOFROWS_SHIFT 2
374#define NOOFROWS_MASK 0x0000001C
375#define NOOFCOLS_SHIFT 5
376#define NOOFCOLS_MASK 0x00000060
377#define CHANSIZE_SHIFT 7
378#define CHANSIZE_MASK 0x00000080
379#define BURSTLENGTH_SHIFT 8
380#define BURSTLENGTH_MASK 0x00000100
381#define CHANSIZE_OVERRIDE (1 << 10)
382
383#define SCRATCH_REG0 0x8500
384#define SCRATCH_REG1 0x8504
385#define SCRATCH_REG2 0x8508
386#define SCRATCH_REG3 0x850C
387#define SCRATCH_REG4 0x8510
388#define SCRATCH_REG5 0x8514
389#define SCRATCH_REG6 0x8518
390#define SCRATCH_REG7 0x851C
391#define SCRATCH_UMSK 0x8540
392#define SCRATCH_ADDR 0x8544
393
394#define SPI_CONFIG_CNTL 0x9100
395#define GPR_WRITE_PRIORITY(x) ((x) << 0)
396#define DISABLE_INTERP_1 (1 << 5)
397#define SPI_CONFIG_CNTL_1 0x913C
398#define VTX_DONE_DELAY(x) ((x) << 0)
399#define INTERP_ONE_PRIM_PER_ROW (1 << 4)
400#define SPI_INPUT_Z 0x286D8
401#define SPI_PS_IN_CONTROL_0 0x286CC
402#define NUM_INTERP(x) ((x)<<0)
403#define POSITION_ENA (1<<8)
404#define POSITION_CENTROID (1<<9)
405#define POSITION_ADDR(x) ((x)<<10)
406#define PARAM_GEN(x) ((x)<<15)
407#define PARAM_GEN_ADDR(x) ((x)<<19)
408#define BARYC_SAMPLE_CNTL(x) ((x)<<26)
409#define PERSP_GRADIENT_ENA (1<<28)
410#define LINEAR_GRADIENT_ENA (1<<29)
411#define POSITION_SAMPLE (1<<30)
412#define BARYC_AT_SAMPLE_ENA (1<<31)
413#define SPI_PS_IN_CONTROL_1 0x286D0
414#define GEN_INDEX_PIX (1<<0)
415#define GEN_INDEX_PIX_ADDR(x) ((x)<<1)
416#define FRONT_FACE_ENA (1<<8)
417#define FRONT_FACE_CHAN(x) ((x)<<9)
418#define FRONT_FACE_ALL_BITS (1<<11)
419#define FRONT_FACE_ADDR(x) ((x)<<12)
420#define FOG_ADDR(x) ((x)<<17)
421#define FIXED_PT_POSITION_ENA (1<<24)
422#define FIXED_PT_POSITION_ADDR(x) ((x)<<25)
423
424#define SQ_MS_FIFO_SIZES 0x8CF0
425#define CACHE_FIFO_SIZE(x) ((x) << 0)
426#define FETCH_FIFO_HIWATER(x) ((x) << 8)
427#define DONE_FIFO_HIWATER(x) ((x) << 16)
428#define ALU_UPDATE_FIFO_HIWATER(x) ((x) << 24)
429#define SQ_PGM_START_ES 0x28880
430#define SQ_PGM_START_FS 0x28894
431#define SQ_PGM_START_GS 0x2886C
432#define SQ_PGM_START_PS 0x28840
433#define SQ_PGM_RESOURCES_PS 0x28850
434#define SQ_PGM_EXPORTS_PS 0x28854
435#define SQ_PGM_CF_OFFSET_PS 0x288cc
436#define SQ_PGM_START_VS 0x28858
437#define SQ_PGM_RESOURCES_VS 0x28868
438#define SQ_PGM_CF_OFFSET_VS 0x288d0
Ilija Hadzic3a386122011-10-12 23:29:37 -0400439
440#define SQ_VTX_CONSTANT_WORD0_0 0x30000
441#define SQ_VTX_CONSTANT_WORD1_0 0x30004
442#define SQ_VTX_CONSTANT_WORD2_0 0x30008
443# define SQ_VTXC_BASE_ADDR_HI(x) ((x) << 0)
444# define SQ_VTXC_STRIDE(x) ((x) << 8)
445# define SQ_VTXC_ENDIAN_SWAP(x) ((x) << 30)
446# define SQ_ENDIAN_NONE 0
447# define SQ_ENDIAN_8IN16 1
448# define SQ_ENDIAN_8IN32 2
449#define SQ_VTX_CONSTANT_WORD3_0 0x3000c
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000450#define SQ_VTX_CONSTANT_WORD6_0 0x38018
451#define S__SQ_VTX_CONSTANT_TYPE(x) (((x) & 3) << 30)
452#define G__SQ_VTX_CONSTANT_TYPE(x) (((x) >> 30) & 3)
453#define SQ_TEX_VTX_INVALID_TEXTURE 0x0
454#define SQ_TEX_VTX_INVALID_BUFFER 0x1
455#define SQ_TEX_VTX_VALID_TEXTURE 0x2
456#define SQ_TEX_VTX_VALID_BUFFER 0x3
457
458
459#define SX_MISC 0x28350
Alex Deuchera39533b2009-11-09 16:41:21 -0500460#define SX_MEMORY_EXPORT_BASE 0x9010
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000461#define SX_DEBUG_1 0x9054
462#define SMX_EVENT_RELEASE (1 << 0)
463#define ENABLE_NEW_SMX_ADDRESS (1 << 16)
464
465#define TA_CNTL_AUX 0x9508
466#define DISABLE_CUBE_WRAP (1 << 0)
467#define DISABLE_CUBE_ANISO (1 << 1)
468#define SYNC_GRADIENT (1 << 24)
469#define SYNC_WALKER (1 << 25)
470#define SYNC_ALIGNER (1 << 26)
471#define BILINEAR_PRECISION_6_BIT (0 << 31)
472#define BILINEAR_PRECISION_8_BIT (1 << 31)
473
474#define TC_CNTL 0x9608
475#define TC_L2_SIZE(x) ((x)<<5)
476#define L2_DISABLE_LATE_HIT (1<<9)
477
478
479#define VGT_CACHE_INVALIDATION 0x88C4
480#define CACHE_INVALIDATION(x) ((x)<<0)
481#define VC_ONLY 0
482#define TC_ONLY 1
483#define VC_AND_TC 2
484#define VGT_DMA_BASE 0x287E8
485#define VGT_DMA_BASE_HI 0x287E4
486#define VGT_ES_PER_GS 0x88CC
487#define VGT_GS_PER_ES 0x88C8
488#define VGT_GS_PER_VS 0x88E8
489#define VGT_GS_VERTEX_REUSE 0x88D4
490#define VGT_PRIMITIVE_TYPE 0x8958
491#define VGT_NUM_INSTANCES 0x8974
492#define VGT_OUT_DEALLOC_CNTL 0x28C5C
493#define DEALLOC_DIST_MASK 0x0000007F
494#define VGT_STRMOUT_BASE_OFFSET_0 0x28B10
495#define VGT_STRMOUT_BASE_OFFSET_1 0x28B14
496#define VGT_STRMOUT_BASE_OFFSET_2 0x28B18
497#define VGT_STRMOUT_BASE_OFFSET_3 0x28B1c
498#define VGT_STRMOUT_BASE_OFFSET_HI_0 0x28B44
499#define VGT_STRMOUT_BASE_OFFSET_HI_1 0x28B48
500#define VGT_STRMOUT_BASE_OFFSET_HI_2 0x28B4c
501#define VGT_STRMOUT_BASE_OFFSET_HI_3 0x28B50
502#define VGT_STRMOUT_BUFFER_BASE_0 0x28AD8
503#define VGT_STRMOUT_BUFFER_BASE_1 0x28AE8
504#define VGT_STRMOUT_BUFFER_BASE_2 0x28AF8
505#define VGT_STRMOUT_BUFFER_BASE_3 0x28B08
506#define VGT_STRMOUT_BUFFER_OFFSET_0 0x28ADC
507#define VGT_STRMOUT_BUFFER_OFFSET_1 0x28AEC
508#define VGT_STRMOUT_BUFFER_OFFSET_2 0x28AFC
509#define VGT_STRMOUT_BUFFER_OFFSET_3 0x28B0C
Marek Olšákdd220a02012-01-27 12:17:59 -0500510#define VGT_STRMOUT_BUFFER_SIZE_0 0x28AD0
511#define VGT_STRMOUT_BUFFER_SIZE_1 0x28AE0
512#define VGT_STRMOUT_BUFFER_SIZE_2 0x28AF0
513#define VGT_STRMOUT_BUFFER_SIZE_3 0x28B00
514
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000515#define VGT_STRMOUT_EN 0x28AB0
516#define VGT_VERTEX_REUSE_BLOCK_CNTL 0x28C58
517#define VTX_REUSE_DEPTH_MASK 0x000000FF
518#define VGT_EVENT_INITIATOR 0x28a90
Alex Deucherd0f8a852010-09-04 05:04:34 -0400519# define CACHE_FLUSH_AND_INV_EVENT_TS (0x14 << 0)
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000520# define CACHE_FLUSH_AND_INV_EVENT (0x16 << 0)
521
522#define VM_CONTEXT0_CNTL 0x1410
523#define ENABLE_CONTEXT (1 << 0)
524#define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1)
525#define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4)
526#define VM_CONTEXT0_INVALIDATION_LOW_ADDR 0x1490
527#define VM_CONTEXT0_INVALIDATION_HIGH_ADDR 0x14B0
528#define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x1574
529#define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x1594
530#define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x15B4
531#define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1554
532#define VM_CONTEXT0_REQUEST_RESPONSE 0x1470
533#define REQUEST_TYPE(x) (((x) & 0xf) << 0)
534#define RESPONSE_TYPE_MASK 0x000000F0
535#define RESPONSE_TYPE_SHIFT 4
536#define VM_L2_CNTL 0x1400
537#define ENABLE_L2_CACHE (1 << 0)
538#define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1)
539#define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9)
540#define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 13)
541#define VM_L2_CNTL2 0x1404
542#define INVALIDATE_ALL_L1_TLBS (1 << 0)
543#define INVALIDATE_L2_CACHE (1 << 1)
544#define VM_L2_CNTL3 0x1408
545#define BANK_SELECT_0(x) (((x) & 0x1f) << 0)
546#define BANK_SELECT_1(x) (((x) & 0x1f) << 5)
547#define L2_CACHE_UPDATE_MODE(x) (((x) & 3) << 10)
548#define VM_L2_STATUS 0x140C
549#define L2_BUSY (1 << 0)
550
551#define WAIT_UNTIL 0x8040
552#define WAIT_2D_IDLE_bit (1 << 14)
553#define WAIT_3D_IDLE_bit (1 << 15)
554#define WAIT_2D_IDLECLEAN_bit (1 << 16)
555#define WAIT_3D_IDLECLEAN_bit (1 << 17)
556
Alex Deucherd8f60cf2009-12-01 13:43:46 -0500557#define IH_RB_CNTL 0x3e00
558# define IH_RB_ENABLE (1 << 0)
559# define IH_IB_SIZE(x) ((x) << 1) /* log2 */
560# define IH_RB_FULL_DRAIN_ENABLE (1 << 6)
561# define IH_WPTR_WRITEBACK_ENABLE (1 << 8)
562# define IH_WPTR_WRITEBACK_TIMER(x) ((x) << 9) /* log2 */
563# define IH_WPTR_OVERFLOW_ENABLE (1 << 16)
564# define IH_WPTR_OVERFLOW_CLEAR (1 << 31)
565#define IH_RB_BASE 0x3e04
566#define IH_RB_RPTR 0x3e08
567#define IH_RB_WPTR 0x3e0c
568# define RB_OVERFLOW (1 << 0)
569# define WPTR_OFFSET_MASK 0x3fffc
570#define IH_RB_WPTR_ADDR_HI 0x3e10
571#define IH_RB_WPTR_ADDR_LO 0x3e14
572#define IH_CNTL 0x3e18
573# define ENABLE_INTR (1 << 0)
Alex Deucherfcb857a2011-07-06 19:52:27 +0000574# define IH_MC_SWAP(x) ((x) << 1)
Alex Deucherd8f60cf2009-12-01 13:43:46 -0500575# define IH_MC_SWAP_NONE 0
576# define IH_MC_SWAP_16BIT 1
577# define IH_MC_SWAP_32BIT 2
578# define IH_MC_SWAP_64BIT 3
579# define RPTR_REARM (1 << 4)
580# define MC_WRREQ_CREDIT(x) ((x) << 15)
581# define MC_WR_CLEAN_CNT(x) ((x) << 20)
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000582
Alex Deucherd8f60cf2009-12-01 13:43:46 -0500583#define RLC_CNTL 0x3f00
584# define RLC_ENABLE (1 << 0)
585#define RLC_HB_BASE 0x3f10
586#define RLC_HB_CNTL 0x3f0c
587#define RLC_HB_RPTR 0x3f20
588#define RLC_HB_WPTR 0x3f1c
589#define RLC_HB_WPTR_LSB_ADDR 0x3f14
590#define RLC_HB_WPTR_MSB_ADDR 0x3f18
591#define RLC_MC_CNTL 0x3f44
592#define RLC_UCODE_CNTL 0x3f48
593#define RLC_UCODE_ADDR 0x3f2c
594#define RLC_UCODE_DATA 0x3f30
595
596#define SRBM_SOFT_RESET 0xe60
597# define SOFT_RESET_RLC (1 << 13)
598
599#define CP_INT_CNTL 0xc124
600# define CNTX_BUSY_INT_ENABLE (1 << 19)
601# define CNTX_EMPTY_INT_ENABLE (1 << 20)
602# define SCRATCH_INT_ENABLE (1 << 25)
603# define TIME_STAMP_INT_ENABLE (1 << 26)
604# define IB2_INT_ENABLE (1 << 29)
605# define IB1_INT_ENABLE (1 << 30)
606# define RB_INT_ENABLE (1 << 31)
607#define CP_INT_STATUS 0xc128
608# define SCRATCH_INT_STAT (1 << 25)
609# define TIME_STAMP_INT_STAT (1 << 26)
610# define IB2_INT_STAT (1 << 29)
611# define IB1_INT_STAT (1 << 30)
612# define RB_INT_STAT (1 << 31)
613
614#define GRBM_INT_CNTL 0x8060
615# define RDERR_INT_ENABLE (1 << 0)
616# define WAIT_COUNT_TIMEOUT_INT_ENABLE (1 << 1)
617# define GUI_IDLE_INT_ENABLE (1 << 19)
618
619#define INTERRUPT_CNTL 0x5468
620# define IH_DUMMY_RD_OVERRIDE (1 << 0)
621# define IH_DUMMY_RD_EN (1 << 1)
622# define IH_REQ_NONSNOOP_EN (1 << 3)
623# define GEN_IH_INT_EN (1 << 8)
624#define INTERRUPT_CNTL2 0x546c
625
626#define D1MODE_VBLANK_STATUS 0x6534
627#define D2MODE_VBLANK_STATUS 0x6d34
628# define DxMODE_VBLANK_OCCURRED (1 << 0)
629# define DxMODE_VBLANK_ACK (1 << 4)
630# define DxMODE_VBLANK_STAT (1 << 12)
631# define DxMODE_VBLANK_INTERRUPT (1 << 16)
632# define DxMODE_VBLANK_INTERRUPT_TYPE (1 << 17)
633#define D1MODE_VLINE_STATUS 0x653c
634#define D2MODE_VLINE_STATUS 0x6d3c
635# define DxMODE_VLINE_OCCURRED (1 << 0)
636# define DxMODE_VLINE_ACK (1 << 4)
637# define DxMODE_VLINE_STAT (1 << 12)
638# define DxMODE_VLINE_INTERRUPT (1 << 16)
639# define DxMODE_VLINE_INTERRUPT_TYPE (1 << 17)
640#define DxMODE_INT_MASK 0x6540
641# define D1MODE_VBLANK_INT_MASK (1 << 0)
642# define D1MODE_VLINE_INT_MASK (1 << 4)
643# define D2MODE_VBLANK_INT_MASK (1 << 8)
644# define D2MODE_VLINE_INT_MASK (1 << 12)
645#define DCE3_DISP_INTERRUPT_STATUS 0x7ddc
646# define DC_HPD1_INTERRUPT (1 << 18)
647# define DC_HPD2_INTERRUPT (1 << 19)
648#define DISP_INTERRUPT_STATUS 0x7edc
649# define LB_D1_VLINE_INTERRUPT (1 << 2)
650# define LB_D2_VLINE_INTERRUPT (1 << 3)
651# define LB_D1_VBLANK_INTERRUPT (1 << 4)
652# define LB_D2_VBLANK_INTERRUPT (1 << 5)
653# define DACA_AUTODETECT_INTERRUPT (1 << 16)
654# define DACB_AUTODETECT_INTERRUPT (1 << 17)
655# define DC_HOT_PLUG_DETECT1_INTERRUPT (1 << 18)
656# define DC_HOT_PLUG_DETECT2_INTERRUPT (1 << 19)
657# define DC_I2C_SW_DONE_INTERRUPT (1 << 20)
658# define DC_I2C_HW_DONE_INTERRUPT (1 << 21)
Alex Deucherb500f682009-12-03 13:08:53 -0500659#define DISP_INTERRUPT_STATUS_CONTINUE 0x7ee8
Alex Deucherd8f60cf2009-12-01 13:43:46 -0500660#define DCE3_DISP_INTERRUPT_STATUS_CONTINUE 0x7de8
661# define DC_HPD4_INTERRUPT (1 << 14)
662# define DC_HPD4_RX_INTERRUPT (1 << 15)
663# define DC_HPD3_INTERRUPT (1 << 28)
664# define DC_HPD1_RX_INTERRUPT (1 << 29)
665# define DC_HPD2_RX_INTERRUPT (1 << 30)
666#define DCE3_DISP_INTERRUPT_STATUS_CONTINUE2 0x7dec
667# define DC_HPD3_RX_INTERRUPT (1 << 0)
668# define DIGA_DP_VID_STREAM_DISABLE_INTERRUPT (1 << 1)
669# define DIGA_DP_STEER_FIFO_OVERFLOW_INTERRUPT (1 << 2)
670# define DIGB_DP_VID_STREAM_DISABLE_INTERRUPT (1 << 3)
671# define DIGB_DP_STEER_FIFO_OVERFLOW_INTERRUPT (1 << 4)
672# define AUX1_SW_DONE_INTERRUPT (1 << 5)
673# define AUX1_LS_DONE_INTERRUPT (1 << 6)
674# define AUX2_SW_DONE_INTERRUPT (1 << 7)
675# define AUX2_LS_DONE_INTERRUPT (1 << 8)
676# define AUX3_SW_DONE_INTERRUPT (1 << 9)
677# define AUX3_LS_DONE_INTERRUPT (1 << 10)
678# define AUX4_SW_DONE_INTERRUPT (1 << 11)
679# define AUX4_LS_DONE_INTERRUPT (1 << 12)
680# define DIGA_DP_FAST_TRAINING_COMPLETE_INTERRUPT (1 << 13)
681# define DIGB_DP_FAST_TRAINING_COMPLETE_INTERRUPT (1 << 14)
682/* DCE 3.2 */
683# define AUX5_SW_DONE_INTERRUPT (1 << 15)
684# define AUX5_LS_DONE_INTERRUPT (1 << 16)
685# define AUX6_SW_DONE_INTERRUPT (1 << 17)
686# define AUX6_LS_DONE_INTERRUPT (1 << 18)
687# define DC_HPD5_INTERRUPT (1 << 19)
688# define DC_HPD5_RX_INTERRUPT (1 << 20)
689# define DC_HPD6_INTERRUPT (1 << 21)
690# define DC_HPD6_RX_INTERRUPT (1 << 22)
691
Alex Deucherb500f682009-12-03 13:08:53 -0500692#define DACA_AUTO_DETECT_CONTROL 0x7828
693#define DACB_AUTO_DETECT_CONTROL 0x7a28
694#define DCE3_DACA_AUTO_DETECT_CONTROL 0x7028
695#define DCE3_DACB_AUTO_DETECT_CONTROL 0x7128
696# define DACx_AUTODETECT_MODE(x) ((x) << 0)
697# define DACx_AUTODETECT_MODE_NONE 0
698# define DACx_AUTODETECT_MODE_CONNECT 1
699# define DACx_AUTODETECT_MODE_DISCONNECT 2
700# define DACx_AUTODETECT_FRAME_TIME_COUNTER(x) ((x) << 8)
701/* bit 18 = R/C, 17 = G/Y, 16 = B/Comp */
702# define DACx_AUTODETECT_CHECK_MASK(x) ((x) << 16)
703
Alex Deucherd8f60cf2009-12-01 13:43:46 -0500704#define DCE3_DACA_AUTODETECT_INT_CONTROL 0x7038
705#define DCE3_DACB_AUTODETECT_INT_CONTROL 0x7138
706#define DACA_AUTODETECT_INT_CONTROL 0x7838
707#define DACB_AUTODETECT_INT_CONTROL 0x7a38
708# define DACx_AUTODETECT_ACK (1 << 0)
709# define DACx_AUTODETECT_INT_ENABLE (1 << 16)
710
Alex Deucherb500f682009-12-03 13:08:53 -0500711#define DC_HOT_PLUG_DETECT1_CONTROL 0x7d00
712#define DC_HOT_PLUG_DETECT2_CONTROL 0x7d10
713#define DC_HOT_PLUG_DETECT3_CONTROL 0x7d24
714# define DC_HOT_PLUG_DETECTx_EN (1 << 0)
715
716#define DC_HOT_PLUG_DETECT1_INT_STATUS 0x7d04
717#define DC_HOT_PLUG_DETECT2_INT_STATUS 0x7d14
718#define DC_HOT_PLUG_DETECT3_INT_STATUS 0x7d28
719# define DC_HOT_PLUG_DETECTx_INT_STATUS (1 << 0)
720# define DC_HOT_PLUG_DETECTx_SENSE (1 << 1)
721
722/* DCE 3.0 */
723#define DC_HPD1_INT_STATUS 0x7d00
724#define DC_HPD2_INT_STATUS 0x7d0c
725#define DC_HPD3_INT_STATUS 0x7d18
726#define DC_HPD4_INT_STATUS 0x7d24
727/* DCE 3.2 */
728#define DC_HPD5_INT_STATUS 0x7dc0
729#define DC_HPD6_INT_STATUS 0x7df4
730# define DC_HPDx_INT_STATUS (1 << 0)
731# define DC_HPDx_SENSE (1 << 1)
732# define DC_HPDx_RX_INT_STATUS (1 << 8)
733
Alex Deucherd8f60cf2009-12-01 13:43:46 -0500734#define DC_HOT_PLUG_DETECT1_INT_CONTROL 0x7d08
735#define DC_HOT_PLUG_DETECT2_INT_CONTROL 0x7d18
736#define DC_HOT_PLUG_DETECT3_INT_CONTROL 0x7d2c
737# define DC_HOT_PLUG_DETECTx_INT_ACK (1 << 0)
738# define DC_HOT_PLUG_DETECTx_INT_POLARITY (1 << 8)
739# define DC_HOT_PLUG_DETECTx_INT_EN (1 << 16)
Alex Deucherb500f682009-12-03 13:08:53 -0500740/* DCE 3.0 */
Alex Deucherd8f60cf2009-12-01 13:43:46 -0500741#define DC_HPD1_INT_CONTROL 0x7d04
742#define DC_HPD2_INT_CONTROL 0x7d10
743#define DC_HPD3_INT_CONTROL 0x7d1c
744#define DC_HPD4_INT_CONTROL 0x7d28
Alex Deucherb500f682009-12-03 13:08:53 -0500745/* DCE 3.2 */
746#define DC_HPD5_INT_CONTROL 0x7dc4
747#define DC_HPD6_INT_CONTROL 0x7df8
Alex Deucherd8f60cf2009-12-01 13:43:46 -0500748# define DC_HPDx_INT_ACK (1 << 0)
749# define DC_HPDx_INT_POLARITY (1 << 8)
750# define DC_HPDx_INT_EN (1 << 16)
751# define DC_HPDx_RX_INT_ACK (1 << 20)
752# define DC_HPDx_RX_INT_EN (1 << 24)
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000753
Alex Deucherb500f682009-12-03 13:08:53 -0500754/* DCE 3.0 */
755#define DC_HPD1_CONTROL 0x7d08
756#define DC_HPD2_CONTROL 0x7d14
757#define DC_HPD3_CONTROL 0x7d20
758#define DC_HPD4_CONTROL 0x7d2c
759/* DCE 3.2 */
760#define DC_HPD5_CONTROL 0x7dc8
761#define DC_HPD6_CONTROL 0x7dfc
762# define DC_HPDx_CONNECTION_TIMER(x) ((x) << 0)
763# define DC_HPDx_RX_INT_TIMER(x) ((x) << 16)
764/* DCE 3.2 */
765# define DC_HPDx_EN (1 << 28)
766
Alex Deucher6f34be52010-11-21 10:59:01 -0500767#define D1GRPH_INTERRUPT_STATUS 0x6158
768#define D2GRPH_INTERRUPT_STATUS 0x6958
769# define DxGRPH_PFLIP_INT_OCCURRED (1 << 0)
770# define DxGRPH_PFLIP_INT_CLEAR (1 << 8)
771#define D1GRPH_INTERRUPT_CONTROL 0x615c
772#define D2GRPH_INTERRUPT_CONTROL 0x695c
773# define DxGRPH_PFLIP_INT_MASK (1 << 0)
774# define DxGRPH_PFLIP_INT_TYPE (1 << 8)
775
Alex Deucher9e46a482011-01-06 18:49:35 -0500776/* PCIE link stuff */
777#define PCIE_LC_TRAINING_CNTL 0xa1 /* PCIE_P */
778# define LC_POINT_7_PLUS_EN (1 << 6)
779#define PCIE_LC_LINK_WIDTH_CNTL 0xa2 /* PCIE_P */
780# define LC_LINK_WIDTH_SHIFT 0
781# define LC_LINK_WIDTH_MASK 0x7
782# define LC_LINK_WIDTH_X0 0
783# define LC_LINK_WIDTH_X1 1
784# define LC_LINK_WIDTH_X2 2
785# define LC_LINK_WIDTH_X4 3
786# define LC_LINK_WIDTH_X8 4
787# define LC_LINK_WIDTH_X16 6
788# define LC_LINK_WIDTH_RD_SHIFT 4
789# define LC_LINK_WIDTH_RD_MASK 0x70
790# define LC_RECONFIG_ARC_MISSING_ESCAPE (1 << 7)
791# define LC_RECONFIG_NOW (1 << 8)
792# define LC_RENEGOTIATION_SUPPORT (1 << 9)
793# define LC_RENEGOTIATE_EN (1 << 10)
794# define LC_SHORT_RECONFIG_EN (1 << 11)
795# define LC_UPCONFIGURE_SUPPORT (1 << 12)
796# define LC_UPCONFIGURE_DIS (1 << 13)
797#define PCIE_LC_SPEED_CNTL 0xa4 /* PCIE_P */
798# define LC_GEN2_EN_STRAP (1 << 0)
799# define LC_TARGET_LINK_SPEED_OVERRIDE_EN (1 << 1)
800# define LC_FORCE_EN_HW_SPEED_CHANGE (1 << 5)
801# define LC_FORCE_DIS_HW_SPEED_CHANGE (1 << 6)
802# define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK (0x3 << 8)
803# define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT 3
804# define LC_CURRENT_DATA_RATE (1 << 11)
805# define LC_VOLTAGE_TIMER_SEL_MASK (0xf << 14)
806# define LC_CLR_FAILED_SPD_CHANGE_CNT (1 << 21)
807# define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 23)
808# define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 24)
809#define MM_CFGREGS_CNTL 0x544c
810# define MM_WR_TO_CFG_EN (1 << 3)
811#define LINK_CNTL2 0x88 /* F0 */
812# define TARGET_LINK_SPEED_MASK (0xf << 0)
813# define SELECTABLE_DEEMPHASIS (1 << 6)
814
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000815/*
816 * PM4
817 */
818#define PACKET_TYPE0 0
819#define PACKET_TYPE1 1
820#define PACKET_TYPE2 2
821#define PACKET_TYPE3 3
822
823#define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3)
824#define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF)
825#define CP_PACKET0_GET_REG(h) (((h) & 0xFFFF) << 2)
826#define CP_PACKET3_GET_OPCODE(h) (((h) >> 8) & 0xFF)
827#define PACKET0(reg, n) ((PACKET_TYPE0 << 30) | \
828 (((reg) >> 2) & 0xFFFF) | \
829 ((n) & 0x3FFF) << 16)
830#define PACKET3(op, n) ((PACKET_TYPE3 << 30) | \
831 (((op) & 0xFF) << 8) | \
832 ((n) & 0x3FFF) << 16)
833
834/* Packet 3 types */
835#define PACKET3_NOP 0x10
836#define PACKET3_INDIRECT_BUFFER_END 0x17
837#define PACKET3_SET_PREDICATION 0x20
838#define PACKET3_REG_RMW 0x21
839#define PACKET3_COND_EXEC 0x22
840#define PACKET3_PRED_EXEC 0x23
841#define PACKET3_START_3D_CMDBUF 0x24
842#define PACKET3_DRAW_INDEX_2 0x27
843#define PACKET3_CONTEXT_CONTROL 0x28
844#define PACKET3_DRAW_INDEX_IMMD_BE 0x29
845#define PACKET3_INDEX_TYPE 0x2A
846#define PACKET3_DRAW_INDEX 0x2B
847#define PACKET3_DRAW_INDEX_AUTO 0x2D
848#define PACKET3_DRAW_INDEX_IMMD 0x2E
849#define PACKET3_NUM_INSTANCES 0x2F
850#define PACKET3_STRMOUT_BUFFER_UPDATE 0x34
851#define PACKET3_INDIRECT_BUFFER_MP 0x38
852#define PACKET3_MEM_SEMAPHORE 0x39
Christian König15d33322011-09-15 19:02:22 +0200853# define PACKET3_SEM_SEL_SIGNAL (0x6 << 29)
854# define PACKET3_SEM_SEL_WAIT (0x7 << 29)
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000855#define PACKET3_MPEG_INDEX 0x3A
Marek Olšákdd220a02012-01-27 12:17:59 -0500856#define PACKET3_COPY_DW 0x3B
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000857#define PACKET3_WAIT_REG_MEM 0x3C
858#define PACKET3_MEM_WRITE 0x3D
859#define PACKET3_INDIRECT_BUFFER 0x32
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000860#define PACKET3_SURFACE_SYNC 0x43
861# define PACKET3_CB0_DEST_BASE_ENA (1 << 6)
862# define PACKET3_TC_ACTION_ENA (1 << 23)
863# define PACKET3_VC_ACTION_ENA (1 << 24)
864# define PACKET3_CB_ACTION_ENA (1 << 25)
865# define PACKET3_DB_ACTION_ENA (1 << 26)
866# define PACKET3_SH_ACTION_ENA (1 << 27)
867# define PACKET3_SMX_ACTION_ENA (1 << 28)
868#define PACKET3_ME_INITIALIZE 0x44
869#define PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16)
870#define PACKET3_COND_WRITE 0x45
871#define PACKET3_EVENT_WRITE 0x46
Alex Deucherd0f8a852010-09-04 05:04:34 -0400872#define EVENT_TYPE(x) ((x) << 0)
873#define EVENT_INDEX(x) ((x) << 8)
874 /* 0 - any non-TS event
875 * 1 - ZPASS_DONE
876 * 2 - SAMPLE_PIPELINESTAT
877 * 3 - SAMPLE_STREAMOUTSTAT*
878 * 4 - *S_PARTIAL_FLUSH
879 * 5 - TS events
880 */
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000881#define PACKET3_EVENT_WRITE_EOP 0x47
Alex Deucherd0f8a852010-09-04 05:04:34 -0400882#define DATA_SEL(x) ((x) << 29)
883 /* 0 - discard
884 * 1 - send low 32bit data
885 * 2 - send 64bit data
886 * 3 - send 64bit counter value
887 */
888#define INT_SEL(x) ((x) << 24)
889 /* 0 - none
890 * 1 - interrupt only (DATA_SEL = 0)
891 * 2 - interrupt when data write is confirmed
892 */
Jerome Glisse3ce0a232009-09-08 10:10:24 +1000893#define PACKET3_ONE_REG_WRITE 0x57
894#define PACKET3_SET_CONFIG_REG 0x68
895#define PACKET3_SET_CONFIG_REG_OFFSET 0x00008000
896#define PACKET3_SET_CONFIG_REG_END 0x0000ac00
897#define PACKET3_SET_CONTEXT_REG 0x69
898#define PACKET3_SET_CONTEXT_REG_OFFSET 0x00028000
899#define PACKET3_SET_CONTEXT_REG_END 0x00029000
900#define PACKET3_SET_ALU_CONST 0x6A
901#define PACKET3_SET_ALU_CONST_OFFSET 0x00030000
902#define PACKET3_SET_ALU_CONST_END 0x00032000
903#define PACKET3_SET_BOOL_CONST 0x6B
904#define PACKET3_SET_BOOL_CONST_OFFSET 0x0003e380
905#define PACKET3_SET_BOOL_CONST_END 0x00040000
906#define PACKET3_SET_LOOP_CONST 0x6C
907#define PACKET3_SET_LOOP_CONST_OFFSET 0x0003e200
908#define PACKET3_SET_LOOP_CONST_END 0x0003e380
909#define PACKET3_SET_RESOURCE 0x6D
910#define PACKET3_SET_RESOURCE_OFFSET 0x00038000
911#define PACKET3_SET_RESOURCE_END 0x0003c000
912#define PACKET3_SET_SAMPLER 0x6E
913#define PACKET3_SET_SAMPLER_OFFSET 0x0003c000
914#define PACKET3_SET_SAMPLER_END 0x0003cff0
915#define PACKET3_SET_CTL_CONST 0x6F
916#define PACKET3_SET_CTL_CONST_OFFSET 0x0003cff0
917#define PACKET3_SET_CTL_CONST_END 0x0003e200
918#define PACKET3_SURFACE_BASE_UPDATE 0x73
919
920
921#define R_008020_GRBM_SOFT_RESET 0x8020
922#define S_008020_SOFT_RESET_CP(x) (((x) & 1) << 0)
923#define S_008020_SOFT_RESET_CB(x) (((x) & 1) << 1)
924#define S_008020_SOFT_RESET_CR(x) (((x) & 1) << 2)
925#define S_008020_SOFT_RESET_DB(x) (((x) & 1) << 3)
926#define S_008020_SOFT_RESET_PA(x) (((x) & 1) << 5)
927#define S_008020_SOFT_RESET_SC(x) (((x) & 1) << 6)
928#define S_008020_SOFT_RESET_SMX(x) (((x) & 1) << 7)
929#define S_008020_SOFT_RESET_SPI(x) (((x) & 1) << 8)
930#define S_008020_SOFT_RESET_SH(x) (((x) & 1) << 9)
931#define S_008020_SOFT_RESET_SX(x) (((x) & 1) << 10)
932#define S_008020_SOFT_RESET_TC(x) (((x) & 1) << 11)
933#define S_008020_SOFT_RESET_TA(x) (((x) & 1) << 12)
934#define S_008020_SOFT_RESET_VC(x) (((x) & 1) << 13)
935#define S_008020_SOFT_RESET_VGT(x) (((x) & 1) << 14)
936#define R_008010_GRBM_STATUS 0x8010
937#define S_008010_CMDFIFO_AVAIL(x) (((x) & 0x1F) << 0)
938#define S_008010_CP_RQ_PENDING(x) (((x) & 1) << 6)
939#define S_008010_CF_RQ_PENDING(x) (((x) & 1) << 7)
940#define S_008010_PF_RQ_PENDING(x) (((x) & 1) << 8)
941#define S_008010_GRBM_EE_BUSY(x) (((x) & 1) << 10)
942#define S_008010_VC_BUSY(x) (((x) & 1) << 11)
943#define S_008010_DB03_CLEAN(x) (((x) & 1) << 12)
944#define S_008010_CB03_CLEAN(x) (((x) & 1) << 13)
945#define S_008010_VGT_BUSY_NO_DMA(x) (((x) & 1) << 16)
946#define S_008010_VGT_BUSY(x) (((x) & 1) << 17)
947#define S_008010_TA03_BUSY(x) (((x) & 1) << 18)
948#define S_008010_TC_BUSY(x) (((x) & 1) << 19)
949#define S_008010_SX_BUSY(x) (((x) & 1) << 20)
950#define S_008010_SH_BUSY(x) (((x) & 1) << 21)
951#define S_008010_SPI03_BUSY(x) (((x) & 1) << 22)
952#define S_008010_SMX_BUSY(x) (((x) & 1) << 23)
953#define S_008010_SC_BUSY(x) (((x) & 1) << 24)
954#define S_008010_PA_BUSY(x) (((x) & 1) << 25)
955#define S_008010_DB03_BUSY(x) (((x) & 1) << 26)
956#define S_008010_CR_BUSY(x) (((x) & 1) << 27)
957#define S_008010_CP_COHERENCY_BUSY(x) (((x) & 1) << 28)
958#define S_008010_CP_BUSY(x) (((x) & 1) << 29)
959#define S_008010_CB03_BUSY(x) (((x) & 1) << 30)
960#define S_008010_GUI_ACTIVE(x) (((x) & 1) << 31)
961#define G_008010_CMDFIFO_AVAIL(x) (((x) >> 0) & 0x1F)
962#define G_008010_CP_RQ_PENDING(x) (((x) >> 6) & 1)
963#define G_008010_CF_RQ_PENDING(x) (((x) >> 7) & 1)
964#define G_008010_PF_RQ_PENDING(x) (((x) >> 8) & 1)
965#define G_008010_GRBM_EE_BUSY(x) (((x) >> 10) & 1)
966#define G_008010_VC_BUSY(x) (((x) >> 11) & 1)
967#define G_008010_DB03_CLEAN(x) (((x) >> 12) & 1)
968#define G_008010_CB03_CLEAN(x) (((x) >> 13) & 1)
969#define G_008010_VGT_BUSY_NO_DMA(x) (((x) >> 16) & 1)
970#define G_008010_VGT_BUSY(x) (((x) >> 17) & 1)
971#define G_008010_TA03_BUSY(x) (((x) >> 18) & 1)
972#define G_008010_TC_BUSY(x) (((x) >> 19) & 1)
973#define G_008010_SX_BUSY(x) (((x) >> 20) & 1)
974#define G_008010_SH_BUSY(x) (((x) >> 21) & 1)
975#define G_008010_SPI03_BUSY(x) (((x) >> 22) & 1)
976#define G_008010_SMX_BUSY(x) (((x) >> 23) & 1)
977#define G_008010_SC_BUSY(x) (((x) >> 24) & 1)
978#define G_008010_PA_BUSY(x) (((x) >> 25) & 1)
979#define G_008010_DB03_BUSY(x) (((x) >> 26) & 1)
980#define G_008010_CR_BUSY(x) (((x) >> 27) & 1)
981#define G_008010_CP_COHERENCY_BUSY(x) (((x) >> 28) & 1)
982#define G_008010_CP_BUSY(x) (((x) >> 29) & 1)
983#define G_008010_CB03_BUSY(x) (((x) >> 30) & 1)
984#define G_008010_GUI_ACTIVE(x) (((x) >> 31) & 1)
985#define R_008014_GRBM_STATUS2 0x8014
986#define S_008014_CR_CLEAN(x) (((x) & 1) << 0)
987#define S_008014_SMX_CLEAN(x) (((x) & 1) << 1)
988#define S_008014_SPI0_BUSY(x) (((x) & 1) << 8)
989#define S_008014_SPI1_BUSY(x) (((x) & 1) << 9)
990#define S_008014_SPI2_BUSY(x) (((x) & 1) << 10)
991#define S_008014_SPI3_BUSY(x) (((x) & 1) << 11)
992#define S_008014_TA0_BUSY(x) (((x) & 1) << 12)
993#define S_008014_TA1_BUSY(x) (((x) & 1) << 13)
994#define S_008014_TA2_BUSY(x) (((x) & 1) << 14)
995#define S_008014_TA3_BUSY(x) (((x) & 1) << 15)
996#define S_008014_DB0_BUSY(x) (((x) & 1) << 16)
997#define S_008014_DB1_BUSY(x) (((x) & 1) << 17)
998#define S_008014_DB2_BUSY(x) (((x) & 1) << 18)
999#define S_008014_DB3_BUSY(x) (((x) & 1) << 19)
1000#define S_008014_CB0_BUSY(x) (((x) & 1) << 20)
1001#define S_008014_CB1_BUSY(x) (((x) & 1) << 21)
1002#define S_008014_CB2_BUSY(x) (((x) & 1) << 22)
1003#define S_008014_CB3_BUSY(x) (((x) & 1) << 23)
1004#define G_008014_CR_CLEAN(x) (((x) >> 0) & 1)
1005#define G_008014_SMX_CLEAN(x) (((x) >> 1) & 1)
1006#define G_008014_SPI0_BUSY(x) (((x) >> 8) & 1)
1007#define G_008014_SPI1_BUSY(x) (((x) >> 9) & 1)
1008#define G_008014_SPI2_BUSY(x) (((x) >> 10) & 1)
1009#define G_008014_SPI3_BUSY(x) (((x) >> 11) & 1)
1010#define G_008014_TA0_BUSY(x) (((x) >> 12) & 1)
1011#define G_008014_TA1_BUSY(x) (((x) >> 13) & 1)
1012#define G_008014_TA2_BUSY(x) (((x) >> 14) & 1)
1013#define G_008014_TA3_BUSY(x) (((x) >> 15) & 1)
1014#define G_008014_DB0_BUSY(x) (((x) >> 16) & 1)
1015#define G_008014_DB1_BUSY(x) (((x) >> 17) & 1)
1016#define G_008014_DB2_BUSY(x) (((x) >> 18) & 1)
1017#define G_008014_DB3_BUSY(x) (((x) >> 19) & 1)
1018#define G_008014_CB0_BUSY(x) (((x) >> 20) & 1)
1019#define G_008014_CB1_BUSY(x) (((x) >> 21) & 1)
1020#define G_008014_CB2_BUSY(x) (((x) >> 22) & 1)
1021#define G_008014_CB3_BUSY(x) (((x) >> 23) & 1)
1022#define R_000E50_SRBM_STATUS 0x0E50
1023#define G_000E50_RLC_RQ_PENDING(x) (((x) >> 3) & 1)
1024#define G_000E50_RCU_RQ_PENDING(x) (((x) >> 4) & 1)
1025#define G_000E50_GRBM_RQ_PENDING(x) (((x) >> 5) & 1)
1026#define G_000E50_HI_RQ_PENDING(x) (((x) >> 6) & 1)
1027#define G_000E50_IO_EXTERN_SIGNAL(x) (((x) >> 7) & 1)
1028#define G_000E50_VMC_BUSY(x) (((x) >> 8) & 1)
1029#define G_000E50_MCB_BUSY(x) (((x) >> 9) & 1)
1030#define G_000E50_MCDZ_BUSY(x) (((x) >> 10) & 1)
1031#define G_000E50_MCDY_BUSY(x) (((x) >> 11) & 1)
1032#define G_000E50_MCDX_BUSY(x) (((x) >> 12) & 1)
1033#define G_000E50_MCDW_BUSY(x) (((x) >> 13) & 1)
1034#define G_000E50_SEM_BUSY(x) (((x) >> 14) & 1)
1035#define G_000E50_RLC_BUSY(x) (((x) >> 15) & 1)
Jerome Glisse1a029b72009-10-06 19:04:30 +02001036#define G_000E50_BIF_BUSY(x) (((x) >> 29) & 1)
Jerome Glisse3ce0a232009-09-08 10:10:24 +10001037#define R_000E60_SRBM_SOFT_RESET 0x0E60
1038#define S_000E60_SOFT_RESET_BIF(x) (((x) & 1) << 1)
1039#define S_000E60_SOFT_RESET_CG(x) (((x) & 1) << 2)
1040#define S_000E60_SOFT_RESET_CMC(x) (((x) & 1) << 3)
1041#define S_000E60_SOFT_RESET_CSC(x) (((x) & 1) << 4)
1042#define S_000E60_SOFT_RESET_DC(x) (((x) & 1) << 5)
1043#define S_000E60_SOFT_RESET_GRBM(x) (((x) & 1) << 8)
1044#define S_000E60_SOFT_RESET_HDP(x) (((x) & 1) << 9)
1045#define S_000E60_SOFT_RESET_IH(x) (((x) & 1) << 10)
1046#define S_000E60_SOFT_RESET_MC(x) (((x) & 1) << 11)
1047#define S_000E60_SOFT_RESET_RLC(x) (((x) & 1) << 13)
1048#define S_000E60_SOFT_RESET_ROM(x) (((x) & 1) << 14)
1049#define S_000E60_SOFT_RESET_SEM(x) (((x) & 1) << 15)
1050#define S_000E60_SOFT_RESET_TSC(x) (((x) & 1) << 16)
1051#define S_000E60_SOFT_RESET_VMC(x) (((x) & 1) << 17)
1052
Dave Airlie23956df2009-11-23 12:01:09 +10001053#define R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL 0x5480
Jerome Glissec8c15ff2010-01-18 13:01:36 +01001054
Jerome Glisse961fb592010-02-10 22:30:05 +00001055#define R_028C04_PA_SC_AA_CONFIG 0x028C04
1056#define S_028C04_MSAA_NUM_SAMPLES(x) (((x) & 0x3) << 0)
1057#define G_028C04_MSAA_NUM_SAMPLES(x) (((x) >> 0) & 0x3)
1058#define C_028C04_MSAA_NUM_SAMPLES 0xFFFFFFFC
1059#define S_028C04_AA_MASK_CENTROID_DTMN(x) (((x) & 0x1) << 4)
1060#define G_028C04_AA_MASK_CENTROID_DTMN(x) (((x) >> 4) & 0x1)
1061#define C_028C04_AA_MASK_CENTROID_DTMN 0xFFFFFFEF
1062#define S_028C04_MAX_SAMPLE_DIST(x) (((x) & 0xF) << 13)
1063#define G_028C04_MAX_SAMPLE_DIST(x) (((x) >> 13) & 0xF)
1064#define C_028C04_MAX_SAMPLE_DIST 0xFFFE1FFF
Jerome Glissec8c15ff2010-01-18 13:01:36 +01001065#define R_0280E0_CB_COLOR0_FRAG 0x0280E0
1066#define S_0280E0_BASE_256B(x) (((x) & 0xFFFFFFFF) << 0)
1067#define G_0280E0_BASE_256B(x) (((x) >> 0) & 0xFFFFFFFF)
1068#define C_0280E0_BASE_256B 0x00000000
1069#define R_0280E4_CB_COLOR1_FRAG 0x0280E4
1070#define R_0280E8_CB_COLOR2_FRAG 0x0280E8
1071#define R_0280EC_CB_COLOR3_FRAG 0x0280EC
1072#define R_0280F0_CB_COLOR4_FRAG 0x0280F0
1073#define R_0280F4_CB_COLOR5_FRAG 0x0280F4
1074#define R_0280F8_CB_COLOR6_FRAG 0x0280F8
1075#define R_0280FC_CB_COLOR7_FRAG 0x0280FC
1076#define R_0280C0_CB_COLOR0_TILE 0x0280C0
1077#define S_0280C0_BASE_256B(x) (((x) & 0xFFFFFFFF) << 0)
1078#define G_0280C0_BASE_256B(x) (((x) >> 0) & 0xFFFFFFFF)
1079#define C_0280C0_BASE_256B 0x00000000
1080#define R_0280C4_CB_COLOR1_TILE 0x0280C4
1081#define R_0280C8_CB_COLOR2_TILE 0x0280C8
1082#define R_0280CC_CB_COLOR3_TILE 0x0280CC
1083#define R_0280D0_CB_COLOR4_TILE 0x0280D0
1084#define R_0280D4_CB_COLOR5_TILE 0x0280D4
1085#define R_0280D8_CB_COLOR6_TILE 0x0280D8
1086#define R_0280DC_CB_COLOR7_TILE 0x0280DC
Jerome Glisse961fb592010-02-10 22:30:05 +00001087#define R_0280A0_CB_COLOR0_INFO 0x0280A0
1088#define S_0280A0_ENDIAN(x) (((x) & 0x3) << 0)
1089#define G_0280A0_ENDIAN(x) (((x) >> 0) & 0x3)
1090#define C_0280A0_ENDIAN 0xFFFFFFFC
1091#define S_0280A0_FORMAT(x) (((x) & 0x3F) << 2)
1092#define G_0280A0_FORMAT(x) (((x) >> 2) & 0x3F)
1093#define C_0280A0_FORMAT 0xFFFFFF03
1094#define V_0280A0_COLOR_INVALID 0x00000000
1095#define V_0280A0_COLOR_8 0x00000001
1096#define V_0280A0_COLOR_4_4 0x00000002
1097#define V_0280A0_COLOR_3_3_2 0x00000003
1098#define V_0280A0_COLOR_16 0x00000005
1099#define V_0280A0_COLOR_16_FLOAT 0x00000006
1100#define V_0280A0_COLOR_8_8 0x00000007
1101#define V_0280A0_COLOR_5_6_5 0x00000008
1102#define V_0280A0_COLOR_6_5_5 0x00000009
1103#define V_0280A0_COLOR_1_5_5_5 0x0000000A
1104#define V_0280A0_COLOR_4_4_4_4 0x0000000B
1105#define V_0280A0_COLOR_5_5_5_1 0x0000000C
1106#define V_0280A0_COLOR_32 0x0000000D
1107#define V_0280A0_COLOR_32_FLOAT 0x0000000E
1108#define V_0280A0_COLOR_16_16 0x0000000F
1109#define V_0280A0_COLOR_16_16_FLOAT 0x00000010
1110#define V_0280A0_COLOR_8_24 0x00000011
1111#define V_0280A0_COLOR_8_24_FLOAT 0x00000012
1112#define V_0280A0_COLOR_24_8 0x00000013
1113#define V_0280A0_COLOR_24_8_FLOAT 0x00000014
1114#define V_0280A0_COLOR_10_11_11 0x00000015
1115#define V_0280A0_COLOR_10_11_11_FLOAT 0x00000016
1116#define V_0280A0_COLOR_11_11_10 0x00000017
1117#define V_0280A0_COLOR_11_11_10_FLOAT 0x00000018
1118#define V_0280A0_COLOR_2_10_10_10 0x00000019
1119#define V_0280A0_COLOR_8_8_8_8 0x0000001A
1120#define V_0280A0_COLOR_10_10_10_2 0x0000001B
1121#define V_0280A0_COLOR_X24_8_32_FLOAT 0x0000001C
1122#define V_0280A0_COLOR_32_32 0x0000001D
1123#define V_0280A0_COLOR_32_32_FLOAT 0x0000001E
1124#define V_0280A0_COLOR_16_16_16_16 0x0000001F
1125#define V_0280A0_COLOR_16_16_16_16_FLOAT 0x00000020
1126#define V_0280A0_COLOR_32_32_32_32 0x00000022
1127#define V_0280A0_COLOR_32_32_32_32_FLOAT 0x00000023
1128#define S_0280A0_ARRAY_MODE(x) (((x) & 0xF) << 8)
1129#define G_0280A0_ARRAY_MODE(x) (((x) >> 8) & 0xF)
1130#define C_0280A0_ARRAY_MODE 0xFFFFF0FF
1131#define V_0280A0_ARRAY_LINEAR_GENERAL 0x00000000
1132#define V_0280A0_ARRAY_LINEAR_ALIGNED 0x00000001
1133#define V_0280A0_ARRAY_1D_TILED_THIN1 0x00000002
1134#define V_0280A0_ARRAY_2D_TILED_THIN1 0x00000004
1135#define S_0280A0_NUMBER_TYPE(x) (((x) & 0x7) << 12)
1136#define G_0280A0_NUMBER_TYPE(x) (((x) >> 12) & 0x7)
1137#define C_0280A0_NUMBER_TYPE 0xFFFF8FFF
1138#define S_0280A0_READ_SIZE(x) (((x) & 0x1) << 15)
1139#define G_0280A0_READ_SIZE(x) (((x) >> 15) & 0x1)
1140#define C_0280A0_READ_SIZE 0xFFFF7FFF
1141#define S_0280A0_COMP_SWAP(x) (((x) & 0x3) << 16)
1142#define G_0280A0_COMP_SWAP(x) (((x) >> 16) & 0x3)
1143#define C_0280A0_COMP_SWAP 0xFFFCFFFF
1144#define S_0280A0_TILE_MODE(x) (((x) & 0x3) << 18)
1145#define G_0280A0_TILE_MODE(x) (((x) >> 18) & 0x3)
1146#define C_0280A0_TILE_MODE 0xFFF3FFFF
1147#define S_0280A0_BLEND_CLAMP(x) (((x) & 0x1) << 20)
1148#define G_0280A0_BLEND_CLAMP(x) (((x) >> 20) & 0x1)
1149#define C_0280A0_BLEND_CLAMP 0xFFEFFFFF
1150#define S_0280A0_CLEAR_COLOR(x) (((x) & 0x1) << 21)
1151#define G_0280A0_CLEAR_COLOR(x) (((x) >> 21) & 0x1)
1152#define C_0280A0_CLEAR_COLOR 0xFFDFFFFF
1153#define S_0280A0_BLEND_BYPASS(x) (((x) & 0x1) << 22)
1154#define G_0280A0_BLEND_BYPASS(x) (((x) >> 22) & 0x1)
1155#define C_0280A0_BLEND_BYPASS 0xFFBFFFFF
1156#define S_0280A0_BLEND_FLOAT32(x) (((x) & 0x1) << 23)
1157#define G_0280A0_BLEND_FLOAT32(x) (((x) >> 23) & 0x1)
1158#define C_0280A0_BLEND_FLOAT32 0xFF7FFFFF
1159#define S_0280A0_SIMPLE_FLOAT(x) (((x) & 0x1) << 24)
1160#define G_0280A0_SIMPLE_FLOAT(x) (((x) >> 24) & 0x1)
1161#define C_0280A0_SIMPLE_FLOAT 0xFEFFFFFF
1162#define S_0280A0_ROUND_MODE(x) (((x) & 0x1) << 25)
1163#define G_0280A0_ROUND_MODE(x) (((x) >> 25) & 0x1)
1164#define C_0280A0_ROUND_MODE 0xFDFFFFFF
1165#define S_0280A0_TILE_COMPACT(x) (((x) & 0x1) << 26)
1166#define G_0280A0_TILE_COMPACT(x) (((x) >> 26) & 0x1)
1167#define C_0280A0_TILE_COMPACT 0xFBFFFFFF
1168#define S_0280A0_SOURCE_FORMAT(x) (((x) & 0x1) << 27)
1169#define G_0280A0_SOURCE_FORMAT(x) (((x) >> 27) & 0x1)
1170#define C_0280A0_SOURCE_FORMAT 0xF7FFFFFF
1171#define R_0280A4_CB_COLOR1_INFO 0x0280A4
1172#define R_0280A8_CB_COLOR2_INFO 0x0280A8
1173#define R_0280AC_CB_COLOR3_INFO 0x0280AC
1174#define R_0280B0_CB_COLOR4_INFO 0x0280B0
1175#define R_0280B4_CB_COLOR5_INFO 0x0280B4
1176#define R_0280B8_CB_COLOR6_INFO 0x0280B8
1177#define R_0280BC_CB_COLOR7_INFO 0x0280BC
1178#define R_028060_CB_COLOR0_SIZE 0x028060
1179#define S_028060_PITCH_TILE_MAX(x) (((x) & 0x3FF) << 0)
1180#define G_028060_PITCH_TILE_MAX(x) (((x) >> 0) & 0x3FF)
1181#define C_028060_PITCH_TILE_MAX 0xFFFFFC00
1182#define S_028060_SLICE_TILE_MAX(x) (((x) & 0xFFFFF) << 10)
1183#define G_028060_SLICE_TILE_MAX(x) (((x) >> 10) & 0xFFFFF)
1184#define C_028060_SLICE_TILE_MAX 0xC00003FF
1185#define R_028064_CB_COLOR1_SIZE 0x028064
1186#define R_028068_CB_COLOR2_SIZE 0x028068
1187#define R_02806C_CB_COLOR3_SIZE 0x02806C
1188#define R_028070_CB_COLOR4_SIZE 0x028070
1189#define R_028074_CB_COLOR5_SIZE 0x028074
1190#define R_028078_CB_COLOR6_SIZE 0x028078
1191#define R_02807C_CB_COLOR7_SIZE 0x02807C
1192#define R_028238_CB_TARGET_MASK 0x028238
1193#define S_028238_TARGET0_ENABLE(x) (((x) & 0xF) << 0)
1194#define G_028238_TARGET0_ENABLE(x) (((x) >> 0) & 0xF)
1195#define C_028238_TARGET0_ENABLE 0xFFFFFFF0
1196#define S_028238_TARGET1_ENABLE(x) (((x) & 0xF) << 4)
1197#define G_028238_TARGET1_ENABLE(x) (((x) >> 4) & 0xF)
1198#define C_028238_TARGET1_ENABLE 0xFFFFFF0F
1199#define S_028238_TARGET2_ENABLE(x) (((x) & 0xF) << 8)
1200#define G_028238_TARGET2_ENABLE(x) (((x) >> 8) & 0xF)
1201#define C_028238_TARGET2_ENABLE 0xFFFFF0FF
1202#define S_028238_TARGET3_ENABLE(x) (((x) & 0xF) << 12)
1203#define G_028238_TARGET3_ENABLE(x) (((x) >> 12) & 0xF)
1204#define C_028238_TARGET3_ENABLE 0xFFFF0FFF
1205#define S_028238_TARGET4_ENABLE(x) (((x) & 0xF) << 16)
1206#define G_028238_TARGET4_ENABLE(x) (((x) >> 16) & 0xF)
1207#define C_028238_TARGET4_ENABLE 0xFFF0FFFF
1208#define S_028238_TARGET5_ENABLE(x) (((x) & 0xF) << 20)
1209#define G_028238_TARGET5_ENABLE(x) (((x) >> 20) & 0xF)
1210#define C_028238_TARGET5_ENABLE 0xFF0FFFFF
1211#define S_028238_TARGET6_ENABLE(x) (((x) & 0xF) << 24)
1212#define G_028238_TARGET6_ENABLE(x) (((x) >> 24) & 0xF)
1213#define C_028238_TARGET6_ENABLE 0xF0FFFFFF
1214#define S_028238_TARGET7_ENABLE(x) (((x) & 0xF) << 28)
1215#define G_028238_TARGET7_ENABLE(x) (((x) >> 28) & 0xF)
1216#define C_028238_TARGET7_ENABLE 0x0FFFFFFF
1217#define R_02823C_CB_SHADER_MASK 0x02823C
1218#define S_02823C_OUTPUT0_ENABLE(x) (((x) & 0xF) << 0)
1219#define G_02823C_OUTPUT0_ENABLE(x) (((x) >> 0) & 0xF)
1220#define C_02823C_OUTPUT0_ENABLE 0xFFFFFFF0
1221#define S_02823C_OUTPUT1_ENABLE(x) (((x) & 0xF) << 4)
1222#define G_02823C_OUTPUT1_ENABLE(x) (((x) >> 4) & 0xF)
1223#define C_02823C_OUTPUT1_ENABLE 0xFFFFFF0F
1224#define S_02823C_OUTPUT2_ENABLE(x) (((x) & 0xF) << 8)
1225#define G_02823C_OUTPUT2_ENABLE(x) (((x) >> 8) & 0xF)
1226#define C_02823C_OUTPUT2_ENABLE 0xFFFFF0FF
1227#define S_02823C_OUTPUT3_ENABLE(x) (((x) & 0xF) << 12)
1228#define G_02823C_OUTPUT3_ENABLE(x) (((x) >> 12) & 0xF)
1229#define C_02823C_OUTPUT3_ENABLE 0xFFFF0FFF
1230#define S_02823C_OUTPUT4_ENABLE(x) (((x) & 0xF) << 16)
1231#define G_02823C_OUTPUT4_ENABLE(x) (((x) >> 16) & 0xF)
1232#define C_02823C_OUTPUT4_ENABLE 0xFFF0FFFF
1233#define S_02823C_OUTPUT5_ENABLE(x) (((x) & 0xF) << 20)
1234#define G_02823C_OUTPUT5_ENABLE(x) (((x) >> 20) & 0xF)
1235#define C_02823C_OUTPUT5_ENABLE 0xFF0FFFFF
1236#define S_02823C_OUTPUT6_ENABLE(x) (((x) & 0xF) << 24)
1237#define G_02823C_OUTPUT6_ENABLE(x) (((x) >> 24) & 0xF)
1238#define C_02823C_OUTPUT6_ENABLE 0xF0FFFFFF
1239#define S_02823C_OUTPUT7_ENABLE(x) (((x) & 0xF) << 28)
1240#define G_02823C_OUTPUT7_ENABLE(x) (((x) >> 28) & 0xF)
1241#define C_02823C_OUTPUT7_ENABLE 0x0FFFFFFF
1242#define R_028AB0_VGT_STRMOUT_EN 0x028AB0
1243#define S_028AB0_STREAMOUT(x) (((x) & 0x1) << 0)
1244#define G_028AB0_STREAMOUT(x) (((x) >> 0) & 0x1)
1245#define C_028AB0_STREAMOUT 0xFFFFFFFE
1246#define R_028B20_VGT_STRMOUT_BUFFER_EN 0x028B20
1247#define S_028B20_BUFFER_0_EN(x) (((x) & 0x1) << 0)
1248#define G_028B20_BUFFER_0_EN(x) (((x) >> 0) & 0x1)
1249#define C_028B20_BUFFER_0_EN 0xFFFFFFFE
1250#define S_028B20_BUFFER_1_EN(x) (((x) & 0x1) << 1)
1251#define G_028B20_BUFFER_1_EN(x) (((x) >> 1) & 0x1)
1252#define C_028B20_BUFFER_1_EN 0xFFFFFFFD
1253#define S_028B20_BUFFER_2_EN(x) (((x) & 0x1) << 2)
1254#define G_028B20_BUFFER_2_EN(x) (((x) >> 2) & 0x1)
1255#define C_028B20_BUFFER_2_EN 0xFFFFFFFB
1256#define S_028B20_BUFFER_3_EN(x) (((x) & 0x1) << 3)
1257#define G_028B20_BUFFER_3_EN(x) (((x) >> 3) & 0x1)
1258#define C_028B20_BUFFER_3_EN 0xFFFFFFF7
1259#define S_028B20_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
1260#define G_028B20_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
1261#define C_028B20_SIZE 0x00000000
1262#define R_038000_SQ_TEX_RESOURCE_WORD0_0 0x038000
1263#define S_038000_DIM(x) (((x) & 0x7) << 0)
1264#define G_038000_DIM(x) (((x) >> 0) & 0x7)
1265#define C_038000_DIM 0xFFFFFFF8
1266#define V_038000_SQ_TEX_DIM_1D 0x00000000
1267#define V_038000_SQ_TEX_DIM_2D 0x00000001
1268#define V_038000_SQ_TEX_DIM_3D 0x00000002
1269#define V_038000_SQ_TEX_DIM_CUBEMAP 0x00000003
1270#define V_038000_SQ_TEX_DIM_1D_ARRAY 0x00000004
1271#define V_038000_SQ_TEX_DIM_2D_ARRAY 0x00000005
1272#define V_038000_SQ_TEX_DIM_2D_MSAA 0x00000006
1273#define V_038000_SQ_TEX_DIM_2D_ARRAY_MSAA 0x00000007
1274#define S_038000_TILE_MODE(x) (((x) & 0xF) << 3)
1275#define G_038000_TILE_MODE(x) (((x) >> 3) & 0xF)
1276#define C_038000_TILE_MODE 0xFFFFFF87
Alex Deucher7f813372010-05-20 12:43:52 -04001277#define V_038000_ARRAY_LINEAR_GENERAL 0x00000000
1278#define V_038000_ARRAY_LINEAR_ALIGNED 0x00000001
1279#define V_038000_ARRAY_1D_TILED_THIN1 0x00000002
1280#define V_038000_ARRAY_2D_TILED_THIN1 0x00000004
Jerome Glisse961fb592010-02-10 22:30:05 +00001281#define S_038000_TILE_TYPE(x) (((x) & 0x1) << 7)
1282#define G_038000_TILE_TYPE(x) (((x) >> 7) & 0x1)
1283#define C_038000_TILE_TYPE 0xFFFFFF7F
1284#define S_038000_PITCH(x) (((x) & 0x7FF) << 8)
1285#define G_038000_PITCH(x) (((x) >> 8) & 0x7FF)
1286#define C_038000_PITCH 0xFFF800FF
1287#define S_038000_TEX_WIDTH(x) (((x) & 0x1FFF) << 19)
1288#define G_038000_TEX_WIDTH(x) (((x) >> 19) & 0x1FFF)
1289#define C_038000_TEX_WIDTH 0x0007FFFF
1290#define R_038004_SQ_TEX_RESOURCE_WORD1_0 0x038004
1291#define S_038004_TEX_HEIGHT(x) (((x) & 0x1FFF) << 0)
1292#define G_038004_TEX_HEIGHT(x) (((x) >> 0) & 0x1FFF)
1293#define C_038004_TEX_HEIGHT 0xFFFFE000
1294#define S_038004_TEX_DEPTH(x) (((x) & 0x1FFF) << 13)
1295#define G_038004_TEX_DEPTH(x) (((x) >> 13) & 0x1FFF)
1296#define C_038004_TEX_DEPTH 0xFC001FFF
1297#define S_038004_DATA_FORMAT(x) (((x) & 0x3F) << 26)
1298#define G_038004_DATA_FORMAT(x) (((x) >> 26) & 0x3F)
1299#define C_038004_DATA_FORMAT 0x03FFFFFF
1300#define V_038004_COLOR_INVALID 0x00000000
1301#define V_038004_COLOR_8 0x00000001
1302#define V_038004_COLOR_4_4 0x00000002
1303#define V_038004_COLOR_3_3_2 0x00000003
1304#define V_038004_COLOR_16 0x00000005
1305#define V_038004_COLOR_16_FLOAT 0x00000006
1306#define V_038004_COLOR_8_8 0x00000007
1307#define V_038004_COLOR_5_6_5 0x00000008
1308#define V_038004_COLOR_6_5_5 0x00000009
1309#define V_038004_COLOR_1_5_5_5 0x0000000A
1310#define V_038004_COLOR_4_4_4_4 0x0000000B
1311#define V_038004_COLOR_5_5_5_1 0x0000000C
1312#define V_038004_COLOR_32 0x0000000D
1313#define V_038004_COLOR_32_FLOAT 0x0000000E
1314#define V_038004_COLOR_16_16 0x0000000F
1315#define V_038004_COLOR_16_16_FLOAT 0x00000010
1316#define V_038004_COLOR_8_24 0x00000011
1317#define V_038004_COLOR_8_24_FLOAT 0x00000012
1318#define V_038004_COLOR_24_8 0x00000013
1319#define V_038004_COLOR_24_8_FLOAT 0x00000014
1320#define V_038004_COLOR_10_11_11 0x00000015
1321#define V_038004_COLOR_10_11_11_FLOAT 0x00000016
1322#define V_038004_COLOR_11_11_10 0x00000017
1323#define V_038004_COLOR_11_11_10_FLOAT 0x00000018
1324#define V_038004_COLOR_2_10_10_10 0x00000019
1325#define V_038004_COLOR_8_8_8_8 0x0000001A
1326#define V_038004_COLOR_10_10_10_2 0x0000001B
1327#define V_038004_COLOR_X24_8_32_FLOAT 0x0000001C
1328#define V_038004_COLOR_32_32 0x0000001D
1329#define V_038004_COLOR_32_32_FLOAT 0x0000001E
1330#define V_038004_COLOR_16_16_16_16 0x0000001F
1331#define V_038004_COLOR_16_16_16_16_FLOAT 0x00000020
1332#define V_038004_COLOR_32_32_32_32 0x00000022
1333#define V_038004_COLOR_32_32_32_32_FLOAT 0x00000023
1334#define V_038004_FMT_1 0x00000025
1335#define V_038004_FMT_GB_GR 0x00000027
1336#define V_038004_FMT_BG_RG 0x00000028
1337#define V_038004_FMT_32_AS_8 0x00000029
1338#define V_038004_FMT_32_AS_8_8 0x0000002A
1339#define V_038004_FMT_5_9_9_9_SHAREDEXP 0x0000002B
1340#define V_038004_FMT_8_8_8 0x0000002C
1341#define V_038004_FMT_16_16_16 0x0000002D
1342#define V_038004_FMT_16_16_16_FLOAT 0x0000002E
1343#define V_038004_FMT_32_32_32 0x0000002F
1344#define V_038004_FMT_32_32_32_FLOAT 0x00000030
Dave Airlie60b212f2011-02-18 05:51:58 +00001345#define V_038004_FMT_BC1 0x00000031
1346#define V_038004_FMT_BC2 0x00000032
1347#define V_038004_FMT_BC3 0x00000033
1348#define V_038004_FMT_BC4 0x00000034
1349#define V_038004_FMT_BC5 0x00000035
Marek Olšákfe6f0bd2011-05-07 01:09:57 +02001350#define V_038004_FMT_BC6 0x00000036
1351#define V_038004_FMT_BC7 0x00000037
1352#define V_038004_FMT_32_AS_32_32_32_32 0x00000038
Jerome Glisse961fb592010-02-10 22:30:05 +00001353#define R_038010_SQ_TEX_RESOURCE_WORD4_0 0x038010
1354#define S_038010_FORMAT_COMP_X(x) (((x) & 0x3) << 0)
1355#define G_038010_FORMAT_COMP_X(x) (((x) >> 0) & 0x3)
1356#define C_038010_FORMAT_COMP_X 0xFFFFFFFC
1357#define S_038010_FORMAT_COMP_Y(x) (((x) & 0x3) << 2)
1358#define G_038010_FORMAT_COMP_Y(x) (((x) >> 2) & 0x3)
1359#define C_038010_FORMAT_COMP_Y 0xFFFFFFF3
1360#define S_038010_FORMAT_COMP_Z(x) (((x) & 0x3) << 4)
1361#define G_038010_FORMAT_COMP_Z(x) (((x) >> 4) & 0x3)
1362#define C_038010_FORMAT_COMP_Z 0xFFFFFFCF
1363#define S_038010_FORMAT_COMP_W(x) (((x) & 0x3) << 6)
1364#define G_038010_FORMAT_COMP_W(x) (((x) >> 6) & 0x3)
1365#define C_038010_FORMAT_COMP_W 0xFFFFFF3F
1366#define S_038010_NUM_FORMAT_ALL(x) (((x) & 0x3) << 8)
1367#define G_038010_NUM_FORMAT_ALL(x) (((x) >> 8) & 0x3)
1368#define C_038010_NUM_FORMAT_ALL 0xFFFFFCFF
1369#define S_038010_SRF_MODE_ALL(x) (((x) & 0x1) << 10)
1370#define G_038010_SRF_MODE_ALL(x) (((x) >> 10) & 0x1)
1371#define C_038010_SRF_MODE_ALL 0xFFFFFBFF
1372#define S_038010_FORCE_DEGAMMA(x) (((x) & 0x1) << 11)
1373#define G_038010_FORCE_DEGAMMA(x) (((x) >> 11) & 0x1)
1374#define C_038010_FORCE_DEGAMMA 0xFFFFF7FF
1375#define S_038010_ENDIAN_SWAP(x) (((x) & 0x3) << 12)
1376#define G_038010_ENDIAN_SWAP(x) (((x) >> 12) & 0x3)
1377#define C_038010_ENDIAN_SWAP 0xFFFFCFFF
1378#define S_038010_REQUEST_SIZE(x) (((x) & 0x3) << 14)
1379#define G_038010_REQUEST_SIZE(x) (((x) >> 14) & 0x3)
1380#define C_038010_REQUEST_SIZE 0xFFFF3FFF
1381#define S_038010_DST_SEL_X(x) (((x) & 0x7) << 16)
1382#define G_038010_DST_SEL_X(x) (((x) >> 16) & 0x7)
1383#define C_038010_DST_SEL_X 0xFFF8FFFF
1384#define S_038010_DST_SEL_Y(x) (((x) & 0x7) << 19)
1385#define G_038010_DST_SEL_Y(x) (((x) >> 19) & 0x7)
1386#define C_038010_DST_SEL_Y 0xFFC7FFFF
1387#define S_038010_DST_SEL_Z(x) (((x) & 0x7) << 22)
1388#define G_038010_DST_SEL_Z(x) (((x) >> 22) & 0x7)
1389#define C_038010_DST_SEL_Z 0xFE3FFFFF
1390#define S_038010_DST_SEL_W(x) (((x) & 0x7) << 25)
1391#define G_038010_DST_SEL_W(x) (((x) >> 25) & 0x7)
1392#define C_038010_DST_SEL_W 0xF1FFFFFF
Ilija Hadzic3a386122011-10-12 23:29:37 -04001393# define SQ_SEL_X 0
1394# define SQ_SEL_Y 1
1395# define SQ_SEL_Z 2
1396# define SQ_SEL_W 3
1397# define SQ_SEL_0 4
1398# define SQ_SEL_1 5
Jerome Glisse961fb592010-02-10 22:30:05 +00001399#define S_038010_BASE_LEVEL(x) (((x) & 0xF) << 28)
1400#define G_038010_BASE_LEVEL(x) (((x) >> 28) & 0xF)
1401#define C_038010_BASE_LEVEL 0x0FFFFFFF
1402#define R_038014_SQ_TEX_RESOURCE_WORD5_0 0x038014
1403#define S_038014_LAST_LEVEL(x) (((x) & 0xF) << 0)
1404#define G_038014_LAST_LEVEL(x) (((x) >> 0) & 0xF)
1405#define C_038014_LAST_LEVEL 0xFFFFFFF0
1406#define S_038014_BASE_ARRAY(x) (((x) & 0x1FFF) << 4)
1407#define G_038014_BASE_ARRAY(x) (((x) >> 4) & 0x1FFF)
1408#define C_038014_BASE_ARRAY 0xFFFE000F
1409#define S_038014_LAST_ARRAY(x) (((x) & 0x1FFF) << 17)
1410#define G_038014_LAST_ARRAY(x) (((x) >> 17) & 0x1FFF)
1411#define C_038014_LAST_ARRAY 0xC001FFFF
1412#define R_0288A8_SQ_ESGS_RING_ITEMSIZE 0x0288A8
1413#define S_0288A8_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
1414#define G_0288A8_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
1415#define C_0288A8_ITEMSIZE 0xFFFF8000
1416#define R_008C44_SQ_ESGS_RING_SIZE 0x008C44
1417#define S_008C44_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
1418#define G_008C44_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
1419#define C_008C44_MEM_SIZE 0x00000000
1420#define R_0288B0_SQ_ESTMP_RING_ITEMSIZE 0x0288B0
1421#define S_0288B0_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
1422#define G_0288B0_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
1423#define C_0288B0_ITEMSIZE 0xFFFF8000
1424#define R_008C54_SQ_ESTMP_RING_SIZE 0x008C54
1425#define S_008C54_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
1426#define G_008C54_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
1427#define C_008C54_MEM_SIZE 0x00000000
1428#define R_0288C0_SQ_FBUF_RING_ITEMSIZE 0x0288C0
1429#define S_0288C0_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
1430#define G_0288C0_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
1431#define C_0288C0_ITEMSIZE 0xFFFF8000
1432#define R_008C74_SQ_FBUF_RING_SIZE 0x008C74
1433#define S_008C74_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
1434#define G_008C74_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
1435#define C_008C74_MEM_SIZE 0x00000000
1436#define R_0288B4_SQ_GSTMP_RING_ITEMSIZE 0x0288B4
1437#define S_0288B4_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
1438#define G_0288B4_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
1439#define C_0288B4_ITEMSIZE 0xFFFF8000
1440#define R_008C5C_SQ_GSTMP_RING_SIZE 0x008C5C
1441#define S_008C5C_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
1442#define G_008C5C_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
1443#define C_008C5C_MEM_SIZE 0x00000000
1444#define R_0288AC_SQ_GSVS_RING_ITEMSIZE 0x0288AC
1445#define S_0288AC_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
1446#define G_0288AC_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
1447#define C_0288AC_ITEMSIZE 0xFFFF8000
1448#define R_008C4C_SQ_GSVS_RING_SIZE 0x008C4C
1449#define S_008C4C_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
1450#define G_008C4C_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
1451#define C_008C4C_MEM_SIZE 0x00000000
1452#define R_0288BC_SQ_PSTMP_RING_ITEMSIZE 0x0288BC
1453#define S_0288BC_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
1454#define G_0288BC_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
1455#define C_0288BC_ITEMSIZE 0xFFFF8000
1456#define R_008C6C_SQ_PSTMP_RING_SIZE 0x008C6C
1457#define S_008C6C_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
1458#define G_008C6C_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
1459#define C_008C6C_MEM_SIZE 0x00000000
1460#define R_0288C4_SQ_REDUC_RING_ITEMSIZE 0x0288C4
1461#define S_0288C4_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
1462#define G_0288C4_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
1463#define C_0288C4_ITEMSIZE 0xFFFF8000
1464#define R_008C7C_SQ_REDUC_RING_SIZE 0x008C7C
1465#define S_008C7C_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
1466#define G_008C7C_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
1467#define C_008C7C_MEM_SIZE 0x00000000
1468#define R_0288B8_SQ_VSTMP_RING_ITEMSIZE 0x0288B8
1469#define S_0288B8_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
1470#define G_0288B8_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
1471#define C_0288B8_ITEMSIZE 0xFFFF8000
1472#define R_008C64_SQ_VSTMP_RING_SIZE 0x008C64
1473#define S_008C64_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
1474#define G_008C64_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
1475#define C_008C64_MEM_SIZE 0x00000000
1476#define R_0288C8_SQ_GS_VERT_ITEMSIZE 0x0288C8
1477#define S_0288C8_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
1478#define G_0288C8_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
1479#define C_0288C8_ITEMSIZE 0xFFFF8000
1480#define R_028010_DB_DEPTH_INFO 0x028010
1481#define S_028010_FORMAT(x) (((x) & 0x7) << 0)
1482#define G_028010_FORMAT(x) (((x) >> 0) & 0x7)
1483#define C_028010_FORMAT 0xFFFFFFF8
1484#define V_028010_DEPTH_INVALID 0x00000000
1485#define V_028010_DEPTH_16 0x00000001
1486#define V_028010_DEPTH_X8_24 0x00000002
1487#define V_028010_DEPTH_8_24 0x00000003
1488#define V_028010_DEPTH_X8_24_FLOAT 0x00000004
1489#define V_028010_DEPTH_8_24_FLOAT 0x00000005
1490#define V_028010_DEPTH_32_FLOAT 0x00000006
1491#define V_028010_DEPTH_X24_8_32_FLOAT 0x00000007
1492#define S_028010_READ_SIZE(x) (((x) & 0x1) << 3)
1493#define G_028010_READ_SIZE(x) (((x) >> 3) & 0x1)
1494#define C_028010_READ_SIZE 0xFFFFFFF7
1495#define S_028010_ARRAY_MODE(x) (((x) & 0xF) << 15)
1496#define G_028010_ARRAY_MODE(x) (((x) >> 15) & 0xF)
1497#define C_028010_ARRAY_MODE 0xFFF87FFF
Alex Deucher7f813372010-05-20 12:43:52 -04001498#define V_028010_ARRAY_1D_TILED_THIN1 0x00000002
1499#define V_028010_ARRAY_2D_TILED_THIN1 0x00000004
Jerome Glisse961fb592010-02-10 22:30:05 +00001500#define S_028010_TILE_SURFACE_ENABLE(x) (((x) & 0x1) << 25)
1501#define G_028010_TILE_SURFACE_ENABLE(x) (((x) >> 25) & 0x1)
1502#define C_028010_TILE_SURFACE_ENABLE 0xFDFFFFFF
1503#define S_028010_TILE_COMPACT(x) (((x) & 0x1) << 26)
1504#define G_028010_TILE_COMPACT(x) (((x) >> 26) & 0x1)
1505#define C_028010_TILE_COMPACT 0xFBFFFFFF
1506#define S_028010_ZRANGE_PRECISION(x) (((x) & 0x1) << 31)
1507#define G_028010_ZRANGE_PRECISION(x) (((x) >> 31) & 0x1)
1508#define C_028010_ZRANGE_PRECISION 0x7FFFFFFF
1509#define R_028000_DB_DEPTH_SIZE 0x028000
1510#define S_028000_PITCH_TILE_MAX(x) (((x) & 0x3FF) << 0)
1511#define G_028000_PITCH_TILE_MAX(x) (((x) >> 0) & 0x3FF)
1512#define C_028000_PITCH_TILE_MAX 0xFFFFFC00
1513#define S_028000_SLICE_TILE_MAX(x) (((x) & 0xFFFFF) << 10)
1514#define G_028000_SLICE_TILE_MAX(x) (((x) >> 10) & 0xFFFFF)
1515#define C_028000_SLICE_TILE_MAX 0xC00003FF
1516#define R_028004_DB_DEPTH_VIEW 0x028004
1517#define S_028004_SLICE_START(x) (((x) & 0x7FF) << 0)
1518#define G_028004_SLICE_START(x) (((x) >> 0) & 0x7FF)
1519#define C_028004_SLICE_START 0xFFFFF800
1520#define S_028004_SLICE_MAX(x) (((x) & 0x7FF) << 13)
1521#define G_028004_SLICE_MAX(x) (((x) >> 13) & 0x7FF)
1522#define C_028004_SLICE_MAX 0xFF001FFF
1523#define R_028800_DB_DEPTH_CONTROL 0x028800
1524#define S_028800_STENCIL_ENABLE(x) (((x) & 0x1) << 0)
1525#define G_028800_STENCIL_ENABLE(x) (((x) >> 0) & 0x1)
1526#define C_028800_STENCIL_ENABLE 0xFFFFFFFE
1527#define S_028800_Z_ENABLE(x) (((x) & 0x1) << 1)
1528#define G_028800_Z_ENABLE(x) (((x) >> 1) & 0x1)
1529#define C_028800_Z_ENABLE 0xFFFFFFFD
1530#define S_028800_Z_WRITE_ENABLE(x) (((x) & 0x1) << 2)
1531#define G_028800_Z_WRITE_ENABLE(x) (((x) >> 2) & 0x1)
1532#define C_028800_Z_WRITE_ENABLE 0xFFFFFFFB
1533#define S_028800_ZFUNC(x) (((x) & 0x7) << 4)
1534#define G_028800_ZFUNC(x) (((x) >> 4) & 0x7)
1535#define C_028800_ZFUNC 0xFFFFFF8F
1536#define S_028800_BACKFACE_ENABLE(x) (((x) & 0x1) << 7)
1537#define G_028800_BACKFACE_ENABLE(x) (((x) >> 7) & 0x1)
1538#define C_028800_BACKFACE_ENABLE 0xFFFFFF7F
1539#define S_028800_STENCILFUNC(x) (((x) & 0x7) << 8)
1540#define G_028800_STENCILFUNC(x) (((x) >> 8) & 0x7)
1541#define C_028800_STENCILFUNC 0xFFFFF8FF
1542#define S_028800_STENCILFAIL(x) (((x) & 0x7) << 11)
1543#define G_028800_STENCILFAIL(x) (((x) >> 11) & 0x7)
1544#define C_028800_STENCILFAIL 0xFFFFC7FF
1545#define S_028800_STENCILZPASS(x) (((x) & 0x7) << 14)
1546#define G_028800_STENCILZPASS(x) (((x) >> 14) & 0x7)
1547#define C_028800_STENCILZPASS 0xFFFE3FFF
1548#define S_028800_STENCILZFAIL(x) (((x) & 0x7) << 17)
1549#define G_028800_STENCILZFAIL(x) (((x) >> 17) & 0x7)
1550#define C_028800_STENCILZFAIL 0xFFF1FFFF
1551#define S_028800_STENCILFUNC_BF(x) (((x) & 0x7) << 20)
1552#define G_028800_STENCILFUNC_BF(x) (((x) >> 20) & 0x7)
1553#define C_028800_STENCILFUNC_BF 0xFF8FFFFF
1554#define S_028800_STENCILFAIL_BF(x) (((x) & 0x7) << 23)
1555#define G_028800_STENCILFAIL_BF(x) (((x) >> 23) & 0x7)
1556#define C_028800_STENCILFAIL_BF 0xFC7FFFFF
1557#define S_028800_STENCILZPASS_BF(x) (((x) & 0x7) << 26)
1558#define G_028800_STENCILZPASS_BF(x) (((x) >> 26) & 0x7)
1559#define C_028800_STENCILZPASS_BF 0xE3FFFFFF
1560#define S_028800_STENCILZFAIL_BF(x) (((x) & 0x7) << 29)
1561#define G_028800_STENCILZFAIL_BF(x) (((x) >> 29) & 0x7)
1562#define C_028800_STENCILZFAIL_BF 0x1FFFFFFF
Jerome Glissec8c15ff2010-01-18 13:01:36 +01001563
Jerome Glisse3ce0a232009-09-08 10:10:24 +10001564#endif