ddp_dump.c 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812
  1. /* Copyright Statement:
  2. *
  3. * This software/firmware and related documentation ("MediaTek Software") are
  4. * protected under relevant copyright laws. The information contained herein
  5. * is confidential and proprietary to MediaTek Inc. and/or its licensors.
  6. * Without the prior written permission of MediaTek inc. and/or its licensors,
  7. * any reproduction, modification, use or disclosure of MediaTek Software,
  8. * and information contained herein, in whole or in part, shall be strictly prohibited.
  9. */
  10. /* MediaTek Inc. (C) 2015. All rights reserved.
  11. *
  12. * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  13. * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  14. * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
  15. * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  18. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  19. * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  20. * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
  21. * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
  22. * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
  23. * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
  24. * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
  25. * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
  26. * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  27. * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  28. * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
  29. * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  30. */
  31. #define LOG_TAG "DUMP"
  32. #include <platform/ddp_info.h>
  33. #include <platform/ddp_log.h>
  34. #include <platform/ddp_path.h>
  35. #include <platform/ddp_dump.h>
  36. #include <platform/ddp_rdma.h>
  37. #include <platform/disp_drv_platform.h>
  38. #include "platform/ddp_reg.h"
  39. #include <platform/ddp_dsi.h>
  40. #include <platform/ddp_postmask.h>
  41. static const char* ddp_signal[6][32] = {
  42. {
  43. "AFBC_WDMA0_SEL__TO__DISP_UFBC_WDMA0",
  44. "AFBC_WDMA1_SEL__TO__DISP_UFBC_WDMA1",
  45. "DISP_AAL0__TO__DISP_GAMMA0",
  46. "DISP_AAL0_SEL__TO__DISP_AAL0",
  47. "DISP_AAL1__TO__DISP_GAMMA1",
  48. "DISP_CCORR0__TO__DISP_CCORR0_SOUT",
  49. "DISP_CCORR0_SOUT_OUT0__TO__DISP_MDP_AAL4_SEL_IN0",
  50. "DISP_CCORR0_SOUT_OUT1__TO__DISP_AAL0_SEL_IN1",
  51. "DISP_CCORR1__TO__DISP_CCORR1_SOUT",
  52. "DISP_CCORR1_SOUT_OUT0__TO__DISP_MDP_AAL5_SEL_IN0",
  53. "DISP_CCORR1_SOUT_OUT1__TO__MDP_AAL1_SEL_IN1",
  54. "DISP_COLOR0__TO__DISP_COLOR0_OUT_SEL_IN0",
  55. "DISP_COLOR0_OUT_SEL__TO__DISP_CCORR0",
  56. "DISP_COLOR1__TO__DISP_COLOR1_OUT_SEL_IN0",
  57. "DISP_COLOR1_OUT_SEL__TO__DISP_CCORR1",
  58. "DISP_DITHER0__TO__DISP_DITHER0_MOUT",
  59. "DISP_DITHER0_MOUT_OUT0__TO__DSI0_SEL_IN1",
  60. "DISP_DITHER0_MOUT_OUT1__to__DISP_WDMA0_SEL_IN0",
  61. "DISP_DITHER0_MOUT_OUT2__TO__DSI1_SEL_IN2",
  62. "DISP_DITHER0_MOUT_OUT3__TO__DISP_PQ0_SOUT",
  63. "DISP_DITHER1__TO__DISP_DITHER1_MOUT",
  64. "DISP_DITHER1_MOUT_OUT0__TO__DSI1_SEL_IN1",
  65. "DISP_DITHER1_MOUT_OUT1__TO__DISP_WDMA1_SEL_IN0",
  66. "DISP_DITHER1_MOUT_OUT2__TO__DISP_PQ1_SOUT",
  67. "DISP_DP_WRAP_SEL__TO__DP_INTD0",
  68. "DISP_DSC_WRAP0_OUT0__TO__DISP_DSC_WRAP_SOUT",
  69. "DISP_DSC_WRAP0_OUT1__TO__DSI1_SEL_IN3",
  70. "DISP_DSC_WRAP_SOUT_OUT0__TO__DSI0_SEL_IN3",
  71. "DISP_DSC_WRAP_SOUT_OUT1__TO__DISP_DP_WRAP_SEL_IN0",
  72. "DISP_DSI0_DSC_WRAP_SOUT_OUT0__TO__DSI0_SEL_IN2",
  73. "DISP_DSI0_DSC_WRAP_SOUT_OUT1__TO__DISP_DSC_WRAP0_IN0",
  74. "DISP_GAMMA0__TO__DISP_POSTMASK0",
  75. },
  76. {
  77. "DISP_GAMMA1__TO__DISP_POSTMASK1",
  78. "DISP_MDP_AAL4_MDP_HDR4_SEL__TO__MDP_RSZ4",
  79. "DISP_MDP_AAL4_SEL__TO__MDP_AAL4",
  80. "DISP_MDP_AAL4_SOUT_OUT0__TO__DISP_AAL0_SEL_IN0",
  81. "DISP_MDP_AAL4_SOUT_OUT1__TO__DISP_MDP_AAL4_MDP_HDR4_SEL_IN1",
  82. "DISP_MDP_AAL5_MDP_HDR5_SEL__TO__MDP_RSZ5",
  83. "DISP_MDP_AAL5_SEL__TO__MDP_AAL5",
  84. "DISP_MDP_AAL5_SOUT_OUT0__TO__MDP_AAL1_SEL_IN0",
  85. "DISP_MDP_AAL5_SOUT_OUT1__TO__DISP_MDP_AAL5_MDP_HDR5_SEL_IN1",
  86. "DISP_MDP_TDSHP4_SOUT_OUT0__TO__DISP_OVL0_2L_IN1",
  87. "DISP_MDP_TDSHP4_SOUT_OUT1__TO__DISP_OVL0_IN1",
  88. "DISP_MDP_TDSHP5_SOUT_OUT0__TO__DISP_OVL1_2L_IN1",
  89. "DISP_MDP_TDSHP5_SOUT_OUT1__TO__DISP_OVL1_IN1",
  90. "DISP_MERGE0__TO__DISP_RDMA4_PQ0_MERGE0_SEL_IN2",
  91. "DISP_MERGE1__TO__DISP_DP_WRAP_SEL_IN1",
  92. "DISP_OVL0_2L_BLENDOUT_SOUT_OUT0__TO__DISP_TOVL0_OUT0_SEL_IN0",
  93. "DISP_OVL0_2L_BLENDOUT_SOUT_OUT1__TO__DISP_TOVL0_OUT1_SEL_IN0",
  94. "DISP_OVL0_2L_OUT0__TO__DISP_OVL0_2L_BLENDOUT_SOUT",
  95. "DISP_OVL0_2L_OUT1__TO__DISP_OVL0_2L_OVL1_OVL1_2L_BGOUT_SEL_IN1",
  96. "DISP_OVL0_2L_OUT2__TO__DISP_OVL0_OVL0_2L_PGOUT_SEL_IN1",
  97. "DISP_OVL0_2L_OVL1_OVL1_2L_BGOUT_SEL__TO__DISP_OVL0_IN0",
  98. "DISP_OVL0_BLENDOUT_SOUT_OUT0__TO__DISP_TOVL0_OUT0_SEL_IN1",
  99. "DISP_OVL0_BLENDOUT_SOUT_OUT1__TO__DISP_TOVL0_OUT1_SEL_IN1",
  100. "DISP_OVL0_OUT0__TO__DISP_OVL0_BLENDOUT_SOUT",
  101. "DISP_OVL0_OUT1__TO__DISP_OVL0_OVL1_OVL1_2L_BGOUT_SEL_IN1",
  102. "DISP_OVL0_OUT2__TO__DISP_OVL0_OVL0_2L_PGOUT_SEL_IN0",
  103. "DISP_OVL0_OVL0_2L_PGOUT_SEL__TO__DISP_TOVL0_PQOUT_MDP_RDMA4_SEL_IN1",
  104. "DISP_OVL0_OVL1_OVL1_2L_BGOUT_SEL__TO__DISP_OVL0_2L_IN0",
  105. "DISP_OVL1_2L_BGOUT_SOUT_OUT0__TO__DISP_OVL1_IN0",
  106. "DISP_OVL1_2L_BGOUT_SOUT_OUT1__TO__DISP_OVL1_OVL1_2L_BGOUT_SEL_IN0",
  107. "DISP_OVL1_2L_BLENDOUT_SOUT_OUT0__TO_DISP_TOVL1_OUT0_SEL_IN0",
  108. "DISP_OVL1_2L_BLENDOUT_SOUT_OUT1__TO__DISP_OVL1_OVL1_2L_BGOUT_SEL_IN0",
  109. },
  110. {
  111. "DISP_OVL1_2L_OUT0__TO__DISP_OVL1_2L_BLENDOUT_SOUT",
  112. "DISP_OVL1_2L_OUT1__TO__DISP_OVL1_2L_BGOUT_SOUT",
  113. "DISP_OVL1_2L_OUT2__TO__DISP_OVL1_OVL1_2L_PQOUT_SEL_IN1",
  114. "DISP_OVL1_BGOUT_SOUT_OUT0__TO__DISP_OVL1_2L_IN0",
  115. "DISP_OVL1_BGOUT_SOUT_OUT1__TO__DISP_OVL1_OVL1_2L_BGOUT_SEL_IN1",
  116. "DISP_OVL1_BLENDOUT_SOUT_OUT0__TO__DISP_TOVL1_OUT0_SEL_IN1",
  117. "DISP_OVL1_BLENDOUT_SOUT_OUT1__TO__DISP_TOVL1_OUT1_SEL_IN1",
  118. "DISP_OVL1_OUT0__TO__DISP_OVL1_BLENDOUT_SOUT",
  119. "DISP_OVL1_OUT1__TO__DISP_OVL1_BGOUT_SOUT",
  120. "DISP_OVL1_OUT2__TO__DISP_OVL1_OUT1_2L_PQOUT_SEL_IN0",
  121. "DISP_OVL1_OVL1_2L_BGOUT_SEL__TO__DISP_OVL1_OVL1_2L_BGOUT_SOUT",
  122. "DISP_OVL1_OVL1_2L_BGOUT_SOUT_OUT0__TO__DISP_OVL0_OVL1_OVL1_2L_BGOUT_SEL_IN",
  123. "DISP_OVL1_OVL1_2L_BGOUT_SOUT_OUT1__TO__DISP_OVL0_2L_OUT1_OVL1_2L_BGOUT_SEL_IN",
  124. "DISP_OVL1_OVL1_2L_PQOUT_SEL__TO__DISP_TOVL1_PQOUT_MDP_RDMA5_SEL_IN1",
  125. "DISP_OVL2_2L__TO__DISP_OVL2_2L_OUT0_MOUT",
  126. "DISP_OVL2_2L_OUT0_MOUT_OUT0__TO__DISP_RDMA4",
  127. "DISP_OVL2_2L_OUT0_MOUT_OUT1__TO__DISP_WDMA0_SEL_IN4",
  128. "DISP_OVL3_2L_OUT0__TO__DISP_OVL3_2L_OUT0_MOUT",
  129. "DISP_OVL3_2L_OUT0_MOUT_OUT0__TO__DISP_RDMA5",
  130. "DISP_OVL3_2L_OUT0_MOUT_OUT1__TO__DISP_WDMA1_SEL_IN4",
  131. "DISP_OVL3_2L_OUT1__TO__DISP_OVL2_2L",
  132. "DISP_POSTMASK0__TO__DISP_DITHER0",
  133. "DISP_POSTMASK1__TO__DISP_DITHER1",
  134. "DISP_PQ0_SOUT_OUT0__TO__DISP_MERGE0_IN0",
  135. "DISP_PQ0_SOUT_OUT1__TO__DISP_RDMA4_PQ0_MERGE0_SEL_IN1",
  136. "DISP_PQ1_SOUT_OUT0__TO__DISP_MERGE0_IN0",
  137. "DISP_PQ1_SOUT_OUT1__TO__DISP_RDMA5_PQ1_SEL_IN1",
  138. "DISP_RDMA0__TO__DISP_RDMA0_SOUT",
  139. "DISP_RDMA0_RSZ0_SEL__TO__DISP_RDMA0_RSZ0_SOUT",
  140. "DISP_RDMA0_RSZ0_SOUT_OUT0__TO__DSI0_SEL_IN0",
  141. "DISP_RDMA0_RSZ0_SOUT_OUT1__TO__DISP_COLOR0",
  142. "DISP_RDMA0_RSZ0_SOUT_OUT2__TO_DISP_COLOR0_OUT_SEL_IN1",
  143. },
  144. {
  145. "DISP_RDMA0_SEL__TO__DISP_RDMA0",
  146. "DISP_RDMA0_SOUT_OUT0__TO__DISP_RDMA0_RSZ0_SEL_IN0",
  147. "DISP_RDMA0_SOUT_OUT1__TO__DISP_RSZ0_SEL_IN2",
  148. "DISP_RDMA1__TO__DISP_RDMA1_SOUT",
  149. "DISP_RDMA1_TSZ1_SEL__TO__DISP_RDMA1_RSZ1_SOUT",
  150. "DISP_RDMA1_RSZ1_SOUT_OUT0__TO__DSI1_SEL_IN0",
  151. "DISP_RDMA1_RsZ1_SOUT_OUT1__TO__DISP_COLOR1",
  152. "DISP_RDMA1_RSZ1_SOUT_OUT2__TO__DISP_COLOR1_OUT_SEL_IN1",
  153. "DISP_RDMA1_SEL__TO__DISP_RDMA1",
  154. "DISP_RDMA1_SOUT_OUT0__TO__DISP_RDMA1_RSZ1_SEL_IN0",
  155. "DISP_RDMA1_SOUT_OUT1__TO__DISP_RSZ1_SEL_IN2",
  156. "DISP_RDMA2_RSZ0_RSZ1_SEL__TO__DISP_RDMA2_RSZ0_RSZ1_SOUT",
  157. "DISP_RDMA2_RSZ0_RSZ1_SOUT_OUT0__TO__DISP_OVL0_2L_IN2",
  158. "DISP_RDMA2_RSZ0_RSZ1_SOUT_OUT1__TO__DISP_OVL0_IN2",
  159. "DISP_RDMA3_SOUT_OUT0__TO__DISP_OVL1_2L_IN2",
  160. "DISP_RDMA3_SOUT_OUT1__TO__DISP_OVL1_IN2",
  161. "DISP_RDMA4__TO__DISP_RDMA4_SOUT",
  162. "DISP_RDMA4_PQ0_MERGE0_SEL__TO__DISP_DSI0_DSC_WRAP_SOUT",
  163. "DISP_RDMA4_SOUT_OUT0__TO__DISP_MERGE1_IN0",
  164. "DISP_RDMA4_SOUT_OUT1__TO__DISP_RDMA4_PQ0_MERGE0_SEL_IN0",
  165. "DISP_RDMA4_SOUT_OUT2__TO__DISP_DP_WRAP_SEL_IN2",
  166. "DISP_RDMA5__TO__DISP_RDMA5_SOUT",
  167. "DISP_RDMA5_PQ1_SEL__TO__DISP_DSC_WRAP0_IN1",
  168. "DISP_RDMA5_SOUT_OUT0__TO__DISP_MERGE1_IN1",
  169. "DISP_RDMA5_SOUT_OUT1__TO__DISP_RDMA5_PQ1_SEL_IN0",
  170. "DISP_RSZ0__TO__DISP_RSZ0_MOUT",
  171. "DISP_RSZ0_MOUT_OUT0__TO__DISP_RDMA0_SEL_IN1",
  172. "DISP_RSZ0_MOUT_OUT1__TO__DISP_WDMA0_SEL_IN1",
  173. "DISP_RSZ0_MOUT_OUT2__TO__DISP_RDMA0_RSZ0_SEL_IN1",
  174. "DISP_RSZ0_MOUT_OUT3__TO_DISP_RDMA2_RSZ0_RSZ1_SEL_IN0",
  175. "DISP_RSZ0_SEL__TO__DISP_RSZ0",
  176. "DISP_RSZ1__TO__DISP_RSZ1_MOUT",
  177. },
  178. {
  179. "DISP_RSZ1_MOUT_OUT0__TO__DISP_RDMA1_SEL_IN1",
  180. "DISP_RSZ1_MOUT_OUT1__TO__DISP_WDMA1_SEL_IN1",
  181. "DISP_RSZ1_MOUT_OUT2__TO__DISP_RDMA1_RSZ1_SEL_IN1",
  182. "DISP_RSZ1_MOUT_OUT3__TO__DISP_RDMA2_RSZ0_RSZ1_SEL_IN1",
  183. "DISP_RSZ1_MOUT_OUT4__TO__DISP_RDMA3_SOUT",
  184. "DISP_RSZ1_SEL__TO__DISP_RSZ1",
  185. "DISP_TOVL0_OUT0_MOUT_OUT0__TO__DISP_WDMA0_SEL_IN2",
  186. "DISP_TOVL0_OUT0_MOUT_OUT1__TO__DISP_RSZ0_SEL_IN0",
  187. "DISP_TOVL0_OUT0_MOUT_OUT2__TO__AFBC_WDMA0_SEL_IN0",
  188. "DISP_TOVL0_OUT0_SEL__TO__DISP_TOVL0_OUT0_MOUT",
  189. "DISP_TOVL0_OUT1_MOUT_OUT0__TO__DISP_RDMA0_SEL_IN0",
  190. "DISP_TOVL0_OUT1_MOUT_OUT1__TO__DISP_RSZ0_SEL_IN1",
  191. "DISP_TOVL0_OUT1_MOUT_OUT2__TO__DISP_WDMA0_SEL_IN3",
  192. "DISP_TOVL0_OUT1_MOUT_OUT3__TO__AFBC_WDMA0_SEL_IN1",
  193. "DISP_TOVL0_OUT1_SEL__TO__DISP_TOVL0_OUT1_MOUT",
  194. "DISP_TOVL0_PQOUT_MDP_RDMA4_SEL__TO__MDP_HDR4",
  195. "DISP_TOVL1_OUT0_MOUT_OUT0__TO__DISP_WDMA1_SEL_IN2",
  196. "DISP_TOVL1_OUT0_MOUT_OUT1__TO__DISP_RSZ1_SEL_IN0",
  197. "DISP_TOVL1_OUT0_MOUT_OUT2__TO__AFBC_WDMA1_SEL_IN0",
  198. "DISP_TOVL1_OUT0_SEL__TO__DISP_TOVL1_OUT0_MOUT",
  199. "DISP_TOVL1_OUT1_MOUT_OUT0__TO__DISP_RDMA1_SEL_IN0",
  200. "DISP_TOVL1_OUT1_MOUT_OUT1__TO__DISP_RSZ1_SEL_IN1",
  201. "DISP_TOVL1_OUT1_MOUT_OUT2__TO__DISP_WDMA1_SEL_IN3",
  202. "DISP_TOVL1_OUT1_MOUT_OUT3__TO__AFBC_WDMA1_SEL_IN1",
  203. "DISP_TOVL1_OUT1_SEL__TO__DISP_TOVL1_OUT1_MOUT",
  204. "DISP_TOVL1_PQOUT_MDP_RDMA5_SEL__TO__MDP_HDR5",
  205. "DISP_WDMA0_SEL__TO__DISP_WDMA0",
  206. "DISP_WDMA1_SEL__TO__DISP_WDMA1",
  207. "DSI0_SEL__TO__THP_LMT_DSI0",
  208. "DSI1_SEL__TO__THP_LMT_DSI1",
  209. "MDP_AAL1_SEL__TO__DISP_AAL1",
  210. "MDP_AAL4__TO__DISP_MDP_AAL4_SOUT",
  211. },
  212. {
  213. "MDP_AAL4_SOUT_OUT0__TO__DISP_MDP_AAL4_MDP_HDR4_SEL_IN0",
  214. "MDP_AAL4_SOUT_OUT1__TO__DISP_MDP_AAL4_SEL_IN1",
  215. "MDP_AAL5__TO__DISP_MDP_AAL5_SOUT",
  216. "MDP_AAL5_SOUT_OUT0__TO__DISP_MDP_AAL5_MDP_HDR5_SEL_IN0",
  217. "MDP_AAL5_SOUT_OUT1__TO__DIS_MDP_AAL5_SEL_IN1",
  218. "MDP_HDR4__TO__MDP_AAL4_SOUT",
  219. "MDP_HDR5__TO__MDP_AAL5_SOUT",
  220. "MDP_RDMA4__TO__DISP_TOVL0_PQOUT_MDP_RDMA4_SEL_IN0",
  221. "MDP_RDMA5__TO__DISP_TOVL1_PQOUT_MDP_RDMA5_SEL_IN0",
  222. "MDP_RSZ4__TO__MDP_TDSHP4",
  223. "MDP_RSZ5__TO__MDP_TDSHP5",
  224. "MDP_TDSHP4__TO__DISP_MDP_TDSHP4_SOUT",
  225. "MDP_TDSHP5__TO__DISP_MDP_TDSHP5_SOUT",
  226. "THP_LMT_DSI1__TO__DSI1",
  227. },
  228. };
  229. static char *ddp_greq_name(int bit)
  230. {
  231. switch (bit) {
  232. case 0:
  233. return "OVL0";
  234. case 1:
  235. return "OVL0_2L";
  236. case 2:
  237. return "DISP_RDMA0";
  238. case 3:
  239. return "DISP_WDMA0";
  240. case 4:
  241. return "MDP_RDMA0";
  242. case 5:
  243. return "MDP_WDMA0";
  244. case 6:
  245. return "MDP_WROT0";
  246. case 7:
  247. return "DISP_FAKE";
  248. default:
  249. return NULL;
  250. }
  251. }
  252. static char *ddp_get_mutex_module0_name(unsigned int bit)
  253. {
  254. switch (bit) {
  255. case 0: return "disp_ovl0";
  256. case 1: return "disp_ovl0_2l";
  257. case 2: return "disp_rdma0";
  258. case 3: return "disp_wdma0";
  259. case 4: return "disp_color0";
  260. case 5: return "disp_ccorr0";
  261. case 6: return "disp_aal0";
  262. case 7: return "disp_gamma0";
  263. case 8: return "disp_dither0";
  264. case 9: return "dsi0";
  265. case 10: return "disp_rsz0";
  266. case 11: return "disp_pwm0";
  267. case 12: return "disp_ovl1";
  268. case 13: return "disp_ovl1_2l";
  269. case 14: return "disp_rdma1";
  270. case 15: return "disp_wdma1";
  271. case 16: return "disp_color1";
  272. case 17: return "disp_ccorr1";
  273. case 18: return "disp_aal1";
  274. case 19: return "disp_gamma1";
  275. case 20: return "disp_dither1";
  276. case 21: return "dsi1";
  277. case 22: return "disp_rsz1";
  278. case 23: return "disp_ovl2";
  279. case 24: return "disp_ovl3";
  280. case 25: return "disp_postmask0";
  281. case 26: return "disp_postmask1";
  282. case 27: return "disp_merge0";
  283. case 28: return "disp_merge1";
  284. case 29: return "disp_dsc_wrap";
  285. case 30: return "disp_dsc_wrap_1";
  286. case 31: return "dp_intf";
  287. default: return "mutex-unknown";
  288. }
  289. }
  290. static char *ddp_get_mutex_module1_name(unsigned int bit)
  291. {
  292. switch (bit) {
  293. case 0: return "mdp_aal4";
  294. default: return "mutex-unknown";
  295. }
  296. }
  297. char *ddp_get_fmt_name(DISP_MODULE_ENUM module, unsigned int fmt)
  298. {
  299. if (module == DISP_MODULE_WDMA0) {
  300. switch (fmt) {
  301. case 0:
  302. return "rgb565";
  303. case 1:
  304. return "rgb888";
  305. case 2:
  306. return "rgba8888";
  307. case 3:
  308. return "argb8888";
  309. case 4:
  310. return "uyvy";
  311. case 5:
  312. return "yuy2";
  313. case 7:
  314. return "y-only";
  315. case 8:
  316. return "iyuv";
  317. case 12:
  318. return "nv12";
  319. default:
  320. DDPDUMP("ddp_get_fmt_name, unknown fmt=%d, module=%d\n", fmt, module);
  321. return "unknown";
  322. }
  323. } else if (module == DISP_MODULE_OVL0) {
  324. switch (fmt) {
  325. case 0:
  326. return "rgb565";
  327. case 1:
  328. return "rgb888";
  329. case 2:
  330. return "rgba8888";
  331. case 3:
  332. return "argb8888";
  333. case 4:
  334. return "uyvy";
  335. case 5:
  336. return "yuyv";
  337. default:
  338. DDPDUMP("ddp_get_fmt_name, unknown fmt=%d, module=%d\n", fmt, module);
  339. return "unknown";
  340. }
  341. } else if (module == DISP_MODULE_RDMA0) {
  342. switch (fmt) {
  343. case 0:
  344. return "rgb565";
  345. case 1:
  346. return "rgb888";
  347. case 2:
  348. return "rgba8888";
  349. case 3:
  350. return "argb8888";
  351. case 4:
  352. return "uyvy";
  353. case 5:
  354. return "yuyv";
  355. default:
  356. DDPDUMP("ddp_get_fmt_name, unknown fmt=%d, module=%d\n", fmt, module);
  357. return "unknown";
  358. }
  359. } else {
  360. DDPDUMP("ddp_get_fmt_name, unknown module=%d\n", module);
  361. }
  362. return "unknown";
  363. }
  364. static char *ddp_clock_0(int bit)
  365. {
  366. switch (bit) {
  367. case 7:
  368. return "ovl0, ";
  369. case 8:
  370. return "ovl0_2L, ";
  371. case 9:
  372. return "disp_rsz0, ";
  373. case 10:
  374. return "rdma0, ";
  375. case 11:
  376. return "wdma0, ";
  377. case 12:
  378. return "color, ";
  379. case 13:
  380. return "ccorr, ";
  381. case 14:
  382. return "aal, ";
  383. case 15:
  384. return "gamma, ";
  385. case 16:
  386. return "dither, ";
  387. case 17:
  388. return "dsi0_mm(cg), ";
  389. case 19:
  390. return "smi_common(cg), ";
  391. case 20:
  392. return "smi_larb0(cg), ";
  393. case 21:
  394. return "smi_comm0(cg), ";
  395. case 22:
  396. return "smi_comm1(cg), ";
  397. case 28:
  398. return "dsi0_interface(cg), ";
  399. case 29:
  400. return "26M, ";
  401. default:
  402. return NULL;
  403. }
  404. }
  405. /* no need ddp_clock_1 */
  406. /*
  407. * static char *ddp_clock_1(int bit)
  408. * {
  409. * switch (bit) {
  410. * case 0:
  411. * return "dsi0_mm(cg), ";
  412. * case 1:
  413. * return "dsi0_interface(cg), ";
  414. * case 7:
  415. * return "26M, ";
  416. * default:
  417. * return NULL;
  418. * }
  419. * }
  420. */
  421. static void mutex_dump_reg(void)
  422. {
  423. unsigned long module_base = DISPSYS_MUTEX_BASE;
  424. DDPDUMP("== START: DISP MUTEX registers ==\n");
  425. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  426. 0x0, INREG32(module_base + 0x0),
  427. 0x4, INREG32(module_base + 0x4),
  428. 0x8, INREG32(module_base + 0x8),
  429. 0xC, INREG32(module_base + 0xC));
  430. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  431. 0x10, INREG32(module_base + 0x10),
  432. 0x14, INREG32(module_base + 0x14),
  433. 0x18, INREG32(module_base + 0x18),
  434. 0x1C, INREG32(module_base + 0x1C));
  435. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  436. 0x020, INREG32(module_base + 0x020),
  437. 0x024, INREG32(module_base + 0x024),
  438. 0x028, INREG32(module_base + 0x028),
  439. 0x02C, INREG32(module_base + 0x02C));
  440. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  441. 0x030, INREG32(module_base + 0x030),
  442. 0x034, INREG32(module_base + 0x034),
  443. 0x038, INREG32(module_base + 0x038),
  444. 0x03C, INREG32(module_base + 0x03C));
  445. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  446. 0x040, INREG32(module_base + 0x040),
  447. 0x044, INREG32(module_base + 0x044),
  448. 0x048, INREG32(module_base + 0x048),
  449. 0x04C, INREG32(module_base + 0x04C));
  450. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  451. 0x050, INREG32(module_base + 0x050),
  452. 0x060, INREG32(module_base + 0x060),
  453. 0x064, INREG32(module_base + 0x064),
  454. 0x068, INREG32(module_base + 0x068));
  455. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  456. 0x06C, INREG32(module_base + 0x06C),
  457. 0x070, INREG32(module_base + 0x070),
  458. 0x080, INREG32(module_base + 0x080),
  459. 0x084, INREG32(module_base + 0x084));
  460. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  461. 0x088, INREG32(module_base + 0x088),
  462. 0x08C, INREG32(module_base + 0x08C),
  463. 0x090, INREG32(module_base + 0x090),
  464. 0x0A0, INREG32(module_base + 0x0A0));
  465. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  466. 0x0A4, INREG32(module_base + 0x0A4),
  467. 0x0A8, INREG32(module_base + 0x0A8),
  468. 0x0AC, INREG32(module_base + 0x0AC),
  469. 0x0B0, INREG32(module_base + 0x0B0));
  470. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  471. 0x0C0, INREG32(module_base + 0x0C0),
  472. 0x0C4, INREG32(module_base + 0x0C4),
  473. 0x0C8, INREG32(module_base + 0x0C8),
  474. 0x0CC, INREG32(module_base + 0x0CC));
  475. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  476. 0x0D0, INREG32(module_base + 0x0D0),
  477. 0x0E0, INREG32(module_base + 0x0E0),
  478. 0x0E4, INREG32(module_base + 0x0E4),
  479. 0x0E8, INREG32(module_base + 0x0E8));
  480. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  481. 0x0EC, INREG32(module_base + 0x0EC),
  482. 0x0F0, INREG32(module_base + 0x0F0),
  483. 0x100, INREG32(module_base + 0x100),
  484. 0x104, INREG32(module_base + 0x104));
  485. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  486. 0x108, INREG32(module_base + 0x108),
  487. 0x10C, INREG32(module_base + 0x10C),
  488. 0x110, INREG32(module_base + 0x110),
  489. 0x120, INREG32(module_base + 0x120));
  490. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  491. 0x124, INREG32(module_base + 0x124),
  492. 0x128, INREG32(module_base + 0x128),
  493. 0x12C, INREG32(module_base + 0x12C),
  494. 0x130, INREG32(module_base + 0x130));
  495. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  496. 0x140, INREG32(module_base + 0x140),
  497. 0x144, INREG32(module_base + 0x144),
  498. 0x148, INREG32(module_base + 0x148),
  499. 0x14C, INREG32(module_base + 0x14C));
  500. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  501. 0x150, INREG32(module_base + 0x150),
  502. 0x160, INREG32(module_base + 0x160),
  503. 0x164, INREG32(module_base + 0x164),
  504. 0x168, INREG32(module_base + 0x168));
  505. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  506. 0x16C, INREG32(module_base + 0x16C),
  507. 0x170, INREG32(module_base + 0x170),
  508. 0x180, INREG32(module_base + 0x180),
  509. 0x184, INREG32(module_base + 0x184));
  510. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  511. 0x188, INREG32(module_base + 0x188),
  512. 0x18C, INREG32(module_base + 0x18C),
  513. 0x190, INREG32(module_base + 0x190),
  514. 0x300, INREG32(module_base + 0x300));
  515. DDPDUMP("MUTEX: 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  516. 0x304, INREG32(module_base + 0x304),
  517. 0x30C, INREG32(module_base + 0x30C));
  518. DDPDUMP("-- END: DISP MUTEX registers --\n");
  519. return;
  520. }
  521. static void mutex_dump_analysis(void)
  522. {
  523. int i = 0;
  524. int j = 0;
  525. char mutex_module[512] = { '\0' };
  526. char *p = NULL;
  527. int len = 0;
  528. unsigned int val;
  529. DDPDUMP("== DISP Mutex Analysis ==\n");
  530. for (i = 0; i < 5; i++) {
  531. p = mutex_module;
  532. len = 0;
  533. if (DISP_REG_GET(DISP_REG_CONFIG_MUTEX_MOD0(i)) == 0)
  534. continue;
  535. val = DISP_REG_GET(DISP_REG_CONFIG_MUTEX_SOF(i));
  536. len = sprintf(p, "MUTEX%d :SOF=%s,EOF=%s,WAIT=%d,module=(",
  537. i,
  538. ddp_get_mutex_sof_name(REG_FLD_VAL_GET(SOF_FLD_MUTEX0_SOF, val)),
  539. ddp_get_mutex_sof_name(REG_FLD_VAL_GET(SOF_FLD_MUTEX0_EOF, val)),
  540. REG_FLD_VAL_GET(SOF_FLD_MUTEX0_SOF_WAIT, val));
  541. p += len;
  542. for (j = 0; j < 32; j++) {
  543. unsigned int regval = DISP_REG_GET(DISP_REG_CONFIG_MUTEX_MOD0(i));
  544. if ((regval & (1 << j))) {
  545. len = sprintf(p, "%s,", ddp_get_mutex_module0_name(j));
  546. p += len;
  547. }
  548. regval = DISP_REG_GET(DISP_REG_CONFIG_MUTEX_MOD1(i));
  549. if ((regval & (1 << j))) {
  550. len = sprintf(p, "%s,", ddp_get_mutex_module1_name(j));
  551. p += len;
  552. }
  553. }
  554. DDPDUMP("%s)\n", mutex_module);
  555. }
  556. }
  557. static void mmsys_config_dump_reg(void)
  558. {
  559. unsigned long module_base = DISPSYS_CONFIG_BASE;
  560. DDPDUMP("== START: DISP MMSYS_CONFIG registers ==\n");
  561. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  562. 0x000, INREG32(module_base + 0x000),
  563. 0x004, INREG32(module_base + 0x004),
  564. 0x00C, INREG32(module_base + 0x00C),
  565. 0x010, INREG32(module_base + 0x010));
  566. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  567. 0x014, INREG32(module_base + 0x014),
  568. 0x018, INREG32(module_base + 0x018),
  569. 0x020, INREG32(module_base + 0x020),
  570. 0x024, INREG32(module_base + 0x024));
  571. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  572. 0x028, INREG32(module_base + 0x028),
  573. 0x02C, INREG32(module_base + 0x02C),
  574. 0x030, INREG32(module_base + 0x030),
  575. 0x034, INREG32(module_base + 0x034));
  576. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  577. 0x038, INREG32(module_base + 0x038),
  578. 0x048, INREG32(module_base + 0x048),
  579. 0x0F0, INREG32(module_base + 0x0F0),
  580. 0x0F4, INREG32(module_base + 0x0F4));
  581. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  582. 0x0F8, INREG32(module_base + 0x0F8),
  583. 0x100, INREG32(module_base + 0x100),
  584. 0x104, INREG32(module_base + 0x104),
  585. 0x108, INREG32(module_base + 0x108));
  586. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  587. 0x110, INREG32(module_base + 0x110),
  588. 0x114, INREG32(module_base + 0x114),
  589. 0x118, INREG32(module_base + 0x118),
  590. 0x120, INREG32(module_base + 0x120));
  591. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  592. 0x124, INREG32(module_base + 0x124),
  593. 0x128, INREG32(module_base + 0x128),
  594. 0x130, INREG32(module_base + 0x130),
  595. 0x134, INREG32(module_base + 0x134));
  596. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  597. 0x138, INREG32(module_base + 0x138),
  598. 0x140, INREG32(module_base + 0x140),
  599. 0x144, INREG32(module_base + 0x144),
  600. 0x150, INREG32(module_base + 0x150));
  601. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  602. 0x180, INREG32(module_base + 0x180),
  603. 0x184, INREG32(module_base + 0x184),
  604. 0x190, INREG32(module_base + 0x190),
  605. 0x200, INREG32(module_base + 0x200));
  606. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  607. 0x204, INREG32(module_base + 0x204),
  608. 0x208, INREG32(module_base + 0x208),
  609. 0x20C, INREG32(module_base + 0x20C),
  610. 0x210, INREG32(module_base + 0x210));
  611. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  612. 0x214, INREG32(module_base + 0x214),
  613. 0x218, INREG32(module_base + 0x218),
  614. 0x220, INREG32(module_base + 0x220),
  615. 0x224, INREG32(module_base + 0x224));
  616. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  617. 0x228, INREG32(module_base + 0x228),
  618. 0x22C, INREG32(module_base + 0x22C),
  619. 0x230, INREG32(module_base + 0x230),
  620. 0x234, INREG32(module_base + 0x234));
  621. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  622. 0x238, INREG32(module_base + 0x238),
  623. 0x800, INREG32(module_base + 0x800),
  624. 0x804, INREG32(module_base + 0x804),
  625. 0x808, INREG32(module_base + 0x808));
  626. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  627. 0x80C, INREG32(module_base + 0x80C),
  628. 0x810, INREG32(module_base + 0x810),
  629. 0x814, INREG32(module_base + 0x814),
  630. 0x818, INREG32(module_base + 0x818));
  631. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  632. 0x81C, INREG32(module_base + 0x81C),
  633. 0x820, INREG32(module_base + 0x820),
  634. 0x824, INREG32(module_base + 0x824),
  635. 0x828, INREG32(module_base + 0x828));
  636. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  637. 0x82C, INREG32(module_base + 0x82C),
  638. 0x830, INREG32(module_base + 0x830),
  639. 0x834, INREG32(module_base + 0x834),
  640. 0x838, INREG32(module_base + 0x838));
  641. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  642. 0x83C, INREG32(module_base + 0x83C),
  643. 0x840, INREG32(module_base + 0x840),
  644. 0x844, INREG32(module_base + 0x844),
  645. 0x848, INREG32(module_base + 0x848));
  646. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  647. 0x84C, INREG32(module_base + 0x84C),
  648. 0x854, INREG32(module_base + 0x854),
  649. 0x858, INREG32(module_base + 0x858),
  650. 0x85C, INREG32(module_base + 0x85C));
  651. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  652. 0x860, INREG32(module_base + 0x860),
  653. 0x864, INREG32(module_base + 0x864),
  654. 0x868, INREG32(module_base + 0x868),
  655. 0x870, INREG32(module_base + 0x870));
  656. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  657. 0x874, INREG32(module_base + 0x874),
  658. 0x878, INREG32(module_base + 0x878),
  659. 0x88C, INREG32(module_base + 0x88C),
  660. 0x890, INREG32(module_base + 0x890));
  661. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  662. 0x894, INREG32(module_base + 0x894),
  663. 0x898, INREG32(module_base + 0x898),
  664. 0x89C, INREG32(module_base + 0x89C),
  665. 0x8A0, INREG32(module_base + 0x8A0));
  666. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  667. 0x8A4, INREG32(module_base + 0x8A4),
  668. 0x8A8, INREG32(module_base + 0x8A8),
  669. 0x8AC, INREG32(module_base + 0x8AC),
  670. 0x8B0, INREG32(module_base + 0x8B0));
  671. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  672. 0x8B4, INREG32(module_base + 0x8B4),
  673. 0x8B8, INREG32(module_base + 0x8B8),
  674. 0x8C0, INREG32(module_base + 0x8C0),
  675. 0x8C4, INREG32(module_base + 0x8C4));
  676. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  677. 0x8CC, INREG32(module_base + 0x8CC),
  678. 0x8D0, INREG32(module_base + 0x8D0),
  679. 0x8D4, INREG32(module_base + 0x8D4),
  680. 0x8D8, INREG32(module_base + 0x8D8));
  681. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  682. 0x8DC, INREG32(module_base + 0x8DC),
  683. 0x8E0, INREG32(module_base + 0x8E0),
  684. 0x8E4, INREG32(module_base + 0x8E4),
  685. 0x8E8, INREG32(module_base + 0x8E8));
  686. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  687. 0x8EC, INREG32(module_base + 0x8EC),
  688. 0x8F0, INREG32(module_base + 0x8F0),
  689. 0x908, INREG32(module_base + 0x908),
  690. 0x90C, INREG32(module_base + 0x90C));
  691. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  692. 0x910, INREG32(module_base + 0x910),
  693. 0x914, INREG32(module_base + 0x914),
  694. 0x918, INREG32(module_base + 0x918),
  695. 0x91C, INREG32(module_base + 0x91C));
  696. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  697. 0x920, INREG32(module_base + 0x920),
  698. 0x924, INREG32(module_base + 0x924),
  699. 0x928, INREG32(module_base + 0x928),
  700. 0x934, INREG32(module_base + 0x934));
  701. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  702. 0x938, INREG32(module_base + 0x938),
  703. 0x93C, INREG32(module_base + 0x93C),
  704. 0x940, INREG32(module_base + 0x940),
  705. 0x944, INREG32(module_base + 0x944));
  706. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  707. 0xF00, INREG32(module_base + 0xF00),
  708. 0xF04, INREG32(module_base + 0xF04),
  709. 0xF08, INREG32(module_base + 0xF08),
  710. 0xF0C, INREG32(module_base + 0xF0C));
  711. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  712. 0xF10, INREG32(module_base + 0xF10),
  713. 0xF20, INREG32(module_base + 0xF20),
  714. 0xF24, INREG32(module_base + 0xF24),
  715. 0xF28, INREG32(module_base + 0xF28));
  716. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  717. 0xF2C, INREG32(module_base + 0xF2C),
  718. 0xF30, INREG32(module_base + 0xF30),
  719. 0xF34, INREG32(module_base + 0xF34),
  720. 0xF38, INREG32(module_base + 0xF38));
  721. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  722. 0xF3C, INREG32(module_base + 0xF3C),
  723. 0xF40, INREG32(module_base + 0xF40),
  724. 0xF44, INREG32(module_base + 0xF44),
  725. 0xF48, INREG32(module_base + 0xF48));
  726. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  727. 0xF50, INREG32(module_base + 0xF50),
  728. 0xF54, INREG32(module_base + 0xF54),
  729. 0xF58, INREG32(module_base + 0xF58),
  730. 0xF5C, INREG32(module_base + 0xF5C));
  731. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  732. 0xF80, INREG32(module_base + 0xF80),
  733. 0xF84, INREG32(module_base + 0xF84),
  734. 0xF88, INREG32(module_base + 0xF88),
  735. 0xF8C, INREG32(module_base + 0xF8C));
  736. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  737. 0xF90, INREG32(module_base + 0xF90),
  738. 0xF94, INREG32(module_base + 0xF94),
  739. 0xF98, INREG32(module_base + 0xF98),
  740. 0xFA0, INREG32(module_base + 0xFA0));
  741. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  742. 0xFA4, INREG32(module_base + 0xFA4),
  743. 0xFA8, INREG32(module_base + 0xFA8),
  744. 0xFAC, INREG32(module_base + 0xFAC),
  745. 0xFB0, INREG32(module_base + 0xFB0));
  746. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  747. 0xFC0, INREG32(module_base + 0xFC0),
  748. 0XFC4, INREG32(module_base + 0XFC4),
  749. 0xFC8, INREG32(module_base + 0xFC8),
  750. 0xFCC, INREG32(module_base + 0xFCC));
  751. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  752. 0xFD0, INREG32(module_base + 0xFD0),
  753. 0xFD4, INREG32(module_base + 0xFD4),
  754. 0xFD8, INREG32(module_base + 0xFD8),
  755. 0xFDC, INREG32(module_base + 0xFDC));
  756. DDPDUMP("MMSYS_CONFIG: 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  757. 0xFE0, INREG32(module_base + 0xFE0),
  758. 0xFE4, INREG32(module_base + 0xFE4));
  759. DDPDUMP("-- END: DISP MMSYS_CONFIG registers --\n");
  760. return;
  761. }
  762. /* ------ clock:
  763. Before power on mmsys:
  764. CLK_CFG_0_CLR (address is 0x10000048) = 0x80000000 (bit 31).
  765. Before using DISP_PWM0 or DISP_PWM1:
  766. CLK_CFG_1_CLR(address is 0x10000058)=0x80 (bit 7).
  767. Before using DPI pixel clock:
  768. CLK_CFG_6_CLR(address is 0x100000A8)=0x80 (bit 7).
  769. Only need to enable the corresponding bits of MMSYS_CG_CON0 and MMSYS_CG_CON1 for the modules:
  770. smi_common, larb0, mdp_crop, fake_eng, mutex_32k, pwm0, pwm1, dsi0, dsi1, dpi.
  771. Other bits could keep 1. Suggest to keep smi_common and larb0 always clock on.
  772. --------valid & ready
  773. example:
  774. ovl0 -> ovl0_mout_ready=1 means engines after ovl_mout are ready for receiving data
  775. ovl0_mout_ready=0 means ovl0_mout can not receive data, maybe ovl0_mout or after engines config error
  776. ovl0 -> ovl0_mout_valid=1 means engines before ovl0_mout is OK,
  777. ovl0_mout_valid=0 means ovl can not transfer data to ovl0_mout, means ovl0 or before engines are not ready.
  778. */
  779. static void mmsys_config_dump_analysis(void)
  780. {
  781. unsigned int i = 0, j;
  782. unsigned int reg = 0;
  783. char clock_on[512] = { '\0' };
  784. char *pos = NULL;
  785. const char *name;
  786. /* int len = 0; */
  787. unsigned int valid[6], ready[6];
  788. unsigned int greq;
  789. valid[0] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_VALID0);
  790. valid[1] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_VALID1);
  791. valid[2] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_VALID2);
  792. valid[3] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_VALID3);
  793. valid[4] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_VALID4);
  794. valid[5] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_VALID5);
  795. ready[0] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_READY0);
  796. ready[1] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_READY1);
  797. ready[2] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_READY2);
  798. ready[3] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_READY3);
  799. ready[4] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_READY4);
  800. ready[5] = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_DL_READY5);
  801. greq = DISP_REG_GET(DISP_REG_CONFIG_SMI_LARB0_GREQ);
  802. DDPDUMP("== DISP MMSYS_CONFIG ANALYSIS ==\n");
  803. #if 0 /* TODO: mmsys clk?? */
  804. DDPDUMP("mmsys clock=0x%x, CG_CON0=0x%x, CG_CON1=0x%x\n",
  805. DISP_REG_GET(DISP_REG_CLK_CFG_0_MM_CLK),
  806. DISP_REG_GET(DISP_REG_CONFIG_MMSYS_CG_CON0),
  807. DISP_REG_GET(DISP_REG_CONFIG_MMSYS_CG_CON1));
  808. if ((DISP_REG_GET(DISP_REG_CLK_CFG_0_MM_CLK) >> 31) & 0x1)
  809. DDPERR("mmsys clock abnormal!!\n");
  810. #endif
  811. reg = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_CG_CON0);
  812. for (i = 0; i < 32; i++) {
  813. if ((reg & (1 << i)) == 0) {
  814. name = ddp_clock_0(i);
  815. if (name)
  816. strncat(clock_on, name, sizeof(clock_on));
  817. }
  818. }
  819. /* no need ddp_clock_1 */
  820. /*
  821. * reg = DISP_REG_GET(DISP_REG_CONFIG_MMSYS_CG_CON1);
  822. * for (i = 0; i < 32; i++) {
  823. * if ((reg & (1 << i)) == 0) {
  824. * name = ddp_clock_1(i);
  825. * if (name)
  826. * strncat(clock_on, name,
  827. * (sizeof(clock_on) -
  828. * strlen(clock_on) - 1));
  829. * }
  830. * }
  831. */
  832. DDPDUMP("clock on modules:%s\n", clock_on);
  833. DDPDUMP("valid0=0x%x,valid1=0x%x,valid2=0x%x,ready0=0x%x,ready1=0x%x,ready2=0x%x,greq=0%x\n",
  834. valid[0], valid[1], valid[2], ready[0], ready[1], ready[2], greq);
  835. DDPDUMP("valid3=0x%x,valid4=0x%x,valid5=0x%x,ready3=0x%x,ready4=0x%x,ready5=0x%x\n",
  836. valid[3], valid[4], valid[5], ready[3], ready[4], ready[5]);
  837. for (j = 0; j < ARRAY_SIZE(valid); j++) {
  838. for (i = 0; i < 32; i++) {
  839. name = ddp_signal[j][i];
  840. if (!name)
  841. continue;
  842. pos = clock_on;
  843. if ((valid[j] & (1 << i)))
  844. pos += sprintf(pos, "%s,", "v");
  845. else
  846. pos += sprintf(pos, "%s,", "n");
  847. if ((ready[j] & (1 << i)))
  848. pos += sprintf(pos, "%s", "r");
  849. else
  850. pos += sprintf(pos, "%s", "n");
  851. pos += sprintf(pos, ": %s", name);
  852. DDPDUMP("%s\n", clock_on);
  853. }
  854. }
  855. /* greq: 1 means SMI dose not grant, maybe SMI hang */
  856. if (greq)
  857. DDPDUMP("smi greq not grant module: (greq: 1 means SMI dose not grant, maybe SMI hang)");
  858. clock_on[0] = '\0';
  859. for (i = 0; i < 32; i++) {
  860. if (greq & (1 << i)) {
  861. name = ddp_greq_name(i);
  862. if (!name)
  863. continue;
  864. strncat(clock_on, name, sizeof(clock_on));
  865. }
  866. }
  867. DDPDUMP("%s\n", clock_on);
  868. }
  869. static void gamma_dump_reg(void)
  870. {
  871. unsigned long module_base = DISPSYS_GAMMA0_BASE;
  872. DDPDUMP("== START: DISP gamma0 registers ==\n");
  873. DDPDUMP("gamma0: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  874. 0x0000, INREG32(module_base + 0x0000),
  875. 0x0004, INREG32(module_base + 0x0004),
  876. 0x0008, INREG32(module_base + 0x0008),
  877. 0x000c, INREG32(module_base + 0x000c));
  878. DDPDUMP("gamma0: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  879. 0x0010, INREG32(module_base + 0x0010),
  880. 0x0020, INREG32(module_base + 0x0020),
  881. 0x0024, INREG32(module_base + 0x0024),
  882. 0x0028, INREG32(module_base + 0x0028));
  883. DDPDUMP("gamma0: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  884. 0x002c, INREG32(module_base + 0x002c),
  885. 0x0030, INREG32(module_base + 0x0030),
  886. 0x0034, INREG32(module_base + 0x0034),
  887. 0x0700, INREG32(module_base + 0x0700));
  888. DDPDUMP("-- END: DISP gamma0 registers --\n");
  889. }
  890. static void gamma_dump_analysis(void)
  891. {
  892. DDPDUMP("== DISP GAMMA ANALYSIS ==\n");
  893. DDPDUMP("gamma: en=%d, w=%d, h=%d, in_p_cnt=%d, in_l_cnt=%d, out_p_cnt=%d, out_l_cnt=%d\n",
  894. DISP_REG_GET(DISP_REG_GAMMA_EN),
  895. (DISP_REG_GET(DISP_REG_GAMMA_SIZE) >> 16) & 0x1fff,
  896. DISP_REG_GET(DISP_REG_GAMMA_SIZE) & 0x1fff,
  897. DISP_REG_GET(DISP_REG_GAMMA_INPUT_COUNT) & 0x1fff,
  898. (DISP_REG_GET(DISP_REG_GAMMA_INPUT_COUNT) >> 16) & 0x1fff,
  899. DISP_REG_GET(DISP_REG_GAMMA_OUTPUT_COUNT) & 0x1fff,
  900. (DISP_REG_GET(DISP_REG_GAMMA_OUTPUT_COUNT) >> 16) & 0x1fff);
  901. }
  902. static void color_dump_reg(DISP_MODULE_ENUM module)
  903. {
  904. int idx = 0;
  905. unsigned long module_base = DISPSYS_COLOR0_BASE;
  906. DDPDUMP("== START: DISP COLOR%d registers ==\n", idx);
  907. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  908. idx,
  909. 0x00000400, INREG32(module_base + 0x00000400),
  910. 0x00000404, INREG32(module_base + 0x00000404),
  911. 0x00000408, INREG32(module_base + 0x00000408),
  912. 0x0000040C, INREG32(module_base + 0x0000040C));
  913. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  914. idx,
  915. 0x00000410, INREG32(module_base + 0x00000410),
  916. 0x00000418, INREG32(module_base + 0x00000418),
  917. 0x0000041C, INREG32(module_base + 0x0000041C),
  918. 0x00000420, INREG32(module_base + 0x00000420));
  919. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  920. idx,
  921. 0x00000428, INREG32(module_base + 0x00000428),
  922. 0x0000042C, INREG32(module_base + 0x0000042C),
  923. 0x00000430, INREG32(module_base + 0x00000430),
  924. 0x00000434, INREG32(module_base + 0x00000434));
  925. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  926. idx,
  927. 0x00000438, INREG32(module_base + 0x00000438),
  928. 0x00000484, INREG32(module_base + 0x00000484),
  929. 0x00000488, INREG32(module_base + 0x00000488),
  930. 0x0000048C, INREG32(module_base + 0x0000048C));
  931. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  932. idx,
  933. 0x00000490, INREG32(module_base + 0x00000490),
  934. 0x00000494, INREG32(module_base + 0x00000494),
  935. 0x00000498, INREG32(module_base + 0x00000498),
  936. 0x0000049C, INREG32(module_base + 0x0000049C));
  937. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  938. idx,
  939. 0x000004A0, INREG32(module_base + 0x000004A0),
  940. 0x000004A4, INREG32(module_base + 0x000004A4),
  941. 0x000004A8, INREG32(module_base + 0x000004A8),
  942. 0x000004AC, INREG32(module_base + 0x000004AC));
  943. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  944. idx,
  945. 0x000004B0, INREG32(module_base + 0x000004B0),
  946. 0x000004B4, INREG32(module_base + 0x000004B4),
  947. 0x000004B8, INREG32(module_base + 0x000004B8),
  948. 0x000004BC, INREG32(module_base + 0x000004BC));
  949. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  950. idx,
  951. 0x00000620, INREG32(module_base + 0x00000620),
  952. 0x00000624, INREG32(module_base + 0x00000624),
  953. 0x00000628, INREG32(module_base + 0x00000628),
  954. 0x0000062C, INREG32(module_base + 0x0000062C));
  955. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  956. idx,
  957. 0x00000630, INREG32(module_base + 0x00000630),
  958. 0x00000740, INREG32(module_base + 0x00000740),
  959. 0x0000074C, INREG32(module_base + 0x0000074C),
  960. 0x00000768, INREG32(module_base + 0x00000768));
  961. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  962. idx,
  963. 0x0000076C, INREG32(module_base + 0x0000076C),
  964. 0x0000079C, INREG32(module_base + 0x0000079C),
  965. 0x000007E0, INREG32(module_base + 0x000007E0),
  966. 0x000007E4, INREG32(module_base + 0x000007E4));
  967. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  968. idx,
  969. 0x000007E8, INREG32(module_base + 0x000007E8),
  970. 0x000007EC, INREG32(module_base + 0x000007EC),
  971. 0x000007F0, INREG32(module_base + 0x000007F0),
  972. 0x000007FC, INREG32(module_base + 0x000007FC));
  973. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  974. idx,
  975. 0x00000800, INREG32(module_base + 0x00000800),
  976. 0x00000804, INREG32(module_base + 0x00000804),
  977. 0x00000808, INREG32(module_base + 0x00000808),
  978. 0x0000080C, INREG32(module_base + 0x0000080C));
  979. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  980. idx,
  981. 0x00000810, INREG32(module_base + 0x00000810),
  982. 0x00000814, INREG32(module_base + 0x00000814),
  983. 0x00000818, INREG32(module_base + 0x00000818),
  984. 0x0000081C, INREG32(module_base + 0x0000081C));
  985. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  986. idx,
  987. 0x00000820, INREG32(module_base + 0x00000820),
  988. 0x00000824, INREG32(module_base + 0x00000824),
  989. 0x00000828, INREG32(module_base + 0x00000828),
  990. 0x0000082C, INREG32(module_base + 0x0000082C));
  991. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  992. idx,
  993. 0x00000830, INREG32(module_base + 0x00000830),
  994. 0x00000834, INREG32(module_base + 0x00000834),
  995. 0x00000838, INREG32(module_base + 0x00000838),
  996. 0x0000083C, INREG32(module_base + 0x0000083C));
  997. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  998. idx,
  999. 0x00000840, INREG32(module_base + 0x00000840),
  1000. 0x00000844, INREG32(module_base + 0x00000844),
  1001. 0x00000848, INREG32(module_base + 0x00000848),
  1002. 0x0000084C, INREG32(module_base + 0x0000084C));
  1003. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1004. idx,
  1005. 0x00000850, INREG32(module_base + 0x00000850),
  1006. 0x00000854, INREG32(module_base + 0x00000854),
  1007. 0x00000858, INREG32(module_base + 0x00000858),
  1008. 0x0000085C, INREG32(module_base + 0x0000085C));
  1009. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1010. idx,
  1011. 0x00000860, INREG32(module_base + 0x00000860),
  1012. 0x00000864, INREG32(module_base + 0x00000864),
  1013. 0x00000868, INREG32(module_base + 0x00000868),
  1014. 0x0000086C, INREG32(module_base + 0x0000086C));
  1015. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1016. idx,
  1017. 0x00000870, INREG32(module_base + 0x00000870),
  1018. 0x00000874, INREG32(module_base + 0x00000874),
  1019. 0x00000878, INREG32(module_base + 0x00000878),
  1020. 0x0000087C, INREG32(module_base + 0x0000087C));
  1021. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1022. idx,
  1023. 0x00000880, INREG32(module_base + 0x00000880),
  1024. 0x00000884, INREG32(module_base + 0x00000884),
  1025. 0x00000888, INREG32(module_base + 0x00000888),
  1026. 0x0000088C, INREG32(module_base + 0x0000088C));
  1027. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1028. idx,
  1029. 0x00000890, INREG32(module_base + 0x00000890),
  1030. 0x00000894, INREG32(module_base + 0x00000894),
  1031. 0x00000898, INREG32(module_base + 0x00000898),
  1032. 0x0000089C, INREG32(module_base + 0x0000089C));
  1033. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1034. idx,
  1035. 0x000008A0, INREG32(module_base + 0x000008A0),
  1036. 0x000008A4, INREG32(module_base + 0x000008A4),
  1037. 0x000008A8, INREG32(module_base + 0x000008A8),
  1038. 0x000008AC, INREG32(module_base + 0x000008AC));
  1039. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1040. idx,
  1041. 0x000008B0, INREG32(module_base + 0x000008B0),
  1042. 0x000008B4, INREG32(module_base + 0x000008B4),
  1043. 0x000008B8, INREG32(module_base + 0x000008B8),
  1044. 0x000008BC, INREG32(module_base + 0x000008BC));
  1045. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1046. idx,
  1047. 0x000008C0, INREG32(module_base + 0x000008C0),
  1048. 0x000008C4, INREG32(module_base + 0x000008C4),
  1049. 0x000008C8, INREG32(module_base + 0x000008C8),
  1050. 0x000008CC, INREG32(module_base + 0x000008CC));
  1051. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1052. idx,
  1053. 0x000008D0, INREG32(module_base + 0x000008D0),
  1054. 0x000008D4, INREG32(module_base + 0x000008D4),
  1055. 0x000008D8, INREG32(module_base + 0x000008D8),
  1056. 0x000008DC, INREG32(module_base + 0x000008DC));
  1057. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1058. idx,
  1059. 0x000008E0, INREG32(module_base + 0x000008E0),
  1060. 0x000008E4, INREG32(module_base + 0x000008E4),
  1061. 0x000008E8, INREG32(module_base + 0x000008E8),
  1062. 0x000008EC, INREG32(module_base + 0x000008EC));
  1063. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1064. idx,
  1065. 0x000008F0, INREG32(module_base + 0x000008F0),
  1066. 0x000008F4, INREG32(module_base + 0x000008F4),
  1067. 0x000008F8, INREG32(module_base + 0x000008F8),
  1068. 0x000008FC, INREG32(module_base + 0x000008FC));
  1069. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1070. idx,
  1071. 0x00000900, INREG32(module_base + 0x00000900),
  1072. 0x00000904, INREG32(module_base + 0x00000904),
  1073. 0x00000908, INREG32(module_base + 0x00000908),
  1074. 0x0000090C, INREG32(module_base + 0x0000090C));
  1075. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1076. idx,
  1077. 0x00000910, INREG32(module_base + 0x00000910),
  1078. 0x00000914, INREG32(module_base + 0x00000914),
  1079. 0x00000C00, INREG32(module_base + 0x00000C00),
  1080. 0x00000C04, INREG32(module_base + 0x00000C04));
  1081. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1082. idx,
  1083. 0x00000C08, INREG32(module_base + 0x00000C08),
  1084. 0x00000C0C, INREG32(module_base + 0x00000C0C),
  1085. 0x00000C10, INREG32(module_base + 0x00000C10),
  1086. 0x00000C14, INREG32(module_base + 0x00000C14));
  1087. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1088. idx,
  1089. 0x00000C18, INREG32(module_base + 0x00000C18),
  1090. 0x00000C28, INREG32(module_base + 0x00000C28),
  1091. 0x00000C50, INREG32(module_base + 0x00000C50),
  1092. 0x00000C54, INREG32(module_base + 0x00000C54));
  1093. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1094. idx,
  1095. 0x00000C60, INREG32(module_base + 0x00000C60),
  1096. 0x00000CA0, INREG32(module_base + 0x00000CA0),
  1097. 0x00000CB0, INREG32(module_base + 0x00000CB0),
  1098. 0x00000CF0, INREG32(module_base + 0x00000CF0));
  1099. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1100. idx,
  1101. 0x00000CF4, INREG32(module_base + 0x00000CF4),
  1102. 0x00000CF8, INREG32(module_base + 0x00000CF8),
  1103. 0x00000CFC, INREG32(module_base + 0x00000CFC),
  1104. 0x00000D00, INREG32(module_base + 0x00000D00));
  1105. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1106. idx,
  1107. 0x00000D04, INREG32(module_base + 0x00000D04),
  1108. 0x00000D08, INREG32(module_base + 0x00000D08),
  1109. 0x00000D0C, INREG32(module_base + 0x00000D0C),
  1110. 0x00000D10, INREG32(module_base + 0x00000D10));
  1111. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1112. idx,
  1113. 0x00000D14, INREG32(module_base + 0x00000D14),
  1114. 0x00000D18, INREG32(module_base + 0x00000D18),
  1115. 0x00000D1C, INREG32(module_base + 0x00000D1C),
  1116. 0x00000D20, INREG32(module_base + 0x00000D20));
  1117. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1118. idx,
  1119. 0x00000D24, INREG32(module_base + 0x00000D24),
  1120. 0x00000D28, INREG32(module_base + 0x00000D28),
  1121. 0x00000D2C, INREG32(module_base + 0x00000D2C),
  1122. 0x00000D30, INREG32(module_base + 0x00000D30));
  1123. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1124. idx,
  1125. 0x00000D34, INREG32(module_base + 0x00000D34),
  1126. 0x00000D38, INREG32(module_base + 0x00000D38),
  1127. 0x00000D3C, INREG32(module_base + 0x00000D3C),
  1128. 0x00000D40, INREG32(module_base + 0x00000D40));
  1129. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1130. idx,
  1131. 0x00000D44, INREG32(module_base + 0x00000D44),
  1132. 0x00000D48, INREG32(module_base + 0x00000D48),
  1133. 0x00000D4C, INREG32(module_base + 0x00000D4C),
  1134. 0x00000D50, INREG32(module_base + 0x00000D50));
  1135. DDPDUMP("COLOR%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1136. idx,
  1137. 0x00000D54, INREG32(module_base + 0x00000D54),
  1138. 0x00000D58, INREG32(module_base + 0x00000D58),
  1139. 0x00000D5C, INREG32(module_base + 0x00000D5C));
  1140. DDPDUMP("-- END: DISP COLOR%d registers --\n", idx);
  1141. return;
  1142. }
  1143. static void color_dump_analysis(DISP_MODULE_ENUM module)
  1144. {
  1145. int index = 0;
  1146. if (DISP_MODULE_COLOR0 == module) {
  1147. index = 0;
  1148. } else {
  1149. DDPDUMP("error: DISP COLOR%d dose not exist!\n", index);
  1150. return;
  1151. }
  1152. DDPDUMP("== DISP COLOR%d ANALYSIS ==\n", index);
  1153. DDPDUMP("color%d: bypass=%d, w=%d, h=%d, pixel_cnt=%d, line_cnt=%d,\n",
  1154. index,
  1155. (DISP_REG_GET(DISP_COLOR_CFG_MAIN) >> 7) & 0x1,
  1156. DISP_REG_GET(DISP_COLOR_INTERNAL_IP_WIDTH),
  1157. DISP_REG_GET(DISP_COLOR_INTERNAL_IP_HEIGHT),
  1158. DISP_REG_GET(DISP_COLOR_PXL_CNT_MAIN) & 0xffff,
  1159. (DISP_REG_GET(DISP_COLOR_LINE_CNT_MAIN) >> 16) & 0x1fff);
  1160. return;
  1161. }
  1162. static void aal_dump_reg(void)
  1163. {
  1164. int i = 0;
  1165. unsigned long module_base = DISPSYS_AAL0_BASE;
  1166. DDPDUMP("== START: DISP AAL%d registers ==\n", i);
  1167. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1168. 0x00000000, INREG32(module_base + 0x00000000),
  1169. 0x00000004, INREG32(module_base + 0x00000004),
  1170. 0x00000008, INREG32(module_base + 0x00000008),
  1171. 0x0000000C, INREG32(module_base + 0x0000000C));
  1172. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1173. 0x00000010, INREG32(module_base + 0x00000010),
  1174. 0x00000020, INREG32(module_base + 0x00000020),
  1175. 0x00000024, INREG32(module_base + 0x00000024),
  1176. 0x00000028, INREG32(module_base + 0x00000028));
  1177. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1178. 0x0000002C, INREG32(module_base + 0x0000002C),
  1179. 0x00000030, INREG32(module_base + 0x00000030),
  1180. 0x00000034, INREG32(module_base + 0x000004d8));
  1181. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1182. 0x000000B0, INREG32(module_base + 0x000000B0),
  1183. 0x000000C0, INREG32(module_base + 0x000000C0),
  1184. 0x000000FC, INREG32(module_base + 0x000000FC));
  1185. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1186. 0x00000204, INREG32(module_base + 0x00000204),
  1187. 0x0000020C, INREG32(module_base + 0x0000020C),
  1188. 0x00000214, INREG32(module_base + 0x00000214));
  1189. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1190. 0x0000021C, INREG32(module_base + 0x0000021C),
  1191. 0x00000224, INREG32(module_base + 0x00000224),
  1192. 0x00000228, INREG32(module_base + 0x00000228),
  1193. 0x0000022C, INREG32(module_base + 0x0000022C));
  1194. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1195. 0x00000230, INREG32(module_base + 0x00000230),
  1196. 0x00000234, INREG32(module_base + 0x00000234),
  1197. 0x00000238, INREG32(module_base + 0x00000238),
  1198. 0x0000023C, INREG32(module_base + 0x0000023C));
  1199. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1200. 0x00000240, INREG32(module_base + 0x00000240),
  1201. 0x00000244, INREG32(module_base + 0x00000244),
  1202. 0x00000248, INREG32(module_base + 0x00000248),
  1203. 0x0000024C, INREG32(module_base + 0x0000024C));
  1204. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1205. 0x00000250, INREG32(module_base + 0x00000250),
  1206. 0x00000254, INREG32(module_base + 0x00000254),
  1207. 0x00000258, INREG32(module_base + 0x00000258),
  1208. 0x0000025C, INREG32(module_base + 0x0000025C));
  1209. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1210. 0x00000260, INREG32(module_base + 0x00000260),
  1211. 0x00000264, INREG32(module_base + 0x00000264),
  1212. 0x00000268, INREG32(module_base + 0x00000268),
  1213. 0x0000026C, INREG32(module_base + 0x0000026C));
  1214. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1215. 0x00000270, INREG32(module_base + 0x00000270),
  1216. 0x00000274, INREG32(module_base + 0x00000274),
  1217. 0x00000278, INREG32(module_base + 0x00000278),
  1218. 0x0000027C, INREG32(module_base + 0x0000027C));
  1219. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1220. 0x00000280, INREG32(module_base + 0x00000280),
  1221. 0x00000284, INREG32(module_base + 0x00000284),
  1222. 0x00000288, INREG32(module_base + 0x00000288),
  1223. 0x0000028C, INREG32(module_base + 0x0000028C));
  1224. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1225. 0x00000290, INREG32(module_base + 0x00000290),
  1226. 0x00000294, INREG32(module_base + 0x00000294),
  1227. 0x00000298, INREG32(module_base + 0x00000298),
  1228. 0x0000029C, INREG32(module_base + 0x0000029C));
  1229. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1230. 0x000002A0, INREG32(module_base + 0x000002A0),
  1231. 0x000002A4, INREG32(module_base + 0x000002A4),
  1232. 0x00000358, INREG32(module_base + 0x00000358),
  1233. 0x0000035C, INREG32(module_base + 0x0000035C));
  1234. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1235. 0x00000360, INREG32(module_base + 0x00000360),
  1236. 0x00000364, INREG32(module_base + 0x00000364),
  1237. 0x00000368, INREG32(module_base + 0x00000368),
  1238. 0x0000036C, INREG32(module_base + 0x0000036C));
  1239. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1240. 0x00000370, INREG32(module_base + 0x00000370),
  1241. 0x00000374, INREG32(module_base + 0x00000374),
  1242. 0x00000378, INREG32(module_base + 0x00000378),
  1243. 0x0000037C, INREG32(module_base + 0x0000037C));
  1244. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1245. 0x00000380, INREG32(module_base + 0x00000380),
  1246. 0x000003B0, INREG32(module_base + 0x000003B0),
  1247. 0x0000040C, INREG32(module_base + 0x0000040C),
  1248. 0x00000410, INREG32(module_base + 0x00000410));
  1249. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1250. 0x00000414, INREG32(module_base + 0x00000414),
  1251. 0x00000418, INREG32(module_base + 0x00000418),
  1252. 0x0000041C, INREG32(module_base + 0x0000041C),
  1253. 0x00000420, INREG32(module_base + 0x00000420));
  1254. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1255. 0x00000424, INREG32(module_base + 0x00000424),
  1256. 0x00000428, INREG32(module_base + 0x00000428),
  1257. 0x0000042C, INREG32(module_base + 0x0000042C),
  1258. 0x00000430, INREG32(module_base + 0x00000430));
  1259. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1260. 0x00000434, INREG32(module_base + 0x00000434),
  1261. 0x00000440, INREG32(module_base + 0x00000440),
  1262. 0x00000444, INREG32(module_base + 0x00000444),
  1263. 0x00000448, INREG32(module_base + 0x00000448));
  1264. DDPDUMP("-- END: DISP AAL%d registers --\n", i);
  1265. return;
  1266. }
  1267. static void mdp_aal_dump_reg(DISP_MODULE_ENUM module)
  1268. {
  1269. int i;
  1270. unsigned long module_base = DISPSYS_MDP_AAL4_BASE;
  1271. if (module == DISP_MODULE_MDP_AAL4)
  1272. i = 0;
  1273. else
  1274. i = 1;
  1275. DDPDUMP("== START: DISP MDP AAL%d registers ==\n", i);
  1276. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1277. 0x00000000, INREG32(module_base + 0x00000000),
  1278. 0x00000004, INREG32(module_base + 0x00000004),
  1279. 0x00000008, INREG32(module_base + 0x00000008),
  1280. 0x0000000C, INREG32(module_base + 0x0000000C));
  1281. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1282. 0x00000010, INREG32(module_base + 0x00000010),
  1283. 0x00000020, INREG32(module_base + 0x00000020),
  1284. 0x00000024, INREG32(module_base + 0x00000024),
  1285. 0x00000028, INREG32(module_base + 0x00000028));
  1286. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1287. 0x0000002C, INREG32(module_base + 0x0000002C),
  1288. 0x00000030, INREG32(module_base + 0x00000030),
  1289. 0x00000034, INREG32(module_base + 0x00000034));
  1290. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1291. 0x000000B0, INREG32(module_base + 0x000000B0),
  1292. 0x000000C0, INREG32(module_base + 0x000000C0),
  1293. 0x000000FC, INREG32(module_base + 0x000000FC));
  1294. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1295. 0x00000204, INREG32(module_base + 0x00000204),
  1296. 0x0000020C, INREG32(module_base + 0x0000020C),
  1297. 0x00000214, INREG32(module_base + 0x00000214));
  1298. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1299. 0x0000021C, INREG32(module_base + 0x0000021C),
  1300. 0x00000224, INREG32(module_base + 0x00000224),
  1301. 0x00000228, INREG32(module_base + 0x00000228),
  1302. 0x0000022C, INREG32(module_base + 0x0000022C));
  1303. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1304. 0x00000230, INREG32(module_base + 0x00000230),
  1305. 0x00000234, INREG32(module_base + 0x00000234),
  1306. 0x00000238, INREG32(module_base + 0x00000238),
  1307. 0x0000023C, INREG32(module_base + 0x0000023C));
  1308. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1309. 0x00000240, INREG32(module_base + 0x00000240),
  1310. 0x00000244, INREG32(module_base + 0x00000244),
  1311. 0x00000248, INREG32(module_base + 0x00000248),
  1312. 0x0000024C, INREG32(module_base + 0x0000024C));
  1313. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1314. 0x00000250, INREG32(module_base + 0x00000250),
  1315. 0x00000254, INREG32(module_base + 0x00000254),
  1316. 0x00000258, INREG32(module_base + 0x00000258),
  1317. 0x0000025C, INREG32(module_base + 0x0000025C));
  1318. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1319. 0x00000260, INREG32(module_base + 0x00000260),
  1320. 0x00000264, INREG32(module_base + 0x00000264),
  1321. 0x00000268, INREG32(module_base + 0x00000268),
  1322. 0x0000026C, INREG32(module_base + 0x0000026C));
  1323. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1324. 0x00000270, INREG32(module_base + 0x00000270),
  1325. 0x00000274, INREG32(module_base + 0x00000274),
  1326. 0x00000278, INREG32(module_base + 0x00000278),
  1327. 0x0000027C, INREG32(module_base + 0x0000027C));
  1328. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1329. 0x00000280, INREG32(module_base + 0x00000280),
  1330. 0x00000284, INREG32(module_base + 0x00000284),
  1331. 0x00000288, INREG32(module_base + 0x00000288),
  1332. 0x0000028C, INREG32(module_base + 0x0000028C));
  1333. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1334. 0x00000290, INREG32(module_base + 0x00000290),
  1335. 0x00000294, INREG32(module_base + 0x00000294),
  1336. 0x00000298, INREG32(module_base + 0x00000298),
  1337. 0x0000029C, INREG32(module_base + 0x0000029C));
  1338. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1339. 0x000002A0, INREG32(module_base + 0x000002A0),
  1340. 0x000002A4, INREG32(module_base + 0x000002A4),
  1341. 0x00000358, INREG32(module_base + 0x00000358),
  1342. 0x0000035C, INREG32(module_base + 0x0000035C));
  1343. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1344. 0x00000360, INREG32(module_base + 0x00000360),
  1345. 0x00000364, INREG32(module_base + 0x00000364),
  1346. 0x00000368, INREG32(module_base + 0x00000368),
  1347. 0x0000036C, INREG32(module_base + 0x0000036C));
  1348. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1349. 0x00000370, INREG32(module_base + 0x00000370),
  1350. 0x00000374, INREG32(module_base + 0x00000374),
  1351. 0x00000378, INREG32(module_base + 0x00000378),
  1352. 0x0000037C, INREG32(module_base + 0x0000037C));
  1353. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1354. 0x00000380, INREG32(module_base + 0x00000380),
  1355. 0x000003B0, INREG32(module_base + 0x000003B0),
  1356. 0x0000040C, INREG32(module_base + 0x0000040C),
  1357. 0x00000410, INREG32(module_base + 0x00000410));
  1358. DDPDUMP("AAL:0x%04x= 0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1359. 0x00000414, INREG32(module_base + 0x00000414),
  1360. 0x00000418, INREG32(module_base + 0x00000418),
  1361. 0x0000041C, INREG32(module_base + 0x0000041C),
  1362. 0x00000420, INREG32(module_base + 0x00000420));
  1363. DDPDUMP("AAL:0x%04x= 0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1364. 0x00000424, INREG32(module_base + 0x00000424),
  1365. 0x00000428, INREG32(module_base + 0x00000428),
  1366. 0x0000042C, INREG32(module_base + 0x0000042C),
  1367. 0x00000430, INREG32(module_base + 0x00000430));
  1368. DDPDUMP("AAL: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1369. 0x00000434, INREG32(module_base + 0x00000434),
  1370. 0x00000440, INREG32(module_base + 0x00000440),
  1371. 0x00000444, INREG32(module_base + 0x00000444),
  1372. 0x00000448, INREG32(module_base + 0x00000448));
  1373. DDPDUMP("-- END: DISP AAL%d registers --\n", i);
  1374. }
  1375. static void aal_dump_analysis(void)
  1376. {
  1377. DDPDUMP("== DISP AAL ANALYSIS ==\n");
  1378. DDPDUMP("aal: bypass=%d, relay=%d, en=%d, w=%d, h=%d, in(%d,%d),out(%d,%d)\n",
  1379. DISP_REG_GET(DISP_AAL_EN) == 0x0,
  1380. DISP_REG_GET(DISP_AAL_CFG) & 0x01,
  1381. DISP_REG_GET(DISP_AAL_EN),
  1382. (DISP_REG_GET(DISP_AAL_SIZE) >> 16) & 0x1fff,
  1383. DISP_REG_GET(DISP_AAL_SIZE) & 0x1fff,
  1384. DISP_REG_GET(DISP_AAL_IN_CNT) & 0x1fff,
  1385. (DISP_REG_GET(DISP_AAL_IN_CNT) >> 16) & 0x1fff,
  1386. DISP_REG_GET(DISP_AAL_OUT_CNT) & 0x1fff,
  1387. (DISP_REG_GET(DISP_AAL_OUT_CNT) >> 16) & 0x1fff);
  1388. }
  1389. static void pwm_dump_reg(DISP_MODULE_ENUM module)
  1390. {
  1391. unsigned long module_base = DISPSYS_PWM0_BASE;
  1392. DDPDUMP("== START: DISP PWM0 registers ==\n");
  1393. DDPDUMP("PWM0: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1394. 0x0, INREG32(module_base + 0x0),
  1395. 0x4, INREG32(module_base + 0x4),
  1396. 0x8, INREG32(module_base + 0x8),
  1397. 0xC, INREG32(module_base + 0xC));
  1398. DDPDUMP("PWM0: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1399. 0x10, INREG32(module_base + 0x10),
  1400. 0x14, INREG32(module_base + 0x14),
  1401. 0x18, INREG32(module_base + 0x18),
  1402. 0x1C, INREG32(module_base + 0x1C));
  1403. DDPDUMP("PWM0: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1404. 0x80, INREG32(module_base + 0x80),
  1405. 0x28, INREG32(module_base + 0x28),
  1406. 0x2C, INREG32(module_base + 0x2C),
  1407. 0x30, INREG32(module_base + 0x30));
  1408. DDPDUMP("PWM0: 0x%04x=0x%08x\n",
  1409. 0xC0, INREG32(module_base + 0xC0));
  1410. DDPDUMP("-- END: DISP PWM0 registers --\n");
  1411. }
  1412. static void pwm_dump_analysis(DISP_MODULE_ENUM module)
  1413. {
  1414. int index = 0;
  1415. unsigned int reg_base = 0;
  1416. if (module == DISP_MODULE_PWM0) {
  1417. index = 0;
  1418. reg_base = DISPSYS_PWM0_BASE;
  1419. } else {
  1420. index = 1;
  1421. reg_base = DISPSYS_PWM0_BASE;
  1422. }
  1423. DDPDUMP("== DISP PWM%d REG_BASE:0x%08x ANALYSIS ==\n", index, reg_base);
  1424. #if 0 /* TODO: clk reg?? */
  1425. DDPDUMP("pwm clock=%d\n", (DISP_REG_GET(DISP_REG_CLK_CFG_1_CLR) >> 7) & 0x1);
  1426. #endif
  1427. return;
  1428. }
  1429. static void ccorr_dump_reg(void)
  1430. {
  1431. int i = 0;
  1432. unsigned long module_base = DISPSYS_CCORR0_BASE;
  1433. DDPDUMP("== START: DISP CCORR%i registers ==\n", i);
  1434. DDPDUMP("CCORR: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1435. 0x000, INREG32(module_base + 0x000),
  1436. 0x004, INREG32(module_base + 0x004),
  1437. 0x008, INREG32(module_base + 0x008),
  1438. 0x00C, INREG32(module_base + 0x00C));
  1439. DDPDUMP("CCORR: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1440. 0x010, INREG32(module_base + 0x010),
  1441. 0x020, INREG32(module_base + 0x020),
  1442. 0x024, INREG32(module_base + 0x024),
  1443. 0x028, INREG32(module_base + 0x028));
  1444. DDPDUMP("CCORR: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1445. 0x02C, INREG32(module_base + 0x02C),
  1446. 0x030, INREG32(module_base + 0x030),
  1447. 0x080, INREG32(module_base + 0x080),
  1448. 0x084, INREG32(module_base + 0x084));
  1449. DDPDUMP("CCORR: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1450. 0x088, INREG32(module_base + 0x088),
  1451. 0x08C, INREG32(module_base + 0x08C),
  1452. 0x090, INREG32(module_base + 0x090),
  1453. 0x0A0, INREG32(module_base + 0x0A0));
  1454. DDPDUMP("CCORR: 0x%04x=0x%08x\n",
  1455. 0x0C0, INREG32(module_base + 0x0C0));
  1456. DDPDUMP("-- END: DISP CCORR%d registers --\n", i);
  1457. }
  1458. static void ccorr_dump_analyze(void)
  1459. {
  1460. DDPDUMP("ccorr: en=%d, config=%d, w=%d, h=%d, in_p_cnt=%d, in_l_cnt=%d, out_p_cnt=%d, out_l_cnt=%d\n",
  1461. DISP_REG_GET(DISP_REG_CCORR_EN), DISP_REG_GET(DISP_REG_CCORR_CFG),
  1462. (DISP_REG_GET(DISP_REG_CCORR_SIZE) >> 16) & 0x1fff,
  1463. DISP_REG_GET(DISP_REG_CCORR_SIZE) & 0x1fff,
  1464. DISP_REG_GET(DISP_REG_CCORR_IN_CNT) & 0x1fff,
  1465. (DISP_REG_GET(DISP_REG_CCORR_IN_CNT) >> 16) & 0x1fff,
  1466. DISP_REG_GET(DISP_REG_CCORR_IN_CNT) & 0x1fff,
  1467. (DISP_REG_GET(DISP_REG_CCORR_IN_CNT) >> 16) & 0x1fff);
  1468. }
  1469. static void dither_dump_reg(void)
  1470. {
  1471. int i = 0;
  1472. unsigned long module_base = DISPSYS_DITHER0_BASE;
  1473. DDPDUMP("== START: DISP DITHER%d registers ==\n", i);
  1474. DDPDUMP("DITHER: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1475. 0x00000000, INREG32(module_base + 0x00000000),
  1476. 0x00000004, INREG32(module_base + 0x00000004),
  1477. 0x00000008, INREG32(module_base + 0x00000008),
  1478. 0x0000000C, INREG32(module_base + 0x0000000C));
  1479. DDPDUMP("DITHER: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1480. 0x00000010, INREG32(module_base + 0x00000010),
  1481. 0x00000020, INREG32(module_base + 0x00000020),
  1482. 0x00000024, INREG32(module_base + 0x00000024),
  1483. 0x00000028, INREG32(module_base + 0x00000028));
  1484. DDPDUMP("DITHER: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1485. 0x0000002C, INREG32(module_base + 0x0000002C),
  1486. 0x00000030, INREG32(module_base + 0x00000030),
  1487. 0x000000C0, INREG32(module_base + 0x000000C0),
  1488. 0x00000100, INREG32(module_base + 0x00000100));
  1489. DDPDUMP("DITHER: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1490. 0x00000114, INREG32(module_base + 0x00000114),
  1491. 0x00000118, INREG32(module_base + 0x00000118),
  1492. 0x0000011C, INREG32(module_base + 0x0000011C),
  1493. 0x00000120, INREG32(module_base + 0x00000120));
  1494. DDPDUMP("DITHER: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1495. 0x00000124, INREG32(module_base + 0x00000124),
  1496. 0x00000128, INREG32(module_base + 0x00000128),
  1497. 0x0000012C, INREG32(module_base + 0x0000012C),
  1498. 0x00000130, INREG32(module_base + 0x00000130));
  1499. DDPDUMP("DITHER: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1500. 0x00000134, INREG32(module_base + 0x00000134),
  1501. 0x00000138, INREG32(module_base + 0x00000138),
  1502. 0x0000013C, INREG32(module_base + 0x0000013C),
  1503. 0x00000140, INREG32(module_base + 0x00000140));
  1504. DDPDUMP("DITHER: 0x%04x=0x%08x\n",
  1505. 0x00000144, INREG32(module_base + 0x00000144));
  1506. DDPDUMP("-- END: DISP DITHER%d registers --\n", i);
  1507. }
  1508. static void dither_dump_analyze(void)
  1509. {
  1510. DDPDUMP("dither: en=%d, config=%d, w=%d, h=%d, in_p_cnt=%d, in_l_cnt=%d, out_p_cnt=%d, out_l_cnt=%d\n",
  1511. DISP_REG_GET(DISPSYS_DITHER0_BASE + 0x000), DISP_REG_GET(DISPSYS_DITHER0_BASE + 0x020),
  1512. (DISP_REG_GET(DISP_REG_DITHER_SIZE) >> 16) & 0x1fff,
  1513. DISP_REG_GET(DISP_REG_DITHER_SIZE) & 0x1fff,
  1514. DISP_REG_GET(DISP_REG_DITHER_IN_CNT) & 0x1fff,
  1515. (DISP_REG_GET(DISP_REG_DITHER_IN_CNT) >> 16) & 0x1fff,
  1516. DISP_REG_GET(DISP_REG_DITHER_OUT_CNT) & 0x1fff,
  1517. (DISP_REG_GET(DISP_REG_DITHER_OUT_CNT) >> 16) & 0x1fff);
  1518. }
  1519. static void dsi_dump_reg(DISP_MODULE_ENUM module)
  1520. {
  1521. DSI_DumpRegisters(module, 1);
  1522. #if 0
  1523. if (DISP_MODULE_DSI0) {
  1524. int i = 0;
  1525. DDPDUMP("== DISP DSI0 REGS ==\n");
  1526. for (i = 0; i < 25 * 16; i += 16) {
  1527. DDPDUMP("DSI0+%04x: 0x%08x 0x%08x 0x%08x 0x%08x\n", i,
  1528. INREG32(DISPSYS_DSI0_BASE + i), INREG32(DISPSYS_DSI0_BASE + i + 0x4),
  1529. INREG32(DISPSYS_DSI0_BASE + i + 0x8),
  1530. INREG32(DISPSYS_DSI0_BASE + i + 0xc));
  1531. }
  1532. DDPDUMP("DSI0 CMDQ+0x200: 0x%08x 0x%08x 0x%08x 0x%08x\n",
  1533. INREG32(DISPSYS_DSI0_BASE + 0x200), INREG32(DISPSYS_DSI0_BASE + 0x200 + 0x4),
  1534. INREG32(DISPSYS_DSI0_BASE + 0x200 + 0x8),
  1535. INREG32(DISPSYS_DSI0_BASE + 0x200 + 0xc));
  1536. }
  1537. #endif
  1538. }
  1539. static void dpi_dump_reg(void)
  1540. {
  1541. }
  1542. static void dpi_dump_analysis(void)
  1543. {
  1544. #if 0
  1545. DDPDUMP("== DISP DPI ANALYSIS ==\n");
  1546. /* TODO: mmsys clk?? */
  1547. DDPDUMP("DPI clock=0x%x\n", DISP_REG_GET(DISP_REG_CLK_CFG_6_DPI));
  1548. DDPDUMP("DPI clock_clear=%d\n", (DISP_REG_GET(DISP_REG_CLK_CFG_6_CLR) >> 7) & 0x1);
  1549. DDPDUMP("(0x000)S_ENABLE=0x%x\n", DISP_REG_GET(DISP_REG_SPLIT_ENABLE));
  1550. DDPDUMP("(0x004)S_SW_RST=0x%x\n", DISP_REG_GET(DISP_REG_SPLIT_SW_RESET));
  1551. #endif
  1552. }
  1553. static int split_dump_regs(void)
  1554. {
  1555. unsigned long module_base = DISPSYS_SPLIT0_BASE;
  1556. unsigned int idx = 0;
  1557. DDPDUMP("== START: DISP SPLIT registers ==\n");
  1558. DDPDUMP("SPLIT%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1559. idx,
  1560. 0x000, INREG32(module_base + 0x000),
  1561. 0x004, INREG32(module_base + 0x004),
  1562. 0x008, INREG32(module_base + 0x008),
  1563. 0x00C, INREG32(module_base + 0x00C));
  1564. DDPDUMP("SPLIT%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1565. idx,
  1566. 0x010, INREG32(module_base + 0x010),
  1567. 0x020, INREG32(module_base + 0x020),
  1568. 0x024, INREG32(module_base + 0x024),
  1569. 0x028, INREG32(module_base + 0x028));
  1570. DDPDUMP("SPLIT%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1571. idx,
  1572. 0x02C, INREG32(module_base + 0x02C),
  1573. 0x030, INREG32(module_base + 0x030),
  1574. 0x034, INREG32(module_base + 0x034),
  1575. 0x038, INREG32(module_base + 0x038));
  1576. DDPDUMP("SPLIT%d: 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x, 0x%04x=0x%08x\n",
  1577. idx,
  1578. 0x03C, INREG32(module_base + 0x03C),
  1579. 0x040, INREG32(module_base + 0x040),
  1580. 0x044, INREG32(module_base + 0x044),
  1581. 0x48, INREG32(module_base + 0x48));
  1582. DDPDUMP("SPLIT%d: 0x%04x=0x%08x\n",
  1583. idx,
  1584. 0x080, INREG32(module_base + 0x080));
  1585. DDPDUMP("-- END: DISP SPLIT registers --\n");
  1586. return 0;
  1587. }
  1588. static int split_dump_analysis(void)
  1589. {
  1590. #if 0
  1591. unsigned int pixel = DISP_REG_GET_FIELD(DEBUG_FLD_IN_PIXEL_CNT, DISP_REG_SPLIT_DEBUG);
  1592. unsigned int state = DISP_REG_GET_FIELD(DEBUG_FLD_SPLIT_FSM, DISP_REG_SPLIT_DEBUG);
  1593. DDPDUMP("== DISP SPLIT0 ANALYSIS ==\n");
  1594. DDPDUMP("cur_pixel %u, state %s\n", pixel, split_state(state));
  1595. return 0;
  1596. #else
  1597. return 0;
  1598. #endif
  1599. }
  1600. extern int dsc_dump(DISP_MODULE_ENUM module, int level);
  1601. int ddp_dump_reg(DISP_MODULE_ENUM module)
  1602. {
  1603. switch (module) {
  1604. case DISP_MODULE_WDMA0:
  1605. //wdma_dump_reg(module);
  1606. break;
  1607. case DISP_MODULE_RDMA0:
  1608. RDMADump(module);
  1609. break;
  1610. case DISP_MODULE_OVL0:
  1611. case DISP_MODULE_OVL0_2L:
  1612. OVLDump(module);
  1613. break;
  1614. case DISP_MODULE_GAMMA0:
  1615. gamma_dump_reg();
  1616. break;
  1617. case DISP_MODULE_CONFIG:
  1618. mmsys_config_dump_reg();
  1619. break;
  1620. case DISP_MODULE_MUTEX:
  1621. mutex_dump_reg();
  1622. break;
  1623. case DISP_MODULE_COLOR0:
  1624. color_dump_reg(module);
  1625. break;
  1626. case DISP_MODULE_AAL0:
  1627. aal_dump_reg();
  1628. break;
  1629. case DISP_MODULE_MDP_AAL4:
  1630. mdp_aal_dump_reg(module);
  1631. break;
  1632. case DISP_MODULE_PWM0:
  1633. /* pwm_dump_reg(module); */
  1634. break;
  1635. case DISP_MODULE_DSI0:
  1636. case DISP_MODULE_DSI1:
  1637. case DISP_MODULE_DSIDUAL:
  1638. dsi_dump_reg(module);
  1639. break;
  1640. case DISP_MODULE_CCORR0:
  1641. ccorr_dump_reg();
  1642. break;
  1643. case DISP_MODULE_DITHER0:
  1644. dither_dump_reg();
  1645. break;
  1646. case DISP_MODULE_POSTMASK0:
  1647. postmask_dump_reg(module);
  1648. break;
  1649. case DISP_MODULE_DSC:
  1650. dsc_dump(module, 0);
  1651. break;
  1652. default:
  1653. DDPDUMP("no dump_reg for module %s(%d)\n", ddp_get_module_name(module), module);
  1654. }
  1655. return 0;
  1656. }
  1657. int ddp_dump_analysis(DISP_MODULE_ENUM module)
  1658. {
  1659. switch (module) {
  1660. case DISP_MODULE_WDMA0:
  1661. //wdma_dump_analysis(module);
  1662. break;
  1663. case DISP_MODULE_RDMA0:
  1664. rdma_dump_analysis(module);
  1665. break;
  1666. case DISP_MODULE_OVL0:
  1667. case DISP_MODULE_OVL0_2L:
  1668. ovl_dump_analysis(module);
  1669. break;
  1670. case DISP_MODULE_GAMMA0:
  1671. gamma_dump_analysis();
  1672. break;
  1673. case DISP_MODULE_CONFIG:
  1674. mmsys_config_dump_analysis();
  1675. break;
  1676. case DISP_MODULE_MUTEX:
  1677. mutex_dump_analysis();
  1678. break;
  1679. case DISP_MODULE_COLOR0:
  1680. color_dump_analysis(module);
  1681. break;
  1682. case DISP_MODULE_AAL0:
  1683. aal_dump_analysis();
  1684. break;
  1685. case DISP_MODULE_PWM0:
  1686. /* pwm_dump_analysis(module); */
  1687. break;
  1688. case DISP_MODULE_DSI0:
  1689. case DISP_MODULE_DSI1:
  1690. case DISP_MODULE_DSIDUAL:
  1691. dsi_analysis(module);
  1692. break;
  1693. case DISP_MODULE_CCORR0:
  1694. ccorr_dump_analyze();
  1695. break;
  1696. case DISP_MODULE_DITHER0:
  1697. dither_dump_analyze();
  1698. break;
  1699. case DISP_MODULE_POSTMASK0:
  1700. postmask_dump_analysis(module);
  1701. break;
  1702. default:
  1703. DDPDUMP("no dump_analysis for module %s(%d)\n", ddp_get_module_name(module),
  1704. module);
  1705. }
  1706. return 0;
  1707. }