0001
0002
0003
0004
0005
0006 #ifndef _MTK_HDMI_REGS_H
0007 #define _MTK_HDMI_REGS_H
0008
0009 #define GRL_INT_MASK 0x18
0010 #define GRL_IFM_PORT 0x188
0011 #define GRL_CH_SWAP 0x198
0012 #define LR_SWAP BIT(0)
0013 #define LFE_CC_SWAP BIT(1)
0014 #define LSRS_SWAP BIT(2)
0015 #define RLS_RRS_SWAP BIT(3)
0016 #define LR_STATUS_SWAP BIT(4)
0017 #define GRL_I2S_C_STA0 0x140
0018 #define GRL_I2S_C_STA1 0x144
0019 #define GRL_I2S_C_STA2 0x148
0020 #define GRL_I2S_C_STA3 0x14C
0021 #define GRL_I2S_C_STA4 0x150
0022 #define GRL_I2S_UV 0x154
0023 #define I2S_UV_V BIT(0)
0024 #define I2S_UV_U BIT(1)
0025 #define I2S_UV_CH_EN_MASK 0x3c
0026 #define I2S_UV_CH_EN(x) BIT((x) + 2)
0027 #define I2S_UV_TMDS_DEBUG BIT(6)
0028 #define I2S_UV_NORMAL_INFO_INV BIT(7)
0029 #define GRL_ACP_ISRC_CTRL 0x158
0030 #define VS_EN BIT(0)
0031 #define ACP_EN BIT(1)
0032 #define ISRC1_EN BIT(2)
0033 #define ISRC2_EN BIT(3)
0034 #define GAMUT_EN BIT(4)
0035 #define GRL_CTS_CTRL 0x160
0036 #define CTS_CTRL_SOFT BIT(0)
0037 #define GRL_INT 0x14
0038 #define INT_MDI BIT(0)
0039 #define INT_HDCP BIT(1)
0040 #define INT_FIFO_O BIT(2)
0041 #define INT_FIFO_U BIT(3)
0042 #define INT_IFM_ERR BIT(4)
0043 #define INT_INF_DONE BIT(5)
0044 #define INT_NCTS_DONE BIT(6)
0045 #define INT_CTRL_PKT_DONE BIT(7)
0046 #define GRL_INT_MASK 0x18
0047 #define GRL_CTRL 0x1C
0048 #define CTRL_GEN_EN BIT(2)
0049 #define CTRL_SPD_EN BIT(3)
0050 #define CTRL_MPEG_EN BIT(4)
0051 #define CTRL_AUDIO_EN BIT(5)
0052 #define CTRL_AVI_EN BIT(6)
0053 #define CTRL_AVMUTE BIT(7)
0054 #define GRL_STATUS 0x20
0055 #define STATUS_HTPLG BIT(0)
0056 #define STATUS_PORD BIT(1)
0057 #define GRL_DIVN 0x170
0058 #define NCTS_WRI_ANYTIME BIT(6)
0059 #define GRL_AUDIO_CFG 0x17C
0060 #define AUDIO_ZERO BIT(0)
0061 #define HIGH_BIT_RATE BIT(1)
0062 #define SACD_DST BIT(2)
0063 #define DST_NORMAL_DOUBLE BIT(3)
0064 #define DSD_INV BIT(4)
0065 #define LR_INV BIT(5)
0066 #define LR_MIX BIT(6)
0067 #define DSD_SEL BIT(7)
0068 #define GRL_NCTS 0x184
0069 #define GRL_CH_SW0 0x18C
0070 #define GRL_CH_SW1 0x190
0071 #define GRL_CH_SW2 0x194
0072 #define CH_SWITCH(from, to) ((from) << ((to) * 3))
0073 #define GRL_INFOFRM_VER 0x19C
0074 #define GRL_INFOFRM_TYPE 0x1A0
0075 #define GRL_INFOFRM_LNG 0x1A4
0076 #define GRL_MIX_CTRL 0x1B4
0077 #define MIX_CTRL_SRC_EN BIT(0)
0078 #define BYPASS_VOLUME BIT(1)
0079 #define MIX_CTRL_FLAT BIT(7)
0080 #define GRL_AOUT_CFG 0x1C4
0081 #define AOUT_BNUM_SEL_MASK 0x03
0082 #define AOUT_24BIT 0x00
0083 #define AOUT_20BIT 0x02
0084 #define AOUT_16BIT 0x03
0085 #define AOUT_FIFO_ADAP_CTRL BIT(6)
0086 #define AOUT_BURST_PREAMBLE_EN BIT(7)
0087 #define HIGH_BIT_RATE_PACKET_ALIGN (AOUT_BURST_PREAMBLE_EN | \
0088 AOUT_FIFO_ADAP_CTRL)
0089 #define GRL_SHIFT_L1 0x1C0
0090 #define GRL_SHIFT_R2 0x1B0
0091 #define AUDIO_PACKET_OFF BIT(6)
0092 #define GRL_CFG0 0x24
0093 #define CFG0_I2S_MODE_MASK 0x3
0094 #define CFG0_I2S_MODE_RTJ 0x1
0095 #define CFG0_I2S_MODE_LTJ 0x0
0096 #define CFG0_I2S_MODE_I2S 0x2
0097 #define CFG0_W_LENGTH_MASK 0x30
0098 #define CFG0_W_LENGTH_24BIT 0x00
0099 #define CFG0_W_LENGTH_16BIT 0x10
0100 #define GRL_CFG1 0x28
0101 #define CFG1_EDG_SEL BIT(0)
0102 #define CFG1_SPDIF BIT(1)
0103 #define CFG1_DVI BIT(2)
0104 #define CFG1_HDCP_DEBUG BIT(3)
0105 #define GRL_CFG2 0x2c
0106 #define CFG2_MHL_DE_SEL BIT(3)
0107 #define CFG2_MHL_FAKE_DE_SEL BIT(4)
0108 #define CFG2_MHL_DATA_REMAP BIT(5)
0109 #define CFG2_NOTICE_EN BIT(6)
0110 #define CFG2_ACLK_INV BIT(7)
0111 #define GRL_CFG3 0x30
0112 #define CFG3_AES_KEY_INDEX_MASK 0x3f
0113 #define CFG3_CONTROL_PACKET_DELAY BIT(6)
0114 #define CFG3_KSV_LOAD_START BIT(7)
0115 #define GRL_CFG4 0x34
0116 #define CFG4_AES_KEY_LOAD BIT(4)
0117 #define CFG4_AV_UNMUTE_EN BIT(5)
0118 #define CFG4_AV_UNMUTE_SET BIT(6)
0119 #define CFG4_MHL_MODE BIT(7)
0120 #define GRL_CFG5 0x38
0121 #define CFG5_CD_RATIO_MASK 0x8F
0122 #define CFG5_FS128 (0x1 << 4)
0123 #define CFG5_FS256 (0x2 << 4)
0124 #define CFG5_FS384 (0x3 << 4)
0125 #define CFG5_FS512 (0x4 << 4)
0126 #define CFG5_FS768 (0x6 << 4)
0127 #define DUMMY_304 0x304
0128 #define CHMO_SEL (0x3 << 2)
0129 #define CHM1_SEL (0x3 << 4)
0130 #define CHM2_SEL (0x3 << 6)
0131 #define AUDIO_I2S_NCTS_SEL BIT(1)
0132 #define AUDIO_I2S_NCTS_SEL_64 (1 << 1)
0133 #define AUDIO_I2S_NCTS_SEL_128 (0 << 1)
0134 #define NEW_GCP_CTRL BIT(0)
0135 #define NEW_GCP_CTRL_MERGE BIT(0)
0136 #define GRL_L_STATUS_0 0x200
0137 #define GRL_L_STATUS_1 0x204
0138 #define GRL_L_STATUS_2 0x208
0139 #define GRL_L_STATUS_3 0x20c
0140 #define GRL_L_STATUS_4 0x210
0141 #define GRL_L_STATUS_5 0x214
0142 #define GRL_L_STATUS_6 0x218
0143 #define GRL_L_STATUS_7 0x21c
0144 #define GRL_L_STATUS_8 0x220
0145 #define GRL_L_STATUS_9 0x224
0146 #define GRL_L_STATUS_10 0x228
0147 #define GRL_L_STATUS_11 0x22c
0148 #define GRL_L_STATUS_12 0x230
0149 #define GRL_L_STATUS_13 0x234
0150 #define GRL_L_STATUS_14 0x238
0151 #define GRL_L_STATUS_15 0x23c
0152 #define GRL_L_STATUS_16 0x240
0153 #define GRL_L_STATUS_17 0x244
0154 #define GRL_L_STATUS_18 0x248
0155 #define GRL_L_STATUS_19 0x24c
0156 #define GRL_L_STATUS_20 0x250
0157 #define GRL_L_STATUS_21 0x254
0158 #define GRL_L_STATUS_22 0x258
0159 #define GRL_L_STATUS_23 0x25c
0160 #define GRL_R_STATUS_0 0x260
0161 #define GRL_R_STATUS_1 0x264
0162 #define GRL_R_STATUS_2 0x268
0163 #define GRL_R_STATUS_3 0x26c
0164 #define GRL_R_STATUS_4 0x270
0165 #define GRL_R_STATUS_5 0x274
0166 #define GRL_R_STATUS_6 0x278
0167 #define GRL_R_STATUS_7 0x27c
0168 #define GRL_R_STATUS_8 0x280
0169 #define GRL_R_STATUS_9 0x284
0170 #define GRL_R_STATUS_10 0x288
0171 #define GRL_R_STATUS_11 0x28c
0172 #define GRL_R_STATUS_12 0x290
0173 #define GRL_R_STATUS_13 0x294
0174 #define GRL_R_STATUS_14 0x298
0175 #define GRL_R_STATUS_15 0x29c
0176 #define GRL_R_STATUS_16 0x2a0
0177 #define GRL_R_STATUS_17 0x2a4
0178 #define GRL_R_STATUS_18 0x2a8
0179 #define GRL_R_STATUS_19 0x2ac
0180 #define GRL_R_STATUS_20 0x2b0
0181 #define GRL_R_STATUS_21 0x2b4
0182 #define GRL_R_STATUS_22 0x2b8
0183 #define GRL_R_STATUS_23 0x2bc
0184 #define GRL_ABIST_CTRL0 0x2D4
0185 #define GRL_ABIST_CTRL1 0x2D8
0186 #define ABIST_EN BIT(7)
0187 #define ABIST_DATA_FMT (0x7 << 0)
0188 #define VIDEO_CFG_0 0x380
0189 #define VIDEO_CFG_1 0x384
0190 #define VIDEO_CFG_2 0x388
0191 #define VIDEO_CFG_3 0x38c
0192 #define VIDEO_CFG_4 0x390
0193 #define VIDEO_SOURCE_SEL BIT(7)
0194 #define NORMAL_PATH (1 << 7)
0195 #define GEN_RGB (0 << 7)
0196
0197 #define HDMI_SYS_CFG1C 0x000
0198 #define HDMI_ON BIT(0)
0199 #define HDMI_RST BIT(1)
0200 #define ANLG_ON BIT(2)
0201 #define CFG10_DVI BIT(3)
0202 #define HDMI_TST BIT(3)
0203 #define SYS_KEYMASK1 (0xff << 8)
0204 #define SYS_KEYMASK2 (0xff << 16)
0205 #define AUD_OUTSYNC_EN BIT(24)
0206 #define AUD_OUTSYNC_PRE_EN BIT(25)
0207 #define I2CM_ON BIT(26)
0208 #define E2PROM_TYPE_8BIT BIT(27)
0209 #define MCM_E2PROM_ON BIT(28)
0210 #define EXT_E2PROM_ON BIT(29)
0211 #define HTPLG_PIN_SEL_OFF BIT(30)
0212 #define AES_EFUSE_ENABLE BIT(31)
0213 #define HDMI_SYS_CFG20 0x004
0214 #define DEEP_COLOR_MODE_MASK (3 << 1)
0215 #define COLOR_8BIT_MODE (0 << 1)
0216 #define COLOR_10BIT_MODE (1 << 1)
0217 #define COLOR_12BIT_MODE (2 << 1)
0218 #define COLOR_16BIT_MODE (3 << 1)
0219 #define DEEP_COLOR_EN BIT(0)
0220 #define HDMI_AUDIO_TEST_SEL BIT(8)
0221 #define HDMI2P0_EN BIT(11)
0222 #define HDMI_OUT_FIFO_EN BIT(16)
0223 #define HDMI_OUT_FIFO_CLK_INV BIT(17)
0224 #define MHL_MODE_ON BIT(28)
0225 #define MHL_PP_MODE BIT(29)
0226 #define MHL_SYNC_AUTO_EN BIT(30)
0227 #define HDMI_PCLK_FREE_RUN BIT(31)
0228
0229 #define MTK_SIP_SET_AUTHORIZED_SECURE_REG 0x82000001
0230 #endif