mtk_hdmi_regs.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. /*
  2. * Copyright (c) 2014 MediaTek Inc.
  3. * Author: Jie Qiu <jie.qiu@mediatek.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef _MTK_HDMI_REGS_H
  15. #define _MTK_HDMI_REGS_H
  16. #define GRL_INT_MASK 0x18
  17. #define GRL_IFM_PORT 0x188
  18. #define GRL_CH_SWAP 0x198
  19. #define LR_SWAP BIT(0)
  20. #define LFE_CC_SWAP BIT(1)
  21. #define LSRS_SWAP BIT(2)
  22. #define RLS_RRS_SWAP BIT(3)
  23. #define LR_STATUS_SWAP BIT(4)
  24. #define GRL_I2S_C_STA0 0x140
  25. #define GRL_I2S_C_STA1 0x144
  26. #define GRL_I2S_C_STA2 0x148
  27. #define GRL_I2S_C_STA3 0x14C
  28. #define GRL_I2S_C_STA4 0x150
  29. #define GRL_I2S_UV 0x154
  30. #define I2S_UV_V BIT(0)
  31. #define I2S_UV_U BIT(1)
  32. #define I2S_UV_CH_EN_MASK 0x3c
  33. #define I2S_UV_CH_EN(x) BIT((x) + 2)
  34. #define I2S_UV_TMDS_DEBUG BIT(6)
  35. #define I2S_UV_NORMAL_INFO_INV BIT(7)
  36. #define GRL_ACP_ISRC_CTRL 0x158
  37. #define VS_EN BIT(0)
  38. #define ACP_EN BIT(1)
  39. #define ISRC1_EN BIT(2)
  40. #define ISRC2_EN BIT(3)
  41. #define GAMUT_EN BIT(4)
  42. #define GRL_CTS_CTRL 0x160
  43. #define CTS_CTRL_SOFT BIT(0)
  44. #define GRL_INT 0x14
  45. #define INT_MDI BIT(0)
  46. #define INT_HDCP BIT(1)
  47. #define INT_FIFO_O BIT(2)
  48. #define INT_FIFO_U BIT(3)
  49. #define INT_IFM_ERR BIT(4)
  50. #define INT_INF_DONE BIT(5)
  51. #define INT_NCTS_DONE BIT(6)
  52. #define INT_CTRL_PKT_DONE BIT(7)
  53. #define GRL_INT_MASK 0x18
  54. #define GRL_CTRL 0x1C
  55. #define CTRL_GEN_EN BIT(2)
  56. #define CTRL_SPD_EN BIT(3)
  57. #define CTRL_MPEG_EN BIT(4)
  58. #define CTRL_AUDIO_EN BIT(5)
  59. #define CTRL_AVI_EN BIT(6)
  60. #define CTRL_AVMUTE BIT(7)
  61. #define GRL_STATUS 0x20
  62. #define STATUS_HTPLG BIT(0)
  63. #define STATUS_PORD BIT(1)
  64. #define GRL_DIVN 0x170
  65. #define NCTS_WRI_ANYTIME BIT(6)
  66. #define GRL_AUDIO_CFG 0x17C
  67. #define AUDIO_ZERO BIT(0)
  68. #define HIGH_BIT_RATE BIT(1)
  69. #define SACD_DST BIT(2)
  70. #define DST_NORMAL_DOUBLE BIT(3)
  71. #define DSD_INV BIT(4)
  72. #define LR_INV BIT(5)
  73. #define LR_MIX BIT(6)
  74. #define DSD_SEL BIT(7)
  75. #define GRL_NCTS 0x184
  76. #define GRL_CH_SW0 0x18C
  77. #define GRL_CH_SW1 0x190
  78. #define GRL_CH_SW2 0x194
  79. #define CH_SWITCH(from, to) ((from) << ((to) * 3))
  80. #define GRL_INFOFRM_VER 0x19C
  81. #define GRL_INFOFRM_TYPE 0x1A0
  82. #define GRL_INFOFRM_LNG 0x1A4
  83. #define GRL_MIX_CTRL 0x1B4
  84. #define MIX_CTRL_SRC_EN BIT(0)
  85. #define BYPASS_VOLUME BIT(1)
  86. #define MIX_CTRL_FLAT BIT(7)
  87. #define GRL_AOUT_CFG 0x1C4
  88. #define AOUT_BNUM_SEL_MASK 0x03
  89. #define AOUT_24BIT 0x00
  90. #define AOUT_20BIT 0x02
  91. #define AOUT_16BIT 0x03
  92. #define AOUT_FIFO_ADAP_CTRL BIT(6)
  93. #define AOUT_BURST_PREAMBLE_EN BIT(7)
  94. #define HIGH_BIT_RATE_PACKET_ALIGN (AOUT_BURST_PREAMBLE_EN | \
  95. AOUT_FIFO_ADAP_CTRL)
  96. #define GRL_SHIFT_L1 0x1C0
  97. #define GRL_SHIFT_R2 0x1B0
  98. #define AUDIO_PACKET_OFF BIT(6)
  99. #define GRL_CFG0 0x24
  100. #define CFG0_I2S_MODE_MASK 0x3
  101. #define CFG0_I2S_MODE_RTJ 0x1
  102. #define CFG0_I2S_MODE_LTJ 0x0
  103. #define CFG0_I2S_MODE_I2S 0x2
  104. #define CFG0_W_LENGTH_MASK 0x30
  105. #define CFG0_W_LENGTH_24BIT 0x00
  106. #define CFG0_W_LENGTH_16BIT 0x10
  107. #define GRL_CFG1 0x28
  108. #define CFG1_EDG_SEL BIT(0)
  109. #define CFG1_SPDIF BIT(1)
  110. #define CFG1_DVI BIT(2)
  111. #define CFG1_HDCP_DEBUG BIT(3)
  112. #define GRL_CFG2 0x2c
  113. #define CFG2_MHL_DE_SEL BIT(3)
  114. #define CFG2_MHL_FAKE_DE_SEL BIT(4)
  115. #define CFG2_MHL_DATA_REMAP BIT(5)
  116. #define CFG2_NOTICE_EN BIT(6)
  117. #define CFG2_ACLK_INV BIT(7)
  118. #define GRL_CFG3 0x30
  119. #define CFG3_AES_KEY_INDEX_MASK 0x3f
  120. #define CFG3_CONTROL_PACKET_DELAY BIT(6)
  121. #define CFG3_KSV_LOAD_START BIT(7)
  122. #define GRL_CFG4 0x34
  123. #define CFG4_AES_KEY_LOAD BIT(4)
  124. #define CFG4_AV_UNMUTE_EN BIT(5)
  125. #define CFG4_AV_UNMUTE_SET BIT(6)
  126. #define CFG4_MHL_MODE BIT(7)
  127. #define GRL_CFG5 0x38
  128. #define CFG5_CD_RATIO_MASK 0x8F
  129. #define CFG5_FS128 (0x1 << 4)
  130. #define CFG5_FS256 (0x2 << 4)
  131. #define CFG5_FS384 (0x3 << 4)
  132. #define CFG5_FS512 (0x4 << 4)
  133. #define CFG5_FS768 (0x6 << 4)
  134. #define DUMMY_304 0x304
  135. #define CHMO_SEL (0x3 << 2)
  136. #define CHM1_SEL (0x3 << 4)
  137. #define CHM2_SEL (0x3 << 6)
  138. #define AUDIO_I2S_NCTS_SEL BIT(1)
  139. #define AUDIO_I2S_NCTS_SEL_64 (1 << 1)
  140. #define AUDIO_I2S_NCTS_SEL_128 (0 << 1)
  141. #define NEW_GCP_CTRL BIT(0)
  142. #define NEW_GCP_CTRL_MERGE BIT(0)
  143. #define GRL_L_STATUS_0 0x200
  144. #define GRL_L_STATUS_1 0x204
  145. #define GRL_L_STATUS_2 0x208
  146. #define GRL_L_STATUS_3 0x20c
  147. #define GRL_L_STATUS_4 0x210
  148. #define GRL_L_STATUS_5 0x214
  149. #define GRL_L_STATUS_6 0x218
  150. #define GRL_L_STATUS_7 0x21c
  151. #define GRL_L_STATUS_8 0x220
  152. #define GRL_L_STATUS_9 0x224
  153. #define GRL_L_STATUS_10 0x228
  154. #define GRL_L_STATUS_11 0x22c
  155. #define GRL_L_STATUS_12 0x230
  156. #define GRL_L_STATUS_13 0x234
  157. #define GRL_L_STATUS_14 0x238
  158. #define GRL_L_STATUS_15 0x23c
  159. #define GRL_L_STATUS_16 0x240
  160. #define GRL_L_STATUS_17 0x244
  161. #define GRL_L_STATUS_18 0x248
  162. #define GRL_L_STATUS_19 0x24c
  163. #define GRL_L_STATUS_20 0x250
  164. #define GRL_L_STATUS_21 0x254
  165. #define GRL_L_STATUS_22 0x258
  166. #define GRL_L_STATUS_23 0x25c
  167. #define GRL_R_STATUS_0 0x260
  168. #define GRL_R_STATUS_1 0x264
  169. #define GRL_R_STATUS_2 0x268
  170. #define GRL_R_STATUS_3 0x26c
  171. #define GRL_R_STATUS_4 0x270
  172. #define GRL_R_STATUS_5 0x274
  173. #define GRL_R_STATUS_6 0x278
  174. #define GRL_R_STATUS_7 0x27c
  175. #define GRL_R_STATUS_8 0x280
  176. #define GRL_R_STATUS_9 0x284
  177. #define GRL_R_STATUS_10 0x288
  178. #define GRL_R_STATUS_11 0x28c
  179. #define GRL_R_STATUS_12 0x290
  180. #define GRL_R_STATUS_13 0x294
  181. #define GRL_R_STATUS_14 0x298
  182. #define GRL_R_STATUS_15 0x29c
  183. #define GRL_R_STATUS_16 0x2a0
  184. #define GRL_R_STATUS_17 0x2a4
  185. #define GRL_R_STATUS_18 0x2a8
  186. #define GRL_R_STATUS_19 0x2ac
  187. #define GRL_R_STATUS_20 0x2b0
  188. #define GRL_R_STATUS_21 0x2b4
  189. #define GRL_R_STATUS_22 0x2b8
  190. #define GRL_R_STATUS_23 0x2bc
  191. #define GRL_ABIST_CTRL0 0x2D4
  192. #define GRL_ABIST_CTRL1 0x2D8
  193. #define ABIST_EN BIT(7)
  194. #define ABIST_DATA_FMT (0x7 << 0)
  195. #define VIDEO_CFG_0 0x380
  196. #define VIDEO_CFG_1 0x384
  197. #define VIDEO_CFG_2 0x388
  198. #define VIDEO_CFG_3 0x38c
  199. #define VIDEO_CFG_4 0x390
  200. #define VIDEO_SOURCE_SEL BIT(7)
  201. #define NORMAL_PATH (1 << 7)
  202. #define GEN_RGB (0 << 7)
  203. #define HDMI_SYS_CFG1C 0x000
  204. #define HDMI_ON BIT(0)
  205. #define HDMI_RST BIT(1)
  206. #define ANLG_ON BIT(2)
  207. #define CFG10_DVI BIT(3)
  208. #define HDMI_TST BIT(3)
  209. #define SYS_KEYMASK1 (0xff << 8)
  210. #define SYS_KEYMASK2 (0xff << 16)
  211. #define AUD_OUTSYNC_EN BIT(24)
  212. #define AUD_OUTSYNC_PRE_EN BIT(25)
  213. #define I2CM_ON BIT(26)
  214. #define E2PROM_TYPE_8BIT BIT(27)
  215. #define MCM_E2PROM_ON BIT(28)
  216. #define EXT_E2PROM_ON BIT(29)
  217. #define HTPLG_PIN_SEL_OFF BIT(30)
  218. #define AES_EFUSE_ENABLE BIT(31)
  219. #define HDMI_SYS_CFG20 0x004
  220. #define DEEP_COLOR_MODE_MASK (3 << 1)
  221. #define COLOR_8BIT_MODE (0 << 1)
  222. #define COLOR_10BIT_MODE (1 << 1)
  223. #define COLOR_12BIT_MODE (2 << 1)
  224. #define COLOR_16BIT_MODE (3 << 1)
  225. #define DEEP_COLOR_EN BIT(0)
  226. #define HDMI_AUDIO_TEST_SEL BIT(8)
  227. #define HDMI2P0_EN BIT(11)
  228. #define HDMI_OUT_FIFO_EN BIT(16)
  229. #define HDMI_OUT_FIFO_CLK_INV BIT(17)
  230. #define MHL_MODE_ON BIT(28)
  231. #define MHL_PP_MODE BIT(29)
  232. #define MHL_SYNC_AUTO_EN BIT(30)
  233. #define HDMI_PCLK_FREE_RUN BIT(31)
  234. #define MTK_SIP_SET_AUTHORIZED_SECURE_REG 0x82000001
  235. #endif