mdp_hw_init.c 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. /* Copyright (c) 2008-2009, 2012 The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #include "mdp.h"
  14. /* mdp primary csc limit vector */
  15. uint32 mdp_plv[] = { 0x10, 0xeb, 0x10, 0xf0 };
  16. /* Color Coefficient matrix for YUV -> RGB */
  17. struct mdp_ccs mdp_ccs_yuv2rgb = {
  18. MDP_CCS_YUV2RGB,
  19. {
  20. 0x254,
  21. 0x000,
  22. 0x331,
  23. 0x254,
  24. 0xff38,
  25. 0xfe61,
  26. 0x254,
  27. 0x409,
  28. 0x000,
  29. },
  30. {
  31. #ifdef CONFIG_FB_MSM_MDP31
  32. 0x1f0,
  33. 0x180,
  34. 0x180
  35. #else
  36. 0x10,
  37. 0x80,
  38. 0x80
  39. #endif
  40. }
  41. };
  42. /* Color Coefficient matrix for RGB -> YUV */
  43. struct mdp_ccs mdp_ccs_rgb2yuv = {
  44. MDP_CCS_RGB2YUV,
  45. {
  46. 0x83,
  47. 0x102,
  48. 0x32,
  49. 0xffb5,
  50. 0xff6c,
  51. 0xe1,
  52. 0xe1,
  53. 0xff45,
  54. 0xffdc,
  55. },
  56. #ifdef CONFIG_FB_MSM_MDP31
  57. {
  58. 0x10,
  59. 0x80,
  60. 0x80
  61. }
  62. #endif
  63. };
  64. static void mdp_load_lut_param(void)
  65. {
  66. outpdw(MDP_BASE + 0x40800, 0x0);
  67. outpdw(MDP_BASE + 0x40804, 0x151515);
  68. outpdw(MDP_BASE + 0x40808, 0x1d1d1d);
  69. outpdw(MDP_BASE + 0x4080c, 0x232323);
  70. outpdw(MDP_BASE + 0x40810, 0x272727);
  71. outpdw(MDP_BASE + 0x40814, 0x2b2b2b);
  72. outpdw(MDP_BASE + 0x40818, 0x2f2f2f);
  73. outpdw(MDP_BASE + 0x4081c, 0x333333);
  74. outpdw(MDP_BASE + 0x40820, 0x363636);
  75. outpdw(MDP_BASE + 0x40824, 0x393939);
  76. outpdw(MDP_BASE + 0x40828, 0x3b3b3b);
  77. outpdw(MDP_BASE + 0x4082c, 0x3e3e3e);
  78. outpdw(MDP_BASE + 0x40830, 0x404040);
  79. outpdw(MDP_BASE + 0x40834, 0x434343);
  80. outpdw(MDP_BASE + 0x40838, 0x454545);
  81. outpdw(MDP_BASE + 0x4083c, 0x474747);
  82. outpdw(MDP_BASE + 0x40840, 0x494949);
  83. outpdw(MDP_BASE + 0x40844, 0x4b4b4b);
  84. outpdw(MDP_BASE + 0x40848, 0x4d4d4d);
  85. outpdw(MDP_BASE + 0x4084c, 0x4f4f4f);
  86. outpdw(MDP_BASE + 0x40850, 0x515151);
  87. outpdw(MDP_BASE + 0x40854, 0x535353);
  88. outpdw(MDP_BASE + 0x40858, 0x555555);
  89. outpdw(MDP_BASE + 0x4085c, 0x565656);
  90. outpdw(MDP_BASE + 0x40860, 0x585858);
  91. outpdw(MDP_BASE + 0x40864, 0x5a5a5a);
  92. outpdw(MDP_BASE + 0x40868, 0x5b5b5b);
  93. outpdw(MDP_BASE + 0x4086c, 0x5d5d5d);
  94. outpdw(MDP_BASE + 0x40870, 0x5e5e5e);
  95. outpdw(MDP_BASE + 0x40874, 0x606060);
  96. outpdw(MDP_BASE + 0x40878, 0x616161);
  97. outpdw(MDP_BASE + 0x4087c, 0x636363);
  98. outpdw(MDP_BASE + 0x40880, 0x646464);
  99. outpdw(MDP_BASE + 0x40884, 0x666666);
  100. outpdw(MDP_BASE + 0x40888, 0x676767);
  101. outpdw(MDP_BASE + 0x4088c, 0x686868);
  102. outpdw(MDP_BASE + 0x40890, 0x6a6a6a);
  103. outpdw(MDP_BASE + 0x40894, 0x6b6b6b);
  104. outpdw(MDP_BASE + 0x40898, 0x6c6c6c);
  105. outpdw(MDP_BASE + 0x4089c, 0x6e6e6e);
  106. outpdw(MDP_BASE + 0x408a0, 0x6f6f6f);
  107. outpdw(MDP_BASE + 0x408a4, 0x707070);
  108. outpdw(MDP_BASE + 0x408a8, 0x717171);
  109. outpdw(MDP_BASE + 0x408ac, 0x727272);
  110. outpdw(MDP_BASE + 0x408b0, 0x747474);
  111. outpdw(MDP_BASE + 0x408b4, 0x757575);
  112. outpdw(MDP_BASE + 0x408b8, 0x767676);
  113. outpdw(MDP_BASE + 0x408bc, 0x777777);
  114. outpdw(MDP_BASE + 0x408c0, 0x787878);
  115. outpdw(MDP_BASE + 0x408c4, 0x797979);
  116. outpdw(MDP_BASE + 0x408c8, 0x7a7a7a);
  117. outpdw(MDP_BASE + 0x408cc, 0x7c7c7c);
  118. outpdw(MDP_BASE + 0x408d0, 0x7d7d7d);
  119. outpdw(MDP_BASE + 0x408d4, 0x7e7e7e);
  120. outpdw(MDP_BASE + 0x408d8, 0x7f7f7f);
  121. outpdw(MDP_BASE + 0x408dc, 0x808080);
  122. outpdw(MDP_BASE + 0x408e0, 0x818181);
  123. outpdw(MDP_BASE + 0x408e4, 0x828282);
  124. outpdw(MDP_BASE + 0x408e8, 0x838383);
  125. outpdw(MDP_BASE + 0x408ec, 0x848484);
  126. outpdw(MDP_BASE + 0x408f0, 0x858585);
  127. outpdw(MDP_BASE + 0x408f4, 0x868686);
  128. outpdw(MDP_BASE + 0x408f8, 0x878787);
  129. outpdw(MDP_BASE + 0x408fc, 0x888888);
  130. outpdw(MDP_BASE + 0x40900, 0x898989);
  131. outpdw(MDP_BASE + 0x40904, 0x8a8a8a);
  132. outpdw(MDP_BASE + 0x40908, 0x8b8b8b);
  133. outpdw(MDP_BASE + 0x4090c, 0x8c8c8c);
  134. outpdw(MDP_BASE + 0x40910, 0x8d8d8d);
  135. outpdw(MDP_BASE + 0x40914, 0x8e8e8e);
  136. outpdw(MDP_BASE + 0x40918, 0x8f8f8f);
  137. outpdw(MDP_BASE + 0x4091c, 0x8f8f8f);
  138. outpdw(MDP_BASE + 0x40920, 0x909090);
  139. outpdw(MDP_BASE + 0x40924, 0x919191);
  140. outpdw(MDP_BASE + 0x40928, 0x929292);
  141. outpdw(MDP_BASE + 0x4092c, 0x939393);
  142. outpdw(MDP_BASE + 0x40930, 0x949494);
  143. outpdw(MDP_BASE + 0x40934, 0x959595);
  144. outpdw(MDP_BASE + 0x40938, 0x969696);
  145. outpdw(MDP_BASE + 0x4093c, 0x969696);
  146. outpdw(MDP_BASE + 0x40940, 0x979797);
  147. outpdw(MDP_BASE + 0x40944, 0x989898);
  148. outpdw(MDP_BASE + 0x40948, 0x999999);
  149. outpdw(MDP_BASE + 0x4094c, 0x9a9a9a);
  150. outpdw(MDP_BASE + 0x40950, 0x9b9b9b);
  151. outpdw(MDP_BASE + 0x40954, 0x9c9c9c);
  152. outpdw(MDP_BASE + 0x40958, 0x9c9c9c);
  153. outpdw(MDP_BASE + 0x4095c, 0x9d9d9d);
  154. outpdw(MDP_BASE + 0x40960, 0x9e9e9e);
  155. outpdw(MDP_BASE + 0x40964, 0x9f9f9f);
  156. outpdw(MDP_BASE + 0x40968, 0xa0a0a0);
  157. outpdw(MDP_BASE + 0x4096c, 0xa0a0a0);
  158. outpdw(MDP_BASE + 0x40970, 0xa1a1a1);
  159. outpdw(MDP_BASE + 0x40974, 0xa2a2a2);
  160. outpdw(MDP_BASE + 0x40978, 0xa3a3a3);
  161. outpdw(MDP_BASE + 0x4097c, 0xa4a4a4);
  162. outpdw(MDP_BASE + 0x40980, 0xa4a4a4);
  163. outpdw(MDP_BASE + 0x40984, 0xa5a5a5);
  164. outpdw(MDP_BASE + 0x40988, 0xa6a6a6);
  165. outpdw(MDP_BASE + 0x4098c, 0xa7a7a7);
  166. outpdw(MDP_BASE + 0x40990, 0xa7a7a7);
  167. outpdw(MDP_BASE + 0x40994, 0xa8a8a8);
  168. outpdw(MDP_BASE + 0x40998, 0xa9a9a9);
  169. outpdw(MDP_BASE + 0x4099c, 0xaaaaaa);
  170. outpdw(MDP_BASE + 0x409a0, 0xaaaaaa);
  171. outpdw(MDP_BASE + 0x409a4, 0xababab);
  172. outpdw(MDP_BASE + 0x409a8, 0xacacac);
  173. outpdw(MDP_BASE + 0x409ac, 0xadadad);
  174. outpdw(MDP_BASE + 0x409b0, 0xadadad);
  175. outpdw(MDP_BASE + 0x409b4, 0xaeaeae);
  176. outpdw(MDP_BASE + 0x409b8, 0xafafaf);
  177. outpdw(MDP_BASE + 0x409bc, 0xafafaf);
  178. outpdw(MDP_BASE + 0x409c0, 0xb0b0b0);
  179. outpdw(MDP_BASE + 0x409c4, 0xb1b1b1);
  180. outpdw(MDP_BASE + 0x409c8, 0xb2b2b2);
  181. outpdw(MDP_BASE + 0x409cc, 0xb2b2b2);
  182. outpdw(MDP_BASE + 0x409d0, 0xb3b3b3);
  183. outpdw(MDP_BASE + 0x409d4, 0xb4b4b4);
  184. outpdw(MDP_BASE + 0x409d8, 0xb4b4b4);
  185. outpdw(MDP_BASE + 0x409dc, 0xb5b5b5);
  186. outpdw(MDP_BASE + 0x409e0, 0xb6b6b6);
  187. outpdw(MDP_BASE + 0x409e4, 0xb6b6b6);
  188. outpdw(MDP_BASE + 0x409e8, 0xb7b7b7);
  189. outpdw(MDP_BASE + 0x409ec, 0xb8b8b8);
  190. outpdw(MDP_BASE + 0x409f0, 0xb8b8b8);
  191. outpdw(MDP_BASE + 0x409f4, 0xb9b9b9);
  192. outpdw(MDP_BASE + 0x409f8, 0xbababa);
  193. outpdw(MDP_BASE + 0x409fc, 0xbababa);
  194. outpdw(MDP_BASE + 0x40a00, 0xbbbbbb);
  195. outpdw(MDP_BASE + 0x40a04, 0xbcbcbc);
  196. outpdw(MDP_BASE + 0x40a08, 0xbcbcbc);
  197. outpdw(MDP_BASE + 0x40a0c, 0xbdbdbd);
  198. outpdw(MDP_BASE + 0x40a10, 0xbebebe);
  199. outpdw(MDP_BASE + 0x40a14, 0xbebebe);
  200. outpdw(MDP_BASE + 0x40a18, 0xbfbfbf);
  201. outpdw(MDP_BASE + 0x40a1c, 0xc0c0c0);
  202. outpdw(MDP_BASE + 0x40a20, 0xc0c0c0);
  203. outpdw(MDP_BASE + 0x40a24, 0xc1c1c1);
  204. outpdw(MDP_BASE + 0x40a28, 0xc1c1c1);
  205. outpdw(MDP_BASE + 0x40a2c, 0xc2c2c2);
  206. outpdw(MDP_BASE + 0x40a30, 0xc3c3c3);
  207. outpdw(MDP_BASE + 0x40a34, 0xc3c3c3);
  208. outpdw(MDP_BASE + 0x40a38, 0xc4c4c4);
  209. outpdw(MDP_BASE + 0x40a3c, 0xc5c5c5);
  210. outpdw(MDP_BASE + 0x40a40, 0xc5c5c5);
  211. outpdw(MDP_BASE + 0x40a44, 0xc6c6c6);
  212. outpdw(MDP_BASE + 0x40a48, 0xc6c6c6);
  213. outpdw(MDP_BASE + 0x40a4c, 0xc7c7c7);
  214. outpdw(MDP_BASE + 0x40a50, 0xc8c8c8);
  215. outpdw(MDP_BASE + 0x40a54, 0xc8c8c8);
  216. outpdw(MDP_BASE + 0x40a58, 0xc9c9c9);
  217. outpdw(MDP_BASE + 0x40a5c, 0xc9c9c9);
  218. outpdw(MDP_BASE + 0x40a60, 0xcacaca);
  219. outpdw(MDP_BASE + 0x40a64, 0xcbcbcb);
  220. outpdw(MDP_BASE + 0x40a68, 0xcbcbcb);
  221. outpdw(MDP_BASE + 0x40a6c, 0xcccccc);
  222. outpdw(MDP_BASE + 0x40a70, 0xcccccc);
  223. outpdw(MDP_BASE + 0x40a74, 0xcdcdcd);
  224. outpdw(MDP_BASE + 0x40a78, 0xcecece);
  225. outpdw(MDP_BASE + 0x40a7c, 0xcecece);
  226. outpdw(MDP_BASE + 0x40a80, 0xcfcfcf);
  227. outpdw(MDP_BASE + 0x40a84, 0xcfcfcf);
  228. outpdw(MDP_BASE + 0x40a88, 0xd0d0d0);
  229. outpdw(MDP_BASE + 0x40a8c, 0xd0d0d0);
  230. outpdw(MDP_BASE + 0x40a90, 0xd1d1d1);
  231. outpdw(MDP_BASE + 0x40a94, 0xd2d2d2);
  232. outpdw(MDP_BASE + 0x40a98, 0xd2d2d2);
  233. outpdw(MDP_BASE + 0x40a9c, 0xd3d3d3);
  234. outpdw(MDP_BASE + 0x40aa0, 0xd3d3d3);
  235. outpdw(MDP_BASE + 0x40aa4, 0xd4d4d4);
  236. outpdw(MDP_BASE + 0x40aa8, 0xd4d4d4);
  237. outpdw(MDP_BASE + 0x40aac, 0xd5d5d5);
  238. outpdw(MDP_BASE + 0x40ab0, 0xd6d6d6);
  239. outpdw(MDP_BASE + 0x40ab4, 0xd6d6d6);
  240. outpdw(MDP_BASE + 0x40ab8, 0xd7d7d7);
  241. outpdw(MDP_BASE + 0x40abc, 0xd7d7d7);
  242. outpdw(MDP_BASE + 0x40ac0, 0xd8d8d8);
  243. outpdw(MDP_BASE + 0x40ac4, 0xd8d8d8);
  244. outpdw(MDP_BASE + 0x40ac8, 0xd9d9d9);
  245. outpdw(MDP_BASE + 0x40acc, 0xd9d9d9);
  246. outpdw(MDP_BASE + 0x40ad0, 0xdadada);
  247. outpdw(MDP_BASE + 0x40ad4, 0xdbdbdb);
  248. outpdw(MDP_BASE + 0x40ad8, 0xdbdbdb);
  249. outpdw(MDP_BASE + 0x40adc, 0xdcdcdc);
  250. outpdw(MDP_BASE + 0x40ae0, 0xdcdcdc);
  251. outpdw(MDP_BASE + 0x40ae4, 0xdddddd);
  252. outpdw(MDP_BASE + 0x40ae8, 0xdddddd);
  253. outpdw(MDP_BASE + 0x40aec, 0xdedede);
  254. outpdw(MDP_BASE + 0x40af0, 0xdedede);
  255. outpdw(MDP_BASE + 0x40af4, 0xdfdfdf);
  256. outpdw(MDP_BASE + 0x40af8, 0xdfdfdf);
  257. outpdw(MDP_BASE + 0x40afc, 0xe0e0e0);
  258. outpdw(MDP_BASE + 0x40b00, 0xe0e0e0);
  259. outpdw(MDP_BASE + 0x40b04, 0xe1e1e1);
  260. outpdw(MDP_BASE + 0x40b08, 0xe1e1e1);
  261. outpdw(MDP_BASE + 0x40b0c, 0xe2e2e2);
  262. outpdw(MDP_BASE + 0x40b10, 0xe3e3e3);
  263. outpdw(MDP_BASE + 0x40b14, 0xe3e3e3);
  264. outpdw(MDP_BASE + 0x40b18, 0xe4e4e4);
  265. outpdw(MDP_BASE + 0x40b1c, 0xe4e4e4);
  266. outpdw(MDP_BASE + 0x40b20, 0xe5e5e5);
  267. outpdw(MDP_BASE + 0x40b24, 0xe5e5e5);
  268. outpdw(MDP_BASE + 0x40b28, 0xe6e6e6);
  269. outpdw(MDP_BASE + 0x40b2c, 0xe6e6e6);
  270. outpdw(MDP_BASE + 0x40b30, 0xe7e7e7);
  271. outpdw(MDP_BASE + 0x40b34, 0xe7e7e7);
  272. outpdw(MDP_BASE + 0x40b38, 0xe8e8e8);
  273. outpdw(MDP_BASE + 0x40b3c, 0xe8e8e8);
  274. outpdw(MDP_BASE + 0x40b40, 0xe9e9e9);
  275. outpdw(MDP_BASE + 0x40b44, 0xe9e9e9);
  276. outpdw(MDP_BASE + 0x40b48, 0xeaeaea);
  277. outpdw(MDP_BASE + 0x40b4c, 0xeaeaea);
  278. outpdw(MDP_BASE + 0x40b50, 0xebebeb);
  279. outpdw(MDP_BASE + 0x40b54, 0xebebeb);
  280. outpdw(MDP_BASE + 0x40b58, 0xececec);
  281. outpdw(MDP_BASE + 0x40b5c, 0xececec);
  282. outpdw(MDP_BASE + 0x40b60, 0xededed);
  283. outpdw(MDP_BASE + 0x40b64, 0xededed);
  284. outpdw(MDP_BASE + 0x40b68, 0xeeeeee);
  285. outpdw(MDP_BASE + 0x40b6c, 0xeeeeee);
  286. outpdw(MDP_BASE + 0x40b70, 0xefefef);
  287. outpdw(MDP_BASE + 0x40b74, 0xefefef);
  288. outpdw(MDP_BASE + 0x40b78, 0xf0f0f0);
  289. outpdw(MDP_BASE + 0x40b7c, 0xf0f0f0);
  290. outpdw(MDP_BASE + 0x40b80, 0xf1f1f1);
  291. outpdw(MDP_BASE + 0x40b84, 0xf1f1f1);
  292. outpdw(MDP_BASE + 0x40b88, 0xf2f2f2);
  293. outpdw(MDP_BASE + 0x40b8c, 0xf2f2f2);
  294. outpdw(MDP_BASE + 0x40b90, 0xf2f2f2);
  295. outpdw(MDP_BASE + 0x40b94, 0xf3f3f3);
  296. outpdw(MDP_BASE + 0x40b98, 0xf3f3f3);
  297. outpdw(MDP_BASE + 0x40b9c, 0xf4f4f4);
  298. outpdw(MDP_BASE + 0x40ba0, 0xf4f4f4);
  299. outpdw(MDP_BASE + 0x40ba4, 0xf5f5f5);
  300. outpdw(MDP_BASE + 0x40ba8, 0xf5f5f5);
  301. outpdw(MDP_BASE + 0x40bac, 0xf6f6f6);
  302. outpdw(MDP_BASE + 0x40bb0, 0xf6f6f6);
  303. outpdw(MDP_BASE + 0x40bb4, 0xf7f7f7);
  304. outpdw(MDP_BASE + 0x40bb8, 0xf7f7f7);
  305. outpdw(MDP_BASE + 0x40bbc, 0xf8f8f8);
  306. outpdw(MDP_BASE + 0x40bc0, 0xf8f8f8);
  307. outpdw(MDP_BASE + 0x40bc4, 0xf9f9f9);
  308. outpdw(MDP_BASE + 0x40bc8, 0xf9f9f9);
  309. outpdw(MDP_BASE + 0x40bcc, 0xfafafa);
  310. outpdw(MDP_BASE + 0x40bd0, 0xfafafa);
  311. outpdw(MDP_BASE + 0x40bd4, 0xfafafa);
  312. outpdw(MDP_BASE + 0x40bd8, 0xfbfbfb);
  313. outpdw(MDP_BASE + 0x40bdc, 0xfbfbfb);
  314. outpdw(MDP_BASE + 0x40be0, 0xfcfcfc);
  315. outpdw(MDP_BASE + 0x40be4, 0xfcfcfc);
  316. outpdw(MDP_BASE + 0x40be8, 0xfdfdfd);
  317. outpdw(MDP_BASE + 0x40bec, 0xfdfdfd);
  318. outpdw(MDP_BASE + 0x40bf0, 0xfefefe);
  319. outpdw(MDP_BASE + 0x40bf4, 0xfefefe);
  320. outpdw(MDP_BASE + 0x40bf8, 0xffffff);
  321. outpdw(MDP_BASE + 0x40bfc, 0xffffff);
  322. outpdw(MDP_BASE + 0x40c00, 0x0);
  323. outpdw(MDP_BASE + 0x40c04, 0x0);
  324. outpdw(MDP_BASE + 0x40c08, 0x0);
  325. outpdw(MDP_BASE + 0x40c0c, 0x0);
  326. outpdw(MDP_BASE + 0x40c10, 0x0);
  327. outpdw(MDP_BASE + 0x40c14, 0x0);
  328. outpdw(MDP_BASE + 0x40c18, 0x0);
  329. outpdw(MDP_BASE + 0x40c1c, 0x0);
  330. outpdw(MDP_BASE + 0x40c20, 0x0);
  331. outpdw(MDP_BASE + 0x40c24, 0x0);
  332. outpdw(MDP_BASE + 0x40c28, 0x0);
  333. outpdw(MDP_BASE + 0x40c2c, 0x0);
  334. outpdw(MDP_BASE + 0x40c30, 0x0);
  335. outpdw(MDP_BASE + 0x40c34, 0x0);
  336. outpdw(MDP_BASE + 0x40c38, 0x0);
  337. outpdw(MDP_BASE + 0x40c3c, 0x0);
  338. outpdw(MDP_BASE + 0x40c40, 0x10101);
  339. outpdw(MDP_BASE + 0x40c44, 0x10101);
  340. outpdw(MDP_BASE + 0x40c48, 0x10101);
  341. outpdw(MDP_BASE + 0x40c4c, 0x10101);
  342. outpdw(MDP_BASE + 0x40c50, 0x10101);
  343. outpdw(MDP_BASE + 0x40c54, 0x10101);
  344. outpdw(MDP_BASE + 0x40c58, 0x10101);
  345. outpdw(MDP_BASE + 0x40c5c, 0x10101);
  346. outpdw(MDP_BASE + 0x40c60, 0x10101);
  347. outpdw(MDP_BASE + 0x40c64, 0x10101);
  348. outpdw(MDP_BASE + 0x40c68, 0x20202);
  349. outpdw(MDP_BASE + 0x40c6c, 0x20202);
  350. outpdw(MDP_BASE + 0x40c70, 0x20202);
  351. outpdw(MDP_BASE + 0x40c74, 0x20202);
  352. outpdw(MDP_BASE + 0x40c78, 0x20202);
  353. outpdw(MDP_BASE + 0x40c7c, 0x20202);
  354. outpdw(MDP_BASE + 0x40c80, 0x30303);
  355. outpdw(MDP_BASE + 0x40c84, 0x30303);
  356. outpdw(MDP_BASE + 0x40c88, 0x30303);
  357. outpdw(MDP_BASE + 0x40c8c, 0x30303);
  358. outpdw(MDP_BASE + 0x40c90, 0x30303);
  359. outpdw(MDP_BASE + 0x40c94, 0x40404);
  360. outpdw(MDP_BASE + 0x40c98, 0x40404);
  361. outpdw(MDP_BASE + 0x40c9c, 0x40404);
  362. outpdw(MDP_BASE + 0x40ca0, 0x40404);
  363. outpdw(MDP_BASE + 0x40ca4, 0x40404);
  364. outpdw(MDP_BASE + 0x40ca8, 0x50505);
  365. outpdw(MDP_BASE + 0x40cac, 0x50505);
  366. outpdw(MDP_BASE + 0x40cb0, 0x50505);
  367. outpdw(MDP_BASE + 0x40cb4, 0x50505);
  368. outpdw(MDP_BASE + 0x40cb8, 0x60606);
  369. outpdw(MDP_BASE + 0x40cbc, 0x60606);
  370. outpdw(MDP_BASE + 0x40cc0, 0x60606);
  371. outpdw(MDP_BASE + 0x40cc4, 0x70707);
  372. outpdw(MDP_BASE + 0x40cc8, 0x70707);
  373. outpdw(MDP_BASE + 0x40ccc, 0x70707);
  374. outpdw(MDP_BASE + 0x40cd0, 0x70707);
  375. outpdw(MDP_BASE + 0x40cd4, 0x80808);
  376. outpdw(MDP_BASE + 0x40cd8, 0x80808);
  377. outpdw(MDP_BASE + 0x40cdc, 0x80808);
  378. outpdw(MDP_BASE + 0x40ce0, 0x90909);
  379. outpdw(MDP_BASE + 0x40ce4, 0x90909);
  380. outpdw(MDP_BASE + 0x40ce8, 0xa0a0a);
  381. outpdw(MDP_BASE + 0x40cec, 0xa0a0a);
  382. outpdw(MDP_BASE + 0x40cf0, 0xa0a0a);
  383. outpdw(MDP_BASE + 0x40cf4, 0xb0b0b);
  384. outpdw(MDP_BASE + 0x40cf8, 0xb0b0b);
  385. outpdw(MDP_BASE + 0x40cfc, 0xb0b0b);
  386. outpdw(MDP_BASE + 0x40d00, 0xc0c0c);
  387. outpdw(MDP_BASE + 0x40d04, 0xc0c0c);
  388. outpdw(MDP_BASE + 0x40d08, 0xd0d0d);
  389. outpdw(MDP_BASE + 0x40d0c, 0xd0d0d);
  390. outpdw(MDP_BASE + 0x40d10, 0xe0e0e);
  391. outpdw(MDP_BASE + 0x40d14, 0xe0e0e);
  392. outpdw(MDP_BASE + 0x40d18, 0xe0e0e);
  393. outpdw(MDP_BASE + 0x40d1c, 0xf0f0f);
  394. outpdw(MDP_BASE + 0x40d20, 0xf0f0f);
  395. outpdw(MDP_BASE + 0x40d24, 0x101010);
  396. outpdw(MDP_BASE + 0x40d28, 0x101010);
  397. outpdw(MDP_BASE + 0x40d2c, 0x111111);
  398. outpdw(MDP_BASE + 0x40d30, 0x111111);
  399. outpdw(MDP_BASE + 0x40d34, 0x121212);
  400. outpdw(MDP_BASE + 0x40d38, 0x121212);
  401. outpdw(MDP_BASE + 0x40d3c, 0x131313);
  402. outpdw(MDP_BASE + 0x40d40, 0x131313);
  403. outpdw(MDP_BASE + 0x40d44, 0x141414);
  404. outpdw(MDP_BASE + 0x40d48, 0x151515);
  405. outpdw(MDP_BASE + 0x40d4c, 0x151515);
  406. outpdw(MDP_BASE + 0x40d50, 0x161616);
  407. outpdw(MDP_BASE + 0x40d54, 0x161616);
  408. outpdw(MDP_BASE + 0x40d58, 0x171717);
  409. outpdw(MDP_BASE + 0x40d5c, 0x171717);
  410. outpdw(MDP_BASE + 0x40d60, 0x181818);
  411. outpdw(MDP_BASE + 0x40d64, 0x191919);
  412. outpdw(MDP_BASE + 0x40d68, 0x191919);
  413. outpdw(MDP_BASE + 0x40d6c, 0x1a1a1a);
  414. outpdw(MDP_BASE + 0x40d70, 0x1b1b1b);
  415. outpdw(MDP_BASE + 0x40d74, 0x1b1b1b);
  416. outpdw(MDP_BASE + 0x40d78, 0x1c1c1c);
  417. outpdw(MDP_BASE + 0x40d7c, 0x1c1c1c);
  418. outpdw(MDP_BASE + 0x40d80, 0x1d1d1d);
  419. outpdw(MDP_BASE + 0x40d84, 0x1e1e1e);
  420. outpdw(MDP_BASE + 0x40d88, 0x1f1f1f);
  421. outpdw(MDP_BASE + 0x40d8c, 0x1f1f1f);
  422. outpdw(MDP_BASE + 0x40d90, 0x202020);
  423. outpdw(MDP_BASE + 0x40d94, 0x212121);
  424. outpdw(MDP_BASE + 0x40d98, 0x212121);
  425. outpdw(MDP_BASE + 0x40d9c, 0x222222);
  426. outpdw(MDP_BASE + 0x40da0, 0x232323);
  427. outpdw(MDP_BASE + 0x40da4, 0x242424);
  428. outpdw(MDP_BASE + 0x40da8, 0x242424);
  429. outpdw(MDP_BASE + 0x40dac, 0x252525);
  430. outpdw(MDP_BASE + 0x40db0, 0x262626);
  431. outpdw(MDP_BASE + 0x40db4, 0x272727);
  432. outpdw(MDP_BASE + 0x40db8, 0x272727);
  433. outpdw(MDP_BASE + 0x40dbc, 0x282828);
  434. outpdw(MDP_BASE + 0x40dc0, 0x292929);
  435. outpdw(MDP_BASE + 0x40dc4, 0x2a2a2a);
  436. outpdw(MDP_BASE + 0x40dc8, 0x2b2b2b);
  437. outpdw(MDP_BASE + 0x40dcc, 0x2c2c2c);
  438. outpdw(MDP_BASE + 0x40dd0, 0x2c2c2c);
  439. outpdw(MDP_BASE + 0x40dd4, 0x2d2d2d);
  440. outpdw(MDP_BASE + 0x40dd8, 0x2e2e2e);
  441. outpdw(MDP_BASE + 0x40ddc, 0x2f2f2f);
  442. outpdw(MDP_BASE + 0x40de0, 0x303030);
  443. outpdw(MDP_BASE + 0x40de4, 0x313131);
  444. outpdw(MDP_BASE + 0x40de8, 0x323232);
  445. outpdw(MDP_BASE + 0x40dec, 0x333333);
  446. outpdw(MDP_BASE + 0x40df0, 0x333333);
  447. outpdw(MDP_BASE + 0x40df4, 0x343434);
  448. outpdw(MDP_BASE + 0x40df8, 0x353535);
  449. outpdw(MDP_BASE + 0x40dfc, 0x363636);
  450. outpdw(MDP_BASE + 0x40e00, 0x373737);
  451. outpdw(MDP_BASE + 0x40e04, 0x383838);
  452. outpdw(MDP_BASE + 0x40e08, 0x393939);
  453. outpdw(MDP_BASE + 0x40e0c, 0x3a3a3a);
  454. outpdw(MDP_BASE + 0x40e10, 0x3b3b3b);
  455. outpdw(MDP_BASE + 0x40e14, 0x3c3c3c);
  456. outpdw(MDP_BASE + 0x40e18, 0x3d3d3d);
  457. outpdw(MDP_BASE + 0x40e1c, 0x3e3e3e);
  458. outpdw(MDP_BASE + 0x40e20, 0x3f3f3f);
  459. outpdw(MDP_BASE + 0x40e24, 0x404040);
  460. outpdw(MDP_BASE + 0x40e28, 0x414141);
  461. outpdw(MDP_BASE + 0x40e2c, 0x424242);
  462. outpdw(MDP_BASE + 0x40e30, 0x434343);
  463. outpdw(MDP_BASE + 0x40e34, 0x444444);
  464. outpdw(MDP_BASE + 0x40e38, 0x464646);
  465. outpdw(MDP_BASE + 0x40e3c, 0x474747);
  466. outpdw(MDP_BASE + 0x40e40, 0x484848);
  467. outpdw(MDP_BASE + 0x40e44, 0x494949);
  468. outpdw(MDP_BASE + 0x40e48, 0x4a4a4a);
  469. outpdw(MDP_BASE + 0x40e4c, 0x4b4b4b);
  470. outpdw(MDP_BASE + 0x40e50, 0x4c4c4c);
  471. outpdw(MDP_BASE + 0x40e54, 0x4d4d4d);
  472. outpdw(MDP_BASE + 0x40e58, 0x4f4f4f);
  473. outpdw(MDP_BASE + 0x40e5c, 0x505050);
  474. outpdw(MDP_BASE + 0x40e60, 0x515151);
  475. outpdw(MDP_BASE + 0x40e64, 0x525252);
  476. outpdw(MDP_BASE + 0x40e68, 0x535353);
  477. outpdw(MDP_BASE + 0x40e6c, 0x545454);
  478. outpdw(MDP_BASE + 0x40e70, 0x565656);
  479. outpdw(MDP_BASE + 0x40e74, 0x575757);
  480. outpdw(MDP_BASE + 0x40e78, 0x585858);
  481. outpdw(MDP_BASE + 0x40e7c, 0x595959);
  482. outpdw(MDP_BASE + 0x40e80, 0x5b5b5b);
  483. outpdw(MDP_BASE + 0x40e84, 0x5c5c5c);
  484. outpdw(MDP_BASE + 0x40e88, 0x5d5d5d);
  485. outpdw(MDP_BASE + 0x40e8c, 0x5e5e5e);
  486. outpdw(MDP_BASE + 0x40e90, 0x606060);
  487. outpdw(MDP_BASE + 0x40e94, 0x616161);
  488. outpdw(MDP_BASE + 0x40e98, 0x626262);
  489. outpdw(MDP_BASE + 0x40e9c, 0x646464);
  490. outpdw(MDP_BASE + 0x40ea0, 0x656565);
  491. outpdw(MDP_BASE + 0x40ea4, 0x666666);
  492. outpdw(MDP_BASE + 0x40ea8, 0x686868);
  493. outpdw(MDP_BASE + 0x40eac, 0x696969);
  494. outpdw(MDP_BASE + 0x40eb0, 0x6a6a6a);
  495. outpdw(MDP_BASE + 0x40eb4, 0x6c6c6c);
  496. outpdw(MDP_BASE + 0x40eb8, 0x6d6d6d);
  497. outpdw(MDP_BASE + 0x40ebc, 0x6f6f6f);
  498. outpdw(MDP_BASE + 0x40ec0, 0x707070);
  499. outpdw(MDP_BASE + 0x40ec4, 0x717171);
  500. outpdw(MDP_BASE + 0x40ec8, 0x737373);
  501. outpdw(MDP_BASE + 0x40ecc, 0x747474);
  502. outpdw(MDP_BASE + 0x40ed0, 0x767676);
  503. outpdw(MDP_BASE + 0x40ed4, 0x777777);
  504. outpdw(MDP_BASE + 0x40ed8, 0x797979);
  505. outpdw(MDP_BASE + 0x40edc, 0x7a7a7a);
  506. outpdw(MDP_BASE + 0x40ee0, 0x7c7c7c);
  507. outpdw(MDP_BASE + 0x40ee4, 0x7d7d7d);
  508. outpdw(MDP_BASE + 0x40ee8, 0x7f7f7f);
  509. outpdw(MDP_BASE + 0x40eec, 0x808080);
  510. outpdw(MDP_BASE + 0x40ef0, 0x828282);
  511. outpdw(MDP_BASE + 0x40ef4, 0x838383);
  512. outpdw(MDP_BASE + 0x40ef8, 0x858585);
  513. outpdw(MDP_BASE + 0x40efc, 0x868686);
  514. outpdw(MDP_BASE + 0x40f00, 0x888888);
  515. outpdw(MDP_BASE + 0x40f04, 0x898989);
  516. outpdw(MDP_BASE + 0x40f08, 0x8b8b8b);
  517. outpdw(MDP_BASE + 0x40f0c, 0x8d8d8d);
  518. outpdw(MDP_BASE + 0x40f10, 0x8e8e8e);
  519. outpdw(MDP_BASE + 0x40f14, 0x909090);
  520. outpdw(MDP_BASE + 0x40f18, 0x919191);
  521. outpdw(MDP_BASE + 0x40f1c, 0x939393);
  522. outpdw(MDP_BASE + 0x40f20, 0x959595);
  523. outpdw(MDP_BASE + 0x40f24, 0x969696);
  524. outpdw(MDP_BASE + 0x40f28, 0x989898);
  525. outpdw(MDP_BASE + 0x40f2c, 0x9a9a9a);
  526. outpdw(MDP_BASE + 0x40f30, 0x9b9b9b);
  527. outpdw(MDP_BASE + 0x40f34, 0x9d9d9d);
  528. outpdw(MDP_BASE + 0x40f38, 0x9f9f9f);
  529. outpdw(MDP_BASE + 0x40f3c, 0xa1a1a1);
  530. outpdw(MDP_BASE + 0x40f40, 0xa2a2a2);
  531. outpdw(MDP_BASE + 0x40f44, 0xa4a4a4);
  532. outpdw(MDP_BASE + 0x40f48, 0xa6a6a6);
  533. outpdw(MDP_BASE + 0x40f4c, 0xa7a7a7);
  534. outpdw(MDP_BASE + 0x40f50, 0xa9a9a9);
  535. outpdw(MDP_BASE + 0x40f54, 0xababab);
  536. outpdw(MDP_BASE + 0x40f58, 0xadadad);
  537. outpdw(MDP_BASE + 0x40f5c, 0xafafaf);
  538. outpdw(MDP_BASE + 0x40f60, 0xb0b0b0);
  539. outpdw(MDP_BASE + 0x40f64, 0xb2b2b2);
  540. outpdw(MDP_BASE + 0x40f68, 0xb4b4b4);
  541. outpdw(MDP_BASE + 0x40f6c, 0xb6b6b6);
  542. outpdw(MDP_BASE + 0x40f70, 0xb8b8b8);
  543. outpdw(MDP_BASE + 0x40f74, 0xbababa);
  544. outpdw(MDP_BASE + 0x40f78, 0xbbbbbb);
  545. outpdw(MDP_BASE + 0x40f7c, 0xbdbdbd);
  546. outpdw(MDP_BASE + 0x40f80, 0xbfbfbf);
  547. outpdw(MDP_BASE + 0x40f84, 0xc1c1c1);
  548. outpdw(MDP_BASE + 0x40f88, 0xc3c3c3);
  549. outpdw(MDP_BASE + 0x40f8c, 0xc5c5c5);
  550. outpdw(MDP_BASE + 0x40f90, 0xc7c7c7);
  551. outpdw(MDP_BASE + 0x40f94, 0xc9c9c9);
  552. outpdw(MDP_BASE + 0x40f98, 0xcbcbcb);
  553. outpdw(MDP_BASE + 0x40f9c, 0xcdcdcd);
  554. outpdw(MDP_BASE + 0x40fa0, 0xcfcfcf);
  555. outpdw(MDP_BASE + 0x40fa4, 0xd1d1d1);
  556. outpdw(MDP_BASE + 0x40fa8, 0xd3d3d3);
  557. outpdw(MDP_BASE + 0x40fac, 0xd5d5d5);
  558. outpdw(MDP_BASE + 0x40fb0, 0xd7d7d7);
  559. outpdw(MDP_BASE + 0x40fb4, 0xd9d9d9);
  560. outpdw(MDP_BASE + 0x40fb8, 0xdbdbdb);
  561. outpdw(MDP_BASE + 0x40fbc, 0xdddddd);
  562. outpdw(MDP_BASE + 0x40fc0, 0xdfdfdf);
  563. outpdw(MDP_BASE + 0x40fc4, 0xe1e1e1);
  564. outpdw(MDP_BASE + 0x40fc8, 0xe3e3e3);
  565. outpdw(MDP_BASE + 0x40fcc, 0xe5e5e5);
  566. outpdw(MDP_BASE + 0x40fd0, 0xe7e7e7);
  567. outpdw(MDP_BASE + 0x40fd4, 0xe9e9e9);
  568. outpdw(MDP_BASE + 0x40fd8, 0xebebeb);
  569. outpdw(MDP_BASE + 0x40fdc, 0xeeeeee);
  570. outpdw(MDP_BASE + 0x40fe0, 0xf0f0f0);
  571. outpdw(MDP_BASE + 0x40fe4, 0xf2f2f2);
  572. outpdw(MDP_BASE + 0x40fe8, 0xf4f4f4);
  573. outpdw(MDP_BASE + 0x40fec, 0xf6f6f6);
  574. outpdw(MDP_BASE + 0x40ff0, 0xf8f8f8);
  575. outpdw(MDP_BASE + 0x40ff4, 0xfbfbfb);
  576. outpdw(MDP_BASE + 0x40ff8, 0xfdfdfd);
  577. outpdw(MDP_BASE + 0x40ffc, 0xffffff);
  578. }
  579. #define IRQ_EN_1__MDP_IRQ___M 0x00000800
  580. void mdp_hw_init(int splash)
  581. {
  582. int i;
  583. /* MDP cmd block enable */
  584. mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
  585. /* debug interface write access */
  586. outpdw(MDP_BASE + 0x60, 1);
  587. outp32(MDP_INTR_ENABLE, MDP_ANY_INTR_MASK);
  588. outp32(MDP_EBI2_PORTMAP_MODE, 0x3);
  589. outpdw(MDP_CMD_DEBUG_ACCESS_BASE + 0x01f8, 0x0);
  590. outpdw(MDP_CMD_DEBUG_ACCESS_BASE + 0x01fc, 0x0);
  591. outpdw(MDP_BASE + 0x60, 0x1);
  592. mdp_load_lut_param();
  593. /*
  594. * clear up unused fg/main registers
  595. */
  596. /* comp.plane 2&3 ystride */
  597. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0120, 0x0);
  598. /* unpacked pattern */
  599. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x012c, 0x0);
  600. /* unpacked pattern */
  601. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0130, 0x0);
  602. /* unpacked pattern */
  603. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0134, 0x0);
  604. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0158, 0x0);
  605. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x15c, 0x0);
  606. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0160, 0x0);
  607. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0170, 0x0);
  608. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0174, 0x0);
  609. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x017c, 0x0);
  610. /* comp.plane 2 */
  611. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0114, 0x0);
  612. /* comp.plane 3 */
  613. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0118, 0x0);
  614. /* clear up unused bg registers */
  615. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x01c8, 0);
  616. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x01d0, 0);
  617. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x01dc, 0);
  618. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x01e0, 0);
  619. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x01e4, 0);
  620. #ifndef CONFIG_FB_MSM_MDP22
  621. if (!splash)
  622. MDP_OUTP(MDP_BASE + 0xE0000, 0);
  623. MDP_OUTP(MDP_BASE + 0x100, 0xffffffff);
  624. MDP_OUTP(MDP_BASE + 0x90070, 0);
  625. #endif
  626. /*
  627. * limit vector
  628. * pre gets applied before color matrix conversion
  629. * post is after ccs
  630. */
  631. writel(mdp_plv[0], MDP_CSC_PRE_LV1n(0));
  632. writel(mdp_plv[1], MDP_CSC_PRE_LV1n(1));
  633. writel(mdp_plv[2], MDP_CSC_PRE_LV1n(2));
  634. writel(mdp_plv[3], MDP_CSC_PRE_LV1n(3));
  635. #ifdef CONFIG_FB_MSM_MDP31
  636. writel(mdp_plv[2], MDP_CSC_PRE_LV1n(4));
  637. writel(mdp_plv[3], MDP_CSC_PRE_LV1n(5));
  638. writel(0, MDP_CSC_POST_LV1n(0));
  639. writel(0xff, MDP_CSC_POST_LV1n(1));
  640. writel(0, MDP_CSC_POST_LV1n(2));
  641. writel(0xff, MDP_CSC_POST_LV1n(3));
  642. writel(0, MDP_CSC_POST_LV1n(4));
  643. writel(0xff, MDP_CSC_POST_LV1n(5));
  644. writel(0, MDP_CSC_PRE_LV2n(0));
  645. writel(0xff, MDP_CSC_PRE_LV2n(1));
  646. writel(0, MDP_CSC_PRE_LV2n(2));
  647. writel(0xff, MDP_CSC_PRE_LV2n(3));
  648. writel(0, MDP_CSC_PRE_LV2n(4));
  649. writel(0xff, MDP_CSC_PRE_LV2n(5));
  650. writel(mdp_plv[0], MDP_CSC_POST_LV2n(0));
  651. writel(mdp_plv[1], MDP_CSC_POST_LV2n(1));
  652. writel(mdp_plv[2], MDP_CSC_POST_LV2n(2));
  653. writel(mdp_plv[3], MDP_CSC_POST_LV2n(3));
  654. writel(mdp_plv[2], MDP_CSC_POST_LV2n(4));
  655. writel(mdp_plv[3], MDP_CSC_POST_LV2n(5));
  656. #endif
  657. /* primary forward matrix */
  658. for (i = 0; i < MDP_CCS_SIZE; i++)
  659. writel(mdp_ccs_rgb2yuv.ccs[i], MDP_CSC_PFMVn(i));
  660. #ifdef CONFIG_FB_MSM_MDP31
  661. for (i = 0; i < MDP_BV_SIZE; i++)
  662. writel(mdp_ccs_rgb2yuv.bv[i], MDP_CSC_POST_BV2n(i));
  663. writel(0, MDP_CSC_PRE_BV2n(0));
  664. writel(0, MDP_CSC_PRE_BV2n(1));
  665. writel(0, MDP_CSC_PRE_BV2n(2));
  666. #endif
  667. /* primary reverse matrix */
  668. for (i = 0; i < MDP_CCS_SIZE; i++)
  669. writel(mdp_ccs_yuv2rgb.ccs[i], MDP_CSC_PRMVn(i));
  670. for (i = 0; i < MDP_BV_SIZE; i++)
  671. writel(mdp_ccs_yuv2rgb.bv[i], MDP_CSC_PRE_BV1n(i));
  672. #ifdef CONFIG_FB_MSM_MDP31
  673. writel(0, MDP_CSC_POST_BV1n(0));
  674. writel(0, MDP_CSC_POST_BV1n(1));
  675. writel(0, MDP_CSC_POST_BV1n(2));
  676. outpdw(MDP_BASE + 0x30010, 0x03e0);
  677. outpdw(MDP_BASE + 0x30014, 0x0360);
  678. outpdw(MDP_BASE + 0x30018, 0x0120);
  679. outpdw(MDP_BASE + 0x3001c, 0x0140);
  680. #endif
  681. mdp_init_scale_table();
  682. #ifndef CONFIG_FB_MSM_MDP31
  683. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0104,
  684. ((16 << 6) << 16) | (16) << 6);
  685. #endif
  686. /* MDP cmd block disable */
  687. mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
  688. }