r520d.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 __R520D_H__
  29. #define __R520D_H__
  30. /* Registers */
  31. #define R_0000F8_CONFIG_MEMSIZE 0x0000F8
  32. #define S_0000F8_CONFIG_MEMSIZE(x) (((x) & 0xFFFFFFFF) << 0)
  33. #define G_0000F8_CONFIG_MEMSIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  34. #define C_0000F8_CONFIG_MEMSIZE 0x00000000
  35. #define R_000134_HDP_FB_LOCATION 0x000134
  36. #define S_000134_HDP_FB_START(x) (((x) & 0xFFFF) << 0)
  37. #define G_000134_HDP_FB_START(x) (((x) >> 0) & 0xFFFF)
  38. #define C_000134_HDP_FB_START 0xFFFF0000
  39. #define R_0007C0_CP_STAT 0x0007C0
  40. #define S_0007C0_MRU_BUSY(x) (((x) & 0x1) << 0)
  41. #define G_0007C0_MRU_BUSY(x) (((x) >> 0) & 0x1)
  42. #define C_0007C0_MRU_BUSY 0xFFFFFFFE
  43. #define S_0007C0_MWU_BUSY(x) (((x) & 0x1) << 1)
  44. #define G_0007C0_MWU_BUSY(x) (((x) >> 1) & 0x1)
  45. #define C_0007C0_MWU_BUSY 0xFFFFFFFD
  46. #define S_0007C0_RSIU_BUSY(x) (((x) & 0x1) << 2)
  47. #define G_0007C0_RSIU_BUSY(x) (((x) >> 2) & 0x1)
  48. #define C_0007C0_RSIU_BUSY 0xFFFFFFFB
  49. #define S_0007C0_RCIU_BUSY(x) (((x) & 0x1) << 3)
  50. #define G_0007C0_RCIU_BUSY(x) (((x) >> 3) & 0x1)
  51. #define C_0007C0_RCIU_BUSY 0xFFFFFFF7
  52. #define S_0007C0_CSF_PRIMARY_BUSY(x) (((x) & 0x1) << 9)
  53. #define G_0007C0_CSF_PRIMARY_BUSY(x) (((x) >> 9) & 0x1)
  54. #define C_0007C0_CSF_PRIMARY_BUSY 0xFFFFFDFF
  55. #define S_0007C0_CSF_INDIRECT_BUSY(x) (((x) & 0x1) << 10)
  56. #define G_0007C0_CSF_INDIRECT_BUSY(x) (((x) >> 10) & 0x1)
  57. #define C_0007C0_CSF_INDIRECT_BUSY 0xFFFFFBFF
  58. #define S_0007C0_CSQ_PRIMARY_BUSY(x) (((x) & 0x1) << 11)
  59. #define G_0007C0_CSQ_PRIMARY_BUSY(x) (((x) >> 11) & 0x1)
  60. #define C_0007C0_CSQ_PRIMARY_BUSY 0xFFFFF7FF
  61. #define S_0007C0_CSQ_INDIRECT_BUSY(x) (((x) & 0x1) << 12)
  62. #define G_0007C0_CSQ_INDIRECT_BUSY(x) (((x) >> 12) & 0x1)
  63. #define C_0007C0_CSQ_INDIRECT_BUSY 0xFFFFEFFF
  64. #define S_0007C0_CSI_BUSY(x) (((x) & 0x1) << 13)
  65. #define G_0007C0_CSI_BUSY(x) (((x) >> 13) & 0x1)
  66. #define C_0007C0_CSI_BUSY 0xFFFFDFFF
  67. #define S_0007C0_CSF_INDIRECT2_BUSY(x) (((x) & 0x1) << 14)
  68. #define G_0007C0_CSF_INDIRECT2_BUSY(x) (((x) >> 14) & 0x1)
  69. #define C_0007C0_CSF_INDIRECT2_BUSY 0xFFFFBFFF
  70. #define S_0007C0_CSQ_INDIRECT2_BUSY(x) (((x) & 0x1) << 15)
  71. #define G_0007C0_CSQ_INDIRECT2_BUSY(x) (((x) >> 15) & 0x1)
  72. #define C_0007C0_CSQ_INDIRECT2_BUSY 0xFFFF7FFF
  73. #define S_0007C0_GUIDMA_BUSY(x) (((x) & 0x1) << 28)
  74. #define G_0007C0_GUIDMA_BUSY(x) (((x) >> 28) & 0x1)
  75. #define C_0007C0_GUIDMA_BUSY 0xEFFFFFFF
  76. #define S_0007C0_VIDDMA_BUSY(x) (((x) & 0x1) << 29)
  77. #define G_0007C0_VIDDMA_BUSY(x) (((x) >> 29) & 0x1)
  78. #define C_0007C0_VIDDMA_BUSY 0xDFFFFFFF
  79. #define S_0007C0_CMDSTRM_BUSY(x) (((x) & 0x1) << 30)
  80. #define G_0007C0_CMDSTRM_BUSY(x) (((x) >> 30) & 0x1)
  81. #define C_0007C0_CMDSTRM_BUSY 0xBFFFFFFF
  82. #define S_0007C0_CP_BUSY(x) (((x) & 0x1) << 31)
  83. #define G_0007C0_CP_BUSY(x) (((x) >> 31) & 0x1)
  84. #define C_0007C0_CP_BUSY 0x7FFFFFFF
  85. #define R_000E40_RBBM_STATUS 0x000E40
  86. #define S_000E40_CMDFIFO_AVAIL(x) (((x) & 0x7F) << 0)
  87. #define G_000E40_CMDFIFO_AVAIL(x) (((x) >> 0) & 0x7F)
  88. #define C_000E40_CMDFIFO_AVAIL 0xFFFFFF80
  89. #define S_000E40_HIRQ_ON_RBB(x) (((x) & 0x1) << 8)
  90. #define G_000E40_HIRQ_ON_RBB(x) (((x) >> 8) & 0x1)
  91. #define C_000E40_HIRQ_ON_RBB 0xFFFFFEFF
  92. #define S_000E40_CPRQ_ON_RBB(x) (((x) & 0x1) << 9)
  93. #define G_000E40_CPRQ_ON_RBB(x) (((x) >> 9) & 0x1)
  94. #define C_000E40_CPRQ_ON_RBB 0xFFFFFDFF
  95. #define S_000E40_CFRQ_ON_RBB(x) (((x) & 0x1) << 10)
  96. #define G_000E40_CFRQ_ON_RBB(x) (((x) >> 10) & 0x1)
  97. #define C_000E40_CFRQ_ON_RBB 0xFFFFFBFF
  98. #define S_000E40_HIRQ_IN_RTBUF(x) (((x) & 0x1) << 11)
  99. #define G_000E40_HIRQ_IN_RTBUF(x) (((x) >> 11) & 0x1)
  100. #define C_000E40_HIRQ_IN_RTBUF 0xFFFFF7FF
  101. #define S_000E40_CPRQ_IN_RTBUF(x) (((x) & 0x1) << 12)
  102. #define G_000E40_CPRQ_IN_RTBUF(x) (((x) >> 12) & 0x1)
  103. #define C_000E40_CPRQ_IN_RTBUF 0xFFFFEFFF
  104. #define S_000E40_CFRQ_IN_RTBUF(x) (((x) & 0x1) << 13)
  105. #define G_000E40_CFRQ_IN_RTBUF(x) (((x) >> 13) & 0x1)
  106. #define C_000E40_CFRQ_IN_RTBUF 0xFFFFDFFF
  107. #define S_000E40_CF_PIPE_BUSY(x) (((x) & 0x1) << 14)
  108. #define G_000E40_CF_PIPE_BUSY(x) (((x) >> 14) & 0x1)
  109. #define C_000E40_CF_PIPE_BUSY 0xFFFFBFFF
  110. #define S_000E40_ENG_EV_BUSY(x) (((x) & 0x1) << 15)
  111. #define G_000E40_ENG_EV_BUSY(x) (((x) >> 15) & 0x1)
  112. #define C_000E40_ENG_EV_BUSY 0xFFFF7FFF
  113. #define S_000E40_CP_CMDSTRM_BUSY(x) (((x) & 0x1) << 16)
  114. #define G_000E40_CP_CMDSTRM_BUSY(x) (((x) >> 16) & 0x1)
  115. #define C_000E40_CP_CMDSTRM_BUSY 0xFFFEFFFF
  116. #define S_000E40_E2_BUSY(x) (((x) & 0x1) << 17)
  117. #define G_000E40_E2_BUSY(x) (((x) >> 17) & 0x1)
  118. #define C_000E40_E2_BUSY 0xFFFDFFFF
  119. #define S_000E40_RB2D_BUSY(x) (((x) & 0x1) << 18)
  120. #define G_000E40_RB2D_BUSY(x) (((x) >> 18) & 0x1)
  121. #define C_000E40_RB2D_BUSY 0xFFFBFFFF
  122. #define S_000E40_RB3D_BUSY(x) (((x) & 0x1) << 19)
  123. #define G_000E40_RB3D_BUSY(x) (((x) >> 19) & 0x1)
  124. #define C_000E40_RB3D_BUSY 0xFFF7FFFF
  125. #define S_000E40_VAP_BUSY(x) (((x) & 0x1) << 20)
  126. #define G_000E40_VAP_BUSY(x) (((x) >> 20) & 0x1)
  127. #define C_000E40_VAP_BUSY 0xFFEFFFFF
  128. #define S_000E40_RE_BUSY(x) (((x) & 0x1) << 21)
  129. #define G_000E40_RE_BUSY(x) (((x) >> 21) & 0x1)
  130. #define C_000E40_RE_BUSY 0xFFDFFFFF
  131. #define S_000E40_TAM_BUSY(x) (((x) & 0x1) << 22)
  132. #define G_000E40_TAM_BUSY(x) (((x) >> 22) & 0x1)
  133. #define C_000E40_TAM_BUSY 0xFFBFFFFF
  134. #define S_000E40_TDM_BUSY(x) (((x) & 0x1) << 23)
  135. #define G_000E40_TDM_BUSY(x) (((x) >> 23) & 0x1)
  136. #define C_000E40_TDM_BUSY 0xFF7FFFFF
  137. #define S_000E40_PB_BUSY(x) (((x) & 0x1) << 24)
  138. #define G_000E40_PB_BUSY(x) (((x) >> 24) & 0x1)
  139. #define C_000E40_PB_BUSY 0xFEFFFFFF
  140. #define S_000E40_TIM_BUSY(x) (((x) & 0x1) << 25)
  141. #define G_000E40_TIM_BUSY(x) (((x) >> 25) & 0x1)
  142. #define C_000E40_TIM_BUSY 0xFDFFFFFF
  143. #define S_000E40_GA_BUSY(x) (((x) & 0x1) << 26)
  144. #define G_000E40_GA_BUSY(x) (((x) >> 26) & 0x1)
  145. #define C_000E40_GA_BUSY 0xFBFFFFFF
  146. #define S_000E40_CBA2D_BUSY(x) (((x) & 0x1) << 27)
  147. #define G_000E40_CBA2D_BUSY(x) (((x) >> 27) & 0x1)
  148. #define C_000E40_CBA2D_BUSY 0xF7FFFFFF
  149. #define S_000E40_RBBM_HIBUSY(x) (((x) & 0x1) << 28)
  150. #define G_000E40_RBBM_HIBUSY(x) (((x) >> 28) & 0x1)
  151. #define C_000E40_RBBM_HIBUSY 0xEFFFFFFF
  152. #define S_000E40_SKID_CFBUSY(x) (((x) & 0x1) << 29)
  153. #define G_000E40_SKID_CFBUSY(x) (((x) >> 29) & 0x1)
  154. #define C_000E40_SKID_CFBUSY 0xDFFFFFFF
  155. #define S_000E40_VAP_VF_BUSY(x) (((x) & 0x1) << 30)
  156. #define G_000E40_VAP_VF_BUSY(x) (((x) >> 30) & 0x1)
  157. #define C_000E40_VAP_VF_BUSY 0xBFFFFFFF
  158. #define S_000E40_GUI_ACTIVE(x) (((x) & 0x1) << 31)
  159. #define G_000E40_GUI_ACTIVE(x) (((x) >> 31) & 0x1)
  160. #define C_000E40_GUI_ACTIVE 0x7FFFFFFF
  161. #define R_000004_MC_FB_LOCATION 0x000004
  162. #define S_000004_MC_FB_START(x) (((x) & 0xFFFF) << 0)
  163. #define G_000004_MC_FB_START(x) (((x) >> 0) & 0xFFFF)
  164. #define C_000004_MC_FB_START 0xFFFF0000
  165. #define S_000004_MC_FB_TOP(x) (((x) & 0xFFFF) << 16)
  166. #define G_000004_MC_FB_TOP(x) (((x) >> 16) & 0xFFFF)
  167. #define C_000004_MC_FB_TOP 0x0000FFFF
  168. #define R_000005_MC_AGP_LOCATION 0x000005
  169. #define S_000005_MC_AGP_START(x) (((x) & 0xFFFF) << 0)
  170. #define G_000005_MC_AGP_START(x) (((x) >> 0) & 0xFFFF)
  171. #define C_000005_MC_AGP_START 0xFFFF0000
  172. #define S_000005_MC_AGP_TOP(x) (((x) & 0xFFFF) << 16)
  173. #define G_000005_MC_AGP_TOP(x) (((x) >> 16) & 0xFFFF)
  174. #define C_000005_MC_AGP_TOP 0x0000FFFF
  175. #define R_000006_AGP_BASE 0x000006
  176. #define S_000006_AGP_BASE_ADDR(x) (((x) & 0xFFFFFFFF) << 0)
  177. #define G_000006_AGP_BASE_ADDR(x) (((x) >> 0) & 0xFFFFFFFF)
  178. #define C_000006_AGP_BASE_ADDR 0x00000000
  179. #define R_000007_AGP_BASE_2 0x000007
  180. #define S_000007_AGP_BASE_ADDR_2(x) (((x) & 0xF) << 0)
  181. #define G_000007_AGP_BASE_ADDR_2(x) (((x) >> 0) & 0xF)
  182. #define C_000007_AGP_BASE_ADDR_2 0xFFFFFFF0
  183. #endif