r600d.h 123 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369
  1. /*
  2. * Copyright 2009 Advanced Micro Devices, Inc.
  3. * Copyright 2009 Red Hat Inc.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a
  6. * copy of this software and associated documentation files (the "Software"),
  7. * to deal in the Software without restriction, including without limitation
  8. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. * and/or sell copies of the Software, and to permit persons to whom the
  10. * Software is furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in
  13. * all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  19. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  20. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  21. * OTHER DEALINGS IN THE SOFTWARE.
  22. *
  23. * Authors: Dave Airlie
  24. * Alex Deucher
  25. * Jerome Glisse
  26. */
  27. #ifndef R600D_H
  28. #define R600D_H
  29. #define CP_PACKET2 0x80000000
  30. #define PACKET2_PAD_SHIFT 0
  31. #define PACKET2_PAD_MASK (0x3fffffff << 0)
  32. #define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
  33. #define R6XX_MAX_SH_GPRS 256
  34. #define R6XX_MAX_TEMP_GPRS 16
  35. #define R6XX_MAX_SH_THREADS 256
  36. #define R6XX_MAX_SH_STACK_ENTRIES 4096
  37. #define R6XX_MAX_BACKENDS 8
  38. #define R6XX_MAX_BACKENDS_MASK 0xff
  39. #define R6XX_MAX_SIMDS 8
  40. #define R6XX_MAX_SIMDS_MASK 0xff
  41. #define R6XX_MAX_PIPES 8
  42. #define R6XX_MAX_PIPES_MASK 0xff
  43. /* tiling bits */
  44. #define ARRAY_LINEAR_GENERAL 0x00000000
  45. #define ARRAY_LINEAR_ALIGNED 0x00000001
  46. #define ARRAY_1D_TILED_THIN1 0x00000002
  47. #define ARRAY_2D_TILED_THIN1 0x00000004
  48. /* Registers */
  49. #define ARB_POP 0x2418
  50. #define ENABLE_TC128 (1 << 30)
  51. #define ARB_GDEC_RD_CNTL 0x246C
  52. #define CC_GC_SHADER_PIPE_CONFIG 0x8950
  53. #define CC_RB_BACKEND_DISABLE 0x98F4
  54. #define BACKEND_DISABLE(x) ((x) << 16)
  55. #define R_028808_CB_COLOR_CONTROL 0x28808
  56. #define S_028808_SPECIAL_OP(x) (((x) & 0x7) << 4)
  57. #define G_028808_SPECIAL_OP(x) (((x) >> 4) & 0x7)
  58. #define C_028808_SPECIAL_OP 0xFFFFFF8F
  59. #define V_028808_SPECIAL_NORMAL 0x00
  60. #define V_028808_SPECIAL_DISABLE 0x01
  61. #define V_028808_SPECIAL_RESOLVE_BOX 0x07
  62. #define CB_COLOR0_BASE 0x28040
  63. #define CB_COLOR1_BASE 0x28044
  64. #define CB_COLOR2_BASE 0x28048
  65. #define CB_COLOR3_BASE 0x2804C
  66. #define CB_COLOR4_BASE 0x28050
  67. #define CB_COLOR5_BASE 0x28054
  68. #define CB_COLOR6_BASE 0x28058
  69. #define CB_COLOR7_BASE 0x2805C
  70. #define CB_COLOR7_FRAG 0x280FC
  71. #define CB_COLOR0_SIZE 0x28060
  72. #define CB_COLOR0_VIEW 0x28080
  73. #define R_028080_CB_COLOR0_VIEW 0x028080
  74. #define S_028080_SLICE_START(x) (((x) & 0x7FF) << 0)
  75. #define G_028080_SLICE_START(x) (((x) >> 0) & 0x7FF)
  76. #define C_028080_SLICE_START 0xFFFFF800
  77. #define S_028080_SLICE_MAX(x) (((x) & 0x7FF) << 13)
  78. #define G_028080_SLICE_MAX(x) (((x) >> 13) & 0x7FF)
  79. #define C_028080_SLICE_MAX 0xFF001FFF
  80. #define R_028084_CB_COLOR1_VIEW 0x028084
  81. #define R_028088_CB_COLOR2_VIEW 0x028088
  82. #define R_02808C_CB_COLOR3_VIEW 0x02808C
  83. #define R_028090_CB_COLOR4_VIEW 0x028090
  84. #define R_028094_CB_COLOR5_VIEW 0x028094
  85. #define R_028098_CB_COLOR6_VIEW 0x028098
  86. #define R_02809C_CB_COLOR7_VIEW 0x02809C
  87. #define R_028100_CB_COLOR0_MASK 0x028100
  88. #define S_028100_CMASK_BLOCK_MAX(x) (((x) & 0xFFF) << 0)
  89. #define G_028100_CMASK_BLOCK_MAX(x) (((x) >> 0) & 0xFFF)
  90. #define C_028100_CMASK_BLOCK_MAX 0xFFFFF000
  91. #define S_028100_FMASK_TILE_MAX(x) (((x) & 0xFFFFF) << 12)
  92. #define G_028100_FMASK_TILE_MAX(x) (((x) >> 12) & 0xFFFFF)
  93. #define C_028100_FMASK_TILE_MAX 0x00000FFF
  94. #define R_028104_CB_COLOR1_MASK 0x028104
  95. #define R_028108_CB_COLOR2_MASK 0x028108
  96. #define R_02810C_CB_COLOR3_MASK 0x02810C
  97. #define R_028110_CB_COLOR4_MASK 0x028110
  98. #define R_028114_CB_COLOR5_MASK 0x028114
  99. #define R_028118_CB_COLOR6_MASK 0x028118
  100. #define R_02811C_CB_COLOR7_MASK 0x02811C
  101. #define CB_COLOR0_INFO 0x280a0
  102. # define CB_FORMAT(x) ((x) << 2)
  103. # define CB_ARRAY_MODE(x) ((x) << 8)
  104. # define CB_SOURCE_FORMAT(x) ((x) << 27)
  105. # define CB_SF_EXPORT_FULL 0
  106. # define CB_SF_EXPORT_NORM 1
  107. #define CB_COLOR0_TILE 0x280c0
  108. #define CB_COLOR0_FRAG 0x280e0
  109. #define CB_COLOR0_MASK 0x28100
  110. #define SQ_ALU_CONST_CACHE_PS_0 0x28940
  111. #define SQ_ALU_CONST_CACHE_PS_1 0x28944
  112. #define SQ_ALU_CONST_CACHE_PS_2 0x28948
  113. #define SQ_ALU_CONST_CACHE_PS_3 0x2894c
  114. #define SQ_ALU_CONST_CACHE_PS_4 0x28950
  115. #define SQ_ALU_CONST_CACHE_PS_5 0x28954
  116. #define SQ_ALU_CONST_CACHE_PS_6 0x28958
  117. #define SQ_ALU_CONST_CACHE_PS_7 0x2895c
  118. #define SQ_ALU_CONST_CACHE_PS_8 0x28960
  119. #define SQ_ALU_CONST_CACHE_PS_9 0x28964
  120. #define SQ_ALU_CONST_CACHE_PS_10 0x28968
  121. #define SQ_ALU_CONST_CACHE_PS_11 0x2896c
  122. #define SQ_ALU_CONST_CACHE_PS_12 0x28970
  123. #define SQ_ALU_CONST_CACHE_PS_13 0x28974
  124. #define SQ_ALU_CONST_CACHE_PS_14 0x28978
  125. #define SQ_ALU_CONST_CACHE_PS_15 0x2897c
  126. #define SQ_ALU_CONST_CACHE_VS_0 0x28980
  127. #define SQ_ALU_CONST_CACHE_VS_1 0x28984
  128. #define SQ_ALU_CONST_CACHE_VS_2 0x28988
  129. #define SQ_ALU_CONST_CACHE_VS_3 0x2898c
  130. #define SQ_ALU_CONST_CACHE_VS_4 0x28990
  131. #define SQ_ALU_CONST_CACHE_VS_5 0x28994
  132. #define SQ_ALU_CONST_CACHE_VS_6 0x28998
  133. #define SQ_ALU_CONST_CACHE_VS_7 0x2899c
  134. #define SQ_ALU_CONST_CACHE_VS_8 0x289a0
  135. #define SQ_ALU_CONST_CACHE_VS_9 0x289a4
  136. #define SQ_ALU_CONST_CACHE_VS_10 0x289a8
  137. #define SQ_ALU_CONST_CACHE_VS_11 0x289ac
  138. #define SQ_ALU_CONST_CACHE_VS_12 0x289b0
  139. #define SQ_ALU_CONST_CACHE_VS_13 0x289b4
  140. #define SQ_ALU_CONST_CACHE_VS_14 0x289b8
  141. #define SQ_ALU_CONST_CACHE_VS_15 0x289bc
  142. #define SQ_ALU_CONST_CACHE_GS_0 0x289c0
  143. #define SQ_ALU_CONST_CACHE_GS_1 0x289c4
  144. #define SQ_ALU_CONST_CACHE_GS_2 0x289c8
  145. #define SQ_ALU_CONST_CACHE_GS_3 0x289cc
  146. #define SQ_ALU_CONST_CACHE_GS_4 0x289d0
  147. #define SQ_ALU_CONST_CACHE_GS_5 0x289d4
  148. #define SQ_ALU_CONST_CACHE_GS_6 0x289d8
  149. #define SQ_ALU_CONST_CACHE_GS_7 0x289dc
  150. #define SQ_ALU_CONST_CACHE_GS_8 0x289e0
  151. #define SQ_ALU_CONST_CACHE_GS_9 0x289e4
  152. #define SQ_ALU_CONST_CACHE_GS_10 0x289e8
  153. #define SQ_ALU_CONST_CACHE_GS_11 0x289ec
  154. #define SQ_ALU_CONST_CACHE_GS_12 0x289f0
  155. #define SQ_ALU_CONST_CACHE_GS_13 0x289f4
  156. #define SQ_ALU_CONST_CACHE_GS_14 0x289f8
  157. #define SQ_ALU_CONST_CACHE_GS_15 0x289fc
  158. #define CONFIG_MEMSIZE 0x5428
  159. #define CONFIG_CNTL 0x5424
  160. #define CP_STALLED_STAT1 0x8674
  161. #define CP_STALLED_STAT2 0x8678
  162. #define CP_BUSY_STAT 0x867C
  163. #define CP_STAT 0x8680
  164. #define CP_COHER_BASE 0x85F8
  165. #define CP_DEBUG 0xC1FC
  166. #define R_0086D8_CP_ME_CNTL 0x86D8
  167. #define S_0086D8_CP_PFP_HALT(x) (((x) & 1)<<26)
  168. #define C_0086D8_CP_PFP_HALT(x) ((x) & 0xFBFFFFFF)
  169. #define S_0086D8_CP_ME_HALT(x) (((x) & 1)<<28)
  170. #define C_0086D8_CP_ME_HALT(x) ((x) & 0xEFFFFFFF)
  171. #define CP_ME_RAM_DATA 0xC160
  172. #define CP_ME_RAM_RADDR 0xC158
  173. #define CP_ME_RAM_WADDR 0xC15C
  174. #define CP_MEQ_THRESHOLDS 0x8764
  175. #define MEQ_END(x) ((x) << 16)
  176. #define ROQ_END(x) ((x) << 24)
  177. #define CP_PERFMON_CNTL 0x87FC
  178. #define CP_PFP_UCODE_ADDR 0xC150
  179. #define CP_PFP_UCODE_DATA 0xC154
  180. #define CP_QUEUE_THRESHOLDS 0x8760
  181. #define ROQ_IB1_START(x) ((x) << 0)
  182. #define ROQ_IB2_START(x) ((x) << 8)
  183. #define CP_RB_BASE 0xC100
  184. #define CP_RB_CNTL 0xC104
  185. #define RB_BUFSZ(x) ((x) << 0)
  186. #define RB_BLKSZ(x) ((x) << 8)
  187. #define RB_NO_UPDATE (1 << 27)
  188. #define RB_RPTR_WR_ENA (1 << 31)
  189. #define BUF_SWAP_32BIT (2 << 16)
  190. #define CP_RB_RPTR 0x8700
  191. #define CP_RB_RPTR_ADDR 0xC10C
  192. #define RB_RPTR_SWAP(x) ((x) << 0)
  193. #define CP_RB_RPTR_ADDR_HI 0xC110
  194. #define CP_RB_RPTR_WR 0xC108
  195. #define CP_RB_WPTR 0xC114
  196. #define CP_RB_WPTR_ADDR 0xC118
  197. #define CP_RB_WPTR_ADDR_HI 0xC11C
  198. #define CP_RB_WPTR_DELAY 0x8704
  199. #define CP_ROQ_IB1_STAT 0x8784
  200. #define CP_ROQ_IB2_STAT 0x8788
  201. #define CP_SEM_WAIT_TIMER 0x85BC
  202. #define DB_DEBUG 0x9830
  203. #define PREZ_MUST_WAIT_FOR_POSTZ_DONE (1 << 31)
  204. #define DB_DEPTH_BASE 0x2800C
  205. #define DB_HTILE_DATA_BASE 0x28014
  206. #define DB_HTILE_SURFACE 0x28D24
  207. #define S_028D24_HTILE_WIDTH(x) (((x) & 0x1) << 0)
  208. #define G_028D24_HTILE_WIDTH(x) (((x) >> 0) & 0x1)
  209. #define C_028D24_HTILE_WIDTH 0xFFFFFFFE
  210. #define S_028D24_HTILE_HEIGHT(x) (((x) & 0x1) << 1)
  211. #define G_028D24_HTILE_HEIGHT(x) (((x) >> 1) & 0x1)
  212. #define C_028D24_HTILE_HEIGHT 0xFFFFFFFD
  213. #define G_028D24_LINEAR(x) (((x) >> 2) & 0x1)
  214. #define DB_WATERMARKS 0x9838
  215. #define DEPTH_FREE(x) ((x) << 0)
  216. #define DEPTH_FLUSH(x) ((x) << 5)
  217. #define DEPTH_PENDING_FREE(x) ((x) << 15)
  218. #define DEPTH_CACHELINE_FREE(x) ((x) << 20)
  219. #define DCP_TILING_CONFIG 0x6CA0
  220. #define PIPE_TILING(x) ((x) << 1)
  221. #define BANK_TILING(x) ((x) << 4)
  222. #define GROUP_SIZE(x) ((x) << 6)
  223. #define ROW_TILING(x) ((x) << 8)
  224. #define BANK_SWAPS(x) ((x) << 11)
  225. #define SAMPLE_SPLIT(x) ((x) << 14)
  226. #define BACKEND_MAP(x) ((x) << 16)
  227. #define GB_TILING_CONFIG 0x98F0
  228. #define PIPE_TILING__SHIFT 1
  229. #define PIPE_TILING__MASK 0x0000000e
  230. #define GC_USER_SHADER_PIPE_CONFIG 0x8954
  231. #define INACTIVE_QD_PIPES(x) ((x) << 8)
  232. #define INACTIVE_QD_PIPES_MASK 0x0000FF00
  233. #define INACTIVE_SIMDS(x) ((x) << 16)
  234. #define INACTIVE_SIMDS_MASK 0x00FF0000
  235. #define SQ_CONFIG 0x8c00
  236. # define VC_ENABLE (1 << 0)
  237. # define EXPORT_SRC_C (1 << 1)
  238. # define DX9_CONSTS (1 << 2)
  239. # define ALU_INST_PREFER_VECTOR (1 << 3)
  240. # define DX10_CLAMP (1 << 4)
  241. # define CLAUSE_SEQ_PRIO(x) ((x) << 8)
  242. # define PS_PRIO(x) ((x) << 24)
  243. # define VS_PRIO(x) ((x) << 26)
  244. # define GS_PRIO(x) ((x) << 28)
  245. # define ES_PRIO(x) ((x) << 30)
  246. #define SQ_GPR_RESOURCE_MGMT_1 0x8c04
  247. # define NUM_PS_GPRS(x) ((x) << 0)
  248. # define NUM_VS_GPRS(x) ((x) << 16)
  249. # define NUM_CLAUSE_TEMP_GPRS(x) ((x) << 28)
  250. #define SQ_GPR_RESOURCE_MGMT_2 0x8c08
  251. # define NUM_GS_GPRS(x) ((x) << 0)
  252. # define NUM_ES_GPRS(x) ((x) << 16)
  253. #define SQ_THREAD_RESOURCE_MGMT 0x8c0c
  254. # define NUM_PS_THREADS(x) ((x) << 0)
  255. # define NUM_VS_THREADS(x) ((x) << 8)
  256. # define NUM_GS_THREADS(x) ((x) << 16)
  257. # define NUM_ES_THREADS(x) ((x) << 24)
  258. #define SQ_STACK_RESOURCE_MGMT_1 0x8c10
  259. # define NUM_PS_STACK_ENTRIES(x) ((x) << 0)
  260. # define NUM_VS_STACK_ENTRIES(x) ((x) << 16)
  261. #define SQ_STACK_RESOURCE_MGMT_2 0x8c14
  262. # define NUM_GS_STACK_ENTRIES(x) ((x) << 0)
  263. # define NUM_ES_STACK_ENTRIES(x) ((x) << 16)
  264. #define SQ_ESGS_RING_BASE 0x8c40
  265. #define SQ_GSVS_RING_BASE 0x8c48
  266. #define SQ_ESTMP_RING_BASE 0x8c50
  267. #define SQ_GSTMP_RING_BASE 0x8c58
  268. #define SQ_VSTMP_RING_BASE 0x8c60
  269. #define SQ_PSTMP_RING_BASE 0x8c68
  270. #define SQ_FBUF_RING_BASE 0x8c70
  271. #define SQ_REDUC_RING_BASE 0x8c78
  272. #define GRBM_CNTL 0x8000
  273. # define GRBM_READ_TIMEOUT(x) ((x) << 0)
  274. #define GRBM_STATUS 0x8010
  275. #define CMDFIFO_AVAIL_MASK 0x0000001F
  276. #define GUI_ACTIVE (1<<31)
  277. #define GRBM_STATUS2 0x8014
  278. #define GRBM_SOFT_RESET 0x8020
  279. #define SOFT_RESET_CP (1<<0)
  280. #define CG_THERMAL_CTRL 0x7F0
  281. #define DIG_THERM_DPM(x) ((x) << 12)
  282. #define DIG_THERM_DPM_MASK 0x000FF000
  283. #define DIG_THERM_DPM_SHIFT 12
  284. #define CG_THERMAL_STATUS 0x7F4
  285. #define ASIC_T(x) ((x) << 0)
  286. #define ASIC_T_MASK 0x1FF
  287. #define ASIC_T_SHIFT 0
  288. #define CG_THERMAL_INT 0x7F8
  289. #define DIG_THERM_INTH(x) ((x) << 8)
  290. #define DIG_THERM_INTH_MASK 0x0000FF00
  291. #define DIG_THERM_INTH_SHIFT 8
  292. #define DIG_THERM_INTL(x) ((x) << 16)
  293. #define DIG_THERM_INTL_MASK 0x00FF0000
  294. #define DIG_THERM_INTL_SHIFT 16
  295. #define THERM_INT_MASK_HIGH (1 << 24)
  296. #define THERM_INT_MASK_LOW (1 << 25)
  297. #define RV770_CG_THERMAL_INT 0x734
  298. #define HDP_HOST_PATH_CNTL 0x2C00
  299. #define HDP_NONSURFACE_BASE 0x2C04
  300. #define HDP_NONSURFACE_INFO 0x2C08
  301. #define HDP_NONSURFACE_SIZE 0x2C0C
  302. #define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0
  303. #define HDP_TILING_CONFIG 0x2F3C
  304. #define HDP_DEBUG1 0x2F34
  305. #define MC_CONFIG 0x2000
  306. #define MC_VM_AGP_TOP 0x2184
  307. #define MC_VM_AGP_BOT 0x2188
  308. #define MC_VM_AGP_BASE 0x218C
  309. #define MC_VM_FB_LOCATION 0x2180
  310. #define MC_VM_L1_TLB_MCB_RD_UVD_CNTL 0x2124
  311. #define ENABLE_L1_TLB (1 << 0)
  312. #define ENABLE_L1_FRAGMENT_PROCESSING (1 << 1)
  313. #define ENABLE_L1_STRICT_ORDERING (1 << 2)
  314. #define SYSTEM_ACCESS_MODE_MASK 0x000000C0
  315. #define SYSTEM_ACCESS_MODE_SHIFT 6
  316. #define SYSTEM_ACCESS_MODE_PA_ONLY (0 << 6)
  317. #define SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 6)
  318. #define SYSTEM_ACCESS_MODE_IN_SYS (2 << 6)
  319. #define SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 6)
  320. #define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 8)
  321. #define SYSTEM_APERTURE_UNMAPPED_ACCESS_DEFAULT_PAGE (1 << 8)
  322. #define ENABLE_SEMAPHORE_MODE (1 << 10)
  323. #define ENABLE_WAIT_L2_QUERY (1 << 11)
  324. #define EFFECTIVE_L1_TLB_SIZE(x) (((x) & 7) << 12)
  325. #define EFFECTIVE_L1_TLB_SIZE_MASK 0x00007000
  326. #define EFFECTIVE_L1_TLB_SIZE_SHIFT 12
  327. #define EFFECTIVE_L1_QUEUE_SIZE(x) (((x) & 7) << 15)
  328. #define EFFECTIVE_L1_QUEUE_SIZE_MASK 0x00038000
  329. #define EFFECTIVE_L1_QUEUE_SIZE_SHIFT 15
  330. #define MC_VM_L1_TLB_MCD_RD_A_CNTL 0x219C
  331. #define MC_VM_L1_TLB_MCD_RD_B_CNTL 0x21A0
  332. #define MC_VM_L1_TLB_MCB_RD_GFX_CNTL 0x21FC
  333. #define MC_VM_L1_TLB_MCB_RD_HDP_CNTL 0x2204
  334. #define MC_VM_L1_TLB_MCB_RD_PDMA_CNTL 0x2208
  335. #define MC_VM_L1_TLB_MCB_RD_SEM_CNTL 0x220C
  336. #define MC_VM_L1_TLB_MCB_RD_SYS_CNTL 0x2200
  337. #define MC_VM_L1_TLB_MCB_WR_UVD_CNTL 0x212c
  338. #define MC_VM_L1_TLB_MCD_WR_A_CNTL 0x21A4
  339. #define MC_VM_L1_TLB_MCD_WR_B_CNTL 0x21A8
  340. #define MC_VM_L1_TLB_MCB_WR_GFX_CNTL 0x2210
  341. #define MC_VM_L1_TLB_MCB_WR_HDP_CNTL 0x2218
  342. #define MC_VM_L1_TLB_MCB_WR_PDMA_CNTL 0x221C
  343. #define MC_VM_L1_TLB_MCB_WR_SEM_CNTL 0x2220
  344. #define MC_VM_L1_TLB_MCB_WR_SYS_CNTL 0x2214
  345. #define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2190
  346. #define LOGICAL_PAGE_NUMBER_MASK 0x000FFFFF
  347. #define LOGICAL_PAGE_NUMBER_SHIFT 0
  348. #define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2194
  349. #define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x2198
  350. #define RS_DQ_RD_RET_CONF 0x2348
  351. #define PA_CL_ENHANCE 0x8A14
  352. #define CLIP_VTX_REORDER_ENA (1 << 0)
  353. #define NUM_CLIP_SEQ(x) ((x) << 1)
  354. #define PA_SC_AA_CONFIG 0x28C04
  355. #define PA_SC_AA_SAMPLE_LOCS_2S 0x8B40
  356. #define PA_SC_AA_SAMPLE_LOCS_4S 0x8B44
  357. #define PA_SC_AA_SAMPLE_LOCS_8S_WD0 0x8B48
  358. #define PA_SC_AA_SAMPLE_LOCS_8S_WD1 0x8B4C
  359. #define S0_X(x) ((x) << 0)
  360. #define S0_Y(x) ((x) << 4)
  361. #define S1_X(x) ((x) << 8)
  362. #define S1_Y(x) ((x) << 12)
  363. #define S2_X(x) ((x) << 16)
  364. #define S2_Y(x) ((x) << 20)
  365. #define S3_X(x) ((x) << 24)
  366. #define S3_Y(x) ((x) << 28)
  367. #define S4_X(x) ((x) << 0)
  368. #define S4_Y(x) ((x) << 4)
  369. #define S5_X(x) ((x) << 8)
  370. #define S5_Y(x) ((x) << 12)
  371. #define S6_X(x) ((x) << 16)
  372. #define S6_Y(x) ((x) << 20)
  373. #define S7_X(x) ((x) << 24)
  374. #define S7_Y(x) ((x) << 28)
  375. #define PA_SC_CLIPRECT_RULE 0x2820c
  376. #define PA_SC_ENHANCE 0x8BF0
  377. #define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0)
  378. #define FORCE_EOV_MAX_TILE_CNT(x) ((x) << 12)
  379. #define PA_SC_LINE_STIPPLE 0x28A0C
  380. #define PA_SC_LINE_STIPPLE_STATE 0x8B10
  381. #define PA_SC_MODE_CNTL 0x28A4C
  382. #define PA_SC_MULTI_CHIP_CNTL 0x8B20
  383. #define PA_SC_SCREEN_SCISSOR_TL 0x28030
  384. #define PA_SC_GENERIC_SCISSOR_TL 0x28240
  385. #define PA_SC_WINDOW_SCISSOR_TL 0x28204
  386. #define PCIE_PORT_INDEX 0x0038
  387. #define PCIE_PORT_DATA 0x003C
  388. #define CHMAP 0x2004
  389. #define NOOFCHAN_SHIFT 12
  390. #define NOOFCHAN_MASK 0x00003000
  391. #define RAMCFG 0x2408
  392. #define NOOFBANK_SHIFT 0
  393. #define NOOFBANK_MASK 0x00000001
  394. #define NOOFRANK_SHIFT 1
  395. #define NOOFRANK_MASK 0x00000002
  396. #define NOOFROWS_SHIFT 2
  397. #define NOOFROWS_MASK 0x0000001C
  398. #define NOOFCOLS_SHIFT 5
  399. #define NOOFCOLS_MASK 0x00000060
  400. #define CHANSIZE_SHIFT 7
  401. #define CHANSIZE_MASK 0x00000080
  402. #define BURSTLENGTH_SHIFT 8
  403. #define BURSTLENGTH_MASK 0x00000100
  404. #define CHANSIZE_OVERRIDE (1 << 10)
  405. #define SCRATCH_REG0 0x8500
  406. #define SCRATCH_REG1 0x8504
  407. #define SCRATCH_REG2 0x8508
  408. #define SCRATCH_REG3 0x850C
  409. #define SCRATCH_REG4 0x8510
  410. #define SCRATCH_REG5 0x8514
  411. #define SCRATCH_REG6 0x8518
  412. #define SCRATCH_REG7 0x851C
  413. #define SCRATCH_UMSK 0x8540
  414. #define SCRATCH_ADDR 0x8544
  415. #define SPI_CONFIG_CNTL 0x9100
  416. #define GPR_WRITE_PRIORITY(x) ((x) << 0)
  417. #define DISABLE_INTERP_1 (1 << 5)
  418. #define SPI_CONFIG_CNTL_1 0x913C
  419. #define VTX_DONE_DELAY(x) ((x) << 0)
  420. #define INTERP_ONE_PRIM_PER_ROW (1 << 4)
  421. #define SPI_INPUT_Z 0x286D8
  422. #define SPI_PS_IN_CONTROL_0 0x286CC
  423. #define NUM_INTERP(x) ((x)<<0)
  424. #define POSITION_ENA (1<<8)
  425. #define POSITION_CENTROID (1<<9)
  426. #define POSITION_ADDR(x) ((x)<<10)
  427. #define PARAM_GEN(x) ((x)<<15)
  428. #define PARAM_GEN_ADDR(x) ((x)<<19)
  429. #define BARYC_SAMPLE_CNTL(x) ((x)<<26)
  430. #define PERSP_GRADIENT_ENA (1<<28)
  431. #define LINEAR_GRADIENT_ENA (1<<29)
  432. #define POSITION_SAMPLE (1<<30)
  433. #define BARYC_AT_SAMPLE_ENA (1<<31)
  434. #define SPI_PS_IN_CONTROL_1 0x286D0
  435. #define GEN_INDEX_PIX (1<<0)
  436. #define GEN_INDEX_PIX_ADDR(x) ((x)<<1)
  437. #define FRONT_FACE_ENA (1<<8)
  438. #define FRONT_FACE_CHAN(x) ((x)<<9)
  439. #define FRONT_FACE_ALL_BITS (1<<11)
  440. #define FRONT_FACE_ADDR(x) ((x)<<12)
  441. #define FOG_ADDR(x) ((x)<<17)
  442. #define FIXED_PT_POSITION_ENA (1<<24)
  443. #define FIXED_PT_POSITION_ADDR(x) ((x)<<25)
  444. #define SQ_MS_FIFO_SIZES 0x8CF0
  445. #define CACHE_FIFO_SIZE(x) ((x) << 0)
  446. #define FETCH_FIFO_HIWATER(x) ((x) << 8)
  447. #define DONE_FIFO_HIWATER(x) ((x) << 16)
  448. #define ALU_UPDATE_FIFO_HIWATER(x) ((x) << 24)
  449. #define SQ_PGM_START_ES 0x28880
  450. #define SQ_PGM_START_FS 0x28894
  451. #define SQ_PGM_START_GS 0x2886C
  452. #define SQ_PGM_START_PS 0x28840
  453. #define SQ_PGM_RESOURCES_PS 0x28850
  454. #define SQ_PGM_EXPORTS_PS 0x28854
  455. #define SQ_PGM_CF_OFFSET_PS 0x288cc
  456. #define SQ_PGM_START_VS 0x28858
  457. #define SQ_PGM_RESOURCES_VS 0x28868
  458. #define SQ_PGM_CF_OFFSET_VS 0x288d0
  459. #define SQ_VTX_CONSTANT_WORD0_0 0x30000
  460. #define SQ_VTX_CONSTANT_WORD1_0 0x30004
  461. #define SQ_VTX_CONSTANT_WORD2_0 0x30008
  462. # define SQ_VTXC_BASE_ADDR_HI(x) ((x) << 0)
  463. # define SQ_VTXC_STRIDE(x) ((x) << 8)
  464. # define SQ_VTXC_ENDIAN_SWAP(x) ((x) << 30)
  465. # define SQ_ENDIAN_NONE 0
  466. # define SQ_ENDIAN_8IN16 1
  467. # define SQ_ENDIAN_8IN32 2
  468. #define SQ_VTX_CONSTANT_WORD3_0 0x3000c
  469. #define SQ_VTX_CONSTANT_WORD6_0 0x38018
  470. #define S__SQ_VTX_CONSTANT_TYPE(x) (((x) & 3) << 30)
  471. #define G__SQ_VTX_CONSTANT_TYPE(x) (((x) >> 30) & 3)
  472. #define SQ_TEX_VTX_INVALID_TEXTURE 0x0
  473. #define SQ_TEX_VTX_INVALID_BUFFER 0x1
  474. #define SQ_TEX_VTX_VALID_TEXTURE 0x2
  475. #define SQ_TEX_VTX_VALID_BUFFER 0x3
  476. #define SX_MISC 0x28350
  477. #define SX_MEMORY_EXPORT_BASE 0x9010
  478. #define SX_DEBUG_1 0x9054
  479. #define SMX_EVENT_RELEASE (1 << 0)
  480. #define ENABLE_NEW_SMX_ADDRESS (1 << 16)
  481. #define TA_CNTL_AUX 0x9508
  482. #define DISABLE_CUBE_WRAP (1 << 0)
  483. #define DISABLE_CUBE_ANISO (1 << 1)
  484. #define SYNC_GRADIENT (1 << 24)
  485. #define SYNC_WALKER (1 << 25)
  486. #define SYNC_ALIGNER (1 << 26)
  487. #define BILINEAR_PRECISION_6_BIT (0 << 31)
  488. #define BILINEAR_PRECISION_8_BIT (1 << 31)
  489. #define TC_CNTL 0x9608
  490. #define TC_L2_SIZE(x) ((x)<<5)
  491. #define L2_DISABLE_LATE_HIT (1<<9)
  492. #define VC_ENHANCE 0x9714
  493. #define VGT_CACHE_INVALIDATION 0x88C4
  494. #define CACHE_INVALIDATION(x) ((x)<<0)
  495. #define VC_ONLY 0
  496. #define TC_ONLY 1
  497. #define VC_AND_TC 2
  498. #define VGT_DMA_BASE 0x287E8
  499. #define VGT_DMA_BASE_HI 0x287E4
  500. #define VGT_ES_PER_GS 0x88CC
  501. #define VGT_GS_PER_ES 0x88C8
  502. #define VGT_GS_PER_VS 0x88E8
  503. #define VGT_GS_VERTEX_REUSE 0x88D4
  504. #define VGT_PRIMITIVE_TYPE 0x8958
  505. #define VGT_NUM_INSTANCES 0x8974
  506. #define VGT_OUT_DEALLOC_CNTL 0x28C5C
  507. #define DEALLOC_DIST_MASK 0x0000007F
  508. #define VGT_STRMOUT_BASE_OFFSET_0 0x28B10
  509. #define VGT_STRMOUT_BASE_OFFSET_1 0x28B14
  510. #define VGT_STRMOUT_BASE_OFFSET_2 0x28B18
  511. #define VGT_STRMOUT_BASE_OFFSET_3 0x28B1c
  512. #define VGT_STRMOUT_BASE_OFFSET_HI_0 0x28B44
  513. #define VGT_STRMOUT_BASE_OFFSET_HI_1 0x28B48
  514. #define VGT_STRMOUT_BASE_OFFSET_HI_2 0x28B4c
  515. #define VGT_STRMOUT_BASE_OFFSET_HI_3 0x28B50
  516. #define VGT_STRMOUT_BUFFER_BASE_0 0x28AD8
  517. #define VGT_STRMOUT_BUFFER_BASE_1 0x28AE8
  518. #define VGT_STRMOUT_BUFFER_BASE_2 0x28AF8
  519. #define VGT_STRMOUT_BUFFER_BASE_3 0x28B08
  520. #define VGT_STRMOUT_BUFFER_OFFSET_0 0x28ADC
  521. #define VGT_STRMOUT_BUFFER_OFFSET_1 0x28AEC
  522. #define VGT_STRMOUT_BUFFER_OFFSET_2 0x28AFC
  523. #define VGT_STRMOUT_BUFFER_OFFSET_3 0x28B0C
  524. #define VGT_STRMOUT_BUFFER_SIZE_0 0x28AD0
  525. #define VGT_STRMOUT_BUFFER_SIZE_1 0x28AE0
  526. #define VGT_STRMOUT_BUFFER_SIZE_2 0x28AF0
  527. #define VGT_STRMOUT_BUFFER_SIZE_3 0x28B00
  528. #define VGT_STRMOUT_EN 0x28AB0
  529. #define VGT_VERTEX_REUSE_BLOCK_CNTL 0x28C58
  530. #define VTX_REUSE_DEPTH_MASK 0x000000FF
  531. #define VGT_EVENT_INITIATOR 0x28a90
  532. # define CACHE_FLUSH_AND_INV_EVENT_TS (0x14 << 0)
  533. # define CACHE_FLUSH_AND_INV_EVENT (0x16 << 0)
  534. #define VM_CONTEXT0_CNTL 0x1410
  535. #define ENABLE_CONTEXT (1 << 0)
  536. #define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1)
  537. #define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4)
  538. #define VM_CONTEXT0_INVALIDATION_LOW_ADDR 0x1490
  539. #define VM_CONTEXT0_INVALIDATION_HIGH_ADDR 0x14B0
  540. #define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x1574
  541. #define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x1594
  542. #define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x15B4
  543. #define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1554
  544. #define VM_CONTEXT0_REQUEST_RESPONSE 0x1470
  545. #define REQUEST_TYPE(x) (((x) & 0xf) << 0)
  546. #define RESPONSE_TYPE_MASK 0x000000F0
  547. #define RESPONSE_TYPE_SHIFT 4
  548. #define VM_L2_CNTL 0x1400
  549. #define ENABLE_L2_CACHE (1 << 0)
  550. #define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1)
  551. #define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9)
  552. #define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 13)
  553. #define VM_L2_CNTL2 0x1404
  554. #define INVALIDATE_ALL_L1_TLBS (1 << 0)
  555. #define INVALIDATE_L2_CACHE (1 << 1)
  556. #define VM_L2_CNTL3 0x1408
  557. #define BANK_SELECT_0(x) (((x) & 0x1f) << 0)
  558. #define BANK_SELECT_1(x) (((x) & 0x1f) << 5)
  559. #define L2_CACHE_UPDATE_MODE(x) (((x) & 3) << 10)
  560. #define VM_L2_STATUS 0x140C
  561. #define L2_BUSY (1 << 0)
  562. #define WAIT_UNTIL 0x8040
  563. #define WAIT_CP_DMA_IDLE_bit (1 << 8)
  564. #define WAIT_2D_IDLE_bit (1 << 14)
  565. #define WAIT_3D_IDLE_bit (1 << 15)
  566. #define WAIT_2D_IDLECLEAN_bit (1 << 16)
  567. #define WAIT_3D_IDLECLEAN_bit (1 << 17)
  568. /* async DMA */
  569. #define DMA_TILING_CONFIG 0x3ec4
  570. #define DMA_CONFIG 0x3e4c
  571. #define DMA_RB_CNTL 0xd000
  572. # define DMA_RB_ENABLE (1 << 0)
  573. # define DMA_RB_SIZE(x) ((x) << 1) /* log2 */
  574. # define DMA_RB_SWAP_ENABLE (1 << 9) /* 8IN32 */
  575. # define DMA_RPTR_WRITEBACK_ENABLE (1 << 12)
  576. # define DMA_RPTR_WRITEBACK_SWAP_ENABLE (1 << 13) /* 8IN32 */
  577. # define DMA_RPTR_WRITEBACK_TIMER(x) ((x) << 16) /* log2 */
  578. #define DMA_RB_BASE 0xd004
  579. #define DMA_RB_RPTR 0xd008
  580. #define DMA_RB_WPTR 0xd00c
  581. #define DMA_RB_RPTR_ADDR_HI 0xd01c
  582. #define DMA_RB_RPTR_ADDR_LO 0xd020
  583. #define DMA_IB_CNTL 0xd024
  584. # define DMA_IB_ENABLE (1 << 0)
  585. # define DMA_IB_SWAP_ENABLE (1 << 4)
  586. #define DMA_IB_RPTR 0xd028
  587. #define DMA_CNTL 0xd02c
  588. # define TRAP_ENABLE (1 << 0)
  589. # define SEM_INCOMPLETE_INT_ENABLE (1 << 1)
  590. # define SEM_WAIT_INT_ENABLE (1 << 2)
  591. # define DATA_SWAP_ENABLE (1 << 3)
  592. # define FENCE_SWAP_ENABLE (1 << 4)
  593. # define CTXEMPTY_INT_ENABLE (1 << 28)
  594. #define DMA_STATUS_REG 0xd034
  595. # define DMA_IDLE (1 << 0)
  596. #define DMA_SEM_INCOMPLETE_TIMER_CNTL 0xd044
  597. #define DMA_SEM_WAIT_FAIL_TIMER_CNTL 0xd048
  598. #define DMA_MODE 0xd0bc
  599. /* async DMA packets */
  600. #define DMA_PACKET(cmd, t, s, n) ((((cmd) & 0xF) << 28) | \
  601. (((t) & 0x1) << 23) | \
  602. (((s) & 0x1) << 22) | \
  603. (((n) & 0xFFFF) << 0))
  604. /* async DMA Packet types */
  605. #define DMA_PACKET_WRITE 0x2
  606. #define DMA_PACKET_COPY 0x3
  607. #define DMA_PACKET_INDIRECT_BUFFER 0x4
  608. #define DMA_PACKET_SEMAPHORE 0x5
  609. #define DMA_PACKET_FENCE 0x6
  610. #define DMA_PACKET_TRAP 0x7
  611. #define DMA_PACKET_CONSTANT_FILL 0xd /* 7xx only */
  612. #define DMA_PACKET_NOP 0xf
  613. #define IH_RB_CNTL 0x3e00
  614. # define IH_RB_ENABLE (1 << 0)
  615. # define IH_RB_SIZE(x) ((x) << 1) /* log2 */
  616. # define IH_RB_FULL_DRAIN_ENABLE (1 << 6)
  617. # define IH_WPTR_WRITEBACK_ENABLE (1 << 8)
  618. # define IH_WPTR_WRITEBACK_TIMER(x) ((x) << 9) /* log2 */
  619. # define IH_WPTR_OVERFLOW_ENABLE (1 << 16)
  620. # define IH_WPTR_OVERFLOW_CLEAR (1 << 31)
  621. #define IH_RB_BASE 0x3e04
  622. #define IH_RB_RPTR 0x3e08
  623. #define IH_RB_WPTR 0x3e0c
  624. # define RB_OVERFLOW (1 << 0)
  625. # define WPTR_OFFSET_MASK 0x3fffc
  626. #define IH_RB_WPTR_ADDR_HI 0x3e10
  627. #define IH_RB_WPTR_ADDR_LO 0x3e14
  628. #define IH_CNTL 0x3e18
  629. # define ENABLE_INTR (1 << 0)
  630. # define IH_MC_SWAP(x) ((x) << 1)
  631. # define IH_MC_SWAP_NONE 0
  632. # define IH_MC_SWAP_16BIT 1
  633. # define IH_MC_SWAP_32BIT 2
  634. # define IH_MC_SWAP_64BIT 3
  635. # define RPTR_REARM (1 << 4)
  636. # define MC_WRREQ_CREDIT(x) ((x) << 15)
  637. # define MC_WR_CLEAN_CNT(x) ((x) << 20)
  638. #define RLC_CNTL 0x3f00
  639. # define RLC_ENABLE (1 << 0)
  640. #define RLC_HB_BASE 0x3f10
  641. #define RLC_HB_CNTL 0x3f0c
  642. #define RLC_HB_RPTR 0x3f20
  643. #define RLC_HB_WPTR 0x3f1c
  644. #define RLC_HB_WPTR_LSB_ADDR 0x3f14
  645. #define RLC_HB_WPTR_MSB_ADDR 0x3f18
  646. #define RLC_GPU_CLOCK_COUNT_LSB 0x3f38
  647. #define RLC_GPU_CLOCK_COUNT_MSB 0x3f3c
  648. #define RLC_CAPTURE_GPU_CLOCK_COUNT 0x3f40
  649. #define RLC_MC_CNTL 0x3f44
  650. #define RLC_UCODE_CNTL 0x3f48
  651. #define RLC_UCODE_ADDR 0x3f2c
  652. #define RLC_UCODE_DATA 0x3f30
  653. #define SRBM_SOFT_RESET 0xe60
  654. # define SOFT_RESET_BIF (1 << 1)
  655. # define SOFT_RESET_DMA (1 << 12)
  656. # define SOFT_RESET_RLC (1 << 13)
  657. # define SOFT_RESET_UVD (1 << 18)
  658. # define RV770_SOFT_RESET_DMA (1 << 20)
  659. #define BIF_SCRATCH0 0x5438
  660. #define BUS_CNTL 0x5420
  661. # define BIOS_ROM_DIS (1 << 1)
  662. # define VGA_COHE_SPEC_TIMER_DIS (1 << 9)
  663. #define CP_INT_CNTL 0xc124
  664. # define CNTX_BUSY_INT_ENABLE (1 << 19)
  665. # define CNTX_EMPTY_INT_ENABLE (1 << 20)
  666. # define SCRATCH_INT_ENABLE (1 << 25)
  667. # define TIME_STAMP_INT_ENABLE (1 << 26)
  668. # define IB2_INT_ENABLE (1 << 29)
  669. # define IB1_INT_ENABLE (1 << 30)
  670. # define RB_INT_ENABLE (1 << 31)
  671. #define CP_INT_STATUS 0xc128
  672. # define SCRATCH_INT_STAT (1 << 25)
  673. # define TIME_STAMP_INT_STAT (1 << 26)
  674. # define IB2_INT_STAT (1 << 29)
  675. # define IB1_INT_STAT (1 << 30)
  676. # define RB_INT_STAT (1 << 31)
  677. #define GRBM_INT_CNTL 0x8060
  678. # define RDERR_INT_ENABLE (1 << 0)
  679. # define WAIT_COUNT_TIMEOUT_INT_ENABLE (1 << 1)
  680. # define GUI_IDLE_INT_ENABLE (1 << 19)
  681. #define INTERRUPT_CNTL 0x5468
  682. # define IH_DUMMY_RD_OVERRIDE (1 << 0)
  683. # define IH_DUMMY_RD_EN (1 << 1)
  684. # define IH_REQ_NONSNOOP_EN (1 << 3)
  685. # define GEN_IH_INT_EN (1 << 8)
  686. #define INTERRUPT_CNTL2 0x546c
  687. #define D1MODE_VBLANK_STATUS 0x6534
  688. #define D2MODE_VBLANK_STATUS 0x6d34
  689. # define DxMODE_VBLANK_OCCURRED (1 << 0)
  690. # define DxMODE_VBLANK_ACK (1 << 4)
  691. # define DxMODE_VBLANK_STAT (1 << 12)
  692. # define DxMODE_VBLANK_INTERRUPT (1 << 16)
  693. # define DxMODE_VBLANK_INTERRUPT_TYPE (1 << 17)
  694. #define D1MODE_VLINE_STATUS 0x653c
  695. #define D2MODE_VLINE_STATUS 0x6d3c
  696. # define DxMODE_VLINE_OCCURRED (1 << 0)
  697. # define DxMODE_VLINE_ACK (1 << 4)
  698. # define DxMODE_VLINE_STAT (1 << 12)
  699. # define DxMODE_VLINE_INTERRUPT (1 << 16)
  700. # define DxMODE_VLINE_INTERRUPT_TYPE (1 << 17)
  701. #define DxMODE_INT_MASK 0x6540
  702. # define D1MODE_VBLANK_INT_MASK (1 << 0)
  703. # define D1MODE_VLINE_INT_MASK (1 << 4)
  704. # define D2MODE_VBLANK_INT_MASK (1 << 8)
  705. # define D2MODE_VLINE_INT_MASK (1 << 12)
  706. #define DCE3_DISP_INTERRUPT_STATUS 0x7ddc
  707. # define DC_HPD1_INTERRUPT (1 << 18)
  708. # define DC_HPD2_INTERRUPT (1 << 19)
  709. #define DISP_INTERRUPT_STATUS 0x7edc
  710. # define LB_D1_VLINE_INTERRUPT (1 << 2)
  711. # define LB_D2_VLINE_INTERRUPT (1 << 3)
  712. # define LB_D1_VBLANK_INTERRUPT (1 << 4)
  713. # define LB_D2_VBLANK_INTERRUPT (1 << 5)
  714. # define DACA_AUTODETECT_INTERRUPT (1 << 16)
  715. # define DACB_AUTODETECT_INTERRUPT (1 << 17)
  716. # define DC_HOT_PLUG_DETECT1_INTERRUPT (1 << 18)
  717. # define DC_HOT_PLUG_DETECT2_INTERRUPT (1 << 19)
  718. # define DC_I2C_SW_DONE_INTERRUPT (1 << 20)
  719. # define DC_I2C_HW_DONE_INTERRUPT (1 << 21)
  720. #define DISP_INTERRUPT_STATUS_CONTINUE 0x7ee8
  721. #define DCE3_DISP_INTERRUPT_STATUS_CONTINUE 0x7de8
  722. # define DC_HPD4_INTERRUPT (1 << 14)
  723. # define DC_HPD4_RX_INTERRUPT (1 << 15)
  724. # define DC_HPD3_INTERRUPT (1 << 28)
  725. # define DC_HPD1_RX_INTERRUPT (1 << 29)
  726. # define DC_HPD2_RX_INTERRUPT (1 << 30)
  727. #define DCE3_DISP_INTERRUPT_STATUS_CONTINUE2 0x7dec
  728. # define DC_HPD3_RX_INTERRUPT (1 << 0)
  729. # define DIGA_DP_VID_STREAM_DISABLE_INTERRUPT (1 << 1)
  730. # define DIGA_DP_STEER_FIFO_OVERFLOW_INTERRUPT (1 << 2)
  731. # define DIGB_DP_VID_STREAM_DISABLE_INTERRUPT (1 << 3)
  732. # define DIGB_DP_STEER_FIFO_OVERFLOW_INTERRUPT (1 << 4)
  733. # define AUX1_SW_DONE_INTERRUPT (1 << 5)
  734. # define AUX1_LS_DONE_INTERRUPT (1 << 6)
  735. # define AUX2_SW_DONE_INTERRUPT (1 << 7)
  736. # define AUX2_LS_DONE_INTERRUPT (1 << 8)
  737. # define AUX3_SW_DONE_INTERRUPT (1 << 9)
  738. # define AUX3_LS_DONE_INTERRUPT (1 << 10)
  739. # define AUX4_SW_DONE_INTERRUPT (1 << 11)
  740. # define AUX4_LS_DONE_INTERRUPT (1 << 12)
  741. # define DIGA_DP_FAST_TRAINING_COMPLETE_INTERRUPT (1 << 13)
  742. # define DIGB_DP_FAST_TRAINING_COMPLETE_INTERRUPT (1 << 14)
  743. /* DCE 3.2 */
  744. # define AUX5_SW_DONE_INTERRUPT (1 << 15)
  745. # define AUX5_LS_DONE_INTERRUPT (1 << 16)
  746. # define AUX6_SW_DONE_INTERRUPT (1 << 17)
  747. # define AUX6_LS_DONE_INTERRUPT (1 << 18)
  748. # define DC_HPD5_INTERRUPT (1 << 19)
  749. # define DC_HPD5_RX_INTERRUPT (1 << 20)
  750. # define DC_HPD6_INTERRUPT (1 << 21)
  751. # define DC_HPD6_RX_INTERRUPT (1 << 22)
  752. #define DACA_AUTO_DETECT_CONTROL 0x7828
  753. #define DACB_AUTO_DETECT_CONTROL 0x7a28
  754. #define DCE3_DACA_AUTO_DETECT_CONTROL 0x7028
  755. #define DCE3_DACB_AUTO_DETECT_CONTROL 0x7128
  756. # define DACx_AUTODETECT_MODE(x) ((x) << 0)
  757. # define DACx_AUTODETECT_MODE_NONE 0
  758. # define DACx_AUTODETECT_MODE_CONNECT 1
  759. # define DACx_AUTODETECT_MODE_DISCONNECT 2
  760. # define DACx_AUTODETECT_FRAME_TIME_COUNTER(x) ((x) << 8)
  761. /* bit 18 = R/C, 17 = G/Y, 16 = B/Comp */
  762. # define DACx_AUTODETECT_CHECK_MASK(x) ((x) << 16)
  763. #define DCE3_DACA_AUTODETECT_INT_CONTROL 0x7038
  764. #define DCE3_DACB_AUTODETECT_INT_CONTROL 0x7138
  765. #define DACA_AUTODETECT_INT_CONTROL 0x7838
  766. #define DACB_AUTODETECT_INT_CONTROL 0x7a38
  767. # define DACx_AUTODETECT_ACK (1 << 0)
  768. # define DACx_AUTODETECT_INT_ENABLE (1 << 16)
  769. #define DC_HOT_PLUG_DETECT1_CONTROL 0x7d00
  770. #define DC_HOT_PLUG_DETECT2_CONTROL 0x7d10
  771. #define DC_HOT_PLUG_DETECT3_CONTROL 0x7d24
  772. # define DC_HOT_PLUG_DETECTx_EN (1 << 0)
  773. #define DC_HOT_PLUG_DETECT1_INT_STATUS 0x7d04
  774. #define DC_HOT_PLUG_DETECT2_INT_STATUS 0x7d14
  775. #define DC_HOT_PLUG_DETECT3_INT_STATUS 0x7d28
  776. # define DC_HOT_PLUG_DETECTx_INT_STATUS (1 << 0)
  777. # define DC_HOT_PLUG_DETECTx_SENSE (1 << 1)
  778. /* DCE 3.0 */
  779. #define DC_HPD1_INT_STATUS 0x7d00
  780. #define DC_HPD2_INT_STATUS 0x7d0c
  781. #define DC_HPD3_INT_STATUS 0x7d18
  782. #define DC_HPD4_INT_STATUS 0x7d24
  783. /* DCE 3.2 */
  784. #define DC_HPD5_INT_STATUS 0x7dc0
  785. #define DC_HPD6_INT_STATUS 0x7df4
  786. # define DC_HPDx_INT_STATUS (1 << 0)
  787. # define DC_HPDx_SENSE (1 << 1)
  788. # define DC_HPDx_RX_INT_STATUS (1 << 8)
  789. #define DC_HOT_PLUG_DETECT1_INT_CONTROL 0x7d08
  790. #define DC_HOT_PLUG_DETECT2_INT_CONTROL 0x7d18
  791. #define DC_HOT_PLUG_DETECT3_INT_CONTROL 0x7d2c
  792. # define DC_HOT_PLUG_DETECTx_INT_ACK (1 << 0)
  793. # define DC_HOT_PLUG_DETECTx_INT_POLARITY (1 << 8)
  794. # define DC_HOT_PLUG_DETECTx_INT_EN (1 << 16)
  795. /* DCE 3.0 */
  796. #define DC_HPD1_INT_CONTROL 0x7d04
  797. #define DC_HPD2_INT_CONTROL 0x7d10
  798. #define DC_HPD3_INT_CONTROL 0x7d1c
  799. #define DC_HPD4_INT_CONTROL 0x7d28
  800. /* DCE 3.2 */
  801. #define DC_HPD5_INT_CONTROL 0x7dc4
  802. #define DC_HPD6_INT_CONTROL 0x7df8
  803. # define DC_HPDx_INT_ACK (1 << 0)
  804. # define DC_HPDx_INT_POLARITY (1 << 8)
  805. # define DC_HPDx_INT_EN (1 << 16)
  806. # define DC_HPDx_RX_INT_ACK (1 << 20)
  807. # define DC_HPDx_RX_INT_EN (1 << 24)
  808. /* DCE 3.0 */
  809. #define DC_HPD1_CONTROL 0x7d08
  810. #define DC_HPD2_CONTROL 0x7d14
  811. #define DC_HPD3_CONTROL 0x7d20
  812. #define DC_HPD4_CONTROL 0x7d2c
  813. /* DCE 3.2 */
  814. #define DC_HPD5_CONTROL 0x7dc8
  815. #define DC_HPD6_CONTROL 0x7dfc
  816. # define DC_HPDx_CONNECTION_TIMER(x) ((x) << 0)
  817. # define DC_HPDx_RX_INT_TIMER(x) ((x) << 16)
  818. /* DCE 3.2 */
  819. # define DC_HPDx_EN (1 << 28)
  820. #define D1GRPH_INTERRUPT_STATUS 0x6158
  821. #define D2GRPH_INTERRUPT_STATUS 0x6958
  822. # define DxGRPH_PFLIP_INT_OCCURRED (1 << 0)
  823. # define DxGRPH_PFLIP_INT_CLEAR (1 << 8)
  824. #define D1GRPH_INTERRUPT_CONTROL 0x615c
  825. #define D2GRPH_INTERRUPT_CONTROL 0x695c
  826. # define DxGRPH_PFLIP_INT_MASK (1 << 0)
  827. # define DxGRPH_PFLIP_INT_TYPE (1 << 8)
  828. /* PCIE link stuff */
  829. #define PCIE_LC_TRAINING_CNTL 0xa1 /* PCIE_P */
  830. # define LC_POINT_7_PLUS_EN (1 << 6)
  831. #define PCIE_LC_LINK_WIDTH_CNTL 0xa2 /* PCIE_P */
  832. # define LC_LINK_WIDTH_SHIFT 0
  833. # define LC_LINK_WIDTH_MASK 0x7
  834. # define LC_LINK_WIDTH_X0 0
  835. # define LC_LINK_WIDTH_X1 1
  836. # define LC_LINK_WIDTH_X2 2
  837. # define LC_LINK_WIDTH_X4 3
  838. # define LC_LINK_WIDTH_X8 4
  839. # define LC_LINK_WIDTH_X16 6
  840. # define LC_LINK_WIDTH_RD_SHIFT 4
  841. # define LC_LINK_WIDTH_RD_MASK 0x70
  842. # define LC_RECONFIG_ARC_MISSING_ESCAPE (1 << 7)
  843. # define LC_RECONFIG_NOW (1 << 8)
  844. # define LC_RENEGOTIATION_SUPPORT (1 << 9)
  845. # define LC_RENEGOTIATE_EN (1 << 10)
  846. # define LC_SHORT_RECONFIG_EN (1 << 11)
  847. # define LC_UPCONFIGURE_SUPPORT (1 << 12)
  848. # define LC_UPCONFIGURE_DIS (1 << 13)
  849. #define PCIE_LC_SPEED_CNTL 0xa4 /* PCIE_P */
  850. # define LC_GEN2_EN_STRAP (1 << 0)
  851. # define LC_TARGET_LINK_SPEED_OVERRIDE_EN (1 << 1)
  852. # define LC_FORCE_EN_HW_SPEED_CHANGE (1 << 5)
  853. # define LC_FORCE_DIS_HW_SPEED_CHANGE (1 << 6)
  854. # define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK (0x3 << 8)
  855. # define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT 3
  856. # define LC_CURRENT_DATA_RATE (1 << 11)
  857. # define LC_VOLTAGE_TIMER_SEL_MASK (0xf << 14)
  858. # define LC_CLR_FAILED_SPD_CHANGE_CNT (1 << 21)
  859. # define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 23)
  860. # define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 24)
  861. #define MM_CFGREGS_CNTL 0x544c
  862. # define MM_WR_TO_CFG_EN (1 << 3)
  863. #define LINK_CNTL2 0x88 /* F0 */
  864. # define TARGET_LINK_SPEED_MASK (0xf << 0)
  865. # define SELECTABLE_DEEMPHASIS (1 << 6)
  866. /* Audio */
  867. #define AZ_HOT_PLUG_CONTROL 0x7300
  868. # define AZ_FORCE_CODEC_WAKE (1 << 0)
  869. # define JACK_DETECTION_ENABLE (1 << 4)
  870. # define UNSOLICITED_RESPONSE_ENABLE (1 << 8)
  871. # define CODEC_HOT_PLUG_ENABLE (1 << 12)
  872. # define AUDIO_ENABLED (1 << 31)
  873. /* DCE3 adds */
  874. # define PIN0_JACK_DETECTION_ENABLE (1 << 4)
  875. # define PIN1_JACK_DETECTION_ENABLE (1 << 5)
  876. # define PIN2_JACK_DETECTION_ENABLE (1 << 6)
  877. # define PIN3_JACK_DETECTION_ENABLE (1 << 7)
  878. # define PIN0_AUDIO_ENABLED (1 << 24)
  879. # define PIN1_AUDIO_ENABLED (1 << 25)
  880. # define PIN2_AUDIO_ENABLED (1 << 26)
  881. # define PIN3_AUDIO_ENABLED (1 << 27)
  882. /* Audio clocks DCE 2.0/3.0 */
  883. #define AUDIO_DTO 0x7340
  884. # define AUDIO_DTO_PHASE(x) (((x) & 0xffff) << 0)
  885. # define AUDIO_DTO_MODULE(x) (((x) & 0xffff) << 16)
  886. /* Audio clocks DCE 3.2 */
  887. #define DCCG_AUDIO_DTO0_PHASE 0x0514
  888. #define DCCG_AUDIO_DTO0_MODULE 0x0518
  889. #define DCCG_AUDIO_DTO0_LOAD 0x051c
  890. # define DTO_LOAD (1 << 31)
  891. #define DCCG_AUDIO_DTO0_CNTL 0x0520
  892. # define DCCG_AUDIO_DTO_WALLCLOCK_RATIO(x) (((x) & 7) << 0)
  893. # define DCCG_AUDIO_DTO_WALLCLOCK_RATIO_MASK 7
  894. # define DCCG_AUDIO_DTO_WALLCLOCK_RATIO_SHIFT 0
  895. #define DCCG_AUDIO_DTO1_PHASE 0x0524
  896. #define DCCG_AUDIO_DTO1_MODULE 0x0528
  897. #define DCCG_AUDIO_DTO1_LOAD 0x052c
  898. #define DCCG_AUDIO_DTO1_CNTL 0x0530
  899. #define DCCG_AUDIO_DTO_SELECT 0x0534
  900. /* digital blocks */
  901. #define TMDSA_CNTL 0x7880
  902. # define TMDSA_HDMI_EN (1 << 2)
  903. #define LVTMA_CNTL 0x7a80
  904. # define LVTMA_HDMI_EN (1 << 2)
  905. #define DDIA_CNTL 0x7200
  906. # define DDIA_HDMI_EN (1 << 2)
  907. #define DIG0_CNTL 0x75a0
  908. # define DIG_MODE(x) (((x) & 7) << 8)
  909. # define DIG_MODE_DP 0
  910. # define DIG_MODE_LVDS 1
  911. # define DIG_MODE_TMDS_DVI 2
  912. # define DIG_MODE_TMDS_HDMI 3
  913. # define DIG_MODE_SDVO 4
  914. #define DIG1_CNTL 0x79a0
  915. #define AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER 0x71bc
  916. #define SPEAKER_ALLOCATION(x) (((x) & 0x7f) << 0)
  917. #define SPEAKER_ALLOCATION_MASK (0x7f << 0)
  918. #define SPEAKER_ALLOCATION_SHIFT 0
  919. #define HDMI_CONNECTION (1 << 16)
  920. #define DP_CONNECTION (1 << 17)
  921. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR0 0x71c8 /* LPCM */
  922. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR1 0x71cc /* AC3 */
  923. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR2 0x71d0 /* MPEG1 */
  924. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR3 0x71d4 /* MP3 */
  925. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR4 0x71d8 /* MPEG2 */
  926. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR5 0x71dc /* AAC */
  927. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR6 0x71e0 /* DTS */
  928. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR7 0x71e4 /* ATRAC */
  929. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR8 0x71e8 /* one bit audio - leave at 0 (default) */
  930. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR9 0x71ec /* Dolby Digital */
  931. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR10 0x71f0 /* DTS-HD */
  932. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR11 0x71f4 /* MAT-MLP */
  933. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR12 0x71f8 /* DTS */
  934. #define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR13 0x71fc /* WMA Pro */
  935. # define MAX_CHANNELS(x) (((x) & 0x7) << 0)
  936. /* max channels minus one. 7 = 8 channels */
  937. # define SUPPORTED_FREQUENCIES(x) (((x) & 0xff) << 8)
  938. # define DESCRIPTOR_BYTE_2(x) (((x) & 0xff) << 16)
  939. # define SUPPORTED_FREQUENCIES_STEREO(x) (((x) & 0xff) << 24) /* LPCM only */
  940. /* SUPPORTED_FREQUENCIES, SUPPORTED_FREQUENCIES_STEREO
  941. * bit0 = 32 kHz
  942. * bit1 = 44.1 kHz
  943. * bit2 = 48 kHz
  944. * bit3 = 88.2 kHz
  945. * bit4 = 96 kHz
  946. * bit5 = 176.4 kHz
  947. * bit6 = 192 kHz
  948. */
  949. /* rs6xx/rs740 and r6xx share the same HDMI blocks, however, rs6xx has only one
  950. * instance of the blocks while r6xx has 2. DCE 3.0 cards are slightly
  951. * different due to the new DIG blocks, but also have 2 instances.
  952. * DCE 3.0 HDMI blocks are part of each DIG encoder.
  953. */
  954. /* rs6xx/rs740/r6xx/dce3 */
  955. #define HDMI0_CONTROL 0x7400
  956. /* rs6xx/rs740/r6xx */
  957. # define HDMI0_ENABLE (1 << 0)
  958. # define HDMI0_STREAM(x) (((x) & 3) << 2)
  959. # define HDMI0_STREAM_TMDSA 0
  960. # define HDMI0_STREAM_LVTMA 1
  961. # define HDMI0_STREAM_DVOA 2
  962. # define HDMI0_STREAM_DDIA 3
  963. /* rs6xx/r6xx/dce3 */
  964. # define HDMI0_ERROR_ACK (1 << 8)
  965. # define HDMI0_ERROR_MASK (1 << 9)
  966. #define HDMI0_STATUS 0x7404
  967. # define HDMI0_ACTIVE_AVMUTE (1 << 0)
  968. # define HDMI0_AUDIO_ENABLE (1 << 4)
  969. # define HDMI0_AZ_FORMAT_WTRIG (1 << 28)
  970. # define HDMI0_AZ_FORMAT_WTRIG_INT (1 << 29)
  971. #define HDMI0_AUDIO_PACKET_CONTROL 0x7408
  972. # define HDMI0_AUDIO_SAMPLE_SEND (1 << 0)
  973. # define HDMI0_AUDIO_DELAY_EN(x) (((x) & 3) << 4)
  974. # define HDMI0_AUDIO_DELAY_EN_MASK (3 << 4)
  975. # define HDMI0_AUDIO_SEND_MAX_PACKETS (1 << 8)
  976. # define HDMI0_AUDIO_TEST_EN (1 << 12)
  977. # define HDMI0_AUDIO_PACKETS_PER_LINE(x) (((x) & 0x1f) << 16)
  978. # define HDMI0_AUDIO_PACKETS_PER_LINE_MASK (0x1f << 16)
  979. # define HDMI0_AUDIO_CHANNEL_SWAP (1 << 24)
  980. # define HDMI0_60958_CS_UPDATE (1 << 26)
  981. # define HDMI0_AZ_FORMAT_WTRIG_MASK (1 << 28)
  982. # define HDMI0_AZ_FORMAT_WTRIG_ACK (1 << 29)
  983. #define HDMI0_AUDIO_CRC_CONTROL 0x740c
  984. # define HDMI0_AUDIO_CRC_EN (1 << 0)
  985. #define DCE3_HDMI0_ACR_PACKET_CONTROL 0x740c
  986. #define HDMI0_VBI_PACKET_CONTROL 0x7410
  987. # define HDMI0_NULL_SEND (1 << 0)
  988. # define HDMI0_GC_SEND (1 << 4)
  989. # define HDMI0_GC_CONT (1 << 5) /* 0 - once; 1 - every frame */
  990. #define HDMI0_INFOFRAME_CONTROL0 0x7414
  991. # define HDMI0_AVI_INFO_SEND (1 << 0)
  992. # define HDMI0_AVI_INFO_CONT (1 << 1)
  993. # define HDMI0_AUDIO_INFO_SEND (1 << 4)
  994. # define HDMI0_AUDIO_INFO_CONT (1 << 5)
  995. # define HDMI0_AUDIO_INFO_SOURCE (1 << 6) /* 0 - sound block; 1 - hdmi regs */
  996. # define HDMI0_AUDIO_INFO_UPDATE (1 << 7)
  997. # define HDMI0_MPEG_INFO_SEND (1 << 8)
  998. # define HDMI0_MPEG_INFO_CONT (1 << 9)
  999. # define HDMI0_MPEG_INFO_UPDATE (1 << 10)
  1000. #define HDMI0_INFOFRAME_CONTROL1 0x7418
  1001. # define HDMI0_AVI_INFO_LINE(x) (((x) & 0x3f) << 0)
  1002. # define HDMI0_AVI_INFO_LINE_MASK (0x3f << 0)
  1003. # define HDMI0_AUDIO_INFO_LINE(x) (((x) & 0x3f) << 8)
  1004. # define HDMI0_AUDIO_INFO_LINE_MASK (0x3f << 8)
  1005. # define HDMI0_MPEG_INFO_LINE(x) (((x) & 0x3f) << 16)
  1006. #define HDMI0_GENERIC_PACKET_CONTROL 0x741c
  1007. # define HDMI0_GENERIC0_SEND (1 << 0)
  1008. # define HDMI0_GENERIC0_CONT (1 << 1)
  1009. # define HDMI0_GENERIC0_UPDATE (1 << 2)
  1010. # define HDMI0_GENERIC1_SEND (1 << 4)
  1011. # define HDMI0_GENERIC1_CONT (1 << 5)
  1012. # define HDMI0_GENERIC0_LINE(x) (((x) & 0x3f) << 16)
  1013. # define HDMI0_GENERIC0_LINE_MASK (0x3f << 16)
  1014. # define HDMI0_GENERIC1_LINE(x) (((x) & 0x3f) << 24)
  1015. # define HDMI0_GENERIC1_LINE_MASK (0x3f << 24)
  1016. #define HDMI0_GC 0x7428
  1017. # define HDMI0_GC_AVMUTE (1 << 0)
  1018. #define HDMI0_AVI_INFO0 0x7454
  1019. # define HDMI0_AVI_INFO_CHECKSUM(x) (((x) & 0xff) << 0)
  1020. # define HDMI0_AVI_INFO_S(x) (((x) & 3) << 8)
  1021. # define HDMI0_AVI_INFO_B(x) (((x) & 3) << 10)
  1022. # define HDMI0_AVI_INFO_A(x) (((x) & 1) << 12)
  1023. # define HDMI0_AVI_INFO_Y(x) (((x) & 3) << 13)
  1024. # define HDMI0_AVI_INFO_Y_RGB 0
  1025. # define HDMI0_AVI_INFO_Y_YCBCR422 1
  1026. # define HDMI0_AVI_INFO_Y_YCBCR444 2
  1027. # define HDMI0_AVI_INFO_Y_A_B_S(x) (((x) & 0xff) << 8)
  1028. # define HDMI0_AVI_INFO_R(x) (((x) & 0xf) << 16)
  1029. # define HDMI0_AVI_INFO_M(x) (((x) & 0x3) << 20)
  1030. # define HDMI0_AVI_INFO_C(x) (((x) & 0x3) << 22)
  1031. # define HDMI0_AVI_INFO_C_M_R(x) (((x) & 0xff) << 16)
  1032. # define HDMI0_AVI_INFO_SC(x) (((x) & 0x3) << 24)
  1033. # define HDMI0_AVI_INFO_ITC_EC_Q_SC(x) (((x) & 0xff) << 24)
  1034. #define HDMI0_AVI_INFO1 0x7458
  1035. # define HDMI0_AVI_INFO_VIC(x) (((x) & 0x7f) << 0) /* don't use avi infoframe v1 */
  1036. # define HDMI0_AVI_INFO_PR(x) (((x) & 0xf) << 8) /* don't use avi infoframe v1 */
  1037. # define HDMI0_AVI_INFO_TOP(x) (((x) & 0xffff) << 16)
  1038. #define HDMI0_AVI_INFO2 0x745c
  1039. # define HDMI0_AVI_INFO_BOTTOM(x) (((x) & 0xffff) << 0)
  1040. # define HDMI0_AVI_INFO_LEFT(x) (((x) & 0xffff) << 16)
  1041. #define HDMI0_AVI_INFO3 0x7460
  1042. # define HDMI0_AVI_INFO_RIGHT(x) (((x) & 0xffff) << 0)
  1043. # define HDMI0_AVI_INFO_VERSION(x) (((x) & 3) << 24)
  1044. #define HDMI0_MPEG_INFO0 0x7464
  1045. # define HDMI0_MPEG_INFO_CHECKSUM(x) (((x) & 0xff) << 0)
  1046. # define HDMI0_MPEG_INFO_MB0(x) (((x) & 0xff) << 8)
  1047. # define HDMI0_MPEG_INFO_MB1(x) (((x) & 0xff) << 16)
  1048. # define HDMI0_MPEG_INFO_MB2(x) (((x) & 0xff) << 24)
  1049. #define HDMI0_MPEG_INFO1 0x7468
  1050. # define HDMI0_MPEG_INFO_MB3(x) (((x) & 0xff) << 0)
  1051. # define HDMI0_MPEG_INFO_MF(x) (((x) & 3) << 8)
  1052. # define HDMI0_MPEG_INFO_FR(x) (((x) & 1) << 12)
  1053. #define HDMI0_GENERIC0_HDR 0x746c
  1054. #define HDMI0_GENERIC0_0 0x7470
  1055. #define HDMI0_GENERIC0_1 0x7474
  1056. #define HDMI0_GENERIC0_2 0x7478
  1057. #define HDMI0_GENERIC0_3 0x747c
  1058. #define HDMI0_GENERIC0_4 0x7480
  1059. #define HDMI0_GENERIC0_5 0x7484
  1060. #define HDMI0_GENERIC0_6 0x7488
  1061. #define HDMI0_GENERIC1_HDR 0x748c
  1062. #define HDMI0_GENERIC1_0 0x7490
  1063. #define HDMI0_GENERIC1_1 0x7494
  1064. #define HDMI0_GENERIC1_2 0x7498
  1065. #define HDMI0_GENERIC1_3 0x749c
  1066. #define HDMI0_GENERIC1_4 0x74a0
  1067. #define HDMI0_GENERIC1_5 0x74a4
  1068. #define HDMI0_GENERIC1_6 0x74a8
  1069. #define HDMI0_ACR_32_0 0x74ac
  1070. # define HDMI0_ACR_CTS_32(x) (((x) & 0xfffff) << 12)
  1071. # define HDMI0_ACR_CTS_32_MASK (0xfffff << 12)
  1072. #define HDMI0_ACR_32_1 0x74b0
  1073. # define HDMI0_ACR_N_32(x) (((x) & 0xfffff) << 0)
  1074. # define HDMI0_ACR_N_32_MASK (0xfffff << 0)
  1075. #define HDMI0_ACR_44_0 0x74b4
  1076. # define HDMI0_ACR_CTS_44(x) (((x) & 0xfffff) << 12)
  1077. # define HDMI0_ACR_CTS_44_MASK (0xfffff << 12)
  1078. #define HDMI0_ACR_44_1 0x74b8
  1079. # define HDMI0_ACR_N_44(x) (((x) & 0xfffff) << 0)
  1080. # define HDMI0_ACR_N_44_MASK (0xfffff << 0)
  1081. #define HDMI0_ACR_48_0 0x74bc
  1082. # define HDMI0_ACR_CTS_48(x) (((x) & 0xfffff) << 12)
  1083. # define HDMI0_ACR_CTS_48_MASK (0xfffff << 12)
  1084. #define HDMI0_ACR_48_1 0x74c0
  1085. # define HDMI0_ACR_N_48(x) (((x) & 0xfffff) << 0)
  1086. # define HDMI0_ACR_N_48_MASK (0xfffff << 0)
  1087. #define HDMI0_ACR_STATUS_0 0x74c4
  1088. #define HDMI0_ACR_STATUS_1 0x74c8
  1089. #define HDMI0_AUDIO_INFO0 0x74cc
  1090. # define HDMI0_AUDIO_INFO_CHECKSUM(x) (((x) & 0xff) << 0)
  1091. # define HDMI0_AUDIO_INFO_CC(x) (((x) & 7) << 8)
  1092. #define HDMI0_AUDIO_INFO1 0x74d0
  1093. # define HDMI0_AUDIO_INFO_CA(x) (((x) & 0xff) << 0)
  1094. # define HDMI0_AUDIO_INFO_LSV(x) (((x) & 0xf) << 11)
  1095. # define HDMI0_AUDIO_INFO_DM_INH(x) (((x) & 1) << 15)
  1096. # define HDMI0_AUDIO_INFO_DM_INH_LSV(x) (((x) & 0xff) << 8)
  1097. #define HDMI0_60958_0 0x74d4
  1098. # define HDMI0_60958_CS_A(x) (((x) & 1) << 0)
  1099. # define HDMI0_60958_CS_B(x) (((x) & 1) << 1)
  1100. # define HDMI0_60958_CS_C(x) (((x) & 1) << 2)
  1101. # define HDMI0_60958_CS_D(x) (((x) & 3) << 3)
  1102. # define HDMI0_60958_CS_MODE(x) (((x) & 3) << 6)
  1103. # define HDMI0_60958_CS_CATEGORY_CODE(x) (((x) & 0xff) << 8)
  1104. # define HDMI0_60958_CS_SOURCE_NUMBER(x) (((x) & 0xf) << 16)
  1105. # define HDMI0_60958_CS_CHANNEL_NUMBER_L(x) (((x) & 0xf) << 20)
  1106. # define HDMI0_60958_CS_CHANNEL_NUMBER_L_MASK (0xf << 20)
  1107. # define HDMI0_60958_CS_SAMPLING_FREQUENCY(x) (((x) & 0xf) << 24)
  1108. # define HDMI0_60958_CS_CLOCK_ACCURACY(x) (((x) & 3) << 28)
  1109. # define HDMI0_60958_CS_CLOCK_ACCURACY_MASK (3 << 28)
  1110. #define HDMI0_60958_1 0x74d8
  1111. # define HDMI0_60958_CS_WORD_LENGTH(x) (((x) & 0xf) << 0)
  1112. # define HDMI0_60958_CS_ORIGINAL_SAMPLING_FREQUENCY(x) (((x) & 0xf) << 4)
  1113. # define HDMI0_60958_CS_VALID_L(x) (((x) & 1) << 16)
  1114. # define HDMI0_60958_CS_VALID_R(x) (((x) & 1) << 18)
  1115. # define HDMI0_60958_CS_CHANNEL_NUMBER_R(x) (((x) & 0xf) << 20)
  1116. # define HDMI0_60958_CS_CHANNEL_NUMBER_R_MASK (0xf << 20)
  1117. #define HDMI0_ACR_PACKET_CONTROL 0x74dc
  1118. # define HDMI0_ACR_SEND (1 << 0)
  1119. # define HDMI0_ACR_CONT (1 << 1)
  1120. # define HDMI0_ACR_SELECT(x) (((x) & 3) << 4)
  1121. # define HDMI0_ACR_HW 0
  1122. # define HDMI0_ACR_32 1
  1123. # define HDMI0_ACR_44 2
  1124. # define HDMI0_ACR_48 3
  1125. # define HDMI0_ACR_SOURCE (1 << 8) /* 0 - hw; 1 - cts value */
  1126. # define HDMI0_ACR_AUTO_SEND (1 << 12)
  1127. #define DCE3_HDMI0_AUDIO_CRC_CONTROL 0x74dc
  1128. #define HDMI0_RAMP_CONTROL0 0x74e0
  1129. # define HDMI0_RAMP_MAX_COUNT(x) (((x) & 0xffffff) << 0)
  1130. #define HDMI0_RAMP_CONTROL1 0x74e4
  1131. # define HDMI0_RAMP_MIN_COUNT(x) (((x) & 0xffffff) << 0)
  1132. #define HDMI0_RAMP_CONTROL2 0x74e8
  1133. # define HDMI0_RAMP_INC_COUNT(x) (((x) & 0xffffff) << 0)
  1134. #define HDMI0_RAMP_CONTROL3 0x74ec
  1135. # define HDMI0_RAMP_DEC_COUNT(x) (((x) & 0xffffff) << 0)
  1136. /* HDMI0_60958_2 is r7xx only */
  1137. #define HDMI0_60958_2 0x74f0
  1138. # define HDMI0_60958_CS_CHANNEL_NUMBER_2(x) (((x) & 0xf) << 0)
  1139. # define HDMI0_60958_CS_CHANNEL_NUMBER_3(x) (((x) & 0xf) << 4)
  1140. # define HDMI0_60958_CS_CHANNEL_NUMBER_4(x) (((x) & 0xf) << 8)
  1141. # define HDMI0_60958_CS_CHANNEL_NUMBER_5(x) (((x) & 0xf) << 12)
  1142. # define HDMI0_60958_CS_CHANNEL_NUMBER_6(x) (((x) & 0xf) << 16)
  1143. # define HDMI0_60958_CS_CHANNEL_NUMBER_7(x) (((x) & 0xf) << 20)
  1144. /* r6xx only; second instance starts at 0x7700 */
  1145. #define HDMI1_CONTROL 0x7700
  1146. #define HDMI1_STATUS 0x7704
  1147. #define HDMI1_AUDIO_PACKET_CONTROL 0x7708
  1148. /* DCE3; second instance starts at 0x7800 NOT 0x7700 */
  1149. #define DCE3_HDMI1_CONTROL 0x7800
  1150. #define DCE3_HDMI1_STATUS 0x7804
  1151. #define DCE3_HDMI1_AUDIO_PACKET_CONTROL 0x7808
  1152. /* DCE3.2 (for interrupts) */
  1153. #define AFMT_STATUS 0x7600
  1154. # define AFMT_AUDIO_ENABLE (1 << 4)
  1155. # define AFMT_AZ_FORMAT_WTRIG (1 << 28)
  1156. # define AFMT_AZ_FORMAT_WTRIG_INT (1 << 29)
  1157. # define AFMT_AZ_AUDIO_ENABLE_CHG (1 << 30)
  1158. #define AFMT_AUDIO_PACKET_CONTROL 0x7604
  1159. # define AFMT_AUDIO_SAMPLE_SEND (1 << 0)
  1160. # define AFMT_AUDIO_TEST_EN (1 << 12)
  1161. # define AFMT_AUDIO_CHANNEL_SWAP (1 << 24)
  1162. # define AFMT_60958_CS_UPDATE (1 << 26)
  1163. # define AFMT_AZ_AUDIO_ENABLE_CHG_MASK (1 << 27)
  1164. # define AFMT_AZ_FORMAT_WTRIG_MASK (1 << 28)
  1165. # define AFMT_AZ_FORMAT_WTRIG_ACK (1 << 29)
  1166. # define AFMT_AZ_AUDIO_ENABLE_CHG_ACK (1 << 30)
  1167. /* DCE3 FMT blocks */
  1168. #define FMT_CONTROL 0x6700
  1169. # define FMT_PIXEL_ENCODING (1 << 16)
  1170. /* 0 = RGB 4:4:4 or YCbCr 4:4:4, 1 = YCbCr 4:2:2 */
  1171. #define FMT_BIT_DEPTH_CONTROL 0x6710
  1172. # define FMT_TRUNCATE_EN (1 << 0)
  1173. # define FMT_TRUNCATE_DEPTH (1 << 4)
  1174. # define FMT_SPATIAL_DITHER_EN (1 << 8)
  1175. # define FMT_SPATIAL_DITHER_MODE(x) ((x) << 9)
  1176. # define FMT_SPATIAL_DITHER_DEPTH (1 << 12)
  1177. # define FMT_FRAME_RANDOM_ENABLE (1 << 13)
  1178. # define FMT_RGB_RANDOM_ENABLE (1 << 14)
  1179. # define FMT_HIGHPASS_RANDOM_ENABLE (1 << 15)
  1180. # define FMT_TEMPORAL_DITHER_EN (1 << 16)
  1181. # define FMT_TEMPORAL_DITHER_DEPTH (1 << 20)
  1182. # define FMT_TEMPORAL_DITHER_OFFSET(x) ((x) << 21)
  1183. # define FMT_TEMPORAL_LEVEL (1 << 24)
  1184. # define FMT_TEMPORAL_DITHER_RESET (1 << 25)
  1185. # define FMT_25FRC_SEL(x) ((x) << 26)
  1186. # define FMT_50FRC_SEL(x) ((x) << 28)
  1187. # define FMT_75FRC_SEL(x) ((x) << 30)
  1188. #define FMT_CLAMP_CONTROL 0x672c
  1189. # define FMT_CLAMP_DATA_EN (1 << 0)
  1190. # define FMT_CLAMP_COLOR_FORMAT(x) ((x) << 16)
  1191. # define FMT_CLAMP_6BPC 0
  1192. # define FMT_CLAMP_8BPC 1
  1193. # define FMT_CLAMP_10BPC 2
  1194. /* Power management */
  1195. #define CG_SPLL_FUNC_CNTL 0x600
  1196. # define SPLL_RESET (1 << 0)
  1197. # define SPLL_SLEEP (1 << 1)
  1198. # define SPLL_REF_DIV(x) ((x) << 2)
  1199. # define SPLL_REF_DIV_MASK (7 << 2)
  1200. # define SPLL_FB_DIV(x) ((x) << 5)
  1201. # define SPLL_FB_DIV_MASK (0xff << 5)
  1202. # define SPLL_PULSEEN (1 << 13)
  1203. # define SPLL_PULSENUM(x) ((x) << 14)
  1204. # define SPLL_PULSENUM_MASK (3 << 14)
  1205. # define SPLL_SW_HILEN(x) ((x) << 16)
  1206. # define SPLL_SW_HILEN_MASK (0xf << 16)
  1207. # define SPLL_SW_LOLEN(x) ((x) << 20)
  1208. # define SPLL_SW_LOLEN_MASK (0xf << 20)
  1209. # define SPLL_DIVEN (1 << 24)
  1210. # define SPLL_BYPASS_EN (1 << 25)
  1211. # define SPLL_CHG_STATUS (1 << 29)
  1212. # define SPLL_CTLREQ (1 << 30)
  1213. # define SPLL_CTLACK (1 << 31)
  1214. #define GENERAL_PWRMGT 0x618
  1215. # define GLOBAL_PWRMGT_EN (1 << 0)
  1216. # define STATIC_PM_EN (1 << 1)
  1217. # define MOBILE_SU (1 << 2)
  1218. # define THERMAL_PROTECTION_DIS (1 << 3)
  1219. # define THERMAL_PROTECTION_TYPE (1 << 4)
  1220. # define ENABLE_GEN2PCIE (1 << 5)
  1221. # define SW_GPIO_INDEX(x) ((x) << 6)
  1222. # define SW_GPIO_INDEX_MASK (3 << 6)
  1223. # define LOW_VOLT_D2_ACPI (1 << 8)
  1224. # define LOW_VOLT_D3_ACPI (1 << 9)
  1225. # define VOLT_PWRMGT_EN (1 << 10)
  1226. #define CG_TPC 0x61c
  1227. # define TPCC(x) ((x) << 0)
  1228. # define TPCC_MASK (0x7fffff << 0)
  1229. # define TPU(x) ((x) << 23)
  1230. # define TPU_MASK (0x1f << 23)
  1231. #define SCLK_PWRMGT_CNTL 0x620
  1232. # define SCLK_PWRMGT_OFF (1 << 0)
  1233. # define SCLK_TURNOFF (1 << 1)
  1234. # define SPLL_TURNOFF (1 << 2)
  1235. # define SU_SCLK_USE_BCLK (1 << 3)
  1236. # define DYNAMIC_GFX_ISLAND_PWR_DOWN (1 << 4)
  1237. # define DYNAMIC_GFX_ISLAND_PWR_LP (1 << 5)
  1238. # define CLK_TURN_ON_STAGGER (1 << 6)
  1239. # define CLK_TURN_OFF_STAGGER (1 << 7)
  1240. # define FIR_FORCE_TREND_SEL (1 << 8)
  1241. # define FIR_TREND_MODE (1 << 9)
  1242. # define DYN_GFX_CLK_OFF_EN (1 << 10)
  1243. # define VDDC3D_TURNOFF_D1 (1 << 11)
  1244. # define VDDC3D_TURNOFF_D2 (1 << 12)
  1245. # define VDDC3D_TURNOFF_D3 (1 << 13)
  1246. # define SPLL_TURNOFF_D2 (1 << 14)
  1247. # define SCLK_LOW_D1 (1 << 15)
  1248. # define DYN_GFX_CLK_OFF_MC_EN (1 << 16)
  1249. #define MCLK_PWRMGT_CNTL 0x624
  1250. # define MPLL_PWRMGT_OFF (1 << 0)
  1251. # define YCLK_TURNOFF (1 << 1)
  1252. # define MPLL_TURNOFF (1 << 2)
  1253. # define SU_MCLK_USE_BCLK (1 << 3)
  1254. # define DLL_READY (1 << 4)
  1255. # define MC_BUSY (1 << 5)
  1256. # define MC_INT_CNTL (1 << 7)
  1257. # define MRDCKA_SLEEP (1 << 8)
  1258. # define MRDCKB_SLEEP (1 << 9)
  1259. # define MRDCKC_SLEEP (1 << 10)
  1260. # define MRDCKD_SLEEP (1 << 11)
  1261. # define MRDCKE_SLEEP (1 << 12)
  1262. # define MRDCKF_SLEEP (1 << 13)
  1263. # define MRDCKG_SLEEP (1 << 14)
  1264. # define MRDCKH_SLEEP (1 << 15)
  1265. # define MRDCKA_RESET (1 << 16)
  1266. # define MRDCKB_RESET (1 << 17)
  1267. # define MRDCKC_RESET (1 << 18)
  1268. # define MRDCKD_RESET (1 << 19)
  1269. # define MRDCKE_RESET (1 << 20)
  1270. # define MRDCKF_RESET (1 << 21)
  1271. # define MRDCKG_RESET (1 << 22)
  1272. # define MRDCKH_RESET (1 << 23)
  1273. # define DLL_READY_READ (1 << 24)
  1274. # define USE_DISPLAY_GAP (1 << 25)
  1275. # define USE_DISPLAY_URGENT_NORMAL (1 << 26)
  1276. # define USE_DISPLAY_GAP_CTXSW (1 << 27)
  1277. # define MPLL_TURNOFF_D2 (1 << 28)
  1278. # define USE_DISPLAY_URGENT_CTXSW (1 << 29)
  1279. #define MPLL_TIME 0x634
  1280. # define MPLL_LOCK_TIME(x) ((x) << 0)
  1281. # define MPLL_LOCK_TIME_MASK (0xffff << 0)
  1282. # define MPLL_RESET_TIME(x) ((x) << 16)
  1283. # define MPLL_RESET_TIME_MASK (0xffff << 16)
  1284. #define SCLK_FREQ_SETTING_STEP_0_PART1 0x648
  1285. # define STEP_0_SPLL_POST_DIV(x) ((x) << 0)
  1286. # define STEP_0_SPLL_POST_DIV_MASK (0xff << 0)
  1287. # define STEP_0_SPLL_FB_DIV(x) ((x) << 8)
  1288. # define STEP_0_SPLL_FB_DIV_MASK (0xff << 8)
  1289. # define STEP_0_SPLL_REF_DIV(x) ((x) << 16)
  1290. # define STEP_0_SPLL_REF_DIV_MASK (7 << 16)
  1291. # define STEP_0_SPLL_STEP_TIME(x) ((x) << 19)
  1292. # define STEP_0_SPLL_STEP_TIME_MASK (0x1fff << 19)
  1293. #define SCLK_FREQ_SETTING_STEP_0_PART2 0x64c
  1294. # define STEP_0_PULSE_HIGH_CNT(x) ((x) << 0)
  1295. # define STEP_0_PULSE_HIGH_CNT_MASK (0x1ff << 0)
  1296. # define STEP_0_POST_DIV_EN (1 << 9)
  1297. # define STEP_0_SPLL_STEP_ENABLE (1 << 30)
  1298. # define STEP_0_SPLL_ENTRY_VALID (1 << 31)
  1299. #define VID_RT 0x6f8
  1300. # define VID_CRT(x) ((x) << 0)
  1301. # define VID_CRT_MASK (0x1fff << 0)
  1302. # define VID_CRTU(x) ((x) << 13)
  1303. # define VID_CRTU_MASK (7 << 13)
  1304. # define SSTU(x) ((x) << 16)
  1305. # define SSTU_MASK (7 << 16)
  1306. #define CTXSW_PROFILE_INDEX 0x6fc
  1307. # define CTXSW_FREQ_VIDS_CFG_INDEX(x) ((x) << 0)
  1308. # define CTXSW_FREQ_VIDS_CFG_INDEX_MASK (3 << 0)
  1309. # define CTXSW_FREQ_VIDS_CFG_INDEX_SHIFT 0
  1310. # define CTXSW_FREQ_MCLK_CFG_INDEX(x) ((x) << 2)
  1311. # define CTXSW_FREQ_MCLK_CFG_INDEX_MASK (3 << 2)
  1312. # define CTXSW_FREQ_MCLK_CFG_INDEX_SHIFT 2
  1313. # define CTXSW_FREQ_SCLK_CFG_INDEX(x) ((x) << 4)
  1314. # define CTXSW_FREQ_SCLK_CFG_INDEX_MASK (0x1f << 4)
  1315. # define CTXSW_FREQ_SCLK_CFG_INDEX_SHIFT 4
  1316. # define CTXSW_FREQ_STATE_SPLL_RESET_EN (1 << 9)
  1317. # define CTXSW_FREQ_STATE_ENABLE (1 << 10)
  1318. # define CTXSW_FREQ_DISPLAY_WATERMARK (1 << 11)
  1319. # define CTXSW_FREQ_GEN2PCIE_VOLT (1 << 12)
  1320. #define TARGET_AND_CURRENT_PROFILE_INDEX 0x70c
  1321. # define TARGET_PROFILE_INDEX_MASK (3 << 0)
  1322. # define TARGET_PROFILE_INDEX_SHIFT 0
  1323. # define CURRENT_PROFILE_INDEX_MASK (3 << 2)
  1324. # define CURRENT_PROFILE_INDEX_SHIFT 2
  1325. # define DYN_PWR_ENTER_INDEX(x) ((x) << 4)
  1326. # define DYN_PWR_ENTER_INDEX_MASK (3 << 4)
  1327. # define DYN_PWR_ENTER_INDEX_SHIFT 4
  1328. # define CURR_MCLK_INDEX_MASK (3 << 6)
  1329. # define CURR_MCLK_INDEX_SHIFT 6
  1330. # define CURR_SCLK_INDEX_MASK (0x1f << 8)
  1331. # define CURR_SCLK_INDEX_SHIFT 8
  1332. # define CURR_VID_INDEX_MASK (3 << 13)
  1333. # define CURR_VID_INDEX_SHIFT 13
  1334. #define LOWER_GPIO_ENABLE 0x710
  1335. #define UPPER_GPIO_ENABLE 0x714
  1336. #define CTXSW_VID_LOWER_GPIO_CNTL 0x718
  1337. #define VID_UPPER_GPIO_CNTL 0x740
  1338. #define CG_CTX_CGTT3D_R 0x744
  1339. # define PHC(x) ((x) << 0)
  1340. # define PHC_MASK (0x1ff << 0)
  1341. # define SDC(x) ((x) << 9)
  1342. # define SDC_MASK (0x3fff << 9)
  1343. #define CG_VDDC3D_OOR 0x748
  1344. # define SU(x) ((x) << 23)
  1345. # define SU_MASK (0xf << 23)
  1346. #define CG_FTV 0x74c
  1347. #define CG_FFCT_0 0x750
  1348. # define UTC_0(x) ((x) << 0)
  1349. # define UTC_0_MASK (0x3ff << 0)
  1350. # define DTC_0(x) ((x) << 10)
  1351. # define DTC_0_MASK (0x3ff << 10)
  1352. #define CG_BSP 0x78c
  1353. # define BSP(x) ((x) << 0)
  1354. # define BSP_MASK (0xffff << 0)
  1355. # define BSU(x) ((x) << 16)
  1356. # define BSU_MASK (0xf << 16)
  1357. #define CG_RT 0x790
  1358. # define FLS(x) ((x) << 0)
  1359. # define FLS_MASK (0xffff << 0)
  1360. # define FMS(x) ((x) << 16)
  1361. # define FMS_MASK (0xffff << 16)
  1362. #define CG_LT 0x794
  1363. # define FHS(x) ((x) << 0)
  1364. # define FHS_MASK (0xffff << 0)
  1365. #define CG_GIT 0x798
  1366. # define CG_GICST(x) ((x) << 0)
  1367. # define CG_GICST_MASK (0xffff << 0)
  1368. # define CG_GIPOT(x) ((x) << 16)
  1369. # define CG_GIPOT_MASK (0xffff << 16)
  1370. #define CG_SSP 0x7a8
  1371. # define CG_SST(x) ((x) << 0)
  1372. # define CG_SST_MASK (0xffff << 0)
  1373. # define CG_SSTU(x) ((x) << 16)
  1374. # define CG_SSTU_MASK (0xf << 16)
  1375. #define CG_RLC_REQ_AND_RSP 0x7c4
  1376. # define RLC_CG_REQ_TYPE_MASK 0xf
  1377. # define RLC_CG_REQ_TYPE_SHIFT 0
  1378. # define CG_RLC_RSP_TYPE_MASK 0xf0
  1379. # define CG_RLC_RSP_TYPE_SHIFT 4
  1380. #define CG_FC_T 0x7cc
  1381. # define FC_T(x) ((x) << 0)
  1382. # define FC_T_MASK (0xffff << 0)
  1383. # define FC_TU(x) ((x) << 16)
  1384. # define FC_TU_MASK (0x1f << 16)
  1385. #define GPIOPAD_MASK 0x1798
  1386. #define GPIOPAD_A 0x179c
  1387. #define GPIOPAD_EN 0x17a0
  1388. #define GRBM_PWR_CNTL 0x800c
  1389. # define REQ_TYPE_MASK 0xf
  1390. # define REQ_TYPE_SHIFT 0
  1391. # define RSP_TYPE_MASK 0xf0
  1392. # define RSP_TYPE_SHIFT 4
  1393. /*
  1394. * UVD
  1395. */
  1396. #define UVD_SEMA_ADDR_LOW 0xef00
  1397. #define UVD_SEMA_ADDR_HIGH 0xef04
  1398. #define UVD_SEMA_CMD 0xef08
  1399. #define UVD_GPCOM_VCPU_CMD 0xef0c
  1400. #define UVD_GPCOM_VCPU_DATA0 0xef10
  1401. #define UVD_GPCOM_VCPU_DATA1 0xef14
  1402. #define UVD_ENGINE_CNTL 0xef18
  1403. #define UVD_SEMA_CNTL 0xf400
  1404. #define UVD_RB_ARB_CTRL 0xf480
  1405. #define UVD_LMI_EXT40_ADDR 0xf498
  1406. #define UVD_CGC_GATE 0xf4a8
  1407. #define UVD_LMI_CTRL2 0xf4f4
  1408. #define UVD_MASTINT_EN 0xf500
  1409. #define UVD_FW_START 0xf51C
  1410. #define UVD_LMI_ADDR_EXT 0xf594
  1411. #define UVD_LMI_CTRL 0xf598
  1412. #define UVD_LMI_SWAP_CNTL 0xf5b4
  1413. #define UVD_MP_SWAP_CNTL 0xf5bC
  1414. #define UVD_MPC_CNTL 0xf5dC
  1415. #define UVD_MPC_SET_MUXA0 0xf5e4
  1416. #define UVD_MPC_SET_MUXA1 0xf5e8
  1417. #define UVD_MPC_SET_MUXB0 0xf5eC
  1418. #define UVD_MPC_SET_MUXB1 0xf5f0
  1419. #define UVD_MPC_SET_MUX 0xf5f4
  1420. #define UVD_MPC_SET_ALU 0xf5f8
  1421. #define UVD_VCPU_CACHE_OFFSET0 0xf608
  1422. #define UVD_VCPU_CACHE_SIZE0 0xf60c
  1423. #define UVD_VCPU_CACHE_OFFSET1 0xf610
  1424. #define UVD_VCPU_CACHE_SIZE1 0xf614
  1425. #define UVD_VCPU_CACHE_OFFSET2 0xf618
  1426. #define UVD_VCPU_CACHE_SIZE2 0xf61c
  1427. #define UVD_VCPU_CNTL 0xf660
  1428. #define UVD_SOFT_RESET 0xf680
  1429. #define RBC_SOFT_RESET (1<<0)
  1430. #define LBSI_SOFT_RESET (1<<1)
  1431. #define LMI_SOFT_RESET (1<<2)
  1432. #define VCPU_SOFT_RESET (1<<3)
  1433. #define CSM_SOFT_RESET (1<<5)
  1434. #define CXW_SOFT_RESET (1<<6)
  1435. #define TAP_SOFT_RESET (1<<7)
  1436. #define LMI_UMC_SOFT_RESET (1<<13)
  1437. #define UVD_RBC_IB_BASE 0xf684
  1438. #define UVD_RBC_IB_SIZE 0xf688
  1439. #define UVD_RBC_RB_BASE 0xf68c
  1440. #define UVD_RBC_RB_RPTR 0xf690
  1441. #define UVD_RBC_RB_WPTR 0xf694
  1442. #define UVD_RBC_RB_WPTR_CNTL 0xf698
  1443. #define UVD_STATUS 0xf6bc
  1444. #define UVD_SEMA_TIMEOUT_STATUS 0xf6c0
  1445. #define UVD_SEMA_WAIT_INCOMPLETE_TIMEOUT_CNTL 0xf6c4
  1446. #define UVD_SEMA_WAIT_FAULT_TIMEOUT_CNTL 0xf6c8
  1447. #define UVD_SEMA_SIGNAL_INCOMPLETE_TIMEOUT_CNTL 0xf6cc
  1448. #define UVD_RBC_RB_CNTL 0xf6a4
  1449. #define UVD_RBC_RB_RPTR_ADDR 0xf6a8
  1450. #define UVD_CONTEXT_ID 0xf6f4
  1451. /* rs780 only */
  1452. #define GFX_MACRO_BYPASS_CNTL 0x30c0
  1453. #define SPLL_BYPASS_CNTL (1 << 0)
  1454. #define UPLL_BYPASS_CNTL (1 << 1)
  1455. #define CG_UPLL_FUNC_CNTL 0x7e0
  1456. # define UPLL_RESET_MASK 0x00000001
  1457. # define UPLL_SLEEP_MASK 0x00000002
  1458. # define UPLL_BYPASS_EN_MASK 0x00000004
  1459. # define UPLL_CTLREQ_MASK 0x00000008
  1460. # define UPLL_FB_DIV(x) ((x) << 4)
  1461. # define UPLL_FB_DIV_MASK 0x0000FFF0
  1462. # define UPLL_REF_DIV(x) ((x) << 16)
  1463. # define UPLL_REF_DIV_MASK 0x003F0000
  1464. # define UPLL_REFCLK_SRC_SEL_MASK 0x20000000
  1465. # define UPLL_CTLACK_MASK 0x40000000
  1466. # define UPLL_CTLACK2_MASK 0x80000000
  1467. #define CG_UPLL_FUNC_CNTL_2 0x7e4
  1468. # define UPLL_SW_HILEN(x) ((x) << 0)
  1469. # define UPLL_SW_LOLEN(x) ((x) << 4)
  1470. # define UPLL_SW_HILEN2(x) ((x) << 8)
  1471. # define UPLL_SW_LOLEN2(x) ((x) << 12)
  1472. # define UPLL_DIVEN_MASK 0x00010000
  1473. # define UPLL_DIVEN2_MASK 0x00020000
  1474. # define UPLL_SW_MASK 0x0003FFFF
  1475. # define VCLK_SRC_SEL(x) ((x) << 20)
  1476. # define VCLK_SRC_SEL_MASK 0x01F00000
  1477. # define DCLK_SRC_SEL(x) ((x) << 25)
  1478. # define DCLK_SRC_SEL_MASK 0x3E000000
  1479. /*
  1480. * PM4
  1481. */
  1482. #define PACKET0(reg, n) ((RADEON_PACKET_TYPE0 << 30) | \
  1483. (((reg) >> 2) & 0xFFFF) | \
  1484. ((n) & 0x3FFF) << 16)
  1485. #define PACKET3(op, n) ((RADEON_PACKET_TYPE3 << 30) | \
  1486. (((op) & 0xFF) << 8) | \
  1487. ((n) & 0x3FFF) << 16)
  1488. /* Packet 3 types */
  1489. #define PACKET3_NOP 0x10
  1490. #define PACKET3_INDIRECT_BUFFER_END 0x17
  1491. #define PACKET3_SET_PREDICATION 0x20
  1492. #define PACKET3_REG_RMW 0x21
  1493. #define PACKET3_COND_EXEC 0x22
  1494. #define PACKET3_PRED_EXEC 0x23
  1495. #define PACKET3_START_3D_CMDBUF 0x24
  1496. #define PACKET3_DRAW_INDEX_2 0x27
  1497. #define PACKET3_CONTEXT_CONTROL 0x28
  1498. #define PACKET3_DRAW_INDEX_IMMD_BE 0x29
  1499. #define PACKET3_INDEX_TYPE 0x2A
  1500. #define PACKET3_DRAW_INDEX 0x2B
  1501. #define PACKET3_DRAW_INDEX_AUTO 0x2D
  1502. #define PACKET3_DRAW_INDEX_IMMD 0x2E
  1503. #define PACKET3_NUM_INSTANCES 0x2F
  1504. #define PACKET3_STRMOUT_BUFFER_UPDATE 0x34
  1505. #define PACKET3_INDIRECT_BUFFER_MP 0x38
  1506. #define PACKET3_MEM_SEMAPHORE 0x39
  1507. # define PACKET3_SEM_WAIT_ON_SIGNAL (0x1 << 12)
  1508. # define PACKET3_SEM_SEL_SIGNAL (0x6 << 29)
  1509. # define PACKET3_SEM_SEL_WAIT (0x7 << 29)
  1510. #define PACKET3_MPEG_INDEX 0x3A
  1511. #define PACKET3_COPY_DW 0x3B
  1512. #define PACKET3_WAIT_REG_MEM 0x3C
  1513. #define PACKET3_MEM_WRITE 0x3D
  1514. #define PACKET3_INDIRECT_BUFFER 0x32
  1515. #define PACKET3_CP_DMA 0x41
  1516. /* 1. header
  1517. * 2. SRC_ADDR_LO [31:0]
  1518. * 3. CP_SYNC [31] | SRC_ADDR_HI [7:0]
  1519. * 4. DST_ADDR_LO [31:0]
  1520. * 5. DST_ADDR_HI [7:0]
  1521. * 6. COMMAND [29:22] | BYTE_COUNT [20:0]
  1522. */
  1523. # define PACKET3_CP_DMA_CP_SYNC (1 << 31)
  1524. /* COMMAND */
  1525. # define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22)
  1526. /* 0 - none
  1527. * 1 - 8 in 16
  1528. * 2 - 8 in 32
  1529. * 3 - 8 in 64
  1530. */
  1531. # define PACKET3_CP_DMA_CMD_DST_SWAP(x) ((x) << 24)
  1532. /* 0 - none
  1533. * 1 - 8 in 16
  1534. * 2 - 8 in 32
  1535. * 3 - 8 in 64
  1536. */
  1537. # define PACKET3_CP_DMA_CMD_SAS (1 << 26)
  1538. /* 0 - memory
  1539. * 1 - register
  1540. */
  1541. # define PACKET3_CP_DMA_CMD_DAS (1 << 27)
  1542. /* 0 - memory
  1543. * 1 - register
  1544. */
  1545. # define PACKET3_CP_DMA_CMD_SAIC (1 << 28)
  1546. # define PACKET3_CP_DMA_CMD_DAIC (1 << 29)
  1547. #define PACKET3_PFP_SYNC_ME 0x42 /* r7xx+ only */
  1548. #define PACKET3_SURFACE_SYNC 0x43
  1549. # define PACKET3_CB0_DEST_BASE_ENA (1 << 6)
  1550. # define PACKET3_FULL_CACHE_ENA (1 << 20) /* r7xx+ only */
  1551. # define PACKET3_TC_ACTION_ENA (1 << 23)
  1552. # define PACKET3_VC_ACTION_ENA (1 << 24)
  1553. # define PACKET3_CB_ACTION_ENA (1 << 25)
  1554. # define PACKET3_DB_ACTION_ENA (1 << 26)
  1555. # define PACKET3_SH_ACTION_ENA (1 << 27)
  1556. # define PACKET3_SMX_ACTION_ENA (1 << 28)
  1557. #define PACKET3_ME_INITIALIZE 0x44
  1558. #define PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16)
  1559. #define PACKET3_COND_WRITE 0x45
  1560. #define PACKET3_EVENT_WRITE 0x46
  1561. #define EVENT_TYPE(x) ((x) << 0)
  1562. #define EVENT_INDEX(x) ((x) << 8)
  1563. /* 0 - any non-TS event
  1564. * 1 - ZPASS_DONE
  1565. * 2 - SAMPLE_PIPELINESTAT
  1566. * 3 - SAMPLE_STREAMOUTSTAT*
  1567. * 4 - *S_PARTIAL_FLUSH
  1568. * 5 - TS events
  1569. */
  1570. #define PACKET3_EVENT_WRITE_EOP 0x47
  1571. #define DATA_SEL(x) ((x) << 29)
  1572. /* 0 - discard
  1573. * 1 - send low 32bit data
  1574. * 2 - send 64bit data
  1575. * 3 - send 64bit counter value
  1576. */
  1577. #define INT_SEL(x) ((x) << 24)
  1578. /* 0 - none
  1579. * 1 - interrupt only (DATA_SEL = 0)
  1580. * 2 - interrupt when data write is confirmed
  1581. */
  1582. #define PACKET3_ONE_REG_WRITE 0x57
  1583. #define PACKET3_SET_CONFIG_REG 0x68
  1584. #define PACKET3_SET_CONFIG_REG_OFFSET 0x00008000
  1585. #define PACKET3_SET_CONFIG_REG_END 0x0000ac00
  1586. #define PACKET3_SET_CONTEXT_REG 0x69
  1587. #define PACKET3_SET_CONTEXT_REG_OFFSET 0x00028000
  1588. #define PACKET3_SET_CONTEXT_REG_END 0x00029000
  1589. #define PACKET3_SET_ALU_CONST 0x6A
  1590. #define PACKET3_SET_ALU_CONST_OFFSET 0x00030000
  1591. #define PACKET3_SET_ALU_CONST_END 0x00032000
  1592. #define PACKET3_SET_BOOL_CONST 0x6B
  1593. #define PACKET3_SET_BOOL_CONST_OFFSET 0x0003e380
  1594. #define PACKET3_SET_BOOL_CONST_END 0x00040000
  1595. #define PACKET3_SET_LOOP_CONST 0x6C
  1596. #define PACKET3_SET_LOOP_CONST_OFFSET 0x0003e200
  1597. #define PACKET3_SET_LOOP_CONST_END 0x0003e380
  1598. #define PACKET3_SET_RESOURCE 0x6D
  1599. #define PACKET3_SET_RESOURCE_OFFSET 0x00038000
  1600. #define PACKET3_SET_RESOURCE_END 0x0003c000
  1601. #define PACKET3_SET_SAMPLER 0x6E
  1602. #define PACKET3_SET_SAMPLER_OFFSET 0x0003c000
  1603. #define PACKET3_SET_SAMPLER_END 0x0003cff0
  1604. #define PACKET3_SET_CTL_CONST 0x6F
  1605. #define PACKET3_SET_CTL_CONST_OFFSET 0x0003cff0
  1606. #define PACKET3_SET_CTL_CONST_END 0x0003e200
  1607. #define PACKET3_STRMOUT_BASE_UPDATE 0x72 /* r7xx */
  1608. #define PACKET3_SURFACE_BASE_UPDATE 0x73
  1609. #define R_000011_K8_FB_LOCATION 0x11
  1610. #define R_000012_MC_MISC_UMA_CNTL 0x12
  1611. #define G_000012_K8_ADDR_EXT(x) (((x) >> 0) & 0xFF)
  1612. #define R_0028F8_MC_INDEX 0x28F8
  1613. #define S_0028F8_MC_IND_ADDR(x) (((x) & 0x1FF) << 0)
  1614. #define C_0028F8_MC_IND_ADDR 0xFFFFFE00
  1615. #define S_0028F8_MC_IND_WR_EN(x) (((x) & 0x1) << 9)
  1616. #define R_0028FC_MC_DATA 0x28FC
  1617. #define R_008020_GRBM_SOFT_RESET 0x8020
  1618. #define S_008020_SOFT_RESET_CP(x) (((x) & 1) << 0)
  1619. #define S_008020_SOFT_RESET_CB(x) (((x) & 1) << 1)
  1620. #define S_008020_SOFT_RESET_CR(x) (((x) & 1) << 2)
  1621. #define S_008020_SOFT_RESET_DB(x) (((x) & 1) << 3)
  1622. #define S_008020_SOFT_RESET_PA(x) (((x) & 1) << 5)
  1623. #define S_008020_SOFT_RESET_SC(x) (((x) & 1) << 6)
  1624. #define S_008020_SOFT_RESET_SMX(x) (((x) & 1) << 7)
  1625. #define S_008020_SOFT_RESET_SPI(x) (((x) & 1) << 8)
  1626. #define S_008020_SOFT_RESET_SH(x) (((x) & 1) << 9)
  1627. #define S_008020_SOFT_RESET_SX(x) (((x) & 1) << 10)
  1628. #define S_008020_SOFT_RESET_TC(x) (((x) & 1) << 11)
  1629. #define S_008020_SOFT_RESET_TA(x) (((x) & 1) << 12)
  1630. #define S_008020_SOFT_RESET_VC(x) (((x) & 1) << 13)
  1631. #define S_008020_SOFT_RESET_VGT(x) (((x) & 1) << 14)
  1632. #define R_008010_GRBM_STATUS 0x8010
  1633. #define S_008010_CMDFIFO_AVAIL(x) (((x) & 0x1F) << 0)
  1634. #define S_008010_CP_RQ_PENDING(x) (((x) & 1) << 6)
  1635. #define S_008010_CF_RQ_PENDING(x) (((x) & 1) << 7)
  1636. #define S_008010_PF_RQ_PENDING(x) (((x) & 1) << 8)
  1637. #define S_008010_GRBM_EE_BUSY(x) (((x) & 1) << 10)
  1638. #define S_008010_VC_BUSY(x) (((x) & 1) << 11)
  1639. #define S_008010_DB03_CLEAN(x) (((x) & 1) << 12)
  1640. #define S_008010_CB03_CLEAN(x) (((x) & 1) << 13)
  1641. #define S_008010_VGT_BUSY_NO_DMA(x) (((x) & 1) << 16)
  1642. #define S_008010_VGT_BUSY(x) (((x) & 1) << 17)
  1643. #define S_008010_TA03_BUSY(x) (((x) & 1) << 18)
  1644. #define S_008010_TC_BUSY(x) (((x) & 1) << 19)
  1645. #define S_008010_SX_BUSY(x) (((x) & 1) << 20)
  1646. #define S_008010_SH_BUSY(x) (((x) & 1) << 21)
  1647. #define S_008010_SPI03_BUSY(x) (((x) & 1) << 22)
  1648. #define S_008010_SMX_BUSY(x) (((x) & 1) << 23)
  1649. #define S_008010_SC_BUSY(x) (((x) & 1) << 24)
  1650. #define S_008010_PA_BUSY(x) (((x) & 1) << 25)
  1651. #define S_008010_DB03_BUSY(x) (((x) & 1) << 26)
  1652. #define S_008010_CR_BUSY(x) (((x) & 1) << 27)
  1653. #define S_008010_CP_COHERENCY_BUSY(x) (((x) & 1) << 28)
  1654. #define S_008010_CP_BUSY(x) (((x) & 1) << 29)
  1655. #define S_008010_CB03_BUSY(x) (((x) & 1) << 30)
  1656. #define S_008010_GUI_ACTIVE(x) (((x) & 1) << 31)
  1657. #define G_008010_CMDFIFO_AVAIL(x) (((x) >> 0) & 0x1F)
  1658. #define G_008010_CP_RQ_PENDING(x) (((x) >> 6) & 1)
  1659. #define G_008010_CF_RQ_PENDING(x) (((x) >> 7) & 1)
  1660. #define G_008010_PF_RQ_PENDING(x) (((x) >> 8) & 1)
  1661. #define G_008010_GRBM_EE_BUSY(x) (((x) >> 10) & 1)
  1662. #define G_008010_VC_BUSY(x) (((x) >> 11) & 1)
  1663. #define G_008010_DB03_CLEAN(x) (((x) >> 12) & 1)
  1664. #define G_008010_CB03_CLEAN(x) (((x) >> 13) & 1)
  1665. #define G_008010_TA_BUSY(x) (((x) >> 14) & 1)
  1666. #define G_008010_VGT_BUSY_NO_DMA(x) (((x) >> 16) & 1)
  1667. #define G_008010_VGT_BUSY(x) (((x) >> 17) & 1)
  1668. #define G_008010_TA03_BUSY(x) (((x) >> 18) & 1)
  1669. #define G_008010_TC_BUSY(x) (((x) >> 19) & 1)
  1670. #define G_008010_SX_BUSY(x) (((x) >> 20) & 1)
  1671. #define G_008010_SH_BUSY(x) (((x) >> 21) & 1)
  1672. #define G_008010_SPI03_BUSY(x) (((x) >> 22) & 1)
  1673. #define G_008010_SMX_BUSY(x) (((x) >> 23) & 1)
  1674. #define G_008010_SC_BUSY(x) (((x) >> 24) & 1)
  1675. #define G_008010_PA_BUSY(x) (((x) >> 25) & 1)
  1676. #define G_008010_DB03_BUSY(x) (((x) >> 26) & 1)
  1677. #define G_008010_CR_BUSY(x) (((x) >> 27) & 1)
  1678. #define G_008010_CP_COHERENCY_BUSY(x) (((x) >> 28) & 1)
  1679. #define G_008010_CP_BUSY(x) (((x) >> 29) & 1)
  1680. #define G_008010_CB03_BUSY(x) (((x) >> 30) & 1)
  1681. #define G_008010_GUI_ACTIVE(x) (((x) >> 31) & 1)
  1682. #define R_008014_GRBM_STATUS2 0x8014
  1683. #define S_008014_CR_CLEAN(x) (((x) & 1) << 0)
  1684. #define S_008014_SMX_CLEAN(x) (((x) & 1) << 1)
  1685. #define S_008014_SPI0_BUSY(x) (((x) & 1) << 8)
  1686. #define S_008014_SPI1_BUSY(x) (((x) & 1) << 9)
  1687. #define S_008014_SPI2_BUSY(x) (((x) & 1) << 10)
  1688. #define S_008014_SPI3_BUSY(x) (((x) & 1) << 11)
  1689. #define S_008014_TA0_BUSY(x) (((x) & 1) << 12)
  1690. #define S_008014_TA1_BUSY(x) (((x) & 1) << 13)
  1691. #define S_008014_TA2_BUSY(x) (((x) & 1) << 14)
  1692. #define S_008014_TA3_BUSY(x) (((x) & 1) << 15)
  1693. #define S_008014_DB0_BUSY(x) (((x) & 1) << 16)
  1694. #define S_008014_DB1_BUSY(x) (((x) & 1) << 17)
  1695. #define S_008014_DB2_BUSY(x) (((x) & 1) << 18)
  1696. #define S_008014_DB3_BUSY(x) (((x) & 1) << 19)
  1697. #define S_008014_CB0_BUSY(x) (((x) & 1) << 20)
  1698. #define S_008014_CB1_BUSY(x) (((x) & 1) << 21)
  1699. #define S_008014_CB2_BUSY(x) (((x) & 1) << 22)
  1700. #define S_008014_CB3_BUSY(x) (((x) & 1) << 23)
  1701. #define G_008014_CR_CLEAN(x) (((x) >> 0) & 1)
  1702. #define G_008014_SMX_CLEAN(x) (((x) >> 1) & 1)
  1703. #define G_008014_SPI0_BUSY(x) (((x) >> 8) & 1)
  1704. #define G_008014_SPI1_BUSY(x) (((x) >> 9) & 1)
  1705. #define G_008014_SPI2_BUSY(x) (((x) >> 10) & 1)
  1706. #define G_008014_SPI3_BUSY(x) (((x) >> 11) & 1)
  1707. #define G_008014_TA0_BUSY(x) (((x) >> 12) & 1)
  1708. #define G_008014_TA1_BUSY(x) (((x) >> 13) & 1)
  1709. #define G_008014_TA2_BUSY(x) (((x) >> 14) & 1)
  1710. #define G_008014_TA3_BUSY(x) (((x) >> 15) & 1)
  1711. #define G_008014_DB0_BUSY(x) (((x) >> 16) & 1)
  1712. #define G_008014_DB1_BUSY(x) (((x) >> 17) & 1)
  1713. #define G_008014_DB2_BUSY(x) (((x) >> 18) & 1)
  1714. #define G_008014_DB3_BUSY(x) (((x) >> 19) & 1)
  1715. #define G_008014_CB0_BUSY(x) (((x) >> 20) & 1)
  1716. #define G_008014_CB1_BUSY(x) (((x) >> 21) & 1)
  1717. #define G_008014_CB2_BUSY(x) (((x) >> 22) & 1)
  1718. #define G_008014_CB3_BUSY(x) (((x) >> 23) & 1)
  1719. #define R_000E50_SRBM_STATUS 0x0E50
  1720. #define G_000E50_RLC_RQ_PENDING(x) (((x) >> 3) & 1)
  1721. #define G_000E50_RCU_RQ_PENDING(x) (((x) >> 4) & 1)
  1722. #define G_000E50_GRBM_RQ_PENDING(x) (((x) >> 5) & 1)
  1723. #define G_000E50_HI_RQ_PENDING(x) (((x) >> 6) & 1)
  1724. #define G_000E50_IO_EXTERN_SIGNAL(x) (((x) >> 7) & 1)
  1725. #define G_000E50_VMC_BUSY(x) (((x) >> 8) & 1)
  1726. #define G_000E50_MCB_BUSY(x) (((x) >> 9) & 1)
  1727. #define G_000E50_MCDZ_BUSY(x) (((x) >> 10) & 1)
  1728. #define G_000E50_MCDY_BUSY(x) (((x) >> 11) & 1)
  1729. #define G_000E50_MCDX_BUSY(x) (((x) >> 12) & 1)
  1730. #define G_000E50_MCDW_BUSY(x) (((x) >> 13) & 1)
  1731. #define G_000E50_SEM_BUSY(x) (((x) >> 14) & 1)
  1732. #define G_000E50_RLC_BUSY(x) (((x) >> 15) & 1)
  1733. #define G_000E50_IH_BUSY(x) (((x) >> 17) & 1)
  1734. #define G_000E50_BIF_BUSY(x) (((x) >> 29) & 1)
  1735. #define R_000E60_SRBM_SOFT_RESET 0x0E60
  1736. #define S_000E60_SOFT_RESET_BIF(x) (((x) & 1) << 1)
  1737. #define S_000E60_SOFT_RESET_CG(x) (((x) & 1) << 2)
  1738. #define S_000E60_SOFT_RESET_CMC(x) (((x) & 1) << 3)
  1739. #define S_000E60_SOFT_RESET_CSC(x) (((x) & 1) << 4)
  1740. #define S_000E60_SOFT_RESET_DC(x) (((x) & 1) << 5)
  1741. #define S_000E60_SOFT_RESET_GRBM(x) (((x) & 1) << 8)
  1742. #define S_000E60_SOFT_RESET_HDP(x) (((x) & 1) << 9)
  1743. #define S_000E60_SOFT_RESET_IH(x) (((x) & 1) << 10)
  1744. #define S_000E60_SOFT_RESET_MC(x) (((x) & 1) << 11)
  1745. #define S_000E60_SOFT_RESET_RLC(x) (((x) & 1) << 13)
  1746. #define S_000E60_SOFT_RESET_ROM(x) (((x) & 1) << 14)
  1747. #define S_000E60_SOFT_RESET_SEM(x) (((x) & 1) << 15)
  1748. #define S_000E60_SOFT_RESET_TSC(x) (((x) & 1) << 16)
  1749. #define S_000E60_SOFT_RESET_VMC(x) (((x) & 1) << 17)
  1750. #define R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL 0x5480
  1751. #define R_028C04_PA_SC_AA_CONFIG 0x028C04
  1752. #define S_028C04_MSAA_NUM_SAMPLES(x) (((x) & 0x3) << 0)
  1753. #define G_028C04_MSAA_NUM_SAMPLES(x) (((x) >> 0) & 0x3)
  1754. #define C_028C04_MSAA_NUM_SAMPLES 0xFFFFFFFC
  1755. #define S_028C04_AA_MASK_CENTROID_DTMN(x) (((x) & 0x1) << 4)
  1756. #define G_028C04_AA_MASK_CENTROID_DTMN(x) (((x) >> 4) & 0x1)
  1757. #define C_028C04_AA_MASK_CENTROID_DTMN 0xFFFFFFEF
  1758. #define S_028C04_MAX_SAMPLE_DIST(x) (((x) & 0xF) << 13)
  1759. #define G_028C04_MAX_SAMPLE_DIST(x) (((x) >> 13) & 0xF)
  1760. #define C_028C04_MAX_SAMPLE_DIST 0xFFFE1FFF
  1761. #define R_0280E0_CB_COLOR0_FRAG 0x0280E0
  1762. #define S_0280E0_BASE_256B(x) (((x) & 0xFFFFFFFF) << 0)
  1763. #define G_0280E0_BASE_256B(x) (((x) >> 0) & 0xFFFFFFFF)
  1764. #define C_0280E0_BASE_256B 0x00000000
  1765. #define R_0280E4_CB_COLOR1_FRAG 0x0280E4
  1766. #define R_0280E8_CB_COLOR2_FRAG 0x0280E8
  1767. #define R_0280EC_CB_COLOR3_FRAG 0x0280EC
  1768. #define R_0280F0_CB_COLOR4_FRAG 0x0280F0
  1769. #define R_0280F4_CB_COLOR5_FRAG 0x0280F4
  1770. #define R_0280F8_CB_COLOR6_FRAG 0x0280F8
  1771. #define R_0280FC_CB_COLOR7_FRAG 0x0280FC
  1772. #define R_0280C0_CB_COLOR0_TILE 0x0280C0
  1773. #define S_0280C0_BASE_256B(x) (((x) & 0xFFFFFFFF) << 0)
  1774. #define G_0280C0_BASE_256B(x) (((x) >> 0) & 0xFFFFFFFF)
  1775. #define C_0280C0_BASE_256B 0x00000000
  1776. #define R_0280C4_CB_COLOR1_TILE 0x0280C4
  1777. #define R_0280C8_CB_COLOR2_TILE 0x0280C8
  1778. #define R_0280CC_CB_COLOR3_TILE 0x0280CC
  1779. #define R_0280D0_CB_COLOR4_TILE 0x0280D0
  1780. #define R_0280D4_CB_COLOR5_TILE 0x0280D4
  1781. #define R_0280D8_CB_COLOR6_TILE 0x0280D8
  1782. #define R_0280DC_CB_COLOR7_TILE 0x0280DC
  1783. #define R_0280A0_CB_COLOR0_INFO 0x0280A0
  1784. #define S_0280A0_ENDIAN(x) (((x) & 0x3) << 0)
  1785. #define G_0280A0_ENDIAN(x) (((x) >> 0) & 0x3)
  1786. #define C_0280A0_ENDIAN 0xFFFFFFFC
  1787. #define S_0280A0_FORMAT(x) (((x) & 0x3F) << 2)
  1788. #define G_0280A0_FORMAT(x) (((x) >> 2) & 0x3F)
  1789. #define C_0280A0_FORMAT 0xFFFFFF03
  1790. #define V_0280A0_COLOR_INVALID 0x00000000
  1791. #define V_0280A0_COLOR_8 0x00000001
  1792. #define V_0280A0_COLOR_4_4 0x00000002
  1793. #define V_0280A0_COLOR_3_3_2 0x00000003
  1794. #define V_0280A0_COLOR_16 0x00000005
  1795. #define V_0280A0_COLOR_16_FLOAT 0x00000006
  1796. #define V_0280A0_COLOR_8_8 0x00000007
  1797. #define V_0280A0_COLOR_5_6_5 0x00000008
  1798. #define V_0280A0_COLOR_6_5_5 0x00000009
  1799. #define V_0280A0_COLOR_1_5_5_5 0x0000000A
  1800. #define V_0280A0_COLOR_4_4_4_4 0x0000000B
  1801. #define V_0280A0_COLOR_5_5_5_1 0x0000000C
  1802. #define V_0280A0_COLOR_32 0x0000000D
  1803. #define V_0280A0_COLOR_32_FLOAT 0x0000000E
  1804. #define V_0280A0_COLOR_16_16 0x0000000F
  1805. #define V_0280A0_COLOR_16_16_FLOAT 0x00000010
  1806. #define V_0280A0_COLOR_8_24 0x00000011
  1807. #define V_0280A0_COLOR_8_24_FLOAT 0x00000012
  1808. #define V_0280A0_COLOR_24_8 0x00000013
  1809. #define V_0280A0_COLOR_24_8_FLOAT 0x00000014
  1810. #define V_0280A0_COLOR_10_11_11 0x00000015
  1811. #define V_0280A0_COLOR_10_11_11_FLOAT 0x00000016
  1812. #define V_0280A0_COLOR_11_11_10 0x00000017
  1813. #define V_0280A0_COLOR_11_11_10_FLOAT 0x00000018
  1814. #define V_0280A0_COLOR_2_10_10_10 0x00000019
  1815. #define V_0280A0_COLOR_8_8_8_8 0x0000001A
  1816. #define V_0280A0_COLOR_10_10_10_2 0x0000001B
  1817. #define V_0280A0_COLOR_X24_8_32_FLOAT 0x0000001C
  1818. #define V_0280A0_COLOR_32_32 0x0000001D
  1819. #define V_0280A0_COLOR_32_32_FLOAT 0x0000001E
  1820. #define V_0280A0_COLOR_16_16_16_16 0x0000001F
  1821. #define V_0280A0_COLOR_16_16_16_16_FLOAT 0x00000020
  1822. #define V_0280A0_COLOR_32_32_32_32 0x00000022
  1823. #define V_0280A0_COLOR_32_32_32_32_FLOAT 0x00000023
  1824. #define S_0280A0_ARRAY_MODE(x) (((x) & 0xF) << 8)
  1825. #define G_0280A0_ARRAY_MODE(x) (((x) >> 8) & 0xF)
  1826. #define C_0280A0_ARRAY_MODE 0xFFFFF0FF
  1827. #define V_0280A0_ARRAY_LINEAR_GENERAL 0x00000000
  1828. #define V_0280A0_ARRAY_LINEAR_ALIGNED 0x00000001
  1829. #define V_0280A0_ARRAY_1D_TILED_THIN1 0x00000002
  1830. #define V_0280A0_ARRAY_2D_TILED_THIN1 0x00000004
  1831. #define S_0280A0_NUMBER_TYPE(x) (((x) & 0x7) << 12)
  1832. #define G_0280A0_NUMBER_TYPE(x) (((x) >> 12) & 0x7)
  1833. #define C_0280A0_NUMBER_TYPE 0xFFFF8FFF
  1834. #define S_0280A0_READ_SIZE(x) (((x) & 0x1) << 15)
  1835. #define G_0280A0_READ_SIZE(x) (((x) >> 15) & 0x1)
  1836. #define C_0280A0_READ_SIZE 0xFFFF7FFF
  1837. #define S_0280A0_COMP_SWAP(x) (((x) & 0x3) << 16)
  1838. #define G_0280A0_COMP_SWAP(x) (((x) >> 16) & 0x3)
  1839. #define C_0280A0_COMP_SWAP 0xFFFCFFFF
  1840. #define S_0280A0_TILE_MODE(x) (((x) & 0x3) << 18)
  1841. #define G_0280A0_TILE_MODE(x) (((x) >> 18) & 0x3)
  1842. #define C_0280A0_TILE_MODE 0xFFF3FFFF
  1843. #define V_0280A0_TILE_DISABLE 0
  1844. #define V_0280A0_CLEAR_ENABLE 1
  1845. #define V_0280A0_FRAG_ENABLE 2
  1846. #define S_0280A0_BLEND_CLAMP(x) (((x) & 0x1) << 20)
  1847. #define G_0280A0_BLEND_CLAMP(x) (((x) >> 20) & 0x1)
  1848. #define C_0280A0_BLEND_CLAMP 0xFFEFFFFF
  1849. #define S_0280A0_CLEAR_COLOR(x) (((x) & 0x1) << 21)
  1850. #define G_0280A0_CLEAR_COLOR(x) (((x) >> 21) & 0x1)
  1851. #define C_0280A0_CLEAR_COLOR 0xFFDFFFFF
  1852. #define S_0280A0_BLEND_BYPASS(x) (((x) & 0x1) << 22)
  1853. #define G_0280A0_BLEND_BYPASS(x) (((x) >> 22) & 0x1)
  1854. #define C_0280A0_BLEND_BYPASS 0xFFBFFFFF
  1855. #define S_0280A0_BLEND_FLOAT32(x) (((x) & 0x1) << 23)
  1856. #define G_0280A0_BLEND_FLOAT32(x) (((x) >> 23) & 0x1)
  1857. #define C_0280A0_BLEND_FLOAT32 0xFF7FFFFF
  1858. #define S_0280A0_SIMPLE_FLOAT(x) (((x) & 0x1) << 24)
  1859. #define G_0280A0_SIMPLE_FLOAT(x) (((x) >> 24) & 0x1)
  1860. #define C_0280A0_SIMPLE_FLOAT 0xFEFFFFFF
  1861. #define S_0280A0_ROUND_MODE(x) (((x) & 0x1) << 25)
  1862. #define G_0280A0_ROUND_MODE(x) (((x) >> 25) & 0x1)
  1863. #define C_0280A0_ROUND_MODE 0xFDFFFFFF
  1864. #define S_0280A0_TILE_COMPACT(x) (((x) & 0x1) << 26)
  1865. #define G_0280A0_TILE_COMPACT(x) (((x) >> 26) & 0x1)
  1866. #define C_0280A0_TILE_COMPACT 0xFBFFFFFF
  1867. #define S_0280A0_SOURCE_FORMAT(x) (((x) & 0x1) << 27)
  1868. #define G_0280A0_SOURCE_FORMAT(x) (((x) >> 27) & 0x1)
  1869. #define C_0280A0_SOURCE_FORMAT 0xF7FFFFFF
  1870. #define R_0280A4_CB_COLOR1_INFO 0x0280A4
  1871. #define R_0280A8_CB_COLOR2_INFO 0x0280A8
  1872. #define R_0280AC_CB_COLOR3_INFO 0x0280AC
  1873. #define R_0280B0_CB_COLOR4_INFO 0x0280B0
  1874. #define R_0280B4_CB_COLOR5_INFO 0x0280B4
  1875. #define R_0280B8_CB_COLOR6_INFO 0x0280B8
  1876. #define R_0280BC_CB_COLOR7_INFO 0x0280BC
  1877. #define R_028060_CB_COLOR0_SIZE 0x028060
  1878. #define S_028060_PITCH_TILE_MAX(x) (((x) & 0x3FF) << 0)
  1879. #define G_028060_PITCH_TILE_MAX(x) (((x) >> 0) & 0x3FF)
  1880. #define C_028060_PITCH_TILE_MAX 0xFFFFFC00
  1881. #define S_028060_SLICE_TILE_MAX(x) (((x) & 0xFFFFF) << 10)
  1882. #define G_028060_SLICE_TILE_MAX(x) (((x) >> 10) & 0xFFFFF)
  1883. #define C_028060_SLICE_TILE_MAX 0xC00003FF
  1884. #define R_028064_CB_COLOR1_SIZE 0x028064
  1885. #define R_028068_CB_COLOR2_SIZE 0x028068
  1886. #define R_02806C_CB_COLOR3_SIZE 0x02806C
  1887. #define R_028070_CB_COLOR4_SIZE 0x028070
  1888. #define R_028074_CB_COLOR5_SIZE 0x028074
  1889. #define R_028078_CB_COLOR6_SIZE 0x028078
  1890. #define R_02807C_CB_COLOR7_SIZE 0x02807C
  1891. #define R_028238_CB_TARGET_MASK 0x028238
  1892. #define S_028238_TARGET0_ENABLE(x) (((x) & 0xF) << 0)
  1893. #define G_028238_TARGET0_ENABLE(x) (((x) >> 0) & 0xF)
  1894. #define C_028238_TARGET0_ENABLE 0xFFFFFFF0
  1895. #define S_028238_TARGET1_ENABLE(x) (((x) & 0xF) << 4)
  1896. #define G_028238_TARGET1_ENABLE(x) (((x) >> 4) & 0xF)
  1897. #define C_028238_TARGET1_ENABLE 0xFFFFFF0F
  1898. #define S_028238_TARGET2_ENABLE(x) (((x) & 0xF) << 8)
  1899. #define G_028238_TARGET2_ENABLE(x) (((x) >> 8) & 0xF)
  1900. #define C_028238_TARGET2_ENABLE 0xFFFFF0FF
  1901. #define S_028238_TARGET3_ENABLE(x) (((x) & 0xF) << 12)
  1902. #define G_028238_TARGET3_ENABLE(x) (((x) >> 12) & 0xF)
  1903. #define C_028238_TARGET3_ENABLE 0xFFFF0FFF
  1904. #define S_028238_TARGET4_ENABLE(x) (((x) & 0xF) << 16)
  1905. #define G_028238_TARGET4_ENABLE(x) (((x) >> 16) & 0xF)
  1906. #define C_028238_TARGET4_ENABLE 0xFFF0FFFF
  1907. #define S_028238_TARGET5_ENABLE(x) (((x) & 0xF) << 20)
  1908. #define G_028238_TARGET5_ENABLE(x) (((x) >> 20) & 0xF)
  1909. #define C_028238_TARGET5_ENABLE 0xFF0FFFFF
  1910. #define S_028238_TARGET6_ENABLE(x) (((x) & 0xF) << 24)
  1911. #define G_028238_TARGET6_ENABLE(x) (((x) >> 24) & 0xF)
  1912. #define C_028238_TARGET6_ENABLE 0xF0FFFFFF
  1913. #define S_028238_TARGET7_ENABLE(x) (((x) & 0xF) << 28)
  1914. #define G_028238_TARGET7_ENABLE(x) (((x) >> 28) & 0xF)
  1915. #define C_028238_TARGET7_ENABLE 0x0FFFFFFF
  1916. #define R_02823C_CB_SHADER_MASK 0x02823C
  1917. #define S_02823C_OUTPUT0_ENABLE(x) (((x) & 0xF) << 0)
  1918. #define G_02823C_OUTPUT0_ENABLE(x) (((x) >> 0) & 0xF)
  1919. #define C_02823C_OUTPUT0_ENABLE 0xFFFFFFF0
  1920. #define S_02823C_OUTPUT1_ENABLE(x) (((x) & 0xF) << 4)
  1921. #define G_02823C_OUTPUT1_ENABLE(x) (((x) >> 4) & 0xF)
  1922. #define C_02823C_OUTPUT1_ENABLE 0xFFFFFF0F
  1923. #define S_02823C_OUTPUT2_ENABLE(x) (((x) & 0xF) << 8)
  1924. #define G_02823C_OUTPUT2_ENABLE(x) (((x) >> 8) & 0xF)
  1925. #define C_02823C_OUTPUT2_ENABLE 0xFFFFF0FF
  1926. #define S_02823C_OUTPUT3_ENABLE(x) (((x) & 0xF) << 12)
  1927. #define G_02823C_OUTPUT3_ENABLE(x) (((x) >> 12) & 0xF)
  1928. #define C_02823C_OUTPUT3_ENABLE 0xFFFF0FFF
  1929. #define S_02823C_OUTPUT4_ENABLE(x) (((x) & 0xF) << 16)
  1930. #define G_02823C_OUTPUT4_ENABLE(x) (((x) >> 16) & 0xF)
  1931. #define C_02823C_OUTPUT4_ENABLE 0xFFF0FFFF
  1932. #define S_02823C_OUTPUT5_ENABLE(x) (((x) & 0xF) << 20)
  1933. #define G_02823C_OUTPUT5_ENABLE(x) (((x) >> 20) & 0xF)
  1934. #define C_02823C_OUTPUT5_ENABLE 0xFF0FFFFF
  1935. #define S_02823C_OUTPUT6_ENABLE(x) (((x) & 0xF) << 24)
  1936. #define G_02823C_OUTPUT6_ENABLE(x) (((x) >> 24) & 0xF)
  1937. #define C_02823C_OUTPUT6_ENABLE 0xF0FFFFFF
  1938. #define S_02823C_OUTPUT7_ENABLE(x) (((x) & 0xF) << 28)
  1939. #define G_02823C_OUTPUT7_ENABLE(x) (((x) >> 28) & 0xF)
  1940. #define C_02823C_OUTPUT7_ENABLE 0x0FFFFFFF
  1941. #define R_028AB0_VGT_STRMOUT_EN 0x028AB0
  1942. #define S_028AB0_STREAMOUT(x) (((x) & 0x1) << 0)
  1943. #define G_028AB0_STREAMOUT(x) (((x) >> 0) & 0x1)
  1944. #define C_028AB0_STREAMOUT 0xFFFFFFFE
  1945. #define R_028B20_VGT_STRMOUT_BUFFER_EN 0x028B20
  1946. #define S_028B20_BUFFER_0_EN(x) (((x) & 0x1) << 0)
  1947. #define G_028B20_BUFFER_0_EN(x) (((x) >> 0) & 0x1)
  1948. #define C_028B20_BUFFER_0_EN 0xFFFFFFFE
  1949. #define S_028B20_BUFFER_1_EN(x) (((x) & 0x1) << 1)
  1950. #define G_028B20_BUFFER_1_EN(x) (((x) >> 1) & 0x1)
  1951. #define C_028B20_BUFFER_1_EN 0xFFFFFFFD
  1952. #define S_028B20_BUFFER_2_EN(x) (((x) & 0x1) << 2)
  1953. #define G_028B20_BUFFER_2_EN(x) (((x) >> 2) & 0x1)
  1954. #define C_028B20_BUFFER_2_EN 0xFFFFFFFB
  1955. #define S_028B20_BUFFER_3_EN(x) (((x) & 0x1) << 3)
  1956. #define G_028B20_BUFFER_3_EN(x) (((x) >> 3) & 0x1)
  1957. #define C_028B20_BUFFER_3_EN 0xFFFFFFF7
  1958. #define S_028B20_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
  1959. #define G_028B20_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  1960. #define C_028B20_SIZE 0x00000000
  1961. #define R_038000_SQ_TEX_RESOURCE_WORD0_0 0x038000
  1962. #define S_038000_DIM(x) (((x) & 0x7) << 0)
  1963. #define G_038000_DIM(x) (((x) >> 0) & 0x7)
  1964. #define C_038000_DIM 0xFFFFFFF8
  1965. #define V_038000_SQ_TEX_DIM_1D 0x00000000
  1966. #define V_038000_SQ_TEX_DIM_2D 0x00000001
  1967. #define V_038000_SQ_TEX_DIM_3D 0x00000002
  1968. #define V_038000_SQ_TEX_DIM_CUBEMAP 0x00000003
  1969. #define V_038000_SQ_TEX_DIM_1D_ARRAY 0x00000004
  1970. #define V_038000_SQ_TEX_DIM_2D_ARRAY 0x00000005
  1971. #define V_038000_SQ_TEX_DIM_2D_MSAA 0x00000006
  1972. #define V_038000_SQ_TEX_DIM_2D_ARRAY_MSAA 0x00000007
  1973. #define S_038000_TILE_MODE(x) (((x) & 0xF) << 3)
  1974. #define G_038000_TILE_MODE(x) (((x) >> 3) & 0xF)
  1975. #define C_038000_TILE_MODE 0xFFFFFF87
  1976. #define V_038000_ARRAY_LINEAR_GENERAL 0x00000000
  1977. #define V_038000_ARRAY_LINEAR_ALIGNED 0x00000001
  1978. #define V_038000_ARRAY_1D_TILED_THIN1 0x00000002
  1979. #define V_038000_ARRAY_2D_TILED_THIN1 0x00000004
  1980. #define S_038000_TILE_TYPE(x) (((x) & 0x1) << 7)
  1981. #define G_038000_TILE_TYPE(x) (((x) >> 7) & 0x1)
  1982. #define C_038000_TILE_TYPE 0xFFFFFF7F
  1983. #define S_038000_PITCH(x) (((x) & 0x7FF) << 8)
  1984. #define G_038000_PITCH(x) (((x) >> 8) & 0x7FF)
  1985. #define C_038000_PITCH 0xFFF800FF
  1986. #define S_038000_TEX_WIDTH(x) (((x) & 0x1FFF) << 19)
  1987. #define G_038000_TEX_WIDTH(x) (((x) >> 19) & 0x1FFF)
  1988. #define C_038000_TEX_WIDTH 0x0007FFFF
  1989. #define R_038004_SQ_TEX_RESOURCE_WORD1_0 0x038004
  1990. #define S_038004_TEX_HEIGHT(x) (((x) & 0x1FFF) << 0)
  1991. #define G_038004_TEX_HEIGHT(x) (((x) >> 0) & 0x1FFF)
  1992. #define C_038004_TEX_HEIGHT 0xFFFFE000
  1993. #define S_038004_TEX_DEPTH(x) (((x) & 0x1FFF) << 13)
  1994. #define G_038004_TEX_DEPTH(x) (((x) >> 13) & 0x1FFF)
  1995. #define C_038004_TEX_DEPTH 0xFC001FFF
  1996. #define S_038004_DATA_FORMAT(x) (((x) & 0x3F) << 26)
  1997. #define G_038004_DATA_FORMAT(x) (((x) >> 26) & 0x3F)
  1998. #define C_038004_DATA_FORMAT 0x03FFFFFF
  1999. #define V_038004_COLOR_INVALID 0x00000000
  2000. #define V_038004_COLOR_8 0x00000001
  2001. #define V_038004_COLOR_4_4 0x00000002
  2002. #define V_038004_COLOR_3_3_2 0x00000003
  2003. #define V_038004_COLOR_16 0x00000005
  2004. #define V_038004_COLOR_16_FLOAT 0x00000006
  2005. #define V_038004_COLOR_8_8 0x00000007
  2006. #define V_038004_COLOR_5_6_5 0x00000008
  2007. #define V_038004_COLOR_6_5_5 0x00000009
  2008. #define V_038004_COLOR_1_5_5_5 0x0000000A
  2009. #define V_038004_COLOR_4_4_4_4 0x0000000B
  2010. #define V_038004_COLOR_5_5_5_1 0x0000000C
  2011. #define V_038004_COLOR_32 0x0000000D
  2012. #define V_038004_COLOR_32_FLOAT 0x0000000E
  2013. #define V_038004_COLOR_16_16 0x0000000F
  2014. #define V_038004_COLOR_16_16_FLOAT 0x00000010
  2015. #define V_038004_COLOR_8_24 0x00000011
  2016. #define V_038004_COLOR_8_24_FLOAT 0x00000012
  2017. #define V_038004_COLOR_24_8 0x00000013
  2018. #define V_038004_COLOR_24_8_FLOAT 0x00000014
  2019. #define V_038004_COLOR_10_11_11 0x00000015
  2020. #define V_038004_COLOR_10_11_11_FLOAT 0x00000016
  2021. #define V_038004_COLOR_11_11_10 0x00000017
  2022. #define V_038004_COLOR_11_11_10_FLOAT 0x00000018
  2023. #define V_038004_COLOR_2_10_10_10 0x00000019
  2024. #define V_038004_COLOR_8_8_8_8 0x0000001A
  2025. #define V_038004_COLOR_10_10_10_2 0x0000001B
  2026. #define V_038004_COLOR_X24_8_32_FLOAT 0x0000001C
  2027. #define V_038004_COLOR_32_32 0x0000001D
  2028. #define V_038004_COLOR_32_32_FLOAT 0x0000001E
  2029. #define V_038004_COLOR_16_16_16_16 0x0000001F
  2030. #define V_038004_COLOR_16_16_16_16_FLOAT 0x00000020
  2031. #define V_038004_COLOR_32_32_32_32 0x00000022
  2032. #define V_038004_COLOR_32_32_32_32_FLOAT 0x00000023
  2033. #define V_038004_FMT_1 0x00000025
  2034. #define V_038004_FMT_GB_GR 0x00000027
  2035. #define V_038004_FMT_BG_RG 0x00000028
  2036. #define V_038004_FMT_32_AS_8 0x00000029
  2037. #define V_038004_FMT_32_AS_8_8 0x0000002A
  2038. #define V_038004_FMT_5_9_9_9_SHAREDEXP 0x0000002B
  2039. #define V_038004_FMT_8_8_8 0x0000002C
  2040. #define V_038004_FMT_16_16_16 0x0000002D
  2041. #define V_038004_FMT_16_16_16_FLOAT 0x0000002E
  2042. #define V_038004_FMT_32_32_32 0x0000002F
  2043. #define V_038004_FMT_32_32_32_FLOAT 0x00000030
  2044. #define V_038004_FMT_BC1 0x00000031
  2045. #define V_038004_FMT_BC2 0x00000032
  2046. #define V_038004_FMT_BC3 0x00000033
  2047. #define V_038004_FMT_BC4 0x00000034
  2048. #define V_038004_FMT_BC5 0x00000035
  2049. #define V_038004_FMT_BC6 0x00000036
  2050. #define V_038004_FMT_BC7 0x00000037
  2051. #define V_038004_FMT_32_AS_32_32_32_32 0x00000038
  2052. #define R_038010_SQ_TEX_RESOURCE_WORD4_0 0x038010
  2053. #define S_038010_FORMAT_COMP_X(x) (((x) & 0x3) << 0)
  2054. #define G_038010_FORMAT_COMP_X(x) (((x) >> 0) & 0x3)
  2055. #define C_038010_FORMAT_COMP_X 0xFFFFFFFC
  2056. #define S_038010_FORMAT_COMP_Y(x) (((x) & 0x3) << 2)
  2057. #define G_038010_FORMAT_COMP_Y(x) (((x) >> 2) & 0x3)
  2058. #define C_038010_FORMAT_COMP_Y 0xFFFFFFF3
  2059. #define S_038010_FORMAT_COMP_Z(x) (((x) & 0x3) << 4)
  2060. #define G_038010_FORMAT_COMP_Z(x) (((x) >> 4) & 0x3)
  2061. #define C_038010_FORMAT_COMP_Z 0xFFFFFFCF
  2062. #define S_038010_FORMAT_COMP_W(x) (((x) & 0x3) << 6)
  2063. #define G_038010_FORMAT_COMP_W(x) (((x) >> 6) & 0x3)
  2064. #define C_038010_FORMAT_COMP_W 0xFFFFFF3F
  2065. #define S_038010_NUM_FORMAT_ALL(x) (((x) & 0x3) << 8)
  2066. #define G_038010_NUM_FORMAT_ALL(x) (((x) >> 8) & 0x3)
  2067. #define C_038010_NUM_FORMAT_ALL 0xFFFFFCFF
  2068. #define S_038010_SRF_MODE_ALL(x) (((x) & 0x1) << 10)
  2069. #define G_038010_SRF_MODE_ALL(x) (((x) >> 10) & 0x1)
  2070. #define C_038010_SRF_MODE_ALL 0xFFFFFBFF
  2071. #define S_038010_FORCE_DEGAMMA(x) (((x) & 0x1) << 11)
  2072. #define G_038010_FORCE_DEGAMMA(x) (((x) >> 11) & 0x1)
  2073. #define C_038010_FORCE_DEGAMMA 0xFFFFF7FF
  2074. #define S_038010_ENDIAN_SWAP(x) (((x) & 0x3) << 12)
  2075. #define G_038010_ENDIAN_SWAP(x) (((x) >> 12) & 0x3)
  2076. #define C_038010_ENDIAN_SWAP 0xFFFFCFFF
  2077. #define S_038010_REQUEST_SIZE(x) (((x) & 0x3) << 14)
  2078. #define G_038010_REQUEST_SIZE(x) (((x) >> 14) & 0x3)
  2079. #define C_038010_REQUEST_SIZE 0xFFFF3FFF
  2080. #define S_038010_DST_SEL_X(x) (((x) & 0x7) << 16)
  2081. #define G_038010_DST_SEL_X(x) (((x) >> 16) & 0x7)
  2082. #define C_038010_DST_SEL_X 0xFFF8FFFF
  2083. #define S_038010_DST_SEL_Y(x) (((x) & 0x7) << 19)
  2084. #define G_038010_DST_SEL_Y(x) (((x) >> 19) & 0x7)
  2085. #define C_038010_DST_SEL_Y 0xFFC7FFFF
  2086. #define S_038010_DST_SEL_Z(x) (((x) & 0x7) << 22)
  2087. #define G_038010_DST_SEL_Z(x) (((x) >> 22) & 0x7)
  2088. #define C_038010_DST_SEL_Z 0xFE3FFFFF
  2089. #define S_038010_DST_SEL_W(x) (((x) & 0x7) << 25)
  2090. #define G_038010_DST_SEL_W(x) (((x) >> 25) & 0x7)
  2091. #define C_038010_DST_SEL_W 0xF1FFFFFF
  2092. # define SQ_SEL_X 0
  2093. # define SQ_SEL_Y 1
  2094. # define SQ_SEL_Z 2
  2095. # define SQ_SEL_W 3
  2096. # define SQ_SEL_0 4
  2097. # define SQ_SEL_1 5
  2098. #define S_038010_BASE_LEVEL(x) (((x) & 0xF) << 28)
  2099. #define G_038010_BASE_LEVEL(x) (((x) >> 28) & 0xF)
  2100. #define C_038010_BASE_LEVEL 0x0FFFFFFF
  2101. #define R_038014_SQ_TEX_RESOURCE_WORD5_0 0x038014
  2102. #define S_038014_LAST_LEVEL(x) (((x) & 0xF) << 0)
  2103. #define G_038014_LAST_LEVEL(x) (((x) >> 0) & 0xF)
  2104. #define C_038014_LAST_LEVEL 0xFFFFFFF0
  2105. #define S_038014_BASE_ARRAY(x) (((x) & 0x1FFF) << 4)
  2106. #define G_038014_BASE_ARRAY(x) (((x) >> 4) & 0x1FFF)
  2107. #define C_038014_BASE_ARRAY 0xFFFE000F
  2108. #define S_038014_LAST_ARRAY(x) (((x) & 0x1FFF) << 17)
  2109. #define G_038014_LAST_ARRAY(x) (((x) >> 17) & 0x1FFF)
  2110. #define C_038014_LAST_ARRAY 0xC001FFFF
  2111. #define R_0288A8_SQ_ESGS_RING_ITEMSIZE 0x0288A8
  2112. #define S_0288A8_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
  2113. #define G_0288A8_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
  2114. #define C_0288A8_ITEMSIZE 0xFFFF8000
  2115. #define R_008C44_SQ_ESGS_RING_SIZE 0x008C44
  2116. #define S_008C44_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
  2117. #define G_008C44_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  2118. #define C_008C44_MEM_SIZE 0x00000000
  2119. #define R_0288B0_SQ_ESTMP_RING_ITEMSIZE 0x0288B0
  2120. #define S_0288B0_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
  2121. #define G_0288B0_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
  2122. #define C_0288B0_ITEMSIZE 0xFFFF8000
  2123. #define R_008C54_SQ_ESTMP_RING_SIZE 0x008C54
  2124. #define S_008C54_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
  2125. #define G_008C54_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  2126. #define C_008C54_MEM_SIZE 0x00000000
  2127. #define R_0288C0_SQ_FBUF_RING_ITEMSIZE 0x0288C0
  2128. #define S_0288C0_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
  2129. #define G_0288C0_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
  2130. #define C_0288C0_ITEMSIZE 0xFFFF8000
  2131. #define R_008C74_SQ_FBUF_RING_SIZE 0x008C74
  2132. #define S_008C74_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
  2133. #define G_008C74_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  2134. #define C_008C74_MEM_SIZE 0x00000000
  2135. #define R_0288B4_SQ_GSTMP_RING_ITEMSIZE 0x0288B4
  2136. #define S_0288B4_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
  2137. #define G_0288B4_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
  2138. #define C_0288B4_ITEMSIZE 0xFFFF8000
  2139. #define R_008C5C_SQ_GSTMP_RING_SIZE 0x008C5C
  2140. #define S_008C5C_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
  2141. #define G_008C5C_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  2142. #define C_008C5C_MEM_SIZE 0x00000000
  2143. #define R_0288AC_SQ_GSVS_RING_ITEMSIZE 0x0288AC
  2144. #define S_0288AC_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
  2145. #define G_0288AC_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
  2146. #define C_0288AC_ITEMSIZE 0xFFFF8000
  2147. #define R_008C4C_SQ_GSVS_RING_SIZE 0x008C4C
  2148. #define S_008C4C_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
  2149. #define G_008C4C_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  2150. #define C_008C4C_MEM_SIZE 0x00000000
  2151. #define R_0288BC_SQ_PSTMP_RING_ITEMSIZE 0x0288BC
  2152. #define S_0288BC_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
  2153. #define G_0288BC_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
  2154. #define C_0288BC_ITEMSIZE 0xFFFF8000
  2155. #define R_008C6C_SQ_PSTMP_RING_SIZE 0x008C6C
  2156. #define S_008C6C_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
  2157. #define G_008C6C_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  2158. #define C_008C6C_MEM_SIZE 0x00000000
  2159. #define R_0288C4_SQ_REDUC_RING_ITEMSIZE 0x0288C4
  2160. #define S_0288C4_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
  2161. #define G_0288C4_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
  2162. #define C_0288C4_ITEMSIZE 0xFFFF8000
  2163. #define R_008C7C_SQ_REDUC_RING_SIZE 0x008C7C
  2164. #define S_008C7C_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
  2165. #define G_008C7C_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  2166. #define C_008C7C_MEM_SIZE 0x00000000
  2167. #define R_0288B8_SQ_VSTMP_RING_ITEMSIZE 0x0288B8
  2168. #define S_0288B8_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
  2169. #define G_0288B8_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
  2170. #define C_0288B8_ITEMSIZE 0xFFFF8000
  2171. #define R_008C64_SQ_VSTMP_RING_SIZE 0x008C64
  2172. #define S_008C64_MEM_SIZE(x) (((x) & 0xFFFFFFFF) << 0)
  2173. #define G_008C64_MEM_SIZE(x) (((x) >> 0) & 0xFFFFFFFF)
  2174. #define C_008C64_MEM_SIZE 0x00000000
  2175. #define R_0288C8_SQ_GS_VERT_ITEMSIZE 0x0288C8
  2176. #define S_0288C8_ITEMSIZE(x) (((x) & 0x7FFF) << 0)
  2177. #define G_0288C8_ITEMSIZE(x) (((x) >> 0) & 0x7FFF)
  2178. #define C_0288C8_ITEMSIZE 0xFFFF8000
  2179. #define R_028010_DB_DEPTH_INFO 0x028010
  2180. #define S_028010_FORMAT(x) (((x) & 0x7) << 0)
  2181. #define G_028010_FORMAT(x) (((x) >> 0) & 0x7)
  2182. #define C_028010_FORMAT 0xFFFFFFF8
  2183. #define V_028010_DEPTH_INVALID 0x00000000
  2184. #define V_028010_DEPTH_16 0x00000001
  2185. #define V_028010_DEPTH_X8_24 0x00000002
  2186. #define V_028010_DEPTH_8_24 0x00000003
  2187. #define V_028010_DEPTH_X8_24_FLOAT 0x00000004
  2188. #define V_028010_DEPTH_8_24_FLOAT 0x00000005
  2189. #define V_028010_DEPTH_32_FLOAT 0x00000006
  2190. #define V_028010_DEPTH_X24_8_32_FLOAT 0x00000007
  2191. #define S_028010_READ_SIZE(x) (((x) & 0x1) << 3)
  2192. #define G_028010_READ_SIZE(x) (((x) >> 3) & 0x1)
  2193. #define C_028010_READ_SIZE 0xFFFFFFF7
  2194. #define S_028010_ARRAY_MODE(x) (((x) & 0xF) << 15)
  2195. #define G_028010_ARRAY_MODE(x) (((x) >> 15) & 0xF)
  2196. #define C_028010_ARRAY_MODE 0xFFF87FFF
  2197. #define V_028010_ARRAY_1D_TILED_THIN1 0x00000002
  2198. #define V_028010_ARRAY_2D_TILED_THIN1 0x00000004
  2199. #define S_028010_TILE_SURFACE_ENABLE(x) (((x) & 0x1) << 25)
  2200. #define G_028010_TILE_SURFACE_ENABLE(x) (((x) >> 25) & 0x1)
  2201. #define C_028010_TILE_SURFACE_ENABLE 0xFDFFFFFF
  2202. #define S_028010_TILE_COMPACT(x) (((x) & 0x1) << 26)
  2203. #define G_028010_TILE_COMPACT(x) (((x) >> 26) & 0x1)
  2204. #define C_028010_TILE_COMPACT 0xFBFFFFFF
  2205. #define S_028010_ZRANGE_PRECISION(x) (((x) & 0x1) << 31)
  2206. #define G_028010_ZRANGE_PRECISION(x) (((x) >> 31) & 0x1)
  2207. #define C_028010_ZRANGE_PRECISION 0x7FFFFFFF
  2208. #define R_028000_DB_DEPTH_SIZE 0x028000
  2209. #define S_028000_PITCH_TILE_MAX(x) (((x) & 0x3FF) << 0)
  2210. #define G_028000_PITCH_TILE_MAX(x) (((x) >> 0) & 0x3FF)
  2211. #define C_028000_PITCH_TILE_MAX 0xFFFFFC00
  2212. #define S_028000_SLICE_TILE_MAX(x) (((x) & 0xFFFFF) << 10)
  2213. #define G_028000_SLICE_TILE_MAX(x) (((x) >> 10) & 0xFFFFF)
  2214. #define C_028000_SLICE_TILE_MAX 0xC00003FF
  2215. #define R_028004_DB_DEPTH_VIEW 0x028004
  2216. #define S_028004_SLICE_START(x) (((x) & 0x7FF) << 0)
  2217. #define G_028004_SLICE_START(x) (((x) >> 0) & 0x7FF)
  2218. #define C_028004_SLICE_START 0xFFFFF800
  2219. #define S_028004_SLICE_MAX(x) (((x) & 0x7FF) << 13)
  2220. #define G_028004_SLICE_MAX(x) (((x) >> 13) & 0x7FF)
  2221. #define C_028004_SLICE_MAX 0xFF001FFF
  2222. #define R_028800_DB_DEPTH_CONTROL 0x028800
  2223. #define S_028800_STENCIL_ENABLE(x) (((x) & 0x1) << 0)
  2224. #define G_028800_STENCIL_ENABLE(x) (((x) >> 0) & 0x1)
  2225. #define C_028800_STENCIL_ENABLE 0xFFFFFFFE
  2226. #define S_028800_Z_ENABLE(x) (((x) & 0x1) << 1)
  2227. #define G_028800_Z_ENABLE(x) (((x) >> 1) & 0x1)
  2228. #define C_028800_Z_ENABLE 0xFFFFFFFD
  2229. #define S_028800_Z_WRITE_ENABLE(x) (((x) & 0x1) << 2)
  2230. #define G_028800_Z_WRITE_ENABLE(x) (((x) >> 2) & 0x1)
  2231. #define C_028800_Z_WRITE_ENABLE 0xFFFFFFFB
  2232. #define S_028800_ZFUNC(x) (((x) & 0x7) << 4)
  2233. #define G_028800_ZFUNC(x) (((x) >> 4) & 0x7)
  2234. #define C_028800_ZFUNC 0xFFFFFF8F
  2235. #define S_028800_BACKFACE_ENABLE(x) (((x) & 0x1) << 7)
  2236. #define G_028800_BACKFACE_ENABLE(x) (((x) >> 7) & 0x1)
  2237. #define C_028800_BACKFACE_ENABLE 0xFFFFFF7F
  2238. #define S_028800_STENCILFUNC(x) (((x) & 0x7) << 8)
  2239. #define G_028800_STENCILFUNC(x) (((x) >> 8) & 0x7)
  2240. #define C_028800_STENCILFUNC 0xFFFFF8FF
  2241. #define S_028800_STENCILFAIL(x) (((x) & 0x7) << 11)
  2242. #define G_028800_STENCILFAIL(x) (((x) >> 11) & 0x7)
  2243. #define C_028800_STENCILFAIL 0xFFFFC7FF
  2244. #define S_028800_STENCILZPASS(x) (((x) & 0x7) << 14)
  2245. #define G_028800_STENCILZPASS(x) (((x) >> 14) & 0x7)
  2246. #define C_028800_STENCILZPASS 0xFFFE3FFF
  2247. #define S_028800_STENCILZFAIL(x) (((x) & 0x7) << 17)
  2248. #define G_028800_STENCILZFAIL(x) (((x) >> 17) & 0x7)
  2249. #define C_028800_STENCILZFAIL 0xFFF1FFFF
  2250. #define S_028800_STENCILFUNC_BF(x) (((x) & 0x7) << 20)
  2251. #define G_028800_STENCILFUNC_BF(x) (((x) >> 20) & 0x7)
  2252. #define C_028800_STENCILFUNC_BF 0xFF8FFFFF
  2253. #define S_028800_STENCILFAIL_BF(x) (((x) & 0x7) << 23)
  2254. #define G_028800_STENCILFAIL_BF(x) (((x) >> 23) & 0x7)
  2255. #define C_028800_STENCILFAIL_BF 0xFC7FFFFF
  2256. #define S_028800_STENCILZPASS_BF(x) (((x) & 0x7) << 26)
  2257. #define G_028800_STENCILZPASS_BF(x) (((x) >> 26) & 0x7)
  2258. #define C_028800_STENCILZPASS_BF 0xE3FFFFFF
  2259. #define S_028800_STENCILZFAIL_BF(x) (((x) & 0x7) << 29)
  2260. #define G_028800_STENCILZFAIL_BF(x) (((x) >> 29) & 0x7)
  2261. #define C_028800_STENCILZFAIL_BF 0x1FFFFFFF
  2262. #endif