blob: 7c290a6dd0e38e48691b240692362f5a02e10cb8 [file] [log] [blame]
Alex Deucher0fcdb612010-03-24 13:20:41 -04001/*
2 * Copyright 2010 Advanced Micro Devices, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Alex Deucher
23 */
24#ifndef EVERGREEND_H
25#define EVERGREEND_H
26
27/* Registers */
28
29#define CC_GC_SHADER_PIPE_CONFIG 0x8950
30#define CC_RB_BACKEND_DISABLE 0x98F4
31#define BACKEND_DISABLE(x) ((x) << 16)
32#define CC_SYS_RB_BACKEND_DISABLE 0x3F88
33
34#define CGTS_SYS_TCC_DISABLE 0x3F90
35#define CGTS_TCC_DISABLE 0x9148
36#define CGTS_USER_SYS_TCC_DISABLE 0x3F94
37#define CGTS_USER_TCC_DISABLE 0x914C
38
39#define CONFIG_MEMSIZE 0x5428
40
41#define CP_ME_CNTL 0x86D8
42#define CP_ME_HALT (1<<28)
43#define CP_PFP_HALT (1<<26)
44#define CP_ME_RAM_DATA 0xC160
45#define CP_ME_RAM_RADDR 0xC158
46#define CP_ME_RAM_WADDR 0xC15C
47#define CP_MEQ_THRESHOLDS 0x8764
48#define STQ_SPLIT(x) ((x) << 0)
49#define CP_PERFMON_CNTL 0x87FC
50#define CP_PFP_UCODE_ADDR 0xC150
51#define CP_PFP_UCODE_DATA 0xC154
52#define CP_QUEUE_THRESHOLDS 0x8760
53#define ROQ_IB1_START(x) ((x) << 0)
54#define ROQ_IB2_START(x) ((x) << 8)
55#define CP_RB_CNTL 0xC104
56#define RB_BUFSZ(x) ((x)<<0)
57#define RB_BLKSZ(x) ((x)<<8)
58#define RB_NO_UPDATE (1<<27)
59#define RB_RPTR_WR_ENA (1<<31)
60#define BUF_SWAP_32BIT (2 << 16)
61#define CP_RB_RPTR 0x8700
62#define CP_RB_RPTR_ADDR 0xC10C
63#define CP_RB_RPTR_ADDR_HI 0xC110
64#define CP_RB_RPTR_WR 0xC108
65#define CP_RB_WPTR 0xC114
66#define CP_RB_WPTR_ADDR 0xC118
67#define CP_RB_WPTR_ADDR_HI 0xC11C
68#define CP_RB_WPTR_DELAY 0x8704
69#define CP_SEM_WAIT_TIMER 0x85BC
70
71
72#define GC_USER_SHADER_PIPE_CONFIG 0x8954
73#define INACTIVE_QD_PIPES(x) ((x) << 8)
74#define INACTIVE_QD_PIPES_MASK 0x0000FF00
75#define INACTIVE_SIMDS(x) ((x) << 16)
76#define INACTIVE_SIMDS_MASK 0x00FF0000
77
78#define GRBM_CNTL 0x8000
79#define GRBM_READ_TIMEOUT(x) ((x) << 0)
80#define GRBM_SOFT_RESET 0x8020
Alex Deucher747943e2010-03-24 13:26:36 -040081#define SOFT_RESET_CP (1 << 0)
82#define SOFT_RESET_CB (1 << 1)
83#define SOFT_RESET_DB (1 << 3)
84#define SOFT_RESET_PA (1 << 5)
85#define SOFT_RESET_SC (1 << 6)
86#define SOFT_RESET_SPI (1 << 8)
87#define SOFT_RESET_SH (1 << 9)
88#define SOFT_RESET_SX (1 << 10)
89#define SOFT_RESET_TC (1 << 11)
90#define SOFT_RESET_TA (1 << 12)
91#define SOFT_RESET_VC (1 << 13)
92#define SOFT_RESET_VGT (1 << 14)
93
Alex Deucher0fcdb612010-03-24 13:20:41 -040094#define GRBM_STATUS 0x8010
95#define CMDFIFO_AVAIL_MASK 0x0000000F
Alex Deucher747943e2010-03-24 13:26:36 -040096#define SRBM_RQ_PENDING (1 << 5)
97#define CF_RQ_PENDING (1 << 7)
98#define PF_RQ_PENDING (1 << 8)
99#define GRBM_EE_BUSY (1 << 10)
100#define SX_CLEAN (1 << 11)
101#define DB_CLEAN (1 << 12)
102#define CB_CLEAN (1 << 13)
103#define TA_BUSY (1 << 14)
104#define VGT_BUSY_NO_DMA (1 << 16)
105#define VGT_BUSY (1 << 17)
106#define SX_BUSY (1 << 20)
107#define SH_BUSY (1 << 21)
108#define SPI_BUSY (1 << 22)
109#define SC_BUSY (1 << 24)
110#define PA_BUSY (1 << 25)
111#define DB_BUSY (1 << 26)
112#define CP_COHERENCY_BUSY (1 << 28)
113#define CP_BUSY (1 << 29)
114#define CB_BUSY (1 << 30)
115#define GUI_ACTIVE (1 << 31)
116#define GRBM_STATUS_SE0 0x8014
117#define GRBM_STATUS_SE1 0x8018
118#define SE_SX_CLEAN (1 << 0)
119#define SE_DB_CLEAN (1 << 1)
120#define SE_CB_CLEAN (1 << 2)
121#define SE_TA_BUSY (1 << 25)
122#define SE_SX_BUSY (1 << 26)
123#define SE_SPI_BUSY (1 << 27)
124#define SE_SH_BUSY (1 << 28)
125#define SE_SC_BUSY (1 << 29)
126#define SE_DB_BUSY (1 << 30)
127#define SE_CB_BUSY (1 << 31)
Alex Deucher0fcdb612010-03-24 13:20:41 -0400128
129#define HDP_HOST_PATH_CNTL 0x2C00
130#define HDP_NONSURFACE_BASE 0x2C04
131#define HDP_NONSURFACE_INFO 0x2C08
132#define HDP_NONSURFACE_SIZE 0x2C0C
133#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0
134#define HDP_TILING_CONFIG 0x2F3C
135
136#define MC_SHARED_CHMAP 0x2004
137#define NOOFCHAN_SHIFT 12
138#define NOOFCHAN_MASK 0x00003000
139
140#define MC_ARB_RAMCFG 0x2760
141#define NOOFBANK_SHIFT 0
142#define NOOFBANK_MASK 0x00000003
143#define NOOFRANK_SHIFT 2
144#define NOOFRANK_MASK 0x00000004
145#define NOOFROWS_SHIFT 3
146#define NOOFROWS_MASK 0x00000038
147#define NOOFCOLS_SHIFT 6
148#define NOOFCOLS_MASK 0x000000C0
149#define CHANSIZE_SHIFT 8
150#define CHANSIZE_MASK 0x00000100
151#define BURSTLENGTH_SHIFT 9
152#define BURSTLENGTH_MASK 0x00000200
153#define CHANSIZE_OVERRIDE (1 << 11)
154#define MC_VM_AGP_TOP 0x2028
155#define MC_VM_AGP_BOT 0x202C
156#define MC_VM_AGP_BASE 0x2030
157#define MC_VM_FB_LOCATION 0x2024
158#define MC_VM_MB_L1_TLB0_CNTL 0x2234
159#define MC_VM_MB_L1_TLB1_CNTL 0x2238
160#define MC_VM_MB_L1_TLB2_CNTL 0x223C
161#define MC_VM_MB_L1_TLB3_CNTL 0x2240
162#define ENABLE_L1_TLB (1 << 0)
163#define ENABLE_L1_FRAGMENT_PROCESSING (1 << 1)
164#define SYSTEM_ACCESS_MODE_PA_ONLY (0 << 3)
165#define SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 3)
166#define SYSTEM_ACCESS_MODE_IN_SYS (2 << 3)
167#define SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 3)
168#define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 5)
169#define EFFECTIVE_L1_TLB_SIZE(x) ((x)<<15)
170#define EFFECTIVE_L1_QUEUE_SIZE(x) ((x)<<18)
171#define MC_VM_MD_L1_TLB0_CNTL 0x2654
172#define MC_VM_MD_L1_TLB1_CNTL 0x2658
173#define MC_VM_MD_L1_TLB2_CNTL 0x265C
174#define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C
175#define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038
176#define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034
177
178#define PA_CL_ENHANCE 0x8A14
179#define CLIP_VTX_REORDER_ENA (1 << 0)
180#define NUM_CLIP_SEQ(x) ((x) << 1)
181#define PA_SC_AA_CONFIG 0x28C04
182#define PA_SC_CLIPRECT_RULE 0x2820C
183#define PA_SC_EDGERULE 0x28230
184#define PA_SC_FIFO_SIZE 0x8BCC
185#define SC_PRIM_FIFO_SIZE(x) ((x) << 0)
186#define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 12)
187#define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24
188#define FORCE_EOV_MAX_CLK_CNT(x) ((x)<<0)
189#define FORCE_EOV_MAX_REZ_CNT(x) ((x)<<16)
190#define PA_SC_LINE_STIPPLE 0x28A0C
191#define PA_SC_LINE_STIPPLE_STATE 0x8B10
192
193#define SCRATCH_REG0 0x8500
194#define SCRATCH_REG1 0x8504
195#define SCRATCH_REG2 0x8508
196#define SCRATCH_REG3 0x850C
197#define SCRATCH_REG4 0x8510
198#define SCRATCH_REG5 0x8514
199#define SCRATCH_REG6 0x8518
200#define SCRATCH_REG7 0x851C
201#define SCRATCH_UMSK 0x8540
202#define SCRATCH_ADDR 0x8544
203
204#define SMX_DC_CTL0 0xA020
205#define USE_HASH_FUNCTION (1 << 0)
206#define CACHE_DEPTH(x) ((x) << 1)
207#define FLUSH_ALL_ON_EVENT (1 << 10)
208#define STALL_ON_EVENT (1 << 11)
209#define SMX_EVENT_CTL 0xA02C
210#define ES_FLUSH_CTL(x) ((x) << 0)
211#define GS_FLUSH_CTL(x) ((x) << 3)
212#define ACK_FLUSH_CTL(x) ((x) << 6)
213#define SYNC_FLUSH_CTL (1 << 8)
214
215#define SPI_CONFIG_CNTL 0x9100
216#define GPR_WRITE_PRIORITY(x) ((x) << 0)
217#define SPI_CONFIG_CNTL_1 0x913C
218#define VTX_DONE_DELAY(x) ((x) << 0)
219#define INTERP_ONE_PRIM_PER_ROW (1 << 4)
220#define SPI_INPUT_Z 0x286D8
221#define SPI_PS_IN_CONTROL_0 0x286CC
222#define NUM_INTERP(x) ((x)<<0)
223#define POSITION_ENA (1<<8)
224#define POSITION_CENTROID (1<<9)
225#define POSITION_ADDR(x) ((x)<<10)
226#define PARAM_GEN(x) ((x)<<15)
227#define PARAM_GEN_ADDR(x) ((x)<<19)
228#define BARYC_SAMPLE_CNTL(x) ((x)<<26)
229#define PERSP_GRADIENT_ENA (1<<28)
230#define LINEAR_GRADIENT_ENA (1<<29)
231#define POSITION_SAMPLE (1<<30)
232#define BARYC_AT_SAMPLE_ENA (1<<31)
233
234#define SQ_CONFIG 0x8C00
235#define VC_ENABLE (1 << 0)
236#define EXPORT_SRC_C (1 << 1)
237#define SQ_GPR_RESOURCE_MGMT_1 0x8C04
238#define NUM_PS_GPRS(x) ((x) << 0)
239#define NUM_VS_GPRS(x) ((x) << 16)
240#define NUM_CLAUSE_TEMP_GPRS(x) ((x) << 28)
241#define SQ_GPR_RESOURCE_MGMT_2 0x8C08
242#define NUM_GS_GPRS(x) ((x) << 0)
243#define NUM_ES_GPRS(x) ((x) << 16)
244#define SQ_MS_FIFO_SIZES 0x8CF0
245#define CACHE_FIFO_SIZE(x) ((x) << 0)
246#define FETCH_FIFO_HIWATER(x) ((x) << 8)
247#define DONE_FIFO_HIWATER(x) ((x) << 16)
248#define ALU_UPDATE_FIFO_HIWATER(x) ((x) << 24)
249
250#define SX_DEBUG_1 0x9058
251#define ENABLE_NEW_SMX_ADDRESS (1 << 16)
252#define SX_EXPORT_BUFFER_SIZES 0x900C
253#define COLOR_BUFFER_SIZE(x) ((x) << 0)
254#define POSITION_BUFFER_SIZE(x) ((x) << 8)
255#define SMX_BUFFER_SIZE(x) ((x) << 16)
256#define SX_MISC 0x28350
257
258#define TA_CNTL_AUX 0x9508
259#define DISABLE_CUBE_WRAP (1 << 0)
260#define DISABLE_CUBE_ANISO (1 << 1)
261#define SYNC_GRADIENT (1 << 24)
262#define SYNC_WALKER (1 << 25)
263#define SYNC_ALIGNER (1 << 26)
264
265#define VGT_CACHE_INVALIDATION 0x88C4
266#define CACHE_INVALIDATION(x) ((x)<<0)
267#define VC_ONLY 0
268#define TC_ONLY 1
269#define VC_AND_TC 2
270#define AUTO_INVLD_EN(x) ((x) << 6)
271#define NO_AUTO 0
272#define ES_AUTO 1
273#define GS_AUTO 2
274#define ES_AND_GS_AUTO 3
275#define VGT_GS_VERTEX_REUSE 0x88D4
276#define VGT_NUM_INSTANCES 0x8974
277#define VGT_OUT_DEALLOC_CNTL 0x28C5C
278#define DEALLOC_DIST_MASK 0x0000007F
279#define VGT_VERTEX_REUSE_BLOCK_CNTL 0x28C58
280#define VTX_REUSE_DEPTH_MASK 0x000000FF
281
282#define VM_CONTEXT0_CNTL 0x1410
283#define ENABLE_CONTEXT (1 << 0)
284#define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1)
285#define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4)
286#define VM_CONTEXT1_CNTL 0x1414
287#define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x153C
288#define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x157C
289#define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x155C
290#define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1518
291#define VM_CONTEXT0_REQUEST_RESPONSE 0x1470
292#define REQUEST_TYPE(x) (((x) & 0xf) << 0)
293#define RESPONSE_TYPE_MASK 0x000000F0
294#define RESPONSE_TYPE_SHIFT 4
295#define VM_L2_CNTL 0x1400
296#define ENABLE_L2_CACHE (1 << 0)
297#define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1)
298#define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9)
299#define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 14)
300#define VM_L2_CNTL2 0x1404
301#define INVALIDATE_ALL_L1_TLBS (1 << 0)
302#define INVALIDATE_L2_CACHE (1 << 1)
303#define VM_L2_CNTL3 0x1408
304#define BANK_SELECT(x) ((x) << 0)
305#define CACHE_UPDATE_MODE(x) ((x) << 6)
306#define VM_L2_STATUS 0x140C
307#define L2_BUSY (1 << 0)
308
309#define WAIT_UNTIL 0x8040
310
311#define SRBM_STATUS 0x0E50
Alex Deucher747943e2010-03-24 13:26:36 -0400312#define SRBM_SOFT_RESET 0x0E60
313#define SRBM_SOFT_RESET_ALL_MASK 0x00FEEFA6
314#define SOFT_RESET_BIF (1 << 1)
315#define SOFT_RESET_CG (1 << 2)
316#define SOFT_RESET_DC (1 << 5)
317#define SOFT_RESET_GRBM (1 << 8)
318#define SOFT_RESET_HDP (1 << 9)
319#define SOFT_RESET_IH (1 << 10)
320#define SOFT_RESET_MC (1 << 11)
321#define SOFT_RESET_RLC (1 << 13)
322#define SOFT_RESET_ROM (1 << 14)
323#define SOFT_RESET_SEM (1 << 15)
324#define SOFT_RESET_VMC (1 << 17)
325#define SOFT_RESET_TST (1 << 21)
326#define SOFT_RESET_REGBB (1 << 22)
327#define SOFT_RESET_ORB (1 << 23)
Alex Deucher0fcdb612010-03-24 13:20:41 -0400328
329#endif