nid.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. #define CAYMAN_MAX_SH_GPRS 256
  27. #define CAYMAN_MAX_TEMP_GPRS 16
  28. #define CAYMAN_MAX_SH_THREADS 256
  29. #define CAYMAN_MAX_SH_STACK_ENTRIES 4096
  30. #define CAYMAN_MAX_FRC_EOV_CNT 16384
  31. #define CAYMAN_MAX_BACKENDS 8
  32. #define CAYMAN_MAX_BACKENDS_MASK 0xFF
  33. #define CAYMAN_MAX_BACKENDS_PER_SE_MASK 0xF
  34. #define CAYMAN_MAX_SIMDS 16
  35. #define CAYMAN_MAX_SIMDS_MASK 0xFFFF
  36. #define CAYMAN_MAX_SIMDS_PER_SE_MASK 0xFFF
  37. #define CAYMAN_MAX_PIPES 8
  38. #define CAYMAN_MAX_PIPES_MASK 0xFF
  39. #define CAYMAN_MAX_LDS_NUM 0xFFFF
  40. #define CAYMAN_MAX_TCC 16
  41. #define CAYMAN_MAX_TCC_MASK 0xFF
  42. #define DMIF_ADDR_CONFIG 0xBD4
  43. #define MC_SHARED_CHMAP 0x2004
  44. #define NOOFCHAN_SHIFT 12
  45. #define NOOFCHAN_MASK 0x00003000
  46. #define MC_SHARED_CHREMAP 0x2008
  47. #define MC_SHARED_BLACKOUT_CNTL 0x20ac
  48. #define MC_ARB_RAMCFG 0x2760
  49. #define NOOFBANK_SHIFT 0
  50. #define NOOFBANK_MASK 0x00000003
  51. #define NOOFRANK_SHIFT 2
  52. #define NOOFRANK_MASK 0x00000004
  53. #define NOOFROWS_SHIFT 3
  54. #define NOOFROWS_MASK 0x00000038
  55. #define NOOFCOLS_SHIFT 6
  56. #define NOOFCOLS_MASK 0x000000C0
  57. #define CHANSIZE_SHIFT 8
  58. #define CHANSIZE_MASK 0x00000100
  59. #define BURSTLENGTH_SHIFT 9
  60. #define BURSTLENGTH_MASK 0x00000200
  61. #define CHANSIZE_OVERRIDE (1 << 11)
  62. #define MC_SEQ_SUP_CNTL 0x28c8
  63. #define RUN_MASK (1 << 0)
  64. #define MC_SEQ_SUP_PGM 0x28cc
  65. #define MC_IO_PAD_CNTL_D0 0x29d0
  66. #define MEM_FALL_OUT_CMD (1 << 8)
  67. #define MC_SEQ_MISC0 0x2a00
  68. #define MC_SEQ_MISC0_GDDR5_SHIFT 28
  69. #define MC_SEQ_MISC0_GDDR5_MASK 0xf0000000
  70. #define MC_SEQ_MISC0_GDDR5_VALUE 5
  71. #define MC_SEQ_IO_DEBUG_INDEX 0x2a44
  72. #define MC_SEQ_IO_DEBUG_DATA 0x2a48
  73. #define HDP_HOST_PATH_CNTL 0x2C00
  74. #define HDP_NONSURFACE_BASE 0x2C04
  75. #define HDP_NONSURFACE_INFO 0x2C08
  76. #define HDP_NONSURFACE_SIZE 0x2C0C
  77. #define HDP_ADDR_CONFIG 0x2F48
  78. #define CC_SYS_RB_BACKEND_DISABLE 0x3F88
  79. #define GC_USER_SYS_RB_BACKEND_DISABLE 0x3F8C
  80. #define CGTS_SYS_TCC_DISABLE 0x3F90
  81. #define CGTS_USER_SYS_TCC_DISABLE 0x3F94
  82. #define CONFIG_MEMSIZE 0x5428
  83. #define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0
  84. #define GRBM_CNTL 0x8000
  85. #define GRBM_READ_TIMEOUT(x) ((x) << 0)
  86. #define GRBM_STATUS 0x8010
  87. #define CMDFIFO_AVAIL_MASK 0x0000000F
  88. #define RING2_RQ_PENDING (1 << 4)
  89. #define SRBM_RQ_PENDING (1 << 5)
  90. #define RING1_RQ_PENDING (1 << 6)
  91. #define CF_RQ_PENDING (1 << 7)
  92. #define PF_RQ_PENDING (1 << 8)
  93. #define GDS_DMA_RQ_PENDING (1 << 9)
  94. #define GRBM_EE_BUSY (1 << 10)
  95. #define SX_CLEAN (1 << 11)
  96. #define DB_CLEAN (1 << 12)
  97. #define CB_CLEAN (1 << 13)
  98. #define TA_BUSY (1 << 14)
  99. #define GDS_BUSY (1 << 15)
  100. #define VGT_BUSY_NO_DMA (1 << 16)
  101. #define VGT_BUSY (1 << 17)
  102. #define IA_BUSY_NO_DMA (1 << 18)
  103. #define IA_BUSY (1 << 19)
  104. #define SX_BUSY (1 << 20)
  105. #define SH_BUSY (1 << 21)
  106. #define SPI_BUSY (1 << 22)
  107. #define SC_BUSY (1 << 24)
  108. #define PA_BUSY (1 << 25)
  109. #define DB_BUSY (1 << 26)
  110. #define CP_COHERENCY_BUSY (1 << 28)
  111. #define CP_BUSY (1 << 29)
  112. #define CB_BUSY (1 << 30)
  113. #define GUI_ACTIVE (1 << 31)
  114. #define GRBM_STATUS_SE0 0x8014
  115. #define GRBM_STATUS_SE1 0x8018
  116. #define SE_SX_CLEAN (1 << 0)
  117. #define SE_DB_CLEAN (1 << 1)
  118. #define SE_CB_CLEAN (1 << 2)
  119. #define SE_VGT_BUSY (1 << 23)
  120. #define SE_PA_BUSY (1 << 24)
  121. #define SE_TA_BUSY (1 << 25)
  122. #define SE_SX_BUSY (1 << 26)
  123. #define SE_SPI_BUSY (1 << 27)
  124. #define SE_SH_BUSY (1 << 28)
  125. #define SE_SC_BUSY (1 << 29)
  126. #define SE_DB_BUSY (1 << 30)
  127. #define SE_CB_BUSY (1 << 31)
  128. #define GRBM_SOFT_RESET 0x8020
  129. #define SOFT_RESET_CP (1 << 0)
  130. #define SOFT_RESET_CB (1 << 1)
  131. #define SOFT_RESET_DB (1 << 3)
  132. #define SOFT_RESET_GDS (1 << 4)
  133. #define SOFT_RESET_PA (1 << 5)
  134. #define SOFT_RESET_SC (1 << 6)
  135. #define SOFT_RESET_SPI (1 << 8)
  136. #define SOFT_RESET_SH (1 << 9)
  137. #define SOFT_RESET_SX (1 << 10)
  138. #define SOFT_RESET_TC (1 << 11)
  139. #define SOFT_RESET_TA (1 << 12)
  140. #define SOFT_RESET_VGT (1 << 14)
  141. #define SOFT_RESET_IA (1 << 15)
  142. #define CP_MEQ_THRESHOLDS 0x8764
  143. #define MEQ1_START(x) ((x) << 0)
  144. #define MEQ2_START(x) ((x) << 8)
  145. #define CP_PERFMON_CNTL 0x87FC
  146. #define VGT_CACHE_INVALIDATION 0x88C4
  147. #define CACHE_INVALIDATION(x) ((x) << 0)
  148. #define VC_ONLY 0
  149. #define TC_ONLY 1
  150. #define VC_AND_TC 2
  151. #define AUTO_INVLD_EN(x) ((x) << 6)
  152. #define NO_AUTO 0
  153. #define ES_AUTO 1
  154. #define GS_AUTO 2
  155. #define ES_AND_GS_AUTO 3
  156. #define VGT_GS_VERTEX_REUSE 0x88D4
  157. #define CC_GC_SHADER_PIPE_CONFIG 0x8950
  158. #define GC_USER_SHADER_PIPE_CONFIG 0x8954
  159. #define INACTIVE_QD_PIPES(x) ((x) << 8)
  160. #define INACTIVE_QD_PIPES_MASK 0x0000FF00
  161. #define INACTIVE_QD_PIPES_SHIFT 8
  162. #define INACTIVE_SIMDS(x) ((x) << 16)
  163. #define INACTIVE_SIMDS_MASK 0xFFFF0000
  164. #define INACTIVE_SIMDS_SHIFT 16
  165. #define VGT_PRIMITIVE_TYPE 0x8958
  166. #define VGT_NUM_INSTANCES 0x8974
  167. #define VGT_TF_RING_SIZE 0x8988
  168. #define VGT_OFFCHIP_LDS_BASE 0x89b4
  169. #define PA_SC_LINE_STIPPLE_STATE 0x8B10
  170. #define PA_CL_ENHANCE 0x8A14
  171. #define CLIP_VTX_REORDER_ENA (1 << 0)
  172. #define NUM_CLIP_SEQ(x) ((x) << 1)
  173. #define PA_SC_FIFO_SIZE 0x8BCC
  174. #define SC_PRIM_FIFO_SIZE(x) ((x) << 0)
  175. #define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 12)
  176. #define SC_EARLYZ_TILE_FIFO_SIZE(x) ((x) << 20)
  177. #define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24
  178. #define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0)
  179. #define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16)
  180. #define SQ_CONFIG 0x8C00
  181. #define VC_ENABLE (1 << 0)
  182. #define EXPORT_SRC_C (1 << 1)
  183. #define GFX_PRIO(x) ((x) << 2)
  184. #define CS1_PRIO(x) ((x) << 4)
  185. #define CS2_PRIO(x) ((x) << 6)
  186. #define SQ_GPR_RESOURCE_MGMT_1 0x8C04
  187. #define NUM_PS_GPRS(x) ((x) << 0)
  188. #define NUM_VS_GPRS(x) ((x) << 16)
  189. #define NUM_CLAUSE_TEMP_GPRS(x) ((x) << 28)
  190. #define SQ_ESGS_RING_SIZE 0x8c44
  191. #define SQ_GSVS_RING_SIZE 0x8c4c
  192. #define SQ_ESTMP_RING_BASE 0x8c50
  193. #define SQ_ESTMP_RING_SIZE 0x8c54
  194. #define SQ_GSTMP_RING_BASE 0x8c58
  195. #define SQ_GSTMP_RING_SIZE 0x8c5c
  196. #define SQ_VSTMP_RING_BASE 0x8c60
  197. #define SQ_VSTMP_RING_SIZE 0x8c64
  198. #define SQ_PSTMP_RING_BASE 0x8c68
  199. #define SQ_PSTMP_RING_SIZE 0x8c6c
  200. #define SQ_MS_FIFO_SIZES 0x8CF0
  201. #define CACHE_FIFO_SIZE(x) ((x) << 0)
  202. #define FETCH_FIFO_HIWATER(x) ((x) << 8)
  203. #define DONE_FIFO_HIWATER(x) ((x) << 16)
  204. #define ALU_UPDATE_FIFO_HIWATER(x) ((x) << 24)
  205. #define SQ_LSTMP_RING_BASE 0x8e10
  206. #define SQ_LSTMP_RING_SIZE 0x8e14
  207. #define SQ_HSTMP_RING_BASE 0x8e18
  208. #define SQ_HSTMP_RING_SIZE 0x8e1c
  209. #define SQ_DYN_GPR_CNTL_PS_FLUSH_REQ 0x8D8C
  210. #define DYN_GPR_ENABLE (1 << 8)
  211. #define SQ_CONST_MEM_BASE 0x8df8
  212. #define SX_EXPORT_BUFFER_SIZES 0x900C
  213. #define COLOR_BUFFER_SIZE(x) ((x) << 0)
  214. #define POSITION_BUFFER_SIZE(x) ((x) << 8)
  215. #define SMX_BUFFER_SIZE(x) ((x) << 16)
  216. #define SX_DEBUG_1 0x9058
  217. #define ENABLE_NEW_SMX_ADDRESS (1 << 16)
  218. #define SPI_CONFIG_CNTL 0x9100
  219. #define GPR_WRITE_PRIORITY(x) ((x) << 0)
  220. #define SPI_CONFIG_CNTL_1 0x913C
  221. #define VTX_DONE_DELAY(x) ((x) << 0)
  222. #define INTERP_ONE_PRIM_PER_ROW (1 << 4)
  223. #define CRC_SIMD_ID_WADDR_DISABLE (1 << 8)
  224. #define CGTS_TCC_DISABLE 0x9148
  225. #define CGTS_USER_TCC_DISABLE 0x914C
  226. #define TCC_DISABLE_MASK 0xFFFF0000
  227. #define TCC_DISABLE_SHIFT 16
  228. #define CGTS_SM_CTRL_REG 0x915C
  229. #define OVERRIDE (1 << 21)
  230. #define TA_CNTL_AUX 0x9508
  231. #define DISABLE_CUBE_WRAP (1 << 0)
  232. #define DISABLE_CUBE_ANISO (1 << 1)
  233. #define TCP_CHAN_STEER_LO 0x960c
  234. #define TCP_CHAN_STEER_HI 0x9610
  235. #define CC_RB_BACKEND_DISABLE 0x98F4
  236. #define BACKEND_DISABLE(x) ((x) << 16)
  237. #define GB_ADDR_CONFIG 0x98F8
  238. #define NUM_PIPES(x) ((x) << 0)
  239. #define NUM_PIPES_MASK 0x00000007
  240. #define NUM_PIPES_SHIFT 0
  241. #define PIPE_INTERLEAVE_SIZE(x) ((x) << 4)
  242. #define PIPE_INTERLEAVE_SIZE_MASK 0x00000070
  243. #define PIPE_INTERLEAVE_SIZE_SHIFT 4
  244. #define BANK_INTERLEAVE_SIZE(x) ((x) << 8)
  245. #define NUM_SHADER_ENGINES(x) ((x) << 12)
  246. #define NUM_SHADER_ENGINES_MASK 0x00003000
  247. #define NUM_SHADER_ENGINES_SHIFT 12
  248. #define SHADER_ENGINE_TILE_SIZE(x) ((x) << 16)
  249. #define SHADER_ENGINE_TILE_SIZE_MASK 0x00070000
  250. #define SHADER_ENGINE_TILE_SIZE_SHIFT 16
  251. #define NUM_GPUS(x) ((x) << 20)
  252. #define NUM_GPUS_MASK 0x00700000
  253. #define NUM_GPUS_SHIFT 20
  254. #define MULTI_GPU_TILE_SIZE(x) ((x) << 24)
  255. #define MULTI_GPU_TILE_SIZE_MASK 0x03000000
  256. #define MULTI_GPU_TILE_SIZE_SHIFT 24
  257. #define ROW_SIZE(x) ((x) << 28)
  258. #define ROW_SIZE_MASK 0x30000007
  259. #define ROW_SIZE_SHIFT 28
  260. #define NUM_LOWER_PIPES(x) ((x) << 30)
  261. #define NUM_LOWER_PIPES_MASK 0x40000000
  262. #define NUM_LOWER_PIPES_SHIFT 30
  263. #define GB_BACKEND_MAP 0x98FC
  264. #define CB_PERF_CTR0_SEL_0 0x9A20
  265. #define CB_PERF_CTR0_SEL_1 0x9A24
  266. #define CB_PERF_CTR1_SEL_0 0x9A28
  267. #define CB_PERF_CTR1_SEL_1 0x9A2C
  268. #define CB_PERF_CTR2_SEL_0 0x9A30
  269. #define CB_PERF_CTR2_SEL_1 0x9A34
  270. #define CB_PERF_CTR3_SEL_0 0x9A38
  271. #define CB_PERF_CTR3_SEL_1 0x9A3C
  272. #define GC_USER_RB_BACKEND_DISABLE 0x9B7C
  273. #define BACKEND_DISABLE_MASK 0x00FF0000
  274. #define BACKEND_DISABLE_SHIFT 16
  275. #define SMX_DC_CTL0 0xA020
  276. #define USE_HASH_FUNCTION (1 << 0)
  277. #define NUMBER_OF_SETS(x) ((x) << 1)
  278. #define FLUSH_ALL_ON_EVENT (1 << 10)
  279. #define STALL_ON_EVENT (1 << 11)
  280. #define SMX_EVENT_CTL 0xA02C
  281. #define ES_FLUSH_CTL(x) ((x) << 0)
  282. #define GS_FLUSH_CTL(x) ((x) << 3)
  283. #define ACK_FLUSH_CTL(x) ((x) << 6)
  284. #define SYNC_FLUSH_CTL (1 << 8)
  285. #endif