ddp_dump.c 57 KB

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