Home | History | Annotate | Line # | Download | only in amdgpu
      1  1.1  riastrad /*	$NetBSD: nvd.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 2019 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 
     26  1.1  riastrad #ifndef NVD_H
     27  1.1  riastrad #define NVD_H
     28  1.1  riastrad 
     29  1.1  riastrad /**
     30  1.1  riastrad  * Navi's PM4 definitions
     31  1.1  riastrad  */
     32  1.1  riastrad #define	PACKET_TYPE0	0
     33  1.1  riastrad #define	PACKET_TYPE1	1
     34  1.1  riastrad #define	PACKET_TYPE2	2
     35  1.1  riastrad #define	PACKET_TYPE3	3
     36  1.1  riastrad 
     37  1.1  riastrad #define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3)
     38  1.1  riastrad #define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF)
     39  1.1  riastrad #define CP_PACKET0_GET_REG(h) ((h) & 0xFFFF)
     40  1.1  riastrad #define CP_PACKET3_GET_OPCODE(h) (((h) >> 8) & 0xFF)
     41  1.1  riastrad #define PACKET0(reg, n)	((PACKET_TYPE0 << 30) |				\
     42  1.1  riastrad 			 ((reg) & 0xFFFF) |			\
     43  1.1  riastrad 			 ((n) & 0x3FFF) << 16)
     44  1.1  riastrad #define CP_PACKET2			0x80000000
     45  1.1  riastrad #define		PACKET2_PAD_SHIFT		0
     46  1.1  riastrad #define		PACKET2_PAD_MASK		(0x3fffffff << 0)
     47  1.1  riastrad 
     48  1.1  riastrad #define PACKET2(v)	(CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
     49  1.1  riastrad 
     50  1.1  riastrad #define PACKET3(op, n)	((PACKET_TYPE3 << 30) |				\
     51  1.1  riastrad 			 (((op) & 0xFF) << 8) |				\
     52  1.1  riastrad 			 ((n) & 0x3FFF) << 16)
     53  1.1  riastrad 
     54  1.1  riastrad #define PACKET3_COMPUTE(op, n) (PACKET3(op, n) | 1 << 1)
     55  1.1  riastrad 
     56  1.1  riastrad /* Packet 3 types */
     57  1.1  riastrad #define	PACKET3_NOP					0x10
     58  1.1  riastrad #define	PACKET3_SET_BASE				0x11
     59  1.1  riastrad #define		PACKET3_BASE_INDEX(x)                  ((x) << 0)
     60  1.1  riastrad #define			CE_PARTITION_BASE		3
     61  1.1  riastrad #define	PACKET3_CLEAR_STATE				0x12
     62  1.1  riastrad #define	PACKET3_INDEX_BUFFER_SIZE			0x13
     63  1.1  riastrad #define	PACKET3_DISPATCH_DIRECT				0x15
     64  1.1  riastrad #define	PACKET3_DISPATCH_INDIRECT			0x16
     65  1.1  riastrad #define	PACKET3_INDIRECT_BUFFER_END			0x17
     66  1.1  riastrad #define	PACKET3_INDIRECT_BUFFER_CNST_END		0x19
     67  1.1  riastrad #define	PACKET3_ATOMIC_GDS				0x1D
     68  1.1  riastrad #define	PACKET3_ATOMIC_MEM				0x1E
     69  1.1  riastrad #define	PACKET3_OCCLUSION_QUERY				0x1F
     70  1.1  riastrad #define	PACKET3_SET_PREDICATION				0x20
     71  1.1  riastrad #define	PACKET3_REG_RMW					0x21
     72  1.1  riastrad #define	PACKET3_COND_EXEC				0x22
     73  1.1  riastrad #define	PACKET3_PRED_EXEC				0x23
     74  1.1  riastrad #define	PACKET3_DRAW_INDIRECT				0x24
     75  1.1  riastrad #define	PACKET3_DRAW_INDEX_INDIRECT			0x25
     76  1.1  riastrad #define	PACKET3_INDEX_BASE				0x26
     77  1.1  riastrad #define	PACKET3_DRAW_INDEX_2				0x27
     78  1.1  riastrad #define	PACKET3_CONTEXT_CONTROL				0x28
     79  1.1  riastrad #define	PACKET3_INDEX_TYPE				0x2A
     80  1.1  riastrad #define	PACKET3_DRAW_INDIRECT_MULTI			0x2C
     81  1.1  riastrad #define	PACKET3_DRAW_INDEX_AUTO				0x2D
     82  1.1  riastrad #define	PACKET3_NUM_INSTANCES				0x2F
     83  1.1  riastrad #define	PACKET3_DRAW_INDEX_MULTI_AUTO			0x30
     84  1.1  riastrad #define	PACKET3_INDIRECT_BUFFER_PRIV			0x32
     85  1.1  riastrad #define	PACKET3_INDIRECT_BUFFER_CNST			0x33
     86  1.1  riastrad #define	PACKET3_COND_INDIRECT_BUFFER_CNST		0x33
     87  1.1  riastrad #define	PACKET3_STRMOUT_BUFFER_UPDATE			0x34
     88  1.1  riastrad #define	PACKET3_DRAW_INDEX_OFFSET_2			0x35
     89  1.1  riastrad #define	PACKET3_DRAW_PREAMBLE				0x36
     90  1.1  riastrad #define	PACKET3_WRITE_DATA				0x37
     91  1.1  riastrad #define		WRITE_DATA_DST_SEL(x)                   ((x) << 8)
     92  1.1  riastrad 		/* 0 - register
     93  1.1  riastrad 		 * 1 - memory (sync - via GRBM)
     94  1.1  riastrad 		 * 2 - gl2
     95  1.1  riastrad 		 * 3 - gds
     96  1.1  riastrad 		 * 4 - reserved
     97  1.1  riastrad 		 * 5 - memory (async - direct)
     98  1.1  riastrad 		 */
     99  1.1  riastrad #define		WR_ONE_ADDR                             (1 << 16)
    100  1.1  riastrad #define		WR_CONFIRM                              (1 << 20)
    101  1.1  riastrad #define		WRITE_DATA_CACHE_POLICY(x)              ((x) << 25)
    102  1.1  riastrad 		/* 0 - LRU
    103  1.1  riastrad 		 * 1 - Stream
    104  1.1  riastrad 		 */
    105  1.1  riastrad #define		WRITE_DATA_ENGINE_SEL(x)                ((x) << 30)
    106  1.1  riastrad 		/* 0 - me
    107  1.1  riastrad 		 * 1 - pfp
    108  1.1  riastrad 		 * 2 - ce
    109  1.1  riastrad 		 */
    110  1.1  riastrad #define	PACKET3_DRAW_INDEX_INDIRECT_MULTI		0x38
    111  1.1  riastrad #define	PACKET3_MEM_SEMAPHORE				0x39
    112  1.1  riastrad #              define PACKET3_SEM_USE_MAILBOX       (0x1 << 16)
    113  1.1  riastrad #              define PACKET3_SEM_SEL_SIGNAL_TYPE   (0x1 << 20) /* 0 = increment, 1 = write 1 */
    114  1.1  riastrad #              define PACKET3_SEM_SEL_SIGNAL	    (0x6 << 29)
    115  1.1  riastrad #              define PACKET3_SEM_SEL_WAIT	    (0x7 << 29)
    116  1.1  riastrad #define	PACKET3_DRAW_INDEX_MULTI_INST			0x3A
    117  1.1  riastrad #define	PACKET3_COPY_DW					0x3B
    118  1.1  riastrad #define	PACKET3_WAIT_REG_MEM				0x3C
    119  1.1  riastrad #define		WAIT_REG_MEM_FUNCTION(x)                ((x) << 0)
    120  1.1  riastrad 		/* 0 - always
    121  1.1  riastrad 		 * 1 - <
    122  1.1  riastrad 		 * 2 - <=
    123  1.1  riastrad 		 * 3 - ==
    124  1.1  riastrad 		 * 4 - !=
    125  1.1  riastrad 		 * 5 - >=
    126  1.1  riastrad 		 * 6 - >
    127  1.1  riastrad 		 */
    128  1.1  riastrad #define		WAIT_REG_MEM_MEM_SPACE(x)               ((x) << 4)
    129  1.1  riastrad 		/* 0 - reg
    130  1.1  riastrad 		 * 1 - mem
    131  1.1  riastrad 		 */
    132  1.1  riastrad #define		WAIT_REG_MEM_OPERATION(x)               ((x) << 6)
    133  1.1  riastrad 		/* 0 - wait_reg_mem
    134  1.1  riastrad 		 * 1 - wr_wait_wr_reg
    135  1.1  riastrad 		 */
    136  1.1  riastrad #define		WAIT_REG_MEM_ENGINE(x)                  ((x) << 8)
    137  1.1  riastrad 		/* 0 - me
    138  1.1  riastrad 		 * 1 - pfp
    139  1.1  riastrad 		 */
    140  1.1  riastrad #define	PACKET3_INDIRECT_BUFFER				0x3F
    141  1.1  riastrad #define		INDIRECT_BUFFER_VALID                   (1 << 23)
    142  1.1  riastrad #define		INDIRECT_BUFFER_CACHE_POLICY(x)         ((x) << 28)
    143  1.1  riastrad 		/* 0 - LRU
    144  1.1  riastrad 		 * 1 - Stream
    145  1.1  riastrad 		 * 2 - Bypass
    146  1.1  riastrad 		 */
    147  1.1  riastrad #define		INDIRECT_BUFFER_PRE_ENB(x)		((x) << 21)
    148  1.1  riastrad #define		INDIRECT_BUFFER_PRE_RESUME(x)           ((x) << 30)
    149  1.1  riastrad #define	PACKET3_COND_INDIRECT_BUFFER			0x3F
    150  1.1  riastrad #define	PACKET3_COPY_DATA				0x40
    151  1.1  riastrad #define	PACKET3_CP_DMA					0x41
    152  1.1  riastrad #define	PACKET3_PFP_SYNC_ME				0x42
    153  1.1  riastrad #define	PACKET3_SURFACE_SYNC				0x43
    154  1.1  riastrad #define	PACKET3_ME_INITIALIZE				0x44
    155  1.1  riastrad #define	PACKET3_COND_WRITE				0x45
    156  1.1  riastrad #define	PACKET3_EVENT_WRITE				0x46
    157  1.1  riastrad #define		EVENT_TYPE(x)                           ((x) << 0)
    158  1.1  riastrad #define		EVENT_INDEX(x)                          ((x) << 8)
    159  1.1  riastrad 		/* 0 - any non-TS event
    160  1.1  riastrad 		 * 1 - ZPASS_DONE, PIXEL_PIPE_STAT_*
    161  1.1  riastrad 		 * 2 - SAMPLE_PIPELINESTAT
    162  1.1  riastrad 		 * 3 - SAMPLE_STREAMOUTSTAT*
    163  1.1  riastrad 		 * 4 - *S_PARTIAL_FLUSH
    164  1.1  riastrad 		 */
    165  1.1  riastrad #define	PACKET3_EVENT_WRITE_EOP				0x47
    166  1.1  riastrad #define	PACKET3_EVENT_WRITE_EOS				0x48
    167  1.1  riastrad #define	PACKET3_RELEASE_MEM				0x49
    168  1.1  riastrad #define		PACKET3_RELEASE_MEM_EVENT_TYPE(x)	((x) << 0)
    169  1.1  riastrad #define		PACKET3_RELEASE_MEM_EVENT_INDEX(x)	((x) << 8)
    170  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_GLM_WB		(1 << 12)
    171  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_GLM_INV		(1 << 13)
    172  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_GLV_INV		(1 << 14)
    173  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_GL1_INV		(1 << 15)
    174  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_GL2_US		(1 << 16)
    175  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_GL2_RANGE	(1 << 17)
    176  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_GL2_DISCARD	(1 << 19)
    177  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_GL2_INV		(1 << 20)
    178  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_GL2_WB		(1 << 21)
    179  1.1  riastrad #define		PACKET3_RELEASE_MEM_GCR_SEQ		(1 << 22)
    180  1.1  riastrad #define		PACKET3_RELEASE_MEM_CACHE_POLICY(x)	((x) << 25)
    181  1.1  riastrad 		/* 0 - cache_policy__me_release_mem__lru
    182  1.1  riastrad 		 * 1 - cache_policy__me_release_mem__stream
    183  1.1  riastrad 		 * 2 - cache_policy__me_release_mem__noa
    184  1.1  riastrad 		 * 3 - cache_policy__me_release_mem__bypass
    185  1.1  riastrad 		 */
    186  1.1  riastrad #define		PACKET3_RELEASE_MEM_EXECUTE		(1 << 28)
    187  1.1  riastrad 
    188  1.1  riastrad #define		PACKET3_RELEASE_MEM_DATA_SEL(x)		((x) << 29)
    189  1.1  riastrad 		/* 0 - discard
    190  1.1  riastrad 		 * 1 - send low 32bit data
    191  1.1  riastrad 		 * 2 - send 64bit data
    192  1.1  riastrad 		 * 3 - send 64bit GPU counter value
    193  1.1  riastrad 		 * 4 - send 64bit sys counter value
    194  1.1  riastrad 		 */
    195  1.1  riastrad #define		PACKET3_RELEASE_MEM_INT_SEL(x)		((x) << 24)
    196  1.1  riastrad 		/* 0 - none
    197  1.1  riastrad 		 * 1 - interrupt only (DATA_SEL = 0)
    198  1.1  riastrad 		 * 2 - interrupt when data write is confirmed
    199  1.1  riastrad 		 */
    200  1.1  riastrad #define		PACKET3_RELEASE_MEM_DST_SEL(x)		((x) << 16)
    201  1.1  riastrad 		/* 0 - MC
    202  1.1  riastrad 		 * 1 - TC/L2
    203  1.1  riastrad 		 */
    204  1.1  riastrad 
    205  1.1  riastrad 
    206  1.1  riastrad 
    207  1.1  riastrad #define	PACKET3_PREAMBLE_CNTL				0x4A
    208  1.1  riastrad #              define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE     (2 << 28)
    209  1.1  riastrad #              define PACKET3_PREAMBLE_END_CLEAR_STATE       (3 << 28)
    210  1.1  riastrad #define	PACKET3_DMA_DATA				0x50
    211  1.1  riastrad /* 1. header
    212  1.1  riastrad  * 2. CONTROL
    213  1.1  riastrad  * 3. SRC_ADDR_LO or DATA [31:0]
    214  1.1  riastrad  * 4. SRC_ADDR_HI [31:0]
    215  1.1  riastrad  * 5. DST_ADDR_LO [31:0]
    216  1.1  riastrad  * 6. DST_ADDR_HI [7:0]
    217  1.1  riastrad  * 7. COMMAND [31:26] | BYTE_COUNT [25:0]
    218  1.1  riastrad  */
    219  1.1  riastrad /* CONTROL */
    220  1.1  riastrad #              define PACKET3_DMA_DATA_ENGINE(x)     ((x) << 0)
    221  1.1  riastrad 		/* 0 - ME
    222  1.1  riastrad 		 * 1 - PFP
    223  1.1  riastrad 		 */
    224  1.1  riastrad #              define PACKET3_DMA_DATA_SRC_CACHE_POLICY(x) ((x) << 13)
    225  1.1  riastrad 		/* 0 - LRU
    226  1.1  riastrad 		 * 1 - Stream
    227  1.1  riastrad 		 */
    228  1.1  riastrad #              define PACKET3_DMA_DATA_DST_SEL(x)  ((x) << 20)
    229  1.1  riastrad 		/* 0 - DST_ADDR using DAS
    230  1.1  riastrad 		 * 1 - GDS
    231  1.1  riastrad 		 * 3 - DST_ADDR using L2
    232  1.1  riastrad 		 */
    233  1.1  riastrad #              define PACKET3_DMA_DATA_DST_CACHE_POLICY(x) ((x) << 25)
    234  1.1  riastrad 		/* 0 - LRU
    235  1.1  riastrad 		 * 1 - Stream
    236  1.1  riastrad 		 */
    237  1.1  riastrad #              define PACKET3_DMA_DATA_SRC_SEL(x)  ((x) << 29)
    238  1.1  riastrad 		/* 0 - SRC_ADDR using SAS
    239  1.1  riastrad 		 * 1 - GDS
    240  1.1  riastrad 		 * 2 - DATA
    241  1.1  riastrad 		 * 3 - SRC_ADDR using L2
    242  1.1  riastrad 		 */
    243  1.1  riastrad #              define PACKET3_DMA_DATA_CP_SYNC     (1 << 31)
    244  1.1  riastrad /* COMMAND */
    245  1.1  riastrad #              define PACKET3_DMA_DATA_CMD_SAS     (1 << 26)
    246  1.1  riastrad 		/* 0 - memory
    247  1.1  riastrad 		 * 1 - register
    248  1.1  riastrad 		 */
    249  1.1  riastrad #              define PACKET3_DMA_DATA_CMD_DAS     (1 << 27)
    250  1.1  riastrad 		/* 0 - memory
    251  1.1  riastrad 		 * 1 - register
    252  1.1  riastrad 		 */
    253  1.1  riastrad #              define PACKET3_DMA_DATA_CMD_SAIC    (1 << 28)
    254  1.1  riastrad #              define PACKET3_DMA_DATA_CMD_DAIC    (1 << 29)
    255  1.1  riastrad #              define PACKET3_DMA_DATA_CMD_RAW_WAIT  (1 << 30)
    256  1.1  riastrad #define	PACKET3_CONTEXT_REG_RMW				0x51
    257  1.1  riastrad #define	PACKET3_GFX_CNTX_UPDATE				0x52
    258  1.1  riastrad #define	PACKET3_BLK_CNTX_UPDATE				0x53
    259  1.1  riastrad #define	PACKET3_INCR_UPDT_STATE				0x55
    260  1.1  riastrad #define	PACKET3_ACQUIRE_MEM				0x58
    261  1.1  riastrad #define	PACKET3_REWIND					0x59
    262  1.1  riastrad #define	PACKET3_INTERRUPT				0x5A
    263  1.1  riastrad #define	PACKET3_GEN_PDEPTE				0x5B
    264  1.1  riastrad #define	PACKET3_INDIRECT_BUFFER_PASID			0x5C
    265  1.1  riastrad #define	PACKET3_PRIME_UTCL2				0x5D
    266  1.1  riastrad #define	PACKET3_LOAD_UCONFIG_REG			0x5E
    267  1.1  riastrad #define	PACKET3_LOAD_SH_REG				0x5F
    268  1.1  riastrad #define	PACKET3_LOAD_CONFIG_REG				0x60
    269  1.1  riastrad #define	PACKET3_LOAD_CONTEXT_REG			0x61
    270  1.1  riastrad #define	PACKET3_LOAD_COMPUTE_STATE			0x62
    271  1.1  riastrad #define	PACKET3_LOAD_SH_REG_INDEX			0x63
    272  1.1  riastrad #define	PACKET3_SET_CONFIG_REG				0x68
    273  1.1  riastrad #define		PACKET3_SET_CONFIG_REG_START			0x00002000
    274  1.1  riastrad #define		PACKET3_SET_CONFIG_REG_END			0x00002c00
    275  1.1  riastrad #define	PACKET3_SET_CONTEXT_REG				0x69
    276  1.1  riastrad #define		PACKET3_SET_CONTEXT_REG_START			0x0000a000
    277  1.1  riastrad #define		PACKET3_SET_CONTEXT_REG_END			0x0000a400
    278  1.1  riastrad #define	PACKET3_SET_CONTEXT_REG_INDEX			0x6A
    279  1.1  riastrad #define	PACKET3_SET_VGPR_REG_DI_MULTI			0x71
    280  1.1  riastrad #define	PACKET3_SET_SH_REG_DI				0x72
    281  1.1  riastrad #define	PACKET3_SET_CONTEXT_REG_INDIRECT		0x73
    282  1.1  riastrad #define	PACKET3_SET_SH_REG_DI_MULTI			0x74
    283  1.1  riastrad #define	PACKET3_GFX_PIPE_LOCK				0x75
    284  1.1  riastrad #define	PACKET3_SET_SH_REG				0x76
    285  1.1  riastrad #define		PACKET3_SET_SH_REG_START			0x00002c00
    286  1.1  riastrad #define		PACKET3_SET_SH_REG_END				0x00003000
    287  1.1  riastrad #define	PACKET3_SET_SH_REG_OFFSET			0x77
    288  1.1  riastrad #define	PACKET3_SET_QUEUE_REG				0x78
    289  1.1  riastrad #define	PACKET3_SET_UCONFIG_REG				0x79
    290  1.1  riastrad #define		PACKET3_SET_UCONFIG_REG_START			0x0000c000
    291  1.1  riastrad #define		PACKET3_SET_UCONFIG_REG_END			0x0000c400
    292  1.1  riastrad #define	PACKET3_SET_UCONFIG_REG_INDEX			0x7A
    293  1.1  riastrad #define	PACKET3_FORWARD_HEADER				0x7C
    294  1.1  riastrad #define	PACKET3_SCRATCH_RAM_WRITE			0x7D
    295  1.1  riastrad #define	PACKET3_SCRATCH_RAM_READ			0x7E
    296  1.1  riastrad #define	PACKET3_LOAD_CONST_RAM				0x80
    297  1.1  riastrad #define	PACKET3_WRITE_CONST_RAM				0x81
    298  1.1  riastrad #define	PACKET3_DUMP_CONST_RAM				0x83
    299  1.1  riastrad #define	PACKET3_INCREMENT_CE_COUNTER			0x84
    300  1.1  riastrad #define	PACKET3_INCREMENT_DE_COUNTER			0x85
    301  1.1  riastrad #define	PACKET3_WAIT_ON_CE_COUNTER			0x86
    302  1.1  riastrad #define	PACKET3_WAIT_ON_DE_COUNTER_DIFF			0x88
    303  1.1  riastrad #define	PACKET3_SWITCH_BUFFER				0x8B
    304  1.1  riastrad #define	PACKET3_DISPATCH_DRAW_PREAMBLE			0x8C
    305  1.1  riastrad #define	PACKET3_DISPATCH_DRAW_PREAMBLE_ACE		0x8C
    306  1.1  riastrad #define	PACKET3_DISPATCH_DRAW				0x8D
    307  1.1  riastrad #define	PACKET3_DISPATCH_DRAW_ACE			0x8D
    308  1.1  riastrad #define	PACKET3_GET_LOD_STATS				0x8E
    309  1.1  riastrad #define	PACKET3_DRAW_MULTI_PREAMBLE			0x8F
    310  1.1  riastrad #define	PACKET3_FRAME_CONTROL				0x90
    311  1.1  riastrad #			define FRAME_CMD(x) ((x) << 28)
    312  1.1  riastrad 			/*
    313  1.1  riastrad 			 * x=0: tmz_begin
    314  1.1  riastrad 			 * x=1: tmz_end
    315  1.1  riastrad 			 */
    316  1.1  riastrad #define	PACKET3_INDEX_ATTRIBUTES_INDIRECT		0x91
    317  1.1  riastrad #define	PACKET3_WAIT_REG_MEM64				0x93
    318  1.1  riastrad #define	PACKET3_COND_PREEMPT				0x94
    319  1.1  riastrad #define	PACKET3_HDP_FLUSH				0x95
    320  1.1  riastrad #define	PACKET3_COPY_DATA_RB				0x96
    321  1.1  riastrad #define	PACKET3_INVALIDATE_TLBS				0x98
    322  1.1  riastrad #              define PACKET3_INVALIDATE_TLBS_DST_SEL(x)     ((x) << 0)
    323  1.1  riastrad #              define PACKET3_INVALIDATE_TLBS_ALL_HUB(x)     ((x) << 4)
    324  1.1  riastrad #              define PACKET3_INVALIDATE_TLBS_PASID(x)       ((x) << 5)
    325  1.1  riastrad #define	PACKET3_AQL_PACKET				0x99
    326  1.1  riastrad #define	PACKET3_DMA_DATA_FILL_MULTI			0x9A
    327  1.1  riastrad #define	PACKET3_SET_SH_REG_INDEX			0x9B
    328  1.1  riastrad #define	PACKET3_DRAW_INDIRECT_COUNT_MULTI		0x9C
    329  1.1  riastrad #define	PACKET3_DRAW_INDEX_INDIRECT_COUNT_MULTI		0x9D
    330  1.1  riastrad #define	PACKET3_DUMP_CONST_RAM_OFFSET			0x9E
    331  1.1  riastrad #define	PACKET3_LOAD_CONTEXT_REG_INDEX			0x9F
    332  1.1  riastrad #define	PACKET3_SET_RESOURCES				0xA0
    333  1.1  riastrad /* 1. header
    334  1.1  riastrad  * 2. CONTROL
    335  1.1  riastrad  * 3. QUEUE_MASK_LO [31:0]
    336  1.1  riastrad  * 4. QUEUE_MASK_HI [31:0]
    337  1.1  riastrad  * 5. GWS_MASK_LO [31:0]
    338  1.1  riastrad  * 6. GWS_MASK_HI [31:0]
    339  1.1  riastrad  * 7. OAC_MASK [15:0]
    340  1.1  riastrad  * 8. GDS_HEAP_SIZE [16:11] | GDS_HEAP_BASE [5:0]
    341  1.1  riastrad  */
    342  1.1  riastrad #              define PACKET3_SET_RESOURCES_VMID_MASK(x)     ((x) << 0)
    343  1.1  riastrad #              define PACKET3_SET_RESOURCES_UNMAP_LATENTY(x) ((x) << 16)
    344  1.1  riastrad #              define PACKET3_SET_RESOURCES_QUEUE_TYPE(x)    ((x) << 29)
    345  1.1  riastrad #define PACKET3_MAP_PROCESS				0xA1
    346  1.1  riastrad #define PACKET3_MAP_QUEUES				0xA2
    347  1.1  riastrad /* 1. header
    348  1.1  riastrad  * 2. CONTROL
    349  1.1  riastrad  * 3. CONTROL2
    350  1.1  riastrad  * 4. MQD_ADDR_LO [31:0]
    351  1.1  riastrad  * 5. MQD_ADDR_HI [31:0]
    352  1.1  riastrad  * 6. WPTR_ADDR_LO [31:0]
    353  1.1  riastrad  * 7. WPTR_ADDR_HI [31:0]
    354  1.1  riastrad  */
    355  1.1  riastrad /* CONTROL */
    356  1.1  riastrad #              define PACKET3_MAP_QUEUES_QUEUE_SEL(x)       ((x) << 4)
    357  1.1  riastrad #              define PACKET3_MAP_QUEUES_VMID(x)            ((x) << 8)
    358  1.1  riastrad #              define PACKET3_MAP_QUEUES_QUEUE(x)           ((x) << 13)
    359  1.1  riastrad #              define PACKET3_MAP_QUEUES_PIPE(x)            ((x) << 16)
    360  1.1  riastrad #              define PACKET3_MAP_QUEUES_ME(x)              ((x) << 18)
    361  1.1  riastrad #              define PACKET3_MAP_QUEUES_QUEUE_TYPE(x)      ((x) << 21)
    362  1.1  riastrad #              define PACKET3_MAP_QUEUES_ALLOC_FORMAT(x)    ((x) << 24)
    363  1.1  riastrad #              define PACKET3_MAP_QUEUES_ENGINE_SEL(x)      ((x) << 26)
    364  1.1  riastrad #              define PACKET3_MAP_QUEUES_NUM_QUEUES(x)      ((x) << 29)
    365  1.1  riastrad /* CONTROL2 */
    366  1.1  riastrad #              define PACKET3_MAP_QUEUES_CHECK_DISABLE(x)   ((x) << 1)
    367  1.1  riastrad #              define PACKET3_MAP_QUEUES_DOORBELL_OFFSET(x) ((x) << 2)
    368  1.1  riastrad #define	PACKET3_UNMAP_QUEUES				0xA3
    369  1.1  riastrad /* 1. header
    370  1.1  riastrad  * 2. CONTROL
    371  1.1  riastrad  * 3. CONTROL2
    372  1.1  riastrad  * 4. CONTROL3
    373  1.1  riastrad  * 5. CONTROL4
    374  1.1  riastrad  * 6. CONTROL5
    375  1.1  riastrad  */
    376  1.1  riastrad /* CONTROL */
    377  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_ACTION(x)           ((x) << 0)
    378  1.1  riastrad 		/* 0 - PREEMPT_QUEUES
    379  1.1  riastrad 		 * 1 - RESET_QUEUES
    380  1.1  riastrad 		 * 2 - DISABLE_PROCESS_QUEUES
    381  1.1  riastrad 		 * 3 - PREEMPT_QUEUES_NO_UNMAP
    382  1.1  riastrad 		 */
    383  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_QUEUE_SEL(x)        ((x) << 4)
    384  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_ENGINE_SEL(x)       ((x) << 26)
    385  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_NUM_QUEUES(x)       ((x) << 29)
    386  1.1  riastrad /* CONTROL2a */
    387  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_PASID(x)            ((x) << 0)
    388  1.1  riastrad /* CONTROL2b */
    389  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET0(x) ((x) << 2)
    390  1.1  riastrad /* CONTROL3a */
    391  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET1(x) ((x) << 2)
    392  1.1  riastrad /* CONTROL3b */
    393  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_RB_WPTR(x)          ((x) << 0)
    394  1.1  riastrad /* CONTROL4 */
    395  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET2(x) ((x) << 2)
    396  1.1  riastrad /* CONTROL5 */
    397  1.1  riastrad #              define PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET3(x) ((x) << 2)
    398  1.1  riastrad #define	PACKET3_QUERY_STATUS				0xA4
    399  1.1  riastrad /* 1. header
    400  1.1  riastrad  * 2. CONTROL
    401  1.1  riastrad  * 3. CONTROL2
    402  1.1  riastrad  * 4. ADDR_LO [31:0]
    403  1.1  riastrad  * 5. ADDR_HI [31:0]
    404  1.1  riastrad  * 6. DATA_LO [31:0]
    405  1.1  riastrad  * 7. DATA_HI [31:0]
    406  1.1  riastrad  */
    407  1.1  riastrad /* CONTROL */
    408  1.1  riastrad #              define PACKET3_QUERY_STATUS_CONTEXT_ID(x)       ((x) << 0)
    409  1.1  riastrad #              define PACKET3_QUERY_STATUS_INTERRUPT_SEL(x)    ((x) << 28)
    410  1.1  riastrad #              define PACKET3_QUERY_STATUS_COMMAND(x)          ((x) << 30)
    411  1.1  riastrad /* CONTROL2a */
    412  1.1  riastrad #              define PACKET3_QUERY_STATUS_PASID(x)            ((x) << 0)
    413  1.1  riastrad /* CONTROL2b */
    414  1.1  riastrad #              define PACKET3_QUERY_STATUS_DOORBELL_OFFSET(x)  ((x) << 2)
    415  1.1  riastrad #              define PACKET3_QUERY_STATUS_ENG_SEL(x)          ((x) << 25)
    416  1.1  riastrad #define	PACKET3_RUN_LIST				0xA5
    417  1.1  riastrad #define	PACKET3_MAP_PROCESS_VM				0xA6
    418  1.1  riastrad 
    419  1.1  riastrad 
    420  1.1  riastrad #endif
    421