ddp_dump.c 65 KB

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