r420d.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. /*
  2. * Copyright 2008 Advanced Micro Devices, Inc.
  3. * Copyright 2008 Red Hat Inc.
  4. * Copyright 2009 Jerome Glisse.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a
  7. * copy of this software and associated documentation files (the "Software"),
  8. * to deal in the Software without restriction, including without limitation
  9. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. * and/or sell copies of the Software, and to permit persons to whom the
  11. * Software is furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  20. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  21. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  22. * OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * Authors: Dave Airlie
  25. * Alex Deucher
  26. * Jerome Glisse
  27. */
  28. #ifndef R420D_H
  29. #define R420D_H
  30. #define R_0001F8_MC_IND_INDEX 0x0001F8
  31. #define S_0001F8_MC_IND_ADDR(x) (((x) & 0x7F) << 0)
  32. #define G_0001F8_MC_IND_ADDR(x) (((x) >> 0) & 0x7F)
  33. #define C_0001F8_MC_IND_ADDR 0xFFFFFF80
  34. #define S_0001F8_MC_IND_WR_EN(x) (((x) & 0x1) << 8)
  35. #define G_0001F8_MC_IND_WR_EN(x) (((x) >> 8) & 0x1)
  36. #define C_0001F8_MC_IND_WR_EN 0xFFFFFEFF
  37. #define R_0001FC_MC_IND_DATA 0x0001FC
  38. #define S_0001FC_MC_IND_DATA(x) (((x) & 0xFFFFFFFF) << 0)
  39. #define G_0001FC_MC_IND_DATA(x) (((x) >> 0) & 0xFFFFFFFF)
  40. #define C_0001FC_MC_IND_DATA 0x00000000
  41. #define R_0007C0_CP_STAT 0x0007C0
  42. #define S_0007C0_MRU_BUSY(x) (((x) & 0x1) << 0)
  43. #define G_0007C0_MRU_BUSY(x) (((x) >> 0) & 0x1)
  44. #define C_0007C0_MRU_BUSY 0xFFFFFFFE
  45. #define S_0007C0_MWU_BUSY(x) (((x) & 0x1) << 1)
  46. #define G_0007C0_MWU_BUSY(x) (((x) >> 1) & 0x1)
  47. #define C_0007C0_MWU_BUSY 0xFFFFFFFD
  48. #define S_0007C0_RSIU_BUSY(x) (((x) & 0x1) << 2)
  49. #define G_0007C0_RSIU_BUSY(x) (((x) >> 2) & 0x1)
  50. #define C_0007C0_RSIU_BUSY 0xFFFFFFFB
  51. #define S_0007C0_RCIU_BUSY(x) (((x) & 0x1) << 3)
  52. #define G_0007C0_RCIU_BUSY(x) (((x) >> 3) & 0x1)
  53. #define C_0007C0_RCIU_BUSY 0xFFFFFFF7
  54. #define S_0007C0_CSF_PRIMARY_BUSY(x) (((x) & 0x1) << 9)
  55. #define G_0007C0_CSF_PRIMARY_BUSY(x) (((x) >> 9) & 0x1)
  56. #define C_0007C0_CSF_PRIMARY_BUSY 0xFFFFFDFF
  57. #define S_0007C0_CSF_INDIRECT_BUSY(x) (((x) & 0x1) << 10)
  58. #define G_0007C0_CSF_INDIRECT_BUSY(x) (((x) >> 10) & 0x1)
  59. #define C_0007C0_CSF_INDIRECT_BUSY 0xFFFFFBFF
  60. #define S_0007C0_CSQ_PRIMARY_BUSY(x) (((x) & 0x1) << 11)
  61. #define G_0007C0_CSQ_PRIMARY_BUSY(x) (((x) >> 11) & 0x1)
  62. #define C_0007C0_CSQ_PRIMARY_BUSY 0xFFFFF7FF
  63. #define S_0007C0_CSQ_INDIRECT_BUSY(x) (((x) & 0x1) << 12)
  64. #define G_0007C0_CSQ_INDIRECT_BUSY(x) (((x) >> 12) & 0x1)
  65. #define C_0007C0_CSQ_INDIRECT_BUSY 0xFFFFEFFF
  66. #define S_0007C0_CSI_BUSY(x) (((x) & 0x1) << 13)
  67. #define G_0007C0_CSI_BUSY(x) (((x) >> 13) & 0x1)
  68. #define C_0007C0_CSI_BUSY 0xFFFFDFFF
  69. #define S_0007C0_CSF_INDIRECT2_BUSY(x) (((x) & 0x1) << 14)
  70. #define G_0007C0_CSF_INDIRECT2_BUSY(x) (((x) >> 14) & 0x1)
  71. #define C_0007C0_CSF_INDIRECT2_BUSY 0xFFFFBFFF
  72. #define S_0007C0_CSQ_INDIRECT2_BUSY(x) (((x) & 0x1) << 15)
  73. #define G_0007C0_CSQ_INDIRECT2_BUSY(x) (((x) >> 15) & 0x1)
  74. #define C_0007C0_CSQ_INDIRECT2_BUSY 0xFFFF7FFF
  75. #define S_0007C0_GUIDMA_BUSY(x) (((x) & 0x1) << 28)
  76. #define G_0007C0_GUIDMA_BUSY(x) (((x) >> 28) & 0x1)
  77. #define C_0007C0_GUIDMA_BUSY 0xEFFFFFFF
  78. #define S_0007C0_VIDDMA_BUSY(x) (((x) & 0x1) << 29)
  79. #define G_0007C0_VIDDMA_BUSY(x) (((x) >> 29) & 0x1)
  80. #define C_0007C0_VIDDMA_BUSY 0xDFFFFFFF
  81. #define S_0007C0_CMDSTRM_BUSY(x) (((x) & 0x1) << 30)
  82. #define G_0007C0_CMDSTRM_BUSY(x) (((x) >> 30) & 0x1)
  83. #define C_0007C0_CMDSTRM_BUSY 0xBFFFFFFF
  84. #define S_0007C0_CP_BUSY(x) (((x) & 0x1) << 31)
  85. #define G_0007C0_CP_BUSY(x) (((x) >> 31) & 0x1)
  86. #define C_0007C0_CP_BUSY 0x7FFFFFFF
  87. #define R_000E40_RBBM_STATUS 0x000E40
  88. #define S_000E40_CMDFIFO_AVAIL(x) (((x) & 0x7F) << 0)
  89. #define G_000E40_CMDFIFO_AVAIL(x) (((x) >> 0) & 0x7F)
  90. #define C_000E40_CMDFIFO_AVAIL 0xFFFFFF80
  91. #define S_000E40_HIRQ_ON_RBB(x) (((x) & 0x1) << 8)
  92. #define G_000E40_HIRQ_ON_RBB(x) (((x) >> 8) & 0x1)
  93. #define C_000E40_HIRQ_ON_RBB 0xFFFFFEFF
  94. #define S_000E40_CPRQ_ON_RBB(x) (((x) & 0x1) << 9)
  95. #define G_000E40_CPRQ_ON_RBB(x) (((x) >> 9) & 0x1)
  96. #define C_000E40_CPRQ_ON_RBB 0xFFFFFDFF
  97. #define S_000E40_CFRQ_ON_RBB(x) (((x) & 0x1) << 10)
  98. #define G_000E40_CFRQ_ON_RBB(x) (((x) >> 10) & 0x1)
  99. #define C_000E40_CFRQ_ON_RBB 0xFFFFFBFF
  100. #define S_000E40_HIRQ_IN_RTBUF(x) (((x) & 0x1) << 11)
  101. #define G_000E40_HIRQ_IN_RTBUF(x) (((x) >> 11) & 0x1)
  102. #define C_000E40_HIRQ_IN_RTBUF 0xFFFFF7FF
  103. #define S_000E40_CPRQ_IN_RTBUF(x) (((x) & 0x1) << 12)
  104. #define G_000E40_CPRQ_IN_RTBUF(x) (((x) >> 12) & 0x1)
  105. #define C_000E40_CPRQ_IN_RTBUF 0xFFFFEFFF
  106. #define S_000E40_CFRQ_IN_RTBUF(x) (((x) & 0x1) << 13)
  107. #define G_000E40_CFRQ_IN_RTBUF(x) (((x) >> 13) & 0x1)
  108. #define C_000E40_CFRQ_IN_RTBUF 0xFFFFDFFF
  109. #define S_000E40_CF_PIPE_BUSY(x) (((x) & 0x1) << 14)
  110. #define G_000E40_CF_PIPE_BUSY(x) (((x) >> 14) & 0x1)
  111. #define C_000E40_CF_PIPE_BUSY 0xFFFFBFFF
  112. #define S_000E40_ENG_EV_BUSY(x) (((x) & 0x1) << 15)
  113. #define G_000E40_ENG_EV_BUSY(x) (((x) >> 15) & 0x1)
  114. #define C_000E40_ENG_EV_BUSY 0xFFFF7FFF
  115. #define S_000E40_CP_CMDSTRM_BUSY(x) (((x) & 0x1) << 16)
  116. #define G_000E40_CP_CMDSTRM_BUSY(x) (((x) >> 16) & 0x1)
  117. #define C_000E40_CP_CMDSTRM_BUSY 0xFFFEFFFF
  118. #define S_000E40_E2_BUSY(x) (((x) & 0x1) << 17)
  119. #define G_000E40_E2_BUSY(x) (((x) >> 17) & 0x1)
  120. #define C_000E40_E2_BUSY 0xFFFDFFFF
  121. #define S_000E40_RB2D_BUSY(x) (((x) & 0x1) << 18)
  122. #define G_000E40_RB2D_BUSY(x) (((x) >> 18) & 0x1)
  123. #define C_000E40_RB2D_BUSY 0xFFFBFFFF
  124. #define S_000E40_RB3D_BUSY(x) (((x) & 0x1) << 19)
  125. #define G_000E40_RB3D_BUSY(x) (((x) >> 19) & 0x1)
  126. #define C_000E40_RB3D_BUSY 0xFFF7FFFF
  127. #define S_000E40_VAP_BUSY(x) (((x) & 0x1) << 20)
  128. #define G_000E40_VAP_BUSY(x) (((x) >> 20) & 0x1)
  129. #define C_000E40_VAP_BUSY 0xFFEFFFFF
  130. #define S_000E40_RE_BUSY(x) (((x) & 0x1) << 21)
  131. #define G_000E40_RE_BUSY(x) (((x) >> 21) & 0x1)
  132. #define C_000E40_RE_BUSY 0xFFDFFFFF
  133. #define S_000E40_TAM_BUSY(x) (((x) & 0x1) << 22)
  134. #define G_000E40_TAM_BUSY(x) (((x) >> 22) & 0x1)
  135. #define C_000E40_TAM_BUSY 0xFFBFFFFF
  136. #define S_000E40_TDM_BUSY(x) (((x) & 0x1) << 23)
  137. #define G_000E40_TDM_BUSY(x) (((x) >> 23) & 0x1)
  138. #define C_000E40_TDM_BUSY 0xFF7FFFFF
  139. #define S_000E40_PB_BUSY(x) (((x) & 0x1) << 24)
  140. #define G_000E40_PB_BUSY(x) (((x) >> 24) & 0x1)
  141. #define C_000E40_PB_BUSY 0xFEFFFFFF
  142. #define S_000E40_TIM_BUSY(x) (((x) & 0x1) << 25)
  143. #define G_000E40_TIM_BUSY(x) (((x) >> 25) & 0x1)
  144. #define C_000E40_TIM_BUSY 0xFDFFFFFF
  145. #define S_000E40_GA_BUSY(x) (((x) & 0x1) << 26)
  146. #define G_000E40_GA_BUSY(x) (((x) >> 26) & 0x1)
  147. #define C_000E40_GA_BUSY 0xFBFFFFFF
  148. #define S_000E40_CBA2D_BUSY(x) (((x) & 0x1) << 27)
  149. #define G_000E40_CBA2D_BUSY(x) (((x) >> 27) & 0x1)
  150. #define C_000E40_CBA2D_BUSY 0xF7FFFFFF
  151. #define S_000E40_GUI_ACTIVE(x) (((x) & 0x1) << 31)
  152. #define G_000E40_GUI_ACTIVE(x) (((x) >> 31) & 0x1)
  153. #define C_000E40_GUI_ACTIVE 0x7FFFFFFF
  154. /* CLK registers */
  155. #define R_00000D_SCLK_CNTL 0x00000D
  156. #define S_00000D_SCLK_SRC_SEL(x) (((x) & 0x7) << 0)
  157. #define G_00000D_SCLK_SRC_SEL(x) (((x) >> 0) & 0x7)
  158. #define C_00000D_SCLK_SRC_SEL 0xFFFFFFF8
  159. #define S_00000D_CP_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 3)
  160. #define G_00000D_CP_MAX_DYN_STOP_LAT(x) (((x) >> 3) & 0x1)
  161. #define C_00000D_CP_MAX_DYN_STOP_LAT 0xFFFFFFF7
  162. #define S_00000D_HDP_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 4)
  163. #define G_00000D_HDP_MAX_DYN_STOP_LAT(x) (((x) >> 4) & 0x1)
  164. #define C_00000D_HDP_MAX_DYN_STOP_LAT 0xFFFFFFEF
  165. #define S_00000D_TV_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 5)
  166. #define G_00000D_TV_MAX_DYN_STOP_LAT(x) (((x) >> 5) & 0x1)
  167. #define C_00000D_TV_MAX_DYN_STOP_LAT 0xFFFFFFDF
  168. #define S_00000D_E2_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 6)
  169. #define G_00000D_E2_MAX_DYN_STOP_LAT(x) (((x) >> 6) & 0x1)
  170. #define C_00000D_E2_MAX_DYN_STOP_LAT 0xFFFFFFBF
  171. #define S_00000D_SE_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 7)
  172. #define G_00000D_SE_MAX_DYN_STOP_LAT(x) (((x) >> 7) & 0x1)
  173. #define C_00000D_SE_MAX_DYN_STOP_LAT 0xFFFFFF7F
  174. #define S_00000D_IDCT_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 8)
  175. #define G_00000D_IDCT_MAX_DYN_STOP_LAT(x) (((x) >> 8) & 0x1)
  176. #define C_00000D_IDCT_MAX_DYN_STOP_LAT 0xFFFFFEFF
  177. #define S_00000D_VIP_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 9)
  178. #define G_00000D_VIP_MAX_DYN_STOP_LAT(x) (((x) >> 9) & 0x1)
  179. #define C_00000D_VIP_MAX_DYN_STOP_LAT 0xFFFFFDFF
  180. #define S_00000D_RE_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 10)
  181. #define G_00000D_RE_MAX_DYN_STOP_LAT(x) (((x) >> 10) & 0x1)
  182. #define C_00000D_RE_MAX_DYN_STOP_LAT 0xFFFFFBFF
  183. #define S_00000D_PB_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 11)
  184. #define G_00000D_PB_MAX_DYN_STOP_LAT(x) (((x) >> 11) & 0x1)
  185. #define C_00000D_PB_MAX_DYN_STOP_LAT 0xFFFFF7FF
  186. #define S_00000D_TAM_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 12)
  187. #define G_00000D_TAM_MAX_DYN_STOP_LAT(x) (((x) >> 12) & 0x1)
  188. #define C_00000D_TAM_MAX_DYN_STOP_LAT 0xFFFFEFFF
  189. #define S_00000D_TDM_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 13)
  190. #define G_00000D_TDM_MAX_DYN_STOP_LAT(x) (((x) >> 13) & 0x1)
  191. #define C_00000D_TDM_MAX_DYN_STOP_LAT 0xFFFFDFFF
  192. #define S_00000D_RB_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 14)
  193. #define G_00000D_RB_MAX_DYN_STOP_LAT(x) (((x) >> 14) & 0x1)
  194. #define C_00000D_RB_MAX_DYN_STOP_LAT 0xFFFFBFFF
  195. #define S_00000D_FORCE_DISP2(x) (((x) & 0x1) << 15)
  196. #define G_00000D_FORCE_DISP2(x) (((x) >> 15) & 0x1)
  197. #define C_00000D_FORCE_DISP2 0xFFFF7FFF
  198. #define S_00000D_FORCE_CP(x) (((x) & 0x1) << 16)
  199. #define G_00000D_FORCE_CP(x) (((x) >> 16) & 0x1)
  200. #define C_00000D_FORCE_CP 0xFFFEFFFF
  201. #define S_00000D_FORCE_HDP(x) (((x) & 0x1) << 17)
  202. #define G_00000D_FORCE_HDP(x) (((x) >> 17) & 0x1)
  203. #define C_00000D_FORCE_HDP 0xFFFDFFFF
  204. #define S_00000D_FORCE_DISP1(x) (((x) & 0x1) << 18)
  205. #define G_00000D_FORCE_DISP1(x) (((x) >> 18) & 0x1)
  206. #define C_00000D_FORCE_DISP1 0xFFFBFFFF
  207. #define S_00000D_FORCE_TOP(x) (((x) & 0x1) << 19)
  208. #define G_00000D_FORCE_TOP(x) (((x) >> 19) & 0x1)
  209. #define C_00000D_FORCE_TOP 0xFFF7FFFF
  210. #define S_00000D_FORCE_E2(x) (((x) & 0x1) << 20)
  211. #define G_00000D_FORCE_E2(x) (((x) >> 20) & 0x1)
  212. #define C_00000D_FORCE_E2 0xFFEFFFFF
  213. #define S_00000D_FORCE_VAP(x) (((x) & 0x1) << 21)
  214. #define G_00000D_FORCE_VAP(x) (((x) >> 21) & 0x1)
  215. #define C_00000D_FORCE_VAP 0xFFDFFFFF
  216. #define S_00000D_FORCE_IDCT(x) (((x) & 0x1) << 22)
  217. #define G_00000D_FORCE_IDCT(x) (((x) >> 22) & 0x1)
  218. #define C_00000D_FORCE_IDCT 0xFFBFFFFF
  219. #define S_00000D_FORCE_VIP(x) (((x) & 0x1) << 23)
  220. #define G_00000D_FORCE_VIP(x) (((x) >> 23) & 0x1)
  221. #define C_00000D_FORCE_VIP 0xFF7FFFFF
  222. #define S_00000D_FORCE_RE(x) (((x) & 0x1) << 24)
  223. #define G_00000D_FORCE_RE(x) (((x) >> 24) & 0x1)
  224. #define C_00000D_FORCE_RE 0xFEFFFFFF
  225. #define S_00000D_FORCE_SR(x) (((x) & 0x1) << 25)
  226. #define G_00000D_FORCE_SR(x) (((x) >> 25) & 0x1)
  227. #define C_00000D_FORCE_SR 0xFDFFFFFF
  228. #define S_00000D_FORCE_PX(x) (((x) & 0x1) << 26)
  229. #define G_00000D_FORCE_PX(x) (((x) >> 26) & 0x1)
  230. #define C_00000D_FORCE_PX 0xFBFFFFFF
  231. #define S_00000D_FORCE_TX(x) (((x) & 0x1) << 27)
  232. #define G_00000D_FORCE_TX(x) (((x) >> 27) & 0x1)
  233. #define C_00000D_FORCE_TX 0xF7FFFFFF
  234. #define S_00000D_FORCE_US(x) (((x) & 0x1) << 28)
  235. #define G_00000D_FORCE_US(x) (((x) >> 28) & 0x1)
  236. #define C_00000D_FORCE_US 0xEFFFFFFF
  237. #define S_00000D_FORCE_TV_SCLK(x) (((x) & 0x1) << 29)
  238. #define G_00000D_FORCE_TV_SCLK(x) (((x) >> 29) & 0x1)
  239. #define C_00000D_FORCE_TV_SCLK 0xDFFFFFFF
  240. #define S_00000D_FORCE_SU(x) (((x) & 0x1) << 30)
  241. #define G_00000D_FORCE_SU(x) (((x) >> 30) & 0x1)
  242. #define C_00000D_FORCE_SU 0xBFFFFFFF
  243. #define S_00000D_FORCE_OV0(x) (((x) & 0x1) << 31)
  244. #define G_00000D_FORCE_OV0(x) (((x) >> 31) & 0x1)
  245. #define C_00000D_FORCE_OV0 0x7FFFFFFF
  246. #endif