162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (c) 2019-2022 MediaTek Inc.
462306a36Sopenharmony_ci * Copyright (c) 2022 BayLibre
562306a36Sopenharmony_ci */
662306a36Sopenharmony_ci#ifndef _MTK_DP_REG_H_
762306a36Sopenharmony_ci#define _MTK_DP_REG_H_
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#define SEC_OFFSET	0x4000
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#define MTK_DP_HPD_DISCONNECT		BIT(1)
1262306a36Sopenharmony_ci#define MTK_DP_HPD_CONNECT		BIT(2)
1362306a36Sopenharmony_ci#define MTK_DP_HPD_INTERRUPT		BIT(3)
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/* offset: 0x0 */
1662306a36Sopenharmony_ci#define DP_PHY_GLB_BIAS_GEN_00		0x0
1762306a36Sopenharmony_ci#define RG_XTP_GLB_BIAS_INTR_CTRL		GENMASK(20, 16)
1862306a36Sopenharmony_ci#define DP_PHY_GLB_DPAUX_TX		0x8
1962306a36Sopenharmony_ci#define RG_CKM_PT0_CKTX_IMPSEL			GENMASK(23, 20)
2062306a36Sopenharmony_ci#define MTK_DP_0034			0x34
2162306a36Sopenharmony_ci#define DA_XTP_GLB_CKDET_EN_FORCE_VAL		BIT(15)
2262306a36Sopenharmony_ci#define DA_XTP_GLB_CKDET_EN_FORCE_EN		BIT(14)
2362306a36Sopenharmony_ci#define DA_CKM_INTCKTX_EN_FORCE_VAL		BIT(13)
2462306a36Sopenharmony_ci#define DA_CKM_INTCKTX_EN_FORCE_EN		BIT(12)
2562306a36Sopenharmony_ci#define DA_CKM_CKTX0_EN_FORCE_VAL		BIT(11)
2662306a36Sopenharmony_ci#define DA_CKM_CKTX0_EN_FORCE_EN		BIT(10)
2762306a36Sopenharmony_ci#define DA_CKM_XTAL_CK_FORCE_VAL		BIT(9)
2862306a36Sopenharmony_ci#define DA_CKM_XTAL_CK_FORCE_EN			BIT(8)
2962306a36Sopenharmony_ci#define DA_CKM_BIAS_LPF_EN_FORCE_VAL		BIT(7)
3062306a36Sopenharmony_ci#define DA_CKM_BIAS_LPF_EN_FORCE_EN		BIT(6)
3162306a36Sopenharmony_ci#define DA_CKM_BIAS_EN_FORCE_VAL		BIT(5)
3262306a36Sopenharmony_ci#define DA_CKM_BIAS_EN_FORCE_EN			BIT(4)
3362306a36Sopenharmony_ci#define DA_XTP_GLB_AVD10_ON_FORCE_VAL		BIT(3)
3462306a36Sopenharmony_ci#define DA_XTP_GLB_AVD10_ON_FORCE		BIT(2)
3562306a36Sopenharmony_ci#define DA_XTP_GLB_LDO_EN_FORCE_VAL		BIT(1)
3662306a36Sopenharmony_ci#define DA_XTP_GLB_LDO_EN_FORCE_EN		BIT(0)
3762306a36Sopenharmony_ci#define DP_PHY_LANE_TX_0		0x104
3862306a36Sopenharmony_ci#define RG_XTP_LN0_TX_IMPSEL_PMOS		GENMASK(15, 12)
3962306a36Sopenharmony_ci#define RG_XTP_LN0_TX_IMPSEL_NMOS		GENMASK(19, 16)
4062306a36Sopenharmony_ci#define DP_PHY_LANE_TX_1		0x204
4162306a36Sopenharmony_ci#define RG_XTP_LN1_TX_IMPSEL_PMOS		GENMASK(15, 12)
4262306a36Sopenharmony_ci#define RG_XTP_LN1_TX_IMPSEL_NMOS		GENMASK(19, 16)
4362306a36Sopenharmony_ci#define DP_PHY_LANE_TX_2		0x304
4462306a36Sopenharmony_ci#define RG_XTP_LN2_TX_IMPSEL_PMOS		GENMASK(15, 12)
4562306a36Sopenharmony_ci#define RG_XTP_LN2_TX_IMPSEL_NMOS		GENMASK(19, 16)
4662306a36Sopenharmony_ci#define DP_PHY_LANE_TX_3		0x404
4762306a36Sopenharmony_ci#define RG_XTP_LN3_TX_IMPSEL_PMOS		GENMASK(15, 12)
4862306a36Sopenharmony_ci#define RG_XTP_LN3_TX_IMPSEL_NMOS		GENMASK(19, 16)
4962306a36Sopenharmony_ci#define MTK_DP_1040			0x1040
5062306a36Sopenharmony_ci#define RG_DPAUX_RX_VALID_DEGLITCH_EN		BIT(2)
5162306a36Sopenharmony_ci#define RG_XTP_GLB_CKDET_EN			BIT(1)
5262306a36Sopenharmony_ci#define RG_DPAUX_RX_EN				BIT(0)
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci/* offset: TOP_OFFSET (0x2000) */
5562306a36Sopenharmony_ci#define MTK_DP_TOP_PWR_STATE		0x2000
5662306a36Sopenharmony_ci#define DP_PWR_STATE_MASK			GENMASK(1, 0)
5762306a36Sopenharmony_ci#define DP_PWR_STATE_BANDGAP			BIT(0)
5862306a36Sopenharmony_ci#define DP_PWR_STATE_BANDGAP_TPLL		BIT(1)
5962306a36Sopenharmony_ci#define DP_PWR_STATE_BANDGAP_TPLL_LANE		GENMASK(1, 0)
6062306a36Sopenharmony_ci#define MTK_DP_TOP_SWING_EMP		0x2004
6162306a36Sopenharmony_ci#define DP_TX0_VOLT_SWING_MASK			GENMASK(1, 0)
6262306a36Sopenharmony_ci#define DP_TX0_VOLT_SWING_SHIFT			0
6362306a36Sopenharmony_ci#define DP_TX0_PRE_EMPH_MASK			GENMASK(3, 2)
6462306a36Sopenharmony_ci#define DP_TX0_PRE_EMPH_SHIFT			2
6562306a36Sopenharmony_ci#define DP_TX1_VOLT_SWING_MASK			GENMASK(9, 8)
6662306a36Sopenharmony_ci#define DP_TX1_VOLT_SWING_SHIFT			8
6762306a36Sopenharmony_ci#define DP_TX1_PRE_EMPH_MASK			GENMASK(11, 10)
6862306a36Sopenharmony_ci#define DP_TX2_VOLT_SWING_MASK			GENMASK(17, 16)
6962306a36Sopenharmony_ci#define DP_TX2_PRE_EMPH_MASK			GENMASK(19, 18)
7062306a36Sopenharmony_ci#define DP_TX3_VOLT_SWING_MASK			GENMASK(25, 24)
7162306a36Sopenharmony_ci#define DP_TX3_PRE_EMPH_MASK			GENMASK(27, 26)
7262306a36Sopenharmony_ci#define MTK_DP_TOP_RESET_AND_PROBE	0x2020
7362306a36Sopenharmony_ci#define SW_RST_B_PHYD				BIT(4)
7462306a36Sopenharmony_ci#define MTK_DP_TOP_IRQ_MASK		0x202c
7562306a36Sopenharmony_ci#define IRQ_MASK_AUX_TOP_IRQ			BIT(2)
7662306a36Sopenharmony_ci#define MTK_DP_TOP_MEM_PD		0x2038
7762306a36Sopenharmony_ci#define MEM_ISO_EN				BIT(0)
7862306a36Sopenharmony_ci#define FUSE_SEL				BIT(2)
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci/* offset: ENC0_OFFSET (0x3000) */
8162306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3000			0x3000
8262306a36Sopenharmony_ci#define LANE_NUM_DP_ENC0_P0_MASK			GENMASK(1, 0)
8362306a36Sopenharmony_ci#define VIDEO_MUTE_SW_DP_ENC0_P0			BIT(2)
8462306a36Sopenharmony_ci#define VIDEO_MUTE_SEL_DP_ENC0_P0			BIT(3)
8562306a36Sopenharmony_ci#define ENHANCED_FRAME_EN_DP_ENC0_P0			BIT(4)
8662306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3004			0x3004
8762306a36Sopenharmony_ci#define VIDEO_M_CODE_SEL_DP_ENC0_P0_MASK		BIT(8)
8862306a36Sopenharmony_ci#define DP_TX_ENCODER_4P_RESET_SW_DP_ENC0_P0		BIT(9)
8962306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3010			0x3010
9062306a36Sopenharmony_ci#define HTOTAL_SW_DP_ENC0_P0_MASK			GENMASK(15, 0)
9162306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3014			0x3014
9262306a36Sopenharmony_ci#define VTOTAL_SW_DP_ENC0_P0_MASK			GENMASK(15, 0)
9362306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3018			0x3018
9462306a36Sopenharmony_ci#define HSTART_SW_DP_ENC0_P0_MASK			GENMASK(15, 0)
9562306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_301C			0x301c
9662306a36Sopenharmony_ci#define VSTART_SW_DP_ENC0_P0_MASK			GENMASK(15, 0)
9762306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3020			0x3020
9862306a36Sopenharmony_ci#define HWIDTH_SW_DP_ENC0_P0_MASK			GENMASK(15, 0)
9962306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3024			0x3024
10062306a36Sopenharmony_ci#define VHEIGHT_SW_DP_ENC0_P0_MASK			GENMASK(15, 0)
10162306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3028			0x3028
10262306a36Sopenharmony_ci#define HSW_SW_DP_ENC0_P0_MASK				GENMASK(14, 0)
10362306a36Sopenharmony_ci#define HSP_SW_DP_ENC0_P0_MASK				BIT(15)
10462306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_302C			0x302c
10562306a36Sopenharmony_ci#define VSW_SW_DP_ENC0_P0_MASK				GENMASK(14, 0)
10662306a36Sopenharmony_ci#define VSP_SW_DP_ENC0_P0_MASK				BIT(15)
10762306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3030			0x3030
10862306a36Sopenharmony_ci#define HTOTAL_SEL_DP_ENC0_P0				BIT(0)
10962306a36Sopenharmony_ci#define VTOTAL_SEL_DP_ENC0_P0				BIT(1)
11062306a36Sopenharmony_ci#define HSTART_SEL_DP_ENC0_P0				BIT(2)
11162306a36Sopenharmony_ci#define VSTART_SEL_DP_ENC0_P0				BIT(3)
11262306a36Sopenharmony_ci#define HWIDTH_SEL_DP_ENC0_P0				BIT(4)
11362306a36Sopenharmony_ci#define VHEIGHT_SEL_DP_ENC0_P0				BIT(5)
11462306a36Sopenharmony_ci#define HSP_SEL_DP_ENC0_P0				BIT(6)
11562306a36Sopenharmony_ci#define HSW_SEL_DP_ENC0_P0				BIT(7)
11662306a36Sopenharmony_ci#define VSP_SEL_DP_ENC0_P0				BIT(8)
11762306a36Sopenharmony_ci#define VSW_SEL_DP_ENC0_P0				BIT(9)
11862306a36Sopenharmony_ci#define VBID_AUDIO_MUTE_FLAG_SW_DP_ENC0_P0		BIT(11)
11962306a36Sopenharmony_ci#define VBID_AUDIO_MUTE_FLAG_SEL_DP_ENC0_P0		BIT(12)
12062306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3034			0x3034
12162306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3038			0x3038
12262306a36Sopenharmony_ci#define VIDEO_SOURCE_SEL_DP_ENC0_P0_MASK		BIT(11)
12362306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_303C			0x303c
12462306a36Sopenharmony_ci#define SRAM_START_READ_THRD_DP_ENC0_P0_MASK		GENMASK(5, 0)
12562306a36Sopenharmony_ci#define VIDEO_COLOR_DEPTH_DP_ENC0_P0_MASK		GENMASK(10, 8)
12662306a36Sopenharmony_ci#define VIDEO_COLOR_DEPTH_DP_ENC0_P0_16BIT		(0 << 8)
12762306a36Sopenharmony_ci#define VIDEO_COLOR_DEPTH_DP_ENC0_P0_12BIT		(1 << 8)
12862306a36Sopenharmony_ci#define VIDEO_COLOR_DEPTH_DP_ENC0_P0_10BIT		(2 << 8)
12962306a36Sopenharmony_ci#define VIDEO_COLOR_DEPTH_DP_ENC0_P0_8BIT		(3 << 8)
13062306a36Sopenharmony_ci#define VIDEO_COLOR_DEPTH_DP_ENC0_P0_6BIT		(4 << 8)
13162306a36Sopenharmony_ci#define PIXEL_ENCODE_FORMAT_DP_ENC0_P0_MASK		GENMASK(14, 12)
13262306a36Sopenharmony_ci#define PIXEL_ENCODE_FORMAT_DP_ENC0_P0_RGB		(0 << 12)
13362306a36Sopenharmony_ci#define PIXEL_ENCODE_FORMAT_DP_ENC0_P0_YCBCR422		(1 << 12)
13462306a36Sopenharmony_ci#define PIXEL_ENCODE_FORMAT_DP_ENC0_P0_YCBCR420		(2 << 12)
13562306a36Sopenharmony_ci#define VIDEO_MN_GEN_EN_DP_ENC0_P0			BIT(15)
13662306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3040			0x3040
13762306a36Sopenharmony_ci#define SDP_DOWN_CNT_DP_ENC0_P0_VAL			0x20
13862306a36Sopenharmony_ci#define SDP_DOWN_CNT_INIT_DP_ENC0_P0_MASK		GENMASK(11, 0)
13962306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_304C			0x304c
14062306a36Sopenharmony_ci#define VBID_VIDEO_MUTE_DP_ENC0_P0_MASK			BIT(2)
14162306a36Sopenharmony_ci#define SDP_VSYNC_RISING_MASK_DP_ENC0_P0_MASK		BIT(8)
14262306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3064			0x3064
14362306a36Sopenharmony_ci#define HDE_NUM_LAST_DP_ENC0_P0_MASK			GENMASK(15, 0)
14462306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3088			0x3088
14562306a36Sopenharmony_ci#define AU_EN_DP_ENC0_P0				BIT(6)
14662306a36Sopenharmony_ci#define AUDIO_8CH_EN_DP_ENC0_P0_MASK			BIT(7)
14762306a36Sopenharmony_ci#define AUDIO_8CH_SEL_DP_ENC0_P0_MASK			BIT(8)
14862306a36Sopenharmony_ci#define AUDIO_2CH_EN_DP_ENC0_P0_MASK			BIT(14)
14962306a36Sopenharmony_ci#define AUDIO_2CH_SEL_DP_ENC0_P0_MASK			BIT(15)
15062306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_308C			0x308c
15162306a36Sopenharmony_ci#define CH_STATUS_0_DP_ENC0_P0_MASK			GENMASK(15, 0)
15262306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3090			0x3090
15362306a36Sopenharmony_ci#define CH_STATUS_1_DP_ENC0_P0_MASK			GENMASK(15, 0)
15462306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3094			0x3094
15562306a36Sopenharmony_ci#define CH_STATUS_2_DP_ENC0_P0_MASK			GENMASK(7, 0)
15662306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_30A4			0x30a4
15762306a36Sopenharmony_ci#define AU_TS_CFG_DP_ENC0_P0_MASK			GENMASK(7, 0)
15862306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_30A8			0x30a8
15962306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_30BC			0x30bc
16062306a36Sopenharmony_ci#define ISRC_CONT_DP_ENC0_P0				BIT(0)
16162306a36Sopenharmony_ci#define AUDIO_M_CODE_MULT_DIV_SEL_DP_ENC0_P0_MASK	GENMASK(10, 8)
16262306a36Sopenharmony_ci#define AUDIO_M_CODE_MULT_DIV_SEL_DP_ENC0_P0_MUL_2	(1 << 8)
16362306a36Sopenharmony_ci#define AUDIO_M_CODE_MULT_DIV_SEL_DP_ENC0_P0_MUL_4	(2 << 8)
16462306a36Sopenharmony_ci#define AUDIO_M_CODE_MULT_DIV_SEL_DP_ENC0_P0_MUL_8	(3 << 8)
16562306a36Sopenharmony_ci#define AUDIO_M_CODE_MULT_DIV_SEL_DP_ENC0_P0_DIV_2	(5 << 8)
16662306a36Sopenharmony_ci#define AUDIO_M_CODE_MULT_DIV_SEL_DP_ENC0_P0_DIV_4	(6 << 8)
16762306a36Sopenharmony_ci#define AUDIO_M_CODE_MULT_DIV_SEL_DP_ENC0_P0_DIV_8	(7 << 8)
16862306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_30D8			0x30d8
16962306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_312C			0x312c
17062306a36Sopenharmony_ci#define ASP_HB2_DP_ENC0_P0_MASK				GENMASK(7, 0)
17162306a36Sopenharmony_ci#define ASP_HB3_DP_ENC0_P0_MASK				GENMASK(15, 8)
17262306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3154			0x3154
17362306a36Sopenharmony_ci#define PGEN_HTOTAL_DP_ENC0_P0_MASK			GENMASK(13, 0)
17462306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3158			0x3158
17562306a36Sopenharmony_ci#define PGEN_HSYNC_RISING_DP_ENC0_P0_MASK		GENMASK(13, 0)
17662306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_315C			0x315c
17762306a36Sopenharmony_ci#define PGEN_HSYNC_PULSE_WIDTH_DP_ENC0_P0_MASK		GENMASK(13, 0)
17862306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3160			0x3160
17962306a36Sopenharmony_ci#define PGEN_HFDE_START_DP_ENC0_P0_MASK			GENMASK(13, 0)
18062306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3164			0x3164
18162306a36Sopenharmony_ci#define PGEN_HFDE_ACTIVE_WIDTH_DP_ENC0_P0_MASK		GENMASK(13, 0)
18262306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3168			0x3168
18362306a36Sopenharmony_ci#define PGEN_VTOTAL_DP_ENC0_P0_MASK			GENMASK(12, 0)
18462306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_316C			0x316c
18562306a36Sopenharmony_ci#define PGEN_VSYNC_RISING_DP_ENC0_P0_MASK		GENMASK(12, 0)
18662306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3170			0x3170
18762306a36Sopenharmony_ci#define PGEN_VSYNC_PULSE_WIDTH_DP_ENC0_P0_MASK		GENMASK(12, 0)
18862306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3174			0x3174
18962306a36Sopenharmony_ci#define PGEN_VFDE_START_DP_ENC0_P0_MASK			GENMASK(12, 0)
19062306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_3178			0x3178
19162306a36Sopenharmony_ci#define PGEN_VFDE_ACTIVE_WIDTH_DP_ENC0_P0_MASK		GENMASK(12, 0)
19262306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_31B0			0x31b0
19362306a36Sopenharmony_ci#define PGEN_PATTERN_SEL_VAL				4
19462306a36Sopenharmony_ci#define PGEN_PATTERN_SEL_MASK				GENMASK(6, 4)
19562306a36Sopenharmony_ci#define MTK_DP_ENC0_P0_31EC			0x31ec
19662306a36Sopenharmony_ci#define AUDIO_CH_SRC_SEL_DP_ENC0_P0			BIT(4)
19762306a36Sopenharmony_ci#define ISRC1_HB3_DP_ENC0_P0_MASK			GENMASK(15, 8)
19862306a36Sopenharmony_ci
19962306a36Sopenharmony_ci/* offset: ENC1_OFFSET (0x3200) */
20062306a36Sopenharmony_ci#define MTK_DP_ENC1_P0_3200			0x3200
20162306a36Sopenharmony_ci#define MTK_DP_ENC1_P0_3280			0x3280
20262306a36Sopenharmony_ci#define SDP_PACKET_TYPE_DP_ENC1_P0_MASK			GENMASK(4, 0)
20362306a36Sopenharmony_ci#define SDP_PACKET_W_DP_ENC1_P0				BIT(5)
20462306a36Sopenharmony_ci#define SDP_PACKET_W_DP_ENC1_P0_MASK			BIT(5)
20562306a36Sopenharmony_ci#define MTK_DP_ENC1_P0_3300			0x3300
20662306a36Sopenharmony_ci#define VIDEO_AFIFO_RDY_SEL_DP_ENC1_P0_VAL		2
20762306a36Sopenharmony_ci#define VIDEO_AFIFO_RDY_SEL_DP_ENC1_P0_MASK		GENMASK(9, 8)
20862306a36Sopenharmony_ci#define MTK_DP_ENC1_P0_3304			0x3304
20962306a36Sopenharmony_ci#define AU_PRTY_REGEN_DP_ENC1_P0_MASK			BIT(8)
21062306a36Sopenharmony_ci#define AU_CH_STS_REGEN_DP_ENC1_P0_MASK			BIT(9)
21162306a36Sopenharmony_ci#define AUDIO_SAMPLE_PRSENT_REGEN_DP_ENC1_P0_MASK	BIT(12)
21262306a36Sopenharmony_ci#define MTK_DP_ENC1_P0_3324			0x3324
21362306a36Sopenharmony_ci#define AUDIO_SOURCE_MUX_DP_ENC1_P0_MASK		GENMASK(9, 8)
21462306a36Sopenharmony_ci#define AUDIO_SOURCE_MUX_DP_ENC1_P0_DPRX		0
21562306a36Sopenharmony_ci#define MTK_DP_ENC1_P0_3364			0x3364
21662306a36Sopenharmony_ci#define SDP_DOWN_CNT_IN_HBLANK_DP_ENC1_P0_VAL		0x20
21762306a36Sopenharmony_ci#define SDP_DOWN_CNT_INIT_IN_HBLANK_DP_ENC1_P0_MASK	GENMASK(11, 0)
21862306a36Sopenharmony_ci#define FIFO_READ_START_POINT_DP_ENC1_P0_VAL		4
21962306a36Sopenharmony_ci#define FIFO_READ_START_POINT_DP_ENC1_P0_MASK		GENMASK(15, 12)
22062306a36Sopenharmony_ci#define MTK_DP_ENC1_P0_3368			0x3368
22162306a36Sopenharmony_ci#define VIDEO_SRAM_FIFO_CNT_RESET_SEL_DP_ENC1_P0	BIT(0)
22262306a36Sopenharmony_ci#define VIDEO_STABLE_CNT_THRD_DP_ENC1_P0		BIT(4)
22362306a36Sopenharmony_ci#define SDP_DP13_EN_DP_ENC1_P0				BIT(8)
22462306a36Sopenharmony_ci#define BS2BS_MODE_DP_ENC1_P0				BIT(12)
22562306a36Sopenharmony_ci#define BS2BS_MODE_DP_ENC1_P0_MASK			GENMASK(13, 12)
22662306a36Sopenharmony_ci#define BS2BS_MODE_DP_ENC1_P0_VAL			1
22762306a36Sopenharmony_ci#define DP_ENC1_P0_3368_VAL				(VIDEO_SRAM_FIFO_CNT_RESET_SEL_DP_ENC1_P0 | \
22862306a36Sopenharmony_ci							 VIDEO_STABLE_CNT_THRD_DP_ENC1_P0 | \
22962306a36Sopenharmony_ci							 SDP_DP13_EN_DP_ENC1_P0 | \
23062306a36Sopenharmony_ci							 BS2BS_MODE_DP_ENC1_P0)
23162306a36Sopenharmony_ci#define MTK_DP_ENC1_P0_33F4			0x33f4
23262306a36Sopenharmony_ci#define DP_ENC_DUMMY_RW_1_AUDIO_RST_EN			BIT(0)
23362306a36Sopenharmony_ci#define DP_ENC_DUMMY_RW_1				BIT(9)
23462306a36Sopenharmony_ci
23562306a36Sopenharmony_ci/* offset: TRANS_OFFSET (0x3400) */
23662306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_3400				0x3400
23762306a36Sopenharmony_ci#define PATTERN1_EN_DP_TRANS_P0_MASK				BIT(12)
23862306a36Sopenharmony_ci#define PATTERN2_EN_DP_TRANS_P0_MASK				BIT(13)
23962306a36Sopenharmony_ci#define PATTERN3_EN_DP_TRANS_P0_MASK				BIT(14)
24062306a36Sopenharmony_ci#define PATTERN4_EN_DP_TRANS_P0_MASK				BIT(15)
24162306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_3404				0x3404
24262306a36Sopenharmony_ci#define DP_SCR_EN_DP_TRANS_P0_MASK				BIT(0)
24362306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_340C				0x340c
24462306a36Sopenharmony_ci#define DP_TX_TRANSMITTER_4P_RESET_SW_DP_TRANS_P0		BIT(13)
24562306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_3410				0x3410
24662306a36Sopenharmony_ci#define HPD_DEB_THD_DP_TRANS_P0_MASK				GENMASK(3, 0)
24762306a36Sopenharmony_ci#define HPD_INT_THD_DP_TRANS_P0_MASK				GENMASK(7, 4)
24862306a36Sopenharmony_ci#define HPD_INT_THD_DP_TRANS_P0_LOWER_500US			(2 << 4)
24962306a36Sopenharmony_ci#define HPD_INT_THD_DP_TRANS_P0_UPPER_1100US			(2 << 6)
25062306a36Sopenharmony_ci#define HPD_DISC_THD_DP_TRANS_P0_MASK				GENMASK(11, 8)
25162306a36Sopenharmony_ci#define HPD_CONN_THD_DP_TRANS_P0_MASK				GENMASK(15, 12)
25262306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_3414				0x3414
25362306a36Sopenharmony_ci#define HPD_DB_DP_TRANS_P0_MASK					BIT(2)
25462306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_3418				0x3418
25562306a36Sopenharmony_ci#define IRQ_CLR_DP_TRANS_P0_MASK				GENMASK(3, 0)
25662306a36Sopenharmony_ci#define IRQ_MASK_DP_TRANS_P0_MASK				GENMASK(7, 4)
25762306a36Sopenharmony_ci#define IRQ_MASK_DP_TRANS_P0_DISC_IRQ				(BIT(1) << 4)
25862306a36Sopenharmony_ci#define IRQ_MASK_DP_TRANS_P0_CONN_IRQ				(BIT(2) << 4)
25962306a36Sopenharmony_ci#define IRQ_MASK_DP_TRANS_P0_INT_IRQ				(BIT(3) << 4)
26062306a36Sopenharmony_ci#define IRQ_STATUS_DP_TRANS_P0_MASK				GENMASK(15, 12)
26162306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_342C				0x342c
26262306a36Sopenharmony_ci#define XTAL_FREQ_DP_TRANS_P0_DEFAULT				(BIT(0) | BIT(3) | BIT(5) | BIT(6))
26362306a36Sopenharmony_ci#define XTAL_FREQ_DP_TRANS_P0_MASK				GENMASK(7, 0)
26462306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_3430				0x3430
26562306a36Sopenharmony_ci#define HPD_INT_THD_ECO_DP_TRANS_P0_MASK			GENMASK(1, 0)
26662306a36Sopenharmony_ci#define HPD_INT_THD_ECO_DP_TRANS_P0_HIGH_BOUND_EXT		BIT(1)
26762306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_34A4				0x34a4
26862306a36Sopenharmony_ci#define LANE_NUM_DP_TRANS_P0_MASK				GENMASK(3, 2)
26962306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_3540				0x3540
27062306a36Sopenharmony_ci#define FEC_EN_DP_TRANS_P0_MASK					BIT(0)
27162306a36Sopenharmony_ci#define FEC_CLOCK_EN_MODE_DP_TRANS_P0				BIT(3)
27262306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_3580				0x3580
27362306a36Sopenharmony_ci#define POST_MISC_DATA_LANE0_OV_DP_TRANS_P0_MASK		BIT(8)
27462306a36Sopenharmony_ci#define POST_MISC_DATA_LANE1_OV_DP_TRANS_P0_MASK		BIT(9)
27562306a36Sopenharmony_ci#define POST_MISC_DATA_LANE2_OV_DP_TRANS_P0_MASK		BIT(10)
27662306a36Sopenharmony_ci#define POST_MISC_DATA_LANE3_OV_DP_TRANS_P0_MASK		BIT(11)
27762306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_35C8				0x35c8
27862306a36Sopenharmony_ci#define SW_IRQ_CLR_DP_TRANS_P0_MASK				GENMASK(15, 0)
27962306a36Sopenharmony_ci#define SW_IRQ_STATUS_DP_TRANS_P0_MASK				GENMASK(15, 0)
28062306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_35D0				0x35d0
28162306a36Sopenharmony_ci#define SW_IRQ_FINAL_STATUS_DP_TRANS_P0_MASK			GENMASK(15, 0)
28262306a36Sopenharmony_ci#define MTK_DP_TRANS_P0_35F0				0x35f0
28362306a36Sopenharmony_ci#define DP_TRANS_DUMMY_RW_0					BIT(3)
28462306a36Sopenharmony_ci#define DP_TRANS_DUMMY_RW_0_MASK				GENMASK(3, 2)
28562306a36Sopenharmony_ci
28662306a36Sopenharmony_ci/* offset: AUX_OFFSET (0x3600) */
28762306a36Sopenharmony_ci#define MTK_DP_AUX_P0_360C			0x360c
28862306a36Sopenharmony_ci#define AUX_TIMEOUT_THR_AUX_TX_P0_MASK			GENMASK(12, 0)
28962306a36Sopenharmony_ci#define AUX_TIMEOUT_THR_AUX_TX_P0_VAL			0x1595
29062306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3614			0x3614
29162306a36Sopenharmony_ci#define AUX_RX_UI_CNT_THR_AUX_TX_P0_MASK		GENMASK(6, 0)
29262306a36Sopenharmony_ci#define AUX_RX_UI_CNT_THR_AUX_FOR_26M			13
29362306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3618			0x3618
29462306a36Sopenharmony_ci#define AUX_RX_FIFO_FULL_AUX_TX_P0_MASK			BIT(9)
29562306a36Sopenharmony_ci#define AUX_RX_FIFO_WRITE_POINTER_AUX_TX_P0_MASK	GENMASK(3, 0)
29662306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3620			0x3620
29762306a36Sopenharmony_ci#define AUX_RD_MODE_AUX_TX_P0_MASK			BIT(9)
29862306a36Sopenharmony_ci#define AUX_RX_FIFO_READ_PULSE_TX_P0			BIT(8)
29962306a36Sopenharmony_ci#define AUX_RX_FIFO_READ_DATA_AUX_TX_P0_MASK		GENMASK(7, 0)
30062306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3624			0x3624
30162306a36Sopenharmony_ci#define AUX_RX_REPLY_COMMAND_AUX_TX_P0_MASK		GENMASK(3, 0)
30262306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3628			0x3628
30362306a36Sopenharmony_ci#define AUX_RX_PHY_STATE_AUX_TX_P0_MASK			GENMASK(9, 0)
30462306a36Sopenharmony_ci#define AUX_RX_PHY_STATE_AUX_TX_P0_RX_IDLE		BIT(0)
30562306a36Sopenharmony_ci#define MTK_DP_AUX_P0_362C			0x362c
30662306a36Sopenharmony_ci#define AUX_NO_LENGTH_AUX_TX_P0				BIT(0)
30762306a36Sopenharmony_ci#define AUX_TX_AUXTX_OV_EN_AUX_TX_P0_MASK		BIT(1)
30862306a36Sopenharmony_ci#define AUX_RESERVED_RW_0_AUX_TX_P0_MASK		GENMASK(15, 2)
30962306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3630			0x3630
31062306a36Sopenharmony_ci#define AUX_TX_REQUEST_READY_AUX_TX_P0			BIT(3)
31162306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3634			0x3634
31262306a36Sopenharmony_ci#define AUX_TX_OVER_SAMPLE_RATE_AUX_TX_P0_MASK		GENMASK(15, 8)
31362306a36Sopenharmony_ci#define AUX_TX_OVER_SAMPLE_RATE_FOR_26M			25
31462306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3640			0x3640
31562306a36Sopenharmony_ci#define AUX_RX_AUX_RECV_COMPLETE_IRQ_AUX_TX_P0		BIT(6)
31662306a36Sopenharmony_ci#define AUX_RX_EDID_RECV_COMPLETE_IRQ_AUX_TX_P0		BIT(5)
31762306a36Sopenharmony_ci#define AUX_RX_MCCS_RECV_COMPLETE_IRQ_AUX_TX_P0		BIT(4)
31862306a36Sopenharmony_ci#define AUX_RX_CMD_RECV_IRQ_AUX_TX_P0			BIT(3)
31962306a36Sopenharmony_ci#define AUX_RX_ADDR_RECV_IRQ_AUX_TX_P0			BIT(2)
32062306a36Sopenharmony_ci#define AUX_RX_DATA_RECV_IRQ_AUX_TX_P0			BIT(1)
32162306a36Sopenharmony_ci#define AUX_400US_TIMEOUT_IRQ_AUX_TX_P0			BIT(0)
32262306a36Sopenharmony_ci#define DP_AUX_P0_3640_VAL				(AUX_400US_TIMEOUT_IRQ_AUX_TX_P0 | \
32362306a36Sopenharmony_ci							 AUX_RX_DATA_RECV_IRQ_AUX_TX_P0 | \
32462306a36Sopenharmony_ci							 AUX_RX_ADDR_RECV_IRQ_AUX_TX_P0 | \
32562306a36Sopenharmony_ci							 AUX_RX_CMD_RECV_IRQ_AUX_TX_P0 | \
32662306a36Sopenharmony_ci							 AUX_RX_MCCS_RECV_COMPLETE_IRQ_AUX_TX_P0 | \
32762306a36Sopenharmony_ci							 AUX_RX_EDID_RECV_COMPLETE_IRQ_AUX_TX_P0 | \
32862306a36Sopenharmony_ci							 AUX_RX_AUX_RECV_COMPLETE_IRQ_AUX_TX_P0)
32962306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3644			0x3644
33062306a36Sopenharmony_ci#define MCU_REQUEST_COMMAND_AUX_TX_P0_MASK		GENMASK(3, 0)
33162306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3648			0x3648
33262306a36Sopenharmony_ci#define MCU_REQUEST_ADDRESS_LSB_AUX_TX_P0_MASK		GENMASK(15, 0)
33362306a36Sopenharmony_ci#define MTK_DP_AUX_P0_364C			0x364c
33462306a36Sopenharmony_ci#define MCU_REQUEST_ADDRESS_MSB_AUX_TX_P0_MASK		GENMASK(3, 0)
33562306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3650			0x3650
33662306a36Sopenharmony_ci#define MCU_REQ_DATA_NUM_AUX_TX_P0_MASK			GENMASK(15, 12)
33762306a36Sopenharmony_ci#define PHY_FIFO_RST_AUX_TX_P0_MASK			BIT(9)
33862306a36Sopenharmony_ci#define MCU_ACK_TRAN_COMPLETE_AUX_TX_P0			BIT(8)
33962306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3658			0x3658
34062306a36Sopenharmony_ci#define AUX_TX_OV_EN_AUX_TX_P0_MASK			BIT(0)
34162306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3690			0x3690
34262306a36Sopenharmony_ci#define RX_REPLY_COMPLETE_MODE_AUX_TX_P0		BIT(8)
34362306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3704			0x3704
34462306a36Sopenharmony_ci#define AUX_TX_FIFO_WDATA_NEW_MODE_T_AUX_TX_P0_MASK	BIT(1)
34562306a36Sopenharmony_ci#define AUX_TX_FIFO_NEW_MODE_EN_AUX_TX_P0		BIT(2)
34662306a36Sopenharmony_ci#define MTK_DP_AUX_P0_3708			0x3708
34762306a36Sopenharmony_ci#define MTK_DP_AUX_P0_37C8			0x37c8
34862306a36Sopenharmony_ci#define MTK_ATOP_EN_AUX_TX_P0				BIT(0)
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_ci#endif /*_MTK_DP_REG_H_*/
351