Alex Deucher | 43b3cd9 | 2012-03-20 17:18:00 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Advanced Micro Devices, Inc. |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | * copy of this software and associated documentation files (the "Software"), |
| 6 | * to deal in the Software without restriction, including without limitation |
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | * and/or sell copies of the Software, and to permit persons to whom the |
| 9 | * Software is furnished to do so, subject to the following conditions: |
| 10 | * |
| 11 | * The above copyright notice and this permission notice shall be included in |
| 12 | * all copies or substantial portions of the Software. |
| 13 | * |
| 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 | * OTHER DEALINGS IN THE SOFTWARE. |
| 21 | * |
| 22 | * Authors: Alex Deucher |
| 23 | */ |
| 24 | #ifndef SI_H |
| 25 | #define SI_H |
| 26 | |
Alex Deucher | 1a8ca75 | 2012-06-01 18:58:22 -0400 | [diff] [blame] | 27 | #define TAHITI_RB_BITMAP_WIDTH_PER_SH 2 |
| 28 | |
| 29 | #define TAHITI_GB_ADDR_CONFIG_GOLDEN 0x12011003 |
| 30 | #define VERDE_GB_ADDR_CONFIG_GOLDEN 0x12010002 |
Alex Deucher | 8b02859 | 2012-07-31 12:42:48 -0400 | [diff] [blame] | 31 | #define HAINAN_GB_ADDR_CONFIG_GOLDEN 0x02010001 |
Alex Deucher | 1a8ca75 | 2012-06-01 18:58:22 -0400 | [diff] [blame] | 32 | |
Alex Deucher | 9ed36f7 | 2013-03-21 12:41:46 -0400 | [diff] [blame^] | 33 | #define SI_MAX_SH_GPRS 256 |
| 34 | #define SI_MAX_TEMP_GPRS 16 |
| 35 | #define SI_MAX_SH_THREADS 256 |
| 36 | #define SI_MAX_SH_STACK_ENTRIES 4096 |
| 37 | #define SI_MAX_FRC_EOV_CNT 16384 |
| 38 | #define SI_MAX_BACKENDS 8 |
| 39 | #define SI_MAX_BACKENDS_MASK 0xFF |
| 40 | #define SI_MAX_BACKENDS_PER_SE_MASK 0x0F |
| 41 | #define SI_MAX_SIMDS 12 |
| 42 | #define SI_MAX_SIMDS_MASK 0x0FFF |
| 43 | #define SI_MAX_SIMDS_PER_SE_MASK 0x00FF |
| 44 | #define SI_MAX_PIPES 8 |
| 45 | #define SI_MAX_PIPES_MASK 0xFF |
| 46 | #define SI_MAX_PIPES_PER_SIMD_MASK 0x3F |
| 47 | #define SI_MAX_LDS_NUM 0xFFFF |
| 48 | #define SI_MAX_TCC 16 |
| 49 | #define SI_MAX_TCC_MASK 0xFFFF |
| 50 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 51 | /* CG IND registers are accessed via SMC indirect space + SMC_CG_IND_START */ |
| 52 | #define SMC_CG_IND_START 0xc0030000 |
| 53 | |
| 54 | #define CG_CGTT_LOCAL_0 0x400 |
| 55 | #define CG_CGTT_LOCAL_1 0x401 |
| 56 | |
Christian König | 2539eb0 | 2013-04-08 12:41:34 +0200 | [diff] [blame] | 57 | /* discrete uvd clocks */ |
| 58 | #define CG_UPLL_FUNC_CNTL 0x634 |
| 59 | # define UPLL_RESET_MASK 0x00000001 |
| 60 | # define UPLL_SLEEP_MASK 0x00000002 |
| 61 | # define UPLL_BYPASS_EN_MASK 0x00000004 |
| 62 | # define UPLL_CTLREQ_MASK 0x00000008 |
| 63 | # define UPLL_VCO_MODE_MASK 0x00000600 |
Christian König | 092fbc4 | 2013-04-29 10:20:23 +0200 | [diff] [blame] | 64 | # define UPLL_REF_DIV_MASK 0x003F0000 |
Christian König | 2539eb0 | 2013-04-08 12:41:34 +0200 | [diff] [blame] | 65 | # define UPLL_CTLACK_MASK 0x40000000 |
| 66 | # define UPLL_CTLACK2_MASK 0x80000000 |
| 67 | #define CG_UPLL_FUNC_CNTL_2 0x638 |
| 68 | # define UPLL_PDIV_A(x) ((x) << 0) |
| 69 | # define UPLL_PDIV_A_MASK 0x0000007F |
| 70 | # define UPLL_PDIV_B(x) ((x) << 8) |
| 71 | # define UPLL_PDIV_B_MASK 0x00007F00 |
| 72 | # define VCLK_SRC_SEL(x) ((x) << 20) |
| 73 | # define VCLK_SRC_SEL_MASK 0x01F00000 |
| 74 | # define DCLK_SRC_SEL(x) ((x) << 25) |
| 75 | # define DCLK_SRC_SEL_MASK 0x3E000000 |
| 76 | #define CG_UPLL_FUNC_CNTL_3 0x63C |
| 77 | # define UPLL_FB_DIV(x) ((x) << 0) |
| 78 | # define UPLL_FB_DIV_MASK 0x01FFFFFF |
| 79 | #define CG_UPLL_FUNC_CNTL_4 0x644 |
| 80 | # define UPLL_SPARE_ISPARE9 0x00020000 |
| 81 | #define CG_UPLL_FUNC_CNTL_5 0x648 |
| 82 | # define RESET_ANTI_MUX_MASK 0x00000200 |
| 83 | #define CG_UPLL_SPREAD_SPECTRUM 0x650 |
| 84 | # define SSEN_MASK 0x00000001 |
| 85 | |
Alex Deucher | 1bd47d2 | 2012-03-20 17:18:10 -0400 | [diff] [blame] | 86 | #define CG_MULT_THERMAL_STATUS 0x714 |
| 87 | #define ASIC_MAX_TEMP(x) ((x) << 0) |
| 88 | #define ASIC_MAX_TEMP_MASK 0x000001ff |
| 89 | #define ASIC_MAX_TEMP_SHIFT 0 |
| 90 | #define CTF_TEMP(x) ((x) << 9) |
| 91 | #define CTF_TEMP_MASK 0x0003fe00 |
| 92 | #define CTF_TEMP_SHIFT 9 |
| 93 | |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 94 | #define VGA_HDP_CONTROL 0x328 |
| 95 | #define VGA_MEMORY_DISABLE (1 << 4) |
| 96 | |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 97 | #define SPLL_CNTL_MODE 0x618 |
| 98 | # define SPLL_REFCLK_SEL(x) ((x) << 8) |
| 99 | # define SPLL_REFCLK_SEL_MASK 0xFF00 |
| 100 | |
| 101 | #define MPLL_BYPASSCLK_SEL 0x65c |
| 102 | # define MPLL_CLKOUT_SEL(x) ((x) << 8) |
| 103 | # define MPLL_CLKOUT_SEL_MASK 0xFF00 |
| 104 | |
Alex Deucher | 454d2e2 | 2013-02-14 10:04:02 -0500 | [diff] [blame] | 105 | #define CG_CLKPIN_CNTL 0x660 |
| 106 | # define XTALIN_DIVIDE (1 << 1) |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 107 | # define BCLK_AS_XCLK (1 << 2) |
Alex Deucher | 454d2e2 | 2013-02-14 10:04:02 -0500 | [diff] [blame] | 108 | #define CG_CLKPIN_CNTL_2 0x664 |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 109 | # define FORCE_BIF_REFCLK_EN (1 << 3) |
Alex Deucher | 454d2e2 | 2013-02-14 10:04:02 -0500 | [diff] [blame] | 110 | # define MUX_TCLK_TO_XCLK (1 << 8) |
| 111 | |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 112 | #define THM_CLK_CNTL 0x66c |
| 113 | # define CMON_CLK_SEL(x) ((x) << 0) |
| 114 | # define CMON_CLK_SEL_MASK 0xFF |
| 115 | # define TMON_CLK_SEL(x) ((x) << 8) |
| 116 | # define TMON_CLK_SEL_MASK 0xFF00 |
| 117 | #define MISC_CLK_CNTL 0x670 |
| 118 | # define DEEP_SLEEP_CLK_SEL(x) ((x) << 0) |
| 119 | # define DEEP_SLEEP_CLK_SEL_MASK 0xFF |
| 120 | # define ZCLK_SEL(x) ((x) << 8) |
| 121 | # define ZCLK_SEL_MASK 0xFF00 |
| 122 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 123 | #define DMIF_ADDR_CONFIG 0xBD4 |
| 124 | |
Alex Deucher | 7c1c7c1 | 2013-04-05 10:28:08 -0400 | [diff] [blame] | 125 | #define DMIF_ADDR_CALC 0xC00 |
| 126 | |
Alex Deucher | c476dde | 2012-03-20 17:18:12 -0400 | [diff] [blame] | 127 | #define SRBM_STATUS 0xE50 |
Alex Deucher | 014bb20 | 2013-01-18 19:36:20 -0500 | [diff] [blame] | 128 | #define GRBM_RQ_PENDING (1 << 5) |
| 129 | #define VMC_BUSY (1 << 8) |
| 130 | #define MCB_BUSY (1 << 9) |
| 131 | #define MCB_NON_DISPLAY_BUSY (1 << 10) |
| 132 | #define MCC_BUSY (1 << 11) |
| 133 | #define MCD_BUSY (1 << 12) |
| 134 | #define SEM_BUSY (1 << 14) |
| 135 | #define IH_BUSY (1 << 17) |
Alex Deucher | c476dde | 2012-03-20 17:18:12 -0400 | [diff] [blame] | 136 | |
Jerome Glisse | 64c56e8 | 2013-01-02 17:30:35 -0500 | [diff] [blame] | 137 | #define SRBM_SOFT_RESET 0x0E60 |
| 138 | #define SOFT_RESET_BIF (1 << 1) |
| 139 | #define SOFT_RESET_DC (1 << 5) |
| 140 | #define SOFT_RESET_DMA1 (1 << 6) |
| 141 | #define SOFT_RESET_GRBM (1 << 8) |
| 142 | #define SOFT_RESET_HDP (1 << 9) |
| 143 | #define SOFT_RESET_IH (1 << 10) |
| 144 | #define SOFT_RESET_MC (1 << 11) |
| 145 | #define SOFT_RESET_ROM (1 << 14) |
| 146 | #define SOFT_RESET_SEM (1 << 15) |
| 147 | #define SOFT_RESET_VMC (1 << 17) |
| 148 | #define SOFT_RESET_DMA (1 << 20) |
| 149 | #define SOFT_RESET_TST (1 << 21) |
| 150 | #define SOFT_RESET_REGBB (1 << 22) |
| 151 | #define SOFT_RESET_ORB (1 << 23) |
| 152 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 153 | #define CC_SYS_RB_BACKEND_DISABLE 0xe80 |
| 154 | #define GC_USER_SYS_RB_BACKEND_DISABLE 0xe84 |
| 155 | |
Alex Deucher | 014bb20 | 2013-01-18 19:36:20 -0500 | [diff] [blame] | 156 | #define SRBM_STATUS2 0x0EC4 |
| 157 | #define DMA_BUSY (1 << 5) |
| 158 | #define DMA1_BUSY (1 << 6) |
| 159 | |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 160 | #define VM_L2_CNTL 0x1400 |
| 161 | #define ENABLE_L2_CACHE (1 << 0) |
| 162 | #define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1) |
| 163 | #define L2_CACHE_PTE_ENDIAN_SWAP_MODE(x) ((x) << 2) |
| 164 | #define L2_CACHE_PDE_ENDIAN_SWAP_MODE(x) ((x) << 4) |
| 165 | #define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9) |
| 166 | #define ENABLE_L2_PDE0_CACHE_LRU_UPDATE_BY_WRITE (1 << 10) |
| 167 | #define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 15) |
| 168 | #define CONTEXT1_IDENTITY_ACCESS_MODE(x) (((x) & 3) << 19) |
| 169 | #define VM_L2_CNTL2 0x1404 |
| 170 | #define INVALIDATE_ALL_L1_TLBS (1 << 0) |
| 171 | #define INVALIDATE_L2_CACHE (1 << 1) |
| 172 | #define INVALIDATE_CACHE_MODE(x) ((x) << 26) |
| 173 | #define INVALIDATE_PTE_AND_PDE_CACHES 0 |
| 174 | #define INVALIDATE_ONLY_PTE_CACHES 1 |
| 175 | #define INVALIDATE_ONLY_PDE_CACHES 2 |
| 176 | #define VM_L2_CNTL3 0x1408 |
| 177 | #define BANK_SELECT(x) ((x) << 0) |
| 178 | #define L2_CACHE_UPDATE_MODE(x) ((x) << 6) |
| 179 | #define L2_CACHE_BIGK_FRAGMENT_SIZE(x) ((x) << 15) |
| 180 | #define L2_CACHE_BIGK_ASSOCIATIVITY (1 << 20) |
| 181 | #define VM_L2_STATUS 0x140C |
| 182 | #define L2_BUSY (1 << 0) |
| 183 | #define VM_CONTEXT0_CNTL 0x1410 |
| 184 | #define ENABLE_CONTEXT (1 << 0) |
| 185 | #define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1) |
Christian König | ae133a1 | 2012-09-18 15:30:44 -0400 | [diff] [blame] | 186 | #define RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 3) |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 187 | #define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4) |
Christian König | ae133a1 | 2012-09-18 15:30:44 -0400 | [diff] [blame] | 188 | #define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 6) |
| 189 | #define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 7) |
| 190 | #define PDE0_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 9) |
| 191 | #define PDE0_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 10) |
| 192 | #define VALID_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 12) |
| 193 | #define VALID_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 13) |
| 194 | #define READ_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 15) |
| 195 | #define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16) |
| 196 | #define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18) |
| 197 | #define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19) |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 198 | #define VM_CONTEXT1_CNTL 0x1414 |
| 199 | #define VM_CONTEXT0_CNTL2 0x1430 |
| 200 | #define VM_CONTEXT1_CNTL2 0x1434 |
| 201 | #define VM_CONTEXT8_PAGE_TABLE_BASE_ADDR 0x1438 |
| 202 | #define VM_CONTEXT9_PAGE_TABLE_BASE_ADDR 0x143c |
| 203 | #define VM_CONTEXT10_PAGE_TABLE_BASE_ADDR 0x1440 |
| 204 | #define VM_CONTEXT11_PAGE_TABLE_BASE_ADDR 0x1444 |
| 205 | #define VM_CONTEXT12_PAGE_TABLE_BASE_ADDR 0x1448 |
| 206 | #define VM_CONTEXT13_PAGE_TABLE_BASE_ADDR 0x144c |
| 207 | #define VM_CONTEXT14_PAGE_TABLE_BASE_ADDR 0x1450 |
| 208 | #define VM_CONTEXT15_PAGE_TABLE_BASE_ADDR 0x1454 |
| 209 | |
Christian König | ae133a1 | 2012-09-18 15:30:44 -0400 | [diff] [blame] | 210 | #define VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x14FC |
| 211 | #define VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x14DC |
| 212 | |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 213 | #define VM_INVALIDATE_REQUEST 0x1478 |
| 214 | #define VM_INVALIDATE_RESPONSE 0x147c |
| 215 | |
| 216 | #define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1518 |
| 217 | #define VM_CONTEXT1_PROTECTION_FAULT_DEFAULT_ADDR 0x151c |
| 218 | |
| 219 | #define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x153c |
| 220 | #define VM_CONTEXT1_PAGE_TABLE_BASE_ADDR 0x1540 |
| 221 | #define VM_CONTEXT2_PAGE_TABLE_BASE_ADDR 0x1544 |
| 222 | #define VM_CONTEXT3_PAGE_TABLE_BASE_ADDR 0x1548 |
| 223 | #define VM_CONTEXT4_PAGE_TABLE_BASE_ADDR 0x154c |
| 224 | #define VM_CONTEXT5_PAGE_TABLE_BASE_ADDR 0x1550 |
| 225 | #define VM_CONTEXT6_PAGE_TABLE_BASE_ADDR 0x1554 |
| 226 | #define VM_CONTEXT7_PAGE_TABLE_BASE_ADDR 0x1558 |
| 227 | #define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x155c |
| 228 | #define VM_CONTEXT1_PAGE_TABLE_START_ADDR 0x1560 |
| 229 | |
| 230 | #define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x157C |
| 231 | #define VM_CONTEXT1_PAGE_TABLE_END_ADDR 0x1580 |
| 232 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 233 | #define VM_L2_CG 0x15c0 |
| 234 | #define MC_CG_ENABLE (1 << 18) |
| 235 | #define MC_LS_ENABLE (1 << 19) |
| 236 | |
Alex Deucher | 43b3cd9 | 2012-03-20 17:18:00 -0400 | [diff] [blame] | 237 | #define MC_SHARED_CHMAP 0x2004 |
| 238 | #define NOOFCHAN_SHIFT 12 |
| 239 | #define NOOFCHAN_MASK 0x0000f000 |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 240 | #define MC_SHARED_CHREMAP 0x2008 |
| 241 | |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 242 | #define MC_VM_FB_LOCATION 0x2024 |
| 243 | #define MC_VM_AGP_TOP 0x2028 |
| 244 | #define MC_VM_AGP_BOT 0x202C |
| 245 | #define MC_VM_AGP_BASE 0x2030 |
| 246 | #define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034 |
| 247 | #define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038 |
| 248 | #define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C |
| 249 | |
| 250 | #define MC_VM_MX_L1_TLB_CNTL 0x2064 |
| 251 | #define ENABLE_L1_TLB (1 << 0) |
| 252 | #define ENABLE_L1_FRAGMENT_PROCESSING (1 << 1) |
| 253 | #define SYSTEM_ACCESS_MODE_PA_ONLY (0 << 3) |
| 254 | #define SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 3) |
| 255 | #define SYSTEM_ACCESS_MODE_IN_SYS (2 << 3) |
| 256 | #define SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 3) |
| 257 | #define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 5) |
| 258 | #define ENABLE_ADVANCED_DRIVER_MODEL (1 << 6) |
| 259 | |
Alex Deucher | 8b074dd | 2012-03-20 17:18:18 -0400 | [diff] [blame] | 260 | #define MC_SHARED_BLACKOUT_CNTL 0x20ac |
| 261 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 262 | #define MC_HUB_MISC_HUB_CG 0x20b8 |
| 263 | #define MC_HUB_MISC_VM_CG 0x20bc |
| 264 | |
| 265 | #define MC_HUB_MISC_SIP_CG 0x20c0 |
| 266 | |
| 267 | #define MC_XPB_CLK_GAT 0x2478 |
| 268 | |
| 269 | #define MC_CITF_MISC_RD_CG 0x2648 |
| 270 | #define MC_CITF_MISC_WR_CG 0x264c |
| 271 | #define MC_CITF_MISC_VM_CG 0x2650 |
| 272 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 273 | #define MC_ARB_RAMCFG 0x2760 |
| 274 | #define NOOFBANK_SHIFT 0 |
| 275 | #define NOOFBANK_MASK 0x00000003 |
| 276 | #define NOOFRANK_SHIFT 2 |
| 277 | #define NOOFRANK_MASK 0x00000004 |
| 278 | #define NOOFROWS_SHIFT 3 |
| 279 | #define NOOFROWS_MASK 0x00000038 |
| 280 | #define NOOFCOLS_SHIFT 6 |
| 281 | #define NOOFCOLS_MASK 0x000000C0 |
| 282 | #define CHANSIZE_SHIFT 8 |
| 283 | #define CHANSIZE_MASK 0x00000100 |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 284 | #define CHANSIZE_OVERRIDE (1 << 11) |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 285 | #define NOOFGROUPS_SHIFT 12 |
| 286 | #define NOOFGROUPS_MASK 0x00001000 |
| 287 | |
Alex Deucher | 8b074dd | 2012-03-20 17:18:18 -0400 | [diff] [blame] | 288 | #define MC_SEQ_TRAIN_WAKEUP_CNTL 0x2808 |
| 289 | #define TRAIN_DONE_D0 (1 << 30) |
| 290 | #define TRAIN_DONE_D1 (1 << 31) |
| 291 | |
| 292 | #define MC_SEQ_SUP_CNTL 0x28c8 |
| 293 | #define RUN_MASK (1 << 0) |
| 294 | #define MC_SEQ_SUP_PGM 0x28cc |
| 295 | |
| 296 | #define MC_IO_PAD_CNTL_D0 0x29d0 |
| 297 | #define MEM_FALL_OUT_CMD (1 << 8) |
| 298 | |
Alex Deucher | d719cef | 2013-02-15 16:49:59 -0500 | [diff] [blame] | 299 | #define MC_SEQ_MISC0 0x2a00 |
| 300 | |
Alex Deucher | 8b074dd | 2012-03-20 17:18:18 -0400 | [diff] [blame] | 301 | #define MC_SEQ_IO_DEBUG_INDEX 0x2a44 |
| 302 | #define MC_SEQ_IO_DEBUG_DATA 0x2a48 |
| 303 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 304 | #define HDP_HOST_PATH_CNTL 0x2C00 |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 305 | #define HDP_NONSURFACE_BASE 0x2C04 |
| 306 | #define HDP_NONSURFACE_INFO 0x2C08 |
| 307 | #define HDP_NONSURFACE_SIZE 0x2C0C |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 308 | |
| 309 | #define HDP_ADDR_CONFIG 0x2F48 |
| 310 | #define HDP_MISC_CNTL 0x2F4C |
| 311 | #define HDP_FLUSH_INVALIDATE_CACHE (1 << 0) |
| 312 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 313 | #define ATC_MISC_CG 0x3350 |
| 314 | |
Alex Deucher | 25a857f | 2012-03-20 17:18:22 -0400 | [diff] [blame] | 315 | #define IH_RB_CNTL 0x3e00 |
| 316 | # define IH_RB_ENABLE (1 << 0) |
| 317 | # define IH_IB_SIZE(x) ((x) << 1) /* log2 */ |
| 318 | # define IH_RB_FULL_DRAIN_ENABLE (1 << 6) |
| 319 | # define IH_WPTR_WRITEBACK_ENABLE (1 << 8) |
| 320 | # define IH_WPTR_WRITEBACK_TIMER(x) ((x) << 9) /* log2 */ |
| 321 | # define IH_WPTR_OVERFLOW_ENABLE (1 << 16) |
| 322 | # define IH_WPTR_OVERFLOW_CLEAR (1 << 31) |
| 323 | #define IH_RB_BASE 0x3e04 |
| 324 | #define IH_RB_RPTR 0x3e08 |
| 325 | #define IH_RB_WPTR 0x3e0c |
| 326 | # define RB_OVERFLOW (1 << 0) |
| 327 | # define WPTR_OFFSET_MASK 0x3fffc |
| 328 | #define IH_RB_WPTR_ADDR_HI 0x3e10 |
| 329 | #define IH_RB_WPTR_ADDR_LO 0x3e14 |
| 330 | #define IH_CNTL 0x3e18 |
| 331 | # define ENABLE_INTR (1 << 0) |
| 332 | # define IH_MC_SWAP(x) ((x) << 1) |
| 333 | # define IH_MC_SWAP_NONE 0 |
| 334 | # define IH_MC_SWAP_16BIT 1 |
| 335 | # define IH_MC_SWAP_32BIT 2 |
| 336 | # define IH_MC_SWAP_64BIT 3 |
| 337 | # define RPTR_REARM (1 << 4) |
| 338 | # define MC_WRREQ_CREDIT(x) ((x) << 15) |
| 339 | # define MC_WR_CLEAN_CNT(x) ((x) << 20) |
| 340 | # define MC_VMID(x) ((x) << 25) |
| 341 | |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 342 | #define CONFIG_MEMSIZE 0x5428 |
| 343 | |
Alex Deucher | 25a857f | 2012-03-20 17:18:22 -0400 | [diff] [blame] | 344 | #define INTERRUPT_CNTL 0x5468 |
| 345 | # define IH_DUMMY_RD_OVERRIDE (1 << 0) |
| 346 | # define IH_DUMMY_RD_EN (1 << 1) |
| 347 | # define IH_REQ_NONSNOOP_EN (1 << 3) |
| 348 | # define GEN_IH_INT_EN (1 << 8) |
| 349 | #define INTERRUPT_CNTL2 0x546c |
| 350 | |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 351 | #define HDP_MEM_COHERENCY_FLUSH_CNTL 0x5480 |
| 352 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 353 | #define BIF_FB_EN 0x5490 |
| 354 | #define FB_READ_EN (1 << 0) |
| 355 | #define FB_WRITE_EN (1 << 1) |
Alex Deucher | 43b3cd9 | 2012-03-20 17:18:00 -0400 | [diff] [blame] | 356 | |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 357 | #define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0 |
| 358 | |
Alex Deucher | 43b3cd9 | 2012-03-20 17:18:00 -0400 | [diff] [blame] | 359 | #define DC_LB_MEMORY_SPLIT 0x6b0c |
| 360 | #define DC_LB_MEMORY_CONFIG(x) ((x) << 20) |
| 361 | |
| 362 | #define PRIORITY_A_CNT 0x6b18 |
| 363 | #define PRIORITY_MARK_MASK 0x7fff |
| 364 | #define PRIORITY_OFF (1 << 16) |
| 365 | #define PRIORITY_ALWAYS_ON (1 << 20) |
| 366 | #define PRIORITY_B_CNT 0x6b1c |
| 367 | |
| 368 | #define DPG_PIPE_ARBITRATION_CONTROL3 0x6cc8 |
| 369 | # define LATENCY_WATERMARK_MASK(x) ((x) << 16) |
| 370 | #define DPG_PIPE_LATENCY_CONTROL 0x6ccc |
| 371 | # define LATENCY_LOW_WATERMARK(x) ((x) << 0) |
| 372 | # define LATENCY_HIGH_WATERMARK(x) ((x) << 16) |
| 373 | |
Alex Deucher | 25a857f | 2012-03-20 17:18:22 -0400 | [diff] [blame] | 374 | /* 0x6bb8, 0x77b8, 0x103b8, 0x10fb8, 0x11bb8, 0x127b8 */ |
| 375 | #define VLINE_STATUS 0x6bb8 |
| 376 | # define VLINE_OCCURRED (1 << 0) |
| 377 | # define VLINE_ACK (1 << 4) |
| 378 | # define VLINE_STAT (1 << 12) |
| 379 | # define VLINE_INTERRUPT (1 << 16) |
| 380 | # define VLINE_INTERRUPT_TYPE (1 << 17) |
| 381 | /* 0x6bbc, 0x77bc, 0x103bc, 0x10fbc, 0x11bbc, 0x127bc */ |
| 382 | #define VBLANK_STATUS 0x6bbc |
| 383 | # define VBLANK_OCCURRED (1 << 0) |
| 384 | # define VBLANK_ACK (1 << 4) |
| 385 | # define VBLANK_STAT (1 << 12) |
| 386 | # define VBLANK_INTERRUPT (1 << 16) |
| 387 | # define VBLANK_INTERRUPT_TYPE (1 << 17) |
| 388 | |
| 389 | /* 0x6b40, 0x7740, 0x10340, 0x10f40, 0x11b40, 0x12740 */ |
| 390 | #define INT_MASK 0x6b40 |
| 391 | # define VBLANK_INT_MASK (1 << 0) |
| 392 | # define VLINE_INT_MASK (1 << 4) |
| 393 | |
| 394 | #define DISP_INTERRUPT_STATUS 0x60f4 |
| 395 | # define LB_D1_VLINE_INTERRUPT (1 << 2) |
| 396 | # define LB_D1_VBLANK_INTERRUPT (1 << 3) |
| 397 | # define DC_HPD1_INTERRUPT (1 << 17) |
| 398 | # define DC_HPD1_RX_INTERRUPT (1 << 18) |
| 399 | # define DACA_AUTODETECT_INTERRUPT (1 << 22) |
| 400 | # define DACB_AUTODETECT_INTERRUPT (1 << 23) |
| 401 | # define DC_I2C_SW_DONE_INTERRUPT (1 << 24) |
| 402 | # define DC_I2C_HW_DONE_INTERRUPT (1 << 25) |
| 403 | #define DISP_INTERRUPT_STATUS_CONTINUE 0x60f8 |
| 404 | # define LB_D2_VLINE_INTERRUPT (1 << 2) |
| 405 | # define LB_D2_VBLANK_INTERRUPT (1 << 3) |
| 406 | # define DC_HPD2_INTERRUPT (1 << 17) |
| 407 | # define DC_HPD2_RX_INTERRUPT (1 << 18) |
| 408 | # define DISP_TIMER_INTERRUPT (1 << 24) |
| 409 | #define DISP_INTERRUPT_STATUS_CONTINUE2 0x60fc |
| 410 | # define LB_D3_VLINE_INTERRUPT (1 << 2) |
| 411 | # define LB_D3_VBLANK_INTERRUPT (1 << 3) |
| 412 | # define DC_HPD3_INTERRUPT (1 << 17) |
| 413 | # define DC_HPD3_RX_INTERRUPT (1 << 18) |
| 414 | #define DISP_INTERRUPT_STATUS_CONTINUE3 0x6100 |
| 415 | # define LB_D4_VLINE_INTERRUPT (1 << 2) |
| 416 | # define LB_D4_VBLANK_INTERRUPT (1 << 3) |
| 417 | # define DC_HPD4_INTERRUPT (1 << 17) |
| 418 | # define DC_HPD4_RX_INTERRUPT (1 << 18) |
| 419 | #define DISP_INTERRUPT_STATUS_CONTINUE4 0x614c |
| 420 | # define LB_D5_VLINE_INTERRUPT (1 << 2) |
| 421 | # define LB_D5_VBLANK_INTERRUPT (1 << 3) |
| 422 | # define DC_HPD5_INTERRUPT (1 << 17) |
| 423 | # define DC_HPD5_RX_INTERRUPT (1 << 18) |
| 424 | #define DISP_INTERRUPT_STATUS_CONTINUE5 0x6150 |
| 425 | # define LB_D6_VLINE_INTERRUPT (1 << 2) |
| 426 | # define LB_D6_VBLANK_INTERRUPT (1 << 3) |
| 427 | # define DC_HPD6_INTERRUPT (1 << 17) |
| 428 | # define DC_HPD6_RX_INTERRUPT (1 << 18) |
| 429 | |
| 430 | /* 0x6858, 0x7458, 0x10058, 0x10c58, 0x11858, 0x12458 */ |
| 431 | #define GRPH_INT_STATUS 0x6858 |
| 432 | # define GRPH_PFLIP_INT_OCCURRED (1 << 0) |
| 433 | # define GRPH_PFLIP_INT_CLEAR (1 << 8) |
| 434 | /* 0x685c, 0x745c, 0x1005c, 0x10c5c, 0x1185c, 0x1245c */ |
| 435 | #define GRPH_INT_CONTROL 0x685c |
| 436 | # define GRPH_PFLIP_INT_MASK (1 << 0) |
| 437 | # define GRPH_PFLIP_INT_TYPE (1 << 8) |
| 438 | |
| 439 | #define DACA_AUTODETECT_INT_CONTROL 0x66c8 |
| 440 | |
| 441 | #define DC_HPD1_INT_STATUS 0x601c |
| 442 | #define DC_HPD2_INT_STATUS 0x6028 |
| 443 | #define DC_HPD3_INT_STATUS 0x6034 |
| 444 | #define DC_HPD4_INT_STATUS 0x6040 |
| 445 | #define DC_HPD5_INT_STATUS 0x604c |
| 446 | #define DC_HPD6_INT_STATUS 0x6058 |
| 447 | # define DC_HPDx_INT_STATUS (1 << 0) |
| 448 | # define DC_HPDx_SENSE (1 << 1) |
| 449 | # define DC_HPDx_RX_INT_STATUS (1 << 8) |
| 450 | |
| 451 | #define DC_HPD1_INT_CONTROL 0x6020 |
| 452 | #define DC_HPD2_INT_CONTROL 0x602c |
| 453 | #define DC_HPD3_INT_CONTROL 0x6038 |
| 454 | #define DC_HPD4_INT_CONTROL 0x6044 |
| 455 | #define DC_HPD5_INT_CONTROL 0x6050 |
| 456 | #define DC_HPD6_INT_CONTROL 0x605c |
| 457 | # define DC_HPDx_INT_ACK (1 << 0) |
| 458 | # define DC_HPDx_INT_POLARITY (1 << 8) |
| 459 | # define DC_HPDx_INT_EN (1 << 16) |
| 460 | # define DC_HPDx_RX_INT_ACK (1 << 20) |
| 461 | # define DC_HPDx_RX_INT_EN (1 << 24) |
| 462 | |
| 463 | #define DC_HPD1_CONTROL 0x6024 |
| 464 | #define DC_HPD2_CONTROL 0x6030 |
| 465 | #define DC_HPD3_CONTROL 0x603c |
| 466 | #define DC_HPD4_CONTROL 0x6048 |
| 467 | #define DC_HPD5_CONTROL 0x6054 |
| 468 | #define DC_HPD6_CONTROL 0x6060 |
| 469 | # define DC_HPDx_CONNECTION_TIMER(x) ((x) << 0) |
| 470 | # define DC_HPDx_RX_INT_TIMER(x) ((x) << 16) |
| 471 | # define DC_HPDx_EN (1 << 28) |
| 472 | |
| 473 | /* 0x6e98, 0x7a98, 0x10698, 0x11298, 0x11e98, 0x12a98 */ |
| 474 | #define CRTC_STATUS_FRAME_COUNT 0x6e98 |
| 475 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 476 | #define GRBM_CNTL 0x8000 |
| 477 | #define GRBM_READ_TIMEOUT(x) ((x) << 0) |
| 478 | |
Alex Deucher | c476dde | 2012-03-20 17:18:12 -0400 | [diff] [blame] | 479 | #define GRBM_STATUS2 0x8008 |
| 480 | #define RLC_RQ_PENDING (1 << 0) |
| 481 | #define RLC_BUSY (1 << 8) |
| 482 | #define TC_BUSY (1 << 9) |
| 483 | |
| 484 | #define GRBM_STATUS 0x8010 |
| 485 | #define CMDFIFO_AVAIL_MASK 0x0000000F |
| 486 | #define RING2_RQ_PENDING (1 << 4) |
| 487 | #define SRBM_RQ_PENDING (1 << 5) |
| 488 | #define RING1_RQ_PENDING (1 << 6) |
| 489 | #define CF_RQ_PENDING (1 << 7) |
| 490 | #define PF_RQ_PENDING (1 << 8) |
| 491 | #define GDS_DMA_RQ_PENDING (1 << 9) |
| 492 | #define GRBM_EE_BUSY (1 << 10) |
| 493 | #define DB_CLEAN (1 << 12) |
| 494 | #define CB_CLEAN (1 << 13) |
| 495 | #define TA_BUSY (1 << 14) |
| 496 | #define GDS_BUSY (1 << 15) |
| 497 | #define VGT_BUSY (1 << 17) |
| 498 | #define IA_BUSY_NO_DMA (1 << 18) |
| 499 | #define IA_BUSY (1 << 19) |
| 500 | #define SX_BUSY (1 << 20) |
| 501 | #define SPI_BUSY (1 << 22) |
| 502 | #define BCI_BUSY (1 << 23) |
| 503 | #define SC_BUSY (1 << 24) |
| 504 | #define PA_BUSY (1 << 25) |
| 505 | #define DB_BUSY (1 << 26) |
| 506 | #define CP_COHERENCY_BUSY (1 << 28) |
| 507 | #define CP_BUSY (1 << 29) |
| 508 | #define CB_BUSY (1 << 30) |
| 509 | #define GUI_ACTIVE (1 << 31) |
| 510 | #define GRBM_STATUS_SE0 0x8014 |
| 511 | #define GRBM_STATUS_SE1 0x8018 |
| 512 | #define SE_DB_CLEAN (1 << 1) |
| 513 | #define SE_CB_CLEAN (1 << 2) |
| 514 | #define SE_BCI_BUSY (1 << 22) |
| 515 | #define SE_VGT_BUSY (1 << 23) |
| 516 | #define SE_PA_BUSY (1 << 24) |
| 517 | #define SE_TA_BUSY (1 << 25) |
| 518 | #define SE_SX_BUSY (1 << 26) |
| 519 | #define SE_SPI_BUSY (1 << 27) |
| 520 | #define SE_SC_BUSY (1 << 29) |
| 521 | #define SE_DB_BUSY (1 << 30) |
| 522 | #define SE_CB_BUSY (1 << 31) |
| 523 | |
| 524 | #define GRBM_SOFT_RESET 0x8020 |
| 525 | #define SOFT_RESET_CP (1 << 0) |
| 526 | #define SOFT_RESET_CB (1 << 1) |
| 527 | #define SOFT_RESET_RLC (1 << 2) |
| 528 | #define SOFT_RESET_DB (1 << 3) |
| 529 | #define SOFT_RESET_GDS (1 << 4) |
| 530 | #define SOFT_RESET_PA (1 << 5) |
| 531 | #define SOFT_RESET_SC (1 << 6) |
| 532 | #define SOFT_RESET_BCI (1 << 7) |
| 533 | #define SOFT_RESET_SPI (1 << 8) |
| 534 | #define SOFT_RESET_SX (1 << 10) |
| 535 | #define SOFT_RESET_TC (1 << 11) |
| 536 | #define SOFT_RESET_TA (1 << 12) |
| 537 | #define SOFT_RESET_VGT (1 << 14) |
| 538 | #define SOFT_RESET_IA (1 << 15) |
| 539 | |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 540 | #define GRBM_GFX_INDEX 0x802C |
Alex Deucher | 1a8ca75 | 2012-06-01 18:58:22 -0400 | [diff] [blame] | 541 | #define INSTANCE_INDEX(x) ((x) << 0) |
| 542 | #define SH_INDEX(x) ((x) << 8) |
| 543 | #define SE_INDEX(x) ((x) << 16) |
| 544 | #define SH_BROADCAST_WRITES (1 << 29) |
| 545 | #define INSTANCE_BROADCAST_WRITES (1 << 30) |
| 546 | #define SE_BROADCAST_WRITES (1 << 31) |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 547 | |
Alex Deucher | 25a857f | 2012-03-20 17:18:22 -0400 | [diff] [blame] | 548 | #define GRBM_INT_CNTL 0x8060 |
| 549 | # define RDERR_INT_ENABLE (1 << 0) |
| 550 | # define GUI_IDLE_INT_ENABLE (1 << 19) |
| 551 | |
Alex Deucher | f418b88 | 2012-11-08 10:13:24 -0500 | [diff] [blame] | 552 | #define CP_STRMOUT_CNTL 0x84FC |
Alex Deucher | 48c0c90 | 2012-03-20 17:18:19 -0400 | [diff] [blame] | 553 | #define SCRATCH_REG0 0x8500 |
| 554 | #define SCRATCH_REG1 0x8504 |
| 555 | #define SCRATCH_REG2 0x8508 |
| 556 | #define SCRATCH_REG3 0x850C |
| 557 | #define SCRATCH_REG4 0x8510 |
| 558 | #define SCRATCH_REG5 0x8514 |
| 559 | #define SCRATCH_REG6 0x8518 |
| 560 | #define SCRATCH_REG7 0x851C |
| 561 | |
| 562 | #define SCRATCH_UMSK 0x8540 |
| 563 | #define SCRATCH_ADDR 0x8544 |
| 564 | |
| 565 | #define CP_SEM_WAIT_TIMER 0x85BC |
| 566 | |
| 567 | #define CP_SEM_INCOMPLETE_TIMER_CNTL 0x85C8 |
| 568 | |
Alex Deucher | c476dde | 2012-03-20 17:18:12 -0400 | [diff] [blame] | 569 | #define CP_ME_CNTL 0x86D8 |
| 570 | #define CP_CE_HALT (1 << 24) |
| 571 | #define CP_PFP_HALT (1 << 26) |
| 572 | #define CP_ME_HALT (1 << 28) |
| 573 | |
Alex Deucher | 2ece2e8 | 2012-03-20 17:18:20 -0400 | [diff] [blame] | 574 | #define CP_COHER_CNTL2 0x85E8 |
| 575 | |
Alex Deucher | 48c0c90 | 2012-03-20 17:18:19 -0400 | [diff] [blame] | 576 | #define CP_RB2_RPTR 0x86f8 |
| 577 | #define CP_RB1_RPTR 0x86fc |
Alex Deucher | c476dde | 2012-03-20 17:18:12 -0400 | [diff] [blame] | 578 | #define CP_RB0_RPTR 0x8700 |
Alex Deucher | 48c0c90 | 2012-03-20 17:18:19 -0400 | [diff] [blame] | 579 | #define CP_RB_WPTR_DELAY 0x8704 |
Alex Deucher | c476dde | 2012-03-20 17:18:12 -0400 | [diff] [blame] | 580 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 581 | #define CP_QUEUE_THRESHOLDS 0x8760 |
| 582 | #define ROQ_IB1_START(x) ((x) << 0) |
| 583 | #define ROQ_IB2_START(x) ((x) << 8) |
| 584 | #define CP_MEQ_THRESHOLDS 0x8764 |
| 585 | #define MEQ1_START(x) ((x) << 0) |
| 586 | #define MEQ2_START(x) ((x) << 8) |
| 587 | |
| 588 | #define CP_PERFMON_CNTL 0x87FC |
| 589 | |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 590 | #define VGT_VTX_VECT_EJECT_REG 0x88B0 |
| 591 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 592 | #define VGT_CACHE_INVALIDATION 0x88C4 |
| 593 | #define CACHE_INVALIDATION(x) ((x) << 0) |
| 594 | #define VC_ONLY 0 |
| 595 | #define TC_ONLY 1 |
| 596 | #define VC_AND_TC 2 |
| 597 | #define AUTO_INVLD_EN(x) ((x) << 6) |
| 598 | #define NO_AUTO 0 |
| 599 | #define ES_AUTO 1 |
| 600 | #define GS_AUTO 2 |
| 601 | #define ES_AND_GS_AUTO 3 |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 602 | #define VGT_ESGS_RING_SIZE 0x88C8 |
| 603 | #define VGT_GSVS_RING_SIZE 0x88CC |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 604 | |
| 605 | #define VGT_GS_VERTEX_REUSE 0x88D4 |
| 606 | |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 607 | #define VGT_PRIMITIVE_TYPE 0x8958 |
| 608 | #define VGT_INDEX_TYPE 0x895C |
| 609 | |
| 610 | #define VGT_NUM_INDICES 0x8970 |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 611 | #define VGT_NUM_INSTANCES 0x8974 |
| 612 | |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 613 | #define VGT_TF_RING_SIZE 0x8988 |
| 614 | |
| 615 | #define VGT_HS_OFFCHIP_PARAM 0x89B0 |
| 616 | |
| 617 | #define VGT_TF_MEMORY_BASE 0x89B8 |
| 618 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 619 | #define CC_GC_SHADER_ARRAY_CONFIG 0x89bc |
Alex Deucher | 1a8ca75 | 2012-06-01 18:58:22 -0400 | [diff] [blame] | 620 | #define INACTIVE_CUS_MASK 0xFFFF0000 |
| 621 | #define INACTIVE_CUS_SHIFT 16 |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 622 | #define GC_USER_SHADER_ARRAY_CONFIG 0x89c0 |
| 623 | |
| 624 | #define PA_CL_ENHANCE 0x8A14 |
| 625 | #define CLIP_VTX_REORDER_ENA (1 << 0) |
| 626 | #define NUM_CLIP_SEQ(x) ((x) << 1) |
| 627 | |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 628 | #define PA_SU_LINE_STIPPLE_VALUE 0x8A60 |
| 629 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 630 | #define PA_SC_LINE_STIPPLE_STATE 0x8B10 |
| 631 | |
| 632 | #define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24 |
| 633 | #define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0) |
| 634 | #define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16) |
| 635 | |
| 636 | #define PA_SC_FIFO_SIZE 0x8BCC |
| 637 | #define SC_FRONTEND_PRIM_FIFO_SIZE(x) ((x) << 0) |
| 638 | #define SC_BACKEND_PRIM_FIFO_SIZE(x) ((x) << 6) |
| 639 | #define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 15) |
| 640 | #define SC_EARLYZ_TILE_FIFO_SIZE(x) ((x) << 23) |
| 641 | |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 642 | #define PA_SC_ENHANCE 0x8BF0 |
| 643 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 644 | #define SQ_CONFIG 0x8C00 |
| 645 | |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 646 | #define SQC_CACHES 0x8C08 |
| 647 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 648 | #define SX_DEBUG_1 0x9060 |
| 649 | |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 650 | #define SPI_STATIC_THREAD_MGMT_1 0x90E0 |
| 651 | #define SPI_STATIC_THREAD_MGMT_2 0x90E4 |
| 652 | #define SPI_STATIC_THREAD_MGMT_3 0x90E8 |
| 653 | #define SPI_PS_MAX_WAVE_ID 0x90EC |
| 654 | |
| 655 | #define SPI_CONFIG_CNTL 0x9100 |
| 656 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 657 | #define SPI_CONFIG_CNTL_1 0x913C |
| 658 | #define VTX_DONE_DELAY(x) ((x) << 0) |
| 659 | #define INTERP_ONE_PRIM_PER_ROW (1 << 4) |
| 660 | |
| 661 | #define CGTS_TCC_DISABLE 0x9148 |
| 662 | #define CGTS_USER_TCC_DISABLE 0x914C |
| 663 | #define TCC_DISABLE_MASK 0xFFFF0000 |
| 664 | #define TCC_DISABLE_SHIFT 16 |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 665 | #define CGTS_SM_CTRL_REG 0x9150 |
| 666 | #define OVERRIDE (1 << 21) |
| 667 | #define LS_OVERRIDE (1 << 22) |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 668 | |
Alex Deucher | d719cef | 2013-02-15 16:49:59 -0500 | [diff] [blame] | 669 | #define SPI_LB_CU_MASK 0x9354 |
| 670 | |
Alex Deucher | 498dd8b | 2012-03-20 17:18:15 -0400 | [diff] [blame] | 671 | #define TA_CNTL_AUX 0x9508 |
| 672 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 673 | #define CC_RB_BACKEND_DISABLE 0x98F4 |
| 674 | #define BACKEND_DISABLE(x) ((x) << 16) |
| 675 | #define GB_ADDR_CONFIG 0x98F8 |
| 676 | #define NUM_PIPES(x) ((x) << 0) |
| 677 | #define NUM_PIPES_MASK 0x00000007 |
| 678 | #define NUM_PIPES_SHIFT 0 |
| 679 | #define PIPE_INTERLEAVE_SIZE(x) ((x) << 4) |
| 680 | #define PIPE_INTERLEAVE_SIZE_MASK 0x00000070 |
| 681 | #define PIPE_INTERLEAVE_SIZE_SHIFT 4 |
| 682 | #define NUM_SHADER_ENGINES(x) ((x) << 12) |
| 683 | #define NUM_SHADER_ENGINES_MASK 0x00003000 |
| 684 | #define NUM_SHADER_ENGINES_SHIFT 12 |
| 685 | #define SHADER_ENGINE_TILE_SIZE(x) ((x) << 16) |
| 686 | #define SHADER_ENGINE_TILE_SIZE_MASK 0x00070000 |
| 687 | #define SHADER_ENGINE_TILE_SIZE_SHIFT 16 |
| 688 | #define NUM_GPUS(x) ((x) << 20) |
| 689 | #define NUM_GPUS_MASK 0x00700000 |
| 690 | #define NUM_GPUS_SHIFT 20 |
| 691 | #define MULTI_GPU_TILE_SIZE(x) ((x) << 24) |
| 692 | #define MULTI_GPU_TILE_SIZE_MASK 0x03000000 |
| 693 | #define MULTI_GPU_TILE_SIZE_SHIFT 24 |
| 694 | #define ROW_SIZE(x) ((x) << 28) |
| 695 | #define ROW_SIZE_MASK 0x30000000 |
| 696 | #define ROW_SIZE_SHIFT 28 |
| 697 | |
| 698 | #define GB_TILE_MODE0 0x9910 |
| 699 | # define MICRO_TILE_MODE(x) ((x) << 0) |
| 700 | # define ADDR_SURF_DISPLAY_MICRO_TILING 0 |
| 701 | # define ADDR_SURF_THIN_MICRO_TILING 1 |
| 702 | # define ADDR_SURF_DEPTH_MICRO_TILING 2 |
| 703 | # define ARRAY_MODE(x) ((x) << 2) |
| 704 | # define ARRAY_LINEAR_GENERAL 0 |
| 705 | # define ARRAY_LINEAR_ALIGNED 1 |
| 706 | # define ARRAY_1D_TILED_THIN1 2 |
| 707 | # define ARRAY_2D_TILED_THIN1 4 |
| 708 | # define PIPE_CONFIG(x) ((x) << 6) |
| 709 | # define ADDR_SURF_P2 0 |
| 710 | # define ADDR_SURF_P4_8x16 4 |
| 711 | # define ADDR_SURF_P4_16x16 5 |
| 712 | # define ADDR_SURF_P4_16x32 6 |
| 713 | # define ADDR_SURF_P4_32x32 7 |
| 714 | # define ADDR_SURF_P8_16x16_8x16 8 |
| 715 | # define ADDR_SURF_P8_16x32_8x16 9 |
| 716 | # define ADDR_SURF_P8_32x32_8x16 10 |
| 717 | # define ADDR_SURF_P8_16x32_16x16 11 |
| 718 | # define ADDR_SURF_P8_32x32_16x16 12 |
| 719 | # define ADDR_SURF_P8_32x32_16x32 13 |
| 720 | # define ADDR_SURF_P8_32x64_32x32 14 |
| 721 | # define TILE_SPLIT(x) ((x) << 11) |
| 722 | # define ADDR_SURF_TILE_SPLIT_64B 0 |
| 723 | # define ADDR_SURF_TILE_SPLIT_128B 1 |
| 724 | # define ADDR_SURF_TILE_SPLIT_256B 2 |
| 725 | # define ADDR_SURF_TILE_SPLIT_512B 3 |
| 726 | # define ADDR_SURF_TILE_SPLIT_1KB 4 |
| 727 | # define ADDR_SURF_TILE_SPLIT_2KB 5 |
| 728 | # define ADDR_SURF_TILE_SPLIT_4KB 6 |
| 729 | # define BANK_WIDTH(x) ((x) << 14) |
| 730 | # define ADDR_SURF_BANK_WIDTH_1 0 |
| 731 | # define ADDR_SURF_BANK_WIDTH_2 1 |
| 732 | # define ADDR_SURF_BANK_WIDTH_4 2 |
| 733 | # define ADDR_SURF_BANK_WIDTH_8 3 |
| 734 | # define BANK_HEIGHT(x) ((x) << 16) |
| 735 | # define ADDR_SURF_BANK_HEIGHT_1 0 |
| 736 | # define ADDR_SURF_BANK_HEIGHT_2 1 |
| 737 | # define ADDR_SURF_BANK_HEIGHT_4 2 |
| 738 | # define ADDR_SURF_BANK_HEIGHT_8 3 |
| 739 | # define MACRO_TILE_ASPECT(x) ((x) << 18) |
| 740 | # define ADDR_SURF_MACRO_ASPECT_1 0 |
| 741 | # define ADDR_SURF_MACRO_ASPECT_2 1 |
| 742 | # define ADDR_SURF_MACRO_ASPECT_4 2 |
| 743 | # define ADDR_SURF_MACRO_ASPECT_8 3 |
| 744 | # define NUM_BANKS(x) ((x) << 20) |
| 745 | # define ADDR_SURF_2_BANK 0 |
| 746 | # define ADDR_SURF_4_BANK 1 |
| 747 | # define ADDR_SURF_8_BANK 2 |
| 748 | # define ADDR_SURF_16_BANK 3 |
| 749 | |
| 750 | #define CB_PERFCOUNTER0_SELECT0 0x9a20 |
| 751 | #define CB_PERFCOUNTER0_SELECT1 0x9a24 |
| 752 | #define CB_PERFCOUNTER1_SELECT0 0x9a28 |
| 753 | #define CB_PERFCOUNTER1_SELECT1 0x9a2c |
| 754 | #define CB_PERFCOUNTER2_SELECT0 0x9a30 |
| 755 | #define CB_PERFCOUNTER2_SELECT1 0x9a34 |
| 756 | #define CB_PERFCOUNTER3_SELECT0 0x9a38 |
| 757 | #define CB_PERFCOUNTER3_SELECT1 0x9a3c |
| 758 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 759 | #define CB_CGTT_SCLK_CTRL 0x9a60 |
| 760 | |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 761 | #define GC_USER_RB_BACKEND_DISABLE 0x9B7C |
| 762 | #define BACKEND_DISABLE_MASK 0x00FF0000 |
| 763 | #define BACKEND_DISABLE_SHIFT 16 |
| 764 | |
| 765 | #define TCP_CHAN_STEER_LO 0xac0c |
| 766 | #define TCP_CHAN_STEER_HI 0xac10 |
| 767 | |
Alex Deucher | 48c0c90 | 2012-03-20 17:18:19 -0400 | [diff] [blame] | 768 | #define CP_RB0_BASE 0xC100 |
| 769 | #define CP_RB0_CNTL 0xC104 |
| 770 | #define RB_BUFSZ(x) ((x) << 0) |
| 771 | #define RB_BLKSZ(x) ((x) << 8) |
| 772 | #define BUF_SWAP_32BIT (2 << 16) |
| 773 | #define RB_NO_UPDATE (1 << 27) |
| 774 | #define RB_RPTR_WR_ENA (1 << 31) |
| 775 | |
| 776 | #define CP_RB0_RPTR_ADDR 0xC10C |
| 777 | #define CP_RB0_RPTR_ADDR_HI 0xC110 |
| 778 | #define CP_RB0_WPTR 0xC114 |
| 779 | |
| 780 | #define CP_PFP_UCODE_ADDR 0xC150 |
| 781 | #define CP_PFP_UCODE_DATA 0xC154 |
| 782 | #define CP_ME_RAM_RADDR 0xC158 |
| 783 | #define CP_ME_RAM_WADDR 0xC15C |
| 784 | #define CP_ME_RAM_DATA 0xC160 |
| 785 | |
| 786 | #define CP_CE_UCODE_ADDR 0xC168 |
| 787 | #define CP_CE_UCODE_DATA 0xC16C |
| 788 | |
| 789 | #define CP_RB1_BASE 0xC180 |
| 790 | #define CP_RB1_CNTL 0xC184 |
| 791 | #define CP_RB1_RPTR_ADDR 0xC188 |
| 792 | #define CP_RB1_RPTR_ADDR_HI 0xC18C |
| 793 | #define CP_RB1_WPTR 0xC190 |
| 794 | #define CP_RB2_BASE 0xC194 |
| 795 | #define CP_RB2_CNTL 0xC198 |
| 796 | #define CP_RB2_RPTR_ADDR 0xC19C |
| 797 | #define CP_RB2_RPTR_ADDR_HI 0xC1A0 |
| 798 | #define CP_RB2_WPTR 0xC1A4 |
Alex Deucher | 25a857f | 2012-03-20 17:18:22 -0400 | [diff] [blame] | 799 | #define CP_INT_CNTL_RING0 0xC1A8 |
| 800 | #define CP_INT_CNTL_RING1 0xC1AC |
| 801 | #define CP_INT_CNTL_RING2 0xC1B0 |
| 802 | # define CNTX_BUSY_INT_ENABLE (1 << 19) |
| 803 | # define CNTX_EMPTY_INT_ENABLE (1 << 20) |
| 804 | # define WAIT_MEM_SEM_INT_ENABLE (1 << 21) |
| 805 | # define TIME_STAMP_INT_ENABLE (1 << 26) |
| 806 | # define CP_RINGID2_INT_ENABLE (1 << 29) |
| 807 | # define CP_RINGID1_INT_ENABLE (1 << 30) |
| 808 | # define CP_RINGID0_INT_ENABLE (1 << 31) |
| 809 | #define CP_INT_STATUS_RING0 0xC1B4 |
| 810 | #define CP_INT_STATUS_RING1 0xC1B8 |
| 811 | #define CP_INT_STATUS_RING2 0xC1BC |
| 812 | # define WAIT_MEM_SEM_INT_STAT (1 << 21) |
| 813 | # define TIME_STAMP_INT_STAT (1 << 26) |
| 814 | # define CP_RINGID2_INT_STAT (1 << 29) |
| 815 | # define CP_RINGID1_INT_STAT (1 << 30) |
| 816 | # define CP_RINGID0_INT_STAT (1 << 31) |
Alex Deucher | 48c0c90 | 2012-03-20 17:18:19 -0400 | [diff] [blame] | 817 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 818 | #define CP_MEM_SLP_CNTL 0xC1E4 |
| 819 | # define CP_MEM_LS_EN (1 << 0) |
| 820 | |
Alex Deucher | 48c0c90 | 2012-03-20 17:18:19 -0400 | [diff] [blame] | 821 | #define CP_DEBUG 0xC1FC |
| 822 | |
Alex Deucher | 347e759 | 2012-03-20 17:18:21 -0400 | [diff] [blame] | 823 | #define RLC_CNTL 0xC300 |
| 824 | # define RLC_ENABLE (1 << 0) |
| 825 | #define RLC_RL_BASE 0xC304 |
| 826 | #define RLC_RL_SIZE 0xC308 |
| 827 | #define RLC_LB_CNTL 0xC30C |
Alex Deucher | d719cef | 2013-02-15 16:49:59 -0500 | [diff] [blame] | 828 | # define LOAD_BALANCE_ENABLE (1 << 0) |
Alex Deucher | 347e759 | 2012-03-20 17:18:21 -0400 | [diff] [blame] | 829 | #define RLC_SAVE_AND_RESTORE_BASE 0xC310 |
| 830 | #define RLC_LB_CNTR_MAX 0xC314 |
| 831 | #define RLC_LB_CNTR_INIT 0xC318 |
| 832 | |
| 833 | #define RLC_CLEAR_STATE_RESTORE_BASE 0xC320 |
| 834 | |
| 835 | #define RLC_UCODE_ADDR 0xC32C |
| 836 | #define RLC_UCODE_DATA 0xC330 |
| 837 | |
Marek Olšák | 6759a0a | 2012-08-09 16:34:17 +0200 | [diff] [blame] | 838 | #define RLC_GPU_CLOCK_COUNT_LSB 0xC338 |
| 839 | #define RLC_GPU_CLOCK_COUNT_MSB 0xC33C |
| 840 | #define RLC_CAPTURE_GPU_CLOCK_COUNT 0xC340 |
Alex Deucher | 347e759 | 2012-03-20 17:18:21 -0400 | [diff] [blame] | 841 | #define RLC_MC_CNTL 0xC344 |
| 842 | #define RLC_UCODE_CNTL 0xC348 |
Alex Deucher | d719cef | 2013-02-15 16:49:59 -0500 | [diff] [blame] | 843 | #define RLC_STAT 0xC34C |
| 844 | # define RLC_BUSY_STATUS (1 << 0) |
| 845 | # define GFX_POWER_STATUS (1 << 1) |
| 846 | # define GFX_CLOCK_STATUS (1 << 2) |
| 847 | # define GFX_LS_STATUS (1 << 3) |
| 848 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 849 | #define RLC_PG_CNTL 0xC35C |
| 850 | # define GFX_PG_ENABLE (1 << 0) |
| 851 | # define GFX_PG_SRC (1 << 1) |
| 852 | |
| 853 | #define RLC_CGTT_MGCG_OVERRIDE 0xC400 |
| 854 | #define RLC_CGCG_CGLS_CTRL 0xC404 |
| 855 | # define CGCG_EN (1 << 0) |
| 856 | # define CGLS_EN (1 << 1) |
| 857 | |
| 858 | #define RLC_TTOP_D 0xC414 |
| 859 | # define RLC_PUD(x) ((x) << 0) |
| 860 | # define RLC_PUD_MASK (0xff << 0) |
| 861 | # define RLC_PDD(x) ((x) << 8) |
| 862 | # define RLC_PDD_MASK (0xff << 8) |
| 863 | # define RLC_TTPD(x) ((x) << 16) |
| 864 | # define RLC_TTPD_MASK (0xff << 16) |
| 865 | # define RLC_MSD(x) ((x) << 24) |
| 866 | # define RLC_MSD_MASK (0xff << 24) |
| 867 | |
Alex Deucher | d719cef | 2013-02-15 16:49:59 -0500 | [diff] [blame] | 868 | #define RLC_LB_INIT_CU_MASK 0xC41C |
| 869 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 870 | #define RLC_PG_AO_CU_MASK 0xC42C |
| 871 | #define RLC_MAX_PG_CU 0xC430 |
| 872 | # define MAX_PU_CU(x) ((x) << 0) |
| 873 | # define MAX_PU_CU_MASK (0xff << 0) |
| 874 | #define RLC_AUTO_PG_CTRL 0xC434 |
| 875 | # define AUTO_PG_EN (1 << 0) |
| 876 | # define GRBM_REG_SGIT(x) ((x) << 3) |
| 877 | # define GRBM_REG_SGIT_MASK (0xffff << 3) |
| 878 | # define PG_AFTER_GRBM_REG_ST(x) ((x) << 19) |
| 879 | # define PG_AFTER_GRBM_REG_ST_MASK (0x1fff << 19) |
| 880 | |
| 881 | #define RLC_SERDES_WR_MASTER_MASK_0 0xC454 |
| 882 | #define RLC_SERDES_WR_MASTER_MASK_1 0xC458 |
| 883 | #define RLC_SERDES_WR_CTRL 0xC45C |
| 884 | |
Alex Deucher | d719cef | 2013-02-15 16:49:59 -0500 | [diff] [blame] | 885 | #define RLC_SERDES_MASTER_BUSY_0 0xC464 |
| 886 | #define RLC_SERDES_MASTER_BUSY_1 0xC468 |
| 887 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 888 | #define RLC_GCPM_GENERAL_3 0xC478 |
| 889 | |
| 890 | #define DB_RENDER_CONTROL 0x28000 |
| 891 | |
Alex Deucher | d719cef | 2013-02-15 16:49:59 -0500 | [diff] [blame] | 892 | #define DB_DEPTH_INFO 0x2803c |
Alex Deucher | 347e759 | 2012-03-20 17:18:21 -0400 | [diff] [blame] | 893 | |
Alex Deucher | 1a8ca75 | 2012-06-01 18:58:22 -0400 | [diff] [blame] | 894 | #define PA_SC_RASTER_CONFIG 0x28350 |
| 895 | # define RASTER_CONFIG_RB_MAP_0 0 |
| 896 | # define RASTER_CONFIG_RB_MAP_1 1 |
| 897 | # define RASTER_CONFIG_RB_MAP_2 2 |
| 898 | # define RASTER_CONFIG_RB_MAP_3 3 |
| 899 | |
Alex Deucher | 2ece2e8 | 2012-03-20 17:18:20 -0400 | [diff] [blame] | 900 | #define VGT_EVENT_INITIATOR 0x28a90 |
| 901 | # define SAMPLE_STREAMOUTSTATS1 (1 << 0) |
| 902 | # define SAMPLE_STREAMOUTSTATS2 (2 << 0) |
| 903 | # define SAMPLE_STREAMOUTSTATS3 (3 << 0) |
| 904 | # define CACHE_FLUSH_TS (4 << 0) |
| 905 | # define CACHE_FLUSH (6 << 0) |
| 906 | # define CS_PARTIAL_FLUSH (7 << 0) |
| 907 | # define VGT_STREAMOUT_RESET (10 << 0) |
| 908 | # define END_OF_PIPE_INCR_DE (11 << 0) |
| 909 | # define END_OF_PIPE_IB_END (12 << 0) |
| 910 | # define RST_PIX_CNT (13 << 0) |
| 911 | # define VS_PARTIAL_FLUSH (15 << 0) |
| 912 | # define PS_PARTIAL_FLUSH (16 << 0) |
| 913 | # define CACHE_FLUSH_AND_INV_TS_EVENT (20 << 0) |
| 914 | # define ZPASS_DONE (21 << 0) |
| 915 | # define CACHE_FLUSH_AND_INV_EVENT (22 << 0) |
| 916 | # define PERFCOUNTER_START (23 << 0) |
| 917 | # define PERFCOUNTER_STOP (24 << 0) |
| 918 | # define PIPELINESTAT_START (25 << 0) |
| 919 | # define PIPELINESTAT_STOP (26 << 0) |
| 920 | # define PERFCOUNTER_SAMPLE (27 << 0) |
| 921 | # define SAMPLE_PIPELINESTAT (30 << 0) |
| 922 | # define SAMPLE_STREAMOUTSTATS (32 << 0) |
| 923 | # define RESET_VTX_CNT (33 << 0) |
| 924 | # define VGT_FLUSH (36 << 0) |
| 925 | # define BOTTOM_OF_PIPE_TS (40 << 0) |
| 926 | # define DB_CACHE_FLUSH_AND_INV (42 << 0) |
| 927 | # define FLUSH_AND_INV_DB_DATA_TS (43 << 0) |
| 928 | # define FLUSH_AND_INV_DB_META (44 << 0) |
| 929 | # define FLUSH_AND_INV_CB_DATA_TS (45 << 0) |
| 930 | # define FLUSH_AND_INV_CB_META (46 << 0) |
| 931 | # define CS_DONE (47 << 0) |
| 932 | # define PS_DONE (48 << 0) |
| 933 | # define FLUSH_AND_INV_CB_PIXEL_DATA (49 << 0) |
| 934 | # define THREAD_TRACE_START (51 << 0) |
| 935 | # define THREAD_TRACE_STOP (52 << 0) |
| 936 | # define THREAD_TRACE_FLUSH (54 << 0) |
| 937 | # define THREAD_TRACE_FINISH (55 << 0) |
| 938 | |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 939 | /* PIF PHY0 registers idx/data 0x8/0xc */ |
| 940 | #define PB0_PIF_CNTL 0x10 |
| 941 | # define LS2_EXIT_TIME(x) ((x) << 17) |
| 942 | # define LS2_EXIT_TIME_MASK (0x7 << 17) |
| 943 | # define LS2_EXIT_TIME_SHIFT 17 |
| 944 | #define PB0_PIF_PAIRING 0x11 |
| 945 | # define MULTI_PIF (1 << 25) |
| 946 | #define PB0_PIF_PWRDOWN_0 0x12 |
| 947 | # define PLL_POWER_STATE_IN_TXS2_0(x) ((x) << 7) |
| 948 | # define PLL_POWER_STATE_IN_TXS2_0_MASK (0x7 << 7) |
| 949 | # define PLL_POWER_STATE_IN_TXS2_0_SHIFT 7 |
| 950 | # define PLL_POWER_STATE_IN_OFF_0(x) ((x) << 10) |
| 951 | # define PLL_POWER_STATE_IN_OFF_0_MASK (0x7 << 10) |
| 952 | # define PLL_POWER_STATE_IN_OFF_0_SHIFT 10 |
| 953 | # define PLL_RAMP_UP_TIME_0(x) ((x) << 24) |
| 954 | # define PLL_RAMP_UP_TIME_0_MASK (0x7 << 24) |
| 955 | # define PLL_RAMP_UP_TIME_0_SHIFT 24 |
| 956 | #define PB0_PIF_PWRDOWN_1 0x13 |
| 957 | # define PLL_POWER_STATE_IN_TXS2_1(x) ((x) << 7) |
| 958 | # define PLL_POWER_STATE_IN_TXS2_1_MASK (0x7 << 7) |
| 959 | # define PLL_POWER_STATE_IN_TXS2_1_SHIFT 7 |
| 960 | # define PLL_POWER_STATE_IN_OFF_1(x) ((x) << 10) |
| 961 | # define PLL_POWER_STATE_IN_OFF_1_MASK (0x7 << 10) |
| 962 | # define PLL_POWER_STATE_IN_OFF_1_SHIFT 10 |
| 963 | # define PLL_RAMP_UP_TIME_1(x) ((x) << 24) |
| 964 | # define PLL_RAMP_UP_TIME_1_MASK (0x7 << 24) |
| 965 | # define PLL_RAMP_UP_TIME_1_SHIFT 24 |
| 966 | |
| 967 | #define PB0_PIF_PWRDOWN_2 0x17 |
| 968 | # define PLL_POWER_STATE_IN_TXS2_2(x) ((x) << 7) |
| 969 | # define PLL_POWER_STATE_IN_TXS2_2_MASK (0x7 << 7) |
| 970 | # define PLL_POWER_STATE_IN_TXS2_2_SHIFT 7 |
| 971 | # define PLL_POWER_STATE_IN_OFF_2(x) ((x) << 10) |
| 972 | # define PLL_POWER_STATE_IN_OFF_2_MASK (0x7 << 10) |
| 973 | # define PLL_POWER_STATE_IN_OFF_2_SHIFT 10 |
| 974 | # define PLL_RAMP_UP_TIME_2(x) ((x) << 24) |
| 975 | # define PLL_RAMP_UP_TIME_2_MASK (0x7 << 24) |
| 976 | # define PLL_RAMP_UP_TIME_2_SHIFT 24 |
| 977 | #define PB0_PIF_PWRDOWN_3 0x18 |
| 978 | # define PLL_POWER_STATE_IN_TXS2_3(x) ((x) << 7) |
| 979 | # define PLL_POWER_STATE_IN_TXS2_3_MASK (0x7 << 7) |
| 980 | # define PLL_POWER_STATE_IN_TXS2_3_SHIFT 7 |
| 981 | # define PLL_POWER_STATE_IN_OFF_3(x) ((x) << 10) |
| 982 | # define PLL_POWER_STATE_IN_OFF_3_MASK (0x7 << 10) |
| 983 | # define PLL_POWER_STATE_IN_OFF_3_SHIFT 10 |
| 984 | # define PLL_RAMP_UP_TIME_3(x) ((x) << 24) |
| 985 | # define PLL_RAMP_UP_TIME_3_MASK (0x7 << 24) |
| 986 | # define PLL_RAMP_UP_TIME_3_SHIFT 24 |
| 987 | /* PIF PHY1 registers idx/data 0x10/0x14 */ |
| 988 | #define PB1_PIF_CNTL 0x10 |
| 989 | #define PB1_PIF_PAIRING 0x11 |
| 990 | #define PB1_PIF_PWRDOWN_0 0x12 |
| 991 | #define PB1_PIF_PWRDOWN_1 0x13 |
| 992 | |
| 993 | #define PB1_PIF_PWRDOWN_2 0x17 |
| 994 | #define PB1_PIF_PWRDOWN_3 0x18 |
Alex Deucher | b9d305d | 2013-02-14 17:16:51 -0500 | [diff] [blame] | 995 | /* PCIE registers idx/data 0x30/0x34 */ |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 996 | #define PCIE_CNTL2 0x1c /* PCIE */ |
| 997 | # define SLV_MEM_LS_EN (1 << 16) |
| 998 | # define MST_MEM_LS_EN (1 << 18) |
| 999 | # define REPLAY_MEM_LS_EN (1 << 19) |
Alex Deucher | b9d305d | 2013-02-14 17:16:51 -0500 | [diff] [blame] | 1000 | #define PCIE_LC_STATUS1 0x28 /* PCIE */ |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 1001 | # define LC_REVERSE_RCVR (1 << 0) |
| 1002 | # define LC_REVERSE_XMIT (1 << 1) |
Alex Deucher | b9d305d | 2013-02-14 17:16:51 -0500 | [diff] [blame] | 1003 | # define LC_OPERATING_LINK_WIDTH_MASK (0x7 << 2) |
| 1004 | # define LC_OPERATING_LINK_WIDTH_SHIFT 2 |
| 1005 | # define LC_DETECTED_LINK_WIDTH_MASK (0x7 << 5) |
| 1006 | # define LC_DETECTED_LINK_WIDTH_SHIFT 5 |
| 1007 | |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 1008 | #define PCIE_P_CNTL 0x40 /* PCIE */ |
| 1009 | # define P_IGNORE_EDB_ERR (1 << 6) |
| 1010 | |
Alex Deucher | b9d305d | 2013-02-14 17:16:51 -0500 | [diff] [blame] | 1011 | /* PCIE PORT registers idx/data 0x38/0x3c */ |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 1012 | #define PCIE_LC_CNTL 0xa0 |
| 1013 | # define LC_L0S_INACTIVITY(x) ((x) << 8) |
| 1014 | # define LC_L0S_INACTIVITY_MASK (0xf << 8) |
| 1015 | # define LC_L0S_INACTIVITY_SHIFT 8 |
| 1016 | # define LC_L1_INACTIVITY(x) ((x) << 12) |
| 1017 | # define LC_L1_INACTIVITY_MASK (0xf << 12) |
| 1018 | # define LC_L1_INACTIVITY_SHIFT 12 |
| 1019 | # define LC_PMI_TO_L1_DIS (1 << 16) |
| 1020 | # define LC_ASPM_TO_L1_DIS (1 << 24) |
Alex Deucher | b9d305d | 2013-02-14 17:16:51 -0500 | [diff] [blame] | 1021 | #define PCIE_LC_LINK_WIDTH_CNTL 0xa2 /* PCIE_P */ |
| 1022 | # define LC_LINK_WIDTH_SHIFT 0 |
| 1023 | # define LC_LINK_WIDTH_MASK 0x7 |
| 1024 | # define LC_LINK_WIDTH_X0 0 |
| 1025 | # define LC_LINK_WIDTH_X1 1 |
| 1026 | # define LC_LINK_WIDTH_X2 2 |
| 1027 | # define LC_LINK_WIDTH_X4 3 |
| 1028 | # define LC_LINK_WIDTH_X8 4 |
| 1029 | # define LC_LINK_WIDTH_X16 6 |
| 1030 | # define LC_LINK_WIDTH_RD_SHIFT 4 |
| 1031 | # define LC_LINK_WIDTH_RD_MASK 0x70 |
| 1032 | # define LC_RECONFIG_ARC_MISSING_ESCAPE (1 << 7) |
| 1033 | # define LC_RECONFIG_NOW (1 << 8) |
| 1034 | # define LC_RENEGOTIATION_SUPPORT (1 << 9) |
| 1035 | # define LC_RENEGOTIATE_EN (1 << 10) |
| 1036 | # define LC_SHORT_RECONFIG_EN (1 << 11) |
| 1037 | # define LC_UPCONFIGURE_SUPPORT (1 << 12) |
| 1038 | # define LC_UPCONFIGURE_DIS (1 << 13) |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 1039 | # define LC_DYN_LANES_PWR_STATE(x) ((x) << 21) |
| 1040 | # define LC_DYN_LANES_PWR_STATE_MASK (0x3 << 21) |
| 1041 | # define LC_DYN_LANES_PWR_STATE_SHIFT 21 |
| 1042 | #define PCIE_LC_N_FTS_CNTL 0xa3 /* PCIE_P */ |
| 1043 | # define LC_XMIT_N_FTS(x) ((x) << 0) |
| 1044 | # define LC_XMIT_N_FTS_MASK (0xff << 0) |
| 1045 | # define LC_XMIT_N_FTS_SHIFT 0 |
| 1046 | # define LC_XMIT_N_FTS_OVERRIDE_EN (1 << 8) |
| 1047 | # define LC_N_FTS_MASK (0xff << 24) |
Alex Deucher | b9d305d | 2013-02-14 17:16:51 -0500 | [diff] [blame] | 1048 | #define PCIE_LC_SPEED_CNTL 0xa4 /* PCIE_P */ |
| 1049 | # define LC_GEN2_EN_STRAP (1 << 0) |
| 1050 | # define LC_GEN3_EN_STRAP (1 << 1) |
| 1051 | # define LC_TARGET_LINK_SPEED_OVERRIDE_EN (1 << 2) |
| 1052 | # define LC_TARGET_LINK_SPEED_OVERRIDE_MASK (0x3 << 3) |
| 1053 | # define LC_TARGET_LINK_SPEED_OVERRIDE_SHIFT 3 |
| 1054 | # define LC_FORCE_EN_SW_SPEED_CHANGE (1 << 5) |
| 1055 | # define LC_FORCE_DIS_SW_SPEED_CHANGE (1 << 6) |
| 1056 | # define LC_FORCE_EN_HW_SPEED_CHANGE (1 << 7) |
| 1057 | # define LC_FORCE_DIS_HW_SPEED_CHANGE (1 << 8) |
| 1058 | # define LC_INITIATE_LINK_SPEED_CHANGE (1 << 9) |
| 1059 | # define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK (0x3 << 10) |
| 1060 | # define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT 10 |
| 1061 | # define LC_CURRENT_DATA_RATE_MASK (0x3 << 13) /* 0/1/2 = gen1/2/3 */ |
| 1062 | # define LC_CURRENT_DATA_RATE_SHIFT 13 |
| 1063 | # define LC_CLR_FAILED_SPD_CHANGE_CNT (1 << 16) |
| 1064 | # define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 18) |
| 1065 | # define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 19) |
| 1066 | # define LC_OTHER_SIDE_EVER_SENT_GEN3 (1 << 20) |
| 1067 | # define LC_OTHER_SIDE_SUPPORTS_GEN3 (1 << 21) |
Alex Deucher | e0bcf165 | 2013-02-15 11:56:59 -0500 | [diff] [blame] | 1068 | |
| 1069 | #define PCIE_LC_CNTL2 0xb1 |
| 1070 | # define LC_ALLOW_PDWN_IN_L1 (1 << 17) |
| 1071 | # define LC_ALLOW_PDWN_IN_L23 (1 << 18) |
| 1072 | |
| 1073 | #define PCIE_LC_CNTL3 0xb5 /* PCIE_P */ |
| 1074 | # define LC_GO_TO_RECOVERY (1 << 30) |
Alex Deucher | b9d305d | 2013-02-14 17:16:51 -0500 | [diff] [blame] | 1075 | #define PCIE_LC_CNTL4 0xb6 /* PCIE_P */ |
| 1076 | # define LC_REDO_EQ (1 << 5) |
| 1077 | # define LC_SET_QUIESCE (1 << 13) |
| 1078 | |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 1079 | /* |
Christian König | f2ba57b | 2013-04-08 12:41:29 +0200 | [diff] [blame] | 1080 | * UVD |
| 1081 | */ |
Christian König | 9a21059 | 2013-04-08 12:41:37 +0200 | [diff] [blame] | 1082 | #define UVD_UDEC_ADDR_CONFIG 0xEF4C |
| 1083 | #define UVD_UDEC_DB_ADDR_CONFIG 0xEF50 |
| 1084 | #define UVD_UDEC_DBW_ADDR_CONFIG 0xEF54 |
Christian König | f2ba57b | 2013-04-08 12:41:29 +0200 | [diff] [blame] | 1085 | #define UVD_RBC_RB_RPTR 0xF690 |
| 1086 | #define UVD_RBC_RB_WPTR 0xF694 |
| 1087 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 1088 | #define UVD_CGC_CTRL 0xF4B0 |
| 1089 | # define DCM (1 << 0) |
| 1090 | # define CG_DT(x) ((x) << 2) |
| 1091 | # define CG_DT_MASK (0xf << 2) |
| 1092 | # define CLK_OD(x) ((x) << 6) |
| 1093 | # define CLK_OD_MASK (0x1f << 6) |
| 1094 | |
| 1095 | /* UVD CTX indirect */ |
| 1096 | #define UVD_CGC_MEM_CTRL 0xC0 |
| 1097 | #define UVD_CGC_CTRL2 0xC1 |
| 1098 | # define DYN_OR_EN (1 << 0) |
| 1099 | # define DYN_RR_EN (1 << 1) |
| 1100 | # define G_DIV_ID(x) ((x) << 2) |
| 1101 | # define G_DIV_ID_MASK (0x7 << 2) |
| 1102 | |
Christian König | f2ba57b | 2013-04-08 12:41:29 +0200 | [diff] [blame] | 1103 | /* |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 1104 | * PM4 |
| 1105 | */ |
Ilija Hadzic | 4e872ae | 2013-01-02 18:27:48 -0500 | [diff] [blame] | 1106 | #define PACKET0(reg, n) ((RADEON_PACKET_TYPE0 << 30) | \ |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 1107 | (((reg) >> 2) & 0xFFFF) | \ |
| 1108 | ((n) & 0x3FFF) << 16) |
| 1109 | #define CP_PACKET2 0x80000000 |
| 1110 | #define PACKET2_PAD_SHIFT 0 |
| 1111 | #define PACKET2_PAD_MASK (0x3fffffff << 0) |
| 1112 | |
| 1113 | #define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v))) |
| 1114 | |
Ilija Hadzic | 4e872ae | 2013-01-02 18:27:48 -0500 | [diff] [blame] | 1115 | #define PACKET3(op, n) ((RADEON_PACKET_TYPE3 << 30) | \ |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 1116 | (((op) & 0xFF) << 8) | \ |
| 1117 | ((n) & 0x3FFF) << 16) |
| 1118 | |
Alex Deucher | 48c0c90 | 2012-03-20 17:18:19 -0400 | [diff] [blame] | 1119 | #define PACKET3_COMPUTE(op, n) (PACKET3(op, n) | 1 << 1) |
| 1120 | |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 1121 | /* Packet 3 types */ |
| 1122 | #define PACKET3_NOP 0x10 |
| 1123 | #define PACKET3_SET_BASE 0x11 |
| 1124 | #define PACKET3_BASE_INDEX(x) ((x) << 0) |
| 1125 | #define GDS_PARTITION_BASE 2 |
| 1126 | #define CE_PARTITION_BASE 3 |
| 1127 | #define PACKET3_CLEAR_STATE 0x12 |
| 1128 | #define PACKET3_INDEX_BUFFER_SIZE 0x13 |
| 1129 | #define PACKET3_DISPATCH_DIRECT 0x15 |
| 1130 | #define PACKET3_DISPATCH_INDIRECT 0x16 |
| 1131 | #define PACKET3_ALLOC_GDS 0x1B |
| 1132 | #define PACKET3_WRITE_GDS_RAM 0x1C |
| 1133 | #define PACKET3_ATOMIC_GDS 0x1D |
| 1134 | #define PACKET3_ATOMIC 0x1E |
| 1135 | #define PACKET3_OCCLUSION_QUERY 0x1F |
| 1136 | #define PACKET3_SET_PREDICATION 0x20 |
| 1137 | #define PACKET3_REG_RMW 0x21 |
| 1138 | #define PACKET3_COND_EXEC 0x22 |
| 1139 | #define PACKET3_PRED_EXEC 0x23 |
| 1140 | #define PACKET3_DRAW_INDIRECT 0x24 |
| 1141 | #define PACKET3_DRAW_INDEX_INDIRECT 0x25 |
| 1142 | #define PACKET3_INDEX_BASE 0x26 |
| 1143 | #define PACKET3_DRAW_INDEX_2 0x27 |
| 1144 | #define PACKET3_CONTEXT_CONTROL 0x28 |
| 1145 | #define PACKET3_INDEX_TYPE 0x2A |
| 1146 | #define PACKET3_DRAW_INDIRECT_MULTI 0x2C |
| 1147 | #define PACKET3_DRAW_INDEX_AUTO 0x2D |
| 1148 | #define PACKET3_DRAW_INDEX_IMMD 0x2E |
| 1149 | #define PACKET3_NUM_INSTANCES 0x2F |
| 1150 | #define PACKET3_DRAW_INDEX_MULTI_AUTO 0x30 |
| 1151 | #define PACKET3_INDIRECT_BUFFER_CONST 0x31 |
| 1152 | #define PACKET3_INDIRECT_BUFFER 0x32 |
| 1153 | #define PACKET3_STRMOUT_BUFFER_UPDATE 0x34 |
| 1154 | #define PACKET3_DRAW_INDEX_OFFSET_2 0x35 |
| 1155 | #define PACKET3_DRAW_INDEX_MULTI_ELEMENT 0x36 |
| 1156 | #define PACKET3_WRITE_DATA 0x37 |
Alex Deucher | 76c44f2 | 2012-10-02 14:39:18 -0400 | [diff] [blame] | 1157 | #define WRITE_DATA_DST_SEL(x) ((x) << 8) |
| 1158 | /* 0 - register |
| 1159 | * 1 - memory (sync - via GRBM) |
| 1160 | * 2 - tc/l2 |
| 1161 | * 3 - gds |
| 1162 | * 4 - reserved |
| 1163 | * 5 - memory (async - direct) |
| 1164 | */ |
| 1165 | #define WR_ONE_ADDR (1 << 16) |
| 1166 | #define WR_CONFIRM (1 << 20) |
| 1167 | #define WRITE_DATA_ENGINE_SEL(x) ((x) << 30) |
| 1168 | /* 0 - me |
| 1169 | * 1 - pfp |
| 1170 | * 2 - ce |
| 1171 | */ |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 1172 | #define PACKET3_DRAW_INDEX_INDIRECT_MULTI 0x38 |
| 1173 | #define PACKET3_MEM_SEMAPHORE 0x39 |
| 1174 | #define PACKET3_MPEG_INDEX 0x3A |
| 1175 | #define PACKET3_COPY_DW 0x3B |
| 1176 | #define PACKET3_WAIT_REG_MEM 0x3C |
| 1177 | #define PACKET3_MEM_WRITE 0x3D |
| 1178 | #define PACKET3_COPY_DATA 0x40 |
Alex Deucher | b997a8b | 2012-12-03 18:07:25 -0500 | [diff] [blame] | 1179 | #define PACKET3_CP_DMA 0x41 |
| 1180 | /* 1. header |
| 1181 | * 2. SRC_ADDR_LO or DATA [31:0] |
| 1182 | * 3. CP_SYNC [31] | SRC_SEL [30:29] | ENGINE [27] | DST_SEL [21:20] | |
| 1183 | * SRC_ADDR_HI [7:0] |
| 1184 | * 4. DST_ADDR_LO [31:0] |
| 1185 | * 5. DST_ADDR_HI [7:0] |
| 1186 | * 6. COMMAND [30:21] | BYTE_COUNT [20:0] |
| 1187 | */ |
| 1188 | # define PACKET3_CP_DMA_DST_SEL(x) ((x) << 20) |
| 1189 | /* 0 - SRC_ADDR |
| 1190 | * 1 - GDS |
| 1191 | */ |
| 1192 | # define PACKET3_CP_DMA_ENGINE(x) ((x) << 27) |
| 1193 | /* 0 - ME |
| 1194 | * 1 - PFP |
| 1195 | */ |
| 1196 | # define PACKET3_CP_DMA_SRC_SEL(x) ((x) << 29) |
| 1197 | /* 0 - SRC_ADDR |
| 1198 | * 1 - GDS |
| 1199 | * 2 - DATA |
| 1200 | */ |
| 1201 | # define PACKET3_CP_DMA_CP_SYNC (1 << 31) |
| 1202 | /* COMMAND */ |
| 1203 | # define PACKET3_CP_DMA_DIS_WC (1 << 21) |
| 1204 | # define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 23) |
| 1205 | /* 0 - none |
| 1206 | * 1 - 8 in 16 |
| 1207 | * 2 - 8 in 32 |
| 1208 | * 3 - 8 in 64 |
| 1209 | */ |
| 1210 | # define PACKET3_CP_DMA_CMD_DST_SWAP(x) ((x) << 24) |
| 1211 | /* 0 - none |
| 1212 | * 1 - 8 in 16 |
| 1213 | * 2 - 8 in 32 |
| 1214 | * 3 - 8 in 64 |
| 1215 | */ |
| 1216 | # define PACKET3_CP_DMA_CMD_SAS (1 << 26) |
| 1217 | /* 0 - memory |
| 1218 | * 1 - register |
| 1219 | */ |
| 1220 | # define PACKET3_CP_DMA_CMD_DAS (1 << 27) |
| 1221 | /* 0 - memory |
| 1222 | * 1 - register |
| 1223 | */ |
| 1224 | # define PACKET3_CP_DMA_CMD_SAIC (1 << 28) |
| 1225 | # define PACKET3_CP_DMA_CMD_DAIC (1 << 29) |
| 1226 | # define PACKET3_CP_DMA_CMD_RAW_WAIT (1 << 30) |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 1227 | #define PACKET3_PFP_SYNC_ME 0x42 |
| 1228 | #define PACKET3_SURFACE_SYNC 0x43 |
| 1229 | # define PACKET3_DEST_BASE_0_ENA (1 << 0) |
| 1230 | # define PACKET3_DEST_BASE_1_ENA (1 << 1) |
| 1231 | # define PACKET3_CB0_DEST_BASE_ENA (1 << 6) |
| 1232 | # define PACKET3_CB1_DEST_BASE_ENA (1 << 7) |
| 1233 | # define PACKET3_CB2_DEST_BASE_ENA (1 << 8) |
| 1234 | # define PACKET3_CB3_DEST_BASE_ENA (1 << 9) |
| 1235 | # define PACKET3_CB4_DEST_BASE_ENA (1 << 10) |
| 1236 | # define PACKET3_CB5_DEST_BASE_ENA (1 << 11) |
| 1237 | # define PACKET3_CB6_DEST_BASE_ENA (1 << 12) |
| 1238 | # define PACKET3_CB7_DEST_BASE_ENA (1 << 13) |
| 1239 | # define PACKET3_DB_DEST_BASE_ENA (1 << 14) |
| 1240 | # define PACKET3_DEST_BASE_2_ENA (1 << 19) |
| 1241 | # define PACKET3_DEST_BASE_3_ENA (1 << 21) |
| 1242 | # define PACKET3_TCL1_ACTION_ENA (1 << 22) |
| 1243 | # define PACKET3_TC_ACTION_ENA (1 << 23) |
| 1244 | # define PACKET3_CB_ACTION_ENA (1 << 25) |
| 1245 | # define PACKET3_DB_ACTION_ENA (1 << 26) |
| 1246 | # define PACKET3_SH_KCACHE_ACTION_ENA (1 << 27) |
| 1247 | # define PACKET3_SH_ICACHE_ACTION_ENA (1 << 29) |
| 1248 | #define PACKET3_ME_INITIALIZE 0x44 |
| 1249 | #define PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16) |
| 1250 | #define PACKET3_COND_WRITE 0x45 |
| 1251 | #define PACKET3_EVENT_WRITE 0x46 |
Alex Deucher | 2ece2e8 | 2012-03-20 17:18:20 -0400 | [diff] [blame] | 1252 | #define EVENT_TYPE(x) ((x) << 0) |
| 1253 | #define EVENT_INDEX(x) ((x) << 8) |
| 1254 | /* 0 - any non-TS event |
| 1255 | * 1 - ZPASS_DONE |
| 1256 | * 2 - SAMPLE_PIPELINESTAT |
| 1257 | * 3 - SAMPLE_STREAMOUTSTAT* |
| 1258 | * 4 - *S_PARTIAL_FLUSH |
| 1259 | * 5 - EOP events |
| 1260 | * 6 - EOS events |
| 1261 | * 7 - CACHE_FLUSH, CACHE_FLUSH_AND_INV_EVENT |
| 1262 | */ |
| 1263 | #define INV_L2 (1 << 20) |
| 1264 | /* INV TC L2 cache when EVENT_INDEX = 7 */ |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 1265 | #define PACKET3_EVENT_WRITE_EOP 0x47 |
Alex Deucher | 2ece2e8 | 2012-03-20 17:18:20 -0400 | [diff] [blame] | 1266 | #define DATA_SEL(x) ((x) << 29) |
| 1267 | /* 0 - discard |
| 1268 | * 1 - send low 32bit data |
| 1269 | * 2 - send 64bit data |
| 1270 | * 3 - send 64bit counter value |
| 1271 | */ |
| 1272 | #define INT_SEL(x) ((x) << 24) |
| 1273 | /* 0 - none |
| 1274 | * 1 - interrupt only (DATA_SEL = 0) |
| 1275 | * 2 - interrupt when data write is confirmed |
| 1276 | */ |
Alex Deucher | d2800ee | 2012-03-20 17:18:13 -0400 | [diff] [blame] | 1277 | #define PACKET3_EVENT_WRITE_EOS 0x48 |
| 1278 | #define PACKET3_PREAMBLE_CNTL 0x4A |
| 1279 | # define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE (2 << 28) |
| 1280 | # define PACKET3_PREAMBLE_END_CLEAR_STATE (3 << 28) |
| 1281 | #define PACKET3_ONE_REG_WRITE 0x57 |
| 1282 | #define PACKET3_LOAD_CONFIG_REG 0x5F |
| 1283 | #define PACKET3_LOAD_CONTEXT_REG 0x60 |
| 1284 | #define PACKET3_LOAD_SH_REG 0x61 |
| 1285 | #define PACKET3_SET_CONFIG_REG 0x68 |
| 1286 | #define PACKET3_SET_CONFIG_REG_START 0x00008000 |
| 1287 | #define PACKET3_SET_CONFIG_REG_END 0x0000b000 |
| 1288 | #define PACKET3_SET_CONTEXT_REG 0x69 |
| 1289 | #define PACKET3_SET_CONTEXT_REG_START 0x00028000 |
| 1290 | #define PACKET3_SET_CONTEXT_REG_END 0x00029000 |
| 1291 | #define PACKET3_SET_CONTEXT_REG_INDIRECT 0x73 |
| 1292 | #define PACKET3_SET_RESOURCE_INDIRECT 0x74 |
| 1293 | #define PACKET3_SET_SH_REG 0x76 |
| 1294 | #define PACKET3_SET_SH_REG_START 0x0000b000 |
| 1295 | #define PACKET3_SET_SH_REG_END 0x0000c000 |
| 1296 | #define PACKET3_SET_SH_REG_OFFSET 0x77 |
| 1297 | #define PACKET3_ME_WRITE 0x7A |
| 1298 | #define PACKET3_SCRATCH_RAM_WRITE 0x7D |
| 1299 | #define PACKET3_SCRATCH_RAM_READ 0x7E |
| 1300 | #define PACKET3_CE_WRITE 0x7F |
| 1301 | #define PACKET3_LOAD_CONST_RAM 0x80 |
| 1302 | #define PACKET3_WRITE_CONST_RAM 0x81 |
| 1303 | #define PACKET3_WRITE_CONST_RAM_OFFSET 0x82 |
| 1304 | #define PACKET3_DUMP_CONST_RAM 0x83 |
| 1305 | #define PACKET3_INCREMENT_CE_COUNTER 0x84 |
| 1306 | #define PACKET3_INCREMENT_DE_COUNTER 0x85 |
| 1307 | #define PACKET3_WAIT_ON_CE_COUNTER 0x86 |
| 1308 | #define PACKET3_WAIT_ON_DE_COUNTER 0x87 |
| 1309 | #define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88 |
| 1310 | #define PACKET3_SET_CE_DE_COUNTERS 0x89 |
| 1311 | #define PACKET3_WAIT_ON_AVAIL_BUFFER 0x8A |
Alex Deucher | a85a7da4 | 2012-07-17 14:02:29 -0400 | [diff] [blame] | 1312 | #define PACKET3_SWITCH_BUFFER 0x8B |
Alex Deucher | 0a96d72 | 2012-03-20 17:18:11 -0400 | [diff] [blame] | 1313 | |
Alex Deucher | 8c5fd7e | 2012-12-04 15:28:18 -0500 | [diff] [blame] | 1314 | /* ASYNC DMA - first instance at 0xd000, second at 0xd800 */ |
| 1315 | #define DMA0_REGISTER_OFFSET 0x0 /* not a register */ |
| 1316 | #define DMA1_REGISTER_OFFSET 0x800 /* not a register */ |
| 1317 | |
| 1318 | #define DMA_RB_CNTL 0xd000 |
| 1319 | # define DMA_RB_ENABLE (1 << 0) |
| 1320 | # define DMA_RB_SIZE(x) ((x) << 1) /* log2 */ |
| 1321 | # define DMA_RB_SWAP_ENABLE (1 << 9) /* 8IN32 */ |
| 1322 | # define DMA_RPTR_WRITEBACK_ENABLE (1 << 12) |
| 1323 | # define DMA_RPTR_WRITEBACK_SWAP_ENABLE (1 << 13) /* 8IN32 */ |
| 1324 | # define DMA_RPTR_WRITEBACK_TIMER(x) ((x) << 16) /* log2 */ |
| 1325 | #define DMA_RB_BASE 0xd004 |
| 1326 | #define DMA_RB_RPTR 0xd008 |
| 1327 | #define DMA_RB_WPTR 0xd00c |
| 1328 | |
| 1329 | #define DMA_RB_RPTR_ADDR_HI 0xd01c |
| 1330 | #define DMA_RB_RPTR_ADDR_LO 0xd020 |
| 1331 | |
| 1332 | #define DMA_IB_CNTL 0xd024 |
| 1333 | # define DMA_IB_ENABLE (1 << 0) |
| 1334 | # define DMA_IB_SWAP_ENABLE (1 << 4) |
| 1335 | #define DMA_IB_RPTR 0xd028 |
| 1336 | #define DMA_CNTL 0xd02c |
| 1337 | # define TRAP_ENABLE (1 << 0) |
| 1338 | # define SEM_INCOMPLETE_INT_ENABLE (1 << 1) |
| 1339 | # define SEM_WAIT_INT_ENABLE (1 << 2) |
| 1340 | # define DATA_SWAP_ENABLE (1 << 3) |
| 1341 | # define FENCE_SWAP_ENABLE (1 << 4) |
| 1342 | # define CTXEMPTY_INT_ENABLE (1 << 28) |
Jerome Glisse | eaaa698 | 2013-01-02 15:12:15 -0500 | [diff] [blame] | 1343 | #define DMA_STATUS_REG 0xd034 |
| 1344 | # define DMA_IDLE (1 << 0) |
Alex Deucher | 8c5fd7e | 2012-12-04 15:28:18 -0500 | [diff] [blame] | 1345 | #define DMA_TILING_CONFIG 0xd0b8 |
| 1346 | |
Alex Deucher | f8f84ac | 2013-03-07 12:56:35 -0500 | [diff] [blame] | 1347 | #define DMA_PG 0xd0d4 |
| 1348 | # define PG_CNTL_ENABLE (1 << 0) |
| 1349 | #define DMA_PGFSM_CONFIG 0xd0d8 |
| 1350 | #define DMA_PGFSM_WRITE 0xd0dc |
| 1351 | |
Alex Deucher | 8c5fd7e | 2012-12-04 15:28:18 -0500 | [diff] [blame] | 1352 | #define DMA_PACKET(cmd, b, t, s, n) ((((cmd) & 0xF) << 28) | \ |
| 1353 | (((b) & 0x1) << 26) | \ |
| 1354 | (((t) & 0x1) << 23) | \ |
| 1355 | (((s) & 0x1) << 22) | \ |
| 1356 | (((n) & 0xFFFFF) << 0)) |
Alex Deucher | deab48f | 2012-10-22 12:32:54 -0400 | [diff] [blame] | 1357 | |
| 1358 | #define DMA_IB_PACKET(cmd, vmid, n) ((((cmd) & 0xF) << 28) | \ |
| 1359 | (((vmid) & 0xF) << 20) | \ |
| 1360 | (((n) & 0xFFFFF) << 0)) |
| 1361 | |
| 1362 | #define DMA_PTE_PDE_PACKET(n) ((2 << 28) | \ |
| 1363 | (1 << 26) | \ |
| 1364 | (1 << 21) | \ |
| 1365 | (((n) & 0xFFFFF) << 0)) |
| 1366 | |
Alex Deucher | 8c5fd7e | 2012-12-04 15:28:18 -0500 | [diff] [blame] | 1367 | /* async DMA Packet types */ |
| 1368 | #define DMA_PACKET_WRITE 0x2 |
| 1369 | #define DMA_PACKET_COPY 0x3 |
| 1370 | #define DMA_PACKET_INDIRECT_BUFFER 0x4 |
| 1371 | #define DMA_PACKET_SEMAPHORE 0x5 |
| 1372 | #define DMA_PACKET_FENCE 0x6 |
| 1373 | #define DMA_PACKET_TRAP 0x7 |
| 1374 | #define DMA_PACKET_SRBM_WRITE 0x9 |
| 1375 | #define DMA_PACKET_CONSTANT_FILL 0xd |
| 1376 | #define DMA_PACKET_NOP 0xf |
| 1377 | |
Alex Deucher | 43b3cd9 | 2012-03-20 17:18:00 -0400 | [diff] [blame] | 1378 | #endif |