evergreend.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023
  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 MSAA_NUM_SAMPLES_SHIFT 0
  206. #define MSAA_NUM_SAMPLES_MASK 0x3
  207. #define PA_SC_CLIPRECT_RULE 0x2820C
  208. #define PA_SC_EDGERULE 0x28230
  209. #define PA_SC_FIFO_SIZE 0x8BCC
  210. #define SC_PRIM_FIFO_SIZE(x) ((x) << 0)
  211. #define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 12)
  212. #define SC_EARLYZ_TILE_FIFO_SIZE(x) ((x) << 20)
  213. #define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24
  214. #define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0)
  215. #define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16)
  216. #define PA_SC_LINE_STIPPLE 0x28A0C
  217. #define PA_SC_LINE_STIPPLE_STATE 0x8B10
  218. #define SCRATCH_REG0 0x8500
  219. #define SCRATCH_REG1 0x8504
  220. #define SCRATCH_REG2 0x8508
  221. #define SCRATCH_REG3 0x850C
  222. #define SCRATCH_REG4 0x8510
  223. #define SCRATCH_REG5 0x8514
  224. #define SCRATCH_REG6 0x8518
  225. #define SCRATCH_REG7 0x851C
  226. #define SCRATCH_UMSK 0x8540
  227. #define SCRATCH_ADDR 0x8544
  228. #define SMX_DC_CTL0 0xA020
  229. #define USE_HASH_FUNCTION (1 << 0)
  230. #define NUMBER_OF_SETS(x) ((x) << 1)
  231. #define FLUSH_ALL_ON_EVENT (1 << 10)
  232. #define STALL_ON_EVENT (1 << 11)
  233. #define SMX_EVENT_CTL 0xA02C
  234. #define ES_FLUSH_CTL(x) ((x) << 0)
  235. #define GS_FLUSH_CTL(x) ((x) << 3)
  236. #define ACK_FLUSH_CTL(x) ((x) << 6)
  237. #define SYNC_FLUSH_CTL (1 << 8)
  238. #define SPI_CONFIG_CNTL 0x9100
  239. #define GPR_WRITE_PRIORITY(x) ((x) << 0)
  240. #define SPI_CONFIG_CNTL_1 0x913C
  241. #define VTX_DONE_DELAY(x) ((x) << 0)
  242. #define INTERP_ONE_PRIM_PER_ROW (1 << 4)
  243. #define SPI_INPUT_Z 0x286D8
  244. #define SPI_PS_IN_CONTROL_0 0x286CC
  245. #define NUM_INTERP(x) ((x)<<0)
  246. #define POSITION_ENA (1<<8)
  247. #define POSITION_CENTROID (1<<9)
  248. #define POSITION_ADDR(x) ((x)<<10)
  249. #define PARAM_GEN(x) ((x)<<15)
  250. #define PARAM_GEN_ADDR(x) ((x)<<19)
  251. #define BARYC_SAMPLE_CNTL(x) ((x)<<26)
  252. #define PERSP_GRADIENT_ENA (1<<28)
  253. #define LINEAR_GRADIENT_ENA (1<<29)
  254. #define POSITION_SAMPLE (1<<30)
  255. #define BARYC_AT_SAMPLE_ENA (1<<31)
  256. #define SQ_CONFIG 0x8C00
  257. #define VC_ENABLE (1 << 0)
  258. #define EXPORT_SRC_C (1 << 1)
  259. #define CS_PRIO(x) ((x) << 18)
  260. #define LS_PRIO(x) ((x) << 20)
  261. #define HS_PRIO(x) ((x) << 22)
  262. #define PS_PRIO(x) ((x) << 24)
  263. #define VS_PRIO(x) ((x) << 26)
  264. #define GS_PRIO(x) ((x) << 28)
  265. #define ES_PRIO(x) ((x) << 30)
  266. #define SQ_GPR_RESOURCE_MGMT_1 0x8C04
  267. #define NUM_PS_GPRS(x) ((x) << 0)
  268. #define NUM_VS_GPRS(x) ((x) << 16)
  269. #define NUM_CLAUSE_TEMP_GPRS(x) ((x) << 28)
  270. #define SQ_GPR_RESOURCE_MGMT_2 0x8C08
  271. #define NUM_GS_GPRS(x) ((x) << 0)
  272. #define NUM_ES_GPRS(x) ((x) << 16)
  273. #define SQ_GPR_RESOURCE_MGMT_3 0x8C0C
  274. #define NUM_HS_GPRS(x) ((x) << 0)
  275. #define NUM_LS_GPRS(x) ((x) << 16)
  276. #define SQ_THREAD_RESOURCE_MGMT 0x8C18
  277. #define NUM_PS_THREADS(x) ((x) << 0)
  278. #define NUM_VS_THREADS(x) ((x) << 8)
  279. #define NUM_GS_THREADS(x) ((x) << 16)
  280. #define NUM_ES_THREADS(x) ((x) << 24)
  281. #define SQ_THREAD_RESOURCE_MGMT_2 0x8C1C
  282. #define NUM_HS_THREADS(x) ((x) << 0)
  283. #define NUM_LS_THREADS(x) ((x) << 8)
  284. #define SQ_STACK_RESOURCE_MGMT_1 0x8C20
  285. #define NUM_PS_STACK_ENTRIES(x) ((x) << 0)
  286. #define NUM_VS_STACK_ENTRIES(x) ((x) << 16)
  287. #define SQ_STACK_RESOURCE_MGMT_2 0x8C24
  288. #define NUM_GS_STACK_ENTRIES(x) ((x) << 0)
  289. #define NUM_ES_STACK_ENTRIES(x) ((x) << 16)
  290. #define SQ_STACK_RESOURCE_MGMT_3 0x8C28
  291. #define NUM_HS_STACK_ENTRIES(x) ((x) << 0)
  292. #define NUM_LS_STACK_ENTRIES(x) ((x) << 16)
  293. #define SQ_DYN_GPR_CNTL_PS_FLUSH_REQ 0x8D8C
  294. #define SQ_LDS_RESOURCE_MGMT 0x8E2C
  295. #define SQ_MS_FIFO_SIZES 0x8CF0
  296. #define CACHE_FIFO_SIZE(x) ((x) << 0)
  297. #define FETCH_FIFO_HIWATER(x) ((x) << 8)
  298. #define DONE_FIFO_HIWATER(x) ((x) << 16)
  299. #define ALU_UPDATE_FIFO_HIWATER(x) ((x) << 24)
  300. #define SX_DEBUG_1 0x9058
  301. #define ENABLE_NEW_SMX_ADDRESS (1 << 16)
  302. #define SX_EXPORT_BUFFER_SIZES 0x900C
  303. #define COLOR_BUFFER_SIZE(x) ((x) << 0)
  304. #define POSITION_BUFFER_SIZE(x) ((x) << 8)
  305. #define SMX_BUFFER_SIZE(x) ((x) << 16)
  306. #define SX_MISC 0x28350
  307. #define CB_PERF_CTR0_SEL_0 0x9A20
  308. #define CB_PERF_CTR0_SEL_1 0x9A24
  309. #define CB_PERF_CTR1_SEL_0 0x9A28
  310. #define CB_PERF_CTR1_SEL_1 0x9A2C
  311. #define CB_PERF_CTR2_SEL_0 0x9A30
  312. #define CB_PERF_CTR2_SEL_1 0x9A34
  313. #define CB_PERF_CTR3_SEL_0 0x9A38
  314. #define CB_PERF_CTR3_SEL_1 0x9A3C
  315. #define TA_CNTL_AUX 0x9508
  316. #define DISABLE_CUBE_WRAP (1 << 0)
  317. #define DISABLE_CUBE_ANISO (1 << 1)
  318. #define SYNC_GRADIENT (1 << 24)
  319. #define SYNC_WALKER (1 << 25)
  320. #define SYNC_ALIGNER (1 << 26)
  321. #define VGT_CACHE_INVALIDATION 0x88C4
  322. #define CACHE_INVALIDATION(x) ((x) << 0)
  323. #define VC_ONLY 0
  324. #define TC_ONLY 1
  325. #define VC_AND_TC 2
  326. #define AUTO_INVLD_EN(x) ((x) << 6)
  327. #define NO_AUTO 0
  328. #define ES_AUTO 1
  329. #define GS_AUTO 2
  330. #define ES_AND_GS_AUTO 3
  331. #define VGT_GS_VERTEX_REUSE 0x88D4
  332. #define VGT_NUM_INSTANCES 0x8974
  333. #define VGT_OUT_DEALLOC_CNTL 0x28C5C
  334. #define DEALLOC_DIST_MASK 0x0000007F
  335. #define VGT_VERTEX_REUSE_BLOCK_CNTL 0x28C58
  336. #define VTX_REUSE_DEPTH_MASK 0x000000FF
  337. #define VM_CONTEXT0_CNTL 0x1410
  338. #define ENABLE_CONTEXT (1 << 0)
  339. #define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1)
  340. #define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4)
  341. #define VM_CONTEXT1_CNTL 0x1414
  342. #define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x153C
  343. #define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x157C
  344. #define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x155C
  345. #define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1518
  346. #define VM_CONTEXT0_REQUEST_RESPONSE 0x1470
  347. #define REQUEST_TYPE(x) (((x) & 0xf) << 0)
  348. #define RESPONSE_TYPE_MASK 0x000000F0
  349. #define RESPONSE_TYPE_SHIFT 4
  350. #define VM_L2_CNTL 0x1400
  351. #define ENABLE_L2_CACHE (1 << 0)
  352. #define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1)
  353. #define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9)
  354. #define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 14)
  355. #define VM_L2_CNTL2 0x1404
  356. #define INVALIDATE_ALL_L1_TLBS (1 << 0)
  357. #define INVALIDATE_L2_CACHE (1 << 1)
  358. #define VM_L2_CNTL3 0x1408
  359. #define BANK_SELECT(x) ((x) << 0)
  360. #define CACHE_UPDATE_MODE(x) ((x) << 6)
  361. #define VM_L2_STATUS 0x140C
  362. #define L2_BUSY (1 << 0)
  363. #define WAIT_UNTIL 0x8040
  364. #define SRBM_STATUS 0x0E50
  365. #define SRBM_SOFT_RESET 0x0E60
  366. #define SRBM_SOFT_RESET_ALL_MASK 0x00FEEFA6
  367. #define SOFT_RESET_BIF (1 << 1)
  368. #define SOFT_RESET_CG (1 << 2)
  369. #define SOFT_RESET_DC (1 << 5)
  370. #define SOFT_RESET_GRBM (1 << 8)
  371. #define SOFT_RESET_HDP (1 << 9)
  372. #define SOFT_RESET_IH (1 << 10)
  373. #define SOFT_RESET_MC (1 << 11)
  374. #define SOFT_RESET_RLC (1 << 13)
  375. #define SOFT_RESET_ROM (1 << 14)
  376. #define SOFT_RESET_SEM (1 << 15)
  377. #define SOFT_RESET_VMC (1 << 17)
  378. #define SOFT_RESET_TST (1 << 21)
  379. #define SOFT_RESET_REGBB (1 << 22)
  380. #define SOFT_RESET_ORB (1 << 23)
  381. #define IH_RB_CNTL 0x3e00
  382. # define IH_RB_ENABLE (1 << 0)
  383. # define IH_IB_SIZE(x) ((x) << 1) /* log2 */
  384. # define IH_RB_FULL_DRAIN_ENABLE (1 << 6)
  385. # define IH_WPTR_WRITEBACK_ENABLE (1 << 8)
  386. # define IH_WPTR_WRITEBACK_TIMER(x) ((x) << 9) /* log2 */
  387. # define IH_WPTR_OVERFLOW_ENABLE (1 << 16)
  388. # define IH_WPTR_OVERFLOW_CLEAR (1 << 31)
  389. #define IH_RB_BASE 0x3e04
  390. #define IH_RB_RPTR 0x3e08
  391. #define IH_RB_WPTR 0x3e0c
  392. # define RB_OVERFLOW (1 << 0)
  393. # define WPTR_OFFSET_MASK 0x3fffc
  394. #define IH_RB_WPTR_ADDR_HI 0x3e10
  395. #define IH_RB_WPTR_ADDR_LO 0x3e14
  396. #define IH_CNTL 0x3e18
  397. # define ENABLE_INTR (1 << 0)
  398. # define IH_MC_SWAP(x) ((x) << 2)
  399. # define IH_MC_SWAP_NONE 0
  400. # define IH_MC_SWAP_16BIT 1
  401. # define IH_MC_SWAP_32BIT 2
  402. # define IH_MC_SWAP_64BIT 3
  403. # define RPTR_REARM (1 << 4)
  404. # define MC_WRREQ_CREDIT(x) ((x) << 15)
  405. # define MC_WR_CLEAN_CNT(x) ((x) << 20)
  406. #define CP_INT_CNTL 0xc124
  407. # define CNTX_BUSY_INT_ENABLE (1 << 19)
  408. # define CNTX_EMPTY_INT_ENABLE (1 << 20)
  409. # define SCRATCH_INT_ENABLE (1 << 25)
  410. # define TIME_STAMP_INT_ENABLE (1 << 26)
  411. # define IB2_INT_ENABLE (1 << 29)
  412. # define IB1_INT_ENABLE (1 << 30)
  413. # define RB_INT_ENABLE (1 << 31)
  414. #define CP_INT_STATUS 0xc128
  415. # define SCRATCH_INT_STAT (1 << 25)
  416. # define TIME_STAMP_INT_STAT (1 << 26)
  417. # define IB2_INT_STAT (1 << 29)
  418. # define IB1_INT_STAT (1 << 30)
  419. # define RB_INT_STAT (1 << 31)
  420. #define GRBM_INT_CNTL 0x8060
  421. # define RDERR_INT_ENABLE (1 << 0)
  422. # define GUI_IDLE_INT_ENABLE (1 << 19)
  423. /* 0x6e98, 0x7a98, 0x10698, 0x11298, 0x11e98, 0x12a98 */
  424. #define CRTC_STATUS_FRAME_COUNT 0x6e98
  425. /* 0x6bb8, 0x77b8, 0x103b8, 0x10fb8, 0x11bb8, 0x127b8 */
  426. #define VLINE_STATUS 0x6bb8
  427. # define VLINE_OCCURRED (1 << 0)
  428. # define VLINE_ACK (1 << 4)
  429. # define VLINE_STAT (1 << 12)
  430. # define VLINE_INTERRUPT (1 << 16)
  431. # define VLINE_INTERRUPT_TYPE (1 << 17)
  432. /* 0x6bbc, 0x77bc, 0x103bc, 0x10fbc, 0x11bbc, 0x127bc */
  433. #define VBLANK_STATUS 0x6bbc
  434. # define VBLANK_OCCURRED (1 << 0)
  435. # define VBLANK_ACK (1 << 4)
  436. # define VBLANK_STAT (1 << 12)
  437. # define VBLANK_INTERRUPT (1 << 16)
  438. # define VBLANK_INTERRUPT_TYPE (1 << 17)
  439. /* 0x6b40, 0x7740, 0x10340, 0x10f40, 0x11b40, 0x12740 */
  440. #define INT_MASK 0x6b40
  441. # define VBLANK_INT_MASK (1 << 0)
  442. # define VLINE_INT_MASK (1 << 4)
  443. #define DISP_INTERRUPT_STATUS 0x60f4
  444. # define LB_D1_VLINE_INTERRUPT (1 << 2)
  445. # define LB_D1_VBLANK_INTERRUPT (1 << 3)
  446. # define DC_HPD1_INTERRUPT (1 << 17)
  447. # define DC_HPD1_RX_INTERRUPT (1 << 18)
  448. # define DACA_AUTODETECT_INTERRUPT (1 << 22)
  449. # define DACB_AUTODETECT_INTERRUPT (1 << 23)
  450. # define DC_I2C_SW_DONE_INTERRUPT (1 << 24)
  451. # define DC_I2C_HW_DONE_INTERRUPT (1 << 25)
  452. #define DISP_INTERRUPT_STATUS_CONTINUE 0x60f8
  453. # define LB_D2_VLINE_INTERRUPT (1 << 2)
  454. # define LB_D2_VBLANK_INTERRUPT (1 << 3)
  455. # define DC_HPD2_INTERRUPT (1 << 17)
  456. # define DC_HPD2_RX_INTERRUPT (1 << 18)
  457. # define DISP_TIMER_INTERRUPT (1 << 24)
  458. #define DISP_INTERRUPT_STATUS_CONTINUE2 0x60fc
  459. # define LB_D3_VLINE_INTERRUPT (1 << 2)
  460. # define LB_D3_VBLANK_INTERRUPT (1 << 3)
  461. # define DC_HPD3_INTERRUPT (1 << 17)
  462. # define DC_HPD3_RX_INTERRUPT (1 << 18)
  463. #define DISP_INTERRUPT_STATUS_CONTINUE3 0x6100
  464. # define LB_D4_VLINE_INTERRUPT (1 << 2)
  465. # define LB_D4_VBLANK_INTERRUPT (1 << 3)
  466. # define DC_HPD4_INTERRUPT (1 << 17)
  467. # define DC_HPD4_RX_INTERRUPT (1 << 18)
  468. #define DISP_INTERRUPT_STATUS_CONTINUE4 0x614c
  469. # define LB_D5_VLINE_INTERRUPT (1 << 2)
  470. # define LB_D5_VBLANK_INTERRUPT (1 << 3)
  471. # define DC_HPD5_INTERRUPT (1 << 17)
  472. # define DC_HPD5_RX_INTERRUPT (1 << 18)
  473. #define DISP_INTERRUPT_STATUS_CONTINUE5 0x6050
  474. # define LB_D6_VLINE_INTERRUPT (1 << 2)
  475. # define LB_D6_VBLANK_INTERRUPT (1 << 3)
  476. # define DC_HPD6_INTERRUPT (1 << 17)
  477. # define DC_HPD6_RX_INTERRUPT (1 << 18)
  478. /* 0x6858, 0x7458, 0x10058, 0x10c58, 0x11858, 0x12458 */
  479. #define GRPH_INT_STATUS 0x6858
  480. # define GRPH_PFLIP_INT_OCCURRED (1 << 0)
  481. # define GRPH_PFLIP_INT_CLEAR (1 << 8)
  482. /* 0x685c, 0x745c, 0x1005c, 0x10c5c, 0x1185c, 0x1245c */
  483. #define GRPH_INT_CONTROL 0x685c
  484. # define GRPH_PFLIP_INT_MASK (1 << 0)
  485. # define GRPH_PFLIP_INT_TYPE (1 << 8)
  486. #define DACA_AUTODETECT_INT_CONTROL 0x66c8
  487. #define DACB_AUTODETECT_INT_CONTROL 0x67c8
  488. #define DC_HPD1_INT_STATUS 0x601c
  489. #define DC_HPD2_INT_STATUS 0x6028
  490. #define DC_HPD3_INT_STATUS 0x6034
  491. #define DC_HPD4_INT_STATUS 0x6040
  492. #define DC_HPD5_INT_STATUS 0x604c
  493. #define DC_HPD6_INT_STATUS 0x6058
  494. # define DC_HPDx_INT_STATUS (1 << 0)
  495. # define DC_HPDx_SENSE (1 << 1)
  496. # define DC_HPDx_RX_INT_STATUS (1 << 8)
  497. #define DC_HPD1_INT_CONTROL 0x6020
  498. #define DC_HPD2_INT_CONTROL 0x602c
  499. #define DC_HPD3_INT_CONTROL 0x6038
  500. #define DC_HPD4_INT_CONTROL 0x6044
  501. #define DC_HPD5_INT_CONTROL 0x6050
  502. #define DC_HPD6_INT_CONTROL 0x605c
  503. # define DC_HPDx_INT_ACK (1 << 0)
  504. # define DC_HPDx_INT_POLARITY (1 << 8)
  505. # define DC_HPDx_INT_EN (1 << 16)
  506. # define DC_HPDx_RX_INT_ACK (1 << 20)
  507. # define DC_HPDx_RX_INT_EN (1 << 24)
  508. #define DC_HPD1_CONTROL 0x6024
  509. #define DC_HPD2_CONTROL 0x6030
  510. #define DC_HPD3_CONTROL 0x603c
  511. #define DC_HPD4_CONTROL 0x6048
  512. #define DC_HPD5_CONTROL 0x6054
  513. #define DC_HPD6_CONTROL 0x6060
  514. # define DC_HPDx_CONNECTION_TIMER(x) ((x) << 0)
  515. # define DC_HPDx_RX_INT_TIMER(x) ((x) << 16)
  516. # define DC_HPDx_EN (1 << 28)
  517. /*
  518. * PM4
  519. */
  520. #define PACKET_TYPE0 0
  521. #define PACKET_TYPE1 1
  522. #define PACKET_TYPE2 2
  523. #define PACKET_TYPE3 3
  524. #define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3)
  525. #define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF)
  526. #define CP_PACKET0_GET_REG(h) (((h) & 0xFFFF) << 2)
  527. #define CP_PACKET3_GET_OPCODE(h) (((h) >> 8) & 0xFF)
  528. #define PACKET0(reg, n) ((PACKET_TYPE0 << 30) | \
  529. (((reg) >> 2) & 0xFFFF) | \
  530. ((n) & 0x3FFF) << 16)
  531. #define CP_PACKET2 0x80000000
  532. #define PACKET2_PAD_SHIFT 0
  533. #define PACKET2_PAD_MASK (0x3fffffff << 0)
  534. #define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
  535. #define PACKET3(op, n) ((PACKET_TYPE3 << 30) | \
  536. (((op) & 0xFF) << 8) | \
  537. ((n) & 0x3FFF) << 16)
  538. /* Packet 3 types */
  539. #define PACKET3_NOP 0x10
  540. #define PACKET3_SET_BASE 0x11
  541. #define PACKET3_CLEAR_STATE 0x12
  542. #define PACKET3_INDIRECT_BUFFER_SIZE 0x13
  543. #define PACKET3_DISPATCH_DIRECT 0x15
  544. #define PACKET3_DISPATCH_INDIRECT 0x16
  545. #define PACKET3_INDIRECT_BUFFER_END 0x17
  546. #define PACKET3_SET_PREDICATION 0x20
  547. #define PACKET3_REG_RMW 0x21
  548. #define PACKET3_COND_EXEC 0x22
  549. #define PACKET3_PRED_EXEC 0x23
  550. #define PACKET3_DRAW_INDIRECT 0x24
  551. #define PACKET3_DRAW_INDEX_INDIRECT 0x25
  552. #define PACKET3_INDEX_BASE 0x26
  553. #define PACKET3_DRAW_INDEX_2 0x27
  554. #define PACKET3_CONTEXT_CONTROL 0x28
  555. #define PACKET3_DRAW_INDEX_OFFSET 0x29
  556. #define PACKET3_INDEX_TYPE 0x2A
  557. #define PACKET3_DRAW_INDEX 0x2B
  558. #define PACKET3_DRAW_INDEX_AUTO 0x2D
  559. #define PACKET3_DRAW_INDEX_IMMD 0x2E
  560. #define PACKET3_NUM_INSTANCES 0x2F
  561. #define PACKET3_DRAW_INDEX_MULTI_AUTO 0x30
  562. #define PACKET3_STRMOUT_BUFFER_UPDATE 0x34
  563. #define PACKET3_DRAW_INDEX_OFFSET_2 0x35
  564. #define PACKET3_DRAW_INDEX_MULTI_ELEMENT 0x36
  565. #define PACKET3_MEM_SEMAPHORE 0x39
  566. #define PACKET3_MPEG_INDEX 0x3A
  567. #define PACKET3_WAIT_REG_MEM 0x3C
  568. #define PACKET3_MEM_WRITE 0x3D
  569. #define PACKET3_INDIRECT_BUFFER 0x32
  570. #define PACKET3_SURFACE_SYNC 0x43
  571. # define PACKET3_CB0_DEST_BASE_ENA (1 << 6)
  572. # define PACKET3_CB1_DEST_BASE_ENA (1 << 7)
  573. # define PACKET3_CB2_DEST_BASE_ENA (1 << 8)
  574. # define PACKET3_CB3_DEST_BASE_ENA (1 << 9)
  575. # define PACKET3_CB4_DEST_BASE_ENA (1 << 10)
  576. # define PACKET3_CB5_DEST_BASE_ENA (1 << 11)
  577. # define PACKET3_CB6_DEST_BASE_ENA (1 << 12)
  578. # define PACKET3_CB7_DEST_BASE_ENA (1 << 13)
  579. # define PACKET3_DB_DEST_BASE_ENA (1 << 14)
  580. # define PACKET3_CB8_DEST_BASE_ENA (1 << 15)
  581. # define PACKET3_CB9_DEST_BASE_ENA (1 << 16)
  582. # define PACKET3_CB10_DEST_BASE_ENA (1 << 17)
  583. # define PACKET3_CB11_DEST_BASE_ENA (1 << 17)
  584. # define PACKET3_FULL_CACHE_ENA (1 << 20)
  585. # define PACKET3_TC_ACTION_ENA (1 << 23)
  586. # define PACKET3_VC_ACTION_ENA (1 << 24)
  587. # define PACKET3_CB_ACTION_ENA (1 << 25)
  588. # define PACKET3_DB_ACTION_ENA (1 << 26)
  589. # define PACKET3_SH_ACTION_ENA (1 << 27)
  590. # define PACKET3_SMX_ACTION_ENA (1 << 28)
  591. #define PACKET3_ME_INITIALIZE 0x44
  592. #define PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16)
  593. #define PACKET3_COND_WRITE 0x45
  594. #define PACKET3_EVENT_WRITE 0x46
  595. #define PACKET3_EVENT_WRITE_EOP 0x47
  596. #define PACKET3_EVENT_WRITE_EOS 0x48
  597. #define PACKET3_PREAMBLE_CNTL 0x4A
  598. #define PACKET3_RB_OFFSET 0x4B
  599. #define PACKET3_ALU_PS_CONST_BUFFER_COPY 0x4C
  600. #define PACKET3_ALU_VS_CONST_BUFFER_COPY 0x4D
  601. #define PACKET3_ALU_PS_CONST_UPDATE 0x4E
  602. #define PACKET3_ALU_VS_CONST_UPDATE 0x4F
  603. #define PACKET3_ONE_REG_WRITE 0x57
  604. #define PACKET3_SET_CONFIG_REG 0x68
  605. #define PACKET3_SET_CONFIG_REG_START 0x00008000
  606. #define PACKET3_SET_CONFIG_REG_END 0x0000ac00
  607. #define PACKET3_SET_CONTEXT_REG 0x69
  608. #define PACKET3_SET_CONTEXT_REG_START 0x00028000
  609. #define PACKET3_SET_CONTEXT_REG_END 0x00029000
  610. #define PACKET3_SET_ALU_CONST 0x6A
  611. /* alu const buffers only; no reg file */
  612. #define PACKET3_SET_BOOL_CONST 0x6B
  613. #define PACKET3_SET_BOOL_CONST_START 0x0003a500
  614. #define PACKET3_SET_BOOL_CONST_END 0x0003a518
  615. #define PACKET3_SET_LOOP_CONST 0x6C
  616. #define PACKET3_SET_LOOP_CONST_START 0x0003a200
  617. #define PACKET3_SET_LOOP_CONST_END 0x0003a500
  618. #define PACKET3_SET_RESOURCE 0x6D
  619. #define PACKET3_SET_RESOURCE_START 0x00030000
  620. #define PACKET3_SET_RESOURCE_END 0x00038000
  621. #define PACKET3_SET_SAMPLER 0x6E
  622. #define PACKET3_SET_SAMPLER_START 0x0003c000
  623. #define PACKET3_SET_SAMPLER_END 0x0003c600
  624. #define PACKET3_SET_CTL_CONST 0x6F
  625. #define PACKET3_SET_CTL_CONST_START 0x0003cff0
  626. #define PACKET3_SET_CTL_CONST_END 0x0003ff0c
  627. #define PACKET3_SET_RESOURCE_OFFSET 0x70
  628. #define PACKET3_SET_ALU_CONST_VS 0x71
  629. #define PACKET3_SET_ALU_CONST_DI 0x72
  630. #define PACKET3_SET_CONTEXT_REG_INDIRECT 0x73
  631. #define PACKET3_SET_RESOURCE_INDIRECT 0x74
  632. #define PACKET3_SET_APPEND_CNT 0x75
  633. #define SQ_RESOURCE_CONSTANT_WORD7_0 0x3001c
  634. #define S__SQ_CONSTANT_TYPE(x) (((x) & 3) << 30)
  635. #define G__SQ_CONSTANT_TYPE(x) (((x) >> 30) & 3)
  636. #define SQ_TEX_VTX_INVALID_TEXTURE 0x0
  637. #define SQ_TEX_VTX_INVALID_BUFFER 0x1
  638. #define SQ_TEX_VTX_VALID_TEXTURE 0x2
  639. #define SQ_TEX_VTX_VALID_BUFFER 0x3
  640. #define SQ_CONST_MEM_BASE 0x8df8
  641. #define SQ_ESGS_RING_SIZE 0x8c44
  642. #define SQ_GSVS_RING_SIZE 0x8c4c
  643. #define SQ_ESTMP_RING_SIZE 0x8c54
  644. #define SQ_GSTMP_RING_SIZE 0x8c5c
  645. #define SQ_VSTMP_RING_SIZE 0x8c64
  646. #define SQ_PSTMP_RING_SIZE 0x8c6c
  647. #define SQ_LSTMP_RING_SIZE 0x8e14
  648. #define SQ_HSTMP_RING_SIZE 0x8e1c
  649. #define VGT_TF_RING_SIZE 0x8988
  650. #define SQ_ESGS_RING_ITEMSIZE 0x28900
  651. #define SQ_GSVS_RING_ITEMSIZE 0x28904
  652. #define SQ_ESTMP_RING_ITEMSIZE 0x28908
  653. #define SQ_GSTMP_RING_ITEMSIZE 0x2890c
  654. #define SQ_VSTMP_RING_ITEMSIZE 0x28910
  655. #define SQ_PSTMP_RING_ITEMSIZE 0x28914
  656. #define SQ_LSTMP_RING_ITEMSIZE 0x28830
  657. #define SQ_HSTMP_RING_ITEMSIZE 0x28834
  658. #define SQ_GS_VERT_ITEMSIZE 0x2891c
  659. #define SQ_GS_VERT_ITEMSIZE_1 0x28920
  660. #define SQ_GS_VERT_ITEMSIZE_2 0x28924
  661. #define SQ_GS_VERT_ITEMSIZE_3 0x28928
  662. #define SQ_GSVS_RING_OFFSET_1 0x2892c
  663. #define SQ_GSVS_RING_OFFSET_2 0x28930
  664. #define SQ_GSVS_RING_OFFSET_3 0x28934
  665. #define SQ_ALU_CONST_BUFFER_SIZE_PS_0 0x28140
  666. #define SQ_ALU_CONST_BUFFER_SIZE_HS_0 0x28f80
  667. #define SQ_ALU_CONST_CACHE_PS_0 0x28940
  668. #define SQ_ALU_CONST_CACHE_PS_1 0x28944
  669. #define SQ_ALU_CONST_CACHE_PS_2 0x28948
  670. #define SQ_ALU_CONST_CACHE_PS_3 0x2894c
  671. #define SQ_ALU_CONST_CACHE_PS_4 0x28950
  672. #define SQ_ALU_CONST_CACHE_PS_5 0x28954
  673. #define SQ_ALU_CONST_CACHE_PS_6 0x28958
  674. #define SQ_ALU_CONST_CACHE_PS_7 0x2895c
  675. #define SQ_ALU_CONST_CACHE_PS_8 0x28960
  676. #define SQ_ALU_CONST_CACHE_PS_9 0x28964
  677. #define SQ_ALU_CONST_CACHE_PS_10 0x28968
  678. #define SQ_ALU_CONST_CACHE_PS_11 0x2896c
  679. #define SQ_ALU_CONST_CACHE_PS_12 0x28970
  680. #define SQ_ALU_CONST_CACHE_PS_13 0x28974
  681. #define SQ_ALU_CONST_CACHE_PS_14 0x28978
  682. #define SQ_ALU_CONST_CACHE_PS_15 0x2897c
  683. #define SQ_ALU_CONST_CACHE_VS_0 0x28980
  684. #define SQ_ALU_CONST_CACHE_VS_1 0x28984
  685. #define SQ_ALU_CONST_CACHE_VS_2 0x28988
  686. #define SQ_ALU_CONST_CACHE_VS_3 0x2898c
  687. #define SQ_ALU_CONST_CACHE_VS_4 0x28990
  688. #define SQ_ALU_CONST_CACHE_VS_5 0x28994
  689. #define SQ_ALU_CONST_CACHE_VS_6 0x28998
  690. #define SQ_ALU_CONST_CACHE_VS_7 0x2899c
  691. #define SQ_ALU_CONST_CACHE_VS_8 0x289a0
  692. #define SQ_ALU_CONST_CACHE_VS_9 0x289a4
  693. #define SQ_ALU_CONST_CACHE_VS_10 0x289a8
  694. #define SQ_ALU_CONST_CACHE_VS_11 0x289ac
  695. #define SQ_ALU_CONST_CACHE_VS_12 0x289b0
  696. #define SQ_ALU_CONST_CACHE_VS_13 0x289b4
  697. #define SQ_ALU_CONST_CACHE_VS_14 0x289b8
  698. #define SQ_ALU_CONST_CACHE_VS_15 0x289bc
  699. #define SQ_ALU_CONST_CACHE_GS_0 0x289c0
  700. #define SQ_ALU_CONST_CACHE_GS_1 0x289c4
  701. #define SQ_ALU_CONST_CACHE_GS_2 0x289c8
  702. #define SQ_ALU_CONST_CACHE_GS_3 0x289cc
  703. #define SQ_ALU_CONST_CACHE_GS_4 0x289d0
  704. #define SQ_ALU_CONST_CACHE_GS_5 0x289d4
  705. #define SQ_ALU_CONST_CACHE_GS_6 0x289d8
  706. #define SQ_ALU_CONST_CACHE_GS_7 0x289dc
  707. #define SQ_ALU_CONST_CACHE_GS_8 0x289e0
  708. #define SQ_ALU_CONST_CACHE_GS_9 0x289e4
  709. #define SQ_ALU_CONST_CACHE_GS_10 0x289e8
  710. #define SQ_ALU_CONST_CACHE_GS_11 0x289ec
  711. #define SQ_ALU_CONST_CACHE_GS_12 0x289f0
  712. #define SQ_ALU_CONST_CACHE_GS_13 0x289f4
  713. #define SQ_ALU_CONST_CACHE_GS_14 0x289f8
  714. #define SQ_ALU_CONST_CACHE_GS_15 0x289fc
  715. #define SQ_ALU_CONST_CACHE_HS_0 0x28f00
  716. #define SQ_ALU_CONST_CACHE_HS_1 0x28f04
  717. #define SQ_ALU_CONST_CACHE_HS_2 0x28f08
  718. #define SQ_ALU_CONST_CACHE_HS_3 0x28f0c
  719. #define SQ_ALU_CONST_CACHE_HS_4 0x28f10
  720. #define SQ_ALU_CONST_CACHE_HS_5 0x28f14
  721. #define SQ_ALU_CONST_CACHE_HS_6 0x28f18
  722. #define SQ_ALU_CONST_CACHE_HS_7 0x28f1c
  723. #define SQ_ALU_CONST_CACHE_HS_8 0x28f20
  724. #define SQ_ALU_CONST_CACHE_HS_9 0x28f24
  725. #define SQ_ALU_CONST_CACHE_HS_10 0x28f28
  726. #define SQ_ALU_CONST_CACHE_HS_11 0x28f2c
  727. #define SQ_ALU_CONST_CACHE_HS_12 0x28f30
  728. #define SQ_ALU_CONST_CACHE_HS_13 0x28f34
  729. #define SQ_ALU_CONST_CACHE_HS_14 0x28f38
  730. #define SQ_ALU_CONST_CACHE_HS_15 0x28f3c
  731. #define SQ_ALU_CONST_CACHE_LS_0 0x28f40
  732. #define SQ_ALU_CONST_CACHE_LS_1 0x28f44
  733. #define SQ_ALU_CONST_CACHE_LS_2 0x28f48
  734. #define SQ_ALU_CONST_CACHE_LS_3 0x28f4c
  735. #define SQ_ALU_CONST_CACHE_LS_4 0x28f50
  736. #define SQ_ALU_CONST_CACHE_LS_5 0x28f54
  737. #define SQ_ALU_CONST_CACHE_LS_6 0x28f58
  738. #define SQ_ALU_CONST_CACHE_LS_7 0x28f5c
  739. #define SQ_ALU_CONST_CACHE_LS_8 0x28f60
  740. #define SQ_ALU_CONST_CACHE_LS_9 0x28f64
  741. #define SQ_ALU_CONST_CACHE_LS_10 0x28f68
  742. #define SQ_ALU_CONST_CACHE_LS_11 0x28f6c
  743. #define SQ_ALU_CONST_CACHE_LS_12 0x28f70
  744. #define SQ_ALU_CONST_CACHE_LS_13 0x28f74
  745. #define SQ_ALU_CONST_CACHE_LS_14 0x28f78
  746. #define SQ_ALU_CONST_CACHE_LS_15 0x28f7c
  747. #define DB_DEPTH_CONTROL 0x28800
  748. #define DB_DEPTH_VIEW 0x28008
  749. #define DB_HTILE_DATA_BASE 0x28014
  750. #define DB_Z_INFO 0x28040
  751. # define Z_ARRAY_MODE(x) ((x) << 4)
  752. #define DB_STENCIL_INFO 0x28044
  753. #define DB_Z_READ_BASE 0x28048
  754. #define DB_STENCIL_READ_BASE 0x2804c
  755. #define DB_Z_WRITE_BASE 0x28050
  756. #define DB_STENCIL_WRITE_BASE 0x28054
  757. #define DB_DEPTH_SIZE 0x28058
  758. #define SQ_PGM_START_PS 0x28840
  759. #define SQ_PGM_START_VS 0x2885c
  760. #define SQ_PGM_START_GS 0x28874
  761. #define SQ_PGM_START_ES 0x2888c
  762. #define SQ_PGM_START_FS 0x288a4
  763. #define SQ_PGM_START_HS 0x288b8
  764. #define SQ_PGM_START_LS 0x288d0
  765. #define VGT_STRMOUT_CONFIG 0x28b94
  766. #define VGT_STRMOUT_BUFFER_CONFIG 0x28b98
  767. #define CB_TARGET_MASK 0x28238
  768. #define CB_SHADER_MASK 0x2823c
  769. #define GDS_ADDR_BASE 0x28720
  770. #define CB_IMMED0_BASE 0x28b9c
  771. #define CB_IMMED1_BASE 0x28ba0
  772. #define CB_IMMED2_BASE 0x28ba4
  773. #define CB_IMMED3_BASE 0x28ba8
  774. #define CB_IMMED4_BASE 0x28bac
  775. #define CB_IMMED5_BASE 0x28bb0
  776. #define CB_IMMED6_BASE 0x28bb4
  777. #define CB_IMMED7_BASE 0x28bb8
  778. #define CB_IMMED8_BASE 0x28bbc
  779. #define CB_IMMED9_BASE 0x28bc0
  780. #define CB_IMMED10_BASE 0x28bc4
  781. #define CB_IMMED11_BASE 0x28bc8
  782. /* all 12 CB blocks have these regs */
  783. #define CB_COLOR0_BASE 0x28c60
  784. #define CB_COLOR0_PITCH 0x28c64
  785. #define CB_COLOR0_SLICE 0x28c68
  786. #define CB_COLOR0_VIEW 0x28c6c
  787. #define CB_COLOR0_INFO 0x28c70
  788. # define CB_ARRAY_MODE(x) ((x) << 8)
  789. # define ARRAY_LINEAR_GENERAL 0
  790. # define ARRAY_LINEAR_ALIGNED 1
  791. # define ARRAY_1D_TILED_THIN1 2
  792. # define ARRAY_2D_TILED_THIN1 4
  793. #define CB_COLOR0_ATTRIB 0x28c74
  794. #define CB_COLOR0_DIM 0x28c78
  795. /* only CB0-7 blocks have these regs */
  796. #define CB_COLOR0_CMASK 0x28c7c
  797. #define CB_COLOR0_CMASK_SLICE 0x28c80
  798. #define CB_COLOR0_FMASK 0x28c84
  799. #define CB_COLOR0_FMASK_SLICE 0x28c88
  800. #define CB_COLOR0_CLEAR_WORD0 0x28c8c
  801. #define CB_COLOR0_CLEAR_WORD1 0x28c90
  802. #define CB_COLOR0_CLEAR_WORD2 0x28c94
  803. #define CB_COLOR0_CLEAR_WORD3 0x28c98
  804. #define CB_COLOR1_BASE 0x28c9c
  805. #define CB_COLOR2_BASE 0x28cd8
  806. #define CB_COLOR3_BASE 0x28d14
  807. #define CB_COLOR4_BASE 0x28d50
  808. #define CB_COLOR5_BASE 0x28d8c
  809. #define CB_COLOR6_BASE 0x28dc8
  810. #define CB_COLOR7_BASE 0x28e04
  811. #define CB_COLOR8_BASE 0x28e40
  812. #define CB_COLOR9_BASE 0x28e5c
  813. #define CB_COLOR10_BASE 0x28e78
  814. #define CB_COLOR11_BASE 0x28e94
  815. #define CB_COLOR1_PITCH 0x28ca0
  816. #define CB_COLOR2_PITCH 0x28cdc
  817. #define CB_COLOR3_PITCH 0x28d18
  818. #define CB_COLOR4_PITCH 0x28d54
  819. #define CB_COLOR5_PITCH 0x28d90
  820. #define CB_COLOR6_PITCH 0x28dcc
  821. #define CB_COLOR7_PITCH 0x28e08
  822. #define CB_COLOR8_PITCH 0x28e44
  823. #define CB_COLOR9_PITCH 0x28e60
  824. #define CB_COLOR10_PITCH 0x28e7c
  825. #define CB_COLOR11_PITCH 0x28e98
  826. #define CB_COLOR1_SLICE 0x28ca4
  827. #define CB_COLOR2_SLICE 0x28ce0
  828. #define CB_COLOR3_SLICE 0x28d1c
  829. #define CB_COLOR4_SLICE 0x28d58
  830. #define CB_COLOR5_SLICE 0x28d94
  831. #define CB_COLOR6_SLICE 0x28dd0
  832. #define CB_COLOR7_SLICE 0x28e0c
  833. #define CB_COLOR8_SLICE 0x28e48
  834. #define CB_COLOR9_SLICE 0x28e64
  835. #define CB_COLOR10_SLICE 0x28e80
  836. #define CB_COLOR11_SLICE 0x28e9c
  837. #define CB_COLOR1_VIEW 0x28ca8
  838. #define CB_COLOR2_VIEW 0x28ce4
  839. #define CB_COLOR3_VIEW 0x28d20
  840. #define CB_COLOR4_VIEW 0x28d5c
  841. #define CB_COLOR5_VIEW 0x28d98
  842. #define CB_COLOR6_VIEW 0x28dd4
  843. #define CB_COLOR7_VIEW 0x28e10
  844. #define CB_COLOR8_VIEW 0x28e4c
  845. #define CB_COLOR9_VIEW 0x28e68
  846. #define CB_COLOR10_VIEW 0x28e84
  847. #define CB_COLOR11_VIEW 0x28ea0
  848. #define CB_COLOR1_INFO 0x28cac
  849. #define CB_COLOR2_INFO 0x28ce8
  850. #define CB_COLOR3_INFO 0x28d24
  851. #define CB_COLOR4_INFO 0x28d60
  852. #define CB_COLOR5_INFO 0x28d9c
  853. #define CB_COLOR6_INFO 0x28dd8
  854. #define CB_COLOR7_INFO 0x28e14
  855. #define CB_COLOR8_INFO 0x28e50
  856. #define CB_COLOR9_INFO 0x28e6c
  857. #define CB_COLOR10_INFO 0x28e88
  858. #define CB_COLOR11_INFO 0x28ea4
  859. #define CB_COLOR1_ATTRIB 0x28cb0
  860. #define CB_COLOR2_ATTRIB 0x28cec
  861. #define CB_COLOR3_ATTRIB 0x28d28
  862. #define CB_COLOR4_ATTRIB 0x28d64
  863. #define CB_COLOR5_ATTRIB 0x28da0
  864. #define CB_COLOR6_ATTRIB 0x28ddc
  865. #define CB_COLOR7_ATTRIB 0x28e18
  866. #define CB_COLOR8_ATTRIB 0x28e54
  867. #define CB_COLOR9_ATTRIB 0x28e70
  868. #define CB_COLOR10_ATTRIB 0x28e8c
  869. #define CB_COLOR11_ATTRIB 0x28ea8
  870. #define CB_COLOR1_DIM 0x28cb4
  871. #define CB_COLOR2_DIM 0x28cf0
  872. #define CB_COLOR3_DIM 0x28d2c
  873. #define CB_COLOR4_DIM 0x28d68
  874. #define CB_COLOR5_DIM 0x28da4
  875. #define CB_COLOR6_DIM 0x28de0
  876. #define CB_COLOR7_DIM 0x28e1c
  877. #define CB_COLOR8_DIM 0x28e58
  878. #define CB_COLOR9_DIM 0x28e74
  879. #define CB_COLOR10_DIM 0x28e90
  880. #define CB_COLOR11_DIM 0x28eac
  881. #define CB_COLOR1_CMASK 0x28cb8
  882. #define CB_COLOR2_CMASK 0x28cf4
  883. #define CB_COLOR3_CMASK 0x28d30
  884. #define CB_COLOR4_CMASK 0x28d6c
  885. #define CB_COLOR5_CMASK 0x28da8
  886. #define CB_COLOR6_CMASK 0x28de4
  887. #define CB_COLOR7_CMASK 0x28e20
  888. #define CB_COLOR1_CMASK_SLICE 0x28cbc
  889. #define CB_COLOR2_CMASK_SLICE 0x28cf8
  890. #define CB_COLOR3_CMASK_SLICE 0x28d34
  891. #define CB_COLOR4_CMASK_SLICE 0x28d70
  892. #define CB_COLOR5_CMASK_SLICE 0x28dac
  893. #define CB_COLOR6_CMASK_SLICE 0x28de8
  894. #define CB_COLOR7_CMASK_SLICE 0x28e24
  895. #define CB_COLOR1_FMASK 0x28cc0
  896. #define CB_COLOR2_FMASK 0x28cfc
  897. #define CB_COLOR3_FMASK 0x28d38
  898. #define CB_COLOR4_FMASK 0x28d74
  899. #define CB_COLOR5_FMASK 0x28db0
  900. #define CB_COLOR6_FMASK 0x28dec
  901. #define CB_COLOR7_FMASK 0x28e28
  902. #define CB_COLOR1_FMASK_SLICE 0x28cc4
  903. #define CB_COLOR2_FMASK_SLICE 0x28d00
  904. #define CB_COLOR3_FMASK_SLICE 0x28d3c
  905. #define CB_COLOR4_FMASK_SLICE 0x28d78
  906. #define CB_COLOR5_FMASK_SLICE 0x28db4
  907. #define CB_COLOR6_FMASK_SLICE 0x28df0
  908. #define CB_COLOR7_FMASK_SLICE 0x28e2c
  909. #define CB_COLOR1_CLEAR_WORD0 0x28cc8
  910. #define CB_COLOR2_CLEAR_WORD0 0x28d04
  911. #define CB_COLOR3_CLEAR_WORD0 0x28d40
  912. #define CB_COLOR4_CLEAR_WORD0 0x28d7c
  913. #define CB_COLOR5_CLEAR_WORD0 0x28db8
  914. #define CB_COLOR6_CLEAR_WORD0 0x28df4
  915. #define CB_COLOR7_CLEAR_WORD0 0x28e30
  916. #define CB_COLOR1_CLEAR_WORD1 0x28ccc
  917. #define CB_COLOR2_CLEAR_WORD1 0x28d08
  918. #define CB_COLOR3_CLEAR_WORD1 0x28d44
  919. #define CB_COLOR4_CLEAR_WORD1 0x28d80
  920. #define CB_COLOR5_CLEAR_WORD1 0x28dbc
  921. #define CB_COLOR6_CLEAR_WORD1 0x28df8
  922. #define CB_COLOR7_CLEAR_WORD1 0x28e34
  923. #define CB_COLOR1_CLEAR_WORD2 0x28cd0
  924. #define CB_COLOR2_CLEAR_WORD2 0x28d0c
  925. #define CB_COLOR3_CLEAR_WORD2 0x28d48
  926. #define CB_COLOR4_CLEAR_WORD2 0x28d84
  927. #define CB_COLOR5_CLEAR_WORD2 0x28dc0
  928. #define CB_COLOR6_CLEAR_WORD2 0x28dfc
  929. #define CB_COLOR7_CLEAR_WORD2 0x28e38
  930. #define CB_COLOR1_CLEAR_WORD3 0x28cd4
  931. #define CB_COLOR2_CLEAR_WORD3 0x28d10
  932. #define CB_COLOR3_CLEAR_WORD3 0x28d4c
  933. #define CB_COLOR4_CLEAR_WORD3 0x28d88
  934. #define CB_COLOR5_CLEAR_WORD3 0x28dc4
  935. #define CB_COLOR6_CLEAR_WORD3 0x28e00
  936. #define CB_COLOR7_CLEAR_WORD3 0x28e3c
  937. #define SQ_TEX_RESOURCE_WORD0_0 0x30000
  938. #define SQ_TEX_RESOURCE_WORD1_0 0x30004
  939. # define TEX_ARRAY_MODE(x) ((x) << 28)
  940. #define SQ_TEX_RESOURCE_WORD2_0 0x30008
  941. #define SQ_TEX_RESOURCE_WORD3_0 0x3000C
  942. #define SQ_TEX_RESOURCE_WORD4_0 0x30010
  943. #define SQ_TEX_RESOURCE_WORD5_0 0x30014
  944. #define SQ_TEX_RESOURCE_WORD6_0 0x30018
  945. #define SQ_TEX_RESOURCE_WORD7_0 0x3001c
  946. #endif