rs600d.h 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  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 __RS600D_H__
  29. #define __RS600D_H__
  30. /* Registers */
  31. #define R_000040_GEN_INT_CNTL 0x000040
  32. #define S_000040_SCRATCH_INT_MASK(x) (((x) & 0x1) << 18)
  33. #define G_000040_SCRATCH_INT_MASK(x) (((x) >> 18) & 0x1)
  34. #define C_000040_SCRATCH_INT_MASK 0xFFFBFFFF
  35. #define S_000040_GUI_IDLE_MASK(x) (((x) & 0x1) << 19)
  36. #define G_000040_GUI_IDLE_MASK(x) (((x) >> 19) & 0x1)
  37. #define C_000040_GUI_IDLE_MASK 0xFFF7FFFF
  38. #define S_000040_DMA_VIPH1_INT_EN(x) (((x) & 0x1) << 13)
  39. #define G_000040_DMA_VIPH1_INT_EN(x) (((x) >> 13) & 0x1)
  40. #define C_000040_DMA_VIPH1_INT_EN 0xFFFFDFFF
  41. #define S_000040_DMA_VIPH2_INT_EN(x) (((x) & 0x1) << 14)
  42. #define G_000040_DMA_VIPH2_INT_EN(x) (((x) >> 14) & 0x1)
  43. #define C_000040_DMA_VIPH2_INT_EN 0xFFFFBFFF
  44. #define S_000040_DMA_VIPH3_INT_EN(x) (((x) & 0x1) << 15)
  45. #define G_000040_DMA_VIPH3_INT_EN(x) (((x) >> 15) & 0x1)
  46. #define C_000040_DMA_VIPH3_INT_EN 0xFFFF7FFF
  47. #define S_000040_I2C_INT_EN(x) (((x) & 0x1) << 17)
  48. #define G_000040_I2C_INT_EN(x) (((x) >> 17) & 0x1)
  49. #define C_000040_I2C_INT_EN 0xFFFDFFFF
  50. #define S_000040_GUI_IDLE(x) (((x) & 0x1) << 19)
  51. #define G_000040_GUI_IDLE(x) (((x) >> 19) & 0x1)
  52. #define C_000040_GUI_IDLE 0xFFF7FFFF
  53. #define S_000040_VIPH_INT_EN(x) (((x) & 0x1) << 24)
  54. #define G_000040_VIPH_INT_EN(x) (((x) >> 24) & 0x1)
  55. #define C_000040_VIPH_INT_EN 0xFEFFFFFF
  56. #define S_000040_SW_INT_EN(x) (((x) & 0x1) << 25)
  57. #define G_000040_SW_INT_EN(x) (((x) >> 25) & 0x1)
  58. #define C_000040_SW_INT_EN 0xFDFFFFFF
  59. #define S_000040_GEYSERVILLE(x) (((x) & 0x1) << 27)
  60. #define G_000040_GEYSERVILLE(x) (((x) >> 27) & 0x1)
  61. #define C_000040_GEYSERVILLE 0xF7FFFFFF
  62. #define S_000040_HDCP_AUTHORIZED_INT(x) (((x) & 0x1) << 28)
  63. #define G_000040_HDCP_AUTHORIZED_INT(x) (((x) >> 28) & 0x1)
  64. #define C_000040_HDCP_AUTHORIZED_INT 0xEFFFFFFF
  65. #define S_000040_DVI_I2C_INT(x) (((x) & 0x1) << 29)
  66. #define G_000040_DVI_I2C_INT(x) (((x) >> 29) & 0x1)
  67. #define C_000040_DVI_I2C_INT 0xDFFFFFFF
  68. #define S_000040_GUIDMA(x) (((x) & 0x1) << 30)
  69. #define G_000040_GUIDMA(x) (((x) >> 30) & 0x1)
  70. #define C_000040_GUIDMA 0xBFFFFFFF
  71. #define S_000040_VIDDMA(x) (((x) & 0x1) << 31)
  72. #define G_000040_VIDDMA(x) (((x) >> 31) & 0x1)
  73. #define C_000040_VIDDMA 0x7FFFFFFF
  74. #define R_000044_GEN_INT_STATUS 0x000044
  75. #define S_000044_DISPLAY_INT_STAT(x) (((x) & 0x1) << 0)
  76. #define G_000044_DISPLAY_INT_STAT(x) (((x) >> 0) & 0x1)
  77. #define C_000044_DISPLAY_INT_STAT 0xFFFFFFFE
  78. #define S_000044_VGA_INT_STAT(x) (((x) & 0x1) << 1)
  79. #define G_000044_VGA_INT_STAT(x) (((x) >> 1) & 0x1)
  80. #define C_000044_VGA_INT_STAT 0xFFFFFFFD
  81. #define S_000044_CAP0_INT_ACTIVE(x) (((x) & 0x1) << 8)
  82. #define G_000044_CAP0_INT_ACTIVE(x) (((x) >> 8) & 0x1)
  83. #define C_000044_CAP0_INT_ACTIVE 0xFFFFFEFF
  84. #define S_000044_DMA_VIPH0_INT(x) (((x) & 0x1) << 12)
  85. #define G_000044_DMA_VIPH0_INT(x) (((x) >> 12) & 0x1)
  86. #define C_000044_DMA_VIPH0_INT 0xFFFFEFFF
  87. #define S_000044_DMA_VIPH1_INT(x) (((x) & 0x1) << 13)
  88. #define G_000044_DMA_VIPH1_INT(x) (((x) >> 13) & 0x1)
  89. #define C_000044_DMA_VIPH1_INT 0xFFFFDFFF
  90. #define S_000044_DMA_VIPH2_INT(x) (((x) & 0x1) << 14)
  91. #define G_000044_DMA_VIPH2_INT(x) (((x) >> 14) & 0x1)
  92. #define C_000044_DMA_VIPH2_INT 0xFFFFBFFF
  93. #define S_000044_DMA_VIPH3_INT(x) (((x) & 0x1) << 15)
  94. #define G_000044_DMA_VIPH3_INT(x) (((x) >> 15) & 0x1)
  95. #define C_000044_DMA_VIPH3_INT 0xFFFF7FFF
  96. #define S_000044_MC_PROBE_FAULT_STAT(x) (((x) & 0x1) << 16)
  97. #define G_000044_MC_PROBE_FAULT_STAT(x) (((x) >> 16) & 0x1)
  98. #define C_000044_MC_PROBE_FAULT_STAT 0xFFFEFFFF
  99. #define S_000044_I2C_INT(x) (((x) & 0x1) << 17)
  100. #define G_000044_I2C_INT(x) (((x) >> 17) & 0x1)
  101. #define C_000044_I2C_INT 0xFFFDFFFF
  102. #define S_000044_SCRATCH_INT_STAT(x) (((x) & 0x1) << 18)
  103. #define G_000044_SCRATCH_INT_STAT(x) (((x) >> 18) & 0x1)
  104. #define C_000044_SCRATCH_INT_STAT 0xFFFBFFFF
  105. #define S_000044_GUI_IDLE_STAT(x) (((x) & 0x1) << 19)
  106. #define G_000044_GUI_IDLE_STAT(x) (((x) >> 19) & 0x1)
  107. #define C_000044_GUI_IDLE_STAT 0xFFF7FFFF
  108. #define S_000044_ATI_OVERDRIVE_INT_STAT(x) (((x) & 0x1) << 20)
  109. #define G_000044_ATI_OVERDRIVE_INT_STAT(x) (((x) >> 20) & 0x1)
  110. #define C_000044_ATI_OVERDRIVE_INT_STAT 0xFFEFFFFF
  111. #define S_000044_MC_PROTECTION_FAULT_STAT(x) (((x) & 0x1) << 21)
  112. #define G_000044_MC_PROTECTION_FAULT_STAT(x) (((x) >> 21) & 0x1)
  113. #define C_000044_MC_PROTECTION_FAULT_STAT 0xFFDFFFFF
  114. #define S_000044_RBBM_READ_INT_STAT(x) (((x) & 0x1) << 22)
  115. #define G_000044_RBBM_READ_INT_STAT(x) (((x) >> 22) & 0x1)
  116. #define C_000044_RBBM_READ_INT_STAT 0xFFBFFFFF
  117. #define S_000044_CB_CONTEXT_SWITCH_STAT(x) (((x) & 0x1) << 23)
  118. #define G_000044_CB_CONTEXT_SWITCH_STAT(x) (((x) >> 23) & 0x1)
  119. #define C_000044_CB_CONTEXT_SWITCH_STAT 0xFF7FFFFF
  120. #define S_000044_VIPH_INT(x) (((x) & 0x1) << 24)
  121. #define G_000044_VIPH_INT(x) (((x) >> 24) & 0x1)
  122. #define C_000044_VIPH_INT 0xFEFFFFFF
  123. #define S_000044_SW_INT(x) (((x) & 0x1) << 25)
  124. #define G_000044_SW_INT(x) (((x) >> 25) & 0x1)
  125. #define C_000044_SW_INT 0xFDFFFFFF
  126. #define S_000044_SW_INT_SET(x) (((x) & 0x1) << 26)
  127. #define G_000044_SW_INT_SET(x) (((x) >> 26) & 0x1)
  128. #define C_000044_SW_INT_SET 0xFBFFFFFF
  129. #define S_000044_IDCT_INT_STAT(x) (((x) & 0x1) << 27)
  130. #define G_000044_IDCT_INT_STAT(x) (((x) >> 27) & 0x1)
  131. #define C_000044_IDCT_INT_STAT 0xF7FFFFFF
  132. #define S_000044_GUIDMA_STAT(x) (((x) & 0x1) << 30)
  133. #define G_000044_GUIDMA_STAT(x) (((x) >> 30) & 0x1)
  134. #define C_000044_GUIDMA_STAT 0xBFFFFFFF
  135. #define S_000044_VIDDMA_STAT(x) (((x) & 0x1) << 31)
  136. #define G_000044_VIDDMA_STAT(x) (((x) >> 31) & 0x1)
  137. #define C_000044_VIDDMA_STAT 0x7FFFFFFF
  138. #define R_00004C_BUS_CNTL 0x00004C
  139. #define S_00004C_BUS_MASTER_DIS(x) (((x) & 0x1) << 14)
  140. #define G_00004C_BUS_MASTER_DIS(x) (((x) >> 14) & 0x1)
  141. #define C_00004C_BUS_MASTER_DIS 0xFFFFBFFF
  142. #define S_00004C_BUS_MSI_REARM(x) (((x) & 0x1) << 20)
  143. #define G_00004C_BUS_MSI_REARM(x) (((x) >> 20) & 0x1)
  144. #define C_00004C_BUS_MSI_REARM 0xFFEFFFFF
  145. #define R_000070_MC_IND_INDEX 0x000070
  146. #define S_000070_MC_IND_ADDR(x) (((x) & 0xFFFF) << 0)
  147. #define G_000070_MC_IND_ADDR(x) (((x) >> 0) & 0xFFFF)
  148. #define C_000070_MC_IND_ADDR 0xFFFF0000
  149. #define S_000070_MC_IND_SEQ_RBS_0(x) (((x) & 0x1) << 16)
  150. #define G_000070_MC_IND_SEQ_RBS_0(x) (((x) >> 16) & 0x1)
  151. #define C_000070_MC_IND_SEQ_RBS_0 0xFFFEFFFF
  152. #define S_000070_MC_IND_SEQ_RBS_1(x) (((x) & 0x1) << 17)
  153. #define G_000070_MC_IND_SEQ_RBS_1(x) (((x) >> 17) & 0x1)
  154. #define C_000070_MC_IND_SEQ_RBS_1 0xFFFDFFFF
  155. #define S_000070_MC_IND_SEQ_RBS_2(x) (((x) & 0x1) << 18)
  156. #define G_000070_MC_IND_SEQ_RBS_2(x) (((x) >> 18) & 0x1)
  157. #define C_000070_MC_IND_SEQ_RBS_2 0xFFFBFFFF
  158. #define S_000070_MC_IND_SEQ_RBS_3(x) (((x) & 0x1) << 19)
  159. #define G_000070_MC_IND_SEQ_RBS_3(x) (((x) >> 19) & 0x1)
  160. #define C_000070_MC_IND_SEQ_RBS_3 0xFFF7FFFF
  161. #define S_000070_MC_IND_AIC_RBS(x) (((x) & 0x1) << 20)
  162. #define G_000070_MC_IND_AIC_RBS(x) (((x) >> 20) & 0x1)
  163. #define C_000070_MC_IND_AIC_RBS 0xFFEFFFFF
  164. #define S_000070_MC_IND_CITF_ARB0(x) (((x) & 0x1) << 21)
  165. #define G_000070_MC_IND_CITF_ARB0(x) (((x) >> 21) & 0x1)
  166. #define C_000070_MC_IND_CITF_ARB0 0xFFDFFFFF
  167. #define S_000070_MC_IND_CITF_ARB1(x) (((x) & 0x1) << 22)
  168. #define G_000070_MC_IND_CITF_ARB1(x) (((x) >> 22) & 0x1)
  169. #define C_000070_MC_IND_CITF_ARB1 0xFFBFFFFF
  170. #define S_000070_MC_IND_WR_EN(x) (((x) & 0x1) << 23)
  171. #define G_000070_MC_IND_WR_EN(x) (((x) >> 23) & 0x1)
  172. #define C_000070_MC_IND_WR_EN 0xFF7FFFFF
  173. #define S_000070_MC_IND_RD_INV(x) (((x) & 0x1) << 24)
  174. #define G_000070_MC_IND_RD_INV(x) (((x) >> 24) & 0x1)
  175. #define C_000070_MC_IND_RD_INV 0xFEFFFFFF
  176. #define R_000074_MC_IND_DATA 0x000074
  177. #define S_000074_MC_IND_DATA(x) (((x) & 0xFFFFFFFF) << 0)
  178. #define G_000074_MC_IND_DATA(x) (((x) >> 0) & 0xFFFFFFFF)
  179. #define C_000074_MC_IND_DATA 0x00000000
  180. #define R_0000F0_RBBM_SOFT_RESET 0x0000F0
  181. #define S_0000F0_SOFT_RESET_CP(x) (((x) & 0x1) << 0)
  182. #define G_0000F0_SOFT_RESET_CP(x) (((x) >> 0) & 0x1)
  183. #define C_0000F0_SOFT_RESET_CP 0xFFFFFFFE
  184. #define S_0000F0_SOFT_RESET_HI(x) (((x) & 0x1) << 1)
  185. #define G_0000F0_SOFT_RESET_HI(x) (((x) >> 1) & 0x1)
  186. #define C_0000F0_SOFT_RESET_HI 0xFFFFFFFD
  187. #define S_0000F0_SOFT_RESET_VAP(x) (((x) & 0x1) << 2)
  188. #define G_0000F0_SOFT_RESET_VAP(x) (((x) >> 2) & 0x1)
  189. #define C_0000F0_SOFT_RESET_VAP 0xFFFFFFFB
  190. #define S_0000F0_SOFT_RESET_RE(x) (((x) & 0x1) << 3)
  191. #define G_0000F0_SOFT_RESET_RE(x) (((x) >> 3) & 0x1)
  192. #define C_0000F0_SOFT_RESET_RE 0xFFFFFFF7
  193. #define S_0000F0_SOFT_RESET_PP(x) (((x) & 0x1) << 4)
  194. #define G_0000F0_SOFT_RESET_PP(x) (((x) >> 4) & 0x1)
  195. #define C_0000F0_SOFT_RESET_PP 0xFFFFFFEF
  196. #define S_0000F0_SOFT_RESET_E2(x) (((x) & 0x1) << 5)
  197. #define G_0000F0_SOFT_RESET_E2(x) (((x) >> 5) & 0x1)
  198. #define C_0000F0_SOFT_RESET_E2 0xFFFFFFDF
  199. #define S_0000F0_SOFT_RESET_RB(x) (((x) & 0x1) << 6)
  200. #define G_0000F0_SOFT_RESET_RB(x) (((x) >> 6) & 0x1)
  201. #define C_0000F0_SOFT_RESET_RB 0xFFFFFFBF
  202. #define S_0000F0_SOFT_RESET_HDP(x) (((x) & 0x1) << 7)
  203. #define G_0000F0_SOFT_RESET_HDP(x) (((x) >> 7) & 0x1)
  204. #define C_0000F0_SOFT_RESET_HDP 0xFFFFFF7F
  205. #define S_0000F0_SOFT_RESET_MC(x) (((x) & 0x1) << 8)
  206. #define G_0000F0_SOFT_RESET_MC(x) (((x) >> 8) & 0x1)
  207. #define C_0000F0_SOFT_RESET_MC 0xFFFFFEFF
  208. #define S_0000F0_SOFT_RESET_AIC(x) (((x) & 0x1) << 9)
  209. #define G_0000F0_SOFT_RESET_AIC(x) (((x) >> 9) & 0x1)
  210. #define C_0000F0_SOFT_RESET_AIC 0xFFFFFDFF
  211. #define S_0000F0_SOFT_RESET_VIP(x) (((x) & 0x1) << 10)
  212. #define G_0000F0_SOFT_RESET_VIP(x) (((x) >> 10) & 0x1)
  213. #define C_0000F0_SOFT_RESET_VIP 0xFFFFFBFF
  214. #define S_0000F0_SOFT_RESET_DISP(x) (((x) & 0x1) << 11)
  215. #define G_0000F0_SOFT_RESET_DISP(x) (((x) >> 11) & 0x1)
  216. #define C_0000F0_SOFT_RESET_DISP 0xFFFFF7FF
  217. #define S_0000F0_SOFT_RESET_CG(x) (((x) & 0x1) << 12)
  218. #define G_0000F0_SOFT_RESET_CG(x) (((x) >> 12) & 0x1)
  219. #define C_0000F0_SOFT_RESET_CG 0xFFFFEFFF
  220. #define S_0000F0_SOFT_RESET_GA(x) (((x) & 0x1) << 13)
  221. #define G_0000F0_SOFT_RESET_GA(x) (((x) >> 13) & 0x1)
  222. #define C_0000F0_SOFT_RESET_GA 0xFFFFDFFF
  223. #define S_0000F0_SOFT_RESET_IDCT(x) (((x) & 0x1) << 14)
  224. #define G_0000F0_SOFT_RESET_IDCT(x) (((x) >> 14) & 0x1)
  225. #define C_0000F0_SOFT_RESET_IDCT 0xFFFFBFFF
  226. #define R_000134_HDP_FB_LOCATION 0x000134
  227. #define S_000134_HDP_FB_START(x) (((x) & 0xFFFF) << 0)
  228. #define G_000134_HDP_FB_START(x) (((x) >> 0) & 0xFFFF)
  229. #define C_000134_HDP_FB_START 0xFFFF0000
  230. #define R_0007C0_CP_STAT 0x0007C0
  231. #define S_0007C0_MRU_BUSY(x) (((x) & 0x1) << 0)
  232. #define G_0007C0_MRU_BUSY(x) (((x) >> 0) & 0x1)
  233. #define C_0007C0_MRU_BUSY 0xFFFFFFFE
  234. #define S_0007C0_MWU_BUSY(x) (((x) & 0x1) << 1)
  235. #define G_0007C0_MWU_BUSY(x) (((x) >> 1) & 0x1)
  236. #define C_0007C0_MWU_BUSY 0xFFFFFFFD
  237. #define S_0007C0_RSIU_BUSY(x) (((x) & 0x1) << 2)
  238. #define G_0007C0_RSIU_BUSY(x) (((x) >> 2) & 0x1)
  239. #define C_0007C0_RSIU_BUSY 0xFFFFFFFB
  240. #define S_0007C0_RCIU_BUSY(x) (((x) & 0x1) << 3)
  241. #define G_0007C0_RCIU_BUSY(x) (((x) >> 3) & 0x1)
  242. #define C_0007C0_RCIU_BUSY 0xFFFFFFF7
  243. #define S_0007C0_CSF_PRIMARY_BUSY(x) (((x) & 0x1) << 9)
  244. #define G_0007C0_CSF_PRIMARY_BUSY(x) (((x) >> 9) & 0x1)
  245. #define C_0007C0_CSF_PRIMARY_BUSY 0xFFFFFDFF
  246. #define S_0007C0_CSF_INDIRECT_BUSY(x) (((x) & 0x1) << 10)
  247. #define G_0007C0_CSF_INDIRECT_BUSY(x) (((x) >> 10) & 0x1)
  248. #define C_0007C0_CSF_INDIRECT_BUSY 0xFFFFFBFF
  249. #define S_0007C0_CSQ_PRIMARY_BUSY(x) (((x) & 0x1) << 11)
  250. #define G_0007C0_CSQ_PRIMARY_BUSY(x) (((x) >> 11) & 0x1)
  251. #define C_0007C0_CSQ_PRIMARY_BUSY 0xFFFFF7FF
  252. #define S_0007C0_CSQ_INDIRECT_BUSY(x) (((x) & 0x1) << 12)
  253. #define G_0007C0_CSQ_INDIRECT_BUSY(x) (((x) >> 12) & 0x1)
  254. #define C_0007C0_CSQ_INDIRECT_BUSY 0xFFFFEFFF
  255. #define S_0007C0_CSI_BUSY(x) (((x) & 0x1) << 13)
  256. #define G_0007C0_CSI_BUSY(x) (((x) >> 13) & 0x1)
  257. #define C_0007C0_CSI_BUSY 0xFFFFDFFF
  258. #define S_0007C0_CSF_INDIRECT2_BUSY(x) (((x) & 0x1) << 14)
  259. #define G_0007C0_CSF_INDIRECT2_BUSY(x) (((x) >> 14) & 0x1)
  260. #define C_0007C0_CSF_INDIRECT2_BUSY 0xFFFFBFFF
  261. #define S_0007C0_CSQ_INDIRECT2_BUSY(x) (((x) & 0x1) << 15)
  262. #define G_0007C0_CSQ_INDIRECT2_BUSY(x) (((x) >> 15) & 0x1)
  263. #define C_0007C0_CSQ_INDIRECT2_BUSY 0xFFFF7FFF
  264. #define S_0007C0_GUIDMA_BUSY(x) (((x) & 0x1) << 28)
  265. #define G_0007C0_GUIDMA_BUSY(x) (((x) >> 28) & 0x1)
  266. #define C_0007C0_GUIDMA_BUSY 0xEFFFFFFF
  267. #define S_0007C0_VIDDMA_BUSY(x) (((x) & 0x1) << 29)
  268. #define G_0007C0_VIDDMA_BUSY(x) (((x) >> 29) & 0x1)
  269. #define C_0007C0_VIDDMA_BUSY 0xDFFFFFFF
  270. #define S_0007C0_CMDSTRM_BUSY(x) (((x) & 0x1) << 30)
  271. #define G_0007C0_CMDSTRM_BUSY(x) (((x) >> 30) & 0x1)
  272. #define C_0007C0_CMDSTRM_BUSY 0xBFFFFFFF
  273. #define S_0007C0_CP_BUSY(x) (((x) & 0x1) << 31)
  274. #define G_0007C0_CP_BUSY(x) (((x) >> 31) & 0x1)
  275. #define C_0007C0_CP_BUSY 0x7FFFFFFF
  276. #define R_000E40_RBBM_STATUS 0x000E40
  277. #define S_000E40_CMDFIFO_AVAIL(x) (((x) & 0x7F) << 0)
  278. #define G_000E40_CMDFIFO_AVAIL(x) (((x) >> 0) & 0x7F)
  279. #define C_000E40_CMDFIFO_AVAIL 0xFFFFFF80
  280. #define S_000E40_HIRQ_ON_RBB(x) (((x) & 0x1) << 8)
  281. #define G_000E40_HIRQ_ON_RBB(x) (((x) >> 8) & 0x1)
  282. #define C_000E40_HIRQ_ON_RBB 0xFFFFFEFF
  283. #define S_000E40_CPRQ_ON_RBB(x) (((x) & 0x1) << 9)
  284. #define G_000E40_CPRQ_ON_RBB(x) (((x) >> 9) & 0x1)
  285. #define C_000E40_CPRQ_ON_RBB 0xFFFFFDFF
  286. #define S_000E40_CFRQ_ON_RBB(x) (((x) & 0x1) << 10)
  287. #define G_000E40_CFRQ_ON_RBB(x) (((x) >> 10) & 0x1)
  288. #define C_000E40_CFRQ_ON_RBB 0xFFFFFBFF
  289. #define S_000E40_HIRQ_IN_RTBUF(x) (((x) & 0x1) << 11)
  290. #define G_000E40_HIRQ_IN_RTBUF(x) (((x) >> 11) & 0x1)
  291. #define C_000E40_HIRQ_IN_RTBUF 0xFFFFF7FF
  292. #define S_000E40_CPRQ_IN_RTBUF(x) (((x) & 0x1) << 12)
  293. #define G_000E40_CPRQ_IN_RTBUF(x) (((x) >> 12) & 0x1)
  294. #define C_000E40_CPRQ_IN_RTBUF 0xFFFFEFFF
  295. #define S_000E40_CFRQ_IN_RTBUF(x) (((x) & 0x1) << 13)
  296. #define G_000E40_CFRQ_IN_RTBUF(x) (((x) >> 13) & 0x1)
  297. #define C_000E40_CFRQ_IN_RTBUF 0xFFFFDFFF
  298. #define S_000E40_CF_PIPE_BUSY(x) (((x) & 0x1) << 14)
  299. #define G_000E40_CF_PIPE_BUSY(x) (((x) >> 14) & 0x1)
  300. #define C_000E40_CF_PIPE_BUSY 0xFFFFBFFF
  301. #define S_000E40_ENG_EV_BUSY(x) (((x) & 0x1) << 15)
  302. #define G_000E40_ENG_EV_BUSY(x) (((x) >> 15) & 0x1)
  303. #define C_000E40_ENG_EV_BUSY 0xFFFF7FFF
  304. #define S_000E40_CP_CMDSTRM_BUSY(x) (((x) & 0x1) << 16)
  305. #define G_000E40_CP_CMDSTRM_BUSY(x) (((x) >> 16) & 0x1)
  306. #define C_000E40_CP_CMDSTRM_BUSY 0xFFFEFFFF
  307. #define S_000E40_E2_BUSY(x) (((x) & 0x1) << 17)
  308. #define G_000E40_E2_BUSY(x) (((x) >> 17) & 0x1)
  309. #define C_000E40_E2_BUSY 0xFFFDFFFF
  310. #define S_000E40_RB2D_BUSY(x) (((x) & 0x1) << 18)
  311. #define G_000E40_RB2D_BUSY(x) (((x) >> 18) & 0x1)
  312. #define C_000E40_RB2D_BUSY 0xFFFBFFFF
  313. #define S_000E40_RB3D_BUSY(x) (((x) & 0x1) << 19)
  314. #define G_000E40_RB3D_BUSY(x) (((x) >> 19) & 0x1)
  315. #define C_000E40_RB3D_BUSY 0xFFF7FFFF
  316. #define S_000E40_VAP_BUSY(x) (((x) & 0x1) << 20)
  317. #define G_000E40_VAP_BUSY(x) (((x) >> 20) & 0x1)
  318. #define C_000E40_VAP_BUSY 0xFFEFFFFF
  319. #define S_000E40_RE_BUSY(x) (((x) & 0x1) << 21)
  320. #define G_000E40_RE_BUSY(x) (((x) >> 21) & 0x1)
  321. #define C_000E40_RE_BUSY 0xFFDFFFFF
  322. #define S_000E40_TAM_BUSY(x) (((x) & 0x1) << 22)
  323. #define G_000E40_TAM_BUSY(x) (((x) >> 22) & 0x1)
  324. #define C_000E40_TAM_BUSY 0xFFBFFFFF
  325. #define S_000E40_TDM_BUSY(x) (((x) & 0x1) << 23)
  326. #define G_000E40_TDM_BUSY(x) (((x) >> 23) & 0x1)
  327. #define C_000E40_TDM_BUSY 0xFF7FFFFF
  328. #define S_000E40_PB_BUSY(x) (((x) & 0x1) << 24)
  329. #define G_000E40_PB_BUSY(x) (((x) >> 24) & 0x1)
  330. #define C_000E40_PB_BUSY 0xFEFFFFFF
  331. #define S_000E40_TIM_BUSY(x) (((x) & 0x1) << 25)
  332. #define G_000E40_TIM_BUSY(x) (((x) >> 25) & 0x1)
  333. #define C_000E40_TIM_BUSY 0xFDFFFFFF
  334. #define S_000E40_GA_BUSY(x) (((x) & 0x1) << 26)
  335. #define G_000E40_GA_BUSY(x) (((x) >> 26) & 0x1)
  336. #define C_000E40_GA_BUSY 0xFBFFFFFF
  337. #define S_000E40_CBA2D_BUSY(x) (((x) & 0x1) << 27)
  338. #define G_000E40_CBA2D_BUSY(x) (((x) >> 27) & 0x1)
  339. #define C_000E40_CBA2D_BUSY 0xF7FFFFFF
  340. #define S_000E40_GUI_ACTIVE(x) (((x) & 0x1) << 31)
  341. #define G_000E40_GUI_ACTIVE(x) (((x) >> 31) & 0x1)
  342. #define C_000E40_GUI_ACTIVE 0x7FFFFFFF
  343. #define R_0060A4_D1CRTC_STATUS_FRAME_COUNT 0x0060A4
  344. #define S_0060A4_D1CRTC_FRAME_COUNT(x) (((x) & 0xFFFFFF) << 0)
  345. #define G_0060A4_D1CRTC_FRAME_COUNT(x) (((x) >> 0) & 0xFFFFFF)
  346. #define C_0060A4_D1CRTC_FRAME_COUNT 0xFF000000
  347. #define R_006534_D1MODE_VBLANK_STATUS 0x006534
  348. #define S_006534_D1MODE_VBLANK_OCCURRED(x) (((x) & 0x1) << 0)
  349. #define G_006534_D1MODE_VBLANK_OCCURRED(x) (((x) >> 0) & 0x1)
  350. #define C_006534_D1MODE_VBLANK_OCCURRED 0xFFFFFFFE
  351. #define S_006534_D1MODE_VBLANK_ACK(x) (((x) & 0x1) << 4)
  352. #define G_006534_D1MODE_VBLANK_ACK(x) (((x) >> 4) & 0x1)
  353. #define C_006534_D1MODE_VBLANK_ACK 0xFFFFFFEF
  354. #define S_006534_D1MODE_VBLANK_STAT(x) (((x) & 0x1) << 12)
  355. #define G_006534_D1MODE_VBLANK_STAT(x) (((x) >> 12) & 0x1)
  356. #define C_006534_D1MODE_VBLANK_STAT 0xFFFFEFFF
  357. #define S_006534_D1MODE_VBLANK_INTERRUPT(x) (((x) & 0x1) << 16)
  358. #define G_006534_D1MODE_VBLANK_INTERRUPT(x) (((x) >> 16) & 0x1)
  359. #define C_006534_D1MODE_VBLANK_INTERRUPT 0xFFFEFFFF
  360. #define R_006540_DxMODE_INT_MASK 0x006540
  361. #define S_006540_D1MODE_VBLANK_INT_MASK(x) (((x) & 0x1) << 0)
  362. #define G_006540_D1MODE_VBLANK_INT_MASK(x) (((x) >> 0) & 0x1)
  363. #define C_006540_D1MODE_VBLANK_INT_MASK 0xFFFFFFFE
  364. #define S_006540_D1MODE_VLINE_INT_MASK(x) (((x) & 0x1) << 4)
  365. #define G_006540_D1MODE_VLINE_INT_MASK(x) (((x) >> 4) & 0x1)
  366. #define C_006540_D1MODE_VLINE_INT_MASK 0xFFFFFFEF
  367. #define S_006540_D2MODE_VBLANK_INT_MASK(x) (((x) & 0x1) << 8)
  368. #define G_006540_D2MODE_VBLANK_INT_MASK(x) (((x) >> 8) & 0x1)
  369. #define C_006540_D2MODE_VBLANK_INT_MASK 0xFFFFFEFF
  370. #define S_006540_D2MODE_VLINE_INT_MASK(x) (((x) & 0x1) << 12)
  371. #define G_006540_D2MODE_VLINE_INT_MASK(x) (((x) >> 12) & 0x1)
  372. #define C_006540_D2MODE_VLINE_INT_MASK 0xFFFFEFFF
  373. #define S_006540_D1MODE_VBLANK_CP_SEL(x) (((x) & 0x1) << 30)
  374. #define G_006540_D1MODE_VBLANK_CP_SEL(x) (((x) >> 30) & 0x1)
  375. #define C_006540_D1MODE_VBLANK_CP_SEL 0xBFFFFFFF
  376. #define S_006540_D2MODE_VBLANK_CP_SEL(x) (((x) & 0x1) << 31)
  377. #define G_006540_D2MODE_VBLANK_CP_SEL(x) (((x) >> 31) & 0x1)
  378. #define C_006540_D2MODE_VBLANK_CP_SEL 0x7FFFFFFF
  379. #define R_0068A4_D2CRTC_STATUS_FRAME_COUNT 0x0068A4
  380. #define S_0068A4_D2CRTC_FRAME_COUNT(x) (((x) & 0xFFFFFF) << 0)
  381. #define G_0068A4_D2CRTC_FRAME_COUNT(x) (((x) >> 0) & 0xFFFFFF)
  382. #define C_0068A4_D2CRTC_FRAME_COUNT 0xFF000000
  383. #define R_006D34_D2MODE_VBLANK_STATUS 0x006D34
  384. #define S_006D34_D2MODE_VBLANK_OCCURRED(x) (((x) & 0x1) << 0)
  385. #define G_006D34_D2MODE_VBLANK_OCCURRED(x) (((x) >> 0) & 0x1)
  386. #define C_006D34_D2MODE_VBLANK_OCCURRED 0xFFFFFFFE
  387. #define S_006D34_D2MODE_VBLANK_ACK(x) (((x) & 0x1) << 4)
  388. #define G_006D34_D2MODE_VBLANK_ACK(x) (((x) >> 4) & 0x1)
  389. #define C_006D34_D2MODE_VBLANK_ACK 0xFFFFFFEF
  390. #define S_006D34_D2MODE_VBLANK_STAT(x) (((x) & 0x1) << 12)
  391. #define G_006D34_D2MODE_VBLANK_STAT(x) (((x) >> 12) & 0x1)
  392. #define C_006D34_D2MODE_VBLANK_STAT 0xFFFFEFFF
  393. #define S_006D34_D2MODE_VBLANK_INTERRUPT(x) (((x) & 0x1) << 16)
  394. #define G_006D34_D2MODE_VBLANK_INTERRUPT(x) (((x) >> 16) & 0x1)
  395. #define C_006D34_D2MODE_VBLANK_INTERRUPT 0xFFFEFFFF
  396. #define R_007EDC_DISP_INTERRUPT_STATUS 0x007EDC
  397. #define S_007EDC_LB_D1_VBLANK_INTERRUPT(x) (((x) & 0x1) << 4)
  398. #define G_007EDC_LB_D1_VBLANK_INTERRUPT(x) (((x) >> 4) & 0x1)
  399. #define C_007EDC_LB_D1_VBLANK_INTERRUPT 0xFFFFFFEF
  400. #define S_007EDC_LB_D2_VBLANK_INTERRUPT(x) (((x) & 0x1) << 5)
  401. #define G_007EDC_LB_D2_VBLANK_INTERRUPT(x) (((x) >> 5) & 0x1)
  402. #define C_007EDC_LB_D2_VBLANK_INTERRUPT 0xFFFFFFDF
  403. #define S_007EDC_DACA_AUTODETECT_INTERRUPT(x) (((x) & 0x1) << 16)
  404. #define G_007EDC_DACA_AUTODETECT_INTERRUPT(x) (((x) >> 16) & 0x1)
  405. #define C_007EDC_DACA_AUTODETECT_INTERRUPT 0xFFFEFFFF
  406. #define S_007EDC_DACB_AUTODETECT_INTERRUPT(x) (((x) & 0x1) << 17)
  407. #define G_007EDC_DACB_AUTODETECT_INTERRUPT(x) (((x) >> 17) & 0x1)
  408. #define C_007EDC_DACB_AUTODETECT_INTERRUPT 0xFFFDFFFF
  409. #define S_007EDC_DC_HOT_PLUG_DETECT1_INTERRUPT(x) (((x) & 0x1) << 18)
  410. #define G_007EDC_DC_HOT_PLUG_DETECT1_INTERRUPT(x) (((x) >> 18) & 0x1)
  411. #define C_007EDC_DC_HOT_PLUG_DETECT1_INTERRUPT 0xFFFBFFFF
  412. #define S_007EDC_DC_HOT_PLUG_DETECT2_INTERRUPT(x) (((x) & 0x1) << 19)
  413. #define G_007EDC_DC_HOT_PLUG_DETECT2_INTERRUPT(x) (((x) >> 19) & 0x1)
  414. #define C_007EDC_DC_HOT_PLUG_DETECT2_INTERRUPT 0xFFF7FFFF
  415. #define R_007828_DACA_AUTODETECT_CONTROL 0x007828
  416. #define S_007828_DACA_AUTODETECT_MODE(x) (((x) & 0x3) << 0)
  417. #define G_007828_DACA_AUTODETECT_MODE(x) (((x) >> 0) & 0x3)
  418. #define C_007828_DACA_AUTODETECT_MODE 0xFFFFFFFC
  419. #define S_007828_DACA_AUTODETECT_FRAME_TIME_COUNTER(x) (((x) & 0xff) << 8)
  420. #define G_007828_DACA_AUTODETECT_FRAME_TIME_COUNTER(x) (((x) >> 8) & 0xff)
  421. #define C_007828_DACA_AUTODETECT_FRAME_TIME_COUNTER 0xFFFF00FF
  422. #define S_007828_DACA_AUTODETECT_CHECK_MASK(x) (((x) & 0x3) << 16)
  423. #define G_007828_DACA_AUTODETECT_CHECK_MASK(x) (((x) >> 16) & 0x3)
  424. #define C_007828_DACA_AUTODETECT_CHECK_MASK 0xFFFCFFFF
  425. #define R_007838_DACA_AUTODETECT_INT_CONTROL 0x007838
  426. #define S_007838_DACA_AUTODETECT_ACK(x) (((x) & 0x1) << 0)
  427. #define C_007838_DACA_DACA_AUTODETECT_ACK 0xFFFFFFFE
  428. #define S_007838_DACA_AUTODETECT_INT_ENABLE(x) (((x) & 0x1) << 16)
  429. #define G_007838_DACA_AUTODETECT_INT_ENABLE(x) (((x) >> 16) & 0x1)
  430. #define C_007838_DACA_AUTODETECT_INT_ENABLE 0xFFFCFFFF
  431. #define R_007A28_DACB_AUTODETECT_CONTROL 0x007A28
  432. #define S_007A28_DACB_AUTODETECT_MODE(x) (((x) & 0x3) << 0)
  433. #define G_007A28_DACB_AUTODETECT_MODE(x) (((x) >> 0) & 0x3)
  434. #define C_007A28_DACB_AUTODETECT_MODE 0xFFFFFFFC
  435. #define S_007A28_DACB_AUTODETECT_FRAME_TIME_COUNTER(x) (((x) & 0xff) << 8)
  436. #define G_007A28_DACB_AUTODETECT_FRAME_TIME_COUNTER(x) (((x) >> 8) & 0xff)
  437. #define C_007A28_DACB_AUTODETECT_FRAME_TIME_COUNTER 0xFFFF00FF
  438. #define S_007A28_DACB_AUTODETECT_CHECK_MASK(x) (((x) & 0x3) << 16)
  439. #define G_007A28_DACB_AUTODETECT_CHECK_MASK(x) (((x) >> 16) & 0x3)
  440. #define C_007A28_DACB_AUTODETECT_CHECK_MASK 0xFFFCFFFF
  441. #define R_007A38_DACB_AUTODETECT_INT_CONTROL 0x007A38
  442. #define S_007A38_DACB_AUTODETECT_ACK(x) (((x) & 0x1) << 0)
  443. #define C_007A38_DACB_DACA_AUTODETECT_ACK 0xFFFFFFFE
  444. #define S_007A38_DACB_AUTODETECT_INT_ENABLE(x) (((x) & 0x1) << 16)
  445. #define G_007A38_DACB_AUTODETECT_INT_ENABLE(x) (((x) >> 16) & 0x1)
  446. #define C_007A38_DACB_AUTODETECT_INT_ENABLE 0xFFFCFFFF
  447. #define R_007D00_DC_HOT_PLUG_DETECT1_CONTROL 0x007D00
  448. #define S_007D00_DC_HOT_PLUG_DETECT1_EN(x) (((x) & 0x1) << 0)
  449. #define G_007D00_DC_HOT_PLUG_DETECT1_EN(x) (((x) >> 0) & 0x1)
  450. #define C_007D00_DC_HOT_PLUG_DETECT1_EN 0xFFFFFFFE
  451. #define R_007D04_DC_HOT_PLUG_DETECT1_INT_STATUS 0x007D04
  452. #define S_007D04_DC_HOT_PLUG_DETECT1_INT_STATUS(x) (((x) & 0x1) << 0)
  453. #define G_007D04_DC_HOT_PLUG_DETECT1_INT_STATUS(x) (((x) >> 0) & 0x1)
  454. #define C_007D04_DC_HOT_PLUG_DETECT1_INT_STATUS 0xFFFFFFFE
  455. #define S_007D04_DC_HOT_PLUG_DETECT1_SENSE(x) (((x) & 0x1) << 1)
  456. #define G_007D04_DC_HOT_PLUG_DETECT1_SENSE(x) (((x) >> 1) & 0x1)
  457. #define C_007D04_DC_HOT_PLUG_DETECT1_SENSE 0xFFFFFFFD
  458. #define R_007D08_DC_HOT_PLUG_DETECT1_INT_CONTROL 0x007D08
  459. #define S_007D08_DC_HOT_PLUG_DETECT1_INT_ACK(x) (((x) & 0x1) << 0)
  460. #define C_007D08_DC_HOT_PLUG_DETECT1_INT_ACK 0xFFFFFFFE
  461. #define S_007D08_DC_HOT_PLUG_DETECT1_INT_POLARITY(x) (((x) & 0x1) << 8)
  462. #define G_007D08_DC_HOT_PLUG_DETECT1_INT_POLARITY(x) (((x) >> 8) & 0x1)
  463. #define C_007D08_DC_HOT_PLUG_DETECT1_INT_POLARITY 0xFFFFFEFF
  464. #define S_007D08_DC_HOT_PLUG_DETECT1_INT_EN(x) (((x) & 0x1) << 16)
  465. #define G_007D08_DC_HOT_PLUG_DETECT1_INT_EN(x) (((x) >> 16) & 0x1)
  466. #define C_007D08_DC_HOT_PLUG_DETECT1_INT_EN 0xFFFEFFFF
  467. #define R_007D10_DC_HOT_PLUG_DETECT2_CONTROL 0x007D10
  468. #define S_007D10_DC_HOT_PLUG_DETECT2_EN(x) (((x) & 0x1) << 0)
  469. #define G_007D10_DC_HOT_PLUG_DETECT2_EN(x) (((x) >> 0) & 0x1)
  470. #define C_007D10_DC_HOT_PLUG_DETECT2_EN 0xFFFFFFFE
  471. #define R_007D14_DC_HOT_PLUG_DETECT2_INT_STATUS 0x007D14
  472. #define S_007D14_DC_HOT_PLUG_DETECT2_INT_STATUS(x) (((x) & 0x1) << 0)
  473. #define G_007D14_DC_HOT_PLUG_DETECT2_INT_STATUS(x) (((x) >> 0) & 0x1)
  474. #define C_007D14_DC_HOT_PLUG_DETECT2_INT_STATUS 0xFFFFFFFE
  475. #define S_007D14_DC_HOT_PLUG_DETECT2_SENSE(x) (((x) & 0x1) << 1)
  476. #define G_007D14_DC_HOT_PLUG_DETECT2_SENSE(x) (((x) >> 1) & 0x1)
  477. #define C_007D14_DC_HOT_PLUG_DETECT2_SENSE 0xFFFFFFFD
  478. #define R_007D18_DC_HOT_PLUG_DETECT2_INT_CONTROL 0x007D18
  479. #define S_007D18_DC_HOT_PLUG_DETECT2_INT_ACK(x) (((x) & 0x1) << 0)
  480. #define C_007D18_DC_HOT_PLUG_DETECT2_INT_ACK 0xFFFFFFFE
  481. #define S_007D18_DC_HOT_PLUG_DETECT2_INT_POLARITY(x) (((x) & 0x1) << 8)
  482. #define G_007D18_DC_HOT_PLUG_DETECT2_INT_POLARITY(x) (((x) >> 8) & 0x1)
  483. #define C_007D18_DC_HOT_PLUG_DETECT2_INT_POLARITY 0xFFFFFEFF
  484. #define S_007D18_DC_HOT_PLUG_DETECT2_INT_EN(x) (((x) & 0x1) << 16)
  485. #define G_007D18_DC_HOT_PLUG_DETECT2_INT_EN(x) (((x) >> 16) & 0x1)
  486. #define C_007D18_DC_HOT_PLUG_DETECT2_INT_EN 0xFFFEFFFF
  487. /* MC registers */
  488. #define R_000000_MC_STATUS 0x000000
  489. #define S_000000_MC_IDLE(x) (((x) & 0x1) << 0)
  490. #define G_000000_MC_IDLE(x) (((x) >> 0) & 0x1)
  491. #define C_000000_MC_IDLE 0xFFFFFFFE
  492. #define R_000004_MC_FB_LOCATION 0x000004
  493. #define S_000004_MC_FB_START(x) (((x) & 0xFFFF) << 0)
  494. #define G_000004_MC_FB_START(x) (((x) >> 0) & 0xFFFF)
  495. #define C_000004_MC_FB_START 0xFFFF0000
  496. #define S_000004_MC_FB_TOP(x) (((x) & 0xFFFF) << 16)
  497. #define G_000004_MC_FB_TOP(x) (((x) >> 16) & 0xFFFF)
  498. #define C_000004_MC_FB_TOP 0x0000FFFF
  499. #define R_000005_MC_AGP_LOCATION 0x000005
  500. #define S_000005_MC_AGP_START(x) (((x) & 0xFFFF) << 0)
  501. #define G_000005_MC_AGP_START(x) (((x) >> 0) & 0xFFFF)
  502. #define C_000005_MC_AGP_START 0xFFFF0000
  503. #define S_000005_MC_AGP_TOP(x) (((x) & 0xFFFF) << 16)
  504. #define G_000005_MC_AGP_TOP(x) (((x) >> 16) & 0xFFFF)
  505. #define C_000005_MC_AGP_TOP 0x0000FFFF
  506. #define R_000006_AGP_BASE 0x000006
  507. #define S_000006_AGP_BASE_ADDR(x) (((x) & 0xFFFFFFFF) << 0)
  508. #define G_000006_AGP_BASE_ADDR(x) (((x) >> 0) & 0xFFFFFFFF)
  509. #define C_000006_AGP_BASE_ADDR 0x00000000
  510. #define R_000007_AGP_BASE_2 0x000007
  511. #define S_000007_AGP_BASE_ADDR_2(x) (((x) & 0xF) << 0)
  512. #define G_000007_AGP_BASE_ADDR_2(x) (((x) >> 0) & 0xF)
  513. #define C_000007_AGP_BASE_ADDR_2 0xFFFFFFF0
  514. #define R_000009_MC_CNTL1 0x000009
  515. #define S_000009_ENABLE_PAGE_TABLES(x) (((x) & 0x1) << 26)
  516. #define G_000009_ENABLE_PAGE_TABLES(x) (((x) >> 26) & 0x1)
  517. #define C_000009_ENABLE_PAGE_TABLES 0xFBFFFFFF
  518. /* FIXME don't know the various field size need feedback from AMD */
  519. #define R_000100_MC_PT0_CNTL 0x000100
  520. #define S_000100_ENABLE_PT(x) (((x) & 0x1) << 0)
  521. #define G_000100_ENABLE_PT(x) (((x) >> 0) & 0x1)
  522. #define C_000100_ENABLE_PT 0xFFFFFFFE
  523. #define S_000100_EFFECTIVE_L2_CACHE_SIZE(x) (((x) & 0x7) << 15)
  524. #define G_000100_EFFECTIVE_L2_CACHE_SIZE(x) (((x) >> 15) & 0x7)
  525. #define C_000100_EFFECTIVE_L2_CACHE_SIZE 0xFFFC7FFF
  526. #define S_000100_EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 0x7) << 21)
  527. #define G_000100_EFFECTIVE_L2_QUEUE_SIZE(x) (((x) >> 21) & 0x7)
  528. #define C_000100_EFFECTIVE_L2_QUEUE_SIZE 0xFF1FFFFF
  529. #define S_000100_INVALIDATE_ALL_L1_TLBS(x) (((x) & 0x1) << 28)
  530. #define G_000100_INVALIDATE_ALL_L1_TLBS(x) (((x) >> 28) & 0x1)
  531. #define C_000100_INVALIDATE_ALL_L1_TLBS 0xEFFFFFFF
  532. #define S_000100_INVALIDATE_L2_CACHE(x) (((x) & 0x1) << 29)
  533. #define G_000100_INVALIDATE_L2_CACHE(x) (((x) >> 29) & 0x1)
  534. #define C_000100_INVALIDATE_L2_CACHE 0xDFFFFFFF
  535. #define R_000102_MC_PT0_CONTEXT0_CNTL 0x000102
  536. #define S_000102_ENABLE_PAGE_TABLE(x) (((x) & 0x1) << 0)
  537. #define G_000102_ENABLE_PAGE_TABLE(x) (((x) >> 0) & 0x1)
  538. #define C_000102_ENABLE_PAGE_TABLE 0xFFFFFFFE
  539. #define S_000102_PAGE_TABLE_DEPTH(x) (((x) & 0x3) << 1)
  540. #define G_000102_PAGE_TABLE_DEPTH(x) (((x) >> 1) & 0x3)
  541. #define C_000102_PAGE_TABLE_DEPTH 0xFFFFFFF9
  542. #define V_000102_PAGE_TABLE_FLAT 0
  543. /* R600 documentation suggest that this should be a number of pages */
  544. #define R_000112_MC_PT0_SYSTEM_APERTURE_LOW_ADDR 0x000112
  545. #define R_000114_MC_PT0_SYSTEM_APERTURE_HIGH_ADDR 0x000114
  546. #define R_00011C_MC_PT0_CONTEXT0_DEFAULT_READ_ADDR 0x00011C
  547. #define R_00012C_MC_PT0_CONTEXT0_FLAT_BASE_ADDR 0x00012C
  548. #define R_00013C_MC_PT0_CONTEXT0_FLAT_START_ADDR 0x00013C
  549. #define R_00014C_MC_PT0_CONTEXT0_FLAT_END_ADDR 0x00014C
  550. #define R_00016C_MC_PT0_CLIENT0_CNTL 0x00016C
  551. #define S_00016C_ENABLE_TRANSLATION_MODE_OVERRIDE(x) (((x) & 0x1) << 0)
  552. #define G_00016C_ENABLE_TRANSLATION_MODE_OVERRIDE(x) (((x) >> 0) & 0x1)
  553. #define C_00016C_ENABLE_TRANSLATION_MODE_OVERRIDE 0xFFFFFFFE
  554. #define S_00016C_TRANSLATION_MODE_OVERRIDE(x) (((x) & 0x1) << 1)
  555. #define G_00016C_TRANSLATION_MODE_OVERRIDE(x) (((x) >> 1) & 0x1)
  556. #define C_00016C_TRANSLATION_MODE_OVERRIDE 0xFFFFFFFD
  557. #define S_00016C_SYSTEM_ACCESS_MODE_MASK(x) (((x) & 0x3) << 8)
  558. #define G_00016C_SYSTEM_ACCESS_MODE_MASK(x) (((x) >> 8) & 0x3)
  559. #define C_00016C_SYSTEM_ACCESS_MODE_MASK 0xFFFFFCFF
  560. #define V_00016C_SYSTEM_ACCESS_MODE_PA_ONLY 0
  561. #define V_00016C_SYSTEM_ACCESS_MODE_USE_SYS_MAP 1
  562. #define V_00016C_SYSTEM_ACCESS_MODE_IN_SYS 2
  563. #define V_00016C_SYSTEM_ACCESS_MODE_NOT_IN_SYS 3
  564. #define S_00016C_SYSTEM_APERTURE_UNMAPPED_ACCESS(x) (((x) & 0x1) << 10)
  565. #define G_00016C_SYSTEM_APERTURE_UNMAPPED_ACCESS(x) (((x) >> 10) & 0x1)
  566. #define C_00016C_SYSTEM_APERTURE_UNMAPPED_ACCESS 0xFFFFFBFF
  567. #define V_00016C_SYSTEM_APERTURE_UNMAPPED_PASSTHROUGH 0
  568. #define V_00016C_SYSTEM_APERTURE_UNMAPPED_DEFAULT_PAGE 1
  569. #define S_00016C_EFFECTIVE_L1_CACHE_SIZE(x) (((x) & 0x7) << 11)
  570. #define G_00016C_EFFECTIVE_L1_CACHE_SIZE(x) (((x) >> 11) & 0x7)
  571. #define C_00016C_EFFECTIVE_L1_CACHE_SIZE 0xFFFFC7FF
  572. #define S_00016C_ENABLE_FRAGMENT_PROCESSING(x) (((x) & 0x1) << 14)
  573. #define G_00016C_ENABLE_FRAGMENT_PROCESSING(x) (((x) >> 14) & 0x1)
  574. #define C_00016C_ENABLE_FRAGMENT_PROCESSING 0xFFFFBFFF
  575. #define S_00016C_EFFECTIVE_L1_QUEUE_SIZE(x) (((x) & 0x7) << 15)
  576. #define G_00016C_EFFECTIVE_L1_QUEUE_SIZE(x) (((x) >> 15) & 0x7)
  577. #define C_00016C_EFFECTIVE_L1_QUEUE_SIZE 0xFFFC7FFF
  578. #define S_00016C_INVALIDATE_L1_TLB(x) (((x) & 0x1) << 20)
  579. #define G_00016C_INVALIDATE_L1_TLB(x) (((x) >> 20) & 0x1)
  580. #define C_00016C_INVALIDATE_L1_TLB 0xFFEFFFFF
  581. #define R_006548_D1MODE_PRIORITY_A_CNT 0x006548
  582. #define S_006548_D1MODE_PRIORITY_MARK_A(x) (((x) & 0x7FFF) << 0)
  583. #define G_006548_D1MODE_PRIORITY_MARK_A(x) (((x) >> 0) & 0x7FFF)
  584. #define C_006548_D1MODE_PRIORITY_MARK_A 0xFFFF8000
  585. #define S_006548_D1MODE_PRIORITY_A_OFF(x) (((x) & 0x1) << 16)
  586. #define G_006548_D1MODE_PRIORITY_A_OFF(x) (((x) >> 16) & 0x1)
  587. #define C_006548_D1MODE_PRIORITY_A_OFF 0xFFFEFFFF
  588. #define S_006548_D1MODE_PRIORITY_A_ALWAYS_ON(x) (((x) & 0x1) << 20)
  589. #define G_006548_D1MODE_PRIORITY_A_ALWAYS_ON(x) (((x) >> 20) & 0x1)
  590. #define C_006548_D1MODE_PRIORITY_A_ALWAYS_ON 0xFFEFFFFF
  591. #define S_006548_D1MODE_PRIORITY_A_FORCE_MASK(x) (((x) & 0x1) << 24)
  592. #define G_006548_D1MODE_PRIORITY_A_FORCE_MASK(x) (((x) >> 24) & 0x1)
  593. #define C_006548_D1MODE_PRIORITY_A_FORCE_MASK 0xFEFFFFFF
  594. #define R_00654C_D1MODE_PRIORITY_B_CNT 0x00654C
  595. #define S_00654C_D1MODE_PRIORITY_MARK_B(x) (((x) & 0x7FFF) << 0)
  596. #define G_00654C_D1MODE_PRIORITY_MARK_B(x) (((x) >> 0) & 0x7FFF)
  597. #define C_00654C_D1MODE_PRIORITY_MARK_B 0xFFFF8000
  598. #define S_00654C_D1MODE_PRIORITY_B_OFF(x) (((x) & 0x1) << 16)
  599. #define G_00654C_D1MODE_PRIORITY_B_OFF(x) (((x) >> 16) & 0x1)
  600. #define C_00654C_D1MODE_PRIORITY_B_OFF 0xFFFEFFFF
  601. #define S_00654C_D1MODE_PRIORITY_B_ALWAYS_ON(x) (((x) & 0x1) << 20)
  602. #define G_00654C_D1MODE_PRIORITY_B_ALWAYS_ON(x) (((x) >> 20) & 0x1)
  603. #define C_00654C_D1MODE_PRIORITY_B_ALWAYS_ON 0xFFEFFFFF
  604. #define S_00654C_D1MODE_PRIORITY_B_FORCE_MASK(x) (((x) & 0x1) << 24)
  605. #define G_00654C_D1MODE_PRIORITY_B_FORCE_MASK(x) (((x) >> 24) & 0x1)
  606. #define C_00654C_D1MODE_PRIORITY_B_FORCE_MASK 0xFEFFFFFF
  607. #define R_006D48_D2MODE_PRIORITY_A_CNT 0x006D48
  608. #define S_006D48_D2MODE_PRIORITY_MARK_A(x) (((x) & 0x7FFF) << 0)
  609. #define G_006D48_D2MODE_PRIORITY_MARK_A(x) (((x) >> 0) & 0x7FFF)
  610. #define C_006D48_D2MODE_PRIORITY_MARK_A 0xFFFF8000
  611. #define S_006D48_D2MODE_PRIORITY_A_OFF(x) (((x) & 0x1) << 16)
  612. #define G_006D48_D2MODE_PRIORITY_A_OFF(x) (((x) >> 16) & 0x1)
  613. #define C_006D48_D2MODE_PRIORITY_A_OFF 0xFFFEFFFF
  614. #define S_006D48_D2MODE_PRIORITY_A_ALWAYS_ON(x) (((x) & 0x1) << 20)
  615. #define G_006D48_D2MODE_PRIORITY_A_ALWAYS_ON(x) (((x) >> 20) & 0x1)
  616. #define C_006D48_D2MODE_PRIORITY_A_ALWAYS_ON 0xFFEFFFFF
  617. #define S_006D48_D2MODE_PRIORITY_A_FORCE_MASK(x) (((x) & 0x1) << 24)
  618. #define G_006D48_D2MODE_PRIORITY_A_FORCE_MASK(x) (((x) >> 24) & 0x1)
  619. #define C_006D48_D2MODE_PRIORITY_A_FORCE_MASK 0xFEFFFFFF
  620. #define R_006D4C_D2MODE_PRIORITY_B_CNT 0x006D4C
  621. #define S_006D4C_D2MODE_PRIORITY_MARK_B(x) (((x) & 0x7FFF) << 0)
  622. #define G_006D4C_D2MODE_PRIORITY_MARK_B(x) (((x) >> 0) & 0x7FFF)
  623. #define C_006D4C_D2MODE_PRIORITY_MARK_B 0xFFFF8000
  624. #define S_006D4C_D2MODE_PRIORITY_B_OFF(x) (((x) & 0x1) << 16)
  625. #define G_006D4C_D2MODE_PRIORITY_B_OFF(x) (((x) >> 16) & 0x1)
  626. #define C_006D4C_D2MODE_PRIORITY_B_OFF 0xFFFEFFFF
  627. #define S_006D4C_D2MODE_PRIORITY_B_ALWAYS_ON(x) (((x) & 0x1) << 20)
  628. #define G_006D4C_D2MODE_PRIORITY_B_ALWAYS_ON(x) (((x) >> 20) & 0x1)
  629. #define C_006D4C_D2MODE_PRIORITY_B_ALWAYS_ON 0xFFEFFFFF
  630. #define S_006D4C_D2MODE_PRIORITY_B_FORCE_MASK(x) (((x) & 0x1) << 24)
  631. #define G_006D4C_D2MODE_PRIORITY_B_FORCE_MASK(x) (((x) >> 24) & 0x1)
  632. #define C_006D4C_D2MODE_PRIORITY_B_FORCE_MASK 0xFEFFFFFF
  633. /* PLL regs */
  634. #define GENERAL_PWRMGT 0x8
  635. #define GLOBAL_PWRMGT_EN (1 << 0)
  636. #define MOBILE_SU (1 << 2)
  637. #define DYN_PWRMGT_SCLK_LENGTH 0xc
  638. #define NORMAL_POWER_SCLK_HILEN(x) ((x) << 0)
  639. #define NORMAL_POWER_SCLK_LOLEN(x) ((x) << 4)
  640. #define REDUCED_POWER_SCLK_HILEN(x) ((x) << 8)
  641. #define REDUCED_POWER_SCLK_LOLEN(x) ((x) << 12)
  642. #define POWER_D1_SCLK_HILEN(x) ((x) << 16)
  643. #define POWER_D1_SCLK_LOLEN(x) ((x) << 20)
  644. #define STATIC_SCREEN_HILEN(x) ((x) << 24)
  645. #define STATIC_SCREEN_LOLEN(x) ((x) << 28)
  646. #define DYN_SCLK_VOL_CNTL 0xe
  647. #define IO_CG_VOLTAGE_DROP (1 << 0)
  648. #define VOLTAGE_DROP_SYNC (1 << 2)
  649. #define VOLTAGE_DELAY_SEL(x) ((x) << 3)
  650. #define HDP_DYN_CNTL 0x10
  651. #define HDP_FORCEON (1 << 0)
  652. #define MC_HOST_DYN_CNTL 0x1e
  653. #define MC_HOST_FORCEON (1 << 0)
  654. #define DYN_BACKBIAS_CNTL 0x29
  655. #define IO_CG_BACKBIAS_EN (1 << 0)
  656. /* mmreg */
  657. #define DOUT_POWER_MANAGEMENT_CNTL 0x7ee0
  658. #define PWRDN_WAIT_BUSY_OFF (1 << 0)
  659. #define PWRDN_WAIT_PWRSEQ_OFF (1 << 4)
  660. #define PWRDN_WAIT_PPLL_OFF (1 << 8)
  661. #define PWRUP_WAIT_PPLL_ON (1 << 12)
  662. #define PWRUP_WAIT_MEM_INIT_DONE (1 << 16)
  663. #define PM_ASSERT_RESET (1 << 20)
  664. #define PM_PWRDN_PPLL (1 << 24)
  665. #endif