blob: 4c6ff1c8b5ed317293ff975bff33671ef495f04e [file] [log] [blame]
Alex Deucher43b3cd92012-03-20 17:18:00 -04001/*
2 * Copyright 2011 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 SI_H
25#define SI_H
26
Alex Deucher1bd47d22012-03-20 17:18:10 -040027#define CG_MULT_THERMAL_STATUS 0x714
28#define ASIC_MAX_TEMP(x) ((x) << 0)
29#define ASIC_MAX_TEMP_MASK 0x000001ff
30#define ASIC_MAX_TEMP_SHIFT 0
31#define CTF_TEMP(x) ((x) << 9)
32#define CTF_TEMP_MASK 0x0003fe00
33#define CTF_TEMP_SHIFT 9
34
Alex Deucher0a96d722012-03-20 17:18:11 -040035#define SI_MAX_SH_GPRS 256
36#define SI_MAX_TEMP_GPRS 16
37#define SI_MAX_SH_THREADS 256
38#define SI_MAX_SH_STACK_ENTRIES 4096
39#define SI_MAX_FRC_EOV_CNT 16384
40#define SI_MAX_BACKENDS 8
41#define SI_MAX_BACKENDS_MASK 0xFF
42#define SI_MAX_BACKENDS_PER_SE_MASK 0x0F
43#define SI_MAX_SIMDS 12
44#define SI_MAX_SIMDS_MASK 0x0FFF
45#define SI_MAX_SIMDS_PER_SE_MASK 0x00FF
46#define SI_MAX_PIPES 8
47#define SI_MAX_PIPES_MASK 0xFF
48#define SI_MAX_PIPES_PER_SIMD_MASK 0x3F
49#define SI_MAX_LDS_NUM 0xFFFF
50#define SI_MAX_TCC 16
51#define SI_MAX_TCC_MASK 0xFFFF
52
53#define DMIF_ADDR_CONFIG 0xBD4
54
Alex Deucherc476dde2012-03-20 17:18:12 -040055#define SRBM_STATUS 0xE50
56
Alex Deucher0a96d722012-03-20 17:18:11 -040057#define CC_SYS_RB_BACKEND_DISABLE 0xe80
58#define GC_USER_SYS_RB_BACKEND_DISABLE 0xe84
59
Alex Deucher43b3cd92012-03-20 17:18:00 -040060#define MC_SHARED_CHMAP 0x2004
61#define NOOFCHAN_SHIFT 12
62#define NOOFCHAN_MASK 0x0000f000
Alex Deucher0a96d722012-03-20 17:18:11 -040063#define MC_SHARED_CHREMAP 0x2008
64
65#define MC_ARB_RAMCFG 0x2760
66#define NOOFBANK_SHIFT 0
67#define NOOFBANK_MASK 0x00000003
68#define NOOFRANK_SHIFT 2
69#define NOOFRANK_MASK 0x00000004
70#define NOOFROWS_SHIFT 3
71#define NOOFROWS_MASK 0x00000038
72#define NOOFCOLS_SHIFT 6
73#define NOOFCOLS_MASK 0x000000C0
74#define CHANSIZE_SHIFT 8
75#define CHANSIZE_MASK 0x00000100
76#define NOOFGROUPS_SHIFT 12
77#define NOOFGROUPS_MASK 0x00001000
78
79#define HDP_HOST_PATH_CNTL 0x2C00
80
81#define HDP_ADDR_CONFIG 0x2F48
82#define HDP_MISC_CNTL 0x2F4C
83#define HDP_FLUSH_INVALIDATE_CACHE (1 << 0)
84
85#define BIF_FB_EN 0x5490
86#define FB_READ_EN (1 << 0)
87#define FB_WRITE_EN (1 << 1)
Alex Deucher43b3cd92012-03-20 17:18:00 -040088
89#define DC_LB_MEMORY_SPLIT 0x6b0c
90#define DC_LB_MEMORY_CONFIG(x) ((x) << 20)
91
92#define PRIORITY_A_CNT 0x6b18
93#define PRIORITY_MARK_MASK 0x7fff
94#define PRIORITY_OFF (1 << 16)
95#define PRIORITY_ALWAYS_ON (1 << 20)
96#define PRIORITY_B_CNT 0x6b1c
97
98#define DPG_PIPE_ARBITRATION_CONTROL3 0x6cc8
99# define LATENCY_WATERMARK_MASK(x) ((x) << 16)
100#define DPG_PIPE_LATENCY_CONTROL 0x6ccc
101# define LATENCY_LOW_WATERMARK(x) ((x) << 0)
102# define LATENCY_HIGH_WATERMARK(x) ((x) << 16)
103
Alex Deucher0a96d722012-03-20 17:18:11 -0400104#define GRBM_CNTL 0x8000
105#define GRBM_READ_TIMEOUT(x) ((x) << 0)
106
Alex Deucherc476dde2012-03-20 17:18:12 -0400107#define GRBM_STATUS2 0x8008
108#define RLC_RQ_PENDING (1 << 0)
109#define RLC_BUSY (1 << 8)
110#define TC_BUSY (1 << 9)
111
112#define GRBM_STATUS 0x8010
113#define CMDFIFO_AVAIL_MASK 0x0000000F
114#define RING2_RQ_PENDING (1 << 4)
115#define SRBM_RQ_PENDING (1 << 5)
116#define RING1_RQ_PENDING (1 << 6)
117#define CF_RQ_PENDING (1 << 7)
118#define PF_RQ_PENDING (1 << 8)
119#define GDS_DMA_RQ_PENDING (1 << 9)
120#define GRBM_EE_BUSY (1 << 10)
121#define DB_CLEAN (1 << 12)
122#define CB_CLEAN (1 << 13)
123#define TA_BUSY (1 << 14)
124#define GDS_BUSY (1 << 15)
125#define VGT_BUSY (1 << 17)
126#define IA_BUSY_NO_DMA (1 << 18)
127#define IA_BUSY (1 << 19)
128#define SX_BUSY (1 << 20)
129#define SPI_BUSY (1 << 22)
130#define BCI_BUSY (1 << 23)
131#define SC_BUSY (1 << 24)
132#define PA_BUSY (1 << 25)
133#define DB_BUSY (1 << 26)
134#define CP_COHERENCY_BUSY (1 << 28)
135#define CP_BUSY (1 << 29)
136#define CB_BUSY (1 << 30)
137#define GUI_ACTIVE (1 << 31)
138#define GRBM_STATUS_SE0 0x8014
139#define GRBM_STATUS_SE1 0x8018
140#define SE_DB_CLEAN (1 << 1)
141#define SE_CB_CLEAN (1 << 2)
142#define SE_BCI_BUSY (1 << 22)
143#define SE_VGT_BUSY (1 << 23)
144#define SE_PA_BUSY (1 << 24)
145#define SE_TA_BUSY (1 << 25)
146#define SE_SX_BUSY (1 << 26)
147#define SE_SPI_BUSY (1 << 27)
148#define SE_SC_BUSY (1 << 29)
149#define SE_DB_BUSY (1 << 30)
150#define SE_CB_BUSY (1 << 31)
151
152#define GRBM_SOFT_RESET 0x8020
153#define SOFT_RESET_CP (1 << 0)
154#define SOFT_RESET_CB (1 << 1)
155#define SOFT_RESET_RLC (1 << 2)
156#define SOFT_RESET_DB (1 << 3)
157#define SOFT_RESET_GDS (1 << 4)
158#define SOFT_RESET_PA (1 << 5)
159#define SOFT_RESET_SC (1 << 6)
160#define SOFT_RESET_BCI (1 << 7)
161#define SOFT_RESET_SPI (1 << 8)
162#define SOFT_RESET_SX (1 << 10)
163#define SOFT_RESET_TC (1 << 11)
164#define SOFT_RESET_TA (1 << 12)
165#define SOFT_RESET_VGT (1 << 14)
166#define SOFT_RESET_IA (1 << 15)
167
168#define CP_ME_CNTL 0x86D8
169#define CP_CE_HALT (1 << 24)
170#define CP_PFP_HALT (1 << 26)
171#define CP_ME_HALT (1 << 28)
172
173#define CP_RB0_RPTR 0x8700
174
Alex Deucher0a96d722012-03-20 17:18:11 -0400175#define CP_QUEUE_THRESHOLDS 0x8760
176#define ROQ_IB1_START(x) ((x) << 0)
177#define ROQ_IB2_START(x) ((x) << 8)
178#define CP_MEQ_THRESHOLDS 0x8764
179#define MEQ1_START(x) ((x) << 0)
180#define MEQ2_START(x) ((x) << 8)
181
182#define CP_PERFMON_CNTL 0x87FC
183
184#define VGT_CACHE_INVALIDATION 0x88C4
185#define CACHE_INVALIDATION(x) ((x) << 0)
186#define VC_ONLY 0
187#define TC_ONLY 1
188#define VC_AND_TC 2
189#define AUTO_INVLD_EN(x) ((x) << 6)
190#define NO_AUTO 0
191#define ES_AUTO 1
192#define GS_AUTO 2
193#define ES_AND_GS_AUTO 3
194
195#define VGT_GS_VERTEX_REUSE 0x88D4
196
197#define VGT_NUM_INSTANCES 0x8974
198
199#define CC_GC_SHADER_ARRAY_CONFIG 0x89bc
200#define GC_USER_SHADER_ARRAY_CONFIG 0x89c0
201
202#define PA_CL_ENHANCE 0x8A14
203#define CLIP_VTX_REORDER_ENA (1 << 0)
204#define NUM_CLIP_SEQ(x) ((x) << 1)
205
206#define PA_SC_LINE_STIPPLE_STATE 0x8B10
207
208#define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24
209#define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0)
210#define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16)
211
212#define PA_SC_FIFO_SIZE 0x8BCC
213#define SC_FRONTEND_PRIM_FIFO_SIZE(x) ((x) << 0)
214#define SC_BACKEND_PRIM_FIFO_SIZE(x) ((x) << 6)
215#define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 15)
216#define SC_EARLYZ_TILE_FIFO_SIZE(x) ((x) << 23)
217
218#define SQ_CONFIG 0x8C00
219
220#define SX_DEBUG_1 0x9060
221
222#define SPI_CONFIG_CNTL_1 0x913C
223#define VTX_DONE_DELAY(x) ((x) << 0)
224#define INTERP_ONE_PRIM_PER_ROW (1 << 4)
225
226#define CGTS_TCC_DISABLE 0x9148
227#define CGTS_USER_TCC_DISABLE 0x914C
228#define TCC_DISABLE_MASK 0xFFFF0000
229#define TCC_DISABLE_SHIFT 16
230
231#define CC_RB_BACKEND_DISABLE 0x98F4
232#define BACKEND_DISABLE(x) ((x) << 16)
233#define GB_ADDR_CONFIG 0x98F8
234#define NUM_PIPES(x) ((x) << 0)
235#define NUM_PIPES_MASK 0x00000007
236#define NUM_PIPES_SHIFT 0
237#define PIPE_INTERLEAVE_SIZE(x) ((x) << 4)
238#define PIPE_INTERLEAVE_SIZE_MASK 0x00000070
239#define PIPE_INTERLEAVE_SIZE_SHIFT 4
240#define NUM_SHADER_ENGINES(x) ((x) << 12)
241#define NUM_SHADER_ENGINES_MASK 0x00003000
242#define NUM_SHADER_ENGINES_SHIFT 12
243#define SHADER_ENGINE_TILE_SIZE(x) ((x) << 16)
244#define SHADER_ENGINE_TILE_SIZE_MASK 0x00070000
245#define SHADER_ENGINE_TILE_SIZE_SHIFT 16
246#define NUM_GPUS(x) ((x) << 20)
247#define NUM_GPUS_MASK 0x00700000
248#define NUM_GPUS_SHIFT 20
249#define MULTI_GPU_TILE_SIZE(x) ((x) << 24)
250#define MULTI_GPU_TILE_SIZE_MASK 0x03000000
251#define MULTI_GPU_TILE_SIZE_SHIFT 24
252#define ROW_SIZE(x) ((x) << 28)
253#define ROW_SIZE_MASK 0x30000000
254#define ROW_SIZE_SHIFT 28
255
256#define GB_TILE_MODE0 0x9910
257# define MICRO_TILE_MODE(x) ((x) << 0)
258# define ADDR_SURF_DISPLAY_MICRO_TILING 0
259# define ADDR_SURF_THIN_MICRO_TILING 1
260# define ADDR_SURF_DEPTH_MICRO_TILING 2
261# define ARRAY_MODE(x) ((x) << 2)
262# define ARRAY_LINEAR_GENERAL 0
263# define ARRAY_LINEAR_ALIGNED 1
264# define ARRAY_1D_TILED_THIN1 2
265# define ARRAY_2D_TILED_THIN1 4
266# define PIPE_CONFIG(x) ((x) << 6)
267# define ADDR_SURF_P2 0
268# define ADDR_SURF_P4_8x16 4
269# define ADDR_SURF_P4_16x16 5
270# define ADDR_SURF_P4_16x32 6
271# define ADDR_SURF_P4_32x32 7
272# define ADDR_SURF_P8_16x16_8x16 8
273# define ADDR_SURF_P8_16x32_8x16 9
274# define ADDR_SURF_P8_32x32_8x16 10
275# define ADDR_SURF_P8_16x32_16x16 11
276# define ADDR_SURF_P8_32x32_16x16 12
277# define ADDR_SURF_P8_32x32_16x32 13
278# define ADDR_SURF_P8_32x64_32x32 14
279# define TILE_SPLIT(x) ((x) << 11)
280# define ADDR_SURF_TILE_SPLIT_64B 0
281# define ADDR_SURF_TILE_SPLIT_128B 1
282# define ADDR_SURF_TILE_SPLIT_256B 2
283# define ADDR_SURF_TILE_SPLIT_512B 3
284# define ADDR_SURF_TILE_SPLIT_1KB 4
285# define ADDR_SURF_TILE_SPLIT_2KB 5
286# define ADDR_SURF_TILE_SPLIT_4KB 6
287# define BANK_WIDTH(x) ((x) << 14)
288# define ADDR_SURF_BANK_WIDTH_1 0
289# define ADDR_SURF_BANK_WIDTH_2 1
290# define ADDR_SURF_BANK_WIDTH_4 2
291# define ADDR_SURF_BANK_WIDTH_8 3
292# define BANK_HEIGHT(x) ((x) << 16)
293# define ADDR_SURF_BANK_HEIGHT_1 0
294# define ADDR_SURF_BANK_HEIGHT_2 1
295# define ADDR_SURF_BANK_HEIGHT_4 2
296# define ADDR_SURF_BANK_HEIGHT_8 3
297# define MACRO_TILE_ASPECT(x) ((x) << 18)
298# define ADDR_SURF_MACRO_ASPECT_1 0
299# define ADDR_SURF_MACRO_ASPECT_2 1
300# define ADDR_SURF_MACRO_ASPECT_4 2
301# define ADDR_SURF_MACRO_ASPECT_8 3
302# define NUM_BANKS(x) ((x) << 20)
303# define ADDR_SURF_2_BANK 0
304# define ADDR_SURF_4_BANK 1
305# define ADDR_SURF_8_BANK 2
306# define ADDR_SURF_16_BANK 3
307
308#define CB_PERFCOUNTER0_SELECT0 0x9a20
309#define CB_PERFCOUNTER0_SELECT1 0x9a24
310#define CB_PERFCOUNTER1_SELECT0 0x9a28
311#define CB_PERFCOUNTER1_SELECT1 0x9a2c
312#define CB_PERFCOUNTER2_SELECT0 0x9a30
313#define CB_PERFCOUNTER2_SELECT1 0x9a34
314#define CB_PERFCOUNTER3_SELECT0 0x9a38
315#define CB_PERFCOUNTER3_SELECT1 0x9a3c
316
317#define GC_USER_RB_BACKEND_DISABLE 0x9B7C
318#define BACKEND_DISABLE_MASK 0x00FF0000
319#define BACKEND_DISABLE_SHIFT 16
320
321#define TCP_CHAN_STEER_LO 0xac0c
322#define TCP_CHAN_STEER_HI 0xac10
323
324
Alex Deucher43b3cd92012-03-20 17:18:00 -0400325#endif