rcar_du_regs.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. /*
  2. * rcar_du_regs.h -- R-Car Display Unit Registers Definitions
  3. *
  4. * Copyright (C) 2013 Renesas Electronics Corporation
  5. *
  6. * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2
  10. * as published by the Free Software Foundation.
  11. */
  12. #ifndef __RCAR_DU_REGS_H__
  13. #define __RCAR_DU_REGS_H__
  14. #define DISP2_REG_OFFSET 0x30000
  15. /* -----------------------------------------------------------------------------
  16. * Display Control Registers
  17. */
  18. #define DSYSR 0x00000 /* display 1 */
  19. #define D2SYSR 0x30000 /* display 2 */
  20. #define DSYSR_ILTS (1 << 29)
  21. #define DSYSR_DSEC (1 << 20)
  22. #define DSYSR_IUPD (1 << 16)
  23. #define DSYSR_DRES (1 << 9)
  24. #define DSYSR_DEN (1 << 8)
  25. #define DSYSR_TVM_MASTER (0 << 6)
  26. #define DSYSR_TVM_SWITCH (1 << 6)
  27. #define DSYSR_TVM_TVSYNC (2 << 6)
  28. #define DSYSR_TVM_MASK (3 << 6)
  29. #define DSYSR_SCM_INT_NONE (0 << 4)
  30. #define DSYSR_SCM_INT_SYNC (2 << 4)
  31. #define DSYSR_SCM_INT_VIDEO (3 << 4)
  32. #define DSMR 0x00004
  33. #define D2SMR 0x30004
  34. #define DSMR_VSPM (1 << 28)
  35. #define DSMR_ODPM (1 << 27)
  36. #define DSMR_DIPM_DISP (0 << 25)
  37. #define DSMR_DIPM_CSYNC (1 << 25)
  38. #define DSMR_DIPM_DE (3 << 25)
  39. #define DSMR_DIPM_MASK (3 << 25)
  40. #define DSMR_CSPM (1 << 24)
  41. #define DSMR_DIL (1 << 19)
  42. #define DSMR_VSL (1 << 18)
  43. #define DSMR_HSL (1 << 17)
  44. #define DSMR_DDIS (1 << 16)
  45. #define DSMR_CDEL (1 << 15)
  46. #define DSMR_CDEM_CDE (0 << 13)
  47. #define DSMR_CDEM_LOW (2 << 13)
  48. #define DSMR_CDEM_HIGH (3 << 13)
  49. #define DSMR_CDEM_MASK (3 << 13)
  50. #define DSMR_CDED (1 << 12)
  51. #define DSMR_ODEV (1 << 8)
  52. #define DSMR_CSY_VH_OR (0 << 6)
  53. #define DSMR_CSY_333 (2 << 6)
  54. #define DSMR_CSY_222 (3 << 6)
  55. #define DSMR_CSY_MASK (3 << 6)
  56. #define DSSR 0x00008
  57. #define D2SSR 0x30008
  58. #define DSSR_VC1FB_DSA0 (0 << 30)
  59. #define DSSR_VC1FB_DSA1 (1 << 30)
  60. #define DSSR_VC1FB_DSA2 (2 << 30)
  61. #define DSSR_VC1FB_INIT (3 << 30)
  62. #define DSSR_VC1FB_MASK (3 << 30)
  63. #define DSSR_VC0FB_DSA0 (0 << 28)
  64. #define DSSR_VC0FB_DSA1 (1 << 28)
  65. #define DSSR_VC0FB_DSA2 (2 << 28)
  66. #define DSSR_VC0FB_INIT (3 << 28)
  67. #define DSSR_VC0FB_MASK (3 << 28)
  68. #define DSSR_DFB(n) (1 << ((n)+15))
  69. #define DSSR_TVR (1 << 15)
  70. #define DSSR_FRM (1 << 14)
  71. #define DSSR_VBK (1 << 11)
  72. #define DSSR_RINT (1 << 9)
  73. #define DSSR_HBK (1 << 8)
  74. #define DSSR_ADC(n) (1 << ((n)-1))
  75. #define DSRCR 0x0000c
  76. #define D2SRCR 0x3000c
  77. #define DSRCR_TVCL (1 << 15)
  78. #define DSRCR_FRCL (1 << 14)
  79. #define DSRCR_VBCL (1 << 11)
  80. #define DSRCR_RICL (1 << 9)
  81. #define DSRCR_HBCL (1 << 8)
  82. #define DSRCR_ADCL(n) (1 << ((n)-1))
  83. #define DSRCR_MASK 0x0000cbff
  84. #define DIER 0x00010
  85. #define D2IER 0x30010
  86. #define DIER_TVE (1 << 15)
  87. #define DIER_FRE (1 << 14)
  88. #define DIER_VBE (1 << 11)
  89. #define DIER_RIE (1 << 9)
  90. #define DIER_HBE (1 << 8)
  91. #define DIER_ADCE(n) (1 << ((n)-1))
  92. #define CPCR 0x00014
  93. #define CPCR_CP4CE (1 << 19)
  94. #define CPCR_CP3CE (1 << 18)
  95. #define CPCR_CP2CE (1 << 17)
  96. #define CPCR_CP1CE (1 << 16)
  97. #define DPPR 0x00018
  98. #define DPPR_DPE(n) (1 << ((n)*4-1))
  99. #define DPPR_DPS(n, p) (((p)-1) << DPPR_DPS_SHIFT(n))
  100. #define DPPR_DPS_SHIFT(n) (((n)-1)*4)
  101. #define DPPR_BPP16 (DPPR_DPE(8) | DPPR_DPS(8, 1)) /* plane1 */
  102. #define DPPR_BPP32_P1 (DPPR_DPE(7) | DPPR_DPS(7, 1))
  103. #define DPPR_BPP32_P2 (DPPR_DPE(8) | DPPR_DPS(8, 2))
  104. #define DPPR_BPP32 (DPPR_BPP32_P1 | DPPR_BPP32_P2) /* plane1 & 2 */
  105. #define DEFR 0x00020
  106. #define D2EFR 0x30020
  107. #define DEFR_CODE (0x7773 << 16)
  108. #define DEFR_EXSL (1 << 12)
  109. #define DEFR_EXVL (1 << 11)
  110. #define DEFR_EXUP (1 << 5)
  111. #define DEFR_VCUP (1 << 4)
  112. #define DEFR_DEFE (1 << 0)
  113. #define DAPCR 0x00024
  114. #define DAPCR_CODE (0x7773 << 16)
  115. #define DAPCR_AP2E (1 << 4)
  116. #define DAPCR_AP1E (1 << 0)
  117. #define DCPCR 0x00028
  118. #define DCPCR_CODE (0x7773 << 16)
  119. #define DCPCR_CA2B (1 << 13)
  120. #define DCPCR_CD2F (1 << 12)
  121. #define DCPCR_DC2E (1 << 8)
  122. #define DCPCR_CAB (1 << 5)
  123. #define DCPCR_CDF (1 << 4)
  124. #define DCPCR_DCE (1 << 0)
  125. #define DEFR2 0x00034
  126. #define D2EFR2 0x30034
  127. #define DEFR2_CODE (0x7775 << 16)
  128. #define DEFR2_DEFE2G (1 << 0)
  129. #define DEFR3 0x00038
  130. #define D2EFR3 0x30038
  131. #define DEFR3_CODE (0x7776 << 16)
  132. #define DEFR3_EVDA (1 << 14)
  133. #define DEFR3_EVDM_1 (1 << 12)
  134. #define DEFR3_EVDM_2 (2 << 12)
  135. #define DEFR3_EVDM_3 (3 << 12)
  136. #define DEFR3_VMSM2_EMA (1 << 6)
  137. #define DEFR3_VMSM1_ENA (1 << 4)
  138. #define DEFR3_DEFE3 (1 << 0)
  139. #define DEFR4 0x0003c
  140. #define D2EFR4 0x3003c
  141. #define DEFR4_CODE (0x7777 << 16)
  142. #define DEFR4_LRUO (1 << 5)
  143. #define DEFR4_SPCE (1 << 4)
  144. #define DVCSR 0x000d0
  145. #define DVCSR_VCnFB2_DSA0(n) (0 << ((n)*2+16))
  146. #define DVCSR_VCnFB2_DSA1(n) (1 << ((n)*2+16))
  147. #define DVCSR_VCnFB2_DSA2(n) (2 << ((n)*2+16))
  148. #define DVCSR_VCnFB2_INIT(n) (3 << ((n)*2+16))
  149. #define DVCSR_VCnFB2_MASK(n) (3 << ((n)*2+16))
  150. #define DVCSR_VCnFB_DSA0(n) (0 << ((n)*2))
  151. #define DVCSR_VCnFB_DSA1(n) (1 << ((n)*2))
  152. #define DVCSR_VCnFB_DSA2(n) (2 << ((n)*2))
  153. #define DVCSR_VCnFB_INIT(n) (3 << ((n)*2))
  154. #define DVCSR_VCnFB_MASK(n) (3 << ((n)*2))
  155. #define DEFR5 0x000e0
  156. #define DEFR5_CODE (0x66 << 24)
  157. #define DEFR5_YCRGB2_DIS (0 << 14)
  158. #define DEFR5_YCRGB2_PRI1 (1 << 14)
  159. #define DEFR5_YCRGB2_PRI2 (2 << 14)
  160. #define DEFR5_YCRGB2_PRI3 (3 << 14)
  161. #define DEFR5_YCRGB2_MASK (3 << 14)
  162. #define DEFR5_YCRGB1_DIS (0 << 12)
  163. #define DEFR5_YCRGB1_PRI1 (1 << 12)
  164. #define DEFR5_YCRGB1_PRI2 (2 << 12)
  165. #define DEFR5_YCRGB1_PRI3 (3 << 12)
  166. #define DEFR5_YCRGB1_MASK (3 << 12)
  167. #define DEFR5_DEFE5 (1 << 0)
  168. #define DDLTR 0x000e4
  169. #define DDLTR_CODE (0x7766 << 16)
  170. #define DDLTR_DLAR2 (1 << 6)
  171. #define DDLTR_DLAY2 (1 << 5)
  172. #define DDLTR_DLAY1 (1 << 1)
  173. #define DEFR6 0x000e8
  174. #define DEFR6_CODE (0x7778 << 16)
  175. #define DEFR6_ODPM22_D2SMR (0 << 10)
  176. #define DEFR6_ODPM22_DISP (2 << 10)
  177. #define DEFR6_ODPM22_CDE (3 << 10)
  178. #define DEFR6_ODPM22_MASK (3 << 10)
  179. #define DEFR6_ODPM12_DSMR (0 << 8)
  180. #define DEFR6_ODPM12_DISP (2 << 8)
  181. #define DEFR6_ODPM12_CDE (3 << 8)
  182. #define DEFR6_ODPM12_MASK (3 << 8)
  183. #define DEFR6_TCNE2 (1 << 6)
  184. #define DEFR6_MLOS1 (1 << 2)
  185. #define DEFR6_DEFAULT (DEFR6_CODE | DEFR6_TCNE2)
  186. /* -----------------------------------------------------------------------------
  187. * Display Timing Generation Registers
  188. */
  189. #define HDSR 0x00040
  190. #define HDER 0x00044
  191. #define VDSR 0x00048
  192. #define VDER 0x0004c
  193. #define HCR 0x00050
  194. #define HSWR 0x00054
  195. #define VCR 0x00058
  196. #define VSPR 0x0005c
  197. #define EQWR 0x00060
  198. #define SPWR 0x00064
  199. #define CLAMPSR 0x00070
  200. #define CLAMPWR 0x00074
  201. #define DESR 0x00078
  202. #define DEWR 0x0007c
  203. /* -----------------------------------------------------------------------------
  204. * Display Attribute Registers
  205. */
  206. #define CP1TR 0x00080
  207. #define CP2TR 0x00084
  208. #define CP3TR 0x00088
  209. #define CP4TR 0x0008c
  210. #define DOOR 0x00090
  211. #define DOOR_RGB(r, g, b) (((r) << 18) | ((g) << 10) | ((b) << 2))
  212. #define CDER 0x00094
  213. #define CDER_RGB(r, g, b) (((r) << 18) | ((g) << 10) | ((b) << 2))
  214. #define BPOR 0x00098
  215. #define BPOR_RGB(r, g, b) (((r) << 18) | ((g) << 10) | ((b) << 2))
  216. #define RINTOFSR 0x0009c
  217. #define DSHPR 0x000c8
  218. #define DSHPR_CODE (0x7776 << 16)
  219. #define DSHPR_PRIH (0xa << 4)
  220. #define DSHPR_PRIL_BPP16 (0x8 << 0)
  221. #define DSHPR_PRIL_BPP32 (0x9 << 0)
  222. /* -----------------------------------------------------------------------------
  223. * Display Plane Registers
  224. */
  225. #define PLANE_OFF 0x00100
  226. #define PnMR 0x00100 /* plane 1 */
  227. #define PnMR_VISL_VIN0 (0 << 26) /* use Video Input 0 */
  228. #define PnMR_VISL_VIN1 (1 << 26) /* use Video Input 1 */
  229. #define PnMR_VISL_VIN2 (2 << 26) /* use Video Input 2 */
  230. #define PnMR_VISL_VIN3 (3 << 26) /* use Video Input 3 */
  231. #define PnMR_YCDF_YUYV (1 << 20) /* YUYV format */
  232. #define PnMR_TC_R (0 << 17) /* Tranparent color is PnTC1R */
  233. #define PnMR_TC_CP (1 << 17) /* Tranparent color is color palette */
  234. #define PnMR_WAE (1 << 16) /* Wrap around Enable */
  235. #define PnMR_SPIM_TP (0 << 12) /* Transparent Color */
  236. #define PnMR_SPIM_ALP (1 << 12) /* Alpha Blending */
  237. #define PnMR_SPIM_EOR (2 << 12) /* EOR */
  238. #define PnMR_SPIM_TP_OFF (1 << 14) /* No Transparent Color */
  239. #define PnMR_CPSL_CP1 (0 << 8) /* Color Palette selected 1 */
  240. #define PnMR_CPSL_CP2 (1 << 8) /* Color Palette selected 2 */
  241. #define PnMR_CPSL_CP3 (2 << 8) /* Color Palette selected 3 */
  242. #define PnMR_CPSL_CP4 (3 << 8) /* Color Palette selected 4 */
  243. #define PnMR_DC (1 << 7) /* Display Area Change */
  244. #define PnMR_BM_MD (0 << 4) /* Manual Display Change Mode */
  245. #define PnMR_BM_AR (1 << 4) /* Auto Rendering Mode */
  246. #define PnMR_BM_AD (2 << 4) /* Auto Display Change Mode */
  247. #define PnMR_BM_VC (3 << 4) /* Video Capture Mode */
  248. #define PnMR_DDDF_8BPP (0 << 0) /* 8bit */
  249. #define PnMR_DDDF_16BPP (1 << 0) /* 16bit or 32bit */
  250. #define PnMR_DDDF_ARGB (2 << 0) /* ARGB */
  251. #define PnMR_DDDF_YC (3 << 0) /* YC */
  252. #define PnMR_DDDF_MASK (3 << 0)
  253. #define PnMWR 0x00104
  254. #define PnALPHAR 0x00108
  255. #define PnALPHAR_ABIT_1 (0 << 12)
  256. #define PnALPHAR_ABIT_0 (1 << 12)
  257. #define PnALPHAR_ABIT_X (2 << 12)
  258. #define PnDSXR 0x00110
  259. #define PnDSYR 0x00114
  260. #define PnDPXR 0x00118
  261. #define PnDPYR 0x0011c
  262. #define PnDSA0R 0x00120
  263. #define PnDSA1R 0x00124
  264. #define PnDSA2R 0x00128
  265. #define PnDSA_MASK 0xfffffff0
  266. #define PnSPXR 0x00130
  267. #define PnSPYR 0x00134
  268. #define PnWASPR 0x00138
  269. #define PnWAMWR 0x0013c
  270. #define PnBTR 0x00140
  271. #define PnTC1R 0x00144
  272. #define PnTC2R 0x00148
  273. #define PnTC3R 0x0014c
  274. #define PnTC3R_CODE (0x66 << 24)
  275. #define PnMLR 0x00150
  276. #define PnSWAPR 0x00180
  277. #define PnSWAPR_DIGN (1 << 4)
  278. #define PnSWAPR_SPQW (1 << 3)
  279. #define PnSWAPR_SPLW (1 << 2)
  280. #define PnSWAPR_SPWD (1 << 1)
  281. #define PnSWAPR_SPBY (1 << 0)
  282. #define PnDDCR 0x00184
  283. #define PnDDCR_CODE (0x7775 << 16)
  284. #define PnDDCR_LRGB1 (1 << 11)
  285. #define PnDDCR_LRGB0 (1 << 10)
  286. #define PnDDCR2 0x00188
  287. #define PnDDCR2_CODE (0x7776 << 16)
  288. #define PnDDCR2_NV21 (1 << 5)
  289. #define PnDDCR2_Y420 (1 << 4)
  290. #define PnDDCR2_DIVU (1 << 1)
  291. #define PnDDCR2_DIVY (1 << 0)
  292. #define PnDDCR4 0x00190
  293. #define PnDDCR4_CODE (0x7766 << 16)
  294. #define PnDDCR4_SDFS_RGB (0 << 4)
  295. #define PnDDCR4_SDFS_YC (5 << 4)
  296. #define PnDDCR4_SDFS_MASK (7 << 4)
  297. #define PnDDCR4_EDF_NONE (0 << 0)
  298. #define PnDDCR4_EDF_ARGB8888 (1 << 0)
  299. #define PnDDCR4_EDF_RGB888 (2 << 0)
  300. #define PnDDCR4_EDF_RGB666 (3 << 0)
  301. #define PnDDCR4_EDF_MASK (7 << 0)
  302. #define APnMR 0x0a100
  303. #define APnMR_WAE (1 << 16) /* Wrap around Enable */
  304. #define APnMR_DC (1 << 7) /* Display Area Change */
  305. #define APnMR_BM_MD (0 << 4) /* Manual Display Change Mode */
  306. #define APnMR_BM_AD (2 << 4) /* Auto Display Change Mode */
  307. #define APnMWR 0x0a104
  308. #define APnDSA0R 0x0a120
  309. #define APnDSA1R 0x0a124
  310. #define APnDSA2R 0x0a128
  311. #define APnMLR 0x0a150
  312. /* -----------------------------------------------------------------------------
  313. * Display Capture Registers
  314. */
  315. #define DCMWR 0x0c104
  316. #define DC2MWR 0x0c204
  317. #define DCSAR 0x0c120
  318. #define DC2SAR 0x0c220
  319. #define DCMLR 0x0c150
  320. #define DC2MLR 0x0c250
  321. /* -----------------------------------------------------------------------------
  322. * Color Palette Registers
  323. */
  324. #define CP1_000R 0x01000
  325. #define CP1_255R 0x013fc
  326. #define CP2_000R 0x02000
  327. #define CP2_255R 0x023fc
  328. #define CP3_000R 0x03000
  329. #define CP3_255R 0x033fc
  330. #define CP4_000R 0x04000
  331. #define CP4_255R 0x043fc
  332. /* -----------------------------------------------------------------------------
  333. * External Synchronization Control Registers
  334. */
  335. #define ESCR 0x10000
  336. #define ESCR2 0x31000
  337. #define ESCR_DCLKOINV (1 << 25)
  338. #define ESCR_DCLKSEL_DCLKIN (0 << 20)
  339. #define ESCR_DCLKSEL_CLKS (1 << 20)
  340. #define ESCR_DCLKSEL_MASK (1 << 20)
  341. #define ESCR_DCLKDIS (1 << 16)
  342. #define ESCR_SYNCSEL_OFF (0 << 8)
  343. #define ESCR_SYNCSEL_EXVSYNC (2 << 8)
  344. #define ESCR_SYNCSEL_EXHSYNC (3 << 8)
  345. #define ESCR_FRQSEL_MASK (0x3f << 0)
  346. #define OTAR 0x10004
  347. #define OTAR2 0x31004
  348. /* -----------------------------------------------------------------------------
  349. * Dual Display Output Control Registers
  350. */
  351. #define DORCR 0x11000
  352. #define DORCR_PG2T (1 << 30)
  353. #define DORCR_DK2S (1 << 28)
  354. #define DORCR_PG2D_DS1 (0 << 24)
  355. #define DORCR_PG2D_DS2 (1 << 24)
  356. #define DORCR_PG2D_FIX0 (2 << 24)
  357. #define DORCR_PG2D_DOOR (3 << 24)
  358. #define DORCR_PG2D_MASK (3 << 24)
  359. #define DORCR_DR1D (1 << 21)
  360. #define DORCR_PG1D_DS1 (0 << 16)
  361. #define DORCR_PG1D_DS2 (1 << 16)
  362. #define DORCR_PG1D_FIX0 (2 << 16)
  363. #define DORCR_PG1D_DOOR (3 << 16)
  364. #define DORCR_PG1D_MASK (3 << 16)
  365. #define DORCR_RGPV (1 << 4)
  366. #define DORCR_DPRS (1 << 0)
  367. #define DPTSR 0x11004
  368. #define DPTSR_PnDK(n) (1 << ((n) + 16))
  369. #define DPTSR_PnTS(n) (1 << (n))
  370. #define DAPTSR 0x11008
  371. #define DAPTSR_APnDK(n) (1 << ((n) + 16))
  372. #define DAPTSR_APnTS(n) (1 << (n))
  373. #define DS1PR 0x11020
  374. #define DS2PR 0x11024
  375. /* -----------------------------------------------------------------------------
  376. * YC-RGB Conversion Coefficient Registers
  377. */
  378. #define YNCR 0x11080
  379. #define YNOR 0x11084
  380. #define CRNOR 0x11088
  381. #define CBNOR 0x1108c
  382. #define RCRCR 0x11090
  383. #define GCRCR 0x11094
  384. #define GCBCR 0x11098
  385. #define BCBCR 0x1109c
  386. #endif /* __RCAR_DU_REGS_H__ */