evergreend.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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 EVERGREEND_H
  25. #define EVERGREEND_H
  26. #define EVERGREEN_MAX_SH_GPRS 256
  27. #define EVERGREEN_MAX_TEMP_GPRS 16
  28. #define EVERGREEN_MAX_SH_THREADS 256
  29. #define EVERGREEN_MAX_SH_STACK_ENTRIES 4096
  30. #define EVERGREEN_MAX_FRC_EOV_CNT 16384
  31. #define EVERGREEN_MAX_BACKENDS 8
  32. #define EVERGREEN_MAX_BACKENDS_MASK 0xFF
  33. #define EVERGREEN_MAX_SIMDS 16
  34. #define EVERGREEN_MAX_SIMDS_MASK 0xFFFF
  35. #define EVERGREEN_MAX_PIPES 8
  36. #define EVERGREEN_MAX_PIPES_MASK 0xFF
  37. #define EVERGREEN_MAX_LDS_NUM 0xFFFF
  38. /* Registers */
  39. #define RCU_IND_INDEX 0x100
  40. #define RCU_IND_DATA 0x104
  41. #define GRBM_GFX_INDEX 0x802C
  42. #define INSTANCE_INDEX(x) ((x) << 0)
  43. #define SE_INDEX(x) ((x) << 16)
  44. #define INSTANCE_BROADCAST_WRITES (1 << 30)
  45. #define SE_BROADCAST_WRITES (1 << 31)
  46. #define RLC_GFX_INDEX 0x3fC4
  47. #define CC_GC_SHADER_PIPE_CONFIG 0x8950
  48. #define WRITE_DIS (1 << 0)
  49. #define CC_RB_BACKEND_DISABLE 0x98F4
  50. #define BACKEND_DISABLE(x) ((x) << 16)
  51. #define GB_ADDR_CONFIG 0x98F8
  52. #define NUM_PIPES(x) ((x) << 0)
  53. #define PIPE_INTERLEAVE_SIZE(x) ((x) << 4)
  54. #define BANK_INTERLEAVE_SIZE(x) ((x) << 8)
  55. #define NUM_SHADER_ENGINES(x) ((x) << 12)
  56. #define SHADER_ENGINE_TILE_SIZE(x) ((x) << 16)
  57. #define NUM_GPUS(x) ((x) << 20)
  58. #define MULTI_GPU_TILE_SIZE(x) ((x) << 24)
  59. #define ROW_SIZE(x) ((x) << 28)
  60. #define GB_BACKEND_MAP 0x98FC
  61. #define DMIF_ADDR_CONFIG 0xBD4
  62. #define HDP_ADDR_CONFIG 0x2F48
  63. #define CC_SYS_RB_BACKEND_DISABLE 0x3F88
  64. #define GC_USER_RB_BACKEND_DISABLE 0x9B7C
  65. #define CGTS_SYS_TCC_DISABLE 0x3F90
  66. #define CGTS_TCC_DISABLE 0x9148
  67. #define CGTS_USER_SYS_TCC_DISABLE 0x3F94
  68. #define CGTS_USER_TCC_DISABLE 0x914C
  69. #define CONFIG_MEMSIZE 0x5428
  70. #define CP_ME_CNTL 0x86D8
  71. #define CP_ME_HALT (1 << 28)
  72. #define CP_PFP_HALT (1 << 26)
  73. #define CP_ME_RAM_DATA 0xC160
  74. #define CP_ME_RAM_RADDR 0xC158
  75. #define CP_ME_RAM_WADDR 0xC15C
  76. #define CP_MEQ_THRESHOLDS 0x8764
  77. #define STQ_SPLIT(x) ((x) << 0)
  78. #define CP_PERFMON_CNTL 0x87FC
  79. #define CP_PFP_UCODE_ADDR 0xC150
  80. #define CP_PFP_UCODE_DATA 0xC154
  81. #define CP_QUEUE_THRESHOLDS 0x8760
  82. #define ROQ_IB1_START(x) ((x) << 0)
  83. #define ROQ_IB2_START(x) ((x) << 8)
  84. #define CP_RB_BASE 0xC100
  85. #define CP_RB_CNTL 0xC104
  86. #define RB_BUFSZ(x) ((x) << 0)
  87. #define RB_BLKSZ(x) ((x) << 8)
  88. #define RB_NO_UPDATE (1 << 27)
  89. #define RB_RPTR_WR_ENA (1 << 31)
  90. #define BUF_SWAP_32BIT (2 << 16)
  91. #define CP_RB_RPTR 0x8700
  92. #define CP_RB_RPTR_ADDR 0xC10C
  93. #define CP_RB_RPTR_ADDR_HI 0xC110
  94. #define CP_RB_RPTR_WR 0xC108
  95. #define CP_RB_WPTR 0xC114
  96. #define CP_RB_WPTR_ADDR 0xC118
  97. #define CP_RB_WPTR_ADDR_HI 0xC11C
  98. #define CP_RB_WPTR_DELAY 0x8704
  99. #define CP_SEM_WAIT_TIMER 0x85BC
  100. #define CP_DEBUG 0xC1FC
  101. #define GC_USER_SHADER_PIPE_CONFIG 0x8954
  102. #define INACTIVE_QD_PIPES(x) ((x) << 8)
  103. #define INACTIVE_QD_PIPES_MASK 0x0000FF00
  104. #define INACTIVE_SIMDS(x) ((x) << 16)
  105. #define INACTIVE_SIMDS_MASK 0x00FF0000
  106. #define GRBM_CNTL 0x8000
  107. #define GRBM_READ_TIMEOUT(x) ((x) << 0)
  108. #define GRBM_SOFT_RESET 0x8020
  109. #define SOFT_RESET_CP (1 << 0)
  110. #define SOFT_RESET_CB (1 << 1)
  111. #define SOFT_RESET_DB (1 << 3)
  112. #define SOFT_RESET_PA (1 << 5)
  113. #define SOFT_RESET_SC (1 << 6)
  114. #define SOFT_RESET_SPI (1 << 8)
  115. #define SOFT_RESET_SH (1 << 9)
  116. #define SOFT_RESET_SX (1 << 10)
  117. #define SOFT_RESET_TC (1 << 11)
  118. #define SOFT_RESET_TA (1 << 12)
  119. #define SOFT_RESET_VC (1 << 13)
  120. #define SOFT_RESET_VGT (1 << 14)
  121. #define GRBM_STATUS 0x8010
  122. #define CMDFIFO_AVAIL_MASK 0x0000000F
  123. #define SRBM_RQ_PENDING (1 << 5)
  124. #define CF_RQ_PENDING (1 << 7)
  125. #define PF_RQ_PENDING (1 << 8)
  126. #define GRBM_EE_BUSY (1 << 10)
  127. #define SX_CLEAN (1 << 11)
  128. #define DB_CLEAN (1 << 12)
  129. #define CB_CLEAN (1 << 13)
  130. #define TA_BUSY (1 << 14)
  131. #define VGT_BUSY_NO_DMA (1 << 16)
  132. #define VGT_BUSY (1 << 17)
  133. #define SX_BUSY (1 << 20)
  134. #define SH_BUSY (1 << 21)
  135. #define SPI_BUSY (1 << 22)
  136. #define SC_BUSY (1 << 24)
  137. #define PA_BUSY (1 << 25)
  138. #define DB_BUSY (1 << 26)
  139. #define CP_COHERENCY_BUSY (1 << 28)
  140. #define CP_BUSY (1 << 29)
  141. #define CB_BUSY (1 << 30)
  142. #define GUI_ACTIVE (1 << 31)
  143. #define GRBM_STATUS_SE0 0x8014
  144. #define GRBM_STATUS_SE1 0x8018
  145. #define SE_SX_CLEAN (1 << 0)
  146. #define SE_DB_CLEAN (1 << 1)
  147. #define SE_CB_CLEAN (1 << 2)
  148. #define SE_TA_BUSY (1 << 25)
  149. #define SE_SX_BUSY (1 << 26)
  150. #define SE_SPI_BUSY (1 << 27)
  151. #define SE_SH_BUSY (1 << 28)
  152. #define SE_SC_BUSY (1 << 29)
  153. #define SE_DB_BUSY (1 << 30)
  154. #define SE_CB_BUSY (1 << 31)
  155. #define HDP_HOST_PATH_CNTL 0x2C00
  156. #define HDP_NONSURFACE_BASE 0x2C04
  157. #define HDP_NONSURFACE_INFO 0x2C08
  158. #define HDP_NONSURFACE_SIZE 0x2C0C
  159. #define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0
  160. #define HDP_TILING_CONFIG 0x2F3C
  161. #define MC_SHARED_CHMAP 0x2004
  162. #define NOOFCHAN_SHIFT 12
  163. #define NOOFCHAN_MASK 0x00003000
  164. #define MC_ARB_RAMCFG 0x2760
  165. #define NOOFBANK_SHIFT 0
  166. #define NOOFBANK_MASK 0x00000003
  167. #define NOOFRANK_SHIFT 2
  168. #define NOOFRANK_MASK 0x00000004
  169. #define NOOFROWS_SHIFT 3
  170. #define NOOFROWS_MASK 0x00000038
  171. #define NOOFCOLS_SHIFT 6
  172. #define NOOFCOLS_MASK 0x000000C0
  173. #define CHANSIZE_SHIFT 8
  174. #define CHANSIZE_MASK 0x00000100
  175. #define BURSTLENGTH_SHIFT 9
  176. #define BURSTLENGTH_MASK 0x00000200
  177. #define CHANSIZE_OVERRIDE (1 << 11)
  178. #define MC_VM_AGP_TOP 0x2028
  179. #define MC_VM_AGP_BOT 0x202C
  180. #define MC_VM_AGP_BASE 0x2030
  181. #define MC_VM_FB_LOCATION 0x2024
  182. #define MC_VM_MB_L1_TLB0_CNTL 0x2234
  183. #define MC_VM_MB_L1_TLB1_CNTL 0x2238
  184. #define MC_VM_MB_L1_TLB2_CNTL 0x223C
  185. #define MC_VM_MB_L1_TLB3_CNTL 0x2240
  186. #define ENABLE_L1_TLB (1 << 0)
  187. #define ENABLE_L1_FRAGMENT_PROCESSING (1 << 1)
  188. #define SYSTEM_ACCESS_MODE_PA_ONLY (0 << 3)
  189. #define SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 3)
  190. #define SYSTEM_ACCESS_MODE_IN_SYS (2 << 3)
  191. #define SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 3)
  192. #define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 5)
  193. #define EFFECTIVE_L1_TLB_SIZE(x) ((x)<<15)
  194. #define EFFECTIVE_L1_QUEUE_SIZE(x) ((x)<<18)
  195. #define MC_VM_MD_L1_TLB0_CNTL 0x2654
  196. #define MC_VM_MD_L1_TLB1_CNTL 0x2658
  197. #define MC_VM_MD_L1_TLB2_CNTL 0x265C
  198. #define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C
  199. #define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038
  200. #define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034
  201. #define PA_CL_ENHANCE 0x8A14
  202. #define CLIP_VTX_REORDER_ENA (1 << 0)
  203. #define NUM_CLIP_SEQ(x) ((x) << 1)
  204. #define PA_SC_AA_CONFIG 0x28C04
  205. #define PA_SC_CLIPRECT_RULE 0x2820C
  206. #define PA_SC_EDGERULE 0x28230
  207. #define PA_SC_FIFO_SIZE 0x8BCC
  208. #define SC_PRIM_FIFO_SIZE(x) ((x) << 0)
  209. #define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 12)
  210. #define SC_EARLYZ_TILE_FIFO_SIZE(x) ((x) << 20)
  211. #define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24
  212. #define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0)
  213. #define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16)
  214. #define PA_SC_LINE_STIPPLE 0x28A0C
  215. #define PA_SC_LINE_STIPPLE_STATE 0x8B10
  216. #define SCRATCH_REG0 0x8500
  217. #define SCRATCH_REG1 0x8504
  218. #define SCRATCH_REG2 0x8508
  219. #define SCRATCH_REG3 0x850C
  220. #define SCRATCH_REG4 0x8510
  221. #define SCRATCH_REG5 0x8514
  222. #define SCRATCH_REG6 0x8518
  223. #define SCRATCH_REG7 0x851C
  224. #define SCRATCH_UMSK 0x8540
  225. #define SCRATCH_ADDR 0x8544
  226. #define SMX_DC_CTL0 0xA020
  227. #define USE_HASH_FUNCTION (1 << 0)
  228. #define NUMBER_OF_SETS(x) ((x) << 1)
  229. #define FLUSH_ALL_ON_EVENT (1 << 10)
  230. #define STALL_ON_EVENT (1 << 11)
  231. #define SMX_EVENT_CTL 0xA02C
  232. #define ES_FLUSH_CTL(x) ((x) << 0)
  233. #define GS_FLUSH_CTL(x) ((x) << 3)
  234. #define ACK_FLUSH_CTL(x) ((x) << 6)
  235. #define SYNC_FLUSH_CTL (1 << 8)
  236. #define SPI_CONFIG_CNTL 0x9100
  237. #define GPR_WRITE_PRIORITY(x) ((x) << 0)
  238. #define SPI_CONFIG_CNTL_1 0x913C
  239. #define VTX_DONE_DELAY(x) ((x) << 0)
  240. #define INTERP_ONE_PRIM_PER_ROW (1 << 4)
  241. #define SPI_INPUT_Z 0x286D8
  242. #define SPI_PS_IN_CONTROL_0 0x286CC
  243. #define NUM_INTERP(x) ((x)<<0)
  244. #define POSITION_ENA (1<<8)
  245. #define POSITION_CENTROID (1<<9)
  246. #define POSITION_ADDR(x) ((x)<<10)
  247. #define PARAM_GEN(x) ((x)<<15)
  248. #define PARAM_GEN_ADDR(x) ((x)<<19)
  249. #define BARYC_SAMPLE_CNTL(x) ((x)<<26)
  250. #define PERSP_GRADIENT_ENA (1<<28)
  251. #define LINEAR_GRADIENT_ENA (1<<29)
  252. #define POSITION_SAMPLE (1<<30)
  253. #define BARYC_AT_SAMPLE_ENA (1<<31)
  254. #define SQ_CONFIG 0x8C00
  255. #define VC_ENABLE (1 << 0)
  256. #define EXPORT_SRC_C (1 << 1)
  257. #define CS_PRIO(x) ((x) << 18)
  258. #define LS_PRIO(x) ((x) << 20)
  259. #define HS_PRIO(x) ((x) << 22)
  260. #define PS_PRIO(x) ((x) << 24)
  261. #define VS_PRIO(x) ((x) << 26)
  262. #define GS_PRIO(x) ((x) << 28)
  263. #define ES_PRIO(x) ((x) << 30)
  264. #define SQ_GPR_RESOURCE_MGMT_1 0x8C04
  265. #define NUM_PS_GPRS(x) ((x) << 0)
  266. #define NUM_VS_GPRS(x) ((x) << 16)
  267. #define NUM_CLAUSE_TEMP_GPRS(x) ((x) << 28)
  268. #define SQ_GPR_RESOURCE_MGMT_2 0x8C08
  269. #define NUM_GS_GPRS(x) ((x) << 0)
  270. #define NUM_ES_GPRS(x) ((x) << 16)
  271. #define SQ_GPR_RESOURCE_MGMT_3 0x8C0C
  272. #define NUM_HS_GPRS(x) ((x) << 0)
  273. #define NUM_LS_GPRS(x) ((x) << 16)
  274. #define SQ_THREAD_RESOURCE_MGMT 0x8C18
  275. #define NUM_PS_THREADS(x) ((x) << 0)
  276. #define NUM_VS_THREADS(x) ((x) << 8)
  277. #define NUM_GS_THREADS(x) ((x) << 16)
  278. #define NUM_ES_THREADS(x) ((x) << 24)
  279. #define SQ_THREAD_RESOURCE_MGMT_2 0x8C1C
  280. #define NUM_HS_THREADS(x) ((x) << 0)
  281. #define NUM_LS_THREADS(x) ((x) << 8)
  282. #define SQ_STACK_RESOURCE_MGMT_1 0x8C20
  283. #define NUM_PS_STACK_ENTRIES(x) ((x) << 0)
  284. #define NUM_VS_STACK_ENTRIES(x) ((x) << 16)
  285. #define SQ_STACK_RESOURCE_MGMT_2 0x8C24
  286. #define NUM_GS_STACK_ENTRIES(x) ((x) << 0)
  287. #define NUM_ES_STACK_ENTRIES(x) ((x) << 16)
  288. #define SQ_STACK_RESOURCE_MGMT_3 0x8C28
  289. #define NUM_HS_STACK_ENTRIES(x) ((x) << 0)
  290. #define NUM_LS_STACK_ENTRIES(x) ((x) << 16)
  291. #define SQ_DYN_GPR_CNTL_PS_FLUSH_REQ 0x8D8C
  292. #define SQ_LDS_RESOURCE_MGMT 0x8E2C
  293. #define SQ_MS_FIFO_SIZES 0x8CF0
  294. #define CACHE_FIFO_SIZE(x) ((x) << 0)
  295. #define FETCH_FIFO_HIWATER(x) ((x) << 8)
  296. #define DONE_FIFO_HIWATER(x) ((x) << 16)
  297. #define ALU_UPDATE_FIFO_HIWATER(x) ((x) << 24)
  298. #define SX_DEBUG_1 0x9058
  299. #define ENABLE_NEW_SMX_ADDRESS (1 << 16)
  300. #define SX_EXPORT_BUFFER_SIZES 0x900C
  301. #define COLOR_BUFFER_SIZE(x) ((x) << 0)
  302. #define POSITION_BUFFER_SIZE(x) ((x) << 8)
  303. #define SMX_BUFFER_SIZE(x) ((x) << 16)
  304. #define SX_MISC 0x28350
  305. #define CB_PERF_CTR0_SEL_0 0x9A20
  306. #define CB_PERF_CTR0_SEL_1 0x9A24
  307. #define CB_PERF_CTR1_SEL_0 0x9A28
  308. #define CB_PERF_CTR1_SEL_1 0x9A2C
  309. #define CB_PERF_CTR2_SEL_0 0x9A30
  310. #define CB_PERF_CTR2_SEL_1 0x9A34
  311. #define CB_PERF_CTR3_SEL_0 0x9A38
  312. #define CB_PERF_CTR3_SEL_1 0x9A3C
  313. #define TA_CNTL_AUX 0x9508
  314. #define DISABLE_CUBE_WRAP (1 << 0)
  315. #define DISABLE_CUBE_ANISO (1 << 1)
  316. #define SYNC_GRADIENT (1 << 24)
  317. #define SYNC_WALKER (1 << 25)
  318. #define SYNC_ALIGNER (1 << 26)
  319. #define VGT_CACHE_INVALIDATION 0x88C4
  320. #define CACHE_INVALIDATION(x) ((x) << 0)
  321. #define VC_ONLY 0
  322. #define TC_ONLY 1
  323. #define VC_AND_TC 2
  324. #define AUTO_INVLD_EN(x) ((x) << 6)
  325. #define NO_AUTO 0
  326. #define ES_AUTO 1
  327. #define GS_AUTO 2
  328. #define ES_AND_GS_AUTO 3
  329. #define VGT_GS_VERTEX_REUSE 0x88D4
  330. #define VGT_NUM_INSTANCES 0x8974
  331. #define VGT_OUT_DEALLOC_CNTL 0x28C5C
  332. #define DEALLOC_DIST_MASK 0x0000007F
  333. #define VGT_VERTEX_REUSE_BLOCK_CNTL 0x28C58
  334. #define VTX_REUSE_DEPTH_MASK 0x000000FF
  335. #define VM_CONTEXT0_CNTL 0x1410
  336. #define ENABLE_CONTEXT (1 << 0)
  337. #define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1)
  338. #define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4)
  339. #define VM_CONTEXT1_CNTL 0x1414
  340. #define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x153C
  341. #define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x157C
  342. #define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x155C
  343. #define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1518
  344. #define VM_CONTEXT0_REQUEST_RESPONSE 0x1470
  345. #define REQUEST_TYPE(x) (((x) & 0xf) << 0)
  346. #define RESPONSE_TYPE_MASK 0x000000F0
  347. #define RESPONSE_TYPE_SHIFT 4
  348. #define VM_L2_CNTL 0x1400
  349. #define ENABLE_L2_CACHE (1 << 0)
  350. #define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1)
  351. #define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9)
  352. #define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 14)
  353. #define VM_L2_CNTL2 0x1404
  354. #define INVALIDATE_ALL_L1_TLBS (1 << 0)
  355. #define INVALIDATE_L2_CACHE (1 << 1)
  356. #define VM_L2_CNTL3 0x1408
  357. #define BANK_SELECT(x) ((x) << 0)
  358. #define CACHE_UPDATE_MODE(x) ((x) << 6)
  359. #define VM_L2_STATUS 0x140C
  360. #define L2_BUSY (1 << 0)
  361. #define WAIT_UNTIL 0x8040
  362. #define SRBM_STATUS 0x0E50
  363. #define SRBM_SOFT_RESET 0x0E60
  364. #define SRBM_SOFT_RESET_ALL_MASK 0x00FEEFA6
  365. #define SOFT_RESET_BIF (1 << 1)
  366. #define SOFT_RESET_CG (1 << 2)
  367. #define SOFT_RESET_DC (1 << 5)
  368. #define SOFT_RESET_GRBM (1 << 8)
  369. #define SOFT_RESET_HDP (1 << 9)
  370. #define SOFT_RESET_IH (1 << 10)
  371. #define SOFT_RESET_MC (1 << 11)
  372. #define SOFT_RESET_RLC (1 << 13)
  373. #define SOFT_RESET_ROM (1 << 14)
  374. #define SOFT_RESET_SEM (1 << 15)
  375. #define SOFT_RESET_VMC (1 << 17)
  376. #define SOFT_RESET_TST (1 << 21)
  377. #define SOFT_RESET_REGBB (1 << 22)
  378. #define SOFT_RESET_ORB (1 << 23)
  379. #define IH_RB_CNTL 0x3e00
  380. # define IH_RB_ENABLE (1 << 0)
  381. # define IH_IB_SIZE(x) ((x) << 1) /* log2 */
  382. # define IH_RB_FULL_DRAIN_ENABLE (1 << 6)
  383. # define IH_WPTR_WRITEBACK_ENABLE (1 << 8)
  384. # define IH_WPTR_WRITEBACK_TIMER(x) ((x) << 9) /* log2 */
  385. # define IH_WPTR_OVERFLOW_ENABLE (1 << 16)
  386. # define IH_WPTR_OVERFLOW_CLEAR (1 << 31)
  387. #define IH_RB_BASE 0x3e04
  388. #define IH_RB_RPTR 0x3e08
  389. #define IH_RB_WPTR 0x3e0c
  390. # define RB_OVERFLOW (1 << 0)
  391. # define WPTR_OFFSET_MASK 0x3fffc
  392. #define IH_RB_WPTR_ADDR_HI 0x3e10
  393. #define IH_RB_WPTR_ADDR_LO 0x3e14
  394. #define IH_CNTL 0x3e18
  395. # define ENABLE_INTR (1 << 0)
  396. # define IH_MC_SWAP(x) ((x) << 2)
  397. # define IH_MC_SWAP_NONE 0
  398. # define IH_MC_SWAP_16BIT 1
  399. # define IH_MC_SWAP_32BIT 2
  400. # define IH_MC_SWAP_64BIT 3
  401. # define RPTR_REARM (1 << 4)
  402. # define MC_WRREQ_CREDIT(x) ((x) << 15)
  403. # define MC_WR_CLEAN_CNT(x) ((x) << 20)
  404. #define CP_INT_CNTL 0xc124
  405. # define CNTX_BUSY_INT_ENABLE (1 << 19)
  406. # define CNTX_EMPTY_INT_ENABLE (1 << 20)
  407. # define SCRATCH_INT_ENABLE (1 << 25)
  408. # define TIME_STAMP_INT_ENABLE (1 << 26)
  409. # define IB2_INT_ENABLE (1 << 29)
  410. # define IB1_INT_ENABLE (1 << 30)
  411. # define RB_INT_ENABLE (1 << 31)
  412. #define CP_INT_STATUS 0xc128
  413. # define SCRATCH_INT_STAT (1 << 25)
  414. # define TIME_STAMP_INT_STAT (1 << 26)
  415. # define IB2_INT_STAT (1 << 29)
  416. # define IB1_INT_STAT (1 << 30)
  417. # define RB_INT_STAT (1 << 31)
  418. #define GRBM_INT_CNTL 0x8060
  419. # define RDERR_INT_ENABLE (1 << 0)
  420. # define GUI_IDLE_INT_ENABLE (1 << 19)
  421. /* 0x6e98, 0x7a98, 0x10698, 0x11298, 0x11e98, 0x12a98 */
  422. #define CRTC_STATUS_FRAME_COUNT 0x6e98
  423. /* 0x6bb8, 0x77b8, 0x103b8, 0x10fb8, 0x11bb8, 0x127b8 */
  424. #define VLINE_STATUS 0x6bb8
  425. # define VLINE_OCCURRED (1 << 0)
  426. # define VLINE_ACK (1 << 4)
  427. # define VLINE_STAT (1 << 12)
  428. # define VLINE_INTERRUPT (1 << 16)
  429. # define VLINE_INTERRUPT_TYPE (1 << 17)
  430. /* 0x6bbc, 0x77bc, 0x103bc, 0x10fbc, 0x11bbc, 0x127bc */
  431. #define VBLANK_STATUS 0x6bbc
  432. # define VBLANK_OCCURRED (1 << 0)
  433. # define VBLANK_ACK (1 << 4)
  434. # define VBLANK_STAT (1 << 12)
  435. # define VBLANK_INTERRUPT (1 << 16)
  436. # define VBLANK_INTERRUPT_TYPE (1 << 17)
  437. /* 0x6b40, 0x7740, 0x10340, 0x10f40, 0x11b40, 0x12740 */
  438. #define INT_MASK 0x6b40
  439. # define VBLANK_INT_MASK (1 << 0)
  440. # define VLINE_INT_MASK (1 << 4)
  441. #define DISP_INTERRUPT_STATUS 0x60f4
  442. # define LB_D1_VLINE_INTERRUPT (1 << 2)
  443. # define LB_D1_VBLANK_INTERRUPT (1 << 3)
  444. # define DC_HPD1_INTERRUPT (1 << 17)
  445. # define DC_HPD1_RX_INTERRUPT (1 << 18)
  446. # define DACA_AUTODETECT_INTERRUPT (1 << 22)
  447. # define DACB_AUTODETECT_INTERRUPT (1 << 23)
  448. # define DC_I2C_SW_DONE_INTERRUPT (1 << 24)
  449. # define DC_I2C_HW_DONE_INTERRUPT (1 << 25)
  450. #define DISP_INTERRUPT_STATUS_CONTINUE 0x60f8
  451. # define LB_D2_VLINE_INTERRUPT (1 << 2)
  452. # define LB_D2_VBLANK_INTERRUPT (1 << 3)
  453. # define DC_HPD2_INTERRUPT (1 << 17)
  454. # define DC_HPD2_RX_INTERRUPT (1 << 18)
  455. # define DISP_TIMER_INTERRUPT (1 << 24)
  456. #define DISP_INTERRUPT_STATUS_CONTINUE2 0x60fc
  457. # define LB_D3_VLINE_INTERRUPT (1 << 2)
  458. # define LB_D3_VBLANK_INTERRUPT (1 << 3)
  459. # define DC_HPD3_INTERRUPT (1 << 17)
  460. # define DC_HPD3_RX_INTERRUPT (1 << 18)
  461. #define DISP_INTERRUPT_STATUS_CONTINUE3 0x6100
  462. # define LB_D4_VLINE_INTERRUPT (1 << 2)
  463. # define LB_D4_VBLANK_INTERRUPT (1 << 3)
  464. # define DC_HPD4_INTERRUPT (1 << 17)
  465. # define DC_HPD4_RX_INTERRUPT (1 << 18)
  466. #define DISP_INTERRUPT_STATUS_CONTINUE4 0x614c
  467. # define LB_D5_VLINE_INTERRUPT (1 << 2)
  468. # define LB_D5_VBLANK_INTERRUPT (1 << 3)
  469. # define DC_HPD5_INTERRUPT (1 << 17)
  470. # define DC_HPD5_RX_INTERRUPT (1 << 18)
  471. #define DISP_INTERRUPT_STATUS_CONTINUE5 0x6050
  472. # define LB_D6_VLINE_INTERRUPT (1 << 2)
  473. # define LB_D6_VBLANK_INTERRUPT (1 << 3)
  474. # define DC_HPD6_INTERRUPT (1 << 17)
  475. # define DC_HPD6_RX_INTERRUPT (1 << 18)
  476. /* 0x6858, 0x7458, 0x10058, 0x10c58, 0x11858, 0x12458 */
  477. #define GRPH_INT_STATUS 0x6858
  478. # define GRPH_PFLIP_INT_OCCURRED (1 << 0)
  479. # define GRPH_PFLIP_INT_CLEAR (1 << 8)
  480. /* 0x685c, 0x745c, 0x1005c, 0x10c5c, 0x1185c, 0x1245c */
  481. #define GRPH_INT_CONTROL 0x685c
  482. # define GRPH_PFLIP_INT_MASK (1 << 0)
  483. # define GRPH_PFLIP_INT_TYPE (1 << 8)
  484. #define DACA_AUTODETECT_INT_CONTROL 0x66c8
  485. #define DACB_AUTODETECT_INT_CONTROL 0x67c8
  486. #define DC_HPD1_INT_STATUS 0x601c
  487. #define DC_HPD2_INT_STATUS 0x6028
  488. #define DC_HPD3_INT_STATUS 0x6034
  489. #define DC_HPD4_INT_STATUS 0x6040
  490. #define DC_HPD5_INT_STATUS 0x604c
  491. #define DC_HPD6_INT_STATUS 0x6058
  492. # define DC_HPDx_INT_STATUS (1 << 0)
  493. # define DC_HPDx_SENSE (1 << 1)
  494. # define DC_HPDx_RX_INT_STATUS (1 << 8)
  495. #define DC_HPD1_INT_CONTROL 0x6020
  496. #define DC_HPD2_INT_CONTROL 0x602c
  497. #define DC_HPD3_INT_CONTROL 0x6038
  498. #define DC_HPD4_INT_CONTROL 0x6044
  499. #define DC_HPD5_INT_CONTROL 0x6050
  500. #define DC_HPD6_INT_CONTROL 0x605c
  501. # define DC_HPDx_INT_ACK (1 << 0)
  502. # define DC_HPDx_INT_POLARITY (1 << 8)
  503. # define DC_HPDx_INT_EN (1 << 16)
  504. # define DC_HPDx_RX_INT_ACK (1 << 20)
  505. # define DC_HPDx_RX_INT_EN (1 << 24)
  506. #define DC_HPD1_CONTROL 0x6024
  507. #define DC_HPD2_CONTROL 0x6030
  508. #define DC_HPD3_CONTROL 0x603c
  509. #define DC_HPD4_CONTROL 0x6048
  510. #define DC_HPD5_CONTROL 0x6054
  511. #define DC_HPD6_CONTROL 0x6060
  512. # define DC_HPDx_CONNECTION_TIMER(x) ((x) << 0)
  513. # define DC_HPDx_RX_INT_TIMER(x) ((x) << 16)
  514. # define DC_HPDx_EN (1 << 28)
  515. #endif