drm/amdgpu: switch to amdgpu folder for firmware files v2
[deliverable/linux.git] / drivers / gpu / drm / amd / amdgpu / cikd.h
CommitLineData
d38ceaf9
AD
1/*
2 * Copyright 2012 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 CIK_H
25#define CIK_H
26
27#define MC_SEQ_MISC0__GDDR5__SHIFT 0x1c
28#define MC_SEQ_MISC0__GDDR5_MASK 0xf0000000
29#define MC_SEQ_MISC0__GDDR5_VALUE 5
30
31#define CP_ME_TABLE_SIZE 96
32
33/* display controller offsets used for crtc/cur/lut/grph/viewport/etc. */
34#define CRTC0_REGISTER_OFFSET (0x1b7c - 0x1b7c)
35#define CRTC1_REGISTER_OFFSET (0x1e7c - 0x1b7c)
36#define CRTC2_REGISTER_OFFSET (0x417c - 0x1b7c)
37#define CRTC3_REGISTER_OFFSET (0x447c - 0x1b7c)
38#define CRTC4_REGISTER_OFFSET (0x477c - 0x1b7c)
39#define CRTC5_REGISTER_OFFSET (0x4a7c - 0x1b7c)
40
41#define BONAIRE_GB_ADDR_CONFIG_GOLDEN 0x12010001
42#define HAWAII_GB_ADDR_CONFIG_GOLDEN 0x12011003
43
44#define CIK_RB_BITMAP_WIDTH_PER_SH 2
45#define HAWAII_RB_BITMAP_WIDTH_PER_SH 4
46
47#define AMDGPU_NUM_OF_VMIDS 8
48
49#define PIPEID(x) ((x) << 0)
50#define MEID(x) ((x) << 2)
51#define VMID(x) ((x) << 4)
52#define QUEUEID(x) ((x) << 8)
53
54#define mmCC_DRM_ID_STRAPS 0x1559
55#define CC_DRM_ID_STRAPS__ATI_REV_ID_MASK 0xf0000000
56
57#define mmCHUB_CONTROL 0x619
58#define BYPASS_VM (1 << 0)
59
60#define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 5)
61
62#define mmGRPH_LUT_10BIT_BYPASS_CONTROL 0x1a02
63#define LUT_10BIT_BYPASS_EN (1 << 8)
64
65# define CURSOR_MONO 0
66# define CURSOR_24_1 1
67# define CURSOR_24_8_PRE_MULT 2
68# define CURSOR_24_8_UNPRE_MULT 3
69# define CURSOR_URGENT_ALWAYS 0
70# define CURSOR_URGENT_1_8 1
71# define CURSOR_URGENT_1_4 2
72# define CURSOR_URGENT_3_8 3
73# define CURSOR_URGENT_1_2 4
74
75# define GRPH_DEPTH_8BPP 0
76# define GRPH_DEPTH_16BPP 1
77# define GRPH_DEPTH_32BPP 2
78/* 8 BPP */
79# define GRPH_FORMAT_INDEXED 0
80/* 16 BPP */
81# define GRPH_FORMAT_ARGB1555 0
82# define GRPH_FORMAT_ARGB565 1
83# define GRPH_FORMAT_ARGB4444 2
84# define GRPH_FORMAT_AI88 3
85# define GRPH_FORMAT_MONO16 4
86# define GRPH_FORMAT_BGRA5551 5
87/* 32 BPP */
88# define GRPH_FORMAT_ARGB8888 0
89# define GRPH_FORMAT_ARGB2101010 1
90# define GRPH_FORMAT_32BPP_DIG 2
91# define GRPH_FORMAT_8B_ARGB2101010 3
92# define GRPH_FORMAT_BGRA1010102 4
93# define GRPH_FORMAT_8B_BGRA1010102 5
94# define GRPH_FORMAT_RGB111110 6
95# define GRPH_FORMAT_BGR101111 7
96# define ADDR_SURF_MACRO_TILE_ASPECT_1 0
97# define ADDR_SURF_MACRO_TILE_ASPECT_2 1
98# define ADDR_SURF_MACRO_TILE_ASPECT_4 2
99# define ADDR_SURF_MACRO_TILE_ASPECT_8 3
100# define GRPH_ARRAY_LINEAR_GENERAL 0
101# define GRPH_ARRAY_LINEAR_ALIGNED 1
102# define GRPH_ARRAY_1D_TILED_THIN1 2
103# define GRPH_ARRAY_2D_TILED_THIN1 4
104# define DISPLAY_MICRO_TILING 0
105# define THIN_MICRO_TILING 1
106# define DEPTH_MICRO_TILING 2
107# define ROTATED_MICRO_TILING 4
108# define GRPH_ENDIAN_NONE 0
109# define GRPH_ENDIAN_8IN16 1
110# define GRPH_ENDIAN_8IN32 2
111# define GRPH_ENDIAN_8IN64 3
112# define GRPH_RED_SEL_R 0
113# define GRPH_RED_SEL_G 1
114# define GRPH_RED_SEL_B 2
115# define GRPH_RED_SEL_A 3
116# define GRPH_GREEN_SEL_G 0
117# define GRPH_GREEN_SEL_B 1
118# define GRPH_GREEN_SEL_A 2
119# define GRPH_GREEN_SEL_R 3
120# define GRPH_BLUE_SEL_B 0
121# define GRPH_BLUE_SEL_A 1
122# define GRPH_BLUE_SEL_R 2
123# define GRPH_BLUE_SEL_G 3
124# define GRPH_ALPHA_SEL_A 0
125# define GRPH_ALPHA_SEL_R 1
126# define GRPH_ALPHA_SEL_G 2
127# define GRPH_ALPHA_SEL_B 3
128# define INPUT_GAMMA_USE_LUT 0
129# define INPUT_GAMMA_BYPASS 1
130# define INPUT_GAMMA_SRGB_24 2
131# define INPUT_GAMMA_XVYCC_222 3
132
133# define INPUT_CSC_BYPASS 0
134# define INPUT_CSC_PROG_COEFF 1
135# define INPUT_CSC_PROG_SHARED_MATRIXA 2
136
137# define OUTPUT_CSC_BYPASS 0
138# define OUTPUT_CSC_TV_RGB 1
139# define OUTPUT_CSC_YCBCR_601 2
140# define OUTPUT_CSC_YCBCR_709 3
141# define OUTPUT_CSC_PROG_COEFF 4
142# define OUTPUT_CSC_PROG_SHARED_MATRIXB 5
143
144# define DEGAMMA_BYPASS 0
145# define DEGAMMA_SRGB_24 1
146# define DEGAMMA_XVYCC_222 2
147# define GAMUT_REMAP_BYPASS 0
148# define GAMUT_REMAP_PROG_COEFF 1
149# define GAMUT_REMAP_PROG_SHARED_MATRIXA 2
150# define GAMUT_REMAP_PROG_SHARED_MATRIXB 3
151
152# define REGAMMA_BYPASS 0
153# define REGAMMA_SRGB_24 1
154# define REGAMMA_XVYCC_222 2
155# define REGAMMA_PROG_A 3
156# define REGAMMA_PROG_B 4
157
158# define FMT_CLAMP_6BPC 0
159# define FMT_CLAMP_8BPC 1
160# define FMT_CLAMP_10BPC 2
161
162# define HDMI_24BIT_DEEP_COLOR 0
163# define HDMI_30BIT_DEEP_COLOR 1
164# define HDMI_36BIT_DEEP_COLOR 2
165# define HDMI_ACR_HW 0
166# define HDMI_ACR_32 1
167# define HDMI_ACR_44 2
168# define HDMI_ACR_48 3
169# define HDMI_ACR_X1 1
170# define HDMI_ACR_X2 2
171# define HDMI_ACR_X4 4
172# define AFMT_AVI_INFO_Y_RGB 0
173# define AFMT_AVI_INFO_Y_YCBCR422 1
174# define AFMT_AVI_INFO_Y_YCBCR444 2
175
176#define NO_AUTO 0
177#define ES_AUTO 1
178#define GS_AUTO 2
179#define ES_AND_GS_AUTO 3
180
181# define ARRAY_MODE(x) ((x) << 2)
182# define PIPE_CONFIG(x) ((x) << 6)
183# define TILE_SPLIT(x) ((x) << 11)
184# define MICRO_TILE_MODE_NEW(x) ((x) << 22)
185# define SAMPLE_SPLIT(x) ((x) << 25)
186# define BANK_WIDTH(x) ((x) << 0)
187# define BANK_HEIGHT(x) ((x) << 2)
188# define MACRO_TILE_ASPECT(x) ((x) << 4)
189# define NUM_BANKS(x) ((x) << 6)
190
191#define MSG_ENTER_RLC_SAFE_MODE 1
192#define MSG_EXIT_RLC_SAFE_MODE 0
193
194/*
195 * PM4
196 */
197#define PACKET_TYPE0 0
198#define PACKET_TYPE1 1
199#define PACKET_TYPE2 2
200#define PACKET_TYPE3 3
201
202#define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3)
203#define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF)
204#define CP_PACKET0_GET_REG(h) ((h) & 0xFFFF)
205#define CP_PACKET3_GET_OPCODE(h) (((h) >> 8) & 0xFF)
206#define PACKET0(reg, n) ((PACKET_TYPE0 << 30) | \
207 ((reg) & 0xFFFF) | \
208 ((n) & 0x3FFF) << 16)
209#define CP_PACKET2 0x80000000
210#define PACKET2_PAD_SHIFT 0
211#define PACKET2_PAD_MASK (0x3fffffff << 0)
212
213#define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
214
215#define PACKET3(op, n) ((PACKET_TYPE3 << 30) | \
216 (((op) & 0xFF) << 8) | \
217 ((n) & 0x3FFF) << 16)
218
219#define PACKET3_COMPUTE(op, n) (PACKET3(op, n) | 1 << 1)
220
221/* Packet 3 types */
222#define PACKET3_NOP 0x10
223#define PACKET3_SET_BASE 0x11
224#define PACKET3_BASE_INDEX(x) ((x) << 0)
225#define CE_PARTITION_BASE 3
226#define PACKET3_CLEAR_STATE 0x12
227#define PACKET3_INDEX_BUFFER_SIZE 0x13
228#define PACKET3_DISPATCH_DIRECT 0x15
229#define PACKET3_DISPATCH_INDIRECT 0x16
230#define PACKET3_ATOMIC_GDS 0x1D
231#define PACKET3_ATOMIC_MEM 0x1E
232#define PACKET3_OCCLUSION_QUERY 0x1F
233#define PACKET3_SET_PREDICATION 0x20
234#define PACKET3_REG_RMW 0x21
235#define PACKET3_COND_EXEC 0x22
236#define PACKET3_PRED_EXEC 0x23
237#define PACKET3_DRAW_INDIRECT 0x24
238#define PACKET3_DRAW_INDEX_INDIRECT 0x25
239#define PACKET3_INDEX_BASE 0x26
240#define PACKET3_DRAW_INDEX_2 0x27
241#define PACKET3_CONTEXT_CONTROL 0x28
242#define PACKET3_INDEX_TYPE 0x2A
243#define PACKET3_DRAW_INDIRECT_MULTI 0x2C
244#define PACKET3_DRAW_INDEX_AUTO 0x2D
245#define PACKET3_NUM_INSTANCES 0x2F
246#define PACKET3_DRAW_INDEX_MULTI_AUTO 0x30
247#define PACKET3_INDIRECT_BUFFER_CONST 0x33
248#define PACKET3_STRMOUT_BUFFER_UPDATE 0x34
249#define PACKET3_DRAW_INDEX_OFFSET_2 0x35
250#define PACKET3_DRAW_PREAMBLE 0x36
251#define PACKET3_WRITE_DATA 0x37
252#define WRITE_DATA_DST_SEL(x) ((x) << 8)
253 /* 0 - register
254 * 1 - memory (sync - via GRBM)
255 * 2 - gl2
256 * 3 - gds
257 * 4 - reserved
258 * 5 - memory (async - direct)
259 */
260#define WR_ONE_ADDR (1 << 16)
261#define WR_CONFIRM (1 << 20)
262#define WRITE_DATA_CACHE_POLICY(x) ((x) << 25)
263 /* 0 - LRU
264 * 1 - Stream
265 */
266#define WRITE_DATA_ENGINE_SEL(x) ((x) << 30)
267 /* 0 - me
268 * 1 - pfp
269 * 2 - ce
270 */
271#define PACKET3_DRAW_INDEX_INDIRECT_MULTI 0x38
272#define PACKET3_MEM_SEMAPHORE 0x39
273# define PACKET3_SEM_USE_MAILBOX (0x1 << 16)
274# define PACKET3_SEM_SEL_SIGNAL_TYPE (0x1 << 20) /* 0 = increment, 1 = write 1 */
275# define PACKET3_SEM_CLIENT_CODE ((x) << 24) /* 0 = CP, 1 = CB, 2 = DB */
276# define PACKET3_SEM_SEL_SIGNAL (0x6 << 29)
277# define PACKET3_SEM_SEL_WAIT (0x7 << 29)
278#define PACKET3_COPY_DW 0x3B
279#define PACKET3_WAIT_REG_MEM 0x3C
280#define WAIT_REG_MEM_FUNCTION(x) ((x) << 0)
281 /* 0 - always
282 * 1 - <
283 * 2 - <=
284 * 3 - ==
285 * 4 - !=
286 * 5 - >=
287 * 6 - >
288 */
289#define WAIT_REG_MEM_MEM_SPACE(x) ((x) << 4)
290 /* 0 - reg
291 * 1 - mem
292 */
293#define WAIT_REG_MEM_OPERATION(x) ((x) << 6)
294 /* 0 - wait_reg_mem
295 * 1 - wr_wait_wr_reg
296 */
297#define WAIT_REG_MEM_ENGINE(x) ((x) << 8)
298 /* 0 - me
299 * 1 - pfp
300 */
301#define PACKET3_INDIRECT_BUFFER 0x3F
302#define INDIRECT_BUFFER_TCL2_VOLATILE (1 << 22)
303#define INDIRECT_BUFFER_VALID (1 << 23)
304#define INDIRECT_BUFFER_CACHE_POLICY(x) ((x) << 28)
305 /* 0 - LRU
306 * 1 - Stream
307 * 2 - Bypass
308 */
309#define PACKET3_COPY_DATA 0x40
310#define PACKET3_PFP_SYNC_ME 0x42
311#define PACKET3_SURFACE_SYNC 0x43
312# define PACKET3_DEST_BASE_0_ENA (1 << 0)
313# define PACKET3_DEST_BASE_1_ENA (1 << 1)
314# define PACKET3_CB0_DEST_BASE_ENA (1 << 6)
315# define PACKET3_CB1_DEST_BASE_ENA (1 << 7)
316# define PACKET3_CB2_DEST_BASE_ENA (1 << 8)
317# define PACKET3_CB3_DEST_BASE_ENA (1 << 9)
318# define PACKET3_CB4_DEST_BASE_ENA (1 << 10)
319# define PACKET3_CB5_DEST_BASE_ENA (1 << 11)
320# define PACKET3_CB6_DEST_BASE_ENA (1 << 12)
321# define PACKET3_CB7_DEST_BASE_ENA (1 << 13)
322# define PACKET3_DB_DEST_BASE_ENA (1 << 14)
323# define PACKET3_TCL1_VOL_ACTION_ENA (1 << 15)
324# define PACKET3_TC_VOL_ACTION_ENA (1 << 16) /* L2 */
325# define PACKET3_TC_WB_ACTION_ENA (1 << 18) /* L2 */
326# define PACKET3_DEST_BASE_2_ENA (1 << 19)
327# define PACKET3_DEST_BASE_3_ENA (1 << 21)
328# define PACKET3_TCL1_ACTION_ENA (1 << 22)
329# define PACKET3_TC_ACTION_ENA (1 << 23) /* L2 */
330# define PACKET3_CB_ACTION_ENA (1 << 25)
331# define PACKET3_DB_ACTION_ENA (1 << 26)
332# define PACKET3_SH_KCACHE_ACTION_ENA (1 << 27)
333# define PACKET3_SH_KCACHE_VOL_ACTION_ENA (1 << 28)
334# define PACKET3_SH_ICACHE_ACTION_ENA (1 << 29)
335#define PACKET3_COND_WRITE 0x45
336#define PACKET3_EVENT_WRITE 0x46
337#define EVENT_TYPE(x) ((x) << 0)
338#define EVENT_INDEX(x) ((x) << 8)
339 /* 0 - any non-TS event
340 * 1 - ZPASS_DONE, PIXEL_PIPE_STAT_*
341 * 2 - SAMPLE_PIPELINESTAT
342 * 3 - SAMPLE_STREAMOUTSTAT*
343 * 4 - *S_PARTIAL_FLUSH
344 * 5 - EOP events
345 * 6 - EOS events
346 */
347#define PACKET3_EVENT_WRITE_EOP 0x47
348#define EOP_TCL1_VOL_ACTION_EN (1 << 12)
349#define EOP_TC_VOL_ACTION_EN (1 << 13) /* L2 */
350#define EOP_TC_WB_ACTION_EN (1 << 15) /* L2 */
351#define EOP_TCL1_ACTION_EN (1 << 16)
352#define EOP_TC_ACTION_EN (1 << 17) /* L2 */
353#define EOP_TCL2_VOLATILE (1 << 24)
354#define EOP_CACHE_POLICY(x) ((x) << 25)
355 /* 0 - LRU
356 * 1 - Stream
357 * 2 - Bypass
358 */
359#define DATA_SEL(x) ((x) << 29)
360 /* 0 - discard
361 * 1 - send low 32bit data
362 * 2 - send 64bit data
363 * 3 - send 64bit GPU counter value
364 * 4 - send 64bit sys counter value
365 */
366#define INT_SEL(x) ((x) << 24)
367 /* 0 - none
368 * 1 - interrupt only (DATA_SEL = 0)
369 * 2 - interrupt when data write is confirmed
370 */
371#define DST_SEL(x) ((x) << 16)
372 /* 0 - MC
373 * 1 - TC/L2
374 */
375#define PACKET3_EVENT_WRITE_EOS 0x48
376#define PACKET3_RELEASE_MEM 0x49
377#define PACKET3_PREAMBLE_CNTL 0x4A
378# define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE (2 << 28)
379# define PACKET3_PREAMBLE_END_CLEAR_STATE (3 << 28)
380#define PACKET3_DMA_DATA 0x50
381/* 1. header
382 * 2. CONTROL
383 * 3. SRC_ADDR_LO or DATA [31:0]
384 * 4. SRC_ADDR_HI [31:0]
385 * 5. DST_ADDR_LO [31:0]
386 * 6. DST_ADDR_HI [7:0]
387 * 7. COMMAND [30:21] | BYTE_COUNT [20:0]
388 */
389/* CONTROL */
390# define PACKET3_DMA_DATA_ENGINE(x) ((x) << 0)
391 /* 0 - ME
392 * 1 - PFP
393 */
394# define PACKET3_DMA_DATA_SRC_CACHE_POLICY(x) ((x) << 13)
395 /* 0 - LRU
396 * 1 - Stream
397 * 2 - Bypass
398 */
399# define PACKET3_DMA_DATA_SRC_VOLATILE (1 << 15)
400# define PACKET3_DMA_DATA_DST_SEL(x) ((x) << 20)
401 /* 0 - DST_ADDR using DAS
402 * 1 - GDS
403 * 3 - DST_ADDR using L2
404 */
405# define PACKET3_DMA_DATA_DST_CACHE_POLICY(x) ((x) << 25)
406 /* 0 - LRU
407 * 1 - Stream
408 * 2 - Bypass
409 */
410# define PACKET3_DMA_DATA_DST_VOLATILE (1 << 27)
411# define PACKET3_DMA_DATA_SRC_SEL(x) ((x) << 29)
412 /* 0 - SRC_ADDR using SAS
413 * 1 - GDS
414 * 2 - DATA
415 * 3 - SRC_ADDR using L2
416 */
417# define PACKET3_DMA_DATA_CP_SYNC (1 << 31)
418/* COMMAND */
419# define PACKET3_DMA_DATA_DIS_WC (1 << 21)
420# define PACKET3_DMA_DATA_CMD_SRC_SWAP(x) ((x) << 22)
421 /* 0 - none
422 * 1 - 8 in 16
423 * 2 - 8 in 32
424 * 3 - 8 in 64
425 */
426# define PACKET3_DMA_DATA_CMD_DST_SWAP(x) ((x) << 24)
427 /* 0 - none
428 * 1 - 8 in 16
429 * 2 - 8 in 32
430 * 3 - 8 in 64
431 */
432# define PACKET3_DMA_DATA_CMD_SAS (1 << 26)
433 /* 0 - memory
434 * 1 - register
435 */
436# define PACKET3_DMA_DATA_CMD_DAS (1 << 27)
437 /* 0 - memory
438 * 1 - register
439 */
440# define PACKET3_DMA_DATA_CMD_SAIC (1 << 28)
441# define PACKET3_DMA_DATA_CMD_DAIC (1 << 29)
442# define PACKET3_DMA_DATA_CMD_RAW_WAIT (1 << 30)
443#define PACKET3_AQUIRE_MEM 0x58
444#define PACKET3_REWIND 0x59
445#define PACKET3_LOAD_UCONFIG_REG 0x5E
446#define PACKET3_LOAD_SH_REG 0x5F
447#define PACKET3_LOAD_CONFIG_REG 0x60
448#define PACKET3_LOAD_CONTEXT_REG 0x61
449#define PACKET3_SET_CONFIG_REG 0x68
450#define PACKET3_SET_CONFIG_REG_START 0x00002000
451#define PACKET3_SET_CONFIG_REG_END 0x00002c00
452#define PACKET3_SET_CONTEXT_REG 0x69
453#define PACKET3_SET_CONTEXT_REG_START 0x0000a000
454#define PACKET3_SET_CONTEXT_REG_END 0x0000a400
455#define PACKET3_SET_CONTEXT_REG_INDIRECT 0x73
456#define PACKET3_SET_SH_REG 0x76
457#define PACKET3_SET_SH_REG_START 0x00002c00
458#define PACKET3_SET_SH_REG_END 0x00003000
459#define PACKET3_SET_SH_REG_OFFSET 0x77
460#define PACKET3_SET_QUEUE_REG 0x78
461#define PACKET3_SET_UCONFIG_REG 0x79
462#define PACKET3_SET_UCONFIG_REG_START 0x0000c000
463#define PACKET3_SET_UCONFIG_REG_END 0x0000c400
464#define PACKET3_SCRATCH_RAM_WRITE 0x7D
465#define PACKET3_SCRATCH_RAM_READ 0x7E
466#define PACKET3_LOAD_CONST_RAM 0x80
467#define PACKET3_WRITE_CONST_RAM 0x81
468#define PACKET3_DUMP_CONST_RAM 0x83
469#define PACKET3_INCREMENT_CE_COUNTER 0x84
470#define PACKET3_INCREMENT_DE_COUNTER 0x85
471#define PACKET3_WAIT_ON_CE_COUNTER 0x86
472#define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88
473#define PACKET3_SWITCH_BUFFER 0x8B
474
475/* SDMA - first instance at 0xd000, second at 0xd800 */
476#define SDMA0_REGISTER_OFFSET 0x0 /* not a register */
477#define SDMA1_REGISTER_OFFSET 0x200 /* not a register */
478#define SDMA_MAX_INSTANCE 2
479
480#define SDMA_PACKET(op, sub_op, e) ((((e) & 0xFFFF) << 16) | \
481 (((sub_op) & 0xFF) << 8) | \
482 (((op) & 0xFF) << 0))
483/* sDMA opcodes */
484#define SDMA_OPCODE_NOP 0
485#define SDMA_OPCODE_COPY 1
486# define SDMA_COPY_SUB_OPCODE_LINEAR 0
487# define SDMA_COPY_SUB_OPCODE_TILED 1
488# define SDMA_COPY_SUB_OPCODE_SOA 3
489# define SDMA_COPY_SUB_OPCODE_LINEAR_SUB_WINDOW 4
490# define SDMA_COPY_SUB_OPCODE_TILED_SUB_WINDOW 5
491# define SDMA_COPY_SUB_OPCODE_T2T_SUB_WINDOW 6
492#define SDMA_OPCODE_WRITE 2
493# define SDMA_WRITE_SUB_OPCODE_LINEAR 0
494# define SDMA_WRTIE_SUB_OPCODE_TILED 1
495#define SDMA_OPCODE_INDIRECT_BUFFER 4
496#define SDMA_OPCODE_FENCE 5
497#define SDMA_OPCODE_TRAP 6
498#define SDMA_OPCODE_SEMAPHORE 7
499# define SDMA_SEMAPHORE_EXTRA_O (1 << 13)
500 /* 0 - increment
501 * 1 - write 1
502 */
503# define SDMA_SEMAPHORE_EXTRA_S (1 << 14)
504 /* 0 - wait
505 * 1 - signal
506 */
507# define SDMA_SEMAPHORE_EXTRA_M (1 << 15)
508 /* mailbox */
509#define SDMA_OPCODE_POLL_REG_MEM 8
510# define SDMA_POLL_REG_MEM_EXTRA_OP(x) ((x) << 10)
511 /* 0 - wait_reg_mem
512 * 1 - wr_wait_wr_reg
513 */
514# define SDMA_POLL_REG_MEM_EXTRA_FUNC(x) ((x) << 12)
515 /* 0 - always
516 * 1 - <
517 * 2 - <=
518 * 3 - ==
519 * 4 - !=
520 * 5 - >=
521 * 6 - >
522 */
523# define SDMA_POLL_REG_MEM_EXTRA_M (1 << 15)
524 /* 0 = register
525 * 1 = memory
526 */
527#define SDMA_OPCODE_COND_EXEC 9
528#define SDMA_OPCODE_CONSTANT_FILL 11
529# define SDMA_CONSTANT_FILL_EXTRA_SIZE(x) ((x) << 14)
530 /* 0 = byte fill
531 * 2 = DW fill
532 */
533#define SDMA_OPCODE_GENERATE_PTE_PDE 12
534#define SDMA_OPCODE_TIMESTAMP 13
535# define SDMA_TIMESTAMP_SUB_OPCODE_SET_LOCAL 0
536# define SDMA_TIMESTAMP_SUB_OPCODE_GET_LOCAL 1
537# define SDMA_TIMESTAMP_SUB_OPCODE_GET_GLOBAL 2
538#define SDMA_OPCODE_SRBM_WRITE 14
539# define SDMA_SRBM_WRITE_EXTRA_BYTE_ENABLE(x) ((x) << 12)
540 /* byte mask */
541
542#define VCE_CMD_NO_OP 0x00000000
543#define VCE_CMD_END 0x00000001
544#define VCE_CMD_IB 0x00000002
545#define VCE_CMD_FENCE 0x00000003
546#define VCE_CMD_TRAP 0x00000004
547#define VCE_CMD_IB_AUTO 0x00000005
548#define VCE_CMD_SEMAPHORE 0x00000006
549
550#endif
This page took 0.047946 seconds and 5 git commands to generate.