Alex Deucher | 0af62b0 | 2011-01-06 21:19:31 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2010 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 NI_H |
| 25 | #define NI_H |
| 26 | |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 27 | #define CAYMAN_MAX_SH_GPRS 256 |
| 28 | #define CAYMAN_MAX_TEMP_GPRS 16 |
| 29 | #define CAYMAN_MAX_SH_THREADS 256 |
| 30 | #define CAYMAN_MAX_SH_STACK_ENTRIES 4096 |
| 31 | #define CAYMAN_MAX_FRC_EOV_CNT 16384 |
| 32 | #define CAYMAN_MAX_BACKENDS 8 |
| 33 | #define CAYMAN_MAX_BACKENDS_MASK 0xFF |
| 34 | #define CAYMAN_MAX_BACKENDS_PER_SE_MASK 0xF |
| 35 | #define CAYMAN_MAX_SIMDS 16 |
| 36 | #define CAYMAN_MAX_SIMDS_MASK 0xFFFF |
| 37 | #define CAYMAN_MAX_SIMDS_PER_SE_MASK 0xFFF |
| 38 | #define CAYMAN_MAX_PIPES 8 |
| 39 | #define CAYMAN_MAX_PIPES_MASK 0xFF |
| 40 | #define CAYMAN_MAX_LDS_NUM 0xFFFF |
| 41 | #define CAYMAN_MAX_TCC 16 |
| 42 | #define CAYMAN_MAX_TCC_MASK 0xFF |
| 43 | |
Alex Deucher | 416a2bd | 2012-05-31 19:00:25 -0400 | [diff] [blame] | 44 | #define CAYMAN_GB_ADDR_CONFIG_GOLDEN 0x02011003 |
| 45 | #define ARUBA_GB_ADDR_CONFIG_GOLDEN 0x12010001 |
| 46 | |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 47 | #define DMIF_ADDR_CONFIG 0xBD4 |
Alex Deucher | 7c1c7c1 | 2013-04-05 10:28:08 -0400 | [diff] [blame] | 48 | |
| 49 | /* DCE6 only */ |
| 50 | #define DMIF_ADDR_CALC 0xC00 |
| 51 | |
Alex Deucher | 1b37078 | 2011-11-17 20:13:28 -0500 | [diff] [blame] | 52 | #define SRBM_GFX_CNTL 0x0E44 |
| 53 | #define RINGID(x) (((x) & 0x3) << 0) |
| 54 | #define VMID(x) (((x) & 0x7) << 0) |
Alex Deucher | b9952a8 | 2011-03-02 20:07:33 -0500 | [diff] [blame] | 55 | #define SRBM_STATUS 0x0E50 |
Alex Deucher | 168757e | 2013-01-18 19:17:22 -0500 | [diff] [blame] | 56 | #define RLC_RQ_PENDING (1 << 3) |
| 57 | #define GRBM_RQ_PENDING (1 << 5) |
| 58 | #define VMC_BUSY (1 << 8) |
| 59 | #define MCB_BUSY (1 << 9) |
| 60 | #define MCB_NON_DISPLAY_BUSY (1 << 10) |
| 61 | #define MCC_BUSY (1 << 11) |
| 62 | #define MCD_BUSY (1 << 12) |
| 63 | #define SEM_BUSY (1 << 14) |
| 64 | #define RLC_BUSY (1 << 15) |
| 65 | #define IH_BUSY (1 << 17) |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 66 | |
Alex Deucher | f60cbd1 | 2012-12-04 15:27:33 -0500 | [diff] [blame] | 67 | #define SRBM_SOFT_RESET 0x0E60 |
| 68 | #define SOFT_RESET_BIF (1 << 1) |
| 69 | #define SOFT_RESET_CG (1 << 2) |
| 70 | #define SOFT_RESET_DC (1 << 5) |
| 71 | #define SOFT_RESET_DMA1 (1 << 6) |
| 72 | #define SOFT_RESET_GRBM (1 << 8) |
| 73 | #define SOFT_RESET_HDP (1 << 9) |
| 74 | #define SOFT_RESET_IH (1 << 10) |
| 75 | #define SOFT_RESET_MC (1 << 11) |
| 76 | #define SOFT_RESET_RLC (1 << 13) |
| 77 | #define SOFT_RESET_ROM (1 << 14) |
| 78 | #define SOFT_RESET_SEM (1 << 15) |
| 79 | #define SOFT_RESET_VMC (1 << 17) |
| 80 | #define SOFT_RESET_DMA (1 << 20) |
| 81 | #define SOFT_RESET_TST (1 << 21) |
Jerome Glisse | 64c56e8 | 2013-01-02 17:30:35 -0500 | [diff] [blame] | 82 | #define SOFT_RESET_REGBB (1 << 22) |
Alex Deucher | f60cbd1 | 2012-12-04 15:27:33 -0500 | [diff] [blame] | 83 | #define SOFT_RESET_ORB (1 << 23) |
| 84 | |
Christian König | acc1522 | 2015-02-18 13:19:28 +0100 | [diff] [blame^] | 85 | #define SRBM_READ_ERROR 0xE98 |
| 86 | #define SRBM_INT_CNTL 0xEA0 |
| 87 | #define SRBM_INT_ACK 0xEA8 |
| 88 | |
Alex Deucher | 168757e | 2013-01-18 19:17:22 -0500 | [diff] [blame] | 89 | #define SRBM_STATUS2 0x0EC4 |
| 90 | #define DMA_BUSY (1 << 5) |
| 91 | #define DMA1_BUSY (1 << 6) |
| 92 | |
Alex Deucher | fa8198e | 2011-03-02 20:07:30 -0500 | [diff] [blame] | 93 | #define VM_CONTEXT0_REQUEST_RESPONSE 0x1470 |
| 94 | #define REQUEST_TYPE(x) (((x) & 0xf) << 0) |
| 95 | #define RESPONSE_TYPE_MASK 0x000000F0 |
| 96 | #define RESPONSE_TYPE_SHIFT 4 |
| 97 | #define VM_L2_CNTL 0x1400 |
| 98 | #define ENABLE_L2_CACHE (1 << 0) |
| 99 | #define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1) |
| 100 | #define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9) |
| 101 | #define ENABLE_L2_PDE0_CACHE_LRU_UPDATE_BY_WRITE (1 << 10) |
| 102 | #define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 14) |
| 103 | #define CONTEXT1_IDENTITY_ACCESS_MODE(x) (((x) & 3) << 18) |
| 104 | /* CONTEXT1_IDENTITY_ACCESS_MODE |
| 105 | * 0 physical = logical |
| 106 | * 1 logical via context1 page table |
| 107 | * 2 inside identity aperture use translation, outside physical = logical |
| 108 | * 3 inside identity aperture physical = logical, outside use translation |
| 109 | */ |
| 110 | #define VM_L2_CNTL2 0x1404 |
| 111 | #define INVALIDATE_ALL_L1_TLBS (1 << 0) |
| 112 | #define INVALIDATE_L2_CACHE (1 << 1) |
| 113 | #define VM_L2_CNTL3 0x1408 |
| 114 | #define BANK_SELECT(x) ((x) << 0) |
| 115 | #define CACHE_UPDATE_MODE(x) ((x) << 6) |
| 116 | #define L2_CACHE_BIGK_ASSOCIATIVITY (1 << 20) |
| 117 | #define L2_CACHE_BIGK_FRAGMENT_SIZE(x) ((x) << 15) |
| 118 | #define VM_L2_STATUS 0x140C |
| 119 | #define L2_BUSY (1 << 0) |
| 120 | #define VM_CONTEXT0_CNTL 0x1410 |
| 121 | #define ENABLE_CONTEXT (1 << 0) |
| 122 | #define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1) |
Christian König | ae133a1 | 2012-09-18 15:30:44 -0400 | [diff] [blame] | 123 | #define RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 3) |
Alex Deucher | fa8198e | 2011-03-02 20:07:30 -0500 | [diff] [blame] | 124 | #define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4) |
Christian König | ae133a1 | 2012-09-18 15:30:44 -0400 | [diff] [blame] | 125 | #define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 6) |
| 126 | #define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 7) |
| 127 | #define PDE0_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 9) |
| 128 | #define PDE0_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 10) |
| 129 | #define VALID_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 12) |
| 130 | #define VALID_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 13) |
| 131 | #define READ_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 15) |
| 132 | #define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16) |
| 133 | #define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18) |
| 134 | #define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19) |
Christian König | 1c89d27 | 2014-05-10 12:17:56 +0200 | [diff] [blame] | 135 | #define PAGE_TABLE_BLOCK_SIZE(x) (((x) & 0xF) << 24) |
Alex Deucher | fa8198e | 2011-03-02 20:07:30 -0500 | [diff] [blame] | 136 | #define VM_CONTEXT1_CNTL 0x1414 |
| 137 | #define VM_CONTEXT0_CNTL2 0x1430 |
| 138 | #define VM_CONTEXT1_CNTL2 0x1434 |
| 139 | #define VM_INVALIDATE_REQUEST 0x1478 |
| 140 | #define VM_INVALIDATE_RESPONSE 0x147c |
Alex Deucher | 54e2e49 | 2013-06-13 18:26:25 -0400 | [diff] [blame] | 141 | #define VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x14FC |
| 142 | #define VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x14DC |
| 143 | #define PROTECTIONS_MASK (0xf << 0) |
| 144 | #define PROTECTIONS_SHIFT 0 |
| 145 | /* bit 0: range |
| 146 | * bit 2: pde0 |
| 147 | * bit 3: valid |
| 148 | * bit 4: read |
| 149 | * bit 5: write |
| 150 | */ |
| 151 | #define MEMORY_CLIENT_ID_MASK (0xff << 12) |
| 152 | #define MEMORY_CLIENT_ID_SHIFT 12 |
| 153 | #define MEMORY_CLIENT_RW_MASK (1 << 24) |
| 154 | #define MEMORY_CLIENT_RW_SHIFT 24 |
| 155 | #define FAULT_VMID_MASK (0x7 << 25) |
| 156 | #define FAULT_VMID_SHIFT 25 |
Alex Deucher | fa8198e | 2011-03-02 20:07:30 -0500 | [diff] [blame] | 157 | #define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1518 |
| 158 | #define VM_CONTEXT1_PROTECTION_FAULT_DEFAULT_ADDR 0x151c |
| 159 | #define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x153C |
| 160 | #define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x155C |
| 161 | #define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x157C |
| 162 | |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 163 | #define MC_SHARED_CHMAP 0x2004 |
| 164 | #define NOOFCHAN_SHIFT 12 |
| 165 | #define NOOFCHAN_MASK 0x00003000 |
| 166 | #define MC_SHARED_CHREMAP 0x2008 |
Alex Deucher | fa8198e | 2011-03-02 20:07:30 -0500 | [diff] [blame] | 167 | |
| 168 | #define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034 |
| 169 | #define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038 |
| 170 | #define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C |
| 171 | #define MC_VM_MX_L1_TLB_CNTL 0x2064 |
| 172 | #define ENABLE_L1_TLB (1 << 0) |
| 173 | #define ENABLE_L1_FRAGMENT_PROCESSING (1 << 1) |
| 174 | #define SYSTEM_ACCESS_MODE_PA_ONLY (0 << 3) |
| 175 | #define SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 3) |
| 176 | #define SYSTEM_ACCESS_MODE_IN_SYS (2 << 3) |
| 177 | #define SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 3) |
| 178 | #define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 5) |
| 179 | #define ENABLE_ADVANCED_DRIVER_MODEL (1 << 6) |
Alex Deucher | 05b3ef6 | 2012-03-20 17:18:37 -0400 | [diff] [blame] | 180 | #define FUS_MC_VM_FB_OFFSET 0x2068 |
Alex Deucher | fa8198e | 2011-03-02 20:07:30 -0500 | [diff] [blame] | 181 | |
Alex Deucher | 0af62b0 | 2011-01-06 21:19:31 -0500 | [diff] [blame] | 182 | #define MC_SHARED_BLACKOUT_CNTL 0x20ac |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 183 | #define MC_ARB_RAMCFG 0x2760 |
| 184 | #define NOOFBANK_SHIFT 0 |
| 185 | #define NOOFBANK_MASK 0x00000003 |
| 186 | #define NOOFRANK_SHIFT 2 |
| 187 | #define NOOFRANK_MASK 0x00000004 |
| 188 | #define NOOFROWS_SHIFT 3 |
| 189 | #define NOOFROWS_MASK 0x00000038 |
| 190 | #define NOOFCOLS_SHIFT 6 |
| 191 | #define NOOFCOLS_MASK 0x000000C0 |
| 192 | #define CHANSIZE_SHIFT 8 |
| 193 | #define CHANSIZE_MASK 0x00000100 |
| 194 | #define BURSTLENGTH_SHIFT 9 |
| 195 | #define BURSTLENGTH_MASK 0x00000200 |
| 196 | #define CHANSIZE_OVERRIDE (1 << 11) |
Alex Deucher | 0af62b0 | 2011-01-06 21:19:31 -0500 | [diff] [blame] | 197 | #define MC_SEQ_SUP_CNTL 0x28c8 |
| 198 | #define RUN_MASK (1 << 0) |
| 199 | #define MC_SEQ_SUP_PGM 0x28cc |
| 200 | #define MC_IO_PAD_CNTL_D0 0x29d0 |
| 201 | #define MEM_FALL_OUT_CMD (1 << 8) |
| 202 | #define MC_SEQ_MISC0 0x2a00 |
| 203 | #define MC_SEQ_MISC0_GDDR5_SHIFT 28 |
| 204 | #define MC_SEQ_MISC0_GDDR5_MASK 0xf0000000 |
| 205 | #define MC_SEQ_MISC0_GDDR5_VALUE 5 |
| 206 | #define MC_SEQ_IO_DEBUG_INDEX 0x2a44 |
| 207 | #define MC_SEQ_IO_DEBUG_DATA 0x2a48 |
| 208 | |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 209 | #define HDP_HOST_PATH_CNTL 0x2C00 |
| 210 | #define HDP_NONSURFACE_BASE 0x2C04 |
| 211 | #define HDP_NONSURFACE_INFO 0x2C08 |
| 212 | #define HDP_NONSURFACE_SIZE 0x2C0C |
| 213 | #define HDP_ADDR_CONFIG 0x2F48 |
Dave Airlie | 0b65f83 | 2011-05-19 14:14:42 +1000 | [diff] [blame] | 214 | #define HDP_MISC_CNTL 0x2F4C |
| 215 | #define HDP_FLUSH_INVALIDATE_CACHE (1 << 0) |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 216 | |
| 217 | #define CC_SYS_RB_BACKEND_DISABLE 0x3F88 |
| 218 | #define GC_USER_SYS_RB_BACKEND_DISABLE 0x3F8C |
| 219 | #define CGTS_SYS_TCC_DISABLE 0x3F90 |
| 220 | #define CGTS_USER_SYS_TCC_DISABLE 0x3F94 |
| 221 | |
Alex Deucher | 416a2bd | 2012-05-31 19:00:25 -0400 | [diff] [blame] | 222 | #define RLC_GFX_INDEX 0x3FC4 |
| 223 | |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 224 | #define CONFIG_MEMSIZE 0x5428 |
| 225 | |
Alex Deucher | fa8198e | 2011-03-02 20:07:30 -0500 | [diff] [blame] | 226 | #define HDP_MEM_COHERENCY_FLUSH_CNTL 0x5480 |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 227 | #define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0 |
| 228 | |
| 229 | #define GRBM_CNTL 0x8000 |
| 230 | #define GRBM_READ_TIMEOUT(x) ((x) << 0) |
| 231 | #define GRBM_STATUS 0x8010 |
| 232 | #define CMDFIFO_AVAIL_MASK 0x0000000F |
| 233 | #define RING2_RQ_PENDING (1 << 4) |
| 234 | #define SRBM_RQ_PENDING (1 << 5) |
| 235 | #define RING1_RQ_PENDING (1 << 6) |
| 236 | #define CF_RQ_PENDING (1 << 7) |
| 237 | #define PF_RQ_PENDING (1 << 8) |
| 238 | #define GDS_DMA_RQ_PENDING (1 << 9) |
| 239 | #define GRBM_EE_BUSY (1 << 10) |
| 240 | #define SX_CLEAN (1 << 11) |
| 241 | #define DB_CLEAN (1 << 12) |
| 242 | #define CB_CLEAN (1 << 13) |
| 243 | #define TA_BUSY (1 << 14) |
| 244 | #define GDS_BUSY (1 << 15) |
| 245 | #define VGT_BUSY_NO_DMA (1 << 16) |
| 246 | #define VGT_BUSY (1 << 17) |
| 247 | #define IA_BUSY_NO_DMA (1 << 18) |
| 248 | #define IA_BUSY (1 << 19) |
| 249 | #define SX_BUSY (1 << 20) |
| 250 | #define SH_BUSY (1 << 21) |
| 251 | #define SPI_BUSY (1 << 22) |
| 252 | #define SC_BUSY (1 << 24) |
| 253 | #define PA_BUSY (1 << 25) |
| 254 | #define DB_BUSY (1 << 26) |
| 255 | #define CP_COHERENCY_BUSY (1 << 28) |
| 256 | #define CP_BUSY (1 << 29) |
| 257 | #define CB_BUSY (1 << 30) |
| 258 | #define GUI_ACTIVE (1 << 31) |
| 259 | #define GRBM_STATUS_SE0 0x8014 |
| 260 | #define GRBM_STATUS_SE1 0x8018 |
| 261 | #define SE_SX_CLEAN (1 << 0) |
| 262 | #define SE_DB_CLEAN (1 << 1) |
| 263 | #define SE_CB_CLEAN (1 << 2) |
| 264 | #define SE_VGT_BUSY (1 << 23) |
| 265 | #define SE_PA_BUSY (1 << 24) |
| 266 | #define SE_TA_BUSY (1 << 25) |
| 267 | #define SE_SX_BUSY (1 << 26) |
| 268 | #define SE_SPI_BUSY (1 << 27) |
| 269 | #define SE_SH_BUSY (1 << 28) |
| 270 | #define SE_SC_BUSY (1 << 29) |
| 271 | #define SE_DB_BUSY (1 << 30) |
| 272 | #define SE_CB_BUSY (1 << 31) |
| 273 | #define GRBM_SOFT_RESET 0x8020 |
| 274 | #define SOFT_RESET_CP (1 << 0) |
| 275 | #define SOFT_RESET_CB (1 << 1) |
| 276 | #define SOFT_RESET_DB (1 << 3) |
| 277 | #define SOFT_RESET_GDS (1 << 4) |
| 278 | #define SOFT_RESET_PA (1 << 5) |
| 279 | #define SOFT_RESET_SC (1 << 6) |
| 280 | #define SOFT_RESET_SPI (1 << 8) |
| 281 | #define SOFT_RESET_SH (1 << 9) |
| 282 | #define SOFT_RESET_SX (1 << 10) |
| 283 | #define SOFT_RESET_TC (1 << 11) |
| 284 | #define SOFT_RESET_TA (1 << 12) |
| 285 | #define SOFT_RESET_VGT (1 << 14) |
| 286 | #define SOFT_RESET_IA (1 << 15) |
| 287 | |
Alex Deucher | 416a2bd | 2012-05-31 19:00:25 -0400 | [diff] [blame] | 288 | #define GRBM_GFX_INDEX 0x802C |
| 289 | #define INSTANCE_INDEX(x) ((x) << 0) |
| 290 | #define SE_INDEX(x) ((x) << 16) |
| 291 | #define INSTANCE_BROADCAST_WRITES (1 << 30) |
| 292 | #define SE_BROADCAST_WRITES (1 << 31) |
| 293 | |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 294 | #define SCRATCH_REG0 0x8500 |
| 295 | #define SCRATCH_REG1 0x8504 |
| 296 | #define SCRATCH_REG2 0x8508 |
| 297 | #define SCRATCH_REG3 0x850C |
| 298 | #define SCRATCH_REG4 0x8510 |
| 299 | #define SCRATCH_REG5 0x8514 |
| 300 | #define SCRATCH_REG6 0x8518 |
| 301 | #define SCRATCH_REG7 0x851C |
| 302 | #define SCRATCH_UMSK 0x8540 |
| 303 | #define SCRATCH_ADDR 0x8544 |
| 304 | #define CP_SEM_WAIT_TIMER 0x85BC |
Alex Deucher | 11ef3f1 | 2012-01-20 14:47:43 -0500 | [diff] [blame] | 305 | #define CP_SEM_INCOMPLETE_TIMER_CNTL 0x85C8 |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 306 | #define CP_COHER_CNTL2 0x85E8 |
Jerome Glisse | 440a7cd | 2012-06-27 12:25:01 -0400 | [diff] [blame] | 307 | #define CP_STALLED_STAT1 0x8674 |
| 308 | #define CP_STALLED_STAT2 0x8678 |
| 309 | #define CP_BUSY_STAT 0x867C |
| 310 | #define CP_STAT 0x8680 |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 311 | #define CP_ME_CNTL 0x86D8 |
| 312 | #define CP_ME_HALT (1 << 28) |
| 313 | #define CP_PFP_HALT (1 << 26) |
| 314 | #define CP_RB2_RPTR 0x86f8 |
| 315 | #define CP_RB1_RPTR 0x86fc |
| 316 | #define CP_RB0_RPTR 0x8700 |
| 317 | #define CP_RB_WPTR_DELAY 0x8704 |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 318 | #define CP_MEQ_THRESHOLDS 0x8764 |
| 319 | #define MEQ1_START(x) ((x) << 0) |
| 320 | #define MEQ2_START(x) ((x) << 8) |
| 321 | #define CP_PERFMON_CNTL 0x87FC |
| 322 | |
| 323 | #define VGT_CACHE_INVALIDATION 0x88C4 |
| 324 | #define CACHE_INVALIDATION(x) ((x) << 0) |
| 325 | #define VC_ONLY 0 |
| 326 | #define TC_ONLY 1 |
| 327 | #define VC_AND_TC 2 |
| 328 | #define AUTO_INVLD_EN(x) ((x) << 6) |
| 329 | #define NO_AUTO 0 |
| 330 | #define ES_AUTO 1 |
| 331 | #define GS_AUTO 2 |
| 332 | #define ES_AND_GS_AUTO 3 |
| 333 | #define VGT_GS_VERTEX_REUSE 0x88D4 |
| 334 | |
| 335 | #define CC_GC_SHADER_PIPE_CONFIG 0x8950 |
| 336 | #define GC_USER_SHADER_PIPE_CONFIG 0x8954 |
| 337 | #define INACTIVE_QD_PIPES(x) ((x) << 8) |
| 338 | #define INACTIVE_QD_PIPES_MASK 0x0000FF00 |
| 339 | #define INACTIVE_QD_PIPES_SHIFT 8 |
| 340 | #define INACTIVE_SIMDS(x) ((x) << 16) |
| 341 | #define INACTIVE_SIMDS_MASK 0xFFFF0000 |
| 342 | #define INACTIVE_SIMDS_SHIFT 16 |
| 343 | |
| 344 | #define VGT_PRIMITIVE_TYPE 0x8958 |
| 345 | #define VGT_NUM_INSTANCES 0x8974 |
| 346 | #define VGT_TF_RING_SIZE 0x8988 |
| 347 | #define VGT_OFFCHIP_LDS_BASE 0x89b4 |
| 348 | |
| 349 | #define PA_SC_LINE_STIPPLE_STATE 0x8B10 |
| 350 | #define PA_CL_ENHANCE 0x8A14 |
| 351 | #define CLIP_VTX_REORDER_ENA (1 << 0) |
| 352 | #define NUM_CLIP_SEQ(x) ((x) << 1) |
| 353 | #define PA_SC_FIFO_SIZE 0x8BCC |
| 354 | #define SC_PRIM_FIFO_SIZE(x) ((x) << 0) |
| 355 | #define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 12) |
| 356 | #define SC_EARLYZ_TILE_FIFO_SIZE(x) ((x) << 20) |
| 357 | #define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24 |
| 358 | #define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0) |
| 359 | #define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16) |
| 360 | |
| 361 | #define SQ_CONFIG 0x8C00 |
| 362 | #define VC_ENABLE (1 << 0) |
| 363 | #define EXPORT_SRC_C (1 << 1) |
| 364 | #define GFX_PRIO(x) ((x) << 2) |
| 365 | #define CS1_PRIO(x) ((x) << 4) |
| 366 | #define CS2_PRIO(x) ((x) << 6) |
| 367 | #define SQ_GPR_RESOURCE_MGMT_1 0x8C04 |
| 368 | #define NUM_PS_GPRS(x) ((x) << 0) |
| 369 | #define NUM_VS_GPRS(x) ((x) << 16) |
| 370 | #define NUM_CLAUSE_TEMP_GPRS(x) ((x) << 28) |
| 371 | #define SQ_ESGS_RING_SIZE 0x8c44 |
| 372 | #define SQ_GSVS_RING_SIZE 0x8c4c |
| 373 | #define SQ_ESTMP_RING_BASE 0x8c50 |
| 374 | #define SQ_ESTMP_RING_SIZE 0x8c54 |
| 375 | #define SQ_GSTMP_RING_BASE 0x8c58 |
| 376 | #define SQ_GSTMP_RING_SIZE 0x8c5c |
| 377 | #define SQ_VSTMP_RING_BASE 0x8c60 |
| 378 | #define SQ_VSTMP_RING_SIZE 0x8c64 |
| 379 | #define SQ_PSTMP_RING_BASE 0x8c68 |
| 380 | #define SQ_PSTMP_RING_SIZE 0x8c6c |
| 381 | #define SQ_MS_FIFO_SIZES 0x8CF0 |
| 382 | #define CACHE_FIFO_SIZE(x) ((x) << 0) |
| 383 | #define FETCH_FIFO_HIWATER(x) ((x) << 8) |
| 384 | #define DONE_FIFO_HIWATER(x) ((x) << 16) |
| 385 | #define ALU_UPDATE_FIFO_HIWATER(x) ((x) << 24) |
| 386 | #define SQ_LSTMP_RING_BASE 0x8e10 |
| 387 | #define SQ_LSTMP_RING_SIZE 0x8e14 |
| 388 | #define SQ_HSTMP_RING_BASE 0x8e18 |
| 389 | #define SQ_HSTMP_RING_SIZE 0x8e1c |
| 390 | #define SQ_DYN_GPR_CNTL_PS_FLUSH_REQ 0x8D8C |
| 391 | #define DYN_GPR_ENABLE (1 << 8) |
| 392 | #define SQ_CONST_MEM_BASE 0x8df8 |
| 393 | |
| 394 | #define SX_EXPORT_BUFFER_SIZES 0x900C |
| 395 | #define COLOR_BUFFER_SIZE(x) ((x) << 0) |
| 396 | #define POSITION_BUFFER_SIZE(x) ((x) << 8) |
| 397 | #define SMX_BUFFER_SIZE(x) ((x) << 16) |
| 398 | #define SX_DEBUG_1 0x9058 |
| 399 | #define ENABLE_NEW_SMX_ADDRESS (1 << 16) |
| 400 | |
| 401 | #define SPI_CONFIG_CNTL 0x9100 |
| 402 | #define GPR_WRITE_PRIORITY(x) ((x) << 0) |
| 403 | #define SPI_CONFIG_CNTL_1 0x913C |
| 404 | #define VTX_DONE_DELAY(x) ((x) << 0) |
| 405 | #define INTERP_ONE_PRIM_PER_ROW (1 << 4) |
| 406 | #define CRC_SIMD_ID_WADDR_DISABLE (1 << 8) |
| 407 | |
| 408 | #define CGTS_TCC_DISABLE 0x9148 |
| 409 | #define CGTS_USER_TCC_DISABLE 0x914C |
| 410 | #define TCC_DISABLE_MASK 0xFFFF0000 |
| 411 | #define TCC_DISABLE_SHIFT 16 |
Alex Deucher | 2498c41 | 2011-07-01 12:58:54 -0400 | [diff] [blame] | 412 | #define CGTS_SM_CTRL_REG 0x9150 |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 413 | #define OVERRIDE (1 << 21) |
| 414 | |
| 415 | #define TA_CNTL_AUX 0x9508 |
| 416 | #define DISABLE_CUBE_WRAP (1 << 0) |
| 417 | #define DISABLE_CUBE_ANISO (1 << 1) |
| 418 | |
| 419 | #define TCP_CHAN_STEER_LO 0x960c |
| 420 | #define TCP_CHAN_STEER_HI 0x9610 |
| 421 | |
| 422 | #define CC_RB_BACKEND_DISABLE 0x98F4 |
| 423 | #define BACKEND_DISABLE(x) ((x) << 16) |
| 424 | #define GB_ADDR_CONFIG 0x98F8 |
| 425 | #define NUM_PIPES(x) ((x) << 0) |
| 426 | #define NUM_PIPES_MASK 0x00000007 |
| 427 | #define NUM_PIPES_SHIFT 0 |
| 428 | #define PIPE_INTERLEAVE_SIZE(x) ((x) << 4) |
| 429 | #define PIPE_INTERLEAVE_SIZE_MASK 0x00000070 |
| 430 | #define PIPE_INTERLEAVE_SIZE_SHIFT 4 |
| 431 | #define BANK_INTERLEAVE_SIZE(x) ((x) << 8) |
| 432 | #define NUM_SHADER_ENGINES(x) ((x) << 12) |
| 433 | #define NUM_SHADER_ENGINES_MASK 0x00003000 |
| 434 | #define NUM_SHADER_ENGINES_SHIFT 12 |
| 435 | #define SHADER_ENGINE_TILE_SIZE(x) ((x) << 16) |
| 436 | #define SHADER_ENGINE_TILE_SIZE_MASK 0x00070000 |
| 437 | #define SHADER_ENGINE_TILE_SIZE_SHIFT 16 |
| 438 | #define NUM_GPUS(x) ((x) << 20) |
| 439 | #define NUM_GPUS_MASK 0x00700000 |
| 440 | #define NUM_GPUS_SHIFT 20 |
| 441 | #define MULTI_GPU_TILE_SIZE(x) ((x) << 24) |
| 442 | #define MULTI_GPU_TILE_SIZE_MASK 0x03000000 |
| 443 | #define MULTI_GPU_TILE_SIZE_SHIFT 24 |
| 444 | #define ROW_SIZE(x) ((x) << 28) |
Alex Deucher | bb92091 | 2011-05-23 14:22:26 -0400 | [diff] [blame] | 445 | #define ROW_SIZE_MASK 0x30000000 |
Alex Deucher | fecf1d0 | 2011-03-02 20:07:29 -0500 | [diff] [blame] | 446 | #define ROW_SIZE_SHIFT 28 |
| 447 | #define NUM_LOWER_PIPES(x) ((x) << 30) |
| 448 | #define NUM_LOWER_PIPES_MASK 0x40000000 |
| 449 | #define NUM_LOWER_PIPES_SHIFT 30 |
| 450 | #define GB_BACKEND_MAP 0x98FC |
| 451 | |
| 452 | #define CB_PERF_CTR0_SEL_0 0x9A20 |
| 453 | #define CB_PERF_CTR0_SEL_1 0x9A24 |
| 454 | #define CB_PERF_CTR1_SEL_0 0x9A28 |
| 455 | #define CB_PERF_CTR1_SEL_1 0x9A2C |
| 456 | #define CB_PERF_CTR2_SEL_0 0x9A30 |
| 457 | #define CB_PERF_CTR2_SEL_1 0x9A34 |
| 458 | #define CB_PERF_CTR3_SEL_0 0x9A38 |
| 459 | #define CB_PERF_CTR3_SEL_1 0x9A3C |
| 460 | |
| 461 | #define GC_USER_RB_BACKEND_DISABLE 0x9B7C |
| 462 | #define BACKEND_DISABLE_MASK 0x00FF0000 |
| 463 | #define BACKEND_DISABLE_SHIFT 16 |
| 464 | |
| 465 | #define SMX_DC_CTL0 0xA020 |
| 466 | #define USE_HASH_FUNCTION (1 << 0) |
| 467 | #define NUMBER_OF_SETS(x) ((x) << 1) |
| 468 | #define FLUSH_ALL_ON_EVENT (1 << 10) |
| 469 | #define STALL_ON_EVENT (1 << 11) |
| 470 | #define SMX_EVENT_CTL 0xA02C |
| 471 | #define ES_FLUSH_CTL(x) ((x) << 0) |
| 472 | #define GS_FLUSH_CTL(x) ((x) << 3) |
| 473 | #define ACK_FLUSH_CTL(x) ((x) << 6) |
| 474 | #define SYNC_FLUSH_CTL (1 << 8) |
| 475 | |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 476 | #define CP_RB0_BASE 0xC100 |
| 477 | #define CP_RB0_CNTL 0xC104 |
| 478 | #define RB_BUFSZ(x) ((x) << 0) |
| 479 | #define RB_BLKSZ(x) ((x) << 8) |
| 480 | #define RB_NO_UPDATE (1 << 27) |
| 481 | #define RB_RPTR_WR_ENA (1 << 31) |
| 482 | #define BUF_SWAP_32BIT (2 << 16) |
| 483 | #define CP_RB0_RPTR_ADDR 0xC10C |
| 484 | #define CP_RB0_RPTR_ADDR_HI 0xC110 |
| 485 | #define CP_RB0_WPTR 0xC114 |
Alex Deucher | 1b37078 | 2011-11-17 20:13:28 -0500 | [diff] [blame] | 486 | |
| 487 | #define CP_INT_CNTL 0xC124 |
| 488 | # define CNTX_BUSY_INT_ENABLE (1 << 19) |
| 489 | # define CNTX_EMPTY_INT_ENABLE (1 << 20) |
| 490 | # define TIME_STAMP_INT_ENABLE (1 << 26) |
| 491 | |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 492 | #define CP_RB1_BASE 0xC180 |
| 493 | #define CP_RB1_CNTL 0xC184 |
| 494 | #define CP_RB1_RPTR_ADDR 0xC188 |
| 495 | #define CP_RB1_RPTR_ADDR_HI 0xC18C |
| 496 | #define CP_RB1_WPTR 0xC190 |
| 497 | #define CP_RB2_BASE 0xC194 |
| 498 | #define CP_RB2_CNTL 0xC198 |
| 499 | #define CP_RB2_RPTR_ADDR 0xC19C |
| 500 | #define CP_RB2_RPTR_ADDR_HI 0xC1A0 |
| 501 | #define CP_RB2_WPTR 0xC1A4 |
| 502 | #define CP_PFP_UCODE_ADDR 0xC150 |
| 503 | #define CP_PFP_UCODE_DATA 0xC154 |
| 504 | #define CP_ME_RAM_RADDR 0xC158 |
| 505 | #define CP_ME_RAM_WADDR 0xC15C |
| 506 | #define CP_ME_RAM_DATA 0xC160 |
| 507 | #define CP_DEBUG 0xC1FC |
| 508 | |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 509 | #define VGT_EVENT_INITIATOR 0x28a90 |
| 510 | # define CACHE_FLUSH_AND_INV_EVENT_TS (0x14 << 0) |
| 511 | # define CACHE_FLUSH_AND_INV_EVENT (0x16 << 0) |
| 512 | |
Alex Deucher | 29a1522 | 2012-12-14 11:57:36 -0500 | [diff] [blame] | 513 | /* TN SMU registers */ |
| 514 | #define TN_CURRENT_GNB_TEMP 0x1F390 |
| 515 | |
Alex Deucher | 69e0b57 | 2013-04-12 16:42:42 -0400 | [diff] [blame] | 516 | /* pm registers */ |
| 517 | #define SMC_MSG 0x20c |
| 518 | #define HOST_SMC_MSG(x) ((x) << 0) |
| 519 | #define HOST_SMC_MSG_MASK (0xff << 0) |
| 520 | #define HOST_SMC_MSG_SHIFT 0 |
| 521 | #define HOST_SMC_RESP(x) ((x) << 8) |
| 522 | #define HOST_SMC_RESP_MASK (0xff << 8) |
| 523 | #define HOST_SMC_RESP_SHIFT 8 |
| 524 | #define SMC_HOST_MSG(x) ((x) << 16) |
| 525 | #define SMC_HOST_MSG_MASK (0xff << 16) |
| 526 | #define SMC_HOST_MSG_SHIFT 16 |
| 527 | #define SMC_HOST_RESP(x) ((x) << 24) |
| 528 | #define SMC_HOST_RESP_MASK (0xff << 24) |
| 529 | #define SMC_HOST_RESP_SHIFT 24 |
| 530 | |
| 531 | #define CG_SPLL_FUNC_CNTL 0x600 |
| 532 | #define SPLL_RESET (1 << 0) |
| 533 | #define SPLL_SLEEP (1 << 1) |
| 534 | #define SPLL_BYPASS_EN (1 << 3) |
| 535 | #define SPLL_REF_DIV(x) ((x) << 4) |
| 536 | #define SPLL_REF_DIV_MASK (0x3f << 4) |
| 537 | #define SPLL_PDIV_A(x) ((x) << 20) |
| 538 | #define SPLL_PDIV_A_MASK (0x7f << 20) |
| 539 | #define SPLL_PDIV_A_SHIFT 20 |
| 540 | #define CG_SPLL_FUNC_CNTL_2 0x604 |
| 541 | #define SCLK_MUX_SEL(x) ((x) << 0) |
| 542 | #define SCLK_MUX_SEL_MASK (0x1ff << 0) |
| 543 | #define CG_SPLL_FUNC_CNTL_3 0x608 |
| 544 | #define SPLL_FB_DIV(x) ((x) << 0) |
| 545 | #define SPLL_FB_DIV_MASK (0x3ffffff << 0) |
| 546 | #define SPLL_FB_DIV_SHIFT 0 |
| 547 | #define SPLL_DITHEN (1 << 28) |
| 548 | |
| 549 | #define MPLL_CNTL_MODE 0x61c |
| 550 | # define SS_SSEN (1 << 24) |
| 551 | # define SS_DSMODE_EN (1 << 25) |
| 552 | |
| 553 | #define MPLL_AD_FUNC_CNTL 0x624 |
| 554 | #define CLKF(x) ((x) << 0) |
| 555 | #define CLKF_MASK (0x7f << 0) |
| 556 | #define CLKR(x) ((x) << 7) |
| 557 | #define CLKR_MASK (0x1f << 7) |
| 558 | #define CLKFRAC(x) ((x) << 12) |
| 559 | #define CLKFRAC_MASK (0x1f << 12) |
| 560 | #define YCLK_POST_DIV(x) ((x) << 17) |
| 561 | #define YCLK_POST_DIV_MASK (3 << 17) |
| 562 | #define IBIAS(x) ((x) << 20) |
| 563 | #define IBIAS_MASK (0x3ff << 20) |
| 564 | #define RESET (1 << 30) |
| 565 | #define PDNB (1 << 31) |
| 566 | #define MPLL_AD_FUNC_CNTL_2 0x628 |
| 567 | #define BYPASS (1 << 19) |
| 568 | #define BIAS_GEN_PDNB (1 << 24) |
| 569 | #define RESET_EN (1 << 25) |
| 570 | #define VCO_MODE (1 << 29) |
| 571 | #define MPLL_DQ_FUNC_CNTL 0x62c |
| 572 | #define MPLL_DQ_FUNC_CNTL_2 0x630 |
| 573 | |
| 574 | #define GENERAL_PWRMGT 0x63c |
| 575 | # define GLOBAL_PWRMGT_EN (1 << 0) |
| 576 | # define STATIC_PM_EN (1 << 1) |
| 577 | # define THERMAL_PROTECTION_DIS (1 << 2) |
| 578 | # define THERMAL_PROTECTION_TYPE (1 << 3) |
| 579 | # define ENABLE_GEN2PCIE (1 << 4) |
| 580 | # define ENABLE_GEN2XSP (1 << 5) |
| 581 | # define SW_SMIO_INDEX(x) ((x) << 6) |
| 582 | # define SW_SMIO_INDEX_MASK (3 << 6) |
| 583 | # define SW_SMIO_INDEX_SHIFT 6 |
| 584 | # define LOW_VOLT_D2_ACPI (1 << 8) |
| 585 | # define LOW_VOLT_D3_ACPI (1 << 9) |
| 586 | # define VOLT_PWRMGT_EN (1 << 10) |
| 587 | # define BACKBIAS_PAD_EN (1 << 18) |
| 588 | # define BACKBIAS_VALUE (1 << 19) |
| 589 | # define DYN_SPREAD_SPECTRUM_EN (1 << 23) |
| 590 | # define AC_DC_SW (1 << 24) |
| 591 | |
| 592 | #define SCLK_PWRMGT_CNTL 0x644 |
| 593 | # define SCLK_PWRMGT_OFF (1 << 0) |
| 594 | # define SCLK_LOW_D1 (1 << 1) |
| 595 | # define FIR_RESET (1 << 4) |
| 596 | # define FIR_FORCE_TREND_SEL (1 << 5) |
| 597 | # define FIR_TREND_MODE (1 << 6) |
| 598 | # define DYN_GFX_CLK_OFF_EN (1 << 7) |
| 599 | # define GFX_CLK_FORCE_ON (1 << 8) |
| 600 | # define GFX_CLK_REQUEST_OFF (1 << 9) |
| 601 | # define GFX_CLK_FORCE_OFF (1 << 10) |
| 602 | # define GFX_CLK_OFF_ACPI_D1 (1 << 11) |
| 603 | # define GFX_CLK_OFF_ACPI_D2 (1 << 12) |
| 604 | # define GFX_CLK_OFF_ACPI_D3 (1 << 13) |
| 605 | # define DYN_LIGHT_SLEEP_EN (1 << 14) |
| 606 | #define MCLK_PWRMGT_CNTL 0x648 |
| 607 | # define DLL_SPEED(x) ((x) << 0) |
| 608 | # define DLL_SPEED_MASK (0x1f << 0) |
| 609 | # define MPLL_PWRMGT_OFF (1 << 5) |
| 610 | # define DLL_READY (1 << 6) |
| 611 | # define MC_INT_CNTL (1 << 7) |
| 612 | # define MRDCKA0_PDNB (1 << 8) |
| 613 | # define MRDCKA1_PDNB (1 << 9) |
| 614 | # define MRDCKB0_PDNB (1 << 10) |
| 615 | # define MRDCKB1_PDNB (1 << 11) |
| 616 | # define MRDCKC0_PDNB (1 << 12) |
| 617 | # define MRDCKC1_PDNB (1 << 13) |
| 618 | # define MRDCKD0_PDNB (1 << 14) |
| 619 | # define MRDCKD1_PDNB (1 << 15) |
| 620 | # define MRDCKA0_RESET (1 << 16) |
| 621 | # define MRDCKA1_RESET (1 << 17) |
| 622 | # define MRDCKB0_RESET (1 << 18) |
| 623 | # define MRDCKB1_RESET (1 << 19) |
| 624 | # define MRDCKC0_RESET (1 << 20) |
| 625 | # define MRDCKC1_RESET (1 << 21) |
| 626 | # define MRDCKD0_RESET (1 << 22) |
| 627 | # define MRDCKD1_RESET (1 << 23) |
| 628 | # define DLL_READY_READ (1 << 24) |
| 629 | # define USE_DISPLAY_GAP (1 << 25) |
| 630 | # define USE_DISPLAY_URGENT_NORMAL (1 << 26) |
| 631 | # define MPLL_TURNOFF_D2 (1 << 28) |
| 632 | #define DLL_CNTL 0x64c |
| 633 | # define MRDCKA0_BYPASS (1 << 24) |
| 634 | # define MRDCKA1_BYPASS (1 << 25) |
| 635 | # define MRDCKB0_BYPASS (1 << 26) |
| 636 | # define MRDCKB1_BYPASS (1 << 27) |
| 637 | # define MRDCKC0_BYPASS (1 << 28) |
| 638 | # define MRDCKC1_BYPASS (1 << 29) |
| 639 | # define MRDCKD0_BYPASS (1 << 30) |
| 640 | # define MRDCKD1_BYPASS (1 << 31) |
| 641 | |
Alex Deucher | bdf0c4f | 2013-06-28 17:49:02 -0400 | [diff] [blame] | 642 | #define TARGET_AND_CURRENT_PROFILE_INDEX 0x66c |
| 643 | # define CURRENT_STATE_INDEX_MASK (0xf << 4) |
| 644 | # define CURRENT_STATE_INDEX_SHIFT 4 |
| 645 | |
Alex Deucher | 69e0b57 | 2013-04-12 16:42:42 -0400 | [diff] [blame] | 646 | #define CG_AT 0x6d4 |
| 647 | # define CG_R(x) ((x) << 0) |
| 648 | # define CG_R_MASK (0xffff << 0) |
| 649 | # define CG_L(x) ((x) << 16) |
| 650 | # define CG_L_MASK (0xffff << 16) |
| 651 | |
| 652 | #define CG_BIF_REQ_AND_RSP 0x7f4 |
| 653 | #define CG_CLIENT_REQ(x) ((x) << 0) |
| 654 | #define CG_CLIENT_REQ_MASK (0xff << 0) |
| 655 | #define CG_CLIENT_REQ_SHIFT 0 |
| 656 | #define CG_CLIENT_RESP(x) ((x) << 8) |
| 657 | #define CG_CLIENT_RESP_MASK (0xff << 8) |
| 658 | #define CG_CLIENT_RESP_SHIFT 8 |
| 659 | #define CLIENT_CG_REQ(x) ((x) << 16) |
| 660 | #define CLIENT_CG_REQ_MASK (0xff << 16) |
| 661 | #define CLIENT_CG_REQ_SHIFT 16 |
| 662 | #define CLIENT_CG_RESP(x) ((x) << 24) |
| 663 | #define CLIENT_CG_RESP_MASK (0xff << 24) |
| 664 | #define CLIENT_CG_RESP_SHIFT 24 |
| 665 | |
| 666 | #define CG_SPLL_SPREAD_SPECTRUM 0x790 |
| 667 | #define SSEN (1 << 0) |
| 668 | #define CLK_S(x) ((x) << 4) |
| 669 | #define CLK_S_MASK (0xfff << 4) |
| 670 | #define CLK_S_SHIFT 4 |
| 671 | #define CG_SPLL_SPREAD_SPECTRUM_2 0x794 |
| 672 | #define CLK_V(x) ((x) << 0) |
| 673 | #define CLK_V_MASK (0x3ffffff << 0) |
| 674 | #define CLK_V_SHIFT 0 |
| 675 | |
| 676 | #define SMC_SCRATCH0 0x81c |
| 677 | |
| 678 | #define CG_SPLL_FUNC_CNTL_4 0x850 |
| 679 | |
| 680 | #define MPLL_SS1 0x85c |
| 681 | #define CLKV(x) ((x) << 0) |
| 682 | #define CLKV_MASK (0x3ffffff << 0) |
| 683 | #define MPLL_SS2 0x860 |
| 684 | #define CLKS(x) ((x) << 0) |
| 685 | #define CLKS_MASK (0xfff << 0) |
| 686 | |
| 687 | #define CG_CAC_CTRL 0x88c |
| 688 | #define TID_CNT(x) ((x) << 0) |
| 689 | #define TID_CNT_MASK (0x3fff << 0) |
| 690 | #define TID_UNIT(x) ((x) << 14) |
| 691 | #define TID_UNIT_MASK (0xf << 14) |
| 692 | |
Alex Deucher | 8ba1046 | 2013-02-15 16:26:33 -0500 | [diff] [blame] | 693 | #define CG_IND_ADDR 0x8f8 |
| 694 | #define CG_IND_DATA 0x8fc |
| 695 | /* CGIND regs */ |
| 696 | #define CG_CGTT_LOCAL_0 0x00 |
| 697 | #define CG_CGTT_LOCAL_1 0x01 |
| 698 | |
Alex Deucher | 69e0b57 | 2013-04-12 16:42:42 -0400 | [diff] [blame] | 699 | #define MC_CG_CONFIG 0x25bc |
| 700 | #define MCDW_WR_ENABLE (1 << 0) |
| 701 | #define MCDX_WR_ENABLE (1 << 1) |
| 702 | #define MCDY_WR_ENABLE (1 << 2) |
| 703 | #define MCDZ_WR_ENABLE (1 << 3) |
| 704 | #define MC_RD_ENABLE(x) ((x) << 4) |
| 705 | #define MC_RD_ENABLE_MASK (3 << 4) |
| 706 | #define INDEX(x) ((x) << 6) |
| 707 | #define INDEX_MASK (0xfff << 6) |
| 708 | #define INDEX_SHIFT 6 |
| 709 | |
| 710 | #define MC_ARB_CAC_CNTL 0x2750 |
| 711 | #define ENABLE (1 << 0) |
| 712 | #define READ_WEIGHT(x) ((x) << 1) |
| 713 | #define READ_WEIGHT_MASK (0x3f << 1) |
| 714 | #define READ_WEIGHT_SHIFT 1 |
| 715 | #define WRITE_WEIGHT(x) ((x) << 7) |
| 716 | #define WRITE_WEIGHT_MASK (0x3f << 7) |
| 717 | #define WRITE_WEIGHT_SHIFT 7 |
| 718 | #define ALLOW_OVERFLOW (1 << 13) |
| 719 | |
| 720 | #define MC_ARB_DRAM_TIMING 0x2774 |
| 721 | #define MC_ARB_DRAM_TIMING2 0x2778 |
| 722 | |
| 723 | #define MC_ARB_RFSH_RATE 0x27b0 |
| 724 | #define POWERMODE0(x) ((x) << 0) |
| 725 | #define POWERMODE0_MASK (0xff << 0) |
| 726 | #define POWERMODE0_SHIFT 0 |
| 727 | #define POWERMODE1(x) ((x) << 8) |
| 728 | #define POWERMODE1_MASK (0xff << 8) |
| 729 | #define POWERMODE1_SHIFT 8 |
| 730 | #define POWERMODE2(x) ((x) << 16) |
| 731 | #define POWERMODE2_MASK (0xff << 16) |
| 732 | #define POWERMODE2_SHIFT 16 |
| 733 | #define POWERMODE3(x) ((x) << 24) |
| 734 | #define POWERMODE3_MASK (0xff << 24) |
| 735 | #define POWERMODE3_SHIFT 24 |
| 736 | |
| 737 | #define MC_ARB_CG 0x27e8 |
| 738 | #define CG_ARB_REQ(x) ((x) << 0) |
| 739 | #define CG_ARB_REQ_MASK (0xff << 0) |
| 740 | #define CG_ARB_REQ_SHIFT 0 |
| 741 | #define CG_ARB_RESP(x) ((x) << 8) |
| 742 | #define CG_ARB_RESP_MASK (0xff << 8) |
| 743 | #define CG_ARB_RESP_SHIFT 8 |
| 744 | #define ARB_CG_REQ(x) ((x) << 16) |
| 745 | #define ARB_CG_REQ_MASK (0xff << 16) |
| 746 | #define ARB_CG_REQ_SHIFT 16 |
| 747 | #define ARB_CG_RESP(x) ((x) << 24) |
| 748 | #define ARB_CG_RESP_MASK (0xff << 24) |
| 749 | #define ARB_CG_RESP_SHIFT 24 |
| 750 | |
| 751 | #define MC_ARB_DRAM_TIMING_1 0x27f0 |
| 752 | #define MC_ARB_DRAM_TIMING_2 0x27f4 |
| 753 | #define MC_ARB_DRAM_TIMING_3 0x27f8 |
| 754 | #define MC_ARB_DRAM_TIMING2_1 0x27fc |
| 755 | #define MC_ARB_DRAM_TIMING2_2 0x2800 |
| 756 | #define MC_ARB_DRAM_TIMING2_3 0x2804 |
| 757 | #define MC_ARB_BURST_TIME 0x2808 |
| 758 | #define STATE0(x) ((x) << 0) |
| 759 | #define STATE0_MASK (0x1f << 0) |
| 760 | #define STATE0_SHIFT 0 |
| 761 | #define STATE1(x) ((x) << 5) |
| 762 | #define STATE1_MASK (0x1f << 5) |
| 763 | #define STATE1_SHIFT 5 |
| 764 | #define STATE2(x) ((x) << 10) |
| 765 | #define STATE2_MASK (0x1f << 10) |
| 766 | #define STATE2_SHIFT 10 |
| 767 | #define STATE3(x) ((x) << 15) |
| 768 | #define STATE3_MASK (0x1f << 15) |
| 769 | #define STATE3_SHIFT 15 |
| 770 | |
| 771 | #define MC_CG_DATAPORT 0x2884 |
| 772 | |
| 773 | #define MC_SEQ_RAS_TIMING 0x28a0 |
| 774 | #define MC_SEQ_CAS_TIMING 0x28a4 |
| 775 | #define MC_SEQ_MISC_TIMING 0x28a8 |
| 776 | #define MC_SEQ_MISC_TIMING2 0x28ac |
| 777 | #define MC_SEQ_PMG_TIMING 0x28b0 |
| 778 | #define MC_SEQ_RD_CTL_D0 0x28b4 |
| 779 | #define MC_SEQ_RD_CTL_D1 0x28b8 |
| 780 | #define MC_SEQ_WR_CTL_D0 0x28bc |
| 781 | #define MC_SEQ_WR_CTL_D1 0x28c0 |
| 782 | |
| 783 | #define MC_SEQ_MISC0 0x2a00 |
| 784 | #define MC_SEQ_MISC0_GDDR5_SHIFT 28 |
| 785 | #define MC_SEQ_MISC0_GDDR5_MASK 0xf0000000 |
| 786 | #define MC_SEQ_MISC0_GDDR5_VALUE 5 |
| 787 | #define MC_SEQ_MISC1 0x2a04 |
| 788 | #define MC_SEQ_RESERVE_M 0x2a08 |
| 789 | #define MC_PMG_CMD_EMRS 0x2a0c |
| 790 | |
| 791 | #define MC_SEQ_MISC3 0x2a2c |
| 792 | |
| 793 | #define MC_SEQ_MISC5 0x2a54 |
| 794 | #define MC_SEQ_MISC6 0x2a58 |
| 795 | |
| 796 | #define MC_SEQ_MISC7 0x2a64 |
| 797 | |
| 798 | #define MC_SEQ_RAS_TIMING_LP 0x2a6c |
| 799 | #define MC_SEQ_CAS_TIMING_LP 0x2a70 |
| 800 | #define MC_SEQ_MISC_TIMING_LP 0x2a74 |
| 801 | #define MC_SEQ_MISC_TIMING2_LP 0x2a78 |
| 802 | #define MC_SEQ_WR_CTL_D0_LP 0x2a7c |
| 803 | #define MC_SEQ_WR_CTL_D1_LP 0x2a80 |
| 804 | #define MC_SEQ_PMG_CMD_EMRS_LP 0x2a84 |
| 805 | #define MC_SEQ_PMG_CMD_MRS_LP 0x2a88 |
| 806 | |
| 807 | #define MC_PMG_CMD_MRS 0x2aac |
| 808 | |
| 809 | #define MC_SEQ_RD_CTL_D0_LP 0x2b1c |
| 810 | #define MC_SEQ_RD_CTL_D1_LP 0x2b20 |
| 811 | |
| 812 | #define MC_PMG_CMD_MRS1 0x2b44 |
| 813 | #define MC_SEQ_PMG_CMD_MRS1_LP 0x2b48 |
| 814 | #define MC_SEQ_PMG_TIMING_LP 0x2b4c |
| 815 | |
| 816 | #define MC_PMG_CMD_MRS2 0x2b5c |
| 817 | #define MC_SEQ_PMG_CMD_MRS2_LP 0x2b60 |
| 818 | |
| 819 | #define LB_SYNC_RESET_SEL 0x6b28 |
| 820 | #define LB_SYNC_RESET_SEL_MASK (3 << 0) |
| 821 | #define LB_SYNC_RESET_SEL_SHIFT 0 |
| 822 | |
| 823 | #define DC_STUTTER_CNTL 0x6b30 |
| 824 | #define DC_STUTTER_ENABLE_A (1 << 0) |
| 825 | #define DC_STUTTER_ENABLE_B (1 << 1) |
| 826 | |
| 827 | #define SQ_CAC_THRESHOLD 0x8e4c |
| 828 | #define VSP(x) ((x) << 0) |
| 829 | #define VSP_MASK (0xff << 0) |
| 830 | #define VSP_SHIFT 0 |
| 831 | #define VSP0(x) ((x) << 8) |
| 832 | #define VSP0_MASK (0xff << 8) |
| 833 | #define VSP0_SHIFT 8 |
| 834 | #define GPR(x) ((x) << 16) |
| 835 | #define GPR_MASK (0xff << 16) |
| 836 | #define GPR_SHIFT 16 |
| 837 | |
| 838 | #define SQ_POWER_THROTTLE 0x8e58 |
| 839 | #define MIN_POWER(x) ((x) << 0) |
| 840 | #define MIN_POWER_MASK (0x3fff << 0) |
| 841 | #define MIN_POWER_SHIFT 0 |
| 842 | #define MAX_POWER(x) ((x) << 16) |
| 843 | #define MAX_POWER_MASK (0x3fff << 16) |
| 844 | #define MAX_POWER_SHIFT 0 |
| 845 | #define SQ_POWER_THROTTLE2 0x8e5c |
| 846 | #define MAX_POWER_DELTA(x) ((x) << 0) |
| 847 | #define MAX_POWER_DELTA_MASK (0x3fff << 0) |
| 848 | #define MAX_POWER_DELTA_SHIFT 0 |
| 849 | #define STI_SIZE(x) ((x) << 16) |
| 850 | #define STI_SIZE_MASK (0x3ff << 16) |
| 851 | #define STI_SIZE_SHIFT 16 |
| 852 | #define LTI_RATIO(x) ((x) << 27) |
| 853 | #define LTI_RATIO_MASK (0xf << 27) |
| 854 | #define LTI_RATIO_SHIFT 27 |
| 855 | |
| 856 | /* CG indirect registers */ |
| 857 | #define CG_CAC_REGION_1_WEIGHT_0 0x83 |
| 858 | #define WEIGHT_TCP_SIG0(x) ((x) << 0) |
| 859 | #define WEIGHT_TCP_SIG0_MASK (0x3f << 0) |
| 860 | #define WEIGHT_TCP_SIG0_SHIFT 0 |
| 861 | #define WEIGHT_TCP_SIG1(x) ((x) << 6) |
| 862 | #define WEIGHT_TCP_SIG1_MASK (0x3f << 6) |
| 863 | #define WEIGHT_TCP_SIG1_SHIFT 6 |
| 864 | #define WEIGHT_TA_SIG(x) ((x) << 12) |
| 865 | #define WEIGHT_TA_SIG_MASK (0x3f << 12) |
| 866 | #define WEIGHT_TA_SIG_SHIFT 12 |
| 867 | #define CG_CAC_REGION_1_WEIGHT_1 0x84 |
| 868 | #define WEIGHT_TCC_EN0(x) ((x) << 0) |
| 869 | #define WEIGHT_TCC_EN0_MASK (0x3f << 0) |
| 870 | #define WEIGHT_TCC_EN0_SHIFT 0 |
| 871 | #define WEIGHT_TCC_EN1(x) ((x) << 6) |
| 872 | #define WEIGHT_TCC_EN1_MASK (0x3f << 6) |
| 873 | #define WEIGHT_TCC_EN1_SHIFT 6 |
| 874 | #define WEIGHT_TCC_EN2(x) ((x) << 12) |
| 875 | #define WEIGHT_TCC_EN2_MASK (0x3f << 12) |
| 876 | #define WEIGHT_TCC_EN2_SHIFT 12 |
| 877 | #define WEIGHT_TCC_EN3(x) ((x) << 18) |
| 878 | #define WEIGHT_TCC_EN3_MASK (0x3f << 18) |
| 879 | #define WEIGHT_TCC_EN3_SHIFT 18 |
| 880 | #define CG_CAC_REGION_2_WEIGHT_0 0x85 |
| 881 | #define WEIGHT_CB_EN0(x) ((x) << 0) |
| 882 | #define WEIGHT_CB_EN0_MASK (0x3f << 0) |
| 883 | #define WEIGHT_CB_EN0_SHIFT 0 |
| 884 | #define WEIGHT_CB_EN1(x) ((x) << 6) |
| 885 | #define WEIGHT_CB_EN1_MASK (0x3f << 6) |
| 886 | #define WEIGHT_CB_EN1_SHIFT 6 |
| 887 | #define WEIGHT_CB_EN2(x) ((x) << 12) |
| 888 | #define WEIGHT_CB_EN2_MASK (0x3f << 12) |
| 889 | #define WEIGHT_CB_EN2_SHIFT 12 |
| 890 | #define WEIGHT_CB_EN3(x) ((x) << 18) |
| 891 | #define WEIGHT_CB_EN3_MASK (0x3f << 18) |
| 892 | #define WEIGHT_CB_EN3_SHIFT 18 |
| 893 | #define CG_CAC_REGION_2_WEIGHT_1 0x86 |
| 894 | #define WEIGHT_DB_SIG0(x) ((x) << 0) |
| 895 | #define WEIGHT_DB_SIG0_MASK (0x3f << 0) |
| 896 | #define WEIGHT_DB_SIG0_SHIFT 0 |
| 897 | #define WEIGHT_DB_SIG1(x) ((x) << 6) |
| 898 | #define WEIGHT_DB_SIG1_MASK (0x3f << 6) |
| 899 | #define WEIGHT_DB_SIG1_SHIFT 6 |
| 900 | #define WEIGHT_DB_SIG2(x) ((x) << 12) |
| 901 | #define WEIGHT_DB_SIG2_MASK (0x3f << 12) |
| 902 | #define WEIGHT_DB_SIG2_SHIFT 12 |
| 903 | #define WEIGHT_DB_SIG3(x) ((x) << 18) |
| 904 | #define WEIGHT_DB_SIG3_MASK (0x3f << 18) |
| 905 | #define WEIGHT_DB_SIG3_SHIFT 18 |
| 906 | #define CG_CAC_REGION_2_WEIGHT_2 0x87 |
| 907 | #define WEIGHT_SXM_SIG0(x) ((x) << 0) |
| 908 | #define WEIGHT_SXM_SIG0_MASK (0x3f << 0) |
| 909 | #define WEIGHT_SXM_SIG0_SHIFT 0 |
| 910 | #define WEIGHT_SXM_SIG1(x) ((x) << 6) |
| 911 | #define WEIGHT_SXM_SIG1_MASK (0x3f << 6) |
| 912 | #define WEIGHT_SXM_SIG1_SHIFT 6 |
| 913 | #define WEIGHT_SXM_SIG2(x) ((x) << 12) |
| 914 | #define WEIGHT_SXM_SIG2_MASK (0x3f << 12) |
| 915 | #define WEIGHT_SXM_SIG2_SHIFT 12 |
| 916 | #define WEIGHT_SXS_SIG0(x) ((x) << 18) |
| 917 | #define WEIGHT_SXS_SIG0_MASK (0x3f << 18) |
| 918 | #define WEIGHT_SXS_SIG0_SHIFT 18 |
| 919 | #define WEIGHT_SXS_SIG1(x) ((x) << 24) |
| 920 | #define WEIGHT_SXS_SIG1_MASK (0x3f << 24) |
| 921 | #define WEIGHT_SXS_SIG1_SHIFT 24 |
| 922 | #define CG_CAC_REGION_3_WEIGHT_0 0x88 |
| 923 | #define WEIGHT_XBR_0(x) ((x) << 0) |
| 924 | #define WEIGHT_XBR_0_MASK (0x3f << 0) |
| 925 | #define WEIGHT_XBR_0_SHIFT 0 |
| 926 | #define WEIGHT_XBR_1(x) ((x) << 6) |
| 927 | #define WEIGHT_XBR_1_MASK (0x3f << 6) |
| 928 | #define WEIGHT_XBR_1_SHIFT 6 |
| 929 | #define WEIGHT_XBR_2(x) ((x) << 12) |
| 930 | #define WEIGHT_XBR_2_MASK (0x3f << 12) |
| 931 | #define WEIGHT_XBR_2_SHIFT 12 |
| 932 | #define WEIGHT_SPI_SIG0(x) ((x) << 18) |
| 933 | #define WEIGHT_SPI_SIG0_MASK (0x3f << 18) |
| 934 | #define WEIGHT_SPI_SIG0_SHIFT 18 |
| 935 | #define CG_CAC_REGION_3_WEIGHT_1 0x89 |
| 936 | #define WEIGHT_SPI_SIG1(x) ((x) << 0) |
| 937 | #define WEIGHT_SPI_SIG1_MASK (0x3f << 0) |
| 938 | #define WEIGHT_SPI_SIG1_SHIFT 0 |
| 939 | #define WEIGHT_SPI_SIG2(x) ((x) << 6) |
| 940 | #define WEIGHT_SPI_SIG2_MASK (0x3f << 6) |
| 941 | #define WEIGHT_SPI_SIG2_SHIFT 6 |
| 942 | #define WEIGHT_SPI_SIG3(x) ((x) << 12) |
| 943 | #define WEIGHT_SPI_SIG3_MASK (0x3f << 12) |
| 944 | #define WEIGHT_SPI_SIG3_SHIFT 12 |
| 945 | #define WEIGHT_SPI_SIG4(x) ((x) << 18) |
| 946 | #define WEIGHT_SPI_SIG4_MASK (0x3f << 18) |
| 947 | #define WEIGHT_SPI_SIG4_SHIFT 18 |
| 948 | #define WEIGHT_SPI_SIG5(x) ((x) << 24) |
| 949 | #define WEIGHT_SPI_SIG5_MASK (0x3f << 24) |
| 950 | #define WEIGHT_SPI_SIG5_SHIFT 24 |
| 951 | #define CG_CAC_REGION_4_WEIGHT_0 0x8a |
| 952 | #define WEIGHT_LDS_SIG0(x) ((x) << 0) |
| 953 | #define WEIGHT_LDS_SIG0_MASK (0x3f << 0) |
| 954 | #define WEIGHT_LDS_SIG0_SHIFT 0 |
| 955 | #define WEIGHT_LDS_SIG1(x) ((x) << 6) |
| 956 | #define WEIGHT_LDS_SIG1_MASK (0x3f << 6) |
| 957 | #define WEIGHT_LDS_SIG1_SHIFT 6 |
| 958 | #define WEIGHT_SC(x) ((x) << 24) |
| 959 | #define WEIGHT_SC_MASK (0x3f << 24) |
| 960 | #define WEIGHT_SC_SHIFT 24 |
| 961 | #define CG_CAC_REGION_4_WEIGHT_1 0x8b |
| 962 | #define WEIGHT_BIF(x) ((x) << 0) |
| 963 | #define WEIGHT_BIF_MASK (0x3f << 0) |
| 964 | #define WEIGHT_BIF_SHIFT 0 |
| 965 | #define WEIGHT_CP(x) ((x) << 6) |
| 966 | #define WEIGHT_CP_MASK (0x3f << 6) |
| 967 | #define WEIGHT_CP_SHIFT 6 |
| 968 | #define WEIGHT_PA_SIG0(x) ((x) << 12) |
| 969 | #define WEIGHT_PA_SIG0_MASK (0x3f << 12) |
| 970 | #define WEIGHT_PA_SIG0_SHIFT 12 |
| 971 | #define WEIGHT_PA_SIG1(x) ((x) << 18) |
| 972 | #define WEIGHT_PA_SIG1_MASK (0x3f << 18) |
| 973 | #define WEIGHT_PA_SIG1_SHIFT 18 |
| 974 | #define WEIGHT_VGT_SIG0(x) ((x) << 24) |
| 975 | #define WEIGHT_VGT_SIG0_MASK (0x3f << 24) |
| 976 | #define WEIGHT_VGT_SIG0_SHIFT 24 |
| 977 | #define CG_CAC_REGION_4_WEIGHT_2 0x8c |
| 978 | #define WEIGHT_VGT_SIG1(x) ((x) << 0) |
| 979 | #define WEIGHT_VGT_SIG1_MASK (0x3f << 0) |
| 980 | #define WEIGHT_VGT_SIG1_SHIFT 0 |
| 981 | #define WEIGHT_VGT_SIG2(x) ((x) << 6) |
| 982 | #define WEIGHT_VGT_SIG2_MASK (0x3f << 6) |
| 983 | #define WEIGHT_VGT_SIG2_SHIFT 6 |
| 984 | #define WEIGHT_DC_SIG0(x) ((x) << 12) |
| 985 | #define WEIGHT_DC_SIG0_MASK (0x3f << 12) |
| 986 | #define WEIGHT_DC_SIG0_SHIFT 12 |
| 987 | #define WEIGHT_DC_SIG1(x) ((x) << 18) |
| 988 | #define WEIGHT_DC_SIG1_MASK (0x3f << 18) |
| 989 | #define WEIGHT_DC_SIG1_SHIFT 18 |
| 990 | #define WEIGHT_DC_SIG2(x) ((x) << 24) |
| 991 | #define WEIGHT_DC_SIG2_MASK (0x3f << 24) |
| 992 | #define WEIGHT_DC_SIG2_SHIFT 24 |
| 993 | #define CG_CAC_REGION_4_WEIGHT_3 0x8d |
| 994 | #define WEIGHT_DC_SIG3(x) ((x) << 0) |
| 995 | #define WEIGHT_DC_SIG3_MASK (0x3f << 0) |
| 996 | #define WEIGHT_DC_SIG3_SHIFT 0 |
| 997 | #define WEIGHT_UVD_SIG0(x) ((x) << 6) |
| 998 | #define WEIGHT_UVD_SIG0_MASK (0x3f << 6) |
| 999 | #define WEIGHT_UVD_SIG0_SHIFT 6 |
| 1000 | #define WEIGHT_UVD_SIG1(x) ((x) << 12) |
| 1001 | #define WEIGHT_UVD_SIG1_MASK (0x3f << 12) |
| 1002 | #define WEIGHT_UVD_SIG1_SHIFT 12 |
| 1003 | #define WEIGHT_SPARE0(x) ((x) << 18) |
| 1004 | #define WEIGHT_SPARE0_MASK (0x3f << 18) |
| 1005 | #define WEIGHT_SPARE0_SHIFT 18 |
| 1006 | #define WEIGHT_SPARE1(x) ((x) << 24) |
| 1007 | #define WEIGHT_SPARE1_MASK (0x3f << 24) |
| 1008 | #define WEIGHT_SPARE1_SHIFT 24 |
| 1009 | #define CG_CAC_REGION_5_WEIGHT_0 0x8e |
| 1010 | #define WEIGHT_SQ_VSP(x) ((x) << 0) |
| 1011 | #define WEIGHT_SQ_VSP_MASK (0x3fff << 0) |
| 1012 | #define WEIGHT_SQ_VSP_SHIFT 0 |
| 1013 | #define WEIGHT_SQ_VSP0(x) ((x) << 14) |
| 1014 | #define WEIGHT_SQ_VSP0_MASK (0x3fff << 14) |
| 1015 | #define WEIGHT_SQ_VSP0_SHIFT 14 |
| 1016 | #define CG_CAC_REGION_4_OVERRIDE_4 0xab |
| 1017 | #define OVR_MODE_SPARE_0(x) ((x) << 16) |
| 1018 | #define OVR_MODE_SPARE_0_MASK (0x1 << 16) |
| 1019 | #define OVR_MODE_SPARE_0_SHIFT 16 |
| 1020 | #define OVR_VAL_SPARE_0(x) ((x) << 17) |
| 1021 | #define OVR_VAL_SPARE_0_MASK (0x1 << 17) |
| 1022 | #define OVR_VAL_SPARE_0_SHIFT 17 |
| 1023 | #define OVR_MODE_SPARE_1(x) ((x) << 18) |
| 1024 | #define OVR_MODE_SPARE_1_MASK (0x3f << 18) |
| 1025 | #define OVR_MODE_SPARE_1_SHIFT 18 |
| 1026 | #define OVR_VAL_SPARE_1(x) ((x) << 19) |
| 1027 | #define OVR_VAL_SPARE_1_MASK (0x3f << 19) |
| 1028 | #define OVR_VAL_SPARE_1_SHIFT 19 |
| 1029 | #define CG_CAC_REGION_5_WEIGHT_1 0xb7 |
| 1030 | #define WEIGHT_SQ_GPR(x) ((x) << 0) |
| 1031 | #define WEIGHT_SQ_GPR_MASK (0x3fff << 0) |
| 1032 | #define WEIGHT_SQ_GPR_SHIFT 0 |
| 1033 | #define WEIGHT_SQ_LDS(x) ((x) << 14) |
| 1034 | #define WEIGHT_SQ_LDS_MASK (0x3fff << 14) |
| 1035 | #define WEIGHT_SQ_LDS_SHIFT 14 |
| 1036 | |
| 1037 | /* PCIE link stuff */ |
| 1038 | #define PCIE_LC_TRAINING_CNTL 0xa1 /* PCIE_P */ |
| 1039 | #define PCIE_LC_LINK_WIDTH_CNTL 0xa2 /* PCIE_P */ |
| 1040 | # define LC_LINK_WIDTH_SHIFT 0 |
| 1041 | # define LC_LINK_WIDTH_MASK 0x7 |
| 1042 | # define LC_LINK_WIDTH_X0 0 |
| 1043 | # define LC_LINK_WIDTH_X1 1 |
| 1044 | # define LC_LINK_WIDTH_X2 2 |
| 1045 | # define LC_LINK_WIDTH_X4 3 |
| 1046 | # define LC_LINK_WIDTH_X8 4 |
| 1047 | # define LC_LINK_WIDTH_X16 6 |
| 1048 | # define LC_LINK_WIDTH_RD_SHIFT 4 |
| 1049 | # define LC_LINK_WIDTH_RD_MASK 0x70 |
| 1050 | # define LC_RECONFIG_ARC_MISSING_ESCAPE (1 << 7) |
| 1051 | # define LC_RECONFIG_NOW (1 << 8) |
| 1052 | # define LC_RENEGOTIATION_SUPPORT (1 << 9) |
| 1053 | # define LC_RENEGOTIATE_EN (1 << 10) |
| 1054 | # define LC_SHORT_RECONFIG_EN (1 << 11) |
| 1055 | # define LC_UPCONFIGURE_SUPPORT (1 << 12) |
| 1056 | # define LC_UPCONFIGURE_DIS (1 << 13) |
| 1057 | #define PCIE_LC_SPEED_CNTL 0xa4 /* PCIE_P */ |
| 1058 | # define LC_GEN2_EN_STRAP (1 << 0) |
| 1059 | # define LC_TARGET_LINK_SPEED_OVERRIDE_EN (1 << 1) |
| 1060 | # define LC_FORCE_EN_HW_SPEED_CHANGE (1 << 5) |
| 1061 | # define LC_FORCE_DIS_HW_SPEED_CHANGE (1 << 6) |
| 1062 | # define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK (0x3 << 8) |
| 1063 | # define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT 3 |
| 1064 | # define LC_CURRENT_DATA_RATE (1 << 11) |
| 1065 | # define LC_HW_VOLTAGE_IF_CONTROL(x) ((x) << 12) |
| 1066 | # define LC_HW_VOLTAGE_IF_CONTROL_MASK (3 << 12) |
| 1067 | # define LC_HW_VOLTAGE_IF_CONTROL_SHIFT 12 |
| 1068 | # define LC_VOLTAGE_TIMER_SEL_MASK (0xf << 14) |
| 1069 | # define LC_CLR_FAILED_SPD_CHANGE_CNT (1 << 21) |
| 1070 | # define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 23) |
| 1071 | # define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 24) |
| 1072 | #define MM_CFGREGS_CNTL 0x544c |
| 1073 | # define MM_WR_TO_CFG_EN (1 << 3) |
| 1074 | #define LINK_CNTL2 0x88 /* F0 */ |
| 1075 | # define TARGET_LINK_SPEED_MASK (0xf << 0) |
| 1076 | # define SELECTABLE_DEEMPHASIS (1 << 6) |
| 1077 | |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1078 | /* |
Christian König | f2ba57b | 2013-04-08 12:41:29 +0200 | [diff] [blame] | 1079 | * UVD |
| 1080 | */ |
| 1081 | #define UVD_SEMA_ADDR_LOW 0xEF00 |
| 1082 | #define UVD_SEMA_ADDR_HIGH 0xEF04 |
| 1083 | #define UVD_SEMA_CMD 0xEF08 |
Christian König | 9a21059 | 2013-04-08 12:41:37 +0200 | [diff] [blame] | 1084 | #define UVD_UDEC_ADDR_CONFIG 0xEF4C |
| 1085 | #define UVD_UDEC_DB_ADDR_CONFIG 0xEF50 |
| 1086 | #define UVD_UDEC_DBW_ADDR_CONFIG 0xEF54 |
Christian König | f2ba57b | 2013-04-08 12:41:29 +0200 | [diff] [blame] | 1087 | #define UVD_RBC_RB_RPTR 0xF690 |
| 1088 | #define UVD_RBC_RB_WPTR 0xF694 |
| 1089 | |
| 1090 | /* |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1091 | * PM4 |
| 1092 | */ |
Ilija Hadzic | 4e872ae | 2013-01-02 18:27:48 -0500 | [diff] [blame] | 1093 | #define PACKET0(reg, n) ((RADEON_PACKET_TYPE0 << 30) | \ |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1094 | (((reg) >> 2) & 0xFFFF) | \ |
| 1095 | ((n) & 0x3FFF) << 16) |
| 1096 | #define CP_PACKET2 0x80000000 |
| 1097 | #define PACKET2_PAD_SHIFT 0 |
| 1098 | #define PACKET2_PAD_MASK (0x3fffffff << 0) |
| 1099 | |
| 1100 | #define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v))) |
| 1101 | |
Ilija Hadzic | 4e872ae | 2013-01-02 18:27:48 -0500 | [diff] [blame] | 1102 | #define PACKET3(op, n) ((RADEON_PACKET_TYPE3 << 30) | \ |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1103 | (((op) & 0xFF) << 8) | \ |
| 1104 | ((n) & 0x3FFF) << 16) |
| 1105 | |
| 1106 | /* Packet 3 types */ |
| 1107 | #define PACKET3_NOP 0x10 |
| 1108 | #define PACKET3_SET_BASE 0x11 |
| 1109 | #define PACKET3_CLEAR_STATE 0x12 |
| 1110 | #define PACKET3_INDEX_BUFFER_SIZE 0x13 |
| 1111 | #define PACKET3_DEALLOC_STATE 0x14 |
| 1112 | #define PACKET3_DISPATCH_DIRECT 0x15 |
| 1113 | #define PACKET3_DISPATCH_INDIRECT 0x16 |
| 1114 | #define PACKET3_INDIRECT_BUFFER_END 0x17 |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1115 | #define PACKET3_MODE_CONTROL 0x18 |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1116 | #define PACKET3_SET_PREDICATION 0x20 |
| 1117 | #define PACKET3_REG_RMW 0x21 |
| 1118 | #define PACKET3_COND_EXEC 0x22 |
| 1119 | #define PACKET3_PRED_EXEC 0x23 |
| 1120 | #define PACKET3_DRAW_INDIRECT 0x24 |
| 1121 | #define PACKET3_DRAW_INDEX_INDIRECT 0x25 |
| 1122 | #define PACKET3_INDEX_BASE 0x26 |
| 1123 | #define PACKET3_DRAW_INDEX_2 0x27 |
| 1124 | #define PACKET3_CONTEXT_CONTROL 0x28 |
| 1125 | #define PACKET3_DRAW_INDEX_OFFSET 0x29 |
| 1126 | #define PACKET3_INDEX_TYPE 0x2A |
| 1127 | #define PACKET3_DRAW_INDEX 0x2B |
| 1128 | #define PACKET3_DRAW_INDEX_AUTO 0x2D |
| 1129 | #define PACKET3_DRAW_INDEX_IMMD 0x2E |
| 1130 | #define PACKET3_NUM_INSTANCES 0x2F |
| 1131 | #define PACKET3_DRAW_INDEX_MULTI_AUTO 0x30 |
| 1132 | #define PACKET3_INDIRECT_BUFFER 0x32 |
| 1133 | #define PACKET3_STRMOUT_BUFFER_UPDATE 0x34 |
| 1134 | #define PACKET3_DRAW_INDEX_OFFSET_2 0x35 |
| 1135 | #define PACKET3_DRAW_INDEX_MULTI_ELEMENT 0x36 |
| 1136 | #define PACKET3_WRITE_DATA 0x37 |
| 1137 | #define PACKET3_MEM_SEMAPHORE 0x39 |
| 1138 | #define PACKET3_MPEG_INDEX 0x3A |
| 1139 | #define PACKET3_WAIT_REG_MEM 0x3C |
Alex Deucher | cbfc35b | 2015-01-05 19:42:25 -0500 | [diff] [blame] | 1140 | #define WAIT_REG_MEM_FUNCTION(x) ((x) << 0) |
| 1141 | /* 0 - always |
| 1142 | * 1 - < |
| 1143 | * 2 - <= |
| 1144 | * 3 - == |
| 1145 | * 4 - != |
| 1146 | * 5 - >= |
| 1147 | * 6 - > |
| 1148 | */ |
| 1149 | #define WAIT_REG_MEM_MEM_SPACE(x) ((x) << 4) |
| 1150 | /* 0 - reg |
| 1151 | * 1 - mem |
| 1152 | */ |
| 1153 | #define WAIT_REG_MEM_ENGINE(x) ((x) << 8) |
| 1154 | /* 0 - me |
| 1155 | * 1 - pfp |
| 1156 | */ |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1157 | #define PACKET3_MEM_WRITE 0x3D |
Christian König | 58f8cf5 | 2012-10-22 17:42:35 +0200 | [diff] [blame] | 1158 | #define PACKET3_PFP_SYNC_ME 0x42 |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1159 | #define PACKET3_SURFACE_SYNC 0x43 |
| 1160 | # define PACKET3_CB0_DEST_BASE_ENA (1 << 6) |
| 1161 | # define PACKET3_CB1_DEST_BASE_ENA (1 << 7) |
| 1162 | # define PACKET3_CB2_DEST_BASE_ENA (1 << 8) |
| 1163 | # define PACKET3_CB3_DEST_BASE_ENA (1 << 9) |
| 1164 | # define PACKET3_CB4_DEST_BASE_ENA (1 << 10) |
| 1165 | # define PACKET3_CB5_DEST_BASE_ENA (1 << 11) |
| 1166 | # define PACKET3_CB6_DEST_BASE_ENA (1 << 12) |
| 1167 | # define PACKET3_CB7_DEST_BASE_ENA (1 << 13) |
| 1168 | # define PACKET3_DB_DEST_BASE_ENA (1 << 14) |
| 1169 | # define PACKET3_CB8_DEST_BASE_ENA (1 << 15) |
| 1170 | # define PACKET3_CB9_DEST_BASE_ENA (1 << 16) |
| 1171 | # define PACKET3_CB10_DEST_BASE_ENA (1 << 17) |
| 1172 | # define PACKET3_CB11_DEST_BASE_ENA (1 << 18) |
| 1173 | # define PACKET3_FULL_CACHE_ENA (1 << 20) |
| 1174 | # define PACKET3_TC_ACTION_ENA (1 << 23) |
| 1175 | # define PACKET3_CB_ACTION_ENA (1 << 25) |
| 1176 | # define PACKET3_DB_ACTION_ENA (1 << 26) |
| 1177 | # define PACKET3_SH_ACTION_ENA (1 << 27) |
| 1178 | # define PACKET3_SX_ACTION_ENA (1 << 28) |
Alex Deucher | 10e9ffa | 2014-01-16 18:02:59 -0500 | [diff] [blame] | 1179 | # define PACKET3_ENGINE_ME (1 << 31) |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1180 | #define PACKET3_ME_INITIALIZE 0x44 |
| 1181 | #define PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16) |
| 1182 | #define PACKET3_COND_WRITE 0x45 |
| 1183 | #define PACKET3_EVENT_WRITE 0x46 |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 1184 | #define EVENT_TYPE(x) ((x) << 0) |
| 1185 | #define EVENT_INDEX(x) ((x) << 8) |
| 1186 | /* 0 - any non-TS event |
| 1187 | * 1 - ZPASS_DONE |
| 1188 | * 2 - SAMPLE_PIPELINESTAT |
| 1189 | * 3 - SAMPLE_STREAMOUTSTAT* |
| 1190 | * 4 - *S_PARTIAL_FLUSH |
| 1191 | * 5 - TS events |
| 1192 | */ |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1193 | #define PACKET3_EVENT_WRITE_EOP 0x47 |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 1194 | #define DATA_SEL(x) ((x) << 29) |
| 1195 | /* 0 - discard |
| 1196 | * 1 - send low 32bit data |
| 1197 | * 2 - send 64bit data |
| 1198 | * 3 - send 64bit counter value |
| 1199 | */ |
| 1200 | #define INT_SEL(x) ((x) << 24) |
| 1201 | /* 0 - none |
| 1202 | * 1 - interrupt only (DATA_SEL = 0) |
| 1203 | * 2 - interrupt when data write is confirmed |
| 1204 | */ |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1205 | #define PACKET3_EVENT_WRITE_EOS 0x48 |
| 1206 | #define PACKET3_PREAMBLE_CNTL 0x4A |
| 1207 | # define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE (2 << 28) |
| 1208 | # define PACKET3_PREAMBLE_END_CLEAR_STATE (3 << 28) |
| 1209 | #define PACKET3_ALU_PS_CONST_BUFFER_COPY 0x4C |
| 1210 | #define PACKET3_ALU_VS_CONST_BUFFER_COPY 0x4D |
| 1211 | #define PACKET3_ALU_PS_CONST_UPDATE 0x4E |
| 1212 | #define PACKET3_ALU_VS_CONST_UPDATE 0x4F |
| 1213 | #define PACKET3_ONE_REG_WRITE 0x57 |
| 1214 | #define PACKET3_SET_CONFIG_REG 0x68 |
| 1215 | #define PACKET3_SET_CONFIG_REG_START 0x00008000 |
| 1216 | #define PACKET3_SET_CONFIG_REG_END 0x0000ac00 |
| 1217 | #define PACKET3_SET_CONTEXT_REG 0x69 |
| 1218 | #define PACKET3_SET_CONTEXT_REG_START 0x00028000 |
| 1219 | #define PACKET3_SET_CONTEXT_REG_END 0x00029000 |
| 1220 | #define PACKET3_SET_ALU_CONST 0x6A |
| 1221 | /* alu const buffers only; no reg file */ |
| 1222 | #define PACKET3_SET_BOOL_CONST 0x6B |
| 1223 | #define PACKET3_SET_BOOL_CONST_START 0x0003a500 |
| 1224 | #define PACKET3_SET_BOOL_CONST_END 0x0003a518 |
| 1225 | #define PACKET3_SET_LOOP_CONST 0x6C |
| 1226 | #define PACKET3_SET_LOOP_CONST_START 0x0003a200 |
| 1227 | #define PACKET3_SET_LOOP_CONST_END 0x0003a500 |
| 1228 | #define PACKET3_SET_RESOURCE 0x6D |
| 1229 | #define PACKET3_SET_RESOURCE_START 0x00030000 |
| 1230 | #define PACKET3_SET_RESOURCE_END 0x00038000 |
| 1231 | #define PACKET3_SET_SAMPLER 0x6E |
| 1232 | #define PACKET3_SET_SAMPLER_START 0x0003c000 |
| 1233 | #define PACKET3_SET_SAMPLER_END 0x0003c600 |
| 1234 | #define PACKET3_SET_CTL_CONST 0x6F |
| 1235 | #define PACKET3_SET_CTL_CONST_START 0x0003cff0 |
| 1236 | #define PACKET3_SET_CTL_CONST_END 0x0003ff0c |
| 1237 | #define PACKET3_SET_RESOURCE_OFFSET 0x70 |
| 1238 | #define PACKET3_SET_ALU_CONST_VS 0x71 |
| 1239 | #define PACKET3_SET_ALU_CONST_DI 0x72 |
| 1240 | #define PACKET3_SET_CONTEXT_REG_INDIRECT 0x73 |
| 1241 | #define PACKET3_SET_RESOURCE_INDIRECT 0x74 |
| 1242 | #define PACKET3_SET_APPEND_CNT 0x75 |
Christian König | 2a6f1ab | 2012-08-11 15:00:30 +0200 | [diff] [blame] | 1243 | #define PACKET3_ME_WRITE 0x7A |
Alex Deucher | 0c88a02 | 2011-03-02 20:07:31 -0500 | [diff] [blame] | 1244 | |
Alex Deucher | f60cbd1 | 2012-12-04 15:27:33 -0500 | [diff] [blame] | 1245 | /* ASYNC DMA - first instance at 0xd000, second at 0xd800 */ |
| 1246 | #define DMA0_REGISTER_OFFSET 0x0 /* not a register */ |
| 1247 | #define DMA1_REGISTER_OFFSET 0x800 /* not a register */ |
| 1248 | |
| 1249 | #define DMA_RB_CNTL 0xd000 |
| 1250 | # define DMA_RB_ENABLE (1 << 0) |
| 1251 | # define DMA_RB_SIZE(x) ((x) << 1) /* log2 */ |
| 1252 | # define DMA_RB_SWAP_ENABLE (1 << 9) /* 8IN32 */ |
| 1253 | # define DMA_RPTR_WRITEBACK_ENABLE (1 << 12) |
| 1254 | # define DMA_RPTR_WRITEBACK_SWAP_ENABLE (1 << 13) /* 8IN32 */ |
| 1255 | # define DMA_RPTR_WRITEBACK_TIMER(x) ((x) << 16) /* log2 */ |
| 1256 | #define DMA_RB_BASE 0xd004 |
| 1257 | #define DMA_RB_RPTR 0xd008 |
| 1258 | #define DMA_RB_WPTR 0xd00c |
| 1259 | |
| 1260 | #define DMA_RB_RPTR_ADDR_HI 0xd01c |
| 1261 | #define DMA_RB_RPTR_ADDR_LO 0xd020 |
| 1262 | |
| 1263 | #define DMA_IB_CNTL 0xd024 |
| 1264 | # define DMA_IB_ENABLE (1 << 0) |
| 1265 | # define DMA_IB_SWAP_ENABLE (1 << 4) |
| 1266 | # define CMD_VMID_FORCE (1 << 31) |
| 1267 | #define DMA_IB_RPTR 0xd028 |
| 1268 | #define DMA_CNTL 0xd02c |
| 1269 | # define TRAP_ENABLE (1 << 0) |
| 1270 | # define SEM_INCOMPLETE_INT_ENABLE (1 << 1) |
| 1271 | # define SEM_WAIT_INT_ENABLE (1 << 2) |
| 1272 | # define DATA_SWAP_ENABLE (1 << 3) |
| 1273 | # define FENCE_SWAP_ENABLE (1 << 4) |
| 1274 | # define CTXEMPTY_INT_ENABLE (1 << 28) |
| 1275 | #define DMA_STATUS_REG 0xd034 |
| 1276 | # define DMA_IDLE (1 << 0) |
| 1277 | #define DMA_SEM_INCOMPLETE_TIMER_CNTL 0xd044 |
| 1278 | #define DMA_SEM_WAIT_FAIL_TIMER_CNTL 0xd048 |
| 1279 | #define DMA_TILING_CONFIG 0xd0b8 |
| 1280 | #define DMA_MODE 0xd0bc |
| 1281 | |
| 1282 | #define DMA_PACKET(cmd, t, s, n) ((((cmd) & 0xF) << 28) | \ |
| 1283 | (((t) & 0x1) << 23) | \ |
| 1284 | (((s) & 0x1) << 22) | \ |
| 1285 | (((n) & 0xFFFFF) << 0)) |
| 1286 | |
| 1287 | #define DMA_IB_PACKET(cmd, vmid, n) ((((cmd) & 0xF) << 28) | \ |
| 1288 | (((vmid) & 0xF) << 20) | \ |
| 1289 | (((n) & 0xFFFFF) << 0)) |
| 1290 | |
Alex Deucher | 2ab91ad | 2013-04-16 10:42:15 -0400 | [diff] [blame] | 1291 | #define DMA_PTE_PDE_PACKET(n) ((2 << 28) | \ |
| 1292 | (1 << 26) | \ |
| 1293 | (1 << 21) | \ |
| 1294 | (((n) & 0xFFFFF) << 0)) |
| 1295 | |
Alex Deucher | cbfc35b | 2015-01-05 19:42:25 -0500 | [diff] [blame] | 1296 | #define DMA_SRBM_POLL_PACKET ((9 << 28) | \ |
| 1297 | (1 << 27) | \ |
| 1298 | (1 << 26)) |
| 1299 | |
| 1300 | #define DMA_SRBM_READ_PACKET ((9 << 28) | \ |
| 1301 | (1 << 27)) |
| 1302 | |
Alex Deucher | f60cbd1 | 2012-12-04 15:27:33 -0500 | [diff] [blame] | 1303 | /* async DMA Packet types */ |
| 1304 | #define DMA_PACKET_WRITE 0x2 |
| 1305 | #define DMA_PACKET_COPY 0x3 |
| 1306 | #define DMA_PACKET_INDIRECT_BUFFER 0x4 |
| 1307 | #define DMA_PACKET_SEMAPHORE 0x5 |
| 1308 | #define DMA_PACKET_FENCE 0x6 |
| 1309 | #define DMA_PACKET_TRAP 0x7 |
| 1310 | #define DMA_PACKET_SRBM_WRITE 0x9 |
| 1311 | #define DMA_PACKET_CONSTANT_FILL 0xd |
| 1312 | #define DMA_PACKET_NOP 0xf |
| 1313 | |
Alex Deucher | 0af62b0 | 2011-01-06 21:19:31 -0500 | [diff] [blame] | 1314 | #endif |