dispc.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  1. /*
  2. * linux/drivers/video/omap2/dss/dispc.h
  3. *
  4. * Copyright (C) 2011 Texas Instruments
  5. * Author: Archit Taneja <archit@ti.com>
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License version 2 as published by
  10. * the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along with
  18. * this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef __OMAP2_DISPC_REG_H
  21. #define __OMAP2_DISPC_REG_H
  22. /* DISPC common registers */
  23. #define DISPC_REVISION 0x0000
  24. #define DISPC_SYSCONFIG 0x0010
  25. #define DISPC_SYSSTATUS 0x0014
  26. #define DISPC_IRQSTATUS 0x0018
  27. #define DISPC_IRQENABLE 0x001C
  28. #define DISPC_CONTROL 0x0040
  29. #define DISPC_CONFIG 0x0044
  30. #define DISPC_CAPABLE 0x0048
  31. #define DISPC_LINE_STATUS 0x005C
  32. #define DISPC_LINE_NUMBER 0x0060
  33. #define DISPC_GLOBAL_ALPHA 0x0074
  34. #define DISPC_CONTROL2 0x0238
  35. #define DISPC_CONFIG2 0x0620
  36. #define DISPC_DIVISOR 0x0804
  37. #define DISPC_GLOBAL_BUFFER 0x0800
  38. #define DISPC_CONTROL3 0x0848
  39. #define DISPC_CONFIG3 0x084C
  40. #define DISPC_MSTANDBY_CTRL 0x0858
  41. #define DISPC_GLOBAL_MFLAG_ATTRIBUTE 0x085C
  42. /* DISPC overlay registers */
  43. #define DISPC_OVL_BA0(n) (DISPC_OVL_BASE(n) + \
  44. DISPC_BA0_OFFSET(n))
  45. #define DISPC_OVL_BA1(n) (DISPC_OVL_BASE(n) + \
  46. DISPC_BA1_OFFSET(n))
  47. #define DISPC_OVL_BA0_UV(n) (DISPC_OVL_BASE(n) + \
  48. DISPC_BA0_UV_OFFSET(n))
  49. #define DISPC_OVL_BA1_UV(n) (DISPC_OVL_BASE(n) + \
  50. DISPC_BA1_UV_OFFSET(n))
  51. #define DISPC_OVL_POSITION(n) (DISPC_OVL_BASE(n) + \
  52. DISPC_POS_OFFSET(n))
  53. #define DISPC_OVL_SIZE(n) (DISPC_OVL_BASE(n) + \
  54. DISPC_SIZE_OFFSET(n))
  55. #define DISPC_OVL_ATTRIBUTES(n) (DISPC_OVL_BASE(n) + \
  56. DISPC_ATTR_OFFSET(n))
  57. #define DISPC_OVL_ATTRIBUTES2(n) (DISPC_OVL_BASE(n) + \
  58. DISPC_ATTR2_OFFSET(n))
  59. #define DISPC_OVL_FIFO_THRESHOLD(n) (DISPC_OVL_BASE(n) + \
  60. DISPC_FIFO_THRESH_OFFSET(n))
  61. #define DISPC_OVL_FIFO_SIZE_STATUS(n) (DISPC_OVL_BASE(n) + \
  62. DISPC_FIFO_SIZE_STATUS_OFFSET(n))
  63. #define DISPC_OVL_ROW_INC(n) (DISPC_OVL_BASE(n) + \
  64. DISPC_ROW_INC_OFFSET(n))
  65. #define DISPC_OVL_PIXEL_INC(n) (DISPC_OVL_BASE(n) + \
  66. DISPC_PIX_INC_OFFSET(n))
  67. #define DISPC_OVL_WINDOW_SKIP(n) (DISPC_OVL_BASE(n) + \
  68. DISPC_WINDOW_SKIP_OFFSET(n))
  69. #define DISPC_OVL_TABLE_BA(n) (DISPC_OVL_BASE(n) + \
  70. DISPC_TABLE_BA_OFFSET(n))
  71. #define DISPC_OVL_FIR(n) (DISPC_OVL_BASE(n) + \
  72. DISPC_FIR_OFFSET(n))
  73. #define DISPC_OVL_FIR2(n) (DISPC_OVL_BASE(n) + \
  74. DISPC_FIR2_OFFSET(n))
  75. #define DISPC_OVL_PICTURE_SIZE(n) (DISPC_OVL_BASE(n) + \
  76. DISPC_PIC_SIZE_OFFSET(n))
  77. #define DISPC_OVL_ACCU0(n) (DISPC_OVL_BASE(n) + \
  78. DISPC_ACCU0_OFFSET(n))
  79. #define DISPC_OVL_ACCU1(n) (DISPC_OVL_BASE(n) + \
  80. DISPC_ACCU1_OFFSET(n))
  81. #define DISPC_OVL_ACCU2_0(n) (DISPC_OVL_BASE(n) + \
  82. DISPC_ACCU2_0_OFFSET(n))
  83. #define DISPC_OVL_ACCU2_1(n) (DISPC_OVL_BASE(n) + \
  84. DISPC_ACCU2_1_OFFSET(n))
  85. #define DISPC_OVL_FIR_COEF_H(n, i) (DISPC_OVL_BASE(n) + \
  86. DISPC_FIR_COEF_H_OFFSET(n, i))
  87. #define DISPC_OVL_FIR_COEF_HV(n, i) (DISPC_OVL_BASE(n) + \
  88. DISPC_FIR_COEF_HV_OFFSET(n, i))
  89. #define DISPC_OVL_FIR_COEF_H2(n, i) (DISPC_OVL_BASE(n) + \
  90. DISPC_FIR_COEF_H2_OFFSET(n, i))
  91. #define DISPC_OVL_FIR_COEF_HV2(n, i) (DISPC_OVL_BASE(n) + \
  92. DISPC_FIR_COEF_HV2_OFFSET(n, i))
  93. #define DISPC_OVL_CONV_COEF(n, i) (DISPC_OVL_BASE(n) + \
  94. DISPC_CONV_COEF_OFFSET(n, i))
  95. #define DISPC_OVL_FIR_COEF_V(n, i) (DISPC_OVL_BASE(n) + \
  96. DISPC_FIR_COEF_V_OFFSET(n, i))
  97. #define DISPC_OVL_FIR_COEF_V2(n, i) (DISPC_OVL_BASE(n) + \
  98. DISPC_FIR_COEF_V2_OFFSET(n, i))
  99. #define DISPC_OVL_PRELOAD(n) (DISPC_OVL_BASE(n) + \
  100. DISPC_PRELOAD_OFFSET(n))
  101. #define DISPC_OVL_MFLAG_THRESHOLD(n) DISPC_MFLAG_THRESHOLD_OFFSET(n)
  102. /* DISPC up/downsampling FIR filter coefficient structure */
  103. struct dispc_coef {
  104. s8 hc4_vc22;
  105. s8 hc3_vc2;
  106. u8 hc2_vc1;
  107. s8 hc1_vc0;
  108. s8 hc0_vc00;
  109. };
  110. const struct dispc_coef *dispc_ovl_get_scale_coef(int inc, int five_taps);
  111. /* DISPC manager/channel specific registers */
  112. static inline u16 DISPC_DEFAULT_COLOR(enum omap_channel channel)
  113. {
  114. switch (channel) {
  115. case OMAP_DSS_CHANNEL_LCD:
  116. return 0x004C;
  117. case OMAP_DSS_CHANNEL_DIGIT:
  118. return 0x0050;
  119. case OMAP_DSS_CHANNEL_LCD2:
  120. return 0x03AC;
  121. case OMAP_DSS_CHANNEL_LCD3:
  122. return 0x0814;
  123. default:
  124. BUG();
  125. return 0;
  126. }
  127. }
  128. static inline u16 DISPC_TRANS_COLOR(enum omap_channel channel)
  129. {
  130. switch (channel) {
  131. case OMAP_DSS_CHANNEL_LCD:
  132. return 0x0054;
  133. case OMAP_DSS_CHANNEL_DIGIT:
  134. return 0x0058;
  135. case OMAP_DSS_CHANNEL_LCD2:
  136. return 0x03B0;
  137. case OMAP_DSS_CHANNEL_LCD3:
  138. return 0x0818;
  139. default:
  140. BUG();
  141. return 0;
  142. }
  143. }
  144. static inline u16 DISPC_TIMING_H(enum omap_channel channel)
  145. {
  146. switch (channel) {
  147. case OMAP_DSS_CHANNEL_LCD:
  148. return 0x0064;
  149. case OMAP_DSS_CHANNEL_DIGIT:
  150. BUG();
  151. return 0;
  152. case OMAP_DSS_CHANNEL_LCD2:
  153. return 0x0400;
  154. case OMAP_DSS_CHANNEL_LCD3:
  155. return 0x0840;
  156. default:
  157. BUG();
  158. return 0;
  159. }
  160. }
  161. static inline u16 DISPC_TIMING_V(enum omap_channel channel)
  162. {
  163. switch (channel) {
  164. case OMAP_DSS_CHANNEL_LCD:
  165. return 0x0068;
  166. case OMAP_DSS_CHANNEL_DIGIT:
  167. BUG();
  168. return 0;
  169. case OMAP_DSS_CHANNEL_LCD2:
  170. return 0x0404;
  171. case OMAP_DSS_CHANNEL_LCD3:
  172. return 0x0844;
  173. default:
  174. BUG();
  175. return 0;
  176. }
  177. }
  178. static inline u16 DISPC_POL_FREQ(enum omap_channel channel)
  179. {
  180. switch (channel) {
  181. case OMAP_DSS_CHANNEL_LCD:
  182. return 0x006C;
  183. case OMAP_DSS_CHANNEL_DIGIT:
  184. BUG();
  185. return 0;
  186. case OMAP_DSS_CHANNEL_LCD2:
  187. return 0x0408;
  188. case OMAP_DSS_CHANNEL_LCD3:
  189. return 0x083C;
  190. default:
  191. BUG();
  192. return 0;
  193. }
  194. }
  195. static inline u16 DISPC_DIVISORo(enum omap_channel channel)
  196. {
  197. switch (channel) {
  198. case OMAP_DSS_CHANNEL_LCD:
  199. return 0x0070;
  200. case OMAP_DSS_CHANNEL_DIGIT:
  201. BUG();
  202. return 0;
  203. case OMAP_DSS_CHANNEL_LCD2:
  204. return 0x040C;
  205. case OMAP_DSS_CHANNEL_LCD3:
  206. return 0x0838;
  207. default:
  208. BUG();
  209. return 0;
  210. }
  211. }
  212. /* Named as DISPC_SIZE_LCD, DISPC_SIZE_DIGIT and DISPC_SIZE_LCD2 in TRM */
  213. static inline u16 DISPC_SIZE_MGR(enum omap_channel channel)
  214. {
  215. switch (channel) {
  216. case OMAP_DSS_CHANNEL_LCD:
  217. return 0x007C;
  218. case OMAP_DSS_CHANNEL_DIGIT:
  219. return 0x0078;
  220. case OMAP_DSS_CHANNEL_LCD2:
  221. return 0x03CC;
  222. case OMAP_DSS_CHANNEL_LCD3:
  223. return 0x0834;
  224. default:
  225. BUG();
  226. return 0;
  227. }
  228. }
  229. static inline u16 DISPC_DATA_CYCLE1(enum omap_channel channel)
  230. {
  231. switch (channel) {
  232. case OMAP_DSS_CHANNEL_LCD:
  233. return 0x01D4;
  234. case OMAP_DSS_CHANNEL_DIGIT:
  235. BUG();
  236. return 0;
  237. case OMAP_DSS_CHANNEL_LCD2:
  238. return 0x03C0;
  239. case OMAP_DSS_CHANNEL_LCD3:
  240. return 0x0828;
  241. default:
  242. BUG();
  243. return 0;
  244. }
  245. }
  246. static inline u16 DISPC_DATA_CYCLE2(enum omap_channel channel)
  247. {
  248. switch (channel) {
  249. case OMAP_DSS_CHANNEL_LCD:
  250. return 0x01D8;
  251. case OMAP_DSS_CHANNEL_DIGIT:
  252. BUG();
  253. return 0;
  254. case OMAP_DSS_CHANNEL_LCD2:
  255. return 0x03C4;
  256. case OMAP_DSS_CHANNEL_LCD3:
  257. return 0x082C;
  258. default:
  259. BUG();
  260. return 0;
  261. }
  262. }
  263. static inline u16 DISPC_DATA_CYCLE3(enum omap_channel channel)
  264. {
  265. switch (channel) {
  266. case OMAP_DSS_CHANNEL_LCD:
  267. return 0x01DC;
  268. case OMAP_DSS_CHANNEL_DIGIT:
  269. BUG();
  270. return 0;
  271. case OMAP_DSS_CHANNEL_LCD2:
  272. return 0x03C8;
  273. case OMAP_DSS_CHANNEL_LCD3:
  274. return 0x0830;
  275. default:
  276. BUG();
  277. return 0;
  278. }
  279. }
  280. static inline u16 DISPC_CPR_COEF_R(enum omap_channel channel)
  281. {
  282. switch (channel) {
  283. case OMAP_DSS_CHANNEL_LCD:
  284. return 0x0220;
  285. case OMAP_DSS_CHANNEL_DIGIT:
  286. BUG();
  287. return 0;
  288. case OMAP_DSS_CHANNEL_LCD2:
  289. return 0x03BC;
  290. case OMAP_DSS_CHANNEL_LCD3:
  291. return 0x0824;
  292. default:
  293. BUG();
  294. return 0;
  295. }
  296. }
  297. static inline u16 DISPC_CPR_COEF_G(enum omap_channel channel)
  298. {
  299. switch (channel) {
  300. case OMAP_DSS_CHANNEL_LCD:
  301. return 0x0224;
  302. case OMAP_DSS_CHANNEL_DIGIT:
  303. BUG();
  304. return 0;
  305. case OMAP_DSS_CHANNEL_LCD2:
  306. return 0x03B8;
  307. case OMAP_DSS_CHANNEL_LCD3:
  308. return 0x0820;
  309. default:
  310. BUG();
  311. return 0;
  312. }
  313. }
  314. static inline u16 DISPC_CPR_COEF_B(enum omap_channel channel)
  315. {
  316. switch (channel) {
  317. case OMAP_DSS_CHANNEL_LCD:
  318. return 0x0228;
  319. case OMAP_DSS_CHANNEL_DIGIT:
  320. BUG();
  321. return 0;
  322. case OMAP_DSS_CHANNEL_LCD2:
  323. return 0x03B4;
  324. case OMAP_DSS_CHANNEL_LCD3:
  325. return 0x081C;
  326. default:
  327. BUG();
  328. return 0;
  329. }
  330. }
  331. /* DISPC overlay register base addresses */
  332. static inline u16 DISPC_OVL_BASE(enum omap_plane plane)
  333. {
  334. switch (plane) {
  335. case OMAP_DSS_GFX:
  336. return 0x0080;
  337. case OMAP_DSS_VIDEO1:
  338. return 0x00BC;
  339. case OMAP_DSS_VIDEO2:
  340. return 0x014C;
  341. case OMAP_DSS_VIDEO3:
  342. return 0x0300;
  343. case OMAP_DSS_WB:
  344. return 0x0500;
  345. default:
  346. BUG();
  347. return 0;
  348. }
  349. }
  350. /* DISPC overlay register offsets */
  351. static inline u16 DISPC_BA0_OFFSET(enum omap_plane plane)
  352. {
  353. switch (plane) {
  354. case OMAP_DSS_GFX:
  355. case OMAP_DSS_VIDEO1:
  356. case OMAP_DSS_VIDEO2:
  357. return 0x0000;
  358. case OMAP_DSS_VIDEO3:
  359. case OMAP_DSS_WB:
  360. return 0x0008;
  361. default:
  362. BUG();
  363. return 0;
  364. }
  365. }
  366. static inline u16 DISPC_BA1_OFFSET(enum omap_plane plane)
  367. {
  368. switch (plane) {
  369. case OMAP_DSS_GFX:
  370. case OMAP_DSS_VIDEO1:
  371. case OMAP_DSS_VIDEO2:
  372. return 0x0004;
  373. case OMAP_DSS_VIDEO3:
  374. case OMAP_DSS_WB:
  375. return 0x000C;
  376. default:
  377. BUG();
  378. return 0;
  379. }
  380. }
  381. static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane plane)
  382. {
  383. switch (plane) {
  384. case OMAP_DSS_GFX:
  385. BUG();
  386. return 0;
  387. case OMAP_DSS_VIDEO1:
  388. return 0x0544;
  389. case OMAP_DSS_VIDEO2:
  390. return 0x04BC;
  391. case OMAP_DSS_VIDEO3:
  392. return 0x0310;
  393. case OMAP_DSS_WB:
  394. return 0x0118;
  395. default:
  396. BUG();
  397. return 0;
  398. }
  399. }
  400. static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane plane)
  401. {
  402. switch (plane) {
  403. case OMAP_DSS_GFX:
  404. BUG();
  405. return 0;
  406. case OMAP_DSS_VIDEO1:
  407. return 0x0548;
  408. case OMAP_DSS_VIDEO2:
  409. return 0x04C0;
  410. case OMAP_DSS_VIDEO3:
  411. return 0x0314;
  412. case OMAP_DSS_WB:
  413. return 0x011C;
  414. default:
  415. BUG();
  416. return 0;
  417. }
  418. }
  419. static inline u16 DISPC_POS_OFFSET(enum omap_plane plane)
  420. {
  421. switch (plane) {
  422. case OMAP_DSS_GFX:
  423. case OMAP_DSS_VIDEO1:
  424. case OMAP_DSS_VIDEO2:
  425. return 0x0008;
  426. case OMAP_DSS_VIDEO3:
  427. return 0x009C;
  428. default:
  429. BUG();
  430. return 0;
  431. }
  432. }
  433. static inline u16 DISPC_SIZE_OFFSET(enum omap_plane plane)
  434. {
  435. switch (plane) {
  436. case OMAP_DSS_GFX:
  437. case OMAP_DSS_VIDEO1:
  438. case OMAP_DSS_VIDEO2:
  439. return 0x000C;
  440. case OMAP_DSS_VIDEO3:
  441. case OMAP_DSS_WB:
  442. return 0x00A8;
  443. default:
  444. BUG();
  445. return 0;
  446. }
  447. }
  448. static inline u16 DISPC_ATTR_OFFSET(enum omap_plane plane)
  449. {
  450. switch (plane) {
  451. case OMAP_DSS_GFX:
  452. return 0x0020;
  453. case OMAP_DSS_VIDEO1:
  454. case OMAP_DSS_VIDEO2:
  455. return 0x0010;
  456. case OMAP_DSS_VIDEO3:
  457. case OMAP_DSS_WB:
  458. return 0x0070;
  459. default:
  460. BUG();
  461. return 0;
  462. }
  463. }
  464. static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane plane)
  465. {
  466. switch (plane) {
  467. case OMAP_DSS_GFX:
  468. BUG();
  469. return 0;
  470. case OMAP_DSS_VIDEO1:
  471. return 0x0568;
  472. case OMAP_DSS_VIDEO2:
  473. return 0x04DC;
  474. case OMAP_DSS_VIDEO3:
  475. return 0x032C;
  476. case OMAP_DSS_WB:
  477. return 0x0310;
  478. default:
  479. BUG();
  480. return 0;
  481. }
  482. }
  483. static inline u16 DISPC_FIFO_THRESH_OFFSET(enum omap_plane plane)
  484. {
  485. switch (plane) {
  486. case OMAP_DSS_GFX:
  487. return 0x0024;
  488. case OMAP_DSS_VIDEO1:
  489. case OMAP_DSS_VIDEO2:
  490. return 0x0014;
  491. case OMAP_DSS_VIDEO3:
  492. case OMAP_DSS_WB:
  493. return 0x008C;
  494. default:
  495. BUG();
  496. return 0;
  497. }
  498. }
  499. static inline u16 DISPC_FIFO_SIZE_STATUS_OFFSET(enum omap_plane plane)
  500. {
  501. switch (plane) {
  502. case OMAP_DSS_GFX:
  503. return 0x0028;
  504. case OMAP_DSS_VIDEO1:
  505. case OMAP_DSS_VIDEO2:
  506. return 0x0018;
  507. case OMAP_DSS_VIDEO3:
  508. case OMAP_DSS_WB:
  509. return 0x0088;
  510. default:
  511. BUG();
  512. return 0;
  513. }
  514. }
  515. static inline u16 DISPC_ROW_INC_OFFSET(enum omap_plane plane)
  516. {
  517. switch (plane) {
  518. case OMAP_DSS_GFX:
  519. return 0x002C;
  520. case OMAP_DSS_VIDEO1:
  521. case OMAP_DSS_VIDEO2:
  522. return 0x001C;
  523. case OMAP_DSS_VIDEO3:
  524. case OMAP_DSS_WB:
  525. return 0x00A4;
  526. default:
  527. BUG();
  528. return 0;
  529. }
  530. }
  531. static inline u16 DISPC_PIX_INC_OFFSET(enum omap_plane plane)
  532. {
  533. switch (plane) {
  534. case OMAP_DSS_GFX:
  535. return 0x0030;
  536. case OMAP_DSS_VIDEO1:
  537. case OMAP_DSS_VIDEO2:
  538. return 0x0020;
  539. case OMAP_DSS_VIDEO3:
  540. case OMAP_DSS_WB:
  541. return 0x0098;
  542. default:
  543. BUG();
  544. return 0;
  545. }
  546. }
  547. static inline u16 DISPC_WINDOW_SKIP_OFFSET(enum omap_plane plane)
  548. {
  549. switch (plane) {
  550. case OMAP_DSS_GFX:
  551. return 0x0034;
  552. case OMAP_DSS_VIDEO1:
  553. case OMAP_DSS_VIDEO2:
  554. case OMAP_DSS_VIDEO3:
  555. BUG();
  556. return 0;
  557. default:
  558. BUG();
  559. return 0;
  560. }
  561. }
  562. static inline u16 DISPC_TABLE_BA_OFFSET(enum omap_plane plane)
  563. {
  564. switch (plane) {
  565. case OMAP_DSS_GFX:
  566. return 0x0038;
  567. case OMAP_DSS_VIDEO1:
  568. case OMAP_DSS_VIDEO2:
  569. case OMAP_DSS_VIDEO3:
  570. BUG();
  571. return 0;
  572. default:
  573. BUG();
  574. return 0;
  575. }
  576. }
  577. static inline u16 DISPC_FIR_OFFSET(enum omap_plane plane)
  578. {
  579. switch (plane) {
  580. case OMAP_DSS_GFX:
  581. BUG();
  582. return 0;
  583. case OMAP_DSS_VIDEO1:
  584. case OMAP_DSS_VIDEO2:
  585. return 0x0024;
  586. case OMAP_DSS_VIDEO3:
  587. case OMAP_DSS_WB:
  588. return 0x0090;
  589. default:
  590. BUG();
  591. return 0;
  592. }
  593. }
  594. static inline u16 DISPC_FIR2_OFFSET(enum omap_plane plane)
  595. {
  596. switch (plane) {
  597. case OMAP_DSS_GFX:
  598. BUG();
  599. return 0;
  600. case OMAP_DSS_VIDEO1:
  601. return 0x0580;
  602. case OMAP_DSS_VIDEO2:
  603. return 0x055C;
  604. case OMAP_DSS_VIDEO3:
  605. return 0x0424;
  606. case OMAP_DSS_WB:
  607. return 0x290;
  608. default:
  609. BUG();
  610. return 0;
  611. }
  612. }
  613. static inline u16 DISPC_PIC_SIZE_OFFSET(enum omap_plane plane)
  614. {
  615. switch (plane) {
  616. case OMAP_DSS_GFX:
  617. BUG();
  618. return 0;
  619. case OMAP_DSS_VIDEO1:
  620. case OMAP_DSS_VIDEO2:
  621. return 0x0028;
  622. case OMAP_DSS_VIDEO3:
  623. case OMAP_DSS_WB:
  624. return 0x0094;
  625. default:
  626. BUG();
  627. return 0;
  628. }
  629. }
  630. static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane plane)
  631. {
  632. switch (plane) {
  633. case OMAP_DSS_GFX:
  634. BUG();
  635. return 0;
  636. case OMAP_DSS_VIDEO1:
  637. case OMAP_DSS_VIDEO2:
  638. return 0x002C;
  639. case OMAP_DSS_VIDEO3:
  640. case OMAP_DSS_WB:
  641. return 0x0000;
  642. default:
  643. BUG();
  644. return 0;
  645. }
  646. }
  647. static inline u16 DISPC_ACCU2_0_OFFSET(enum omap_plane plane)
  648. {
  649. switch (plane) {
  650. case OMAP_DSS_GFX:
  651. BUG();
  652. return 0;
  653. case OMAP_DSS_VIDEO1:
  654. return 0x0584;
  655. case OMAP_DSS_VIDEO2:
  656. return 0x0560;
  657. case OMAP_DSS_VIDEO3:
  658. return 0x0428;
  659. case OMAP_DSS_WB:
  660. return 0x0294;
  661. default:
  662. BUG();
  663. return 0;
  664. }
  665. }
  666. static inline u16 DISPC_ACCU1_OFFSET(enum omap_plane plane)
  667. {
  668. switch (plane) {
  669. case OMAP_DSS_GFX:
  670. BUG();
  671. return 0;
  672. case OMAP_DSS_VIDEO1:
  673. case OMAP_DSS_VIDEO2:
  674. return 0x0030;
  675. case OMAP_DSS_VIDEO3:
  676. case OMAP_DSS_WB:
  677. return 0x0004;
  678. default:
  679. BUG();
  680. return 0;
  681. }
  682. }
  683. static inline u16 DISPC_ACCU2_1_OFFSET(enum omap_plane plane)
  684. {
  685. switch (plane) {
  686. case OMAP_DSS_GFX:
  687. BUG();
  688. return 0;
  689. case OMAP_DSS_VIDEO1:
  690. return 0x0588;
  691. case OMAP_DSS_VIDEO2:
  692. return 0x0564;
  693. case OMAP_DSS_VIDEO3:
  694. return 0x042C;
  695. case OMAP_DSS_WB:
  696. return 0x0298;
  697. default:
  698. BUG();
  699. return 0;
  700. }
  701. }
  702. /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
  703. static inline u16 DISPC_FIR_COEF_H_OFFSET(enum omap_plane plane, u16 i)
  704. {
  705. switch (plane) {
  706. case OMAP_DSS_GFX:
  707. BUG();
  708. return 0;
  709. case OMAP_DSS_VIDEO1:
  710. case OMAP_DSS_VIDEO2:
  711. return 0x0034 + i * 0x8;
  712. case OMAP_DSS_VIDEO3:
  713. case OMAP_DSS_WB:
  714. return 0x0010 + i * 0x8;
  715. default:
  716. BUG();
  717. return 0;
  718. }
  719. }
  720. /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
  721. static inline u16 DISPC_FIR_COEF_H2_OFFSET(enum omap_plane plane, u16 i)
  722. {
  723. switch (plane) {
  724. case OMAP_DSS_GFX:
  725. BUG();
  726. return 0;
  727. case OMAP_DSS_VIDEO1:
  728. return 0x058C + i * 0x8;
  729. case OMAP_DSS_VIDEO2:
  730. return 0x0568 + i * 0x8;
  731. case OMAP_DSS_VIDEO3:
  732. return 0x0430 + i * 0x8;
  733. case OMAP_DSS_WB:
  734. return 0x02A0 + i * 0x8;
  735. default:
  736. BUG();
  737. return 0;
  738. }
  739. }
  740. /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
  741. static inline u16 DISPC_FIR_COEF_HV_OFFSET(enum omap_plane plane, u16 i)
  742. {
  743. switch (plane) {
  744. case OMAP_DSS_GFX:
  745. BUG();
  746. return 0;
  747. case OMAP_DSS_VIDEO1:
  748. case OMAP_DSS_VIDEO2:
  749. return 0x0038 + i * 0x8;
  750. case OMAP_DSS_VIDEO3:
  751. case OMAP_DSS_WB:
  752. return 0x0014 + i * 0x8;
  753. default:
  754. BUG();
  755. return 0;
  756. }
  757. }
  758. /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
  759. static inline u16 DISPC_FIR_COEF_HV2_OFFSET(enum omap_plane plane, u16 i)
  760. {
  761. switch (plane) {
  762. case OMAP_DSS_GFX:
  763. BUG();
  764. return 0;
  765. case OMAP_DSS_VIDEO1:
  766. return 0x0590 + i * 8;
  767. case OMAP_DSS_VIDEO2:
  768. return 0x056C + i * 0x8;
  769. case OMAP_DSS_VIDEO3:
  770. return 0x0434 + i * 0x8;
  771. case OMAP_DSS_WB:
  772. return 0x02A4 + i * 0x8;
  773. default:
  774. BUG();
  775. return 0;
  776. }
  777. }
  778. /* coef index i = {0, 1, 2, 3, 4,} */
  779. static inline u16 DISPC_CONV_COEF_OFFSET(enum omap_plane plane, u16 i)
  780. {
  781. switch (plane) {
  782. case OMAP_DSS_GFX:
  783. BUG();
  784. return 0;
  785. case OMAP_DSS_VIDEO1:
  786. case OMAP_DSS_VIDEO2:
  787. case OMAP_DSS_VIDEO3:
  788. case OMAP_DSS_WB:
  789. return 0x0074 + i * 0x4;
  790. default:
  791. BUG();
  792. return 0;
  793. }
  794. }
  795. /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
  796. static inline u16 DISPC_FIR_COEF_V_OFFSET(enum omap_plane plane, u16 i)
  797. {
  798. switch (plane) {
  799. case OMAP_DSS_GFX:
  800. BUG();
  801. return 0;
  802. case OMAP_DSS_VIDEO1:
  803. return 0x0124 + i * 0x4;
  804. case OMAP_DSS_VIDEO2:
  805. return 0x00B4 + i * 0x4;
  806. case OMAP_DSS_VIDEO3:
  807. case OMAP_DSS_WB:
  808. return 0x0050 + i * 0x4;
  809. default:
  810. BUG();
  811. return 0;
  812. }
  813. }
  814. /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
  815. static inline u16 DISPC_FIR_COEF_V2_OFFSET(enum omap_plane plane, u16 i)
  816. {
  817. switch (plane) {
  818. case OMAP_DSS_GFX:
  819. BUG();
  820. return 0;
  821. case OMAP_DSS_VIDEO1:
  822. return 0x05CC + i * 0x4;
  823. case OMAP_DSS_VIDEO2:
  824. return 0x05A8 + i * 0x4;
  825. case OMAP_DSS_VIDEO3:
  826. return 0x0470 + i * 0x4;
  827. case OMAP_DSS_WB:
  828. return 0x02E0 + i * 0x4;
  829. default:
  830. BUG();
  831. return 0;
  832. }
  833. }
  834. static inline u16 DISPC_PRELOAD_OFFSET(enum omap_plane plane)
  835. {
  836. switch (plane) {
  837. case OMAP_DSS_GFX:
  838. return 0x01AC;
  839. case OMAP_DSS_VIDEO1:
  840. return 0x0174;
  841. case OMAP_DSS_VIDEO2:
  842. return 0x00E8;
  843. case OMAP_DSS_VIDEO3:
  844. return 0x00A0;
  845. default:
  846. BUG();
  847. return 0;
  848. }
  849. }
  850. static inline u16 DISPC_MFLAG_THRESHOLD_OFFSET(enum omap_plane plane)
  851. {
  852. switch (plane) {
  853. case OMAP_DSS_GFX:
  854. return 0x0860;
  855. case OMAP_DSS_VIDEO1:
  856. return 0x0864;
  857. case OMAP_DSS_VIDEO2:
  858. return 0x0868;
  859. case OMAP_DSS_VIDEO3:
  860. return 0x086c;
  861. default:
  862. BUG();
  863. return 0;
  864. }
  865. }
  866. #endif