1 1.1 riastrad /* $NetBSD: soc15d.h,v 1.2 2021/12/18 23:44:59 riastradh Exp $ */ 2 1.1 riastrad 3 1.1 riastrad /* 4 1.1 riastrad * Copyright 2014 Advanced Micro Devices, Inc. 5 1.1 riastrad * 6 1.1 riastrad * Permission is hereby granted, free of charge, to any person obtaining a 7 1.1 riastrad * copy of this software and associated documentation files (the "Software"), 8 1.1 riastrad * to deal in the Software without restriction, including without limitation 9 1.1 riastrad * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 1.1 riastrad * and/or sell copies of the Software, and to permit persons to whom the 11 1.1 riastrad * Software is furnished to do so, subject to the following conditions: 12 1.1 riastrad * 13 1.1 riastrad * The above copyright notice and this permission notice shall be included in 14 1.1 riastrad * all copies or substantial portions of the Software. 15 1.1 riastrad * 16 1.1 riastrad * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 1.1 riastrad * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 1.1 riastrad * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 1.1 riastrad * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 1.1 riastrad * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 1.1 riastrad * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 1.1 riastrad * OTHER DEALINGS IN THE SOFTWARE. 23 1.1 riastrad * 24 1.1 riastrad */ 25 1.1 riastrad #ifndef SOC15_H 26 1.1 riastrad #define SOC15_H 27 1.1 riastrad 28 1.1 riastrad #define GFX9_NUM_GFX_RINGS 1 29 1.1 riastrad #define GFX9_NUM_COMPUTE_RINGS 8 30 1.1 riastrad 31 1.1 riastrad /* 32 1.1 riastrad * PM4 33 1.1 riastrad */ 34 1.1 riastrad #define PACKET_TYPE0 0 35 1.1 riastrad #define PACKET_TYPE1 1 36 1.1 riastrad #define PACKET_TYPE2 2 37 1.1 riastrad #define PACKET_TYPE3 3 38 1.1 riastrad 39 1.1 riastrad #define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3) 40 1.1 riastrad #define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF) 41 1.1 riastrad #define CP_PACKET0_GET_REG(h) ((h) & 0xFFFF) 42 1.1 riastrad #define CP_PACKET3_GET_OPCODE(h) (((h) >> 8) & 0xFF) 43 1.1 riastrad #define PACKET0(reg, n) ((PACKET_TYPE0 << 30) | \ 44 1.1 riastrad ((reg) & 0xFFFF) | \ 45 1.1 riastrad ((n) & 0x3FFF) << 16) 46 1.1 riastrad #define CP_PACKET2 0x80000000 47 1.1 riastrad #define PACKET2_PAD_SHIFT 0 48 1.1 riastrad #define PACKET2_PAD_MASK (0x3fffffff << 0) 49 1.1 riastrad 50 1.1 riastrad #define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v))) 51 1.1 riastrad 52 1.1 riastrad #define PACKET3(op, n) ((PACKET_TYPE3 << 30) | \ 53 1.1 riastrad (((op) & 0xFF) << 8) | \ 54 1.1 riastrad ((n) & 0x3FFF) << 16) 55 1.1 riastrad 56 1.1 riastrad #define PACKET3_COMPUTE(op, n) (PACKET3(op, n) | 1 << 1) 57 1.1 riastrad 58 1.1 riastrad #define PACKETJ_CONDITION_CHECK0 0 59 1.1 riastrad #define PACKETJ_CONDITION_CHECK1 1 60 1.1 riastrad #define PACKETJ_CONDITION_CHECK2 2 61 1.1 riastrad #define PACKETJ_CONDITION_CHECK3 3 62 1.1 riastrad #define PACKETJ_CONDITION_CHECK4 4 63 1.1 riastrad #define PACKETJ_CONDITION_CHECK5 5 64 1.1 riastrad #define PACKETJ_CONDITION_CHECK6 6 65 1.1 riastrad #define PACKETJ_CONDITION_CHECK7 7 66 1.1 riastrad 67 1.1 riastrad #define PACKETJ_TYPE0 0 68 1.1 riastrad #define PACKETJ_TYPE1 1 69 1.1 riastrad #define PACKETJ_TYPE2 2 70 1.1 riastrad #define PACKETJ_TYPE3 3 71 1.1 riastrad #define PACKETJ_TYPE4 4 72 1.1 riastrad #define PACKETJ_TYPE5 5 73 1.1 riastrad #define PACKETJ_TYPE6 6 74 1.1 riastrad #define PACKETJ_TYPE7 7 75 1.1 riastrad 76 1.1 riastrad #define PACKETJ(reg, r, cond, type) ((reg & 0x3FFFF) | \ 77 1.1 riastrad ((r & 0x3F) << 18) | \ 78 1.1 riastrad ((cond & 0xF) << 24) | \ 79 1.1 riastrad ((type & 0xF) << 28)) 80 1.1 riastrad 81 1.1 riastrad /* Packet 3 types */ 82 1.1 riastrad #define PACKET3_NOP 0x10 83 1.1 riastrad #define PACKET3_SET_BASE 0x11 84 1.1 riastrad #define PACKET3_BASE_INDEX(x) ((x) << 0) 85 1.1 riastrad #define CE_PARTITION_BASE 3 86 1.1 riastrad #define PACKET3_CLEAR_STATE 0x12 87 1.1 riastrad #define PACKET3_INDEX_BUFFER_SIZE 0x13 88 1.1 riastrad #define PACKET3_DISPATCH_DIRECT 0x15 89 1.1 riastrad #define PACKET3_DISPATCH_INDIRECT 0x16 90 1.1 riastrad #define PACKET3_ATOMIC_GDS 0x1D 91 1.1 riastrad #define PACKET3_ATOMIC_MEM 0x1E 92 1.1 riastrad #define PACKET3_OCCLUSION_QUERY 0x1F 93 1.1 riastrad #define PACKET3_SET_PREDICATION 0x20 94 1.1 riastrad #define PACKET3_REG_RMW 0x21 95 1.1 riastrad #define PACKET3_COND_EXEC 0x22 96 1.1 riastrad #define PACKET3_PRED_EXEC 0x23 97 1.1 riastrad #define PACKET3_DRAW_INDIRECT 0x24 98 1.1 riastrad #define PACKET3_DRAW_INDEX_INDIRECT 0x25 99 1.1 riastrad #define PACKET3_INDEX_BASE 0x26 100 1.1 riastrad #define PACKET3_DRAW_INDEX_2 0x27 101 1.1 riastrad #define PACKET3_CONTEXT_CONTROL 0x28 102 1.1 riastrad #define PACKET3_INDEX_TYPE 0x2A 103 1.1 riastrad #define PACKET3_DRAW_INDIRECT_MULTI 0x2C 104 1.1 riastrad #define PACKET3_DRAW_INDEX_AUTO 0x2D 105 1.1 riastrad #define PACKET3_NUM_INSTANCES 0x2F 106 1.1 riastrad #define PACKET3_DRAW_INDEX_MULTI_AUTO 0x30 107 1.1 riastrad #define PACKET3_INDIRECT_BUFFER_CONST 0x33 108 1.1 riastrad #define PACKET3_STRMOUT_BUFFER_UPDATE 0x34 109 1.1 riastrad #define PACKET3_DRAW_INDEX_OFFSET_2 0x35 110 1.1 riastrad #define PACKET3_DRAW_PREAMBLE 0x36 111 1.1 riastrad #define PACKET3_WRITE_DATA 0x37 112 1.1 riastrad #define WRITE_DATA_DST_SEL(x) ((x) << 8) 113 1.1 riastrad /* 0 - register 114 1.1 riastrad * 1 - memory (sync - via GRBM) 115 1.1 riastrad * 2 - gl2 116 1.1 riastrad * 3 - gds 117 1.1 riastrad * 4 - reserved 118 1.1 riastrad * 5 - memory (async - direct) 119 1.1 riastrad */ 120 1.1 riastrad #define WR_ONE_ADDR (1 << 16) 121 1.1 riastrad #define WR_CONFIRM (1 << 20) 122 1.1 riastrad #define WRITE_DATA_CACHE_POLICY(x) ((x) << 25) 123 1.1 riastrad /* 0 - LRU 124 1.1 riastrad * 1 - Stream 125 1.1 riastrad */ 126 1.1 riastrad #define WRITE_DATA_ENGINE_SEL(x) ((x) << 30) 127 1.1 riastrad /* 0 - me 128 1.1 riastrad * 1 - pfp 129 1.1 riastrad * 2 - ce 130 1.1 riastrad */ 131 1.1 riastrad #define PACKET3_DRAW_INDEX_INDIRECT_MULTI 0x38 132 1.1 riastrad #define PACKET3_MEM_SEMAPHORE 0x39 133 1.1 riastrad # define PACKET3_SEM_USE_MAILBOX (0x1 << 16) 134 1.1 riastrad # define PACKET3_SEM_SEL_SIGNAL_TYPE (0x1 << 20) /* 0 = increment, 1 = write 1 */ 135 1.1 riastrad # define PACKET3_SEM_SEL_SIGNAL (0x6 << 29) 136 1.1 riastrad # define PACKET3_SEM_SEL_WAIT (0x7 << 29) 137 1.1 riastrad #define PACKET3_WAIT_REG_MEM 0x3C 138 1.1 riastrad #define WAIT_REG_MEM_FUNCTION(x) ((x) << 0) 139 1.1 riastrad /* 0 - always 140 1.1 riastrad * 1 - < 141 1.1 riastrad * 2 - <= 142 1.1 riastrad * 3 - == 143 1.1 riastrad * 4 - != 144 1.1 riastrad * 5 - >= 145 1.1 riastrad * 6 - > 146 1.1 riastrad */ 147 1.1 riastrad #define WAIT_REG_MEM_MEM_SPACE(x) ((x) << 4) 148 1.1 riastrad /* 0 - reg 149 1.1 riastrad * 1 - mem 150 1.1 riastrad */ 151 1.1 riastrad #define WAIT_REG_MEM_OPERATION(x) ((x) << 6) 152 1.1 riastrad /* 0 - wait_reg_mem 153 1.1 riastrad * 1 - wr_wait_wr_reg 154 1.1 riastrad */ 155 1.1 riastrad #define WAIT_REG_MEM_ENGINE(x) ((x) << 8) 156 1.1 riastrad /* 0 - me 157 1.1 riastrad * 1 - pfp 158 1.1 riastrad */ 159 1.1 riastrad #define PACKET3_INDIRECT_BUFFER 0x3F 160 1.1 riastrad #define INDIRECT_BUFFER_VALID (1 << 23) 161 1.1 riastrad #define INDIRECT_BUFFER_CACHE_POLICY(x) ((x) << 28) 162 1.1 riastrad /* 0 - LRU 163 1.1 riastrad * 1 - Stream 164 1.1 riastrad * 2 - Bypass 165 1.1 riastrad */ 166 1.1 riastrad #define INDIRECT_BUFFER_PRE_ENB(x) ((x) << 21) 167 1.1 riastrad #define PACKET3_COPY_DATA 0x40 168 1.1 riastrad #define PACKET3_PFP_SYNC_ME 0x42 169 1.1 riastrad #define PACKET3_COND_WRITE 0x45 170 1.1 riastrad #define PACKET3_EVENT_WRITE 0x46 171 1.1 riastrad #define EVENT_TYPE(x) ((x) << 0) 172 1.1 riastrad #define EVENT_INDEX(x) ((x) << 8) 173 1.1 riastrad /* 0 - any non-TS event 174 1.1 riastrad * 1 - ZPASS_DONE, PIXEL_PIPE_STAT_* 175 1.1 riastrad * 2 - SAMPLE_PIPELINESTAT 176 1.1 riastrad * 3 - SAMPLE_STREAMOUTSTAT* 177 1.1 riastrad * 4 - *S_PARTIAL_FLUSH 178 1.1 riastrad */ 179 1.1 riastrad #define PACKET3_RELEASE_MEM 0x49 180 1.1 riastrad #define EVENT_TYPE(x) ((x) << 0) 181 1.1 riastrad #define EVENT_INDEX(x) ((x) << 8) 182 1.1 riastrad #define EOP_TCL1_VOL_ACTION_EN (1 << 12) 183 1.1 riastrad #define EOP_TC_VOL_ACTION_EN (1 << 13) /* L2 */ 184 1.1 riastrad #define EOP_TC_WB_ACTION_EN (1 << 15) /* L2 */ 185 1.1 riastrad #define EOP_TCL1_ACTION_EN (1 << 16) 186 1.1 riastrad #define EOP_TC_ACTION_EN (1 << 17) /* L2 */ 187 1.1 riastrad #define EOP_TC_NC_ACTION_EN (1 << 19) 188 1.1 riastrad #define EOP_TC_MD_ACTION_EN (1 << 21) /* L2 metadata */ 189 1.1 riastrad 190 1.1 riastrad #define DATA_SEL(x) ((x) << 29) 191 1.1 riastrad /* 0 - discard 192 1.1 riastrad * 1 - send low 32bit data 193 1.1 riastrad * 2 - send 64bit data 194 1.1 riastrad * 3 - send 64bit GPU counter value 195 1.1 riastrad * 4 - send 64bit sys counter value 196 1.1 riastrad */ 197 1.1 riastrad #define INT_SEL(x) ((x) << 24) 198 1.1 riastrad /* 0 - none 199 1.1 riastrad * 1 - interrupt only (DATA_SEL = 0) 200 1.1 riastrad * 2 - interrupt when data write is confirmed 201 1.1 riastrad */ 202 1.1 riastrad #define DST_SEL(x) ((x) << 16) 203 1.1 riastrad /* 0 - MC 204 1.1 riastrad * 1 - TC/L2 205 1.1 riastrad */ 206 1.1 riastrad 207 1.1 riastrad 208 1.1 riastrad 209 1.1 riastrad #define PACKET3_PREAMBLE_CNTL 0x4A 210 1.1 riastrad # define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE (2 << 28) 211 1.1 riastrad # define PACKET3_PREAMBLE_END_CLEAR_STATE (3 << 28) 212 1.1 riastrad #define PACKET3_DMA_DATA 0x50 213 1.1 riastrad /* 1. header 214 1.1 riastrad * 2. CONTROL 215 1.1 riastrad * 3. SRC_ADDR_LO or DATA [31:0] 216 1.1 riastrad * 4. SRC_ADDR_HI [31:0] 217 1.1 riastrad * 5. DST_ADDR_LO [31:0] 218 1.1 riastrad * 6. DST_ADDR_HI [7:0] 219 1.1 riastrad * 7. COMMAND [30:21] | BYTE_COUNT [20:0] 220 1.1 riastrad */ 221 1.1 riastrad /* CONTROL */ 222 1.1 riastrad # define PACKET3_DMA_DATA_ENGINE(x) ((x) << 0) 223 1.1 riastrad /* 0 - ME 224 1.1 riastrad * 1 - PFP 225 1.1 riastrad */ 226 1.1 riastrad # define PACKET3_DMA_DATA_SRC_CACHE_POLICY(x) ((x) << 13) 227 1.1 riastrad /* 0 - LRU 228 1.1 riastrad * 1 - Stream 229 1.1 riastrad */ 230 1.1 riastrad # define PACKET3_DMA_DATA_DST_SEL(x) ((x) << 20) 231 1.1 riastrad /* 0 - DST_ADDR using DAS 232 1.1 riastrad * 1 - GDS 233 1.1 riastrad * 3 - DST_ADDR using L2 234 1.1 riastrad */ 235 1.1 riastrad # define PACKET3_DMA_DATA_DST_CACHE_POLICY(x) ((x) << 25) 236 1.1 riastrad /* 0 - LRU 237 1.1 riastrad * 1 - Stream 238 1.1 riastrad */ 239 1.1 riastrad # define PACKET3_DMA_DATA_SRC_SEL(x) ((x) << 29) 240 1.1 riastrad /* 0 - SRC_ADDR using SAS 241 1.1 riastrad * 1 - GDS 242 1.1 riastrad * 2 - DATA 243 1.1 riastrad * 3 - SRC_ADDR using L2 244 1.1 riastrad */ 245 1.1 riastrad # define PACKET3_DMA_DATA_CP_SYNC (1 << 31) 246 1.1 riastrad /* COMMAND */ 247 1.1 riastrad # define PACKET3_DMA_DATA_CMD_SAS (1 << 26) 248 1.1 riastrad /* 0 - memory 249 1.1 riastrad * 1 - register 250 1.1 riastrad */ 251 1.1 riastrad # define PACKET3_DMA_DATA_CMD_DAS (1 << 27) 252 1.1 riastrad /* 0 - memory 253 1.1 riastrad * 1 - register 254 1.1 riastrad */ 255 1.1 riastrad # define PACKET3_DMA_DATA_CMD_SAIC (1 << 28) 256 1.1 riastrad # define PACKET3_DMA_DATA_CMD_DAIC (1 << 29) 257 1.1 riastrad # define PACKET3_DMA_DATA_CMD_RAW_WAIT (1 << 30) 258 1.1 riastrad #define PACKET3_AQUIRE_MEM 0x58 259 1.1 riastrad #define PACKET3_REWIND 0x59 260 1.1 riastrad #define PACKET3_LOAD_UCONFIG_REG 0x5E 261 1.1 riastrad #define PACKET3_LOAD_SH_REG 0x5F 262 1.1 riastrad #define PACKET3_LOAD_CONFIG_REG 0x60 263 1.1 riastrad #define PACKET3_LOAD_CONTEXT_REG 0x61 264 1.1 riastrad #define PACKET3_SET_CONFIG_REG 0x68 265 1.1 riastrad #define PACKET3_SET_CONFIG_REG_START 0x00002000 266 1.1 riastrad #define PACKET3_SET_CONFIG_REG_END 0x00002c00 267 1.1 riastrad #define PACKET3_SET_CONTEXT_REG 0x69 268 1.1 riastrad #define PACKET3_SET_CONTEXT_REG_START 0x0000a000 269 1.1 riastrad #define PACKET3_SET_CONTEXT_REG_END 0x0000a400 270 1.1 riastrad #define PACKET3_SET_CONTEXT_REG_INDIRECT 0x73 271 1.1 riastrad #define PACKET3_SET_SH_REG 0x76 272 1.1 riastrad #define PACKET3_SET_SH_REG_START 0x00002c00 273 1.1 riastrad #define PACKET3_SET_SH_REG_END 0x00003000 274 1.1 riastrad #define PACKET3_SET_SH_REG_OFFSET 0x77 275 1.1 riastrad #define PACKET3_SET_QUEUE_REG 0x78 276 1.1 riastrad #define PACKET3_SET_UCONFIG_REG 0x79 277 1.1 riastrad #define PACKET3_SET_UCONFIG_REG_START 0x0000c000 278 1.1 riastrad #define PACKET3_SET_UCONFIG_REG_END 0x0000c400 279 1.1 riastrad #define PACKET3_SET_UCONFIG_REG_INDEX_TYPE (2 << 28) 280 1.1 riastrad #define PACKET3_SCRATCH_RAM_WRITE 0x7D 281 1.1 riastrad #define PACKET3_SCRATCH_RAM_READ 0x7E 282 1.1 riastrad #define PACKET3_LOAD_CONST_RAM 0x80 283 1.1 riastrad #define PACKET3_WRITE_CONST_RAM 0x81 284 1.1 riastrad #define PACKET3_DUMP_CONST_RAM 0x83 285 1.1 riastrad #define PACKET3_INCREMENT_CE_COUNTER 0x84 286 1.1 riastrad #define PACKET3_INCREMENT_DE_COUNTER 0x85 287 1.1 riastrad #define PACKET3_WAIT_ON_CE_COUNTER 0x86 288 1.1 riastrad #define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88 289 1.1 riastrad #define PACKET3_SWITCH_BUFFER 0x8B 290 1.1 riastrad #define PACKET3_FRAME_CONTROL 0x90 291 1.1 riastrad # define FRAME_CMD(x) ((x) << 28) 292 1.1 riastrad /* 293 1.1 riastrad * x=0: tmz_begin 294 1.1 riastrad * x=1: tmz_end 295 1.1 riastrad */ 296 1.1 riastrad 297 1.1 riastrad #define PACKET3_INVALIDATE_TLBS 0x98 298 1.1 riastrad # define PACKET3_INVALIDATE_TLBS_DST_SEL(x) ((x) << 0) 299 1.1 riastrad # define PACKET3_INVALIDATE_TLBS_ALL_HUB(x) ((x) << 4) 300 1.1 riastrad # define PACKET3_INVALIDATE_TLBS_PASID(x) ((x) << 5) 301 1.1 riastrad # define PACKET3_INVALIDATE_TLBS_FLUSH_TYPE(x) ((x) << 29) 302 1.1 riastrad #define PACKET3_SET_RESOURCES 0xA0 303 1.1 riastrad /* 1. header 304 1.1 riastrad * 2. CONTROL 305 1.1 riastrad * 3. QUEUE_MASK_LO [31:0] 306 1.1 riastrad * 4. QUEUE_MASK_HI [31:0] 307 1.1 riastrad * 5. GWS_MASK_LO [31:0] 308 1.1 riastrad * 6. GWS_MASK_HI [31:0] 309 1.1 riastrad * 7. OAC_MASK [15:0] 310 1.1 riastrad * 8. GDS_HEAP_SIZE [16:11] | GDS_HEAP_BASE [5:0] 311 1.1 riastrad */ 312 1.1 riastrad # define PACKET3_SET_RESOURCES_VMID_MASK(x) ((x) << 0) 313 1.1 riastrad # define PACKET3_SET_RESOURCES_UNMAP_LATENTY(x) ((x) << 16) 314 1.1 riastrad # define PACKET3_SET_RESOURCES_QUEUE_TYPE(x) ((x) << 29) 315 1.1 riastrad #define PACKET3_MAP_QUEUES 0xA2 316 1.1 riastrad /* 1. header 317 1.1 riastrad * 2. CONTROL 318 1.1 riastrad * 3. CONTROL2 319 1.1 riastrad * 4. MQD_ADDR_LO [31:0] 320 1.1 riastrad * 5. MQD_ADDR_HI [31:0] 321 1.1 riastrad * 6. WPTR_ADDR_LO [31:0] 322 1.1 riastrad * 7. WPTR_ADDR_HI [31:0] 323 1.1 riastrad */ 324 1.1 riastrad /* CONTROL */ 325 1.1 riastrad # define PACKET3_MAP_QUEUES_QUEUE_SEL(x) ((x) << 4) 326 1.1 riastrad # define PACKET3_MAP_QUEUES_VMID(x) ((x) << 8) 327 1.1 riastrad # define PACKET3_MAP_QUEUES_QUEUE(x) ((x) << 13) 328 1.1 riastrad # define PACKET3_MAP_QUEUES_PIPE(x) ((x) << 16) 329 1.1 riastrad # define PACKET3_MAP_QUEUES_ME(x) ((x) << 18) 330 1.1 riastrad # define PACKET3_MAP_QUEUES_QUEUE_TYPE(x) ((x) << 21) 331 1.1 riastrad # define PACKET3_MAP_QUEUES_ALLOC_FORMAT(x) ((x) << 24) 332 1.1 riastrad # define PACKET3_MAP_QUEUES_ENGINE_SEL(x) ((x) << 26) 333 1.1 riastrad # define PACKET3_MAP_QUEUES_NUM_QUEUES(x) ((x) << 29) 334 1.1 riastrad /* CONTROL2 */ 335 1.1 riastrad # define PACKET3_MAP_QUEUES_CHECK_DISABLE(x) ((x) << 1) 336 1.1 riastrad # define PACKET3_MAP_QUEUES_DOORBELL_OFFSET(x) ((x) << 2) 337 1.1 riastrad #define PACKET3_UNMAP_QUEUES 0xA3 338 1.1 riastrad /* 1. header 339 1.1 riastrad * 2. CONTROL 340 1.1 riastrad * 3. CONTROL2 341 1.1 riastrad * 4. CONTROL3 342 1.1 riastrad * 5. CONTROL4 343 1.1 riastrad * 6. CONTROL5 344 1.1 riastrad */ 345 1.1 riastrad /* CONTROL */ 346 1.1 riastrad # define PACKET3_UNMAP_QUEUES_ACTION(x) ((x) << 0) 347 1.1 riastrad /* 0 - PREEMPT_QUEUES 348 1.1 riastrad * 1 - RESET_QUEUES 349 1.1 riastrad * 2 - DISABLE_PROCESS_QUEUES 350 1.1 riastrad * 3 - PREEMPT_QUEUES_NO_UNMAP 351 1.1 riastrad */ 352 1.1 riastrad # define PACKET3_UNMAP_QUEUES_QUEUE_SEL(x) ((x) << 4) 353 1.1 riastrad # define PACKET3_UNMAP_QUEUES_ENGINE_SEL(x) ((x) << 26) 354 1.1 riastrad # define PACKET3_UNMAP_QUEUES_NUM_QUEUES(x) ((x) << 29) 355 1.1 riastrad /* CONTROL2a */ 356 1.1 riastrad # define PACKET3_UNMAP_QUEUES_PASID(x) ((x) << 0) 357 1.1 riastrad /* CONTROL2b */ 358 1.1 riastrad # define PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET0(x) ((x) << 2) 359 1.1 riastrad /* CONTROL3a */ 360 1.1 riastrad # define PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET1(x) ((x) << 2) 361 1.1 riastrad /* CONTROL3b */ 362 1.1 riastrad # define PACKET3_UNMAP_QUEUES_RB_WPTR(x) ((x) << 0) 363 1.1 riastrad /* CONTROL4 */ 364 1.1 riastrad # define PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET2(x) ((x) << 2) 365 1.1 riastrad /* CONTROL5 */ 366 1.1 riastrad # define PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET3(x) ((x) << 2) 367 1.1 riastrad #define PACKET3_QUERY_STATUS 0xA4 368 1.1 riastrad /* 1. header 369 1.1 riastrad * 2. CONTROL 370 1.1 riastrad * 3. CONTROL2 371 1.1 riastrad * 4. ADDR_LO [31:0] 372 1.1 riastrad * 5. ADDR_HI [31:0] 373 1.1 riastrad * 6. DATA_LO [31:0] 374 1.1 riastrad * 7. DATA_HI [31:0] 375 1.1 riastrad */ 376 1.1 riastrad /* CONTROL */ 377 1.1 riastrad # define PACKET3_QUERY_STATUS_CONTEXT_ID(x) ((x) << 0) 378 1.1 riastrad # define PACKET3_QUERY_STATUS_INTERRUPT_SEL(x) ((x) << 28) 379 1.1 riastrad # define PACKET3_QUERY_STATUS_COMMAND(x) ((x) << 30) 380 1.1 riastrad /* CONTROL2a */ 381 1.1 riastrad # define PACKET3_QUERY_STATUS_PASID(x) ((x) << 0) 382 1.1 riastrad /* CONTROL2b */ 383 1.1 riastrad # define PACKET3_QUERY_STATUS_DOORBELL_OFFSET(x) ((x) << 2) 384 1.1 riastrad # define PACKET3_QUERY_STATUS_ENG_SEL(x) ((x) << 25) 385 1.1 riastrad 386 1.1 riastrad 387 1.1 riastrad #define VCE_CMD_NO_OP 0x00000000 388 1.1 riastrad #define VCE_CMD_END 0x00000001 389 1.1 riastrad #define VCE_CMD_IB 0x00000002 390 1.1 riastrad #define VCE_CMD_FENCE 0x00000003 391 1.1 riastrad #define VCE_CMD_TRAP 0x00000004 392 1.1 riastrad #define VCE_CMD_IB_AUTO 0x00000005 393 1.1 riastrad #define VCE_CMD_SEMAPHORE 0x00000006 394 1.1 riastrad 395 1.1 riastrad #define VCE_CMD_IB_VM 0x00000102 396 1.1 riastrad #define VCE_CMD_WAIT_GE 0x00000106 397 1.1 riastrad #define VCE_CMD_UPDATE_PTB 0x00000107 398 1.1 riastrad #define VCE_CMD_FLUSH_TLB 0x00000108 399 1.1 riastrad #define VCE_CMD_REG_WRITE 0x00000109 400 1.1 riastrad #define VCE_CMD_REG_WAIT 0x0000010a 401 1.1 riastrad 402 1.1 riastrad #define HEVC_ENC_CMD_NO_OP 0x00000000 403 1.1 riastrad #define HEVC_ENC_CMD_END 0x00000001 404 1.1 riastrad #define HEVC_ENC_CMD_FENCE 0x00000003 405 1.1 riastrad #define HEVC_ENC_CMD_TRAP 0x00000004 406 1.1 riastrad #define HEVC_ENC_CMD_IB_VM 0x00000102 407 1.1 riastrad #define HEVC_ENC_CMD_REG_WRITE 0x00000109 408 1.1 riastrad #define HEVC_ENC_CMD_REG_WAIT 0x0000010a 409 1.1 riastrad 410 1.1 riastrad #endif 411