btc_dpm.c 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250
  1. /*
  2. * Copyright 2011 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * Authors: Alex Deucher
  23. */
  24. #include "drmP.h"
  25. #include "radeon.h"
  26. #include "btcd.h"
  27. #include "r600_dpm.h"
  28. #include "cypress_dpm.h"
  29. #include "btc_dpm.h"
  30. #include "atom.h"
  31. #define MC_CG_ARB_FREQ_F0 0x0a
  32. #define MC_CG_ARB_FREQ_F1 0x0b
  33. #define MC_CG_ARB_FREQ_F2 0x0c
  34. #define MC_CG_ARB_FREQ_F3 0x0d
  35. #define MC_CG_SEQ_DRAMCONF_S0 0x05
  36. #define MC_CG_SEQ_DRAMCONF_S1 0x06
  37. #define MC_CG_SEQ_YCLK_SUSPEND 0x04
  38. #define MC_CG_SEQ_YCLK_RESUME 0x0a
  39. #define SMC_RAM_END 0x8000
  40. #ifndef BTC_MGCG_SEQUENCE
  41. #define BTC_MGCG_SEQUENCE 300
  42. struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
  43. struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
  44. struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
  45. //********* BARTS **************//
  46. static const u32 barts_cgcg_cgls_default[] =
  47. {
  48. /* Register, Value, Mask bits */
  49. 0x000008f8, 0x00000010, 0xffffffff,
  50. 0x000008fc, 0x00000000, 0xffffffff,
  51. 0x000008f8, 0x00000011, 0xffffffff,
  52. 0x000008fc, 0x00000000, 0xffffffff,
  53. 0x000008f8, 0x00000012, 0xffffffff,
  54. 0x000008fc, 0x00000000, 0xffffffff,
  55. 0x000008f8, 0x00000013, 0xffffffff,
  56. 0x000008fc, 0x00000000, 0xffffffff,
  57. 0x000008f8, 0x00000014, 0xffffffff,
  58. 0x000008fc, 0x00000000, 0xffffffff,
  59. 0x000008f8, 0x00000015, 0xffffffff,
  60. 0x000008fc, 0x00000000, 0xffffffff,
  61. 0x000008f8, 0x00000016, 0xffffffff,
  62. 0x000008fc, 0x00000000, 0xffffffff,
  63. 0x000008f8, 0x00000017, 0xffffffff,
  64. 0x000008fc, 0x00000000, 0xffffffff,
  65. 0x000008f8, 0x00000018, 0xffffffff,
  66. 0x000008fc, 0x00000000, 0xffffffff,
  67. 0x000008f8, 0x00000019, 0xffffffff,
  68. 0x000008fc, 0x00000000, 0xffffffff,
  69. 0x000008f8, 0x0000001a, 0xffffffff,
  70. 0x000008fc, 0x00000000, 0xffffffff,
  71. 0x000008f8, 0x0000001b, 0xffffffff,
  72. 0x000008fc, 0x00000000, 0xffffffff,
  73. 0x000008f8, 0x00000020, 0xffffffff,
  74. 0x000008fc, 0x00000000, 0xffffffff,
  75. 0x000008f8, 0x00000021, 0xffffffff,
  76. 0x000008fc, 0x00000000, 0xffffffff,
  77. 0x000008f8, 0x00000022, 0xffffffff,
  78. 0x000008fc, 0x00000000, 0xffffffff,
  79. 0x000008f8, 0x00000023, 0xffffffff,
  80. 0x000008fc, 0x00000000, 0xffffffff,
  81. 0x000008f8, 0x00000024, 0xffffffff,
  82. 0x000008fc, 0x00000000, 0xffffffff,
  83. 0x000008f8, 0x00000025, 0xffffffff,
  84. 0x000008fc, 0x00000000, 0xffffffff,
  85. 0x000008f8, 0x00000026, 0xffffffff,
  86. 0x000008fc, 0x00000000, 0xffffffff,
  87. 0x000008f8, 0x00000027, 0xffffffff,
  88. 0x000008fc, 0x00000000, 0xffffffff,
  89. 0x000008f8, 0x00000028, 0xffffffff,
  90. 0x000008fc, 0x00000000, 0xffffffff,
  91. 0x000008f8, 0x00000029, 0xffffffff,
  92. 0x000008fc, 0x00000000, 0xffffffff,
  93. 0x000008f8, 0x0000002a, 0xffffffff,
  94. 0x000008fc, 0x00000000, 0xffffffff,
  95. 0x000008f8, 0x0000002b, 0xffffffff,
  96. 0x000008fc, 0x00000000, 0xffffffff
  97. };
  98. #define BARTS_CGCG_CGLS_DEFAULT_LENGTH sizeof(barts_cgcg_cgls_default) / (3 * sizeof(u32))
  99. static const u32 barts_cgcg_cgls_disable[] =
  100. {
  101. 0x000008f8, 0x00000010, 0xffffffff,
  102. 0x000008fc, 0xffffffff, 0xffffffff,
  103. 0x000008f8, 0x00000011, 0xffffffff,
  104. 0x000008fc, 0xffffffff, 0xffffffff,
  105. 0x000008f8, 0x00000012, 0xffffffff,
  106. 0x000008fc, 0xffffffff, 0xffffffff,
  107. 0x000008f8, 0x00000013, 0xffffffff,
  108. 0x000008fc, 0xffffffff, 0xffffffff,
  109. 0x000008f8, 0x00000014, 0xffffffff,
  110. 0x000008fc, 0xffffffff, 0xffffffff,
  111. 0x000008f8, 0x00000015, 0xffffffff,
  112. 0x000008fc, 0xffffffff, 0xffffffff,
  113. 0x000008f8, 0x00000016, 0xffffffff,
  114. 0x000008fc, 0xffffffff, 0xffffffff,
  115. 0x000008f8, 0x00000017, 0xffffffff,
  116. 0x000008fc, 0xffffffff, 0xffffffff,
  117. 0x000008f8, 0x00000018, 0xffffffff,
  118. 0x000008fc, 0xffffffff, 0xffffffff,
  119. 0x000008f8, 0x00000019, 0xffffffff,
  120. 0x000008fc, 0xffffffff, 0xffffffff,
  121. 0x000008f8, 0x0000001a, 0xffffffff,
  122. 0x000008fc, 0xffffffff, 0xffffffff,
  123. 0x000008f8, 0x0000001b, 0xffffffff,
  124. 0x000008fc, 0xffffffff, 0xffffffff,
  125. 0x000008f8, 0x00000020, 0xffffffff,
  126. 0x000008fc, 0x00000000, 0xffffffff,
  127. 0x000008f8, 0x00000021, 0xffffffff,
  128. 0x000008fc, 0x00000000, 0xffffffff,
  129. 0x000008f8, 0x00000022, 0xffffffff,
  130. 0x000008fc, 0x00000000, 0xffffffff,
  131. 0x000008f8, 0x00000023, 0xffffffff,
  132. 0x000008fc, 0x00000000, 0xffffffff,
  133. 0x000008f8, 0x00000024, 0xffffffff,
  134. 0x000008fc, 0x00000000, 0xffffffff,
  135. 0x000008f8, 0x00000025, 0xffffffff,
  136. 0x000008fc, 0x00000000, 0xffffffff,
  137. 0x000008f8, 0x00000026, 0xffffffff,
  138. 0x000008fc, 0x00000000, 0xffffffff,
  139. 0x000008f8, 0x00000027, 0xffffffff,
  140. 0x000008fc, 0x00000000, 0xffffffff,
  141. 0x000008f8, 0x00000028, 0xffffffff,
  142. 0x000008fc, 0x00000000, 0xffffffff,
  143. 0x000008f8, 0x00000029, 0xffffffff,
  144. 0x000008fc, 0x00000000, 0xffffffff,
  145. 0x000008f8, 0x0000002a, 0xffffffff,
  146. 0x000008fc, 0x00000000, 0xffffffff,
  147. 0x000008f8, 0x0000002b, 0xffffffff,
  148. 0x000008fc, 0x00000000, 0xffffffff,
  149. 0x00000644, 0x000f7912, 0x001f4180,
  150. 0x00000644, 0x000f3812, 0x001f4180
  151. };
  152. #define BARTS_CGCG_CGLS_DISABLE_LENGTH sizeof(barts_cgcg_cgls_disable) / (3 * sizeof(u32))
  153. static const u32 barts_cgcg_cgls_enable[] =
  154. {
  155. /* 0x0000c124, 0x84180000, 0x00180000, */
  156. 0x00000644, 0x000f7892, 0x001f4080,
  157. 0x000008f8, 0x00000010, 0xffffffff,
  158. 0x000008fc, 0x00000000, 0xffffffff,
  159. 0x000008f8, 0x00000011, 0xffffffff,
  160. 0x000008fc, 0x00000000, 0xffffffff,
  161. 0x000008f8, 0x00000012, 0xffffffff,
  162. 0x000008fc, 0x00000000, 0xffffffff,
  163. 0x000008f8, 0x00000013, 0xffffffff,
  164. 0x000008fc, 0x00000000, 0xffffffff,
  165. 0x000008f8, 0x00000014, 0xffffffff,
  166. 0x000008fc, 0x00000000, 0xffffffff,
  167. 0x000008f8, 0x00000015, 0xffffffff,
  168. 0x000008fc, 0x00000000, 0xffffffff,
  169. 0x000008f8, 0x00000016, 0xffffffff,
  170. 0x000008fc, 0x00000000, 0xffffffff,
  171. 0x000008f8, 0x00000017, 0xffffffff,
  172. 0x000008fc, 0x00000000, 0xffffffff,
  173. 0x000008f8, 0x00000018, 0xffffffff,
  174. 0x000008fc, 0x00000000, 0xffffffff,
  175. 0x000008f8, 0x00000019, 0xffffffff,
  176. 0x000008fc, 0x00000000, 0xffffffff,
  177. 0x000008f8, 0x0000001a, 0xffffffff,
  178. 0x000008fc, 0x00000000, 0xffffffff,
  179. 0x000008f8, 0x0000001b, 0xffffffff,
  180. 0x000008fc, 0x00000000, 0xffffffff,
  181. 0x000008f8, 0x00000020, 0xffffffff,
  182. 0x000008fc, 0xffffffff, 0xffffffff,
  183. 0x000008f8, 0x00000021, 0xffffffff,
  184. 0x000008fc, 0xffffffff, 0xffffffff,
  185. 0x000008f8, 0x00000022, 0xffffffff,
  186. 0x000008fc, 0xffffffff, 0xffffffff,
  187. 0x000008f8, 0x00000023, 0xffffffff,
  188. 0x000008fc, 0xffffffff, 0xffffffff,
  189. 0x000008f8, 0x00000024, 0xffffffff,
  190. 0x000008fc, 0xffffffff, 0xffffffff,
  191. 0x000008f8, 0x00000025, 0xffffffff,
  192. 0x000008fc, 0xffffffff, 0xffffffff,
  193. 0x000008f8, 0x00000026, 0xffffffff,
  194. 0x000008fc, 0xffffffff, 0xffffffff,
  195. 0x000008f8, 0x00000027, 0xffffffff,
  196. 0x000008fc, 0xffffffff, 0xffffffff,
  197. 0x000008f8, 0x00000028, 0xffffffff,
  198. 0x000008fc, 0xffffffff, 0xffffffff,
  199. 0x000008f8, 0x00000029, 0xffffffff,
  200. 0x000008fc, 0xffffffff, 0xffffffff,
  201. 0x000008f8, 0x0000002a, 0xffffffff,
  202. 0x000008fc, 0xffffffff, 0xffffffff,
  203. 0x000008f8, 0x0000002b, 0xffffffff,
  204. 0x000008fc, 0xffffffff, 0xffffffff
  205. };
  206. #define BARTS_CGCG_CGLS_ENABLE_LENGTH sizeof(barts_cgcg_cgls_enable) / (3 * sizeof(u32))
  207. static const u32 barts_mgcg_default[] =
  208. {
  209. 0x0000802c, 0xc0000000, 0xffffffff,
  210. 0x00005448, 0x00000100, 0xffffffff,
  211. 0x000055e4, 0x00600100, 0xffffffff,
  212. 0x0000160c, 0x00000100, 0xffffffff,
  213. 0x0000c164, 0x00000100, 0xffffffff,
  214. 0x00008a18, 0x00000100, 0xffffffff,
  215. 0x0000897c, 0x06000100, 0xffffffff,
  216. 0x00008b28, 0x00000100, 0xffffffff,
  217. 0x00009144, 0x00000100, 0xffffffff,
  218. 0x00009a60, 0x00000100, 0xffffffff,
  219. 0x00009868, 0x00000100, 0xffffffff,
  220. 0x00008d58, 0x00000100, 0xffffffff,
  221. 0x00009510, 0x00000100, 0xffffffff,
  222. 0x0000949c, 0x00000100, 0xffffffff,
  223. 0x00009654, 0x00000100, 0xffffffff,
  224. 0x00009030, 0x00000100, 0xffffffff,
  225. 0x00009034, 0x00000100, 0xffffffff,
  226. 0x00009038, 0x00000100, 0xffffffff,
  227. 0x0000903c, 0x00000100, 0xffffffff,
  228. 0x00009040, 0x00000100, 0xffffffff,
  229. 0x0000a200, 0x00000100, 0xffffffff,
  230. 0x0000a204, 0x00000100, 0xffffffff,
  231. 0x0000a208, 0x00000100, 0xffffffff,
  232. 0x0000a20c, 0x00000100, 0xffffffff,
  233. 0x0000977c, 0x00000100, 0xffffffff,
  234. 0x00003f80, 0x00000100, 0xffffffff,
  235. 0x0000a210, 0x00000100, 0xffffffff,
  236. 0x0000a214, 0x00000100, 0xffffffff,
  237. 0x000004d8, 0x00000100, 0xffffffff,
  238. 0x00009784, 0x00000100, 0xffffffff,
  239. 0x00009698, 0x00000100, 0xffffffff,
  240. 0x000004d4, 0x00000200, 0xffffffff,
  241. 0x000004d0, 0x00000000, 0xffffffff,
  242. 0x000030cc, 0x00000100, 0xffffffff,
  243. 0x0000d0c0, 0xff000100, 0xffffffff,
  244. 0x0000802c, 0x40000000, 0xffffffff,
  245. 0x0000915c, 0x00010000, 0xffffffff,
  246. 0x00009160, 0x00030002, 0xffffffff,
  247. 0x00009164, 0x00050004, 0xffffffff,
  248. 0x00009168, 0x00070006, 0xffffffff,
  249. 0x00009178, 0x00070000, 0xffffffff,
  250. 0x0000917c, 0x00030002, 0xffffffff,
  251. 0x00009180, 0x00050004, 0xffffffff,
  252. 0x0000918c, 0x00010006, 0xffffffff,
  253. 0x00009190, 0x00090008, 0xffffffff,
  254. 0x00009194, 0x00070000, 0xffffffff,
  255. 0x00009198, 0x00030002, 0xffffffff,
  256. 0x0000919c, 0x00050004, 0xffffffff,
  257. 0x000091a8, 0x00010006, 0xffffffff,
  258. 0x000091ac, 0x00090008, 0xffffffff,
  259. 0x000091b0, 0x00070000, 0xffffffff,
  260. 0x000091b4, 0x00030002, 0xffffffff,
  261. 0x000091b8, 0x00050004, 0xffffffff,
  262. 0x000091c4, 0x00010006, 0xffffffff,
  263. 0x000091c8, 0x00090008, 0xffffffff,
  264. 0x000091cc, 0x00070000, 0xffffffff,
  265. 0x000091d0, 0x00030002, 0xffffffff,
  266. 0x000091d4, 0x00050004, 0xffffffff,
  267. 0x000091e0, 0x00010006, 0xffffffff,
  268. 0x000091e4, 0x00090008, 0xffffffff,
  269. 0x000091e8, 0x00000000, 0xffffffff,
  270. 0x000091ec, 0x00070000, 0xffffffff,
  271. 0x000091f0, 0x00030002, 0xffffffff,
  272. 0x000091f4, 0x00050004, 0xffffffff,
  273. 0x00009200, 0x00010006, 0xffffffff,
  274. 0x00009204, 0x00090008, 0xffffffff,
  275. 0x00009208, 0x00070000, 0xffffffff,
  276. 0x0000920c, 0x00030002, 0xffffffff,
  277. 0x00009210, 0x00050004, 0xffffffff,
  278. 0x0000921c, 0x00010006, 0xffffffff,
  279. 0x00009220, 0x00090008, 0xffffffff,
  280. 0x00009224, 0x00070000, 0xffffffff,
  281. 0x00009228, 0x00030002, 0xffffffff,
  282. 0x0000922c, 0x00050004, 0xffffffff,
  283. 0x00009238, 0x00010006, 0xffffffff,
  284. 0x0000923c, 0x00090008, 0xffffffff,
  285. 0x00009294, 0x00000000, 0xffffffff,
  286. 0x0000802c, 0x40010000, 0xffffffff,
  287. 0x0000915c, 0x00010000, 0xffffffff,
  288. 0x00009160, 0x00030002, 0xffffffff,
  289. 0x00009164, 0x00050004, 0xffffffff,
  290. 0x00009168, 0x00070006, 0xffffffff,
  291. 0x00009178, 0x00070000, 0xffffffff,
  292. 0x0000917c, 0x00030002, 0xffffffff,
  293. 0x00009180, 0x00050004, 0xffffffff,
  294. 0x0000918c, 0x00010006, 0xffffffff,
  295. 0x00009190, 0x00090008, 0xffffffff,
  296. 0x00009194, 0x00070000, 0xffffffff,
  297. 0x00009198, 0x00030002, 0xffffffff,
  298. 0x0000919c, 0x00050004, 0xffffffff,
  299. 0x000091a8, 0x00010006, 0xffffffff,
  300. 0x000091ac, 0x00090008, 0xffffffff,
  301. 0x000091b0, 0x00070000, 0xffffffff,
  302. 0x000091b4, 0x00030002, 0xffffffff,
  303. 0x000091b8, 0x00050004, 0xffffffff,
  304. 0x000091c4, 0x00010006, 0xffffffff,
  305. 0x000091c8, 0x00090008, 0xffffffff,
  306. 0x000091cc, 0x00070000, 0xffffffff,
  307. 0x000091d0, 0x00030002, 0xffffffff,
  308. 0x000091d4, 0x00050004, 0xffffffff,
  309. 0x000091e0, 0x00010006, 0xffffffff,
  310. 0x000091e4, 0x00090008, 0xffffffff,
  311. 0x000091e8, 0x00000000, 0xffffffff,
  312. 0x000091ec, 0x00070000, 0xffffffff,
  313. 0x000091f0, 0x00030002, 0xffffffff,
  314. 0x000091f4, 0x00050004, 0xffffffff,
  315. 0x00009200, 0x00010006, 0xffffffff,
  316. 0x00009204, 0x00090008, 0xffffffff,
  317. 0x00009208, 0x00070000, 0xffffffff,
  318. 0x0000920c, 0x00030002, 0xffffffff,
  319. 0x00009210, 0x00050004, 0xffffffff,
  320. 0x0000921c, 0x00010006, 0xffffffff,
  321. 0x00009220, 0x00090008, 0xffffffff,
  322. 0x00009224, 0x00070000, 0xffffffff,
  323. 0x00009228, 0x00030002, 0xffffffff,
  324. 0x0000922c, 0x00050004, 0xffffffff,
  325. 0x00009238, 0x00010006, 0xffffffff,
  326. 0x0000923c, 0x00090008, 0xffffffff,
  327. 0x00009294, 0x00000000, 0xffffffff,
  328. 0x0000802c, 0xc0000000, 0xffffffff,
  329. 0x000008f8, 0x00000010, 0xffffffff,
  330. 0x000008fc, 0x00000000, 0xffffffff,
  331. 0x000008f8, 0x00000011, 0xffffffff,
  332. 0x000008fc, 0x00000000, 0xffffffff,
  333. 0x000008f8, 0x00000012, 0xffffffff,
  334. 0x000008fc, 0x00000000, 0xffffffff,
  335. 0x000008f8, 0x00000013, 0xffffffff,
  336. 0x000008fc, 0x00000000, 0xffffffff,
  337. 0x000008f8, 0x00000014, 0xffffffff,
  338. 0x000008fc, 0x00000000, 0xffffffff,
  339. 0x000008f8, 0x00000015, 0xffffffff,
  340. 0x000008fc, 0x00000000, 0xffffffff,
  341. 0x000008f8, 0x00000016, 0xffffffff,
  342. 0x000008fc, 0x00000000, 0xffffffff,
  343. 0x000008f8, 0x00000017, 0xffffffff,
  344. 0x000008fc, 0x00000000, 0xffffffff,
  345. 0x000008f8, 0x00000018, 0xffffffff,
  346. 0x000008fc, 0x00000000, 0xffffffff,
  347. 0x000008f8, 0x00000019, 0xffffffff,
  348. 0x000008fc, 0x00000000, 0xffffffff,
  349. 0x000008f8, 0x0000001a, 0xffffffff,
  350. 0x000008fc, 0x00000000, 0xffffffff,
  351. 0x000008f8, 0x0000001b, 0xffffffff,
  352. 0x000008fc, 0x00000000, 0xffffffff
  353. };
  354. #define BARTS_MGCG_DEFAULT_LENGTH sizeof(barts_mgcg_default) / (3 * sizeof(u32))
  355. static const u32 barts_mgcg_disable[] =
  356. {
  357. 0x0000802c, 0xc0000000, 0xffffffff,
  358. 0x000008f8, 0x00000000, 0xffffffff,
  359. 0x000008fc, 0xffffffff, 0xffffffff,
  360. 0x000008f8, 0x00000001, 0xffffffff,
  361. 0x000008fc, 0xffffffff, 0xffffffff,
  362. 0x000008f8, 0x00000002, 0xffffffff,
  363. 0x000008fc, 0xffffffff, 0xffffffff,
  364. 0x000008f8, 0x00000003, 0xffffffff,
  365. 0x000008fc, 0xffffffff, 0xffffffff,
  366. 0x00009150, 0x00600000, 0xffffffff
  367. };
  368. #define BARTS_MGCG_DISABLE_LENGTH sizeof(barts_mgcg_disable) / (3 * sizeof(u32))
  369. static const u32 barts_mgcg_enable[] =
  370. {
  371. 0x0000802c, 0xc0000000, 0xffffffff,
  372. 0x000008f8, 0x00000000, 0xffffffff,
  373. 0x000008fc, 0x00000000, 0xffffffff,
  374. 0x000008f8, 0x00000001, 0xffffffff,
  375. 0x000008fc, 0x00000000, 0xffffffff,
  376. 0x000008f8, 0x00000002, 0xffffffff,
  377. 0x000008fc, 0x00000000, 0xffffffff,
  378. 0x000008f8, 0x00000003, 0xffffffff,
  379. 0x000008fc, 0x00000000, 0xffffffff,
  380. 0x00009150, 0x81944000, 0xffffffff
  381. };
  382. #define BARTS_MGCG_ENABLE_LENGTH sizeof(barts_mgcg_enable) / (3 * sizeof(u32))
  383. //********* CAICOS **************//
  384. static const u32 caicos_cgcg_cgls_default[] =
  385. {
  386. 0x000008f8, 0x00000010, 0xffffffff,
  387. 0x000008fc, 0x00000000, 0xffffffff,
  388. 0x000008f8, 0x00000011, 0xffffffff,
  389. 0x000008fc, 0x00000000, 0xffffffff,
  390. 0x000008f8, 0x00000012, 0xffffffff,
  391. 0x000008fc, 0x00000000, 0xffffffff,
  392. 0x000008f8, 0x00000013, 0xffffffff,
  393. 0x000008fc, 0x00000000, 0xffffffff,
  394. 0x000008f8, 0x00000014, 0xffffffff,
  395. 0x000008fc, 0x00000000, 0xffffffff,
  396. 0x000008f8, 0x00000015, 0xffffffff,
  397. 0x000008fc, 0x00000000, 0xffffffff,
  398. 0x000008f8, 0x00000016, 0xffffffff,
  399. 0x000008fc, 0x00000000, 0xffffffff,
  400. 0x000008f8, 0x00000017, 0xffffffff,
  401. 0x000008fc, 0x00000000, 0xffffffff,
  402. 0x000008f8, 0x00000018, 0xffffffff,
  403. 0x000008fc, 0x00000000, 0xffffffff,
  404. 0x000008f8, 0x00000019, 0xffffffff,
  405. 0x000008fc, 0x00000000, 0xffffffff,
  406. 0x000008f8, 0x0000001a, 0xffffffff,
  407. 0x000008fc, 0x00000000, 0xffffffff,
  408. 0x000008f8, 0x0000001b, 0xffffffff,
  409. 0x000008fc, 0x00000000, 0xffffffff,
  410. 0x000008f8, 0x00000020, 0xffffffff,
  411. 0x000008fc, 0x00000000, 0xffffffff,
  412. 0x000008f8, 0x00000021, 0xffffffff,
  413. 0x000008fc, 0x00000000, 0xffffffff,
  414. 0x000008f8, 0x00000022, 0xffffffff,
  415. 0x000008fc, 0x00000000, 0xffffffff,
  416. 0x000008f8, 0x00000023, 0xffffffff,
  417. 0x000008fc, 0x00000000, 0xffffffff,
  418. 0x000008f8, 0x00000024, 0xffffffff,
  419. 0x000008fc, 0x00000000, 0xffffffff,
  420. 0x000008f8, 0x00000025, 0xffffffff,
  421. 0x000008fc, 0x00000000, 0xffffffff,
  422. 0x000008f8, 0x00000026, 0xffffffff,
  423. 0x000008fc, 0x00000000, 0xffffffff,
  424. 0x000008f8, 0x00000027, 0xffffffff,
  425. 0x000008fc, 0x00000000, 0xffffffff,
  426. 0x000008f8, 0x00000028, 0xffffffff,
  427. 0x000008fc, 0x00000000, 0xffffffff,
  428. 0x000008f8, 0x00000029, 0xffffffff,
  429. 0x000008fc, 0x00000000, 0xffffffff,
  430. 0x000008f8, 0x0000002a, 0xffffffff,
  431. 0x000008fc, 0x00000000, 0xffffffff,
  432. 0x000008f8, 0x0000002b, 0xffffffff,
  433. 0x000008fc, 0x00000000, 0xffffffff
  434. };
  435. #define CAICOS_CGCG_CGLS_DEFAULT_LENGTH sizeof(caicos_cgcg_cgls_default) / (3 * sizeof(u32))
  436. static const u32 caicos_cgcg_cgls_disable[] =
  437. {
  438. 0x000008f8, 0x00000010, 0xffffffff,
  439. 0x000008fc, 0xffffffff, 0xffffffff,
  440. 0x000008f8, 0x00000011, 0xffffffff,
  441. 0x000008fc, 0xffffffff, 0xffffffff,
  442. 0x000008f8, 0x00000012, 0xffffffff,
  443. 0x000008fc, 0xffffffff, 0xffffffff,
  444. 0x000008f8, 0x00000013, 0xffffffff,
  445. 0x000008fc, 0xffffffff, 0xffffffff,
  446. 0x000008f8, 0x00000014, 0xffffffff,
  447. 0x000008fc, 0xffffffff, 0xffffffff,
  448. 0x000008f8, 0x00000015, 0xffffffff,
  449. 0x000008fc, 0xffffffff, 0xffffffff,
  450. 0x000008f8, 0x00000016, 0xffffffff,
  451. 0x000008fc, 0xffffffff, 0xffffffff,
  452. 0x000008f8, 0x00000017, 0xffffffff,
  453. 0x000008fc, 0xffffffff, 0xffffffff,
  454. 0x000008f8, 0x00000018, 0xffffffff,
  455. 0x000008fc, 0xffffffff, 0xffffffff,
  456. 0x000008f8, 0x00000019, 0xffffffff,
  457. 0x000008fc, 0xffffffff, 0xffffffff,
  458. 0x000008f8, 0x0000001a, 0xffffffff,
  459. 0x000008fc, 0xffffffff, 0xffffffff,
  460. 0x000008f8, 0x0000001b, 0xffffffff,
  461. 0x000008fc, 0xffffffff, 0xffffffff,
  462. 0x000008f8, 0x00000020, 0xffffffff,
  463. 0x000008fc, 0x00000000, 0xffffffff,
  464. 0x000008f8, 0x00000021, 0xffffffff,
  465. 0x000008fc, 0x00000000, 0xffffffff,
  466. 0x000008f8, 0x00000022, 0xffffffff,
  467. 0x000008fc, 0x00000000, 0xffffffff,
  468. 0x000008f8, 0x00000023, 0xffffffff,
  469. 0x000008fc, 0x00000000, 0xffffffff,
  470. 0x000008f8, 0x00000024, 0xffffffff,
  471. 0x000008fc, 0x00000000, 0xffffffff,
  472. 0x000008f8, 0x00000025, 0xffffffff,
  473. 0x000008fc, 0x00000000, 0xffffffff,
  474. 0x000008f8, 0x00000026, 0xffffffff,
  475. 0x000008fc, 0x00000000, 0xffffffff,
  476. 0x000008f8, 0x00000027, 0xffffffff,
  477. 0x000008fc, 0x00000000, 0xffffffff,
  478. 0x000008f8, 0x00000028, 0xffffffff,
  479. 0x000008fc, 0x00000000, 0xffffffff,
  480. 0x000008f8, 0x00000029, 0xffffffff,
  481. 0x000008fc, 0x00000000, 0xffffffff,
  482. 0x000008f8, 0x0000002a, 0xffffffff,
  483. 0x000008fc, 0x00000000, 0xffffffff,
  484. 0x000008f8, 0x0000002b, 0xffffffff,
  485. 0x000008fc, 0x00000000, 0xffffffff,
  486. 0x00000644, 0x000f7912, 0x001f4180,
  487. 0x00000644, 0x000f3812, 0x001f4180
  488. };
  489. #define CAICOS_CGCG_CGLS_DISABLE_LENGTH sizeof(caicos_cgcg_cgls_disable) / (3 * sizeof(u32))
  490. static const u32 caicos_cgcg_cgls_enable[] =
  491. {
  492. /* 0x0000c124, 0x84180000, 0x00180000, */
  493. 0x00000644, 0x000f7892, 0x001f4080,
  494. 0x000008f8, 0x00000010, 0xffffffff,
  495. 0x000008fc, 0x00000000, 0xffffffff,
  496. 0x000008f8, 0x00000011, 0xffffffff,
  497. 0x000008fc, 0x00000000, 0xffffffff,
  498. 0x000008f8, 0x00000012, 0xffffffff,
  499. 0x000008fc, 0x00000000, 0xffffffff,
  500. 0x000008f8, 0x00000013, 0xffffffff,
  501. 0x000008fc, 0x00000000, 0xffffffff,
  502. 0x000008f8, 0x00000014, 0xffffffff,
  503. 0x000008fc, 0x00000000, 0xffffffff,
  504. 0x000008f8, 0x00000015, 0xffffffff,
  505. 0x000008fc, 0x00000000, 0xffffffff,
  506. 0x000008f8, 0x00000016, 0xffffffff,
  507. 0x000008fc, 0x00000000, 0xffffffff,
  508. 0x000008f8, 0x00000017, 0xffffffff,
  509. 0x000008fc, 0x00000000, 0xffffffff,
  510. 0x000008f8, 0x00000018, 0xffffffff,
  511. 0x000008fc, 0x00000000, 0xffffffff,
  512. 0x000008f8, 0x00000019, 0xffffffff,
  513. 0x000008fc, 0x00000000, 0xffffffff,
  514. 0x000008f8, 0x0000001a, 0xffffffff,
  515. 0x000008fc, 0x00000000, 0xffffffff,
  516. 0x000008f8, 0x0000001b, 0xffffffff,
  517. 0x000008fc, 0x00000000, 0xffffffff,
  518. 0x000008f8, 0x00000020, 0xffffffff,
  519. 0x000008fc, 0xffffffff, 0xffffffff,
  520. 0x000008f8, 0x00000021, 0xffffffff,
  521. 0x000008fc, 0xffffffff, 0xffffffff,
  522. 0x000008f8, 0x00000022, 0xffffffff,
  523. 0x000008fc, 0xffffffff, 0xffffffff,
  524. 0x000008f8, 0x00000023, 0xffffffff,
  525. 0x000008fc, 0xffffffff, 0xffffffff,
  526. 0x000008f8, 0x00000024, 0xffffffff,
  527. 0x000008fc, 0xffffffff, 0xffffffff,
  528. 0x000008f8, 0x00000025, 0xffffffff,
  529. 0x000008fc, 0xffffffff, 0xffffffff,
  530. 0x000008f8, 0x00000026, 0xffffffff,
  531. 0x000008fc, 0xffffffff, 0xffffffff,
  532. 0x000008f8, 0x00000027, 0xffffffff,
  533. 0x000008fc, 0xffffffff, 0xffffffff,
  534. 0x000008f8, 0x00000028, 0xffffffff,
  535. 0x000008fc, 0xffffffff, 0xffffffff,
  536. 0x000008f8, 0x00000029, 0xffffffff,
  537. 0x000008fc, 0xffffffff, 0xffffffff,
  538. 0x000008f8, 0x0000002a, 0xffffffff,
  539. 0x000008fc, 0xffffffff, 0xffffffff,
  540. 0x000008f8, 0x0000002b, 0xffffffff,
  541. 0x000008fc, 0xffffffff, 0xffffffff
  542. };
  543. #define CAICOS_CGCG_CGLS_ENABLE_LENGTH sizeof(caicos_cgcg_cgls_enable) / (3 * sizeof(u32))
  544. static const u32 caicos_mgcg_default[] =
  545. {
  546. 0x0000802c, 0xc0000000, 0xffffffff,
  547. 0x00005448, 0x00000100, 0xffffffff,
  548. 0x000055e4, 0x00600100, 0xffffffff,
  549. 0x0000160c, 0x00000100, 0xffffffff,
  550. 0x0000c164, 0x00000100, 0xffffffff,
  551. 0x00008a18, 0x00000100, 0xffffffff,
  552. 0x0000897c, 0x06000100, 0xffffffff,
  553. 0x00008b28, 0x00000100, 0xffffffff,
  554. 0x00009144, 0x00000100, 0xffffffff,
  555. 0x00009a60, 0x00000100, 0xffffffff,
  556. 0x00009868, 0x00000100, 0xffffffff,
  557. 0x00008d58, 0x00000100, 0xffffffff,
  558. 0x00009510, 0x00000100, 0xffffffff,
  559. 0x0000949c, 0x00000100, 0xffffffff,
  560. 0x00009654, 0x00000100, 0xffffffff,
  561. 0x00009030, 0x00000100, 0xffffffff,
  562. 0x00009034, 0x00000100, 0xffffffff,
  563. 0x00009038, 0x00000100, 0xffffffff,
  564. 0x0000903c, 0x00000100, 0xffffffff,
  565. 0x00009040, 0x00000100, 0xffffffff,
  566. 0x0000a200, 0x00000100, 0xffffffff,
  567. 0x0000a204, 0x00000100, 0xffffffff,
  568. 0x0000a208, 0x00000100, 0xffffffff,
  569. 0x0000a20c, 0x00000100, 0xffffffff,
  570. 0x0000977c, 0x00000100, 0xffffffff,
  571. 0x00003f80, 0x00000100, 0xffffffff,
  572. 0x0000a210, 0x00000100, 0xffffffff,
  573. 0x0000a214, 0x00000100, 0xffffffff,
  574. 0x000004d8, 0x00000100, 0xffffffff,
  575. 0x00009784, 0x00000100, 0xffffffff,
  576. 0x00009698, 0x00000100, 0xffffffff,
  577. 0x000004d4, 0x00000200, 0xffffffff,
  578. 0x000004d0, 0x00000000, 0xffffffff,
  579. 0x000030cc, 0x00000100, 0xffffffff,
  580. 0x0000d0c0, 0xff000100, 0xffffffff,
  581. 0x0000915c, 0x00010000, 0xffffffff,
  582. 0x00009160, 0x00030002, 0xffffffff,
  583. 0x00009164, 0x00050004, 0xffffffff,
  584. 0x00009168, 0x00070006, 0xffffffff,
  585. 0x00009178, 0x00070000, 0xffffffff,
  586. 0x0000917c, 0x00030002, 0xffffffff,
  587. 0x00009180, 0x00050004, 0xffffffff,
  588. 0x0000918c, 0x00010006, 0xffffffff,
  589. 0x00009190, 0x00090008, 0xffffffff,
  590. 0x00009194, 0x00070000, 0xffffffff,
  591. 0x00009198, 0x00030002, 0xffffffff,
  592. 0x0000919c, 0x00050004, 0xffffffff,
  593. 0x000091a8, 0x00010006, 0xffffffff,
  594. 0x000091ac, 0x00090008, 0xffffffff,
  595. 0x000091e8, 0x00000000, 0xffffffff,
  596. 0x00009294, 0x00000000, 0xffffffff,
  597. 0x000008f8, 0x00000010, 0xffffffff,
  598. 0x000008fc, 0x00000000, 0xffffffff,
  599. 0x000008f8, 0x00000011, 0xffffffff,
  600. 0x000008fc, 0x00000000, 0xffffffff,
  601. 0x000008f8, 0x00000012, 0xffffffff,
  602. 0x000008fc, 0x00000000, 0xffffffff,
  603. 0x000008f8, 0x00000013, 0xffffffff,
  604. 0x000008fc, 0x00000000, 0xffffffff,
  605. 0x000008f8, 0x00000014, 0xffffffff,
  606. 0x000008fc, 0x00000000, 0xffffffff,
  607. 0x000008f8, 0x00000015, 0xffffffff,
  608. 0x000008fc, 0x00000000, 0xffffffff,
  609. 0x000008f8, 0x00000016, 0xffffffff,
  610. 0x000008fc, 0x00000000, 0xffffffff,
  611. 0x000008f8, 0x00000017, 0xffffffff,
  612. 0x000008fc, 0x00000000, 0xffffffff,
  613. 0x000008f8, 0x00000018, 0xffffffff,
  614. 0x000008fc, 0x00000000, 0xffffffff,
  615. 0x000008f8, 0x00000019, 0xffffffff,
  616. 0x000008fc, 0x00000000, 0xffffffff,
  617. 0x000008f8, 0x0000001a, 0xffffffff,
  618. 0x000008fc, 0x00000000, 0xffffffff,
  619. 0x000008f8, 0x0000001b, 0xffffffff,
  620. 0x000008fc, 0x00000000, 0xffffffff
  621. };
  622. #define CAICOS_MGCG_DEFAULT_LENGTH sizeof(caicos_mgcg_default) / (3 * sizeof(u32))
  623. static const u32 caicos_mgcg_disable[] =
  624. {
  625. 0x0000802c, 0xc0000000, 0xffffffff,
  626. 0x000008f8, 0x00000000, 0xffffffff,
  627. 0x000008fc, 0xffffffff, 0xffffffff,
  628. 0x000008f8, 0x00000001, 0xffffffff,
  629. 0x000008fc, 0xffffffff, 0xffffffff,
  630. 0x000008f8, 0x00000002, 0xffffffff,
  631. 0x000008fc, 0xffffffff, 0xffffffff,
  632. 0x000008f8, 0x00000003, 0xffffffff,
  633. 0x000008fc, 0xffffffff, 0xffffffff,
  634. 0x00009150, 0x00600000, 0xffffffff
  635. };
  636. #define CAICOS_MGCG_DISABLE_LENGTH sizeof(caicos_mgcg_disable) / (3 * sizeof(u32))
  637. static const u32 caicos_mgcg_enable[] =
  638. {
  639. 0x0000802c, 0xc0000000, 0xffffffff,
  640. 0x000008f8, 0x00000000, 0xffffffff,
  641. 0x000008fc, 0x00000000, 0xffffffff,
  642. 0x000008f8, 0x00000001, 0xffffffff,
  643. 0x000008fc, 0x00000000, 0xffffffff,
  644. 0x000008f8, 0x00000002, 0xffffffff,
  645. 0x000008fc, 0x00000000, 0xffffffff,
  646. 0x000008f8, 0x00000003, 0xffffffff,
  647. 0x000008fc, 0x00000000, 0xffffffff,
  648. 0x00009150, 0x46944040, 0xffffffff
  649. };
  650. #define CAICOS_MGCG_ENABLE_LENGTH sizeof(caicos_mgcg_enable) / (3 * sizeof(u32))
  651. //********* TURKS **************//
  652. static const u32 turks_cgcg_cgls_default[] =
  653. {
  654. 0x000008f8, 0x00000010, 0xffffffff,
  655. 0x000008fc, 0x00000000, 0xffffffff,
  656. 0x000008f8, 0x00000011, 0xffffffff,
  657. 0x000008fc, 0x00000000, 0xffffffff,
  658. 0x000008f8, 0x00000012, 0xffffffff,
  659. 0x000008fc, 0x00000000, 0xffffffff,
  660. 0x000008f8, 0x00000013, 0xffffffff,
  661. 0x000008fc, 0x00000000, 0xffffffff,
  662. 0x000008f8, 0x00000014, 0xffffffff,
  663. 0x000008fc, 0x00000000, 0xffffffff,
  664. 0x000008f8, 0x00000015, 0xffffffff,
  665. 0x000008fc, 0x00000000, 0xffffffff,
  666. 0x000008f8, 0x00000016, 0xffffffff,
  667. 0x000008fc, 0x00000000, 0xffffffff,
  668. 0x000008f8, 0x00000017, 0xffffffff,
  669. 0x000008fc, 0x00000000, 0xffffffff,
  670. 0x000008f8, 0x00000018, 0xffffffff,
  671. 0x000008fc, 0x00000000, 0xffffffff,
  672. 0x000008f8, 0x00000019, 0xffffffff,
  673. 0x000008fc, 0x00000000, 0xffffffff,
  674. 0x000008f8, 0x0000001a, 0xffffffff,
  675. 0x000008fc, 0x00000000, 0xffffffff,
  676. 0x000008f8, 0x0000001b, 0xffffffff,
  677. 0x000008fc, 0x00000000, 0xffffffff,
  678. 0x000008f8, 0x00000020, 0xffffffff,
  679. 0x000008fc, 0x00000000, 0xffffffff,
  680. 0x000008f8, 0x00000021, 0xffffffff,
  681. 0x000008fc, 0x00000000, 0xffffffff,
  682. 0x000008f8, 0x00000022, 0xffffffff,
  683. 0x000008fc, 0x00000000, 0xffffffff,
  684. 0x000008f8, 0x00000023, 0xffffffff,
  685. 0x000008fc, 0x00000000, 0xffffffff,
  686. 0x000008f8, 0x00000024, 0xffffffff,
  687. 0x000008fc, 0x00000000, 0xffffffff,
  688. 0x000008f8, 0x00000025, 0xffffffff,
  689. 0x000008fc, 0x00000000, 0xffffffff,
  690. 0x000008f8, 0x00000026, 0xffffffff,
  691. 0x000008fc, 0x00000000, 0xffffffff,
  692. 0x000008f8, 0x00000027, 0xffffffff,
  693. 0x000008fc, 0x00000000, 0xffffffff,
  694. 0x000008f8, 0x00000028, 0xffffffff,
  695. 0x000008fc, 0x00000000, 0xffffffff,
  696. 0x000008f8, 0x00000029, 0xffffffff,
  697. 0x000008fc, 0x00000000, 0xffffffff,
  698. 0x000008f8, 0x0000002a, 0xffffffff,
  699. 0x000008fc, 0x00000000, 0xffffffff,
  700. 0x000008f8, 0x0000002b, 0xffffffff,
  701. 0x000008fc, 0x00000000, 0xffffffff
  702. };
  703. #define TURKS_CGCG_CGLS_DEFAULT_LENGTH sizeof(turks_cgcg_cgls_default) / (3 * sizeof(u32))
  704. static const u32 turks_cgcg_cgls_disable[] =
  705. {
  706. 0x000008f8, 0x00000010, 0xffffffff,
  707. 0x000008fc, 0xffffffff, 0xffffffff,
  708. 0x000008f8, 0x00000011, 0xffffffff,
  709. 0x000008fc, 0xffffffff, 0xffffffff,
  710. 0x000008f8, 0x00000012, 0xffffffff,
  711. 0x000008fc, 0xffffffff, 0xffffffff,
  712. 0x000008f8, 0x00000013, 0xffffffff,
  713. 0x000008fc, 0xffffffff, 0xffffffff,
  714. 0x000008f8, 0x00000014, 0xffffffff,
  715. 0x000008fc, 0xffffffff, 0xffffffff,
  716. 0x000008f8, 0x00000015, 0xffffffff,
  717. 0x000008fc, 0xffffffff, 0xffffffff,
  718. 0x000008f8, 0x00000016, 0xffffffff,
  719. 0x000008fc, 0xffffffff, 0xffffffff,
  720. 0x000008f8, 0x00000017, 0xffffffff,
  721. 0x000008fc, 0xffffffff, 0xffffffff,
  722. 0x000008f8, 0x00000018, 0xffffffff,
  723. 0x000008fc, 0xffffffff, 0xffffffff,
  724. 0x000008f8, 0x00000019, 0xffffffff,
  725. 0x000008fc, 0xffffffff, 0xffffffff,
  726. 0x000008f8, 0x0000001a, 0xffffffff,
  727. 0x000008fc, 0xffffffff, 0xffffffff,
  728. 0x000008f8, 0x0000001b, 0xffffffff,
  729. 0x000008fc, 0xffffffff, 0xffffffff,
  730. 0x000008f8, 0x00000020, 0xffffffff,
  731. 0x000008fc, 0x00000000, 0xffffffff,
  732. 0x000008f8, 0x00000021, 0xffffffff,
  733. 0x000008fc, 0x00000000, 0xffffffff,
  734. 0x000008f8, 0x00000022, 0xffffffff,
  735. 0x000008fc, 0x00000000, 0xffffffff,
  736. 0x000008f8, 0x00000023, 0xffffffff,
  737. 0x000008fc, 0x00000000, 0xffffffff,
  738. 0x000008f8, 0x00000024, 0xffffffff,
  739. 0x000008fc, 0x00000000, 0xffffffff,
  740. 0x000008f8, 0x00000025, 0xffffffff,
  741. 0x000008fc, 0x00000000, 0xffffffff,
  742. 0x000008f8, 0x00000026, 0xffffffff,
  743. 0x000008fc, 0x00000000, 0xffffffff,
  744. 0x000008f8, 0x00000027, 0xffffffff,
  745. 0x000008fc, 0x00000000, 0xffffffff,
  746. 0x000008f8, 0x00000028, 0xffffffff,
  747. 0x000008fc, 0x00000000, 0xffffffff,
  748. 0x000008f8, 0x00000029, 0xffffffff,
  749. 0x000008fc, 0x00000000, 0xffffffff,
  750. 0x000008f8, 0x0000002a, 0xffffffff,
  751. 0x000008fc, 0x00000000, 0xffffffff,
  752. 0x000008f8, 0x0000002b, 0xffffffff,
  753. 0x000008fc, 0x00000000, 0xffffffff,
  754. 0x00000644, 0x000f7912, 0x001f4180,
  755. 0x00000644, 0x000f3812, 0x001f4180
  756. };
  757. #define TURKS_CGCG_CGLS_DISABLE_LENGTH sizeof(turks_cgcg_cgls_disable) / (3 * sizeof(u32))
  758. static const u32 turks_cgcg_cgls_enable[] =
  759. {
  760. /* 0x0000c124, 0x84180000, 0x00180000, */
  761. 0x00000644, 0x000f7892, 0x001f4080,
  762. 0x000008f8, 0x00000010, 0xffffffff,
  763. 0x000008fc, 0x00000000, 0xffffffff,
  764. 0x000008f8, 0x00000011, 0xffffffff,
  765. 0x000008fc, 0x00000000, 0xffffffff,
  766. 0x000008f8, 0x00000012, 0xffffffff,
  767. 0x000008fc, 0x00000000, 0xffffffff,
  768. 0x000008f8, 0x00000013, 0xffffffff,
  769. 0x000008fc, 0x00000000, 0xffffffff,
  770. 0x000008f8, 0x00000014, 0xffffffff,
  771. 0x000008fc, 0x00000000, 0xffffffff,
  772. 0x000008f8, 0x00000015, 0xffffffff,
  773. 0x000008fc, 0x00000000, 0xffffffff,
  774. 0x000008f8, 0x00000016, 0xffffffff,
  775. 0x000008fc, 0x00000000, 0xffffffff,
  776. 0x000008f8, 0x00000017, 0xffffffff,
  777. 0x000008fc, 0x00000000, 0xffffffff,
  778. 0x000008f8, 0x00000018, 0xffffffff,
  779. 0x000008fc, 0x00000000, 0xffffffff,
  780. 0x000008f8, 0x00000019, 0xffffffff,
  781. 0x000008fc, 0x00000000, 0xffffffff,
  782. 0x000008f8, 0x0000001a, 0xffffffff,
  783. 0x000008fc, 0x00000000, 0xffffffff,
  784. 0x000008f8, 0x0000001b, 0xffffffff,
  785. 0x000008fc, 0x00000000, 0xffffffff,
  786. 0x000008f8, 0x00000020, 0xffffffff,
  787. 0x000008fc, 0xffffffff, 0xffffffff,
  788. 0x000008f8, 0x00000021, 0xffffffff,
  789. 0x000008fc, 0xffffffff, 0xffffffff,
  790. 0x000008f8, 0x00000022, 0xffffffff,
  791. 0x000008fc, 0xffffffff, 0xffffffff,
  792. 0x000008f8, 0x00000023, 0xffffffff,
  793. 0x000008fc, 0xffffffff, 0xffffffff,
  794. 0x000008f8, 0x00000024, 0xffffffff,
  795. 0x000008fc, 0xffffffff, 0xffffffff,
  796. 0x000008f8, 0x00000025, 0xffffffff,
  797. 0x000008fc, 0xffffffff, 0xffffffff,
  798. 0x000008f8, 0x00000026, 0xffffffff,
  799. 0x000008fc, 0xffffffff, 0xffffffff,
  800. 0x000008f8, 0x00000027, 0xffffffff,
  801. 0x000008fc, 0xffffffff, 0xffffffff,
  802. 0x000008f8, 0x00000028, 0xffffffff,
  803. 0x000008fc, 0xffffffff, 0xffffffff,
  804. 0x000008f8, 0x00000029, 0xffffffff,
  805. 0x000008fc, 0xffffffff, 0xffffffff,
  806. 0x000008f8, 0x0000002a, 0xffffffff,
  807. 0x000008fc, 0xffffffff, 0xffffffff,
  808. 0x000008f8, 0x0000002b, 0xffffffff,
  809. 0x000008fc, 0xffffffff, 0xffffffff
  810. };
  811. #define TURKS_CGCG_CGLS_ENABLE_LENGTH sizeof(turks_cgcg_cgls_enable) / (3 * sizeof(u32))
  812. // These are the sequences for turks_mgcg_shls
  813. static const u32 turks_mgcg_default[] =
  814. {
  815. 0x0000802c, 0xc0000000, 0xffffffff,
  816. 0x00005448, 0x00000100, 0xffffffff,
  817. 0x000055e4, 0x00600100, 0xffffffff,
  818. 0x0000160c, 0x00000100, 0xffffffff,
  819. 0x0000c164, 0x00000100, 0xffffffff,
  820. 0x00008a18, 0x00000100, 0xffffffff,
  821. 0x0000897c, 0x06000100, 0xffffffff,
  822. 0x00008b28, 0x00000100, 0xffffffff,
  823. 0x00009144, 0x00000100, 0xffffffff,
  824. 0x00009a60, 0x00000100, 0xffffffff,
  825. 0x00009868, 0x00000100, 0xffffffff,
  826. 0x00008d58, 0x00000100, 0xffffffff,
  827. 0x00009510, 0x00000100, 0xffffffff,
  828. 0x0000949c, 0x00000100, 0xffffffff,
  829. 0x00009654, 0x00000100, 0xffffffff,
  830. 0x00009030, 0x00000100, 0xffffffff,
  831. 0x00009034, 0x00000100, 0xffffffff,
  832. 0x00009038, 0x00000100, 0xffffffff,
  833. 0x0000903c, 0x00000100, 0xffffffff,
  834. 0x00009040, 0x00000100, 0xffffffff,
  835. 0x0000a200, 0x00000100, 0xffffffff,
  836. 0x0000a204, 0x00000100, 0xffffffff,
  837. 0x0000a208, 0x00000100, 0xffffffff,
  838. 0x0000a20c, 0x00000100, 0xffffffff,
  839. 0x0000977c, 0x00000100, 0xffffffff,
  840. 0x00003f80, 0x00000100, 0xffffffff,
  841. 0x0000a210, 0x00000100, 0xffffffff,
  842. 0x0000a214, 0x00000100, 0xffffffff,
  843. 0x000004d8, 0x00000100, 0xffffffff,
  844. 0x00009784, 0x00000100, 0xffffffff,
  845. 0x00009698, 0x00000100, 0xffffffff,
  846. 0x000004d4, 0x00000200, 0xffffffff,
  847. 0x000004d0, 0x00000000, 0xffffffff,
  848. 0x000030cc, 0x00000100, 0xffffffff,
  849. 0x0000d0c0, 0x00000100, 0xffffffff,
  850. 0x0000915c, 0x00010000, 0xffffffff,
  851. 0x00009160, 0x00030002, 0xffffffff,
  852. 0x00009164, 0x00050004, 0xffffffff,
  853. 0x00009168, 0x00070006, 0xffffffff,
  854. 0x00009178, 0x00070000, 0xffffffff,
  855. 0x0000917c, 0x00030002, 0xffffffff,
  856. 0x00009180, 0x00050004, 0xffffffff,
  857. 0x0000918c, 0x00010006, 0xffffffff,
  858. 0x00009190, 0x00090008, 0xffffffff,
  859. 0x00009194, 0x00070000, 0xffffffff,
  860. 0x00009198, 0x00030002, 0xffffffff,
  861. 0x0000919c, 0x00050004, 0xffffffff,
  862. 0x000091a8, 0x00010006, 0xffffffff,
  863. 0x000091ac, 0x00090008, 0xffffffff,
  864. 0x000091b0, 0x00070000, 0xffffffff,
  865. 0x000091b4, 0x00030002, 0xffffffff,
  866. 0x000091b8, 0x00050004, 0xffffffff,
  867. 0x000091c4, 0x00010006, 0xffffffff,
  868. 0x000091c8, 0x00090008, 0xffffffff,
  869. 0x000091cc, 0x00070000, 0xffffffff,
  870. 0x000091d0, 0x00030002, 0xffffffff,
  871. 0x000091d4, 0x00050004, 0xffffffff,
  872. 0x000091e0, 0x00010006, 0xffffffff,
  873. 0x000091e4, 0x00090008, 0xffffffff,
  874. 0x000091e8, 0x00000000, 0xffffffff,
  875. 0x000091ec, 0x00070000, 0xffffffff,
  876. 0x000091f0, 0x00030002, 0xffffffff,
  877. 0x000091f4, 0x00050004, 0xffffffff,
  878. 0x00009200, 0x00010006, 0xffffffff,
  879. 0x00009204, 0x00090008, 0xffffffff,
  880. 0x00009208, 0x00070000, 0xffffffff,
  881. 0x0000920c, 0x00030002, 0xffffffff,
  882. 0x00009210, 0x00050004, 0xffffffff,
  883. 0x0000921c, 0x00010006, 0xffffffff,
  884. 0x00009220, 0x00090008, 0xffffffff,
  885. 0x00009294, 0x00000000, 0xffffffff,
  886. 0x000008f8, 0x00000010, 0xffffffff,
  887. 0x000008fc, 0x00000000, 0xffffffff,
  888. 0x000008f8, 0x00000011, 0xffffffff,
  889. 0x000008fc, 0x00000000, 0xffffffff,
  890. 0x000008f8, 0x00000012, 0xffffffff,
  891. 0x000008fc, 0x00000000, 0xffffffff,
  892. 0x000008f8, 0x00000013, 0xffffffff,
  893. 0x000008fc, 0x00000000, 0xffffffff,
  894. 0x000008f8, 0x00000014, 0xffffffff,
  895. 0x000008fc, 0x00000000, 0xffffffff,
  896. 0x000008f8, 0x00000015, 0xffffffff,
  897. 0x000008fc, 0x00000000, 0xffffffff,
  898. 0x000008f8, 0x00000016, 0xffffffff,
  899. 0x000008fc, 0x00000000, 0xffffffff,
  900. 0x000008f8, 0x00000017, 0xffffffff,
  901. 0x000008fc, 0x00000000, 0xffffffff,
  902. 0x000008f8, 0x00000018, 0xffffffff,
  903. 0x000008fc, 0x00000000, 0xffffffff,
  904. 0x000008f8, 0x00000019, 0xffffffff,
  905. 0x000008fc, 0x00000000, 0xffffffff,
  906. 0x000008f8, 0x0000001a, 0xffffffff,
  907. 0x000008fc, 0x00000000, 0xffffffff,
  908. 0x000008f8, 0x0000001b, 0xffffffff,
  909. 0x000008fc, 0x00000000, 0xffffffff
  910. };
  911. #define TURKS_MGCG_DEFAULT_LENGTH sizeof(turks_mgcg_default) / (3 * sizeof(u32))
  912. static const u32 turks_mgcg_disable[] =
  913. {
  914. 0x0000802c, 0xc0000000, 0xffffffff,
  915. 0x000008f8, 0x00000000, 0xffffffff,
  916. 0x000008fc, 0xffffffff, 0xffffffff,
  917. 0x000008f8, 0x00000001, 0xffffffff,
  918. 0x000008fc, 0xffffffff, 0xffffffff,
  919. 0x000008f8, 0x00000002, 0xffffffff,
  920. 0x000008fc, 0xffffffff, 0xffffffff,
  921. 0x000008f8, 0x00000003, 0xffffffff,
  922. 0x000008fc, 0xffffffff, 0xffffffff,
  923. 0x00009150, 0x00600000, 0xffffffff
  924. };
  925. #define TURKS_MGCG_DISABLE_LENGTH sizeof(turks_mgcg_disable) / (3 * sizeof(u32))
  926. static const u32 turks_mgcg_enable[] =
  927. {
  928. 0x0000802c, 0xc0000000, 0xffffffff,
  929. 0x000008f8, 0x00000000, 0xffffffff,
  930. 0x000008fc, 0x00000000, 0xffffffff,
  931. 0x000008f8, 0x00000001, 0xffffffff,
  932. 0x000008fc, 0x00000000, 0xffffffff,
  933. 0x000008f8, 0x00000002, 0xffffffff,
  934. 0x000008fc, 0x00000000, 0xffffffff,
  935. 0x000008f8, 0x00000003, 0xffffffff,
  936. 0x000008fc, 0x00000000, 0xffffffff,
  937. 0x00009150, 0x6e944000, 0xffffffff
  938. };
  939. #define TURKS_MGCG_ENABLE_LENGTH sizeof(turks_mgcg_enable) / (3 * sizeof(u32))
  940. #endif
  941. #ifndef BTC_SYSLS_SEQUENCE
  942. #define BTC_SYSLS_SEQUENCE 100
  943. //********* BARTS **************//
  944. static const u32 barts_sysls_default[] =
  945. {
  946. /* Register, Value, Mask bits */
  947. 0x000055e8, 0x00000000, 0xffffffff,
  948. 0x0000d0bc, 0x00000000, 0xffffffff,
  949. 0x000015c0, 0x000c1401, 0xffffffff,
  950. 0x0000264c, 0x000c0400, 0xffffffff,
  951. 0x00002648, 0x000c0400, 0xffffffff,
  952. 0x00002650, 0x000c0400, 0xffffffff,
  953. 0x000020b8, 0x000c0400, 0xffffffff,
  954. 0x000020bc, 0x000c0400, 0xffffffff,
  955. 0x000020c0, 0x000c0c80, 0xffffffff,
  956. 0x0000f4a0, 0x000000c0, 0xffffffff,
  957. 0x0000f4a4, 0x00680fff, 0xffffffff,
  958. 0x000004c8, 0x00000001, 0xffffffff,
  959. 0x000064ec, 0x00000000, 0xffffffff,
  960. 0x00000c7c, 0x00000000, 0xffffffff,
  961. 0x00006dfc, 0x00000000, 0xffffffff
  962. };
  963. #define BARTS_SYSLS_DEFAULT_LENGTH sizeof(barts_sysls_default) / (3 * sizeof(u32))
  964. static const u32 barts_sysls_disable[] =
  965. {
  966. 0x000055e8, 0x00000000, 0xffffffff,
  967. 0x0000d0bc, 0x00000000, 0xffffffff,
  968. 0x000015c0, 0x00041401, 0xffffffff,
  969. 0x0000264c, 0x00040400, 0xffffffff,
  970. 0x00002648, 0x00040400, 0xffffffff,
  971. 0x00002650, 0x00040400, 0xffffffff,
  972. 0x000020b8, 0x00040400, 0xffffffff,
  973. 0x000020bc, 0x00040400, 0xffffffff,
  974. 0x000020c0, 0x00040c80, 0xffffffff,
  975. 0x0000f4a0, 0x000000c0, 0xffffffff,
  976. 0x0000f4a4, 0x00680000, 0xffffffff,
  977. 0x000004c8, 0x00000001, 0xffffffff,
  978. 0x000064ec, 0x00007ffd, 0xffffffff,
  979. 0x00000c7c, 0x0000ff00, 0xffffffff,
  980. 0x00006dfc, 0x0000007f, 0xffffffff
  981. };
  982. #define BARTS_SYSLS_DISABLE_LENGTH sizeof(barts_sysls_disable) / (3 * sizeof(u32))
  983. static const u32 barts_sysls_enable[] =
  984. {
  985. 0x000055e8, 0x00000001, 0xffffffff,
  986. 0x0000d0bc, 0x00000100, 0xffffffff,
  987. 0x000015c0, 0x000c1401, 0xffffffff,
  988. 0x0000264c, 0x000c0400, 0xffffffff,
  989. 0x00002648, 0x000c0400, 0xffffffff,
  990. 0x00002650, 0x000c0400, 0xffffffff,
  991. 0x000020b8, 0x000c0400, 0xffffffff,
  992. 0x000020bc, 0x000c0400, 0xffffffff,
  993. 0x000020c0, 0x000c0c80, 0xffffffff,
  994. 0x0000f4a0, 0x000000c0, 0xffffffff,
  995. 0x0000f4a4, 0x00680fff, 0xffffffff,
  996. 0x000004c8, 0x00000000, 0xffffffff,
  997. 0x000064ec, 0x00000000, 0xffffffff,
  998. 0x00000c7c, 0x00000000, 0xffffffff,
  999. 0x00006dfc, 0x00000000, 0xffffffff
  1000. };
  1001. #define BARTS_SYSLS_ENABLE_LENGTH sizeof(barts_sysls_enable) / (3 * sizeof(u32))
  1002. //********* CAICOS **************//
  1003. static const u32 caicos_sysls_default[] =
  1004. {
  1005. 0x000055e8, 0x00000000, 0xffffffff,
  1006. 0x0000d0bc, 0x00000000, 0xffffffff,
  1007. 0x000015c0, 0x000c1401, 0xffffffff,
  1008. 0x0000264c, 0x000c0400, 0xffffffff,
  1009. 0x00002648, 0x000c0400, 0xffffffff,
  1010. 0x00002650, 0x000c0400, 0xffffffff,
  1011. 0x000020b8, 0x000c0400, 0xffffffff,
  1012. 0x000020bc, 0x000c0400, 0xffffffff,
  1013. 0x0000f4a0, 0x000000c0, 0xffffffff,
  1014. 0x0000f4a4, 0x00680fff, 0xffffffff,
  1015. 0x000004c8, 0x00000001, 0xffffffff,
  1016. 0x000064ec, 0x00000000, 0xffffffff,
  1017. 0x00000c7c, 0x00000000, 0xffffffff,
  1018. 0x00006dfc, 0x00000000, 0xffffffff
  1019. };
  1020. #define CAICOS_SYSLS_DEFAULT_LENGTH sizeof(caicos_sysls_default) / (3 * sizeof(u32))
  1021. static const u32 caicos_sysls_disable[] =
  1022. {
  1023. 0x000055e8, 0x00000000, 0xffffffff,
  1024. 0x0000d0bc, 0x00000000, 0xffffffff,
  1025. 0x000015c0, 0x00041401, 0xffffffff,
  1026. 0x0000264c, 0x00040400, 0xffffffff,
  1027. 0x00002648, 0x00040400, 0xffffffff,
  1028. 0x00002650, 0x00040400, 0xffffffff,
  1029. 0x000020b8, 0x00040400, 0xffffffff,
  1030. 0x000020bc, 0x00040400, 0xffffffff,
  1031. 0x0000f4a0, 0x000000c0, 0xffffffff,
  1032. 0x0000f4a4, 0x00680000, 0xffffffff,
  1033. 0x000004c8, 0x00000001, 0xffffffff,
  1034. 0x000064ec, 0x00007ffd, 0xffffffff,
  1035. 0x00000c7c, 0x0000ff00, 0xffffffff,
  1036. 0x00006dfc, 0x0000007f, 0xffffffff
  1037. };
  1038. #define CAICOS_SYSLS_DISABLE_LENGTH sizeof(caicos_sysls_disable) / (3 * sizeof(u32))
  1039. static const u32 caicos_sysls_enable[] =
  1040. {
  1041. 0x000055e8, 0x00000001, 0xffffffff,
  1042. 0x0000d0bc, 0x00000100, 0xffffffff,
  1043. 0x000015c0, 0x000c1401, 0xffffffff,
  1044. 0x0000264c, 0x000c0400, 0xffffffff,
  1045. 0x00002648, 0x000c0400, 0xffffffff,
  1046. 0x00002650, 0x000c0400, 0xffffffff,
  1047. 0x000020b8, 0x000c0400, 0xffffffff,
  1048. 0x000020bc, 0x000c0400, 0xffffffff,
  1049. 0x0000f4a0, 0x000000c0, 0xffffffff,
  1050. 0x0000f4a4, 0x00680fff, 0xffffffff,
  1051. 0x000064ec, 0x00000000, 0xffffffff,
  1052. 0x00000c7c, 0x00000000, 0xffffffff,
  1053. 0x00006dfc, 0x00000000, 0xffffffff,
  1054. 0x000004c8, 0x00000000, 0xffffffff
  1055. };
  1056. #define CAICOS_SYSLS_ENABLE_LENGTH sizeof(caicos_sysls_enable) / (3 * sizeof(u32))
  1057. //********* TURKS **************//
  1058. static const u32 turks_sysls_default[] =
  1059. {
  1060. 0x000055e8, 0x00000000, 0xffffffff,
  1061. 0x0000d0bc, 0x00000000, 0xffffffff,
  1062. 0x000015c0, 0x000c1401, 0xffffffff,
  1063. 0x0000264c, 0x000c0400, 0xffffffff,
  1064. 0x00002648, 0x000c0400, 0xffffffff,
  1065. 0x00002650, 0x000c0400, 0xffffffff,
  1066. 0x000020b8, 0x000c0400, 0xffffffff,
  1067. 0x000020bc, 0x000c0400, 0xffffffff,
  1068. 0x000020c0, 0x000c0c80, 0xffffffff,
  1069. 0x0000f4a0, 0x000000c0, 0xffffffff,
  1070. 0x0000f4a4, 0x00680fff, 0xffffffff,
  1071. 0x000004c8, 0x00000001, 0xffffffff,
  1072. 0x000064ec, 0x00000000, 0xffffffff,
  1073. 0x00000c7c, 0x00000000, 0xffffffff,
  1074. 0x00006dfc, 0x00000000, 0xffffffff
  1075. };
  1076. #define TURKS_SYSLS_DEFAULT_LENGTH sizeof(turks_sysls_default) / (3 * sizeof(u32))
  1077. static const u32 turks_sysls_disable[] =
  1078. {
  1079. 0x000055e8, 0x00000000, 0xffffffff,
  1080. 0x0000d0bc, 0x00000000, 0xffffffff,
  1081. 0x000015c0, 0x00041401, 0xffffffff,
  1082. 0x0000264c, 0x00040400, 0xffffffff,
  1083. 0x00002648, 0x00040400, 0xffffffff,
  1084. 0x00002650, 0x00040400, 0xffffffff,
  1085. 0x000020b8, 0x00040400, 0xffffffff,
  1086. 0x000020bc, 0x00040400, 0xffffffff,
  1087. 0x000020c0, 0x00040c80, 0xffffffff,
  1088. 0x0000f4a0, 0x000000c0, 0xffffffff,
  1089. 0x0000f4a4, 0x00680000, 0xffffffff,
  1090. 0x000004c8, 0x00000001, 0xffffffff,
  1091. 0x000064ec, 0x00007ffd, 0xffffffff,
  1092. 0x00000c7c, 0x0000ff00, 0xffffffff,
  1093. 0x00006dfc, 0x0000007f, 0xffffffff
  1094. };
  1095. #define TURKS_SYSLS_DISABLE_LENGTH sizeof(turks_sysls_disable) / (3 * sizeof(u32))
  1096. static const u32 turks_sysls_enable[] =
  1097. {
  1098. 0x000055e8, 0x00000001, 0xffffffff,
  1099. 0x0000d0bc, 0x00000100, 0xffffffff,
  1100. 0x000015c0, 0x000c1401, 0xffffffff,
  1101. 0x0000264c, 0x000c0400, 0xffffffff,
  1102. 0x00002648, 0x000c0400, 0xffffffff,
  1103. 0x00002650, 0x000c0400, 0xffffffff,
  1104. 0x000020b8, 0x000c0400, 0xffffffff,
  1105. 0x000020bc, 0x000c0400, 0xffffffff,
  1106. 0x000020c0, 0x000c0c80, 0xffffffff,
  1107. 0x0000f4a0, 0x000000c0, 0xffffffff,
  1108. 0x0000f4a4, 0x00680fff, 0xffffffff,
  1109. 0x000004c8, 0x00000000, 0xffffffff,
  1110. 0x000064ec, 0x00000000, 0xffffffff,
  1111. 0x00000c7c, 0x00000000, 0xffffffff,
  1112. 0x00006dfc, 0x00000000, 0xffffffff
  1113. };
  1114. #define TURKS_SYSLS_ENABLE_LENGTH sizeof(turks_sysls_enable) / (3 * sizeof(u32))
  1115. #endif
  1116. static void btc_enable_bif_dynamic_pcie_gen2(struct radeon_device *rdev,
  1117. bool enable)
  1118. {
  1119. struct rv7xx_power_info *pi = rv770_get_pi(rdev);
  1120. u32 tmp, bif;
  1121. tmp = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL);
  1122. if (enable) {
  1123. if ((tmp & LC_OTHER_SIDE_EVER_SENT_GEN2) &&
  1124. (tmp & LC_OTHER_SIDE_SUPPORTS_GEN2)) {
  1125. if (!pi->boot_in_gen2) {
  1126. bif = RREG32(CG_BIF_REQ_AND_RSP) & ~CG_CLIENT_REQ_MASK;
  1127. bif |= CG_CLIENT_REQ(0xd);
  1128. WREG32(CG_BIF_REQ_AND_RSP, bif);
  1129. tmp &= ~LC_HW_VOLTAGE_IF_CONTROL_MASK;
  1130. tmp |= LC_HW_VOLTAGE_IF_CONTROL(1);
  1131. tmp |= LC_GEN2_EN_STRAP;
  1132. tmp |= LC_CLR_FAILED_SPD_CHANGE_CNT;
  1133. WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
  1134. udelay(10);
  1135. tmp &= ~LC_CLR_FAILED_SPD_CHANGE_CNT;
  1136. WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
  1137. }
  1138. }
  1139. } else {
  1140. if ((tmp & LC_OTHER_SIDE_EVER_SENT_GEN2) ||
  1141. (tmp & LC_OTHER_SIDE_SUPPORTS_GEN2)) {
  1142. if (!pi->boot_in_gen2) {
  1143. bif = RREG32(CG_BIF_REQ_AND_RSP) & ~CG_CLIENT_REQ_MASK;
  1144. bif |= CG_CLIENT_REQ(0xd);
  1145. WREG32(CG_BIF_REQ_AND_RSP, bif);
  1146. tmp &= ~LC_HW_VOLTAGE_IF_CONTROL_MASK;
  1147. tmp &= ~LC_GEN2_EN_STRAP;
  1148. }
  1149. WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
  1150. }
  1151. }
  1152. }
  1153. static void btc_enable_dynamic_pcie_gen2(struct radeon_device *rdev,
  1154. bool enable)
  1155. {
  1156. btc_enable_bif_dynamic_pcie_gen2(rdev, enable);
  1157. if (enable)
  1158. WREG32_P(GENERAL_PWRMGT, ENABLE_GEN2PCIE, ~ENABLE_GEN2PCIE);
  1159. else
  1160. WREG32_P(GENERAL_PWRMGT, 0, ~ENABLE_GEN2PCIE);
  1161. }
  1162. static int btc_disable_ulv(struct radeon_device *rdev)
  1163. {
  1164. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1165. if (eg_pi->ulv.supported) {
  1166. if (rv770_send_msg_to_smc(rdev, PPSMC_MSG_DisableULV) != PPSMC_Result_OK)
  1167. return -EINVAL;
  1168. }
  1169. return 0;
  1170. }
  1171. static int btc_populate_ulv_state(struct radeon_device *rdev,
  1172. RV770_SMC_STATETABLE *table)
  1173. {
  1174. int ret = -EINVAL;
  1175. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1176. struct rv7xx_pl *ulv_pl = eg_pi->ulv.pl;
  1177. if (ulv_pl->vddc) {
  1178. ret = cypress_convert_power_level_to_smc(rdev,
  1179. ulv_pl,
  1180. &table->ULVState.levels[0],
  1181. PPSMC_DISPLAY_WATERMARK_LOW);
  1182. if (ret == 0) {
  1183. table->ULVState.levels[0].arbValue = MC_CG_ARB_FREQ_F0;
  1184. table->ULVState.levels[0].ACIndex = 1;
  1185. table->ULVState.levels[1] = table->ULVState.levels[0];
  1186. table->ULVState.levels[2] = table->ULVState.levels[0];
  1187. table->ULVState.flags |= PPSMC_SWSTATE_FLAG_DC;
  1188. WREG32(CG_ULV_CONTROL, BTC_CGULVCONTROL_DFLT);
  1189. WREG32(CG_ULV_PARAMETER, BTC_CGULVPARAMETER_DFLT);
  1190. }
  1191. }
  1192. return ret;
  1193. }
  1194. static int btc_populate_smc_acpi_state(struct radeon_device *rdev,
  1195. RV770_SMC_STATETABLE *table)
  1196. {
  1197. int ret = cypress_populate_smc_acpi_state(rdev, table);
  1198. if (ret == 0) {
  1199. table->ACPIState.levels[0].ACIndex = 0;
  1200. table->ACPIState.levels[1].ACIndex = 0;
  1201. table->ACPIState.levels[2].ACIndex = 0;
  1202. }
  1203. return ret;
  1204. }
  1205. static void btc_program_mgcg_hw_sequence(struct radeon_device *rdev,
  1206. const u32 *sequence, u32 count)
  1207. {
  1208. u32 i, length = count * 3;
  1209. u32 tmp;
  1210. for (i = 0; i < length; i+=3) {
  1211. tmp = RREG32(sequence[i]);
  1212. tmp &= ~sequence[i+2];
  1213. tmp |= sequence[i+1] & sequence[i+2];
  1214. WREG32(sequence[i], tmp);
  1215. }
  1216. }
  1217. static void btc_cg_clock_gating_default(struct radeon_device *rdev)
  1218. {
  1219. u32 count;
  1220. const u32 *p = NULL;
  1221. if (rdev->family == CHIP_BARTS) {
  1222. p = (const u32 *)&barts_cgcg_cgls_default;
  1223. count = BARTS_CGCG_CGLS_DEFAULT_LENGTH;
  1224. } else if (rdev->family == CHIP_TURKS) {
  1225. p = (const u32 *)&turks_cgcg_cgls_default;
  1226. count = TURKS_CGCG_CGLS_DEFAULT_LENGTH;
  1227. } else if (rdev->family == CHIP_CAICOS) {
  1228. p = (const u32 *)&caicos_cgcg_cgls_default;
  1229. count = CAICOS_CGCG_CGLS_DEFAULT_LENGTH;
  1230. } else
  1231. return;
  1232. btc_program_mgcg_hw_sequence(rdev, p, count);
  1233. }
  1234. static void btc_cg_clock_gating_enable(struct radeon_device *rdev,
  1235. bool enable)
  1236. {
  1237. u32 count;
  1238. const u32 *p = NULL;
  1239. if (enable) {
  1240. if (rdev->family == CHIP_BARTS) {
  1241. p = (const u32 *)&barts_cgcg_cgls_enable;
  1242. count = BARTS_CGCG_CGLS_ENABLE_LENGTH;
  1243. } else if (rdev->family == CHIP_TURKS) {
  1244. p = (const u32 *)&turks_cgcg_cgls_enable;
  1245. count = TURKS_CGCG_CGLS_ENABLE_LENGTH;
  1246. } else if (rdev->family == CHIP_CAICOS) {
  1247. p = (const u32 *)&caicos_cgcg_cgls_enable;
  1248. count = CAICOS_CGCG_CGLS_ENABLE_LENGTH;
  1249. } else
  1250. return;
  1251. } else {
  1252. if (rdev->family == CHIP_BARTS) {
  1253. p = (const u32 *)&barts_cgcg_cgls_disable;
  1254. count = BARTS_CGCG_CGLS_DISABLE_LENGTH;
  1255. } else if (rdev->family == CHIP_TURKS) {
  1256. p = (const u32 *)&turks_cgcg_cgls_disable;
  1257. count = TURKS_CGCG_CGLS_DISABLE_LENGTH;
  1258. } else if (rdev->family == CHIP_CAICOS) {
  1259. p = (const u32 *)&caicos_cgcg_cgls_disable;
  1260. count = CAICOS_CGCG_CGLS_DISABLE_LENGTH;
  1261. } else
  1262. return;
  1263. }
  1264. btc_program_mgcg_hw_sequence(rdev, p, count);
  1265. }
  1266. static void btc_mg_clock_gating_default(struct radeon_device *rdev)
  1267. {
  1268. u32 count;
  1269. const u32 *p = NULL;
  1270. if (rdev->family == CHIP_BARTS) {
  1271. p = (const u32 *)&barts_mgcg_default;
  1272. count = BARTS_MGCG_DEFAULT_LENGTH;
  1273. } else if (rdev->family == CHIP_TURKS) {
  1274. p = (const u32 *)&turks_mgcg_default;
  1275. count = TURKS_MGCG_DEFAULT_LENGTH;
  1276. } else if (rdev->family == CHIP_CAICOS) {
  1277. p = (const u32 *)&caicos_mgcg_default;
  1278. count = CAICOS_MGCG_DEFAULT_LENGTH;
  1279. } else
  1280. return;
  1281. btc_program_mgcg_hw_sequence(rdev, p, count);
  1282. }
  1283. static void btc_mg_clock_gating_enable(struct radeon_device *rdev,
  1284. bool enable)
  1285. {
  1286. u32 count;
  1287. const u32 *p = NULL;
  1288. if (enable) {
  1289. if (rdev->family == CHIP_BARTS) {
  1290. p = (const u32 *)&barts_mgcg_enable;
  1291. count = BARTS_MGCG_ENABLE_LENGTH;
  1292. } else if (rdev->family == CHIP_TURKS) {
  1293. p = (const u32 *)&turks_mgcg_enable;
  1294. count = TURKS_MGCG_ENABLE_LENGTH;
  1295. } else if (rdev->family == CHIP_CAICOS) {
  1296. p = (const u32 *)&caicos_mgcg_enable;
  1297. count = CAICOS_MGCG_ENABLE_LENGTH;
  1298. } else
  1299. return;
  1300. } else {
  1301. if (rdev->family == CHIP_BARTS) {
  1302. p = (const u32 *)&barts_mgcg_disable[0];
  1303. count = BARTS_MGCG_DISABLE_LENGTH;
  1304. } else if (rdev->family == CHIP_TURKS) {
  1305. p = (const u32 *)&turks_mgcg_disable[0];
  1306. count = TURKS_MGCG_DISABLE_LENGTH;
  1307. } else if (rdev->family == CHIP_CAICOS) {
  1308. p = (const u32 *)&caicos_mgcg_disable[0];
  1309. count = CAICOS_MGCG_DISABLE_LENGTH;
  1310. } else
  1311. return;
  1312. }
  1313. btc_program_mgcg_hw_sequence(rdev, p, count);
  1314. }
  1315. static void btc_ls_clock_gating_default(struct radeon_device *rdev)
  1316. {
  1317. u32 count;
  1318. const u32 *p = NULL;
  1319. if (rdev->family == CHIP_BARTS) {
  1320. p = (const u32 *)&barts_sysls_default;
  1321. count = BARTS_SYSLS_DEFAULT_LENGTH;
  1322. } else if (rdev->family == CHIP_TURKS) {
  1323. p = (const u32 *)&turks_sysls_default;
  1324. count = TURKS_SYSLS_DEFAULT_LENGTH;
  1325. } else if (rdev->family == CHIP_CAICOS) {
  1326. p = (const u32 *)&caicos_sysls_default;
  1327. count = CAICOS_SYSLS_DEFAULT_LENGTH;
  1328. } else
  1329. return;
  1330. btc_program_mgcg_hw_sequence(rdev, p, count);
  1331. }
  1332. static void btc_ls_clock_gating_enable(struct radeon_device *rdev,
  1333. bool enable)
  1334. {
  1335. u32 count;
  1336. const u32 *p = NULL;
  1337. if (enable) {
  1338. if (rdev->family == CHIP_BARTS) {
  1339. p = (const u32 *)&barts_sysls_enable;
  1340. count = BARTS_SYSLS_ENABLE_LENGTH;
  1341. } else if (rdev->family == CHIP_TURKS) {
  1342. p = (const u32 *)&turks_sysls_enable;
  1343. count = TURKS_SYSLS_ENABLE_LENGTH;
  1344. } else if (rdev->family == CHIP_CAICOS) {
  1345. p = (const u32 *)&caicos_sysls_enable;
  1346. count = CAICOS_SYSLS_ENABLE_LENGTH;
  1347. } else
  1348. return;
  1349. } else {
  1350. if (rdev->family == CHIP_BARTS) {
  1351. p = (const u32 *)&barts_sysls_disable;
  1352. count = BARTS_SYSLS_DISABLE_LENGTH;
  1353. } else if (rdev->family == CHIP_TURKS) {
  1354. p = (const u32 *)&turks_sysls_disable;
  1355. count = TURKS_SYSLS_DISABLE_LENGTH;
  1356. } else if (rdev->family == CHIP_CAICOS) {
  1357. p = (const u32 *)&caicos_sysls_disable;
  1358. count = CAICOS_SYSLS_DISABLE_LENGTH;
  1359. } else
  1360. return;
  1361. }
  1362. btc_program_mgcg_hw_sequence(rdev, p, count);
  1363. }
  1364. static bool btc_dpm_enabled(struct radeon_device *rdev)
  1365. {
  1366. if (rv770_is_smc_running(rdev))
  1367. return true;
  1368. else
  1369. return false;
  1370. }
  1371. static int btc_init_smc_table(struct radeon_device *rdev)
  1372. {
  1373. struct rv7xx_power_info *pi = rv770_get_pi(rdev);
  1374. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1375. struct radeon_ps *radeon_boot_state = rdev->pm.dpm.boot_ps;
  1376. RV770_SMC_STATETABLE *table = &pi->smc_statetable;
  1377. int ret;
  1378. memset(table, 0, sizeof(RV770_SMC_STATETABLE));
  1379. cypress_populate_smc_voltage_tables(rdev, table);
  1380. switch (rdev->pm.int_thermal_type) {
  1381. case THERMAL_TYPE_EVERGREEN:
  1382. case THERMAL_TYPE_EMC2103_WITH_INTERNAL:
  1383. table->thermalProtectType = PPSMC_THERMAL_PROTECT_TYPE_INTERNAL;
  1384. break;
  1385. case THERMAL_TYPE_NONE:
  1386. table->thermalProtectType = PPSMC_THERMAL_PROTECT_TYPE_NONE;
  1387. break;
  1388. default:
  1389. table->thermalProtectType = PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL;
  1390. break;
  1391. }
  1392. if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_HARDWAREDC)
  1393. table->systemFlags |= PPSMC_SYSTEMFLAG_GPIO_DC;
  1394. if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_REGULATOR_HOT)
  1395. table->systemFlags |= PPSMC_SYSTEMFLAG_REGULATOR_HOT;
  1396. if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_STEPVDDC)
  1397. table->systemFlags |= PPSMC_SYSTEMFLAG_STEPVDDC;
  1398. if (pi->mem_gddr5)
  1399. table->systemFlags |= PPSMC_SYSTEMFLAG_GDDR5;
  1400. ret = cypress_populate_smc_initial_state(rdev, radeon_boot_state, table);
  1401. if (ret)
  1402. return ret;
  1403. if (eg_pi->sclk_deep_sleep)
  1404. WREG32_P(SCLK_PSKIP_CNTL, PSKIP_ON_ALLOW_STOP_HI(32),
  1405. ~PSKIP_ON_ALLOW_STOP_HI_MASK);
  1406. ret = btc_populate_smc_acpi_state(rdev, table);
  1407. if (ret)
  1408. return ret;
  1409. if (eg_pi->ulv.supported) {
  1410. ret = btc_populate_ulv_state(rdev, table);
  1411. if (ret)
  1412. eg_pi->ulv.supported = false;
  1413. }
  1414. table->driverState = table->initialState;
  1415. return rv770_copy_bytes_to_smc(rdev,
  1416. pi->state_table_start,
  1417. (u8 *)table,
  1418. sizeof(RV770_SMC_STATETABLE),
  1419. pi->sram_end);
  1420. }
  1421. static void btc_set_at_for_uvd(struct radeon_device *rdev)
  1422. {
  1423. struct rv7xx_power_info *pi = rv770_get_pi(rdev);
  1424. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1425. struct radeon_ps *radeon_new_state = rdev->pm.dpm.requested_ps;
  1426. int idx = 0;
  1427. if (r600_is_uvd_state(radeon_new_state->class, radeon_new_state->class2))
  1428. idx = 1;
  1429. if ((idx == 1) && !eg_pi->smu_uvd_hs) {
  1430. pi->rlp = 10;
  1431. pi->rmp = 100;
  1432. pi->lhp = 100;
  1433. pi->lmp = 10;
  1434. } else {
  1435. pi->rlp = eg_pi->ats[idx].rlp;
  1436. pi->rmp = eg_pi->ats[idx].rmp;
  1437. pi->lhp = eg_pi->ats[idx].lhp;
  1438. pi->lmp = eg_pi->ats[idx].lmp;
  1439. }
  1440. }
  1441. static void btc_notify_uvd_to_smc(struct radeon_device *rdev)
  1442. {
  1443. struct radeon_ps *radeon_new_state = rdev->pm.dpm.requested_ps;
  1444. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1445. if (r600_is_uvd_state(radeon_new_state->class, radeon_new_state->class2)) {
  1446. rv770_write_smc_soft_register(rdev,
  1447. RV770_SMC_SOFT_REGISTER_uvd_enabled, 1);
  1448. eg_pi->uvd_enabled = true;
  1449. } else {
  1450. rv770_write_smc_soft_register(rdev,
  1451. RV770_SMC_SOFT_REGISTER_uvd_enabled, 0);
  1452. eg_pi->uvd_enabled = false;
  1453. }
  1454. }
  1455. static int btc_reset_to_default(struct radeon_device *rdev)
  1456. {
  1457. if (rv770_send_msg_to_smc(rdev, PPSMC_MSG_ResetToDefaults) != PPSMC_Result_OK)
  1458. return -EINVAL;
  1459. return 0;
  1460. }
  1461. static void btc_stop_smc(struct radeon_device *rdev)
  1462. {
  1463. int i;
  1464. for (i = 0; i < rdev->usec_timeout; i++) {
  1465. if (((RREG32(LB_SYNC_RESET_SEL) & LB_SYNC_RESET_SEL_MASK) >> LB_SYNC_RESET_SEL_SHIFT) != 1)
  1466. break;
  1467. udelay(1);
  1468. }
  1469. udelay(100);
  1470. r7xx_stop_smc(rdev);
  1471. }
  1472. static void btc_read_arb_registers(struct radeon_device *rdev)
  1473. {
  1474. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1475. struct evergreen_arb_registers *arb_registers =
  1476. &eg_pi->bootup_arb_registers;
  1477. arb_registers->mc_arb_dram_timing = RREG32(MC_ARB_DRAM_TIMING);
  1478. arb_registers->mc_arb_dram_timing2 = RREG32(MC_ARB_DRAM_TIMING2);
  1479. arb_registers->mc_arb_rfsh_rate = RREG32(MC_ARB_RFSH_RATE);
  1480. arb_registers->mc_arb_burst_time = RREG32(MC_ARB_BURST_TIME);
  1481. }
  1482. static void btc_set_arb0_registers(struct radeon_device *rdev,
  1483. struct evergreen_arb_registers *arb_registers)
  1484. {
  1485. u32 val;
  1486. WREG32(MC_ARB_DRAM_TIMING, arb_registers->mc_arb_dram_timing);
  1487. WREG32(MC_ARB_DRAM_TIMING2, arb_registers->mc_arb_dram_timing2);
  1488. val = (arb_registers->mc_arb_rfsh_rate & POWERMODE0_MASK) >>
  1489. POWERMODE0_SHIFT;
  1490. WREG32_P(MC_ARB_RFSH_RATE, POWERMODE0(val), ~POWERMODE0_MASK);
  1491. val = (arb_registers->mc_arb_burst_time & STATE0_MASK) >>
  1492. STATE0_SHIFT;
  1493. WREG32_P(MC_ARB_BURST_TIME, STATE0(val), ~STATE0_MASK);
  1494. }
  1495. static void btc_set_boot_state_timing(struct radeon_device *rdev)
  1496. {
  1497. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1498. if (eg_pi->ulv.supported)
  1499. btc_set_arb0_registers(rdev, &eg_pi->bootup_arb_registers);
  1500. }
  1501. static bool btc_is_state_ulv_compatible(struct radeon_device *rdev,
  1502. struct radeon_ps *radeon_state)
  1503. {
  1504. struct rv7xx_ps *state = rv770_get_ps(radeon_state);
  1505. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1506. struct rv7xx_pl *ulv_pl = eg_pi->ulv.pl;
  1507. if (state->low.mclk != ulv_pl->mclk)
  1508. return false;
  1509. if (state->low.vddci != ulv_pl->vddci)
  1510. return false;
  1511. /* XXX check minclocks, etc. */
  1512. return true;
  1513. }
  1514. static int btc_set_ulv_dram_timing(struct radeon_device *rdev)
  1515. {
  1516. u32 val;
  1517. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1518. struct rv7xx_pl *ulv_pl = eg_pi->ulv.pl;
  1519. radeon_atom_set_engine_dram_timings(rdev,
  1520. ulv_pl->sclk,
  1521. ulv_pl->mclk);
  1522. val = rv770_calculate_memory_refresh_rate(rdev, ulv_pl->sclk);
  1523. WREG32_P(MC_ARB_RFSH_RATE, POWERMODE0(val), ~POWERMODE0_MASK);
  1524. val = cypress_calculate_burst_time(rdev, ulv_pl->sclk, ulv_pl->mclk);
  1525. WREG32_P(MC_ARB_BURST_TIME, STATE0(val), ~STATE0_MASK);
  1526. return 0;
  1527. }
  1528. static int btc_enable_ulv(struct radeon_device *rdev)
  1529. {
  1530. if (rv770_send_msg_to_smc(rdev, PPSMC_MSG_EnableULV) != PPSMC_Result_OK)
  1531. return -EINVAL;
  1532. return 0;
  1533. }
  1534. static int btc_set_power_state_conditionally_enable_ulv(struct radeon_device *rdev)
  1535. {
  1536. int ret = 0;
  1537. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1538. struct radeon_ps *radeon_new_state = rdev->pm.dpm.requested_ps;
  1539. if (eg_pi->ulv.supported) {
  1540. if (btc_is_state_ulv_compatible(rdev, radeon_new_state)) {
  1541. // Set ARB[0] to reflect the DRAM timing needed for ULV.
  1542. ret = btc_set_ulv_dram_timing(rdev);
  1543. if (ret == 0)
  1544. ret = btc_enable_ulv(rdev);
  1545. }
  1546. }
  1547. return ret;
  1548. }
  1549. static bool btc_check_s0_mc_reg_index(u16 in_reg, u16 *out_reg)
  1550. {
  1551. bool result = true;
  1552. switch (in_reg) {
  1553. case MC_SEQ_RAS_TIMING >> 2:
  1554. *out_reg = MC_SEQ_RAS_TIMING_LP >> 2;
  1555. break;
  1556. case MC_SEQ_CAS_TIMING >> 2:
  1557. *out_reg = MC_SEQ_CAS_TIMING_LP >> 2;
  1558. break;
  1559. case MC_SEQ_MISC_TIMING >> 2:
  1560. *out_reg = MC_SEQ_MISC_TIMING_LP >> 2;
  1561. break;
  1562. case MC_SEQ_MISC_TIMING2 >> 2:
  1563. *out_reg = MC_SEQ_MISC_TIMING2_LP >> 2;
  1564. break;
  1565. case MC_SEQ_RD_CTL_D0 >> 2:
  1566. *out_reg = MC_SEQ_RD_CTL_D0_LP >> 2;
  1567. break;
  1568. case MC_SEQ_RD_CTL_D1 >> 2:
  1569. *out_reg = MC_SEQ_RD_CTL_D1_LP >> 2;
  1570. break;
  1571. case MC_SEQ_WR_CTL_D0 >> 2:
  1572. *out_reg = MC_SEQ_WR_CTL_D0_LP >> 2;
  1573. break;
  1574. case MC_SEQ_WR_CTL_D1 >> 2:
  1575. *out_reg = MC_SEQ_WR_CTL_D1_LP >> 2;
  1576. break;
  1577. case MC_PMG_CMD_EMRS >> 2:
  1578. *out_reg = MC_SEQ_PMG_CMD_EMRS_LP >> 2;
  1579. break;
  1580. case MC_PMG_CMD_MRS >> 2:
  1581. *out_reg = MC_SEQ_PMG_CMD_MRS_LP >> 2;
  1582. break;
  1583. case MC_PMG_CMD_MRS1 >> 2:
  1584. *out_reg = MC_SEQ_PMG_CMD_MRS1_LP >> 2;
  1585. break;
  1586. default:
  1587. result = false;
  1588. break;
  1589. }
  1590. return result;
  1591. }
  1592. static void btc_set_valid_flag(struct evergreen_mc_reg_table *table)
  1593. {
  1594. u8 i, j;
  1595. for (i = 0; i < table->last; i++) {
  1596. for (j = 1; j < table->num_entries; j++) {
  1597. if (table->mc_reg_table_entry[j-1].mc_data[i] !=
  1598. table->mc_reg_table_entry[j].mc_data[i]) {
  1599. table->valid_flag |= (1 << i);
  1600. break;
  1601. }
  1602. }
  1603. }
  1604. }
  1605. static int btc_set_mc_special_registers(struct radeon_device *rdev,
  1606. struct evergreen_mc_reg_table *table)
  1607. {
  1608. struct rv7xx_power_info *pi = rv770_get_pi(rdev);
  1609. u8 i, j, k;
  1610. u32 tmp;
  1611. for (i = 0, j = table->last; i < table->last; i++) {
  1612. switch (table->mc_reg_address[i].s1) {
  1613. case MC_SEQ_MISC1 >> 2:
  1614. tmp = RREG32(MC_PMG_CMD_EMRS);
  1615. table->mc_reg_address[j].s1 = MC_PMG_CMD_EMRS >> 2;
  1616. table->mc_reg_address[j].s0 = MC_SEQ_PMG_CMD_EMRS_LP >> 2;
  1617. for (k = 0; k < table->num_entries; k++) {
  1618. table->mc_reg_table_entry[k].mc_data[j] =
  1619. ((tmp & 0xffff0000)) |
  1620. ((table->mc_reg_table_entry[k].mc_data[i] & 0xffff0000) >> 16);
  1621. }
  1622. j++;
  1623. if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
  1624. return -EINVAL;
  1625. tmp = RREG32(MC_PMG_CMD_MRS);
  1626. table->mc_reg_address[j].s1 = MC_PMG_CMD_MRS >> 2;
  1627. table->mc_reg_address[j].s0 = MC_SEQ_PMG_CMD_MRS_LP >> 2;
  1628. for (k = 0; k < table->num_entries; k++) {
  1629. table->mc_reg_table_entry[k].mc_data[j] =
  1630. (tmp & 0xffff0000) |
  1631. (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff);
  1632. if (!pi->mem_gddr5)
  1633. table->mc_reg_table_entry[k].mc_data[j] |= 0x100;
  1634. }
  1635. j++;
  1636. if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
  1637. return -EINVAL;
  1638. break;
  1639. case MC_SEQ_RESERVE_M >> 2:
  1640. tmp = RREG32(MC_PMG_CMD_MRS1);
  1641. table->mc_reg_address[j].s1 = MC_PMG_CMD_MRS1 >> 2;
  1642. table->mc_reg_address[j].s0 = MC_SEQ_PMG_CMD_MRS1_LP >> 2;
  1643. for (k = 0; k < table->num_entries; k++) {
  1644. table->mc_reg_table_entry[k].mc_data[j] =
  1645. (tmp & 0xffff0000) |
  1646. (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff);
  1647. }
  1648. j++;
  1649. if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
  1650. return -EINVAL;
  1651. break;
  1652. default:
  1653. break;
  1654. }
  1655. }
  1656. table->last = j;
  1657. return 0;
  1658. }
  1659. static void btc_set_s0_mc_reg_index(struct evergreen_mc_reg_table *table)
  1660. {
  1661. u32 i;
  1662. u16 address;
  1663. for (i = 0; i < table->last; i++) {
  1664. table->mc_reg_address[i].s0 =
  1665. btc_check_s0_mc_reg_index(table->mc_reg_address[i].s1, &address) ?
  1666. address : table->mc_reg_address[i].s1;
  1667. }
  1668. }
  1669. static int btc_copy_vbios_mc_reg_table(struct atom_mc_reg_table *table,
  1670. struct evergreen_mc_reg_table *eg_table)
  1671. {
  1672. u8 i, j;
  1673. if (table->last > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
  1674. return -EINVAL;
  1675. if (table->num_entries > MAX_AC_TIMING_ENTRIES)
  1676. return -EINVAL;
  1677. for (i = 0; i < table->last; i++)
  1678. eg_table->mc_reg_address[i].s1 = table->mc_reg_address[i].s1;
  1679. eg_table->last = table->last;
  1680. for (i = 0; i < table->num_entries; i++) {
  1681. eg_table->mc_reg_table_entry[i].mclk_max =
  1682. table->mc_reg_table_entry[i].mclk_max;
  1683. for(j = 0; j < table->last; j++)
  1684. eg_table->mc_reg_table_entry[i].mc_data[j] =
  1685. table->mc_reg_table_entry[i].mc_data[j];
  1686. }
  1687. eg_table->num_entries = table->num_entries;
  1688. return 0;
  1689. }
  1690. static int btc_initialize_mc_reg_table(struct radeon_device *rdev)
  1691. {
  1692. int ret;
  1693. struct atom_mc_reg_table *table;
  1694. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1695. struct evergreen_mc_reg_table *eg_table = &eg_pi->mc_reg_table;
  1696. u8 module_index = rv770_get_memory_module_index(rdev);
  1697. table = kzalloc(sizeof(struct atom_mc_reg_table), GFP_KERNEL);
  1698. if (!table)
  1699. return -ENOMEM;
  1700. /* Program additional LP registers that are no longer programmed by VBIOS */
  1701. WREG32(MC_SEQ_RAS_TIMING_LP, RREG32(MC_SEQ_RAS_TIMING));
  1702. WREG32(MC_SEQ_CAS_TIMING_LP, RREG32(MC_SEQ_CAS_TIMING));
  1703. WREG32(MC_SEQ_MISC_TIMING_LP, RREG32(MC_SEQ_MISC_TIMING));
  1704. WREG32(MC_SEQ_MISC_TIMING2_LP, RREG32(MC_SEQ_MISC_TIMING2));
  1705. WREG32(MC_SEQ_RD_CTL_D0_LP, RREG32(MC_SEQ_RD_CTL_D0));
  1706. WREG32(MC_SEQ_RD_CTL_D1_LP, RREG32(MC_SEQ_RD_CTL_D1));
  1707. WREG32(MC_SEQ_WR_CTL_D0_LP, RREG32(MC_SEQ_WR_CTL_D0));
  1708. WREG32(MC_SEQ_WR_CTL_D1_LP, RREG32(MC_SEQ_WR_CTL_D1));
  1709. WREG32(MC_SEQ_PMG_CMD_EMRS_LP, RREG32(MC_PMG_CMD_EMRS));
  1710. WREG32(MC_SEQ_PMG_CMD_MRS_LP, RREG32(MC_PMG_CMD_MRS));
  1711. WREG32(MC_SEQ_PMG_CMD_MRS1_LP, RREG32(MC_PMG_CMD_MRS1));
  1712. ret = radeon_atom_init_mc_reg_table(rdev, module_index, table);
  1713. if (ret)
  1714. goto init_mc_done;
  1715. ret = btc_copy_vbios_mc_reg_table(table, eg_table);
  1716. if (ret)
  1717. goto init_mc_done;
  1718. btc_set_s0_mc_reg_index(eg_table);
  1719. ret = btc_set_mc_special_registers(rdev, eg_table);
  1720. if (ret)
  1721. goto init_mc_done;
  1722. btc_set_valid_flag(eg_table);
  1723. init_mc_done:
  1724. kfree(table);
  1725. return ret;
  1726. }
  1727. static void btc_init_stutter_mode(struct radeon_device *rdev)
  1728. {
  1729. struct rv7xx_power_info *pi = rv770_get_pi(rdev);
  1730. u32 tmp;
  1731. if (pi->mclk_stutter_mode_threshold) {
  1732. if (pi->mem_gddr5) {
  1733. tmp = RREG32(MC_PMG_AUTO_CFG);
  1734. if ((0x200 & tmp) == 0) {
  1735. tmp = (tmp & 0xfffffc0b) | 0x204;
  1736. WREG32(MC_PMG_AUTO_CFG, tmp);
  1737. }
  1738. }
  1739. }
  1740. }
  1741. void btc_dpm_reset_asic(struct radeon_device *rdev)
  1742. {
  1743. rv770_restrict_performance_levels_before_switch(rdev);
  1744. btc_disable_ulv(rdev);
  1745. btc_set_boot_state_timing(rdev);
  1746. rv770_set_boot_state(rdev);
  1747. }
  1748. int btc_dpm_set_power_state(struct radeon_device *rdev)
  1749. {
  1750. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1751. btc_disable_ulv(rdev);
  1752. btc_set_boot_state_timing(rdev);
  1753. rv770_restrict_performance_levels_before_switch(rdev);
  1754. if (eg_pi->pcie_performance_request)
  1755. cypress_notify_link_speed_change_before_state_change(rdev);
  1756. rv770_set_uvd_clock_before_set_eng_clock(rdev);
  1757. rv770_halt_smc(rdev);
  1758. btc_set_at_for_uvd(rdev);
  1759. if (eg_pi->smu_uvd_hs)
  1760. btc_notify_uvd_to_smc(rdev);
  1761. cypress_upload_sw_state(rdev);
  1762. if (eg_pi->dynamic_ac_timing)
  1763. cypress_upload_mc_reg_table(rdev);
  1764. cypress_program_memory_timing_parameters(rdev);
  1765. rv770_resume_smc(rdev);
  1766. rv770_set_sw_state(rdev);
  1767. rv770_set_uvd_clock_after_set_eng_clock(rdev);
  1768. if (eg_pi->pcie_performance_request)
  1769. cypress_notify_link_speed_change_after_state_change(rdev);
  1770. btc_set_power_state_conditionally_enable_ulv(rdev);
  1771. #if 0
  1772. /* XXX */
  1773. rv770_unrestrict_performance_levels_after_switch(rdev);
  1774. #endif
  1775. return 0;
  1776. }
  1777. int btc_dpm_enable(struct radeon_device *rdev)
  1778. {
  1779. struct rv7xx_power_info *pi = rv770_get_pi(rdev);
  1780. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1781. if (pi->gfx_clock_gating)
  1782. btc_cg_clock_gating_default(rdev);
  1783. if (btc_dpm_enabled(rdev))
  1784. return -EINVAL;
  1785. if (pi->mg_clock_gating)
  1786. btc_mg_clock_gating_default(rdev);
  1787. if (eg_pi->ls_clock_gating)
  1788. btc_ls_clock_gating_default(rdev);
  1789. if (pi->voltage_control) {
  1790. rv770_enable_voltage_control(rdev, true);
  1791. cypress_construct_voltage_tables(rdev);
  1792. }
  1793. if (pi->mvdd_control)
  1794. cypress_get_mvdd_configuration(rdev);
  1795. if (eg_pi->dynamic_ac_timing)
  1796. btc_initialize_mc_reg_table(rdev);
  1797. if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_BACKBIAS)
  1798. rv770_enable_backbias(rdev, true);
  1799. if (pi->dynamic_ss)
  1800. cypress_enable_spread_spectrum(rdev, true);
  1801. if (pi->thermal_protection)
  1802. rv770_enable_thermal_protection(rdev, true);
  1803. rv770_setup_bsp(rdev);
  1804. rv770_program_git(rdev);
  1805. rv770_program_tp(rdev);
  1806. rv770_program_tpp(rdev);
  1807. rv770_program_sstp(rdev);
  1808. rv770_program_engine_speed_parameters(rdev);
  1809. cypress_enable_display_gap(rdev);
  1810. rv770_program_vc(rdev);
  1811. if (pi->dynamic_pcie_gen2)
  1812. btc_enable_dynamic_pcie_gen2(rdev, true);
  1813. if (rv770_upload_firmware(rdev))
  1814. return -EINVAL;
  1815. cypress_get_table_locations(rdev);
  1816. btc_init_smc_table(rdev);
  1817. if (eg_pi->dynamic_ac_timing)
  1818. cypress_populate_mc_reg_table(rdev);
  1819. cypress_program_response_times(rdev);
  1820. r7xx_start_smc(rdev);
  1821. cypress_notify_smc_display_change(rdev, false);
  1822. cypress_enable_sclk_control(rdev, true);
  1823. if (eg_pi->memory_transition)
  1824. cypress_enable_mclk_control(rdev, true);
  1825. cypress_start_dpm(rdev);
  1826. if (pi->gfx_clock_gating)
  1827. btc_cg_clock_gating_enable(rdev, true);
  1828. if (pi->mg_clock_gating)
  1829. btc_mg_clock_gating_enable(rdev, true);
  1830. if (eg_pi->ls_clock_gating)
  1831. btc_ls_clock_gating_enable(rdev, true);
  1832. if (rdev->irq.installed &&
  1833. r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
  1834. PPSMC_Result result;
  1835. rv770_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
  1836. rdev->irq.dpm_thermal = true;
  1837. radeon_irq_set(rdev);
  1838. result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt);
  1839. if (result != PPSMC_Result_OK)
  1840. DRM_DEBUG_KMS("Could not enable thermal interrupts.\n");
  1841. }
  1842. rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
  1843. btc_init_stutter_mode(rdev);
  1844. return 0;
  1845. };
  1846. void btc_dpm_disable(struct radeon_device *rdev)
  1847. {
  1848. struct rv7xx_power_info *pi = rv770_get_pi(rdev);
  1849. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1850. if (!btc_dpm_enabled(rdev))
  1851. return;
  1852. rv770_clear_vc(rdev);
  1853. if (pi->thermal_protection)
  1854. rv770_enable_thermal_protection(rdev, false);
  1855. if (pi->dynamic_pcie_gen2)
  1856. btc_enable_dynamic_pcie_gen2(rdev, false);
  1857. if (rdev->irq.installed &&
  1858. r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
  1859. rdev->irq.dpm_thermal = false;
  1860. radeon_irq_set(rdev);
  1861. }
  1862. if (pi->gfx_clock_gating)
  1863. btc_cg_clock_gating_enable(rdev, false);
  1864. if (pi->mg_clock_gating)
  1865. btc_mg_clock_gating_enable(rdev, false);
  1866. if (eg_pi->ls_clock_gating)
  1867. btc_ls_clock_gating_enable(rdev, false);
  1868. rv770_stop_dpm(rdev);
  1869. btc_reset_to_default(rdev);
  1870. btc_stop_smc(rdev);
  1871. cypress_enable_spread_spectrum(rdev, false);
  1872. }
  1873. void btc_dpm_setup_asic(struct radeon_device *rdev)
  1874. {
  1875. struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
  1876. rv770_get_memory_type(rdev);
  1877. rv740_read_clock_registers(rdev);
  1878. btc_read_arb_registers(rdev);
  1879. rv770_read_voltage_smio_registers(rdev);
  1880. if (eg_pi->pcie_performance_request)
  1881. cypress_advertise_gen2_capability(rdev);
  1882. rv770_get_pcie_gen2_status(rdev);
  1883. rv770_enable_acpi_pm(rdev);
  1884. }
  1885. int btc_dpm_init(struct radeon_device *rdev)
  1886. {
  1887. struct rv7xx_power_info *pi;
  1888. struct evergreen_power_info *eg_pi;
  1889. int index = GetIndexIntoMasterTable(DATA, ASIC_InternalSS_Info);
  1890. u16 data_offset, size;
  1891. u8 frev, crev;
  1892. struct atom_clock_dividers dividers;
  1893. int ret;
  1894. eg_pi = kzalloc(sizeof(struct evergreen_power_info), GFP_KERNEL);
  1895. if (eg_pi == NULL)
  1896. return -ENOMEM;
  1897. rdev->pm.dpm.priv = eg_pi;
  1898. pi = &eg_pi->rv7xx;
  1899. rv770_get_max_vddc(rdev);
  1900. eg_pi->ulv.supported = false;
  1901. pi->acpi_vddc = 0;
  1902. eg_pi->acpi_vddci = 0;
  1903. pi->min_vddc_in_table = 0;
  1904. pi->max_vddc_in_table = 0;
  1905. ret = rv7xx_parse_power_table(rdev);
  1906. if (ret)
  1907. return ret;
  1908. if (rdev->pm.dpm.voltage_response_time == 0)
  1909. rdev->pm.dpm.voltage_response_time = R600_VOLTAGERESPONSETIME_DFLT;
  1910. if (rdev->pm.dpm.backbias_response_time == 0)
  1911. rdev->pm.dpm.backbias_response_time = R600_BACKBIASRESPONSETIME_DFLT;
  1912. ret = radeon_atom_get_clock_dividers(rdev, COMPUTE_ENGINE_PLL_PARAM,
  1913. 0, false, &dividers);
  1914. if (ret)
  1915. pi->ref_div = dividers.ref_div + 1;
  1916. else
  1917. pi->ref_div = R600_REFERENCEDIVIDER_DFLT;
  1918. pi->mclk_strobe_mode_threshold = 40000;
  1919. pi->mclk_edc_enable_threshold = 40000;
  1920. eg_pi->mclk_edc_wr_enable_threshold = 40000;
  1921. pi->rlp = RV770_RLP_DFLT;
  1922. pi->rmp = RV770_RMP_DFLT;
  1923. pi->lhp = RV770_LHP_DFLT;
  1924. pi->lmp = RV770_LMP_DFLT;
  1925. eg_pi->ats[0].rlp = RV770_RLP_DFLT;
  1926. eg_pi->ats[0].rmp = RV770_RMP_DFLT;
  1927. eg_pi->ats[0].lhp = RV770_LHP_DFLT;
  1928. eg_pi->ats[0].lmp = RV770_LMP_DFLT;
  1929. eg_pi->ats[1].rlp = BTC_RLP_UVD_DFLT;
  1930. eg_pi->ats[1].rmp = BTC_RMP_UVD_DFLT;
  1931. eg_pi->ats[1].lhp = BTC_LHP_UVD_DFLT;
  1932. eg_pi->ats[1].lmp = BTC_LMP_UVD_DFLT;
  1933. eg_pi->smu_uvd_hs = true;
  1934. pi->voltage_control =
  1935. radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC);
  1936. pi->mvdd_control =
  1937. radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_MVDDC);
  1938. eg_pi->vddci_control =
  1939. radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDCI);
  1940. if (atom_parse_data_header(rdev->mode_info.atom_context, index, &size,
  1941. &frev, &crev, &data_offset)) {
  1942. pi->sclk_ss = true;
  1943. pi->mclk_ss = true;
  1944. pi->dynamic_ss = true;
  1945. } else {
  1946. pi->sclk_ss = false;
  1947. pi->mclk_ss = false;
  1948. pi->dynamic_ss = true;
  1949. }
  1950. pi->asi = RV770_ASI_DFLT;
  1951. pi->pasi = CYPRESS_HASI_DFLT;
  1952. pi->vrc = CYPRESS_VRC_DFLT;
  1953. pi->power_gating = false;
  1954. pi->gfx_clock_gating = true;
  1955. pi->mg_clock_gating = true;
  1956. pi->mgcgtssm = true;
  1957. eg_pi->ls_clock_gating = false;
  1958. eg_pi->sclk_deep_sleep = false;
  1959. pi->dynamic_pcie_gen2 = true;
  1960. if (pi->gfx_clock_gating &&
  1961. (rdev->pm.int_thermal_type != THERMAL_TYPE_NONE))
  1962. pi->thermal_protection = true;
  1963. else
  1964. pi->thermal_protection = false;
  1965. pi->display_gap = true;
  1966. if (rdev->flags & RADEON_IS_MOBILITY)
  1967. pi->dcodt = true;
  1968. else
  1969. pi->dcodt = false;
  1970. pi->ulps = true;
  1971. eg_pi->dynamic_ac_timing = true;
  1972. eg_pi->abm = true;
  1973. eg_pi->mcls = true;
  1974. eg_pi->light_sleep = true;
  1975. eg_pi->memory_transition = true;
  1976. #if defined(CONFIG_ACPI)
  1977. eg_pi->pcie_performance_request =
  1978. radeon_acpi_is_pcie_performance_request_supported(rdev);
  1979. #else
  1980. eg_pi->pcie_performance_request = false;
  1981. #endif
  1982. if (rdev->family == CHIP_BARTS)
  1983. eg_pi->dll_default_on = true;
  1984. else
  1985. eg_pi->dll_default_on = false;
  1986. eg_pi->sclk_deep_sleep = false;
  1987. if (ASIC_IS_LOMBOK(rdev))
  1988. pi->mclk_stutter_mode_threshold = 30000;
  1989. else
  1990. pi->mclk_stutter_mode_threshold = 0;
  1991. pi->sram_end = SMC_RAM_END;
  1992. return 0;
  1993. }
  1994. void btc_dpm_fini(struct radeon_device *rdev)
  1995. {
  1996. int i;
  1997. for (i = 0; i < rdev->pm.dpm.num_ps; i++) {
  1998. kfree(rdev->pm.dpm.ps[i].ps_priv);
  1999. }
  2000. kfree(rdev->pm.dpm.ps);
  2001. kfree(rdev->pm.dpm.priv);
  2002. }