1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 /*
3  * Copyright 2014-2022 Advanced Micro Devices, 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  */
24 
25 
26 #ifndef KFD_PM4_OPCODES_H
27 #define KFD_PM4_OPCODES_H
28 
29 enum it_opcode_type {
30 	IT_NOP                               = 0x10,
31 	IT_SET_BASE                          = 0x11,
32 	IT_CLEAR_STATE                       = 0x12,
33 	IT_INDEX_BUFFER_SIZE                 = 0x13,
34 	IT_DISPATCH_DIRECT                   = 0x15,
35 	IT_DISPATCH_INDIRECT                 = 0x16,
36 	IT_ATOMIC_GDS                        = 0x1D,
37 	IT_OCCLUSION_QUERY                   = 0x1F,
38 	IT_SET_PREDICATION                   = 0x20,
39 	IT_REG_RMW                           = 0x21,
40 	IT_COND_EXEC                         = 0x22,
41 	IT_PRED_EXEC                         = 0x23,
42 	IT_DRAW_INDIRECT                     = 0x24,
43 	IT_DRAW_INDEX_INDIRECT               = 0x25,
44 	IT_INDEX_BASE                        = 0x26,
45 	IT_DRAW_INDEX_2                      = 0x27,
46 	IT_CONTEXT_CONTROL                   = 0x28,
47 	IT_INDEX_TYPE                        = 0x2A,
48 	IT_DRAW_INDIRECT_MULTI               = 0x2C,
49 	IT_DRAW_INDEX_AUTO                   = 0x2D,
50 	IT_NUM_INSTANCES                     = 0x2F,
51 	IT_DRAW_INDEX_MULTI_AUTO             = 0x30,
52 	IT_INDIRECT_BUFFER_CNST              = 0x33,
53 	IT_STRMOUT_BUFFER_UPDATE             = 0x34,
54 	IT_DRAW_INDEX_OFFSET_2               = 0x35,
55 	IT_DRAW_PREAMBLE                     = 0x36,
56 	IT_WRITE_DATA                        = 0x37,
57 	IT_DRAW_INDEX_INDIRECT_MULTI         = 0x38,
58 	IT_MEM_SEMAPHORE                     = 0x39,
59 	IT_COPY_DW                           = 0x3B,
60 	IT_WAIT_REG_MEM                      = 0x3C,
61 	IT_INDIRECT_BUFFER                   = 0x3F,
62 	IT_COPY_DATA                         = 0x40,
63 	IT_PFP_SYNC_ME                       = 0x42,
64 	IT_SURFACE_SYNC                      = 0x43,
65 	IT_COND_WRITE                        = 0x45,
66 	IT_EVENT_WRITE                       = 0x46,
67 	IT_EVENT_WRITE_EOP                   = 0x47,
68 	IT_EVENT_WRITE_EOS                   = 0x48,
69 	IT_RELEASE_MEM                       = 0x49,
70 	IT_PREAMBLE_CNTL                     = 0x4A,
71 	IT_DMA_DATA                          = 0x50,
72 	IT_ACQUIRE_MEM                       = 0x58,
73 	IT_REWIND                            = 0x59,
74 	IT_LOAD_UCONFIG_REG                  = 0x5E,
75 	IT_LOAD_SH_REG                       = 0x5F,
76 	IT_LOAD_CONFIG_REG                   = 0x60,
77 	IT_LOAD_CONTEXT_REG                  = 0x61,
78 	IT_SET_CONFIG_REG                    = 0x68,
79 	IT_SET_CONTEXT_REG                   = 0x69,
80 	IT_SET_CONTEXT_REG_INDIRECT          = 0x73,
81 	IT_SET_SH_REG                        = 0x76,
82 	IT_SET_SH_REG_OFFSET                 = 0x77,
83 	IT_SET_QUEUE_REG                     = 0x78,
84 	IT_SET_UCONFIG_REG                   = 0x79,
85 	IT_SCRATCH_RAM_WRITE                 = 0x7D,
86 	IT_SCRATCH_RAM_READ                  = 0x7E,
87 	IT_LOAD_CONST_RAM                    = 0x80,
88 	IT_WRITE_CONST_RAM                   = 0x81,
89 	IT_DUMP_CONST_RAM                    = 0x83,
90 	IT_INCREMENT_CE_COUNTER              = 0x84,
91 	IT_INCREMENT_DE_COUNTER              = 0x85,
92 	IT_WAIT_ON_CE_COUNTER                = 0x86,
93 	IT_WAIT_ON_DE_COUNTER_DIFF           = 0x88,
94 	IT_SWITCH_BUFFER                     = 0x8B,
95 	IT_SET_RESOURCES                     = 0xA0,
96 	IT_MAP_PROCESS                       = 0xA1,
97 	IT_MAP_QUEUES                        = 0xA2,
98 	IT_UNMAP_QUEUES                      = 0xA3,
99 	IT_QUERY_STATUS                      = 0xA4,
100 	IT_RUN_LIST                          = 0xA5,
101 };
102 
103 #define PM4_TYPE_0 0
104 #define PM4_TYPE_2 2
105 #define PM4_TYPE_3 3
106 
107 #endif /* KFD_PM4_OPCODES_H */
108 
109