regs-mfc.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. /*
  2. * Register definition file for Samsung MFC V5.1 Interface (FIMV) driver
  3. *
  4. * Kamil Debski, Copyright (c) 2010 Samsung Electronics
  5. * http://www.samsung.com/
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _REGS_FIMV_H
  12. #define _REGS_FIMV_H
  13. #define S5P_FIMV_REG_SIZE (S5P_FIMV_END_ADDR - S5P_FIMV_START_ADDR)
  14. #define S5P_FIMV_REG_COUNT ((S5P_FIMV_END_ADDR - S5P_FIMV_START_ADDR) / 4)
  15. /* Number of bits that the buffer address should be shifted for particular
  16. * MFC buffers. */
  17. #define S5P_FIMV_START_ADDR 0x0000
  18. #define S5P_FIMV_END_ADDR 0xe008
  19. #define S5P_FIMV_SW_RESET 0x0000
  20. #define S5P_FIMV_RISC_HOST_INT 0x0008
  21. /* Command from HOST to RISC */
  22. #define S5P_FIMV_HOST2RISC_CMD 0x0030
  23. #define S5P_FIMV_HOST2RISC_ARG1 0x0034
  24. #define S5P_FIMV_HOST2RISC_ARG2 0x0038
  25. #define S5P_FIMV_HOST2RISC_ARG3 0x003c
  26. #define S5P_FIMV_HOST2RISC_ARG4 0x0040
  27. /* Command from RISC to HOST */
  28. #define S5P_FIMV_RISC2HOST_CMD 0x0044
  29. #define S5P_FIMV_RISC2HOST_CMD_MASK 0x1FFFF
  30. #define S5P_FIMV_RISC2HOST_ARG1 0x0048
  31. #define S5P_FIMV_RISC2HOST_ARG2 0x004c
  32. #define S5P_FIMV_RISC2HOST_ARG3 0x0050
  33. #define S5P_FIMV_RISC2HOST_ARG4 0x0054
  34. #define S5P_FIMV_FW_VERSION 0x0058
  35. #define S5P_FIMV_SYS_MEM_SZ 0x005c
  36. #define S5P_FIMV_FW_STATUS 0x0080
  37. /* Memory controller register */
  38. #define S5P_FIMV_MC_DRAMBASE_ADR_A 0x0508
  39. #define S5P_FIMV_MC_DRAMBASE_ADR_B 0x050c
  40. #define S5P_FIMV_MC_STATUS 0x0510
  41. /* Common register */
  42. #define S5P_FIMV_COMMON_BASE_A 0x0600
  43. #define S5P_FIMV_COMMON_BASE_B 0x0700
  44. /* Decoder */
  45. #define S5P_FIMV_DEC_CHROMA_ADR (S5P_FIMV_COMMON_BASE_A)
  46. #define S5P_FIMV_DEC_LUMA_ADR (S5P_FIMV_COMMON_BASE_B)
  47. /* H.264 decoding */
  48. #define S5P_FIMV_H264_VERT_NB_MV_ADR (S5P_FIMV_COMMON_BASE_A + 0x8c)
  49. /* vertical neighbor motion vector */
  50. #define S5P_FIMV_H264_NB_IP_ADR (S5P_FIMV_COMMON_BASE_A + 0x90)
  51. /* neighbor pixels for intra pred */
  52. #define S5P_FIMV_H264_MV_ADR (S5P_FIMV_COMMON_BASE_B + 0x80)
  53. /* H264 motion vector */
  54. /* MPEG4 decoding */
  55. #define S5P_FIMV_MPEG4_NB_DCAC_ADR (S5P_FIMV_COMMON_BASE_A + 0x8c)
  56. /* neighbor AC/DC coeff. */
  57. #define S5P_FIMV_MPEG4_UP_NB_MV_ADR (S5P_FIMV_COMMON_BASE_A + 0x90)
  58. /* upper neighbor motion vector */
  59. #define S5P_FIMV_MPEG4_SA_MV_ADR (S5P_FIMV_COMMON_BASE_A + 0x94)
  60. /* subseq. anchor motion vector */
  61. #define S5P_FIMV_MPEG4_OT_LINE_ADR (S5P_FIMV_COMMON_BASE_A + 0x98)
  62. /* overlap transform line */
  63. #define S5P_FIMV_MPEG4_SP_ADR (S5P_FIMV_COMMON_BASE_A + 0xa8)
  64. /* syntax parser */
  65. /* H.263 decoding */
  66. #define S5P_FIMV_H263_NB_DCAC_ADR (S5P_FIMV_COMMON_BASE_A + 0x8c)
  67. #define S5P_FIMV_H263_UP_NB_MV_ADR (S5P_FIMV_COMMON_BASE_A + 0x90)
  68. #define S5P_FIMV_H263_SA_MV_ADR (S5P_FIMV_COMMON_BASE_A + 0x94)
  69. #define S5P_FIMV_H263_OT_LINE_ADR (S5P_FIMV_COMMON_BASE_A + 0x98)
  70. /* VC-1 decoding */
  71. #define S5P_FIMV_VC1_NB_DCAC_ADR (S5P_FIMV_COMMON_BASE_A + 0x8c)
  72. #define S5P_FIMV_VC1_UP_NB_MV_ADR (S5P_FIMV_COMMON_BASE_A + 0x90)
  73. #define S5P_FIMV_VC1_SA_MV_ADR (S5P_FIMV_COMMON_BASE_A + 0x94)
  74. #define S5P_FIMV_VC1_OT_LINE_ADR (S5P_FIMV_COMMON_BASE_A + 0x98)
  75. #define S5P_FIMV_VC1_BITPLANE3_ADR (S5P_FIMV_COMMON_BASE_A + 0x9c)
  76. /* bitplane3 */
  77. #define S5P_FIMV_VC1_BITPLANE2_ADR (S5P_FIMV_COMMON_BASE_A + 0xa0)
  78. /* bitplane2 */
  79. #define S5P_FIMV_VC1_BITPLANE1_ADR (S5P_FIMV_COMMON_BASE_A + 0xa4)
  80. /* bitplane1 */
  81. /* Encoder */
  82. #define S5P_FIMV_ENC_REF0_LUMA_ADR (S5P_FIMV_COMMON_BASE_A + 0x1c)
  83. #define S5P_FIMV_ENC_REF1_LUMA_ADR (S5P_FIMV_COMMON_BASE_A + 0x20)
  84. /* reconstructed luma */
  85. #define S5P_FIMV_ENC_REF0_CHROMA_ADR (S5P_FIMV_COMMON_BASE_B)
  86. #define S5P_FIMV_ENC_REF1_CHROMA_ADR (S5P_FIMV_COMMON_BASE_B + 0x04)
  87. /* reconstructed chroma */
  88. #define S5P_FIMV_ENC_REF2_LUMA_ADR (S5P_FIMV_COMMON_BASE_B + 0x10)
  89. #define S5P_FIMV_ENC_REF2_CHROMA_ADR (S5P_FIMV_COMMON_BASE_B + 0x08)
  90. #define S5P_FIMV_ENC_REF3_LUMA_ADR (S5P_FIMV_COMMON_BASE_B + 0x14)
  91. #define S5P_FIMV_ENC_REF3_CHROMA_ADR (S5P_FIMV_COMMON_BASE_B + 0x0c)
  92. /* H.264 encoding */
  93. #define S5P_FIMV_H264_UP_MV_ADR (S5P_FIMV_COMMON_BASE_A)
  94. /* upper motion vector */
  95. #define S5P_FIMV_H264_NBOR_INFO_ADR (S5P_FIMV_COMMON_BASE_A + 0x04)
  96. /* entropy engine's neighbor info. */
  97. #define S5P_FIMV_H264_UP_INTRA_MD_ADR (S5P_FIMV_COMMON_BASE_A + 0x08)
  98. /* upper intra MD */
  99. #define S5P_FIMV_H264_COZERO_FLAG_ADR (S5P_FIMV_COMMON_BASE_A + 0x10)
  100. /* direct cozero flag */
  101. #define S5P_FIMV_H264_UP_INTRA_PRED_ADR (S5P_FIMV_COMMON_BASE_B + 0x40)
  102. /* upper intra PRED */
  103. /* H.263 encoding */
  104. #define S5P_FIMV_H263_UP_MV_ADR (S5P_FIMV_COMMON_BASE_A)
  105. /* upper motion vector */
  106. #define S5P_FIMV_H263_ACDC_COEF_ADR (S5P_FIMV_COMMON_BASE_A + 0x04)
  107. /* upper Q coeff. */
  108. /* MPEG4 encoding */
  109. #define S5P_FIMV_MPEG4_UP_MV_ADR (S5P_FIMV_COMMON_BASE_A)
  110. /* upper motion vector */
  111. #define S5P_FIMV_MPEG4_ACDC_COEF_ADR (S5P_FIMV_COMMON_BASE_A + 0x04)
  112. /* upper Q coeff. */
  113. #define S5P_FIMV_MPEG4_COZERO_FLAG_ADR (S5P_FIMV_COMMON_BASE_A + 0x10)
  114. /* direct cozero flag */
  115. #define S5P_FIMV_ENC_REF_B_LUMA_ADR 0x062c /* ref B Luma addr */
  116. #define S5P_FIMV_ENC_REF_B_CHROMA_ADR 0x0630 /* ref B Chroma addr */
  117. #define S5P_FIMV_ENC_CUR_LUMA_ADR 0x0718 /* current Luma addr */
  118. #define S5P_FIMV_ENC_CUR_CHROMA_ADR 0x071C /* current Chroma addr */
  119. /* Codec common register */
  120. #define S5P_FIMV_ENC_HSIZE_PX 0x0818 /* frame width at encoder */
  121. #define S5P_FIMV_ENC_VSIZE_PX 0x081c /* frame height at encoder */
  122. #define S5P_FIMV_ENC_PROFILE 0x0830 /* profile register */
  123. #define S5P_FIMV_ENC_PROFILE_H264_MAIN 0
  124. #define S5P_FIMV_ENC_PROFILE_H264_HIGH 1
  125. #define S5P_FIMV_ENC_PROFILE_H264_BASELINE 2
  126. #define S5P_FIMV_ENC_PROFILE_MPEG4_SIMPLE 0
  127. #define S5P_FIMV_ENC_PROFILE_MPEG4_ADVANCED_SIMPLE 1
  128. #define S5P_FIMV_ENC_PIC_STRUCT 0x083c /* picture field/frame flag */
  129. #define S5P_FIMV_ENC_LF_CTRL 0x0848 /* loop filter control */
  130. #define S5P_FIMV_ENC_ALPHA_OFF 0x084c /* loop filter alpha offset */
  131. #define S5P_FIMV_ENC_BETA_OFF 0x0850 /* loop filter beta offset */
  132. #define S5P_FIMV_MR_BUSIF_CTRL 0x0854 /* hidden, bus interface ctrl */
  133. #define S5P_FIMV_ENC_PXL_CACHE_CTRL 0x0a00 /* pixel cache control */
  134. /* Channel & stream interface register */
  135. #define S5P_FIMV_SI_RTN_CHID 0x2000 /* Return CH inst ID register */
  136. #define S5P_FIMV_SI_CH0_INST_ID 0x2040 /* codec instance ID */
  137. #define S5P_FIMV_SI_CH1_INST_ID 0x2080 /* codec instance ID */
  138. /* Decoder */
  139. #define S5P_FIMV_SI_VRESOL 0x2004 /* vertical res of decoder */
  140. #define S5P_FIMV_SI_HRESOL 0x2008 /* horizontal res of decoder */
  141. #define S5P_FIMV_SI_BUF_NUMBER 0x200c /* number of frames in the
  142. decoded pic */
  143. #define S5P_FIMV_SI_DISPLAY_Y_ADR 0x2010 /* luma addr of displayed pic */
  144. #define S5P_FIMV_SI_DISPLAY_C_ADR 0x2014 /* chroma addrof displayed pic */
  145. #define S5P_FIMV_SI_CONSUMED_BYTES 0x2018 /* Consumed number of bytes to
  146. decode a frame */
  147. #define S5P_FIMV_SI_DISPLAY_STATUS 0x201c /* status of decoded picture */
  148. #define S5P_FIMV_SI_CH0_SB_ST_ADR 0x2044 /* start addr of stream buf */
  149. #define S5P_FIMV_SI_CH0_SB_FRM_SIZE 0x2048 /* size of stream buf */
  150. #define S5P_FIMV_SI_CH0_DESC_ADR 0x204c /* addr of descriptor buf */
  151. #define S5P_FIMV_SI_CH0_CPB_SIZE 0x2058 /* max size of coded pic. buf */
  152. #define S5P_FIMV_SI_CH0_DESC_SIZE 0x205c /* max size of descriptor buf */
  153. #define S5P_FIMV_SI_CH1_SB_ST_ADR 0x2084 /* start addr of stream buf */
  154. #define S5P_FIMV_SI_CH1_SB_FRM_SIZE 0x2088 /* size of stream buf */
  155. #define S5P_FIMV_SI_CH1_DESC_ADR 0x208c /* addr of descriptor buf */
  156. #define S5P_FIMV_SI_CH1_CPB_SIZE 0x2098 /* max size of coded pic. buf */
  157. #define S5P_FIMV_SI_CH1_DESC_SIZE 0x209c /* max size of descriptor buf */
  158. #define S5P_FIMV_CRC_LUMA0 0x2030 /* luma crc data per frame
  159. (top field) */
  160. #define S5P_FIMV_CRC_CHROMA0 0x2034 /* chroma crc data per frame
  161. (top field) */
  162. #define S5P_FIMV_CRC_LUMA1 0x2038 /* luma crc data per bottom
  163. field */
  164. #define S5P_FIMV_CRC_CHROMA1 0x203c /* chroma crc data per bottom
  165. field */
  166. /* Display status */
  167. #define S5P_FIMV_DEC_STATUS_DECODING_ONLY 0
  168. #define S5P_FIMV_DEC_STATUS_DECODING_DISPLAY 1
  169. #define S5P_FIMV_DEC_STATUS_DISPLAY_ONLY 2
  170. #define S5P_FIMV_DEC_STATUS_DECODING_EMPTY 3
  171. #define S5P_FIMV_DEC_STATUS_DECODING_STATUS_MASK 7
  172. #define S5P_FIMV_DEC_STATUS_PROGRESSIVE (0<<3)
  173. #define S5P_FIMV_DEC_STATUS_INTERLACE (1<<3)
  174. #define S5P_FIMV_DEC_STATUS_INTERLACE_MASK (1<<3)
  175. #define S5P_FIMV_DEC_STATUS_CRC_NUMBER_TWO (0<<4)
  176. #define S5P_FIMV_DEC_STATUS_CRC_NUMBER_FOUR (1<<4)
  177. #define S5P_FIMV_DEC_STATUS_CRC_NUMBER_MASK (1<<4)
  178. #define S5P_FIMV_DEC_STATUS_CRC_GENERATED (1<<5)
  179. #define S5P_FIMV_DEC_STATUS_CRC_NOT_GENERATED (0<<5)
  180. #define S5P_FIMV_DEC_STATUS_CRC_MASK (1<<5)
  181. #define S5P_FIMV_DEC_STATUS_RESOLUTION_MASK (3<<4)
  182. #define S5P_FIMV_DEC_STATUS_RESOLUTION_INC (1<<4)
  183. #define S5P_FIMV_DEC_STATUS_RESOLUTION_DEC (2<<4)
  184. /* Decode frame address */
  185. #define S5P_FIMV_DECODE_Y_ADR 0x2024
  186. #define S5P_FIMV_DECODE_C_ADR 0x2028
  187. /* Decoded frame tpe */
  188. #define S5P_FIMV_DECODE_FRAME_TYPE 0x2020
  189. #define S5P_FIMV_DECODE_FRAME_MASK 7
  190. #define S5P_FIMV_DECODE_FRAME_SKIPPED 0
  191. #define S5P_FIMV_DECODE_FRAME_I_FRAME 1
  192. #define S5P_FIMV_DECODE_FRAME_P_FRAME 2
  193. #define S5P_FIMV_DECODE_FRAME_B_FRAME 3
  194. #define S5P_FIMV_DECODE_FRAME_OTHER_FRAME 4
  195. /* Sizes of buffers required for decoding */
  196. #define S5P_FIMV_DEC_NB_IP_SIZE (32 * 1024)
  197. #define S5P_FIMV_DEC_VERT_NB_MV_SIZE (16 * 1024)
  198. #define S5P_FIMV_DEC_NB_DCAC_SIZE (16 * 1024)
  199. #define S5P_FIMV_DEC_UPNB_MV_SIZE (68 * 1024)
  200. #define S5P_FIMV_DEC_SUB_ANCHOR_MV_SIZE (136 * 1024)
  201. #define S5P_FIMV_DEC_OVERLAP_TRANSFORM_SIZE (32 * 1024)
  202. #define S5P_FIMV_DEC_VC1_BITPLANE_SIZE (2 * 1024)
  203. #define S5P_FIMV_DEC_STX_PARSER_SIZE (68 * 1024)
  204. #define S5P_FIMV_DEC_BUF_ALIGN (8 * 1024)
  205. #define S5P_FIMV_ENC_BUF_ALIGN (8 * 1024)
  206. #define S5P_FIMV_NV12M_HALIGN 16
  207. #define S5P_FIMV_NV12M_LVALIGN 16
  208. #define S5P_FIMV_NV12M_CVALIGN 8
  209. #define S5P_FIMV_NV12MT_HALIGN 128
  210. #define S5P_FIMV_NV12MT_VALIGN 32
  211. #define S5P_FIMV_NV12M_SALIGN 2048
  212. #define S5P_FIMV_NV12MT_SALIGN 8192
  213. /* Sizes of buffers required for encoding */
  214. #define S5P_FIMV_ENC_UPMV_SIZE 0x10000
  215. #define S5P_FIMV_ENC_COLFLG_SIZE 0x10000
  216. #define S5P_FIMV_ENC_INTRAMD_SIZE 0x10000
  217. #define S5P_FIMV_ENC_INTRAPRED_SIZE 0x4000
  218. #define S5P_FIMV_ENC_NBORINFO_SIZE 0x10000
  219. #define S5P_FIMV_ENC_ACDCCOEF_SIZE 0x10000
  220. /* Encoder */
  221. #define S5P_FIMV_ENC_SI_STRM_SIZE 0x2004 /* stream size */
  222. #define S5P_FIMV_ENC_SI_PIC_CNT 0x2008 /* picture count */
  223. #define S5P_FIMV_ENC_SI_WRITE_PTR 0x200c /* write pointer */
  224. #define S5P_FIMV_ENC_SI_SLICE_TYPE 0x2010 /* slice type(I/P/B/IDR) */
  225. #define S5P_FIMV_ENC_SI_SLICE_TYPE_NON_CODED 0
  226. #define S5P_FIMV_ENC_SI_SLICE_TYPE_I 1
  227. #define S5P_FIMV_ENC_SI_SLICE_TYPE_P 2
  228. #define S5P_FIMV_ENC_SI_SLICE_TYPE_B 3
  229. #define S5P_FIMV_ENC_SI_SLICE_TYPE_SKIPPED 4
  230. #define S5P_FIMV_ENC_SI_SLICE_TYPE_OTHERS 5
  231. #define S5P_FIMV_ENCODED_Y_ADDR 0x2014 /* the addr of the encoded
  232. luma pic */
  233. #define S5P_FIMV_ENCODED_C_ADDR 0x2018 /* the addr of the encoded
  234. chroma pic */
  235. #define S5P_FIMV_ENC_SI_CH0_SB_ADR 0x2044 /* addr of stream buf */
  236. #define S5P_FIMV_ENC_SI_CH0_SB_SIZE 0x204c /* size of stream buf */
  237. #define S5P_FIMV_ENC_SI_CH0_CUR_Y_ADR 0x2050 /* current Luma addr */
  238. #define S5P_FIMV_ENC_SI_CH0_CUR_C_ADR 0x2054 /* current Chroma addr */
  239. #define S5P_FIMV_ENC_SI_CH0_FRAME_INS 0x2058 /* frame insertion */
  240. #define S5P_FIMV_ENC_SI_CH1_SB_ADR 0x2084 /* addr of stream buf */
  241. #define S5P_FIMV_ENC_SI_CH1_SB_SIZE 0x208c /* size of stream buf */
  242. #define S5P_FIMV_ENC_SI_CH1_CUR_Y_ADR 0x2090 /* current Luma addr */
  243. #define S5P_FIMV_ENC_SI_CH1_CUR_C_ADR 0x2094 /* current Chroma addr */
  244. #define S5P_FIMV_ENC_SI_CH1_FRAME_INS 0x2098 /* frame insertion */
  245. #define S5P_FIMV_ENC_PIC_TYPE_CTRL 0xc504 /* pic type level control */
  246. #define S5P_FIMV_ENC_B_RECON_WRITE_ON 0xc508 /* B frame recon write ctrl */
  247. #define S5P_FIMV_ENC_MSLICE_CTRL 0xc50c /* multi slice control */
  248. #define S5P_FIMV_ENC_MSLICE_MB 0xc510 /* MB number in the one slice */
  249. #define S5P_FIMV_ENC_MSLICE_BIT 0xc514 /* bit count for one slice */
  250. #define S5P_FIMV_ENC_CIR_CTRL 0xc518 /* number of intra refresh MB */
  251. #define S5P_FIMV_ENC_MAP_FOR_CUR 0xc51c /* linear or tiled mode */
  252. #define S5P_FIMV_ENC_PADDING_CTRL 0xc520 /* padding control */
  253. #define S5P_FIMV_ENC_RC_CONFIG 0xc5a0 /* RC config */
  254. #define S5P_FIMV_ENC_RC_BIT_RATE 0xc5a8 /* bit rate */
  255. #define S5P_FIMV_ENC_RC_QBOUND 0xc5ac /* max/min QP */
  256. #define S5P_FIMV_ENC_RC_RPARA 0xc5b0 /* rate control reaction coeff */
  257. #define S5P_FIMV_ENC_RC_MB_CTRL 0xc5b4 /* MB adaptive scaling */
  258. /* Encoder for H264 only */
  259. #define S5P_FIMV_ENC_H264_ENTROPY_MODE 0xd004 /* CAVLC or CABAC */
  260. #define S5P_FIMV_ENC_H264_ALPHA_OFF 0xd008 /* loop filter alpha offset */
  261. #define S5P_FIMV_ENC_H264_BETA_OFF 0xd00c /* loop filter beta offset */
  262. #define S5P_FIMV_ENC_H264_NUM_OF_REF 0xd010 /* number of reference for P/B */
  263. #define S5P_FIMV_ENC_H264_TRANS_FLAG 0xd034 /* 8x8 transform flag in PPS &
  264. high profile */
  265. #define S5P_FIMV_ENC_RC_FRAME_RATE 0xd0d0 /* frame rate */
  266. /* Encoder for MPEG4 only */
  267. #define S5P_FIMV_ENC_MPEG4_QUART_PXL 0xe008 /* qpel interpolation ctrl */
  268. /* Additional */
  269. #define S5P_FIMV_SI_CH0_DPB_CONF_CTRL 0x2068 /* DPB Config Control Register */
  270. #define S5P_FIMV_SLICE_INT_MASK 1
  271. #define S5P_FIMV_SLICE_INT_SHIFT 31
  272. #define S5P_FIMV_DDELAY_ENA_SHIFT 30
  273. #define S5P_FIMV_DDELAY_VAL_MASK 0xff
  274. #define S5P_FIMV_DDELAY_VAL_SHIFT 16
  275. #define S5P_FIMV_DPB_COUNT_MASK 0xffff
  276. #define S5P_FIMV_DPB_FLUSH_MASK 1
  277. #define S5P_FIMV_DPB_FLUSH_SHIFT 14
  278. #define S5P_FIMV_SI_CH0_RELEASE_BUF 0x2060 /* DPB release buffer register */
  279. #define S5P_FIMV_SI_CH0_HOST_WR_ADR 0x2064 /* address of shared memory */
  280. /* Codec numbers */
  281. #define S5P_FIMV_CODEC_NONE -1
  282. #define S5P_FIMV_CODEC_H264_DEC 0
  283. #define S5P_FIMV_CODEC_VC1_DEC 1
  284. #define S5P_FIMV_CODEC_MPEG4_DEC 2
  285. #define S5P_FIMV_CODEC_MPEG2_DEC 3
  286. #define S5P_FIMV_CODEC_H263_DEC 4
  287. #define S5P_FIMV_CODEC_VC1RCV_DEC 5
  288. #define S5P_FIMV_CODEC_H264_ENC 16
  289. #define S5P_FIMV_CODEC_MPEG4_ENC 17
  290. #define S5P_FIMV_CODEC_H263_ENC 18
  291. /* Channel Control Register */
  292. #define S5P_FIMV_CH_SEQ_HEADER 1
  293. #define S5P_FIMV_CH_FRAME_START 2
  294. #define S5P_FIMV_CH_LAST_FRAME 3
  295. #define S5P_FIMV_CH_INIT_BUFS 4
  296. #define S5P_FIMV_CH_FRAME_START_REALLOC 5
  297. #define S5P_FIMV_CH_MASK 7
  298. #define S5P_FIMV_CH_SHIFT 16
  299. /* Host to RISC command */
  300. #define S5P_FIMV_H2R_CMD_EMPTY 0
  301. #define S5P_FIMV_H2R_CMD_OPEN_INSTANCE 1
  302. #define S5P_FIMV_H2R_CMD_CLOSE_INSTANCE 2
  303. #define S5P_FIMV_H2R_CMD_SYS_INIT 3
  304. #define S5P_FIMV_H2R_CMD_FLUSH 4
  305. #define S5P_FIMV_H2R_CMD_SLEEP 5
  306. #define S5P_FIMV_H2R_CMD_WAKEUP 6
  307. #define S5P_FIMV_R2H_CMD_EMPTY 0
  308. #define S5P_FIMV_R2H_CMD_OPEN_INSTANCE_RET 1
  309. #define S5P_FIMV_R2H_CMD_CLOSE_INSTANCE_RET 2
  310. #define S5P_FIMV_R2H_CMD_RSV_RET 3
  311. #define S5P_FIMV_R2H_CMD_SEQ_DONE_RET 4
  312. #define S5P_FIMV_R2H_CMD_FRAME_DONE_RET 5
  313. #define S5P_FIMV_R2H_CMD_SLICE_DONE_RET 6
  314. #define S5P_FIMV_R2H_CMD_ENC_COMPLETE_RET 7
  315. #define S5P_FIMV_R2H_CMD_SYS_INIT_RET 8
  316. #define S5P_FIMV_R2H_CMD_FW_STATUS_RET 9
  317. #define S5P_FIMV_R2H_CMD_SLEEP_RET 10
  318. #define S5P_FIMV_R2H_CMD_WAKEUP_RET 11
  319. #define S5P_FIMV_R2H_CMD_FLUSH_RET 12
  320. #define S5P_FIMV_R2H_CMD_INIT_BUFFERS_RET 15
  321. #define S5P_FIMV_R2H_CMD_EDFU_INIT_RET 16
  322. #define S5P_FIMV_R2H_CMD_ERR_RET 32
  323. /* Error handling defines */
  324. #define S5P_FIMV_ERR_WARNINGS_START 145
  325. #define S5P_FIMV_ERR_DEC_MASK 0xFFFF
  326. #define S5P_FIMV_ERR_DEC_SHIFT 0
  327. #define S5P_FIMV_ERR_DSPL_MASK 0xFFFF0000
  328. #define S5P_FIMV_ERR_DSPL_SHIFT 16
  329. /* Shared memory registers' offsets */
  330. /* An offset of the start position in the stream when
  331. * the start position is not aligned */
  332. #define S5P_FIMV_SHARED_CROP_INFO_H 0x0020
  333. #define S5P_FIMV_SHARED_CROP_LEFT_MASK 0xFFFF
  334. #define S5P_FIMV_SHARED_CROP_LEFT_SHIFT 0
  335. #define S5P_FIMV_SHARED_CROP_RIGHT_MASK 0xFFFF0000
  336. #define S5P_FIMV_SHARED_CROP_RIGHT_SHIFT 16
  337. #define S5P_FIMV_SHARED_CROP_INFO_V 0x0024
  338. #define S5P_FIMV_SHARED_CROP_TOP_MASK 0xFFFF
  339. #define S5P_FIMV_SHARED_CROP_TOP_SHIFT 0
  340. #define S5P_FIMV_SHARED_CROP_BOTTOM_MASK 0xFFFF0000
  341. #define S5P_FIMV_SHARED_CROP_BOTTOM_SHIFT 16
  342. #define S5P_FIMV_SHARED_SET_FRAME_TAG 0x0004
  343. #define S5P_FIMV_SHARED_GET_FRAME_TAG_TOP 0x0008
  344. #define S5P_FIMV_SHARED_GET_FRAME_TAG_BOT 0x000C
  345. #define S5P_FIMV_SHARED_START_BYTE_NUM 0x0018
  346. #define S5P_FIMV_SHARED_RC_VOP_TIMING 0x0030
  347. #define S5P_FIMV_SHARED_LUMA_DPB_SIZE 0x0064
  348. #define S5P_FIMV_SHARED_CHROMA_DPB_SIZE 0x0068
  349. #define S5P_FIMV_SHARED_MV_SIZE 0x006C
  350. #define S5P_FIMV_SHARED_PIC_TIME_TOP 0x0010
  351. #define S5P_FIMV_SHARED_PIC_TIME_BOTTOM 0x0014
  352. #define S5P_FIMV_SHARED_EXT_ENC_CONTROL 0x0028
  353. #define S5P_FIMV_SHARED_P_B_FRAME_QP 0x0070
  354. #define S5P_FIMV_SHARED_ASPECT_RATIO_IDC 0x0074
  355. #define S5P_FIMV_SHARED_EXTENDED_SAR 0x0078
  356. #define S5P_FIMV_SHARED_H264_I_PERIOD 0x009C
  357. #define S5P_FIMV_SHARED_RC_CONTROL_CONFIG 0x00A0
  358. #endif /* _REGS_FIMV_H */