10af62b0168043896a042b005ff88caa77dd94d04Alex Deucher/*
20af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * Copyright 2010 Advanced Micro Devices, Inc.
30af62b0168043896a042b005ff88caa77dd94d04Alex Deucher *
40af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * Permission is hereby granted, free of charge, to any person obtaining a
50af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * copy of this software and associated documentation files (the "Software"),
60af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * to deal in the Software without restriction, including without limitation
70af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * the rights to use, copy, modify, merge, publish, distribute, sublicense,
80af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * and/or sell copies of the Software, and to permit persons to whom the
90af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * Software is furnished to do so, subject to the following conditions:
100af62b0168043896a042b005ff88caa77dd94d04Alex Deucher *
110af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * The above copyright notice and this permission notice shall be included in
120af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * all copies or substantial portions of the Software.
130af62b0168043896a042b005ff88caa77dd94d04Alex Deucher *
140af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
150af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
160af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
170af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
180af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
190af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
200af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * OTHER DEALINGS IN THE SOFTWARE.
210af62b0168043896a042b005ff88caa77dd94d04Alex Deucher *
220af62b0168043896a042b005ff88caa77dd94d04Alex Deucher * Authors: Alex Deucher
230af62b0168043896a042b005ff88caa77dd94d04Alex Deucher */
240af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#ifndef NI_H
250af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define NI_H
260af62b0168043896a042b005ff88caa77dd94d04Alex Deucher
27fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_SH_GPRS           256
28fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_TEMP_GPRS         16
29fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_SH_THREADS        256
30fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_SH_STACK_ENTRIES  4096
31fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_FRC_EOV_CNT       16384
32fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_BACKENDS          8
33fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_BACKENDS_MASK     0xFF
34fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_BACKENDS_PER_SE_MASK 0xF
35fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_SIMDS             16
36fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_SIMDS_MASK        0xFFFF
37fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_SIMDS_PER_SE_MASK 0xFFF
38fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_PIPES             8
39fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_PIPES_MASK        0xFF
40fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_LDS_NUM           0xFFFF
41fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_TCC               16
42fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CAYMAN_MAX_TCC_MASK          0xFF
43fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
44fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define DMIF_ADDR_CONFIG  				0xBD4
451b37078b7ddf35cab12ac6544187e3636d50c0dcAlex Deucher#define	SRBM_GFX_CNTL				        0x0E44
461b37078b7ddf35cab12ac6544187e3636d50c0dcAlex Deucher#define		RINGID(x)					(((x) & 0x3) << 0)
471b37078b7ddf35cab12ac6544187e3636d50c0dcAlex Deucher#define		VMID(x)						(((x) & 0x7) << 0)
48b9952a8ae5814b0ef2a6596c7443efd85b92e069Alex Deucher#define	SRBM_STATUS				        0x0E50
49fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
50fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_CONTEXT0_REQUEST_RESPONSE			0x1470
51fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		REQUEST_TYPE(x)					(((x) & 0xf) << 0)
52fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		RESPONSE_TYPE_MASK				0x000000F0
53fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		RESPONSE_TYPE_SHIFT				4
54fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_L2_CNTL					0x1400
55fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		ENABLE_L2_CACHE					(1 << 0)
56fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		ENABLE_L2_FRAGMENT_PROCESSING			(1 << 1)
57fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE		(1 << 9)
58fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		ENABLE_L2_PDE0_CACHE_LRU_UPDATE_BY_WRITE	(1 << 10)
59fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		EFFECTIVE_L2_QUEUE_SIZE(x)			(((x) & 7) << 14)
60fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		CONTEXT1_IDENTITY_ACCESS_MODE(x)		(((x) & 3) << 18)
61fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher/* CONTEXT1_IDENTITY_ACCESS_MODE
62fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher * 0 physical = logical
63fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher * 1 logical via context1 page table
64fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher * 2 inside identity aperture use translation, outside physical = logical
65fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher * 3 inside identity aperture physical = logical, outside use translation
66fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher */
67fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_L2_CNTL2					0x1404
68fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		INVALIDATE_ALL_L1_TLBS				(1 << 0)
69fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		INVALIDATE_L2_CACHE				(1 << 1)
70fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_L2_CNTL3					0x1408
71fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		BANK_SELECT(x)					((x) << 0)
72fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		CACHE_UPDATE_MODE(x)				((x) << 6)
73fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		L2_CACHE_BIGK_ASSOCIATIVITY			(1 << 20)
74fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		L2_CACHE_BIGK_FRAGMENT_SIZE(x)			((x) << 15)
75fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define	VM_L2_STATUS					0x140C
76fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		L2_BUSY						(1 << 0)
77fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_CONTEXT0_CNTL				0x1410
78fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		ENABLE_CONTEXT					(1 << 0)
79fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		PAGE_TABLE_DEPTH(x)				(((x) & 3) << 1)
80fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		RANGE_PROTECTION_FAULT_ENABLE_DEFAULT		(1 << 4)
81fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_CONTEXT1_CNTL				0x1414
82fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_CONTEXT0_CNTL2				0x1430
83fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_CONTEXT1_CNTL2				0x1434
84fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_INVALIDATE_REQUEST				0x1478
85fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_INVALIDATE_RESPONSE				0x147c
86fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR	0x1518
87fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define VM_CONTEXT1_PROTECTION_FAULT_DEFAULT_ADDR	0x151c
88fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define	VM_CONTEXT0_PAGE_TABLE_BASE_ADDR		0x153C
89fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define	VM_CONTEXT0_PAGE_TABLE_START_ADDR		0x155C
90fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define	VM_CONTEXT0_PAGE_TABLE_END_ADDR			0x157C
91fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher
92fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define MC_SHARED_CHMAP						0x2004
93fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFCHAN_SHIFT					12
94fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFCHAN_MASK					0x00003000
95fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define MC_SHARED_CHREMAP					0x2008
96fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher
97fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define	MC_VM_SYSTEM_APERTURE_LOW_ADDR			0x2034
98fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define	MC_VM_SYSTEM_APERTURE_HIGH_ADDR			0x2038
99fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define	MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR		0x203C
100fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define	MC_VM_MX_L1_TLB_CNTL				0x2064
101fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		ENABLE_L1_TLB					(1 << 0)
102fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		ENABLE_L1_FRAGMENT_PROCESSING			(1 << 1)
103fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		SYSTEM_ACCESS_MODE_PA_ONLY			(0 << 3)
104fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		SYSTEM_ACCESS_MODE_USE_SYS_MAP			(1 << 3)
105fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		SYSTEM_ACCESS_MODE_IN_SYS			(2 << 3)
106fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		SYSTEM_ACCESS_MODE_NOT_IN_SYS			(3 << 3)
107fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU	(0 << 5)
108fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define		ENABLE_ADVANCED_DRIVER_MODEL			(1 << 6)
109fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher
1100af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define MC_SHARED_BLACKOUT_CNTL           		0x20ac
111fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	MC_ARB_RAMCFG					0x2760
112fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFBANK_SHIFT					0
113fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFBANK_MASK					0x00000003
114fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFRANK_SHIFT					2
115fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFRANK_MASK					0x00000004
116fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFROWS_SHIFT					3
117fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFROWS_MASK					0x00000038
118fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFCOLS_SHIFT					6
119fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NOOFCOLS_MASK					0x000000C0
120fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CHANSIZE_SHIFT					8
121fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CHANSIZE_MASK					0x00000100
122fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		BURSTLENGTH_SHIFT				9
123fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		BURSTLENGTH_MASK				0x00000200
124fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CHANSIZE_OVERRIDE				(1 << 11)
1250af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define MC_SEQ_SUP_CNTL           			0x28c8
1260af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define		RUN_MASK      				(1 << 0)
1270af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define MC_SEQ_SUP_PGM           			0x28cc
1280af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define MC_IO_PAD_CNTL_D0           			0x29d0
1290af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define		MEM_FALL_OUT_CMD      			(1 << 8)
1300af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define MC_SEQ_MISC0           				0x2a00
1310af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define		MC_SEQ_MISC0_GDDR5_SHIFT      		28
1320af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define		MC_SEQ_MISC0_GDDR5_MASK      		0xf0000000
1330af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define		MC_SEQ_MISC0_GDDR5_VALUE      		5
1340af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define MC_SEQ_IO_DEBUG_INDEX           		0x2a44
1350af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#define MC_SEQ_IO_DEBUG_DATA           			0x2a48
1360af62b0168043896a042b005ff88caa77dd94d04Alex Deucher
137fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	HDP_HOST_PATH_CNTL				0x2C00
138fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	HDP_NONSURFACE_BASE				0x2C04
139fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	HDP_NONSURFACE_INFO				0x2C08
140fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	HDP_NONSURFACE_SIZE				0x2C0C
141fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define HDP_ADDR_CONFIG  				0x2F48
1420b65f83f9d2fab47b9b6040fe75fc2cfc73032d4Dave Airlie#define HDP_MISC_CNTL					0x2F4C
1430b65f83f9d2fab47b9b6040fe75fc2cfc73032d4Dave Airlie#define 	HDP_FLUSH_INVALIDATE_CACHE			(1 << 0)
144fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
145fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	CC_SYS_RB_BACKEND_DISABLE			0x3F88
146fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	GC_USER_SYS_RB_BACKEND_DISABLE			0x3F8C
147fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	CGTS_SYS_TCC_DISABLE				0x3F90
148fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	CGTS_USER_SYS_TCC_DISABLE			0x3F94
149fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
150fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	CONFIG_MEMSIZE					0x5428
151fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
152fa8198eac871edef38e969e2c6a68649e0cd36e0Alex Deucher#define HDP_MEM_COHERENCY_FLUSH_CNTL			0x5480
153fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define HDP_REG_COHERENCY_FLUSH_CNTL			0x54A0
154fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
155fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	GRBM_CNTL					0x8000
156fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		GRBM_READ_TIMEOUT(x)				((x) << 0)
157fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	GRBM_STATUS					0x8010
158fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CMDFIFO_AVAIL_MASK				0x0000000F
159fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		RING2_RQ_PENDING				(1 << 4)
160fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SRBM_RQ_PENDING					(1 << 5)
161fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		RING1_RQ_PENDING				(1 << 6)
162fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CF_RQ_PENDING					(1 << 7)
163fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		PF_RQ_PENDING					(1 << 8)
164fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		GDS_DMA_RQ_PENDING				(1 << 9)
165fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		GRBM_EE_BUSY					(1 << 10)
166fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SX_CLEAN					(1 << 11)
167fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		DB_CLEAN					(1 << 12)
168fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CB_CLEAN					(1 << 13)
169fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		TA_BUSY 					(1 << 14)
170fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		GDS_BUSY 					(1 << 15)
171fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		VGT_BUSY_NO_DMA					(1 << 16)
172fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		VGT_BUSY					(1 << 17)
173fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		IA_BUSY_NO_DMA					(1 << 18)
174fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		IA_BUSY						(1 << 19)
175fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SX_BUSY 					(1 << 20)
176fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SH_BUSY 					(1 << 21)
177fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SPI_BUSY					(1 << 22)
178fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SC_BUSY 					(1 << 24)
179fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		PA_BUSY 					(1 << 25)
180fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		DB_BUSY 					(1 << 26)
181fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CP_COHERENCY_BUSY      				(1 << 28)
182fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CP_BUSY 					(1 << 29)
183fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CB_BUSY 					(1 << 30)
184fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		GUI_ACTIVE					(1 << 31)
185fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	GRBM_STATUS_SE0					0x8014
186fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	GRBM_STATUS_SE1					0x8018
187fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_SX_CLEAN					(1 << 0)
188fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_DB_CLEAN					(1 << 1)
189fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_CB_CLEAN					(1 << 2)
190fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_VGT_BUSY					(1 << 23)
191fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_PA_BUSY					(1 << 24)
192fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_TA_BUSY					(1 << 25)
193fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_SX_BUSY					(1 << 26)
194fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_SPI_BUSY					(1 << 27)
195fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_SH_BUSY					(1 << 28)
196fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_SC_BUSY					(1 << 29)
197fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_DB_BUSY					(1 << 30)
198fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SE_CB_BUSY					(1 << 31)
199fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	GRBM_SOFT_RESET					0x8020
200fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_CP					(1 << 0)
201fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_CB					(1 << 1)
202fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_DB					(1 << 3)
203fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_GDS					(1 << 4)
204fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_PA					(1 << 5)
205fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_SC					(1 << 6)
206fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_SPI					(1 << 8)
207fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_SH					(1 << 9)
208fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_SX					(1 << 10)
209fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_TC					(1 << 11)
210fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_TA					(1 << 12)
211fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_VGT					(1 << 14)
212fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SOFT_RESET_IA					(1 << 15)
213fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
2140c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_REG0					0x8500
2150c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_REG1					0x8504
2160c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_REG2					0x8508
2170c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_REG3					0x850C
2180c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_REG4					0x8510
2190c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_REG5					0x8514
2200c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_REG6					0x8518
2210c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_REG7					0x851C
2220c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_UMSK					0x8540
2230c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	SCRATCH_ADDR					0x8544
2240c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_SEM_WAIT_TIMER				0x85BC
22511ef3f1f8780b64425a4cadbf42a46aa2e36895fAlex Deucher#define	CP_SEM_INCOMPLETE_TIMER_CNTL			0x85C8
226721604a15b934f0a8d1909acb8017f029128be2fJerome Glisse#define	CP_COHER_CNTL2					0x85E8
2270c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define CP_ME_CNTL					0x86D8
2280c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		CP_ME_HALT					(1 << 28)
2290c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		CP_PFP_HALT					(1 << 26)
2300c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB2_RPTR					0x86f8
2310c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB1_RPTR					0x86fc
2320c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB0_RPTR					0x8700
2330c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB_WPTR_DELAY				0x8704
234fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CP_MEQ_THRESHOLDS				0x8764
235fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		MEQ1_START(x)				((x) << 0)
236fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		MEQ2_START(x)				((x) << 8)
237fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	CP_PERFMON_CNTL					0x87FC
238fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
239fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	VGT_CACHE_INVALIDATION				0x88C4
240fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CACHE_INVALIDATION(x)				((x) << 0)
241fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define			VC_ONLY						0
242fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define			TC_ONLY						1
243fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define			VC_AND_TC					2
244fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		AUTO_INVLD_EN(x)				((x) << 6)
245fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define			NO_AUTO						0
246fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define			ES_AUTO						1
247fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define			GS_AUTO						2
248fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define			ES_AND_GS_AUTO					3
249fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	VGT_GS_VERTEX_REUSE				0x88D4
250fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
251fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CC_GC_SHADER_PIPE_CONFIG			0x8950
252fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	GC_USER_SHADER_PIPE_CONFIG			0x8954
253fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		INACTIVE_QD_PIPES(x)				((x) << 8)
254fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		INACTIVE_QD_PIPES_MASK				0x0000FF00
255fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		INACTIVE_QD_PIPES_SHIFT				8
256fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		INACTIVE_SIMDS(x)				((x) << 16)
257fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		INACTIVE_SIMDS_MASK				0xFFFF0000
258fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		INACTIVE_SIMDS_SHIFT				16
259fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
260fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define VGT_PRIMITIVE_TYPE                              0x8958
261fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	VGT_NUM_INSTANCES				0x8974
262fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define VGT_TF_RING_SIZE				0x8988
263fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define VGT_OFFCHIP_LDS_BASE				0x89b4
264fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
265fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	PA_SC_LINE_STIPPLE_STATE			0x8B10
266fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	PA_CL_ENHANCE					0x8A14
267fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CLIP_VTX_REORDER_ENA				(1 << 0)
268fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_CLIP_SEQ(x)					((x) << 1)
269fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	PA_SC_FIFO_SIZE					0x8BCC
270fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SC_PRIM_FIFO_SIZE(x)				((x) << 0)
271fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SC_HIZ_TILE_FIFO_SIZE(x)			((x) << 12)
272fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SC_EARLYZ_TILE_FIFO_SIZE(x)			((x) << 20)
273fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	PA_SC_FORCE_EOV_MAX_CNTS			0x8B24
274fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		FORCE_EOV_MAX_CLK_CNT(x)			((x) << 0)
275fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		FORCE_EOV_MAX_REZ_CNT(x)			((x) << 16)
276fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
277fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SQ_CONFIG					0x8C00
278fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		VC_ENABLE					(1 << 0)
279fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		EXPORT_SRC_C					(1 << 1)
280fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		GFX_PRIO(x)					((x) << 2)
281fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CS1_PRIO(x)					((x) << 4)
282fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CS2_PRIO(x)					((x) << 6)
283fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SQ_GPR_RESOURCE_MGMT_1				0x8C04
284fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_PS_GPRS(x)					((x) << 0)
285fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_VS_GPRS(x)					((x) << 16)
286fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_CLAUSE_TEMP_GPRS(x)				((x) << 28)
287fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_ESGS_RING_SIZE				0x8c44
288fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_GSVS_RING_SIZE				0x8c4c
289fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_ESTMP_RING_BASE				0x8c50
290fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_ESTMP_RING_SIZE				0x8c54
291fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_GSTMP_RING_BASE				0x8c58
292fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_GSTMP_RING_SIZE				0x8c5c
293fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_VSTMP_RING_BASE				0x8c60
294fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_VSTMP_RING_SIZE				0x8c64
295fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_PSTMP_RING_BASE				0x8c68
296fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_PSTMP_RING_SIZE				0x8c6c
297fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SQ_MS_FIFO_SIZES				0x8CF0
298fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CACHE_FIFO_SIZE(x)				((x) << 0)
299fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		FETCH_FIFO_HIWATER(x)				((x) << 8)
300fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		DONE_FIFO_HIWATER(x)				((x) << 16)
301fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		ALU_UPDATE_FIFO_HIWATER(x)			((x) << 24)
302fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_LSTMP_RING_BASE				0x8e10
303fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_LSTMP_RING_SIZE				0x8e14
304fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_HSTMP_RING_BASE				0x8e18
305fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_HSTMP_RING_SIZE				0x8e1c
306fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SQ_DYN_GPR_CNTL_PS_FLUSH_REQ    		0x8D8C
307fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		DYN_GPR_ENABLE					(1 << 8)
308fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define SQ_CONST_MEM_BASE				0x8df8
309fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
310fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SX_EXPORT_BUFFER_SIZES				0x900C
311fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		COLOR_BUFFER_SIZE(x)				((x) << 0)
312fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		POSITION_BUFFER_SIZE(x)				((x) << 8)
313fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SMX_BUFFER_SIZE(x)				((x) << 16)
314fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SX_DEBUG_1					0x9058
315fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		ENABLE_NEW_SMX_ADDRESS				(1 << 16)
316fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
317fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SPI_CONFIG_CNTL					0x9100
318fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		GPR_WRITE_PRIORITY(x)				((x) << 0)
319fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SPI_CONFIG_CNTL_1				0x913C
320fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		VTX_DONE_DELAY(x)				((x) << 0)
321fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		INTERP_ONE_PRIM_PER_ROW				(1 << 4)
322fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		CRC_SIMD_ID_WADDR_DISABLE			(1 << 8)
323fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
324fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	CGTS_TCC_DISABLE				0x9148
325fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	CGTS_USER_TCC_DISABLE				0x914C
326fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		TCC_DISABLE_MASK				0xFFFF0000
327fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		TCC_DISABLE_SHIFT				16
3282498c41e1b6aaa1929d13cae9ff1cb6226887078Alex Deucher#define	CGTS_SM_CTRL_REG				0x9150
329fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		OVERRIDE				(1 << 21)
330fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
331fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	TA_CNTL_AUX					0x9508
332fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		DISABLE_CUBE_WRAP				(1 << 0)
333fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		DISABLE_CUBE_ANISO				(1 << 1)
334fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
335fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	TCP_CHAN_STEER_LO				0x960c
336fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	TCP_CHAN_STEER_HI				0x9610
337fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
338fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CC_RB_BACKEND_DISABLE				0x98F4
339fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		BACKEND_DISABLE(x)     			((x) << 16)
340fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define GB_ADDR_CONFIG  				0x98F8
341fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_PIPES(x)				((x) << 0)
342fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_PIPES_MASK				0x00000007
343fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_PIPES_SHIFT				0
344fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		PIPE_INTERLEAVE_SIZE(x)			((x) << 4)
345fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		PIPE_INTERLEAVE_SIZE_MASK		0x00000070
346fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		PIPE_INTERLEAVE_SIZE_SHIFT		4
347fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		BANK_INTERLEAVE_SIZE(x)			((x) << 8)
348fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_SHADER_ENGINES(x)			((x) << 12)
349fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_SHADER_ENGINES_MASK			0x00003000
350fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_SHADER_ENGINES_SHIFT		12
351fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SHADER_ENGINE_TILE_SIZE(x)     		((x) << 16)
352fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SHADER_ENGINE_TILE_SIZE_MASK		0x00070000
353fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SHADER_ENGINE_TILE_SIZE_SHIFT		16
354fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_GPUS(x)     			((x) << 20)
355fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_GPUS_MASK				0x00700000
356fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_GPUS_SHIFT				20
357fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		MULTI_GPU_TILE_SIZE(x)     		((x) << 24)
358fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		MULTI_GPU_TILE_SIZE_MASK		0x03000000
359fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		MULTI_GPU_TILE_SIZE_SHIFT		24
360fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		ROW_SIZE(x)             		((x) << 28)
361bb92091acfbb9549e3fd2900427c7548e9ebd1bdAlex Deucher#define		ROW_SIZE_MASK				0x30000000
362fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		ROW_SIZE_SHIFT				28
363fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_LOWER_PIPES(x)			((x) << 30)
364fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_LOWER_PIPES_MASK			0x40000000
365fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUM_LOWER_PIPES_SHIFT			30
366fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define GB_BACKEND_MAP  				0x98FC
367fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
368fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CB_PERF_CTR0_SEL_0				0x9A20
369fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CB_PERF_CTR0_SEL_1				0x9A24
370fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CB_PERF_CTR1_SEL_0				0x9A28
371fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CB_PERF_CTR1_SEL_1				0x9A2C
372fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CB_PERF_CTR2_SEL_0				0x9A30
373fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CB_PERF_CTR2_SEL_1				0x9A34
374fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CB_PERF_CTR3_SEL_0				0x9A38
375fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define CB_PERF_CTR3_SEL_1				0x9A3C
376fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
377fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	GC_USER_RB_BACKEND_DISABLE			0x9B7C
378fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		BACKEND_DISABLE_MASK			0x00FF0000
379fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		BACKEND_DISABLE_SHIFT			16
380fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
381fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SMX_DC_CTL0					0xA020
382fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		USE_HASH_FUNCTION				(1 << 0)
383fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		NUMBER_OF_SETS(x)				((x) << 1)
384fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		FLUSH_ALL_ON_EVENT				(1 << 10)
385fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		STALL_ON_EVENT					(1 << 11)
386fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define	SMX_EVENT_CTL					0xA02C
387fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		ES_FLUSH_CTL(x)					((x) << 0)
388fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		GS_FLUSH_CTL(x)					((x) << 3)
389fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		ACK_FLUSH_CTL(x)				((x) << 6)
390fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher#define		SYNC_FLUSH_CTL					(1 << 8)
391fecf1d072f96114266ed3aae8c4fb93f9c179b00Alex Deucher
3920c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB0_BASE					0xC100
3930c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB0_CNTL					0xC104
3940c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		RB_BUFSZ(x)					((x) << 0)
3950c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		RB_BLKSZ(x)					((x) << 8)
3960c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		RB_NO_UPDATE					(1 << 27)
3970c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		RB_RPTR_WR_ENA					(1 << 31)
3980c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		BUF_SWAP_32BIT					(2 << 16)
3990c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB0_RPTR_ADDR				0xC10C
4000c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB0_RPTR_ADDR_HI				0xC110
4010c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB0_WPTR					0xC114
4021b37078b7ddf35cab12ac6544187e3636d50c0dcAlex Deucher
4031b37078b7ddf35cab12ac6544187e3636d50c0dcAlex Deucher#define CP_INT_CNTL                                     0xC124
4041b37078b7ddf35cab12ac6544187e3636d50c0dcAlex Deucher#       define CNTX_BUSY_INT_ENABLE                     (1 << 19)
4051b37078b7ddf35cab12ac6544187e3636d50c0dcAlex Deucher#       define CNTX_EMPTY_INT_ENABLE                    (1 << 20)
4061b37078b7ddf35cab12ac6544187e3636d50c0dcAlex Deucher#       define TIME_STAMP_INT_ENABLE                    (1 << 26)
4071b37078b7ddf35cab12ac6544187e3636d50c0dcAlex Deucher
4080c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB1_BASE					0xC180
4090c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB1_CNTL					0xC184
4100c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB1_RPTR_ADDR				0xC188
4110c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB1_RPTR_ADDR_HI				0xC18C
4120c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB1_WPTR					0xC190
4130c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB2_BASE					0xC194
4140c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB2_CNTL					0xC198
4150c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB2_RPTR_ADDR				0xC19C
4160c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB2_RPTR_ADDR_HI				0xC1A0
4170c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_RB2_WPTR					0xC1A4
4180c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_PFP_UCODE_ADDR				0xC150
4190c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_PFP_UCODE_DATA				0xC154
4200c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_ME_RAM_RADDR					0xC158
4210c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_ME_RAM_WADDR					0xC15C
4220c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_ME_RAM_DATA					0xC160
4230c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	CP_DEBUG					0xC1FC
4240c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher
425b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher#define VGT_EVENT_INITIATOR                             0x28a90
426b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher#       define CACHE_FLUSH_AND_INV_EVENT_TS                     (0x14 << 0)
427b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher#       define CACHE_FLUSH_AND_INV_EVENT                        (0x16 << 0)
428b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher
4290c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher/*
4300c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher * PM4
4310c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher */
4320c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET_TYPE0	0
4330c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET_TYPE1	1
4340c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET_TYPE2	2
4350c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET_TYPE3	3
4360c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher
4370c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3)
4380c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF)
4390c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define CP_PACKET0_GET_REG(h) (((h) & 0xFFFF) << 2)
4400c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define CP_PACKET3_GET_OPCODE(h) (((h) >> 8) & 0xFF)
4410c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define PACKET0(reg, n)	((PACKET_TYPE0 << 30) |				\
4420c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher			 (((reg) >> 2) & 0xFFFF) |			\
4430c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher			 ((n) & 0x3FFF) << 16)
4440c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define CP_PACKET2			0x80000000
4450c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET2_PAD_SHIFT		0
4460c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET2_PAD_MASK		(0x3fffffff << 0)
4470c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher
4480c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define PACKET2(v)	(CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
4490c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher
4500c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define PACKET3(op, n)	((PACKET_TYPE3 << 30) |				\
4510c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher			 (((op) & 0xFF) << 8) |				\
4520c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher			 ((n) & 0x3FFF) << 16)
4530c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher
4540c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher/* Packet 3 types */
4550c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_NOP					0x10
4560c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_BASE				0x11
4570c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_CLEAR_STATE				0x12
4580c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_INDEX_BUFFER_SIZE			0x13
4590c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DEALLOC_STATE				0x14
4600c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DISPATCH_DIRECT				0x15
4610c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DISPATCH_INDIRECT			0x16
4620c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_INDIRECT_BUFFER_END			0x17
463721604a15b934f0a8d1909acb8017f029128be2fJerome Glisse#define	PACKET3_MODE_CONTROL				0x18
4640c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_PREDICATION				0x20
4650c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_REG_RMW					0x21
4660c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_COND_EXEC				0x22
4670c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_PRED_EXEC				0x23
4680c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDIRECT				0x24
4690c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDEX_INDIRECT			0x25
4700c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_INDEX_BASE				0x26
4710c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDEX_2				0x27
4720c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_CONTEXT_CONTROL				0x28
4730c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDEX_OFFSET			0x29
4740c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_INDEX_TYPE				0x2A
4750c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDEX				0x2B
4760c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDEX_AUTO				0x2D
4770c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDEX_IMMD				0x2E
4780c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_NUM_INSTANCES				0x2F
4790c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDEX_MULTI_AUTO			0x30
4800c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_INDIRECT_BUFFER				0x32
4810c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_STRMOUT_BUFFER_UPDATE			0x34
4820c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDEX_OFFSET_2			0x35
4830c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_DRAW_INDEX_MULTI_ELEMENT		0x36
4840c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_WRITE_DATA				0x37
4850c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_MEM_SEMAPHORE				0x39
4860c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_MPEG_INDEX				0x3A
4870c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_WAIT_REG_MEM				0x3C
4880c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_MEM_WRITE				0x3D
4890c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SURFACE_SYNC				0x43
4900c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB0_DEST_BASE_ENA    (1 << 6)
4910c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB1_DEST_BASE_ENA    (1 << 7)
4920c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB2_DEST_BASE_ENA    (1 << 8)
4930c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB3_DEST_BASE_ENA    (1 << 9)
4940c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB4_DEST_BASE_ENA    (1 << 10)
4950c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB5_DEST_BASE_ENA    (1 << 11)
4960c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB6_DEST_BASE_ENA    (1 << 12)
4970c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB7_DEST_BASE_ENA    (1 << 13)
4980c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_DB_DEST_BASE_ENA     (1 << 14)
4990c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB8_DEST_BASE_ENA    (1 << 15)
5000c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB9_DEST_BASE_ENA    (1 << 16)
5010c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB10_DEST_BASE_ENA   (1 << 17)
5020c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB11_DEST_BASE_ENA   (1 << 18)
5030c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_FULL_CACHE_ENA       (1 << 20)
5040c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_TC_ACTION_ENA        (1 << 23)
5050c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_CB_ACTION_ENA        (1 << 25)
5060c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_DB_ACTION_ENA        (1 << 26)
5070c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_SH_ACTION_ENA        (1 << 27)
5080c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_SX_ACTION_ENA        (1 << 28)
5090c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_ME_INITIALIZE				0x44
5100c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16)
5110c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_COND_WRITE				0x45
5120c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_EVENT_WRITE				0x46
513b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher#define		EVENT_TYPE(x)                           ((x) << 0)
514b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher#define		EVENT_INDEX(x)                          ((x) << 8)
515b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher                /* 0 - any non-TS event
516b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 1 - ZPASS_DONE
517b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 2 - SAMPLE_PIPELINESTAT
518b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 3 - SAMPLE_STREAMOUTSTAT*
519b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 4 - *S_PARTIAL_FLUSH
520b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 5 - TS events
521b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 */
5220c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_EVENT_WRITE_EOP				0x47
523b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher#define		DATA_SEL(x)                             ((x) << 29)
524b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher                /* 0 - discard
525b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 1 - send low 32bit data
526b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 2 - send 64bit data
527b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 3 - send 64bit counter value
528b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 */
529b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher#define		INT_SEL(x)                              ((x) << 24)
530b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher                /* 0 - none
531b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 1 - interrupt only (DATA_SEL = 0)
532b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 * 2 - interrupt when data write is confirmed
533b40e7e1608c332767e6b94bed7af84b30418e739Alex Deucher		 */
5340c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_EVENT_WRITE_EOS				0x48
5350c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_PREAMBLE_CNTL				0x4A
5360c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE     (2 << 28)
5370c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#              define PACKET3_PREAMBLE_END_CLEAR_STATE       (3 << 28)
5380c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_ALU_PS_CONST_BUFFER_COPY		0x4C
5390c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_ALU_VS_CONST_BUFFER_COPY		0x4D
5400c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_ALU_PS_CONST_UPDATE		        0x4E
5410c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_ALU_VS_CONST_UPDATE		        0x4F
5420c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_ONE_REG_WRITE				0x57
5430c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_CONFIG_REG				0x68
5440c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_CONFIG_REG_START			0x00008000
5450c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_CONFIG_REG_END			0x0000ac00
5460c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_CONTEXT_REG				0x69
5470c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_CONTEXT_REG_START			0x00028000
5480c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_CONTEXT_REG_END			0x00029000
5490c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_ALU_CONST				0x6A
5500c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher/* alu const buffers only; no reg file */
5510c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_BOOL_CONST				0x6B
5520c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_BOOL_CONST_START			0x0003a500
5530c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_BOOL_CONST_END			0x0003a518
5540c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_LOOP_CONST				0x6C
5550c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_LOOP_CONST_START			0x0003a200
5560c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_LOOP_CONST_END			0x0003a500
5570c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_RESOURCE				0x6D
5580c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_RESOURCE_START			0x00030000
5590c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_RESOURCE_END			0x00038000
5600c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_SAMPLER				0x6E
5610c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_SAMPLER_START			0x0003c000
5620c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_SAMPLER_END				0x0003c600
5630c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_CTL_CONST				0x6F
5640c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_CTL_CONST_START			0x0003cff0
5650c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define		PACKET3_SET_CTL_CONST_END			0x0003ff0c
5660c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_RESOURCE_OFFSET			0x70
5670c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_ALU_CONST_VS			0x71
5680c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_ALU_CONST_DI			0x72
5690c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_CONTEXT_REG_INDIRECT		0x73
5700c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_RESOURCE_INDIRECT			0x74
5710c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher#define	PACKET3_SET_APPEND_CNT			        0x75
5720c88a02ef6b7e29a811f0d56367cc2268c4ef433Alex Deucher
5730af62b0168043896a042b005ff88caa77dd94d04Alex Deucher#endif
5740af62b0168043896a042b005ff88caa77dd94d04Alex Deucher
575