r500_reg.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  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 __R500_REG_H__
  29. #define __R500_REG_H__
  30. /* pipe config regs */
  31. #define R300_GA_POLY_MODE 0x4288
  32. # define R300_FRONT_PTYPE_POINT (0 << 4)
  33. # define R300_FRONT_PTYPE_LINE (1 << 4)
  34. # define R300_FRONT_PTYPE_TRIANGE (2 << 4)
  35. # define R300_BACK_PTYPE_POINT (0 << 7)
  36. # define R300_BACK_PTYPE_LINE (1 << 7)
  37. # define R300_BACK_PTYPE_TRIANGE (2 << 7)
  38. #define R300_GA_ROUND_MODE 0x428c
  39. # define R300_GEOMETRY_ROUND_TRUNC (0 << 0)
  40. # define R300_GEOMETRY_ROUND_NEAREST (1 << 0)
  41. # define R300_COLOR_ROUND_TRUNC (0 << 2)
  42. # define R300_COLOR_ROUND_NEAREST (1 << 2)
  43. #define R300_GB_MSPOS0 0x4010
  44. # define R300_MS_X0_SHIFT 0
  45. # define R300_MS_Y0_SHIFT 4
  46. # define R300_MS_X1_SHIFT 8
  47. # define R300_MS_Y1_SHIFT 12
  48. # define R300_MS_X2_SHIFT 16
  49. # define R300_MS_Y2_SHIFT 20
  50. # define R300_MSBD0_Y_SHIFT 24
  51. # define R300_MSBD0_X_SHIFT 28
  52. #define R300_GB_MSPOS1 0x4014
  53. # define R300_MS_X3_SHIFT 0
  54. # define R300_MS_Y3_SHIFT 4
  55. # define R300_MS_X4_SHIFT 8
  56. # define R300_MS_Y4_SHIFT 12
  57. # define R300_MS_X5_SHIFT 16
  58. # define R300_MS_Y5_SHIFT 20
  59. # define R300_MSBD1_SHIFT 24
  60. #define R300_GA_ENHANCE 0x4274
  61. # define R300_GA_DEADLOCK_CNTL (1 << 0)
  62. # define R300_GA_FASTSYNC_CNTL (1 << 1)
  63. #define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c
  64. # define R300_RB3D_DC_FLUSH (2 << 0)
  65. # define R300_RB3D_DC_FREE (2 << 2)
  66. # define R300_RB3D_DC_FINISH (1 << 4)
  67. #define R300_RB3D_ZCACHE_CTLSTAT 0x4f18
  68. # define R300_ZC_FLUSH (1 << 0)
  69. # define R300_ZC_FREE (1 << 1)
  70. # define R300_ZC_FLUSH_ALL 0x3
  71. #define R400_GB_PIPE_SELECT 0x402c
  72. #define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */
  73. #define R500_SU_REG_DEST 0x42c8
  74. #define R300_GB_TILE_CONFIG 0x4018
  75. # define R300_ENABLE_TILING (1 << 0)
  76. # define R300_PIPE_COUNT_RV350 (0 << 1)
  77. # define R300_PIPE_COUNT_R300 (3 << 1)
  78. # define R300_PIPE_COUNT_R420_3P (6 << 1)
  79. # define R300_PIPE_COUNT_R420 (7 << 1)
  80. # define R300_TILE_SIZE_8 (0 << 4)
  81. # define R300_TILE_SIZE_16 (1 << 4)
  82. # define R300_TILE_SIZE_32 (2 << 4)
  83. # define R300_SUBPIXEL_1_12 (0 << 16)
  84. # define R300_SUBPIXEL_1_16 (1 << 16)
  85. #define R300_DST_PIPE_CONFIG 0x170c
  86. # define R300_PIPE_AUTO_CONFIG (1 << 31)
  87. #define R300_RB2D_DSTCACHE_MODE 0x3428
  88. # define R300_DC_AUTOFLUSH_ENABLE (1 << 8)
  89. # define R300_DC_DC_DISABLE_IGNORE_PE (1 << 17)
  90. #define RADEON_CP_STAT 0x7C0
  91. #define RADEON_RBBM_CMDFIFO_ADDR 0xE70
  92. #define RADEON_RBBM_CMDFIFO_DATA 0xE74
  93. #define RADEON_ISYNC_CNTL 0x1724
  94. # define RADEON_ISYNC_ANY2D_IDLE3D (1 << 0)
  95. # define RADEON_ISYNC_ANY3D_IDLE2D (1 << 1)
  96. # define RADEON_ISYNC_TRIG2D_IDLE3D (1 << 2)
  97. # define RADEON_ISYNC_TRIG3D_IDLE2D (1 << 3)
  98. # define RADEON_ISYNC_WAIT_IDLEGUI (1 << 4)
  99. # define RADEON_ISYNC_CPSCRATCH_IDLEGUI (1 << 5)
  100. #define RS480_NB_MC_INDEX 0x168
  101. # define RS480_NB_MC_IND_WR_EN (1 << 8)
  102. #define RS480_NB_MC_DATA 0x16c
  103. /*
  104. * RS690
  105. */
  106. #define RS690_MCCFG_FB_LOCATION 0x100
  107. #define RS690_MC_FB_START_MASK 0x0000FFFF
  108. #define RS690_MC_FB_START_SHIFT 0
  109. #define RS690_MC_FB_TOP_MASK 0xFFFF0000
  110. #define RS690_MC_FB_TOP_SHIFT 16
  111. #define RS690_MCCFG_AGP_LOCATION 0x101
  112. #define RS690_MC_AGP_START_MASK 0x0000FFFF
  113. #define RS690_MC_AGP_START_SHIFT 0
  114. #define RS690_MC_AGP_TOP_MASK 0xFFFF0000
  115. #define RS690_MC_AGP_TOP_SHIFT 16
  116. #define RS690_MCCFG_AGP_BASE 0x102
  117. #define RS690_MCCFG_AGP_BASE_2 0x103
  118. #define RS690_MC_INIT_MISC_LAT_TIMER 0x104
  119. #define RS690_HDP_FB_LOCATION 0x0134
  120. #define RS690_MC_INDEX 0x78
  121. # define RS690_MC_INDEX_MASK 0x1ff
  122. # define RS690_MC_INDEX_WR_EN (1 << 9)
  123. # define RS690_MC_INDEX_WR_ACK 0x7f
  124. #define RS690_MC_DATA 0x7c
  125. #define RS690_MC_STATUS 0x90
  126. #define RS690_MC_STATUS_IDLE (1 << 0)
  127. #define RS480_AGP_BASE_2 0x0164
  128. #define RS480_MC_MISC_CNTL 0x18
  129. # define RS480_DISABLE_GTW (1 << 1)
  130. # define RS480_GART_INDEX_REG_EN (1 << 12)
  131. # define RS690_BLOCK_GFX_D3_EN (1 << 14)
  132. #define RS480_GART_FEATURE_ID 0x2b
  133. # define RS480_HANG_EN (1 << 11)
  134. # define RS480_TLB_ENABLE (1 << 18)
  135. # define RS480_P2P_ENABLE (1 << 19)
  136. # define RS480_GTW_LAC_EN (1 << 25)
  137. # define RS480_2LEVEL_GART (0 << 30)
  138. # define RS480_1LEVEL_GART (1 << 30)
  139. # define RS480_PDC_EN (1 << 31)
  140. #define RS480_GART_BASE 0x2c
  141. #define RS480_GART_CACHE_CNTRL 0x2e
  142. # define RS480_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */
  143. #define RS480_AGP_ADDRESS_SPACE_SIZE 0x38
  144. # define RS480_GART_EN (1 << 0)
  145. # define RS480_VA_SIZE_32MB (0 << 1)
  146. # define RS480_VA_SIZE_64MB (1 << 1)
  147. # define RS480_VA_SIZE_128MB (2 << 1)
  148. # define RS480_VA_SIZE_256MB (3 << 1)
  149. # define RS480_VA_SIZE_512MB (4 << 1)
  150. # define RS480_VA_SIZE_1GB (5 << 1)
  151. # define RS480_VA_SIZE_2GB (6 << 1)
  152. #define RS480_AGP_MODE_CNTL 0x39
  153. # define RS480_POST_GART_Q_SIZE (1 << 18)
  154. # define RS480_NONGART_SNOOP (1 << 19)
  155. # define RS480_AGP_RD_BUF_SIZE (1 << 20)
  156. # define RS480_REQ_TYPE_SNOOP_SHIFT 22
  157. # define RS480_REQ_TYPE_SNOOP_MASK 0x3
  158. # define RS480_REQ_TYPE_SNOOP_DIS (1 << 24)
  159. #define RS690_AIC_CTRL_SCRATCH 0x3A
  160. # define RS690_DIS_OUT_OF_PCI_GART_ACCESS (1 << 1)
  161. /*
  162. * RS600
  163. */
  164. #define RS600_MC_STATUS 0x0
  165. #define RS600_MC_STATUS_IDLE (1 << 0)
  166. #define RS600_MC_INDEX 0x70
  167. # define RS600_MC_ADDR_MASK 0xffff
  168. # define RS600_MC_IND_SEQ_RBS_0 (1 << 16)
  169. # define RS600_MC_IND_SEQ_RBS_1 (1 << 17)
  170. # define RS600_MC_IND_SEQ_RBS_2 (1 << 18)
  171. # define RS600_MC_IND_SEQ_RBS_3 (1 << 19)
  172. # define RS600_MC_IND_AIC_RBS (1 << 20)
  173. # define RS600_MC_IND_CITF_ARB0 (1 << 21)
  174. # define RS600_MC_IND_CITF_ARB1 (1 << 22)
  175. # define RS600_MC_IND_WR_EN (1 << 23)
  176. #define RS600_MC_DATA 0x74
  177. #define RS600_MC_STATUS 0x0
  178. # define RS600_MC_IDLE (1 << 1)
  179. #define RS600_MC_FB_LOCATION 0x4
  180. #define RS600_MC_FB_START_MASK 0x0000FFFF
  181. #define RS600_MC_FB_START_SHIFT 0
  182. #define RS600_MC_FB_TOP_MASK 0xFFFF0000
  183. #define RS600_MC_FB_TOP_SHIFT 16
  184. #define RS600_MC_AGP_LOCATION 0x5
  185. #define RS600_MC_AGP_START_MASK 0x0000FFFF
  186. #define RS600_MC_AGP_START_SHIFT 0
  187. #define RS600_MC_AGP_TOP_MASK 0xFFFF0000
  188. #define RS600_MC_AGP_TOP_SHIFT 16
  189. #define RS600_MC_AGP_BASE 0x6
  190. #define RS600_MC_AGP_BASE_2 0x7
  191. #define RS600_MC_CNTL1 0x9
  192. # define RS600_ENABLE_PAGE_TABLES (1 << 26)
  193. #define RS600_MC_PT0_CNTL 0x100
  194. # define RS600_ENABLE_PT (1 << 0)
  195. # define RS600_EFFECTIVE_L2_CACHE_SIZE(x) ((x) << 15)
  196. # define RS600_EFFECTIVE_L2_QUEUE_SIZE(x) ((x) << 21)
  197. # define RS600_INVALIDATE_ALL_L1_TLBS (1 << 28)
  198. # define RS600_INVALIDATE_L2_CACHE (1 << 29)
  199. #define RS600_MC_PT0_CONTEXT0_CNTL 0x102
  200. # define RS600_ENABLE_PAGE_TABLE (1 << 0)
  201. # define RS600_PAGE_TABLE_TYPE_FLAT (0 << 1)
  202. #define RS600_MC_PT0_SYSTEM_APERTURE_LOW_ADDR 0x112
  203. #define RS600_MC_PT0_SYSTEM_APERTURE_HIGH_ADDR 0x114
  204. #define RS600_MC_PT0_CONTEXT0_DEFAULT_READ_ADDR 0x11c
  205. #define RS600_MC_PT0_CONTEXT0_FLAT_BASE_ADDR 0x12c
  206. #define RS600_MC_PT0_CONTEXT0_FLAT_START_ADDR 0x13c
  207. #define RS600_MC_PT0_CONTEXT0_FLAT_END_ADDR 0x14c
  208. #define RS600_MC_PT0_CLIENT0_CNTL 0x16c
  209. # define RS600_ENABLE_TRANSLATION_MODE_OVERRIDE (1 << 0)
  210. # define RS600_TRANSLATION_MODE_OVERRIDE (1 << 1)
  211. # define RS600_SYSTEM_ACCESS_MODE_MASK (3 << 8)
  212. # define RS600_SYSTEM_ACCESS_MODE_PA_ONLY (0 << 8)
  213. # define RS600_SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 8)
  214. # define RS600_SYSTEM_ACCESS_MODE_IN_SYS (2 << 8)
  215. # define RS600_SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 8)
  216. # define RS600_SYSTEM_APERTURE_UNMAPPED_ACCESS_PASSTHROUGH (0 << 10)
  217. # define RS600_SYSTEM_APERTURE_UNMAPPED_ACCESS_DEFAULT_PAGE (1 << 10)
  218. # define RS600_EFFECTIVE_L1_CACHE_SIZE(x) ((x) << 11)
  219. # define RS600_ENABLE_FRAGMENT_PROCESSING (1 << 14)
  220. # define RS600_EFFECTIVE_L1_QUEUE_SIZE(x) ((x) << 15)
  221. # define RS600_INVALIDATE_L1_TLB (1 << 20)
  222. /* rs600/rs690/rs740 */
  223. # define RS600_BUS_MASTER_DIS (1 << 14)
  224. # define RS600_MSI_REARM (1 << 20)
  225. /* see RS400_MSI_REARM in AIC_CNTL for rs480 */
  226. #define RV515_MC_FB_LOCATION 0x01
  227. #define RV515_MC_FB_START_MASK 0x0000FFFF
  228. #define RV515_MC_FB_START_SHIFT 0
  229. #define RV515_MC_FB_TOP_MASK 0xFFFF0000
  230. #define RV515_MC_FB_TOP_SHIFT 16
  231. #define RV515_MC_AGP_LOCATION 0x02
  232. #define RV515_MC_AGP_START_MASK 0x0000FFFF
  233. #define RV515_MC_AGP_START_SHIFT 0
  234. #define RV515_MC_AGP_TOP_MASK 0xFFFF0000
  235. #define RV515_MC_AGP_TOP_SHIFT 16
  236. #define RV515_MC_AGP_BASE 0x03
  237. #define RV515_MC_AGP_BASE_2 0x04
  238. #define R520_MC_FB_LOCATION 0x04
  239. #define R520_MC_FB_START_MASK 0x0000FFFF
  240. #define R520_MC_FB_START_SHIFT 0
  241. #define R520_MC_FB_TOP_MASK 0xFFFF0000
  242. #define R520_MC_FB_TOP_SHIFT 16
  243. #define R520_MC_AGP_LOCATION 0x05
  244. #define R520_MC_AGP_START_MASK 0x0000FFFF
  245. #define R520_MC_AGP_START_SHIFT 0
  246. #define R520_MC_AGP_TOP_MASK 0xFFFF0000
  247. #define R520_MC_AGP_TOP_SHIFT 16
  248. #define R520_MC_AGP_BASE 0x06
  249. #define R520_MC_AGP_BASE_2 0x07
  250. #define AVIVO_MC_INDEX 0x0070
  251. #define R520_MC_STATUS 0x00
  252. #define R520_MC_STATUS_IDLE (1<<1)
  253. #define RV515_MC_STATUS 0x08
  254. #define RV515_MC_STATUS_IDLE (1<<4)
  255. #define RV515_MC_INIT_MISC_LAT_TIMER 0x09
  256. #define AVIVO_MC_DATA 0x0074
  257. #define R520_MC_IND_INDEX 0x70
  258. #define R520_MC_IND_WR_EN (1 << 24)
  259. #define R520_MC_IND_DATA 0x74
  260. #define RV515_MC_CNTL 0x5
  261. # define RV515_MEM_NUM_CHANNELS_MASK 0x3
  262. #define R520_MC_CNTL0 0x8
  263. # define R520_MEM_NUM_CHANNELS_MASK (0x3 << 24)
  264. # define R520_MEM_NUM_CHANNELS_SHIFT 24
  265. # define R520_MC_CHANNEL_SIZE (1 << 23)
  266. #define AVIVO_CP_DYN_CNTL 0x000f /* PLL */
  267. # define AVIVO_CP_FORCEON (1 << 0)
  268. #define AVIVO_E2_DYN_CNTL 0x0011 /* PLL */
  269. # define AVIVO_E2_FORCEON (1 << 0)
  270. #define AVIVO_IDCT_DYN_CNTL 0x0013 /* PLL */
  271. # define AVIVO_IDCT_FORCEON (1 << 0)
  272. #define AVIVO_HDP_FB_LOCATION 0x134
  273. #define AVIVO_VGA_RENDER_CONTROL 0x0300
  274. # define AVIVO_VGA_VSTATUS_CNTL_MASK (3 << 16)
  275. #define AVIVO_D1VGA_CONTROL 0x0330
  276. # define AVIVO_DVGA_CONTROL_MODE_ENABLE (1<<0)
  277. # define AVIVO_DVGA_CONTROL_TIMING_SELECT (1<<8)
  278. # define AVIVO_DVGA_CONTROL_SYNC_POLARITY_SELECT (1<<9)
  279. # define AVIVO_DVGA_CONTROL_OVERSCAN_TIMING_SELECT (1<<10)
  280. # define AVIVO_DVGA_CONTROL_OVERSCAN_COLOR_EN (1<<16)
  281. # define AVIVO_DVGA_CONTROL_ROTATE (1<<24)
  282. #define AVIVO_D2VGA_CONTROL 0x0338
  283. #define AVIVO_EXT1_PPLL_REF_DIV_SRC 0x400
  284. #define AVIVO_EXT1_PPLL_REF_DIV 0x404
  285. #define AVIVO_EXT1_PPLL_UPDATE_LOCK 0x408
  286. #define AVIVO_EXT1_PPLL_UPDATE_CNTL 0x40c
  287. #define AVIVO_EXT2_PPLL_REF_DIV_SRC 0x410
  288. #define AVIVO_EXT2_PPLL_REF_DIV 0x414
  289. #define AVIVO_EXT2_PPLL_UPDATE_LOCK 0x418
  290. #define AVIVO_EXT2_PPLL_UPDATE_CNTL 0x41c
  291. #define AVIVO_EXT1_PPLL_FB_DIV 0x430
  292. #define AVIVO_EXT2_PPLL_FB_DIV 0x434
  293. #define AVIVO_EXT1_PPLL_POST_DIV_SRC 0x438
  294. #define AVIVO_EXT1_PPLL_POST_DIV 0x43c
  295. #define AVIVO_EXT2_PPLL_POST_DIV_SRC 0x440
  296. #define AVIVO_EXT2_PPLL_POST_DIV 0x444
  297. #define AVIVO_EXT1_PPLL_CNTL 0x448
  298. #define AVIVO_EXT2_PPLL_CNTL 0x44c
  299. #define AVIVO_P1PLL_CNTL 0x450
  300. #define AVIVO_P2PLL_CNTL 0x454
  301. #define AVIVO_P1PLL_INT_SS_CNTL 0x458
  302. #define AVIVO_P2PLL_INT_SS_CNTL 0x45c
  303. #define AVIVO_P1PLL_TMDSA_CNTL 0x460
  304. #define AVIVO_P2PLL_LVTMA_CNTL 0x464
  305. #define AVIVO_PCLK_CRTC1_CNTL 0x480
  306. #define AVIVO_PCLK_CRTC2_CNTL 0x484
  307. #define AVIVO_D1CRTC_H_TOTAL 0x6000
  308. #define AVIVO_D1CRTC_H_BLANK_START_END 0x6004
  309. #define AVIVO_D1CRTC_H_SYNC_A 0x6008
  310. #define AVIVO_D1CRTC_H_SYNC_A_CNTL 0x600c
  311. #define AVIVO_D1CRTC_H_SYNC_B 0x6010
  312. #define AVIVO_D1CRTC_H_SYNC_B_CNTL 0x6014
  313. #define AVIVO_D1CRTC_V_TOTAL 0x6020
  314. #define AVIVO_D1CRTC_V_BLANK_START_END 0x6024
  315. #define AVIVO_D1CRTC_V_SYNC_A 0x6028
  316. #define AVIVO_D1CRTC_V_SYNC_A_CNTL 0x602c
  317. #define AVIVO_D1CRTC_V_SYNC_B 0x6030
  318. #define AVIVO_D1CRTC_V_SYNC_B_CNTL 0x6034
  319. #define AVIVO_D1CRTC_CONTROL 0x6080
  320. # define AVIVO_CRTC_EN (1 << 0)
  321. # define AVIVO_CRTC_DISP_READ_REQUEST_DISABLE (1 << 24)
  322. #define AVIVO_D1CRTC_BLANK_CONTROL 0x6084
  323. #define AVIVO_D1CRTC_INTERLACE_CONTROL 0x6088
  324. #define AVIVO_D1CRTC_INTERLACE_STATUS 0x608c
  325. #define AVIVO_D1CRTC_STATUS 0x609c
  326. # define AVIVO_D1CRTC_V_BLANK (1 << 0)
  327. #define AVIVO_D1CRTC_STATUS_POSITION 0x60a0
  328. #define AVIVO_D1CRTC_FRAME_COUNT 0x60a4
  329. #define AVIVO_D1CRTC_STATUS_HV_COUNT 0x60ac
  330. #define AVIVO_D1CRTC_STEREO_CONTROL 0x60c4
  331. #define AVIVO_D1MODE_MASTER_UPDATE_LOCK 0x60e0
  332. #define AVIVO_D1MODE_MASTER_UPDATE_MODE 0x60e4
  333. #define AVIVO_D1CRTC_UPDATE_LOCK 0x60e8
  334. /* master controls */
  335. #define AVIVO_DC_CRTC_MASTER_EN 0x60f8
  336. #define AVIVO_DC_CRTC_TV_CONTROL 0x60fc
  337. #define AVIVO_D1GRPH_ENABLE 0x6100
  338. #define AVIVO_D1GRPH_CONTROL 0x6104
  339. # define AVIVO_D1GRPH_CONTROL_DEPTH_8BPP (0 << 0)
  340. # define AVIVO_D1GRPH_CONTROL_DEPTH_16BPP (1 << 0)
  341. # define AVIVO_D1GRPH_CONTROL_DEPTH_32BPP (2 << 0)
  342. # define AVIVO_D1GRPH_CONTROL_DEPTH_64BPP (3 << 0)
  343. # define AVIVO_D1GRPH_CONTROL_8BPP_INDEXED (0 << 8)
  344. # define AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555 (0 << 8)
  345. # define AVIVO_D1GRPH_CONTROL_16BPP_RGB565 (1 << 8)
  346. # define AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444 (2 << 8)
  347. # define AVIVO_D1GRPH_CONTROL_16BPP_AI88 (3 << 8)
  348. # define AVIVO_D1GRPH_CONTROL_16BPP_MONO16 (4 << 8)
  349. # define AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888 (0 << 8)
  350. # define AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010 (1 << 8)
  351. # define AVIVO_D1GRPH_CONTROL_32BPP_DIGITAL (2 << 8)
  352. # define AVIVO_D1GRPH_CONTROL_32BPP_8B_ARGB2101010 (3 << 8)
  353. # define AVIVO_D1GRPH_CONTROL_64BPP_ARGB16161616 (0 << 8)
  354. # define AVIVO_D1GRPH_SWAP_RB (1 << 16)
  355. # define AVIVO_D1GRPH_TILED (1 << 20)
  356. # define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1 << 21)
  357. # define R600_D1GRPH_ARRAY_MODE_LINEAR_GENERAL (0 << 20)
  358. # define R600_D1GRPH_ARRAY_MODE_LINEAR_ALIGNED (1 << 20)
  359. # define R600_D1GRPH_ARRAY_MODE_1D_TILED_THIN1 (2 << 20)
  360. # define R600_D1GRPH_ARRAY_MODE_2D_TILED_THIN1 (4 << 20)
  361. /* The R7xx *_HIGH surface regs are backwards; the D1 regs are in the D2
  362. * block and vice versa. This applies to GRPH, CUR, etc.
  363. */
  364. #define AVIVO_D1GRPH_LUT_SEL 0x6108
  365. # define AVIVO_LUT_10BIT_BYPASS_EN (1 << 8)
  366. #define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110
  367. #define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6914
  368. #define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6114
  369. #define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS 0x6118
  370. #define R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x691c
  371. #define R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x611c
  372. #define AVIVO_D1GRPH_PITCH 0x6120
  373. #define AVIVO_D1GRPH_SURFACE_OFFSET_X 0x6124
  374. #define AVIVO_D1GRPH_SURFACE_OFFSET_Y 0x6128
  375. #define AVIVO_D1GRPH_X_START 0x612c
  376. #define AVIVO_D1GRPH_Y_START 0x6130
  377. #define AVIVO_D1GRPH_X_END 0x6134
  378. #define AVIVO_D1GRPH_Y_END 0x6138
  379. #define AVIVO_D1GRPH_UPDATE 0x6144
  380. # define AVIVO_D1GRPH_SURFACE_UPDATE_PENDING (1 << 2)
  381. # define AVIVO_D1GRPH_UPDATE_LOCK (1 << 16)
  382. #define AVIVO_D1GRPH_FLIP_CONTROL 0x6148
  383. # define AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN (1 << 0)
  384. #define AVIVO_D1CUR_CONTROL 0x6400
  385. # define AVIVO_D1CURSOR_EN (1 << 0)
  386. # define AVIVO_D1CURSOR_MODE_SHIFT 8
  387. # define AVIVO_D1CURSOR_MODE_MASK (3 << 8)
  388. # define AVIVO_D1CURSOR_MODE_24BPP 2
  389. #define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408
  390. #define R700_D1CUR_SURFACE_ADDRESS_HIGH 0x6c0c
  391. #define R700_D2CUR_SURFACE_ADDRESS_HIGH 0x640c
  392. #define AVIVO_D1CUR_SIZE 0x6410
  393. #define AVIVO_D1CUR_POSITION 0x6414
  394. #define AVIVO_D1CUR_HOT_SPOT 0x6418
  395. #define AVIVO_D1CUR_UPDATE 0x6424
  396. # define AVIVO_D1CURSOR_UPDATE_LOCK (1 << 16)
  397. #define AVIVO_DC_LUT_RW_SELECT 0x6480
  398. #define AVIVO_DC_LUT_RW_MODE 0x6484
  399. #define AVIVO_DC_LUT_RW_INDEX 0x6488
  400. #define AVIVO_DC_LUT_SEQ_COLOR 0x648c
  401. #define AVIVO_DC_LUT_PWL_DATA 0x6490
  402. #define AVIVO_DC_LUT_30_COLOR 0x6494
  403. #define AVIVO_DC_LUT_READ_PIPE_SELECT 0x6498
  404. #define AVIVO_DC_LUT_WRITE_EN_MASK 0x649c
  405. #define AVIVO_DC_LUT_AUTOFILL 0x64a0
  406. #define AVIVO_DC_LUTA_CONTROL 0x64c0
  407. #define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE 0x64c4
  408. #define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN 0x64c8
  409. #define AVIVO_DC_LUTA_BLACK_OFFSET_RED 0x64cc
  410. #define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE 0x64d0
  411. #define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN 0x64d4
  412. #define AVIVO_DC_LUTA_WHITE_OFFSET_RED 0x64d8
  413. #define AVIVO_DC_LB_MEMORY_SPLIT 0x6520
  414. # define AVIVO_DC_LB_MEMORY_SPLIT_MASK 0x3
  415. # define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT 0
  416. # define AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0
  417. # define AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1
  418. # define AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY 2
  419. # define AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3
  420. # define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2)
  421. # define AVIVO_DC_LB_DISP1_END_ADR_SHIFT 4
  422. # define AVIVO_DC_LB_DISP1_END_ADR_MASK 0x7ff
  423. #define AVIVO_D1MODE_DATA_FORMAT 0x6528
  424. # define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0)
  425. #define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652C
  426. #define AVIVO_D1MODE_VBLANK_STATUS 0x6534
  427. # define AVIVO_VBLANK_ACK (1 << 4)
  428. #define AVIVO_D1MODE_VLINE_START_END 0x6538
  429. #define AVIVO_D1MODE_VLINE_STATUS 0x653c
  430. # define AVIVO_D1MODE_VLINE_STAT (1 << 12)
  431. #define AVIVO_DxMODE_INT_MASK 0x6540
  432. # define AVIVO_D1MODE_INT_MASK (1 << 0)
  433. # define AVIVO_D2MODE_INT_MASK (1 << 8)
  434. #define AVIVO_D1MODE_VIEWPORT_START 0x6580
  435. #define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584
  436. #define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588
  437. #define AVIVO_D1MODE_EXT_OVERSCAN_TOP_BOTTOM 0x658c
  438. #define AVIVO_D1SCL_SCALER_ENABLE 0x6590
  439. #define AVIVO_D1SCL_SCALER_TAP_CONTROL 0x6594
  440. #define AVIVO_D1SCL_UPDATE 0x65cc
  441. # define AVIVO_D1SCL_UPDATE_LOCK (1 << 16)
  442. /* second crtc */
  443. #define AVIVO_D2CRTC_H_TOTAL 0x6800
  444. #define AVIVO_D2CRTC_H_BLANK_START_END 0x6804
  445. #define AVIVO_D2CRTC_H_SYNC_A 0x6808
  446. #define AVIVO_D2CRTC_H_SYNC_A_CNTL 0x680c
  447. #define AVIVO_D2CRTC_H_SYNC_B 0x6810
  448. #define AVIVO_D2CRTC_H_SYNC_B_CNTL 0x6814
  449. #define AVIVO_D2CRTC_V_TOTAL 0x6820
  450. #define AVIVO_D2CRTC_V_BLANK_START_END 0x6824
  451. #define AVIVO_D2CRTC_V_SYNC_A 0x6828
  452. #define AVIVO_D2CRTC_V_SYNC_A_CNTL 0x682c
  453. #define AVIVO_D2CRTC_V_SYNC_B 0x6830
  454. #define AVIVO_D2CRTC_V_SYNC_B_CNTL 0x6834
  455. #define AVIVO_D2CRTC_CONTROL 0x6880
  456. #define AVIVO_D2CRTC_BLANK_CONTROL 0x6884
  457. #define AVIVO_D2CRTC_INTERLACE_CONTROL 0x6888
  458. #define AVIVO_D2CRTC_INTERLACE_STATUS 0x688c
  459. #define AVIVO_D2CRTC_STATUS_POSITION 0x68a0
  460. #define AVIVO_D2CRTC_FRAME_COUNT 0x68a4
  461. #define AVIVO_D2CRTC_STEREO_CONTROL 0x68c4
  462. #define AVIVO_D2GRPH_ENABLE 0x6900
  463. #define AVIVO_D2GRPH_CONTROL 0x6904
  464. #define AVIVO_D2GRPH_LUT_SEL 0x6908
  465. #define AVIVO_D2GRPH_PRIMARY_SURFACE_ADDRESS 0x6910
  466. #define AVIVO_D2GRPH_SECONDARY_SURFACE_ADDRESS 0x6918
  467. #define AVIVO_D2GRPH_PITCH 0x6920
  468. #define AVIVO_D2GRPH_SURFACE_OFFSET_X 0x6924
  469. #define AVIVO_D2GRPH_SURFACE_OFFSET_Y 0x6928
  470. #define AVIVO_D2GRPH_X_START 0x692c
  471. #define AVIVO_D2GRPH_Y_START 0x6930
  472. #define AVIVO_D2GRPH_X_END 0x6934
  473. #define AVIVO_D2GRPH_Y_END 0x6938
  474. #define AVIVO_D2GRPH_UPDATE 0x6944
  475. #define AVIVO_D2GRPH_FLIP_CONTROL 0x6948
  476. #define AVIVO_D2CUR_CONTROL 0x6c00
  477. #define AVIVO_D2CUR_SURFACE_ADDRESS 0x6c08
  478. #define AVIVO_D2CUR_SIZE 0x6c10
  479. #define AVIVO_D2CUR_POSITION 0x6c14
  480. #define AVIVO_D2MODE_VBLANK_STATUS 0x6d34
  481. #define AVIVO_D2MODE_VLINE_START_END 0x6d38
  482. #define AVIVO_D2MODE_VLINE_STATUS 0x6d3c
  483. #define AVIVO_D2MODE_VIEWPORT_START 0x6d80
  484. #define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84
  485. #define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88
  486. #define AVIVO_D2MODE_EXT_OVERSCAN_TOP_BOTTOM 0x6d8c
  487. #define AVIVO_D2SCL_SCALER_ENABLE 0x6d90
  488. #define AVIVO_D2SCL_SCALER_TAP_CONTROL 0x6d94
  489. #define AVIVO_DDIA_BIT_DEPTH_CONTROL 0x7214
  490. #define AVIVO_DACA_ENABLE 0x7800
  491. # define AVIVO_DAC_ENABLE (1 << 0)
  492. #define AVIVO_DACA_SOURCE_SELECT 0x7804
  493. # define AVIVO_DAC_SOURCE_CRTC1 (0 << 0)
  494. # define AVIVO_DAC_SOURCE_CRTC2 (1 << 0)
  495. # define AVIVO_DAC_SOURCE_TV (2 << 0)
  496. #define AVIVO_DACA_FORCE_OUTPUT_CNTL 0x783c
  497. # define AVIVO_DACA_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0)
  498. # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8)
  499. # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0)
  500. # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1)
  501. # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2)
  502. # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24)
  503. #define AVIVO_DACA_POWERDOWN 0x7850
  504. # define AVIVO_DACA_POWERDOWN_POWERDOWN (1 << 0)
  505. # define AVIVO_DACA_POWERDOWN_BLUE (1 << 8)
  506. # define AVIVO_DACA_POWERDOWN_GREEN (1 << 16)
  507. # define AVIVO_DACA_POWERDOWN_RED (1 << 24)
  508. #define AVIVO_DACB_ENABLE 0x7a00
  509. #define AVIVO_DACB_SOURCE_SELECT 0x7a04
  510. #define AVIVO_DACB_FORCE_OUTPUT_CNTL 0x7a3c
  511. # define AVIVO_DACB_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0)
  512. # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8)
  513. # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0)
  514. # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1)
  515. # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2)
  516. # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24)
  517. #define AVIVO_DACB_POWERDOWN 0x7a50
  518. # define AVIVO_DACB_POWERDOWN_POWERDOWN (1 << 0)
  519. # define AVIVO_DACB_POWERDOWN_BLUE (1 << 8)
  520. # define AVIVO_DACB_POWERDOWN_GREEN (1 << 16)
  521. # define AVIVO_DACB_POWERDOWN_RED
  522. #define AVIVO_TMDSA_CNTL 0x7880
  523. # define AVIVO_TMDSA_CNTL_ENABLE (1 << 0)
  524. # define AVIVO_TMDSA_CNTL_HDMI_EN (1 << 2)
  525. # define AVIVO_TMDSA_CNTL_HPD_MASK (1 << 4)
  526. # define AVIVO_TMDSA_CNTL_HPD_SELECT (1 << 8)
  527. # define AVIVO_TMDSA_CNTL_SYNC_PHASE (1 << 12)
  528. # define AVIVO_TMDSA_CNTL_PIXEL_ENCODING (1 << 16)
  529. # define AVIVO_TMDSA_CNTL_DUAL_LINK_ENABLE (1 << 24)
  530. # define AVIVO_TMDSA_CNTL_SWAP (1 << 28)
  531. #define AVIVO_TMDSA_SOURCE_SELECT 0x7884
  532. /* 78a8 appears to be some kind of (reasonably tolerant) clock?
  533. * 78d0 definitely hits the transmitter, definitely clock. */
  534. /* MYSTERY1 This appears to control dithering? */
  535. #define AVIVO_TMDSA_BIT_DEPTH_CONTROL 0x7894
  536. # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0)
  537. # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4)
  538. # define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8)
  539. # define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12)
  540. # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16)
  541. # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20)
  542. # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24)
  543. # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26)
  544. #define AVIVO_TMDSA_DCBALANCER_CONTROL 0x78d0
  545. # define AVIVO_TMDSA_DCBALANCER_CONTROL_EN (1 << 0)
  546. # define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_EN (1 << 8)
  547. # define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16)
  548. # define AVIVO_TMDSA_DCBALANCER_CONTROL_FORCE (1 << 24)
  549. #define AVIVO_TMDSA_DATA_SYNCHRONIZATION 0x78d8
  550. # define AVIVO_TMDSA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0)
  551. # define AVIVO_TMDSA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8)
  552. #define AVIVO_TMDSA_CLOCK_ENABLE 0x7900
  553. #define AVIVO_TMDSA_TRANSMITTER_ENABLE 0x7904
  554. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX0_ENABLE (1 << 0)
  555. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1)
  556. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2)
  557. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3)
  558. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4)
  559. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX1_ENABLE (1 << 8)
  560. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10)
  561. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11)
  562. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12)
  563. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX_ENABLE_HPD_MASK (1 << 16)
  564. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17)
  565. # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18)
  566. #define AVIVO_TMDSA_TRANSMITTER_CONTROL 0x7910
  567. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0)
  568. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1)
  569. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2)
  570. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4)
  571. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5)
  572. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6)
  573. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK (1 << 8)
  574. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13)
  575. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK (1 << 14)
  576. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15)
  577. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16)
  578. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28)
  579. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29)
  580. # define AVIVO_TMDSA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31)
  581. #define AVIVO_LVTMA_CNTL 0x7a80
  582. # define AVIVO_LVTMA_CNTL_ENABLE (1 << 0)
  583. # define AVIVO_LVTMA_CNTL_HDMI_EN (1 << 2)
  584. # define AVIVO_LVTMA_CNTL_HPD_MASK (1 << 4)
  585. # define AVIVO_LVTMA_CNTL_HPD_SELECT (1 << 8)
  586. # define AVIVO_LVTMA_CNTL_SYNC_PHASE (1 << 12)
  587. # define AVIVO_LVTMA_CNTL_PIXEL_ENCODING (1 << 16)
  588. # define AVIVO_LVTMA_CNTL_DUAL_LINK_ENABLE (1 << 24)
  589. # define AVIVO_LVTMA_CNTL_SWAP (1 << 28)
  590. #define AVIVO_LVTMA_SOURCE_SELECT 0x7a84
  591. #define AVIVO_LVTMA_COLOR_FORMAT 0x7a88
  592. #define AVIVO_LVTMA_BIT_DEPTH_CONTROL 0x7a94
  593. # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0)
  594. # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4)
  595. # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8)
  596. # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12)
  597. # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16)
  598. # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20)
  599. # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24)
  600. # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26)
  601. #define AVIVO_LVTMA_DCBALANCER_CONTROL 0x7ad0
  602. # define AVIVO_LVTMA_DCBALANCER_CONTROL_EN (1 << 0)
  603. # define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_EN (1 << 8)
  604. # define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16)
  605. # define AVIVO_LVTMA_DCBALANCER_CONTROL_FORCE (1 << 24)
  606. #define AVIVO_LVTMA_DATA_SYNCHRONIZATION 0x78d8
  607. # define AVIVO_LVTMA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0)
  608. # define AVIVO_LVTMA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8)
  609. #define R500_LVTMA_CLOCK_ENABLE 0x7b00
  610. #define R600_LVTMA_CLOCK_ENABLE 0x7b04
  611. #define R500_LVTMA_TRANSMITTER_ENABLE 0x7b04
  612. #define R600_LVTMA_TRANSMITTER_ENABLE 0x7b08
  613. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1)
  614. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2)
  615. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3)
  616. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4)
  617. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD03EN (1 << 5)
  618. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC1EN (1 << 9)
  619. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10)
  620. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11)
  621. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12)
  622. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17)
  623. # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18)
  624. #define R500_LVTMA_TRANSMITTER_CONTROL 0x7b10
  625. #define R600_LVTMA_TRANSMITTER_CONTROL 0x7b14
  626. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0)
  627. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1)
  628. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2)
  629. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4)
  630. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5)
  631. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6)
  632. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK (1 << 8)
  633. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13)
  634. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK (1 << 14)
  635. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15)
  636. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16)
  637. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28)
  638. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29)
  639. # define AVIVO_LVTMA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31)
  640. #define R500_LVTMA_PWRSEQ_CNTL 0x7af0
  641. #define R600_LVTMA_PWRSEQ_CNTL 0x7af4
  642. # define AVIVO_LVTMA_PWRSEQ_EN (1 << 0)
  643. # define AVIVO_LVTMA_PWRSEQ_PLL_ENABLE_MASK (1 << 2)
  644. # define AVIVO_LVTMA_PWRSEQ_PLL_RESET_MASK (1 << 3)
  645. # define AVIVO_LVTMA_PWRSEQ_TARGET_STATE (1 << 4)
  646. # define AVIVO_LVTMA_SYNCEN (1 << 8)
  647. # define AVIVO_LVTMA_SYNCEN_OVRD (1 << 9)
  648. # define AVIVO_LVTMA_SYNCEN_POL (1 << 10)
  649. # define AVIVO_LVTMA_DIGON (1 << 16)
  650. # define AVIVO_LVTMA_DIGON_OVRD (1 << 17)
  651. # define AVIVO_LVTMA_DIGON_POL (1 << 18)
  652. # define AVIVO_LVTMA_BLON (1 << 24)
  653. # define AVIVO_LVTMA_BLON_OVRD (1 << 25)
  654. # define AVIVO_LVTMA_BLON_POL (1 << 26)
  655. #define R500_LVTMA_PWRSEQ_STATE 0x7af4
  656. #define R600_LVTMA_PWRSEQ_STATE 0x7af8
  657. # define AVIVO_LVTMA_PWRSEQ_STATE_TARGET_STATE_R (1 << 0)
  658. # define AVIVO_LVTMA_PWRSEQ_STATE_DIGON (1 << 1)
  659. # define AVIVO_LVTMA_PWRSEQ_STATE_SYNCEN (1 << 2)
  660. # define AVIVO_LVTMA_PWRSEQ_STATE_BLON (1 << 3)
  661. # define AVIVO_LVTMA_PWRSEQ_STATE_DONE (1 << 4)
  662. # define AVIVO_LVTMA_PWRSEQ_STATE_STATUS_SHIFT (8)
  663. #define AVIVO_LVDS_BACKLIGHT_CNTL 0x7af8
  664. # define AVIVO_LVDS_BACKLIGHT_CNTL_EN (1 << 0)
  665. # define AVIVO_LVDS_BACKLIGHT_LEVEL_MASK 0x0000ff00
  666. # define AVIVO_LVDS_BACKLIGHT_LEVEL_SHIFT 8
  667. #define AVIVO_DVOA_BIT_DEPTH_CONTROL 0x7988
  668. #define AVIVO_DC_GPIO_HPD_A 0x7e94
  669. #define AVIVO_DC_GPIO_HPD_Y 0x7e9c
  670. #define AVIVO_DC_I2C_STATUS1 0x7d30
  671. # define AVIVO_DC_I2C_DONE (1 << 0)
  672. # define AVIVO_DC_I2C_NACK (1 << 1)
  673. # define AVIVO_DC_I2C_HALT (1 << 2)
  674. # define AVIVO_DC_I2C_GO (1 << 3)
  675. #define AVIVO_DC_I2C_RESET 0x7d34
  676. # define AVIVO_DC_I2C_SOFT_RESET (1 << 0)
  677. # define AVIVO_DC_I2C_ABORT (1 << 8)
  678. #define AVIVO_DC_I2C_CONTROL1 0x7d38
  679. # define AVIVO_DC_I2C_START (1 << 0)
  680. # define AVIVO_DC_I2C_STOP (1 << 1)
  681. # define AVIVO_DC_I2C_RECEIVE (1 << 2)
  682. # define AVIVO_DC_I2C_EN (1 << 8)
  683. # define AVIVO_DC_I2C_PIN_SELECT(x) ((x) << 16)
  684. # define AVIVO_SEL_DDC1 0
  685. # define AVIVO_SEL_DDC2 1
  686. # define AVIVO_SEL_DDC3 2
  687. #define AVIVO_DC_I2C_CONTROL2 0x7d3c
  688. # define AVIVO_DC_I2C_ADDR_COUNT(x) ((x) << 0)
  689. # define AVIVO_DC_I2C_DATA_COUNT(x) ((x) << 8)
  690. #define AVIVO_DC_I2C_CONTROL3 0x7d40
  691. # define AVIVO_DC_I2C_DATA_DRIVE_EN (1 << 0)
  692. # define AVIVO_DC_I2C_DATA_DRIVE_SEL (1 << 1)
  693. # define AVIVO_DC_I2C_CLK_DRIVE_EN (1 << 7)
  694. # define AVIVO_DC_I2C_RD_INTRA_BYTE_DELAY(x) ((x) << 8)
  695. # define AVIVO_DC_I2C_WR_INTRA_BYTE_DELAY(x) ((x) << 16)
  696. # define AVIVO_DC_I2C_TIME_LIMIT(x) ((x) << 24)
  697. #define AVIVO_DC_I2C_DATA 0x7d44
  698. #define AVIVO_DC_I2C_INTERRUPT_CONTROL 0x7d48
  699. # define AVIVO_DC_I2C_INTERRUPT_STATUS (1 << 0)
  700. # define AVIVO_DC_I2C_INTERRUPT_AK (1 << 8)
  701. # define AVIVO_DC_I2C_INTERRUPT_ENABLE (1 << 16)
  702. #define AVIVO_DC_I2C_ARBITRATION 0x7d50
  703. # define AVIVO_DC_I2C_SW_WANTS_TO_USE_I2C (1 << 0)
  704. # define AVIVO_DC_I2C_SW_CAN_USE_I2C (1 << 1)
  705. # define AVIVO_DC_I2C_SW_DONE_USING_I2C (1 << 8)
  706. # define AVIVO_DC_I2C_HW_NEEDS_I2C (1 << 9)
  707. # define AVIVO_DC_I2C_ABORT_HDCP_I2C (1 << 16)
  708. # define AVIVO_DC_I2C_HW_USING_I2C (1 << 17)
  709. #define AVIVO_DC_GPIO_DDC1_MASK 0x7e40
  710. #define AVIVO_DC_GPIO_DDC1_A 0x7e44
  711. #define AVIVO_DC_GPIO_DDC1_EN 0x7e48
  712. #define AVIVO_DC_GPIO_DDC1_Y 0x7e4c
  713. #define AVIVO_DC_GPIO_DDC2_MASK 0x7e50
  714. #define AVIVO_DC_GPIO_DDC2_A 0x7e54
  715. #define AVIVO_DC_GPIO_DDC2_EN 0x7e58
  716. #define AVIVO_DC_GPIO_DDC2_Y 0x7e5c
  717. #define AVIVO_DC_GPIO_DDC3_MASK 0x7e60
  718. #define AVIVO_DC_GPIO_DDC3_A 0x7e64
  719. #define AVIVO_DC_GPIO_DDC3_EN 0x7e68
  720. #define AVIVO_DC_GPIO_DDC3_Y 0x7e6c
  721. #define AVIVO_DISP_INTERRUPT_STATUS 0x7edc
  722. # define AVIVO_D1_VBLANK_INTERRUPT (1 << 4)
  723. # define AVIVO_D2_VBLANK_INTERRUPT (1 << 5)
  724. #endif