1*d87f36a0SRajneesh Bhardwaj /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2ed6e6a34SBen Goz /* 3*d87f36a0SRajneesh Bhardwaj * Copyright 2014-2022 Advanced Micro Devices, Inc. 4ed6e6a34SBen Goz * 5ed6e6a34SBen Goz * Permission is hereby granted, free of charge, to any person obtaining a 6ed6e6a34SBen Goz * copy of this software and associated documentation files (the "Software"), 7ed6e6a34SBen Goz * to deal in the Software without restriction, including without limitation 8ed6e6a34SBen Goz * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9ed6e6a34SBen Goz * and/or sell copies of the Software, and to permit persons to whom the 10ed6e6a34SBen Goz * Software is furnished to do so, subject to the following conditions: 11ed6e6a34SBen Goz * 12ed6e6a34SBen Goz * The above copyright notice and this permission notice shall be included in 13ed6e6a34SBen Goz * all copies or substantial portions of the Software. 14ed6e6a34SBen Goz * 15ed6e6a34SBen Goz * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16ed6e6a34SBen Goz * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17ed6e6a34SBen Goz * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18ed6e6a34SBen Goz * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 19ed6e6a34SBen Goz * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20ed6e6a34SBen Goz * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21ed6e6a34SBen Goz * OTHER DEALINGS IN THE SOFTWARE. 22ed6e6a34SBen Goz * 23ed6e6a34SBen Goz */ 24ed6e6a34SBen Goz 25ed6e6a34SBen Goz 26ed6e6a34SBen Goz #ifndef KFD_PM4_OPCODES_H 27ed6e6a34SBen Goz #define KFD_PM4_OPCODES_H 28ed6e6a34SBen Goz 29ed6e6a34SBen Goz enum it_opcode_type { 30ed6e6a34SBen Goz IT_NOP = 0x10, 31ed6e6a34SBen Goz IT_SET_BASE = 0x11, 32ed6e6a34SBen Goz IT_CLEAR_STATE = 0x12, 33ed6e6a34SBen Goz IT_INDEX_BUFFER_SIZE = 0x13, 34ed6e6a34SBen Goz IT_DISPATCH_DIRECT = 0x15, 35ed6e6a34SBen Goz IT_DISPATCH_INDIRECT = 0x16, 36ed6e6a34SBen Goz IT_ATOMIC_GDS = 0x1D, 37ed6e6a34SBen Goz IT_OCCLUSION_QUERY = 0x1F, 38ed6e6a34SBen Goz IT_SET_PREDICATION = 0x20, 39ed6e6a34SBen Goz IT_REG_RMW = 0x21, 40ed6e6a34SBen Goz IT_COND_EXEC = 0x22, 41ed6e6a34SBen Goz IT_PRED_EXEC = 0x23, 42ed6e6a34SBen Goz IT_DRAW_INDIRECT = 0x24, 43ed6e6a34SBen Goz IT_DRAW_INDEX_INDIRECT = 0x25, 44ed6e6a34SBen Goz IT_INDEX_BASE = 0x26, 45ed6e6a34SBen Goz IT_DRAW_INDEX_2 = 0x27, 46ed6e6a34SBen Goz IT_CONTEXT_CONTROL = 0x28, 47ed6e6a34SBen Goz IT_INDEX_TYPE = 0x2A, 48ed6e6a34SBen Goz IT_DRAW_INDIRECT_MULTI = 0x2C, 49ed6e6a34SBen Goz IT_DRAW_INDEX_AUTO = 0x2D, 50ed6e6a34SBen Goz IT_NUM_INSTANCES = 0x2F, 51ed6e6a34SBen Goz IT_DRAW_INDEX_MULTI_AUTO = 0x30, 52ed6e6a34SBen Goz IT_INDIRECT_BUFFER_CNST = 0x33, 53ed6e6a34SBen Goz IT_STRMOUT_BUFFER_UPDATE = 0x34, 54ed6e6a34SBen Goz IT_DRAW_INDEX_OFFSET_2 = 0x35, 55ed6e6a34SBen Goz IT_DRAW_PREAMBLE = 0x36, 56ed6e6a34SBen Goz IT_WRITE_DATA = 0x37, 57ed6e6a34SBen Goz IT_DRAW_INDEX_INDIRECT_MULTI = 0x38, 58ed6e6a34SBen Goz IT_MEM_SEMAPHORE = 0x39, 59ed6e6a34SBen Goz IT_COPY_DW = 0x3B, 60ed6e6a34SBen Goz IT_WAIT_REG_MEM = 0x3C, 61ed6e6a34SBen Goz IT_INDIRECT_BUFFER = 0x3F, 62ed6e6a34SBen Goz IT_COPY_DATA = 0x40, 63ed6e6a34SBen Goz IT_PFP_SYNC_ME = 0x42, 64ed6e6a34SBen Goz IT_SURFACE_SYNC = 0x43, 65ed6e6a34SBen Goz IT_COND_WRITE = 0x45, 66ed6e6a34SBen Goz IT_EVENT_WRITE = 0x46, 67ed6e6a34SBen Goz IT_EVENT_WRITE_EOP = 0x47, 68ed6e6a34SBen Goz IT_EVENT_WRITE_EOS = 0x48, 69ed6e6a34SBen Goz IT_RELEASE_MEM = 0x49, 70ed6e6a34SBen Goz IT_PREAMBLE_CNTL = 0x4A, 71ed6e6a34SBen Goz IT_DMA_DATA = 0x50, 72ed6e6a34SBen Goz IT_ACQUIRE_MEM = 0x58, 73ed6e6a34SBen Goz IT_REWIND = 0x59, 74ed6e6a34SBen Goz IT_LOAD_UCONFIG_REG = 0x5E, 75ed6e6a34SBen Goz IT_LOAD_SH_REG = 0x5F, 76ed6e6a34SBen Goz IT_LOAD_CONFIG_REG = 0x60, 77ed6e6a34SBen Goz IT_LOAD_CONTEXT_REG = 0x61, 78ed6e6a34SBen Goz IT_SET_CONFIG_REG = 0x68, 79ed6e6a34SBen Goz IT_SET_CONTEXT_REG = 0x69, 80ed6e6a34SBen Goz IT_SET_CONTEXT_REG_INDIRECT = 0x73, 81ed6e6a34SBen Goz IT_SET_SH_REG = 0x76, 82ed6e6a34SBen Goz IT_SET_SH_REG_OFFSET = 0x77, 83ed6e6a34SBen Goz IT_SET_QUEUE_REG = 0x78, 84ed6e6a34SBen Goz IT_SET_UCONFIG_REG = 0x79, 85ed6e6a34SBen Goz IT_SCRATCH_RAM_WRITE = 0x7D, 86ed6e6a34SBen Goz IT_SCRATCH_RAM_READ = 0x7E, 87ed6e6a34SBen Goz IT_LOAD_CONST_RAM = 0x80, 88ed6e6a34SBen Goz IT_WRITE_CONST_RAM = 0x81, 89ed6e6a34SBen Goz IT_DUMP_CONST_RAM = 0x83, 90ed6e6a34SBen Goz IT_INCREMENT_CE_COUNTER = 0x84, 91ed6e6a34SBen Goz IT_INCREMENT_DE_COUNTER = 0x85, 92ed6e6a34SBen Goz IT_WAIT_ON_CE_COUNTER = 0x86, 93ed6e6a34SBen Goz IT_WAIT_ON_DE_COUNTER_DIFF = 0x88, 94ed6e6a34SBen Goz IT_SWITCH_BUFFER = 0x8B, 95ed6e6a34SBen Goz IT_SET_RESOURCES = 0xA0, 96ed6e6a34SBen Goz IT_MAP_PROCESS = 0xA1, 97ed6e6a34SBen Goz IT_MAP_QUEUES = 0xA2, 98ed6e6a34SBen Goz IT_UNMAP_QUEUES = 0xA3, 99ed6e6a34SBen Goz IT_QUERY_STATUS = 0xA4, 100ed6e6a34SBen Goz IT_RUN_LIST = 0xA5, 101ed6e6a34SBen Goz }; 102ed6e6a34SBen Goz 103ed6e6a34SBen Goz #define PM4_TYPE_0 0 104ed6e6a34SBen Goz #define PM4_TYPE_2 2 105ed6e6a34SBen Goz #define PM4_TYPE_3 3 106ed6e6a34SBen Goz 107ed6e6a34SBen Goz #endif /* KFD_PM4_OPCODES_H */ 108ed6e6a34SBen Goz 109