bdisp-reg.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /*
  2. * Copyright (C) STMicroelectronics SA 2014
  3. * Authors: Fabien Dessenne <fabien.dessenne@st.com> for STMicroelectronics.
  4. * License terms: GNU General Public License (GPL), version 2
  5. */
  6. struct bdisp_node {
  7. /* 0 - General */
  8. u32 nip;
  9. u32 cic;
  10. u32 ins;
  11. u32 ack;
  12. /* 1 - Target */
  13. u32 tba;
  14. u32 tty;
  15. u32 txy;
  16. u32 tsz;
  17. /* 2 - Color Fill */
  18. u32 s1cf;
  19. u32 s2cf;
  20. /* 3 - Source 1 */
  21. u32 s1ba;
  22. u32 s1ty;
  23. u32 s1xy;
  24. u32 s1sz_tsz;
  25. /* 4 - Source 2 */
  26. u32 s2ba;
  27. u32 s2ty;
  28. u32 s2xy;
  29. u32 s2sz;
  30. /* 5 - Source 3 */
  31. u32 s3ba;
  32. u32 s3ty;
  33. u32 s3xy;
  34. u32 s3sz;
  35. /* 6 - Clipping */
  36. u32 cwo;
  37. u32 cws;
  38. /* 7 - CLUT */
  39. u32 cco;
  40. u32 cml;
  41. /* 8 - Filter & Mask */
  42. u32 fctl;
  43. u32 pmk;
  44. /* 9 - Chroma Filter */
  45. u32 rsf;
  46. u32 rzi;
  47. u32 hfp;
  48. u32 vfp;
  49. /* 10 - Luma Filter */
  50. u32 y_rsf;
  51. u32 y_rzi;
  52. u32 y_hfp;
  53. u32 y_vfp;
  54. /* 11 - Flicker */
  55. u32 ff0;
  56. u32 ff1;
  57. u32 ff2;
  58. u32 ff3;
  59. /* 12 - Color Key */
  60. u32 key1;
  61. u32 key2;
  62. /* 14 - Static Address & User */
  63. u32 sar;
  64. u32 usr;
  65. /* 15 - Input Versatile Matrix */
  66. u32 ivmx0;
  67. u32 ivmx1;
  68. u32 ivmx2;
  69. u32 ivmx3;
  70. /* 16 - Output Versatile Matrix */
  71. u32 ovmx0;
  72. u32 ovmx1;
  73. u32 ovmx2;
  74. u32 ovmx3;
  75. /* 17 - Pace */
  76. u32 pace;
  77. /* 18 - VC1R & DEI */
  78. u32 vc1r;
  79. u32 dei;
  80. /* 19 - Gradient Fill */
  81. u32 hgf;
  82. u32 vgf;
  83. };
  84. /* HW registers : static */
  85. #define BLT_CTL 0x0A00
  86. #define BLT_ITS 0x0A04
  87. #define BLT_STA1 0x0A08
  88. #define BLT_AQ1_CTL 0x0A60
  89. #define BLT_AQ1_IP 0x0A64
  90. #define BLT_AQ1_LNA 0x0A68
  91. #define BLT_AQ1_STA 0x0A6C
  92. #define BLT_ITM0 0x0AD0
  93. /* HW registers : plugs */
  94. #define BLT_PLUGS1_OP2 0x0B04
  95. #define BLT_PLUGS1_CHZ 0x0B08
  96. #define BLT_PLUGS1_MSZ 0x0B0C
  97. #define BLT_PLUGS1_PGZ 0x0B10
  98. #define BLT_PLUGS2_OP2 0x0B24
  99. #define BLT_PLUGS2_CHZ 0x0B28
  100. #define BLT_PLUGS2_MSZ 0x0B2C
  101. #define BLT_PLUGS2_PGZ 0x0B30
  102. #define BLT_PLUGS3_OP2 0x0B44
  103. #define BLT_PLUGS3_CHZ 0x0B48
  104. #define BLT_PLUGS3_MSZ 0x0B4C
  105. #define BLT_PLUGS3_PGZ 0x0B50
  106. #define BLT_PLUGT_OP2 0x0B84
  107. #define BLT_PLUGT_CHZ 0x0B88
  108. #define BLT_PLUGT_MSZ 0x0B8C
  109. #define BLT_PLUGT_PGZ 0x0B90
  110. /* HW registers : node */
  111. #define BLT_NIP 0x0C00
  112. #define BLT_CIC 0x0C04
  113. #define BLT_INS 0x0C08
  114. #define BLT_ACK 0x0C0C
  115. #define BLT_TBA 0x0C10
  116. #define BLT_TTY 0x0C14
  117. #define BLT_TXY 0x0C18
  118. #define BLT_TSZ 0x0C1C
  119. #define BLT_S1BA 0x0C28
  120. #define BLT_S1TY 0x0C2C
  121. #define BLT_S1XY 0x0C30
  122. #define BLT_S2BA 0x0C38
  123. #define BLT_S2TY 0x0C3C
  124. #define BLT_S2XY 0x0C40
  125. #define BLT_S2SZ 0x0C44
  126. #define BLT_S3BA 0x0C48
  127. #define BLT_S3TY 0x0C4C
  128. #define BLT_S3XY 0x0C50
  129. #define BLT_S3SZ 0x0C54
  130. #define BLT_FCTL 0x0C68
  131. #define BLT_RSF 0x0C70
  132. #define BLT_RZI 0x0C74
  133. #define BLT_HFP 0x0C78
  134. #define BLT_VFP 0x0C7C
  135. #define BLT_Y_RSF 0x0C80
  136. #define BLT_Y_RZI 0x0C84
  137. #define BLT_Y_HFP 0x0C88
  138. #define BLT_Y_VFP 0x0C8C
  139. #define BLT_IVMX0 0x0CC0
  140. #define BLT_IVMX1 0x0CC4
  141. #define BLT_IVMX2 0x0CC8
  142. #define BLT_IVMX3 0x0CCC
  143. #define BLT_OVMX0 0x0CD0
  144. #define BLT_OVMX1 0x0CD4
  145. #define BLT_OVMX2 0x0CD8
  146. #define BLT_OVMX3 0x0CDC
  147. #define BLT_DEI 0x0CEC
  148. /* HW registers : filters */
  149. #define BLT_HFC_N 0x0D00
  150. #define BLT_VFC_N 0x0D90
  151. #define BLT_Y_HFC_N 0x0E00
  152. #define BLT_Y_VFC_N 0x0E90
  153. #define BLT_NB_H_COEF 16
  154. #define BLT_NB_V_COEF 10
  155. /* Registers values */
  156. #define BLT_CTL_RESET BIT(31) /* Global soft reset */
  157. #define BLT_ITS_AQ1_LNA BIT(12) /* AQ1 LNA reached */
  158. #define BLT_STA1_IDLE BIT(0) /* BDISP idle */
  159. #define BLT_AQ1_CTL_CFG 0x80400003 /* Enable, P3, LNA reached */
  160. #define BLT_INS_S1_MASK (BIT(0) | BIT(1) | BIT(2))
  161. #define BLT_INS_S1_OFF 0x00000000 /* src1 disabled */
  162. #define BLT_INS_S1_MEM 0x00000001 /* src1 fetched from memory */
  163. #define BLT_INS_S1_CF 0x00000003 /* src1 color fill */
  164. #define BLT_INS_S1_COPY 0x00000004 /* src1 direct copy */
  165. #define BLT_INS_S1_FILL 0x00000007 /* src1 firect fill */
  166. #define BLT_INS_S2_MASK (BIT(3) | BIT(4))
  167. #define BLT_INS_S2_OFF 0x00000000 /* src2 disabled */
  168. #define BLT_INS_S2_MEM 0x00000008 /* src2 fetched from memory */
  169. #define BLT_INS_S2_CF 0x00000018 /* src2 color fill */
  170. #define BLT_INS_S3_MASK BIT(5)
  171. #define BLT_INS_S3_OFF 0x00000000 /* src3 disabled */
  172. #define BLT_INS_S3_MEM 0x00000020 /* src3 fetched from memory */
  173. #define BLT_INS_IVMX BIT(6) /* Input versatile matrix */
  174. #define BLT_INS_CLUT BIT(7) /* Color Look Up Table */
  175. #define BLT_INS_SCALE BIT(8) /* Scaling */
  176. #define BLT_INS_FLICK BIT(9) /* Flicker filter */
  177. #define BLT_INS_CLIP BIT(10) /* Clipping */
  178. #define BLT_INS_CKEY BIT(11) /* Color key */
  179. #define BLT_INS_OVMX BIT(12) /* Output versatile matrix */
  180. #define BLT_INS_DEI BIT(13) /* Deinterlace */
  181. #define BLT_INS_PMASK BIT(14) /* Plane mask */
  182. #define BLT_INS_VC1R BIT(17) /* VC1 Range mapping */
  183. #define BLT_INS_ROTATE BIT(18) /* Rotation */
  184. #define BLT_INS_GRAD BIT(19) /* Gradient fill */
  185. #define BLT_INS_AQLOCK BIT(29) /* AQ lock */
  186. #define BLT_INS_PACE BIT(30) /* Pace down */
  187. #define BLT_INS_IRQ BIT(31) /* Raise IRQ when node done */
  188. #define BLT_CIC_ALL_GRP 0x000FDFFC /* all valid groups present */
  189. #define BLT_ACK_BYPASS_S2S3 0x00000007 /* Bypass src2 and src3 */
  190. #define BLT_TTY_COL_SHIFT 16 /* Color format */
  191. #define BLT_TTY_COL_MASK 0x001F0000 /* Color format mask */
  192. #define BLT_TTY_ALPHA_R BIT(21) /* Alpha range */
  193. #define BLT_TTY_CR_NOT_CB BIT(22) /* CR not Cb */
  194. #define BLT_TTY_MB BIT(23) /* MB frame / field*/
  195. #define BLT_TTY_HSO BIT(24) /* H scan order */
  196. #define BLT_TTY_VSO BIT(25) /* V scan order */
  197. #define BLT_TTY_DITHER BIT(26) /* Dithering */
  198. #define BLT_TTY_CHROMA BIT(27) /* Write chroma / luma */
  199. #define BLT_TTY_BIG_END BIT(30) /* Big endianness */
  200. #define BLT_S1TY_A1_SUBSET BIT(22) /* A1 subset */
  201. #define BLT_S1TY_CHROMA_EXT BIT(26) /* Chroma Extended */
  202. #define BTL_S1TY_SUBBYTE BIT(28) /* Sub-byte fmt, pixel order */
  203. #define BLT_S1TY_RGB_EXP BIT(29) /* RGB expansion mode */
  204. #define BLT_S2TY_A1_SUBSET BIT(22) /* A1 subset */
  205. #define BLT_S2TY_CHROMA_EXT BIT(26) /* Chroma Extended */
  206. #define BTL_S2TY_SUBBYTE BIT(28) /* Sub-byte fmt, pixel order */
  207. #define BLT_S2TY_RGB_EXP BIT(29) /* RGB expansion mode */
  208. #define BLT_S3TY_BLANK_ACC BIT(26) /* Blank access */
  209. #define BLT_FCTL_HV_SCALE 0x00000055 /* H/V resize + color filter */
  210. #define BLT_FCTL_Y_HV_SCALE 0x33000000 /* Luma version */
  211. #define BLT_FCTL_HV_SAMPLE 0x00000044 /* H/V resize */
  212. #define BLT_FCTL_Y_HV_SAMPLE 0x22000000 /* Luma version */
  213. #define BLT_RZI_DEFAULT 0x20003000 /* H/VNB_repeat = 3/2 */
  214. /* Color format */
  215. #define BDISP_RGB565 0x00 /* RGB565 */
  216. #define BDISP_RGB888 0x01 /* RGB888 */
  217. #define BDISP_XRGB8888 0x02 /* RGB888_32 */
  218. #define BDISP_ARGB8888 0x05 /* ARGB888 */
  219. #define BDISP_NV12 0x16 /* YCbCr42x R2B */
  220. #define BDISP_YUV_3B 0x1E /* YUV (3 buffer) */