162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * NXP XCVR ALSA SoC Digital Audio Interface (DAI) driver
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright 2019 NXP
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#ifndef __FSL_XCVR_H
962306a36Sopenharmony_ci#define __FSL_XCVR_H
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#define FSL_XCVR_MODE_SPDIF	0
1262306a36Sopenharmony_ci#define FSL_XCVR_MODE_ARC	1
1362306a36Sopenharmony_ci#define FSL_XCVR_MODE_EARC	2
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/* XCVR Registers */
1662306a36Sopenharmony_ci#define FSL_XCVR_REG_OFFSET		0x800 /* regs offset */
1762306a36Sopenharmony_ci#define FSL_XCVR_FIFO_SIZE		0x80  /* 128 */
1862306a36Sopenharmony_ci#define FSL_XCVR_FIFO_WMK_RX		(FSL_XCVR_FIFO_SIZE >> 1)   /* 64 */
1962306a36Sopenharmony_ci#define FSL_XCVR_FIFO_WMK_TX		(FSL_XCVR_FIFO_SIZE >> 1)   /* 64 */
2062306a36Sopenharmony_ci#define FSL_XCVR_MAXBURST_RX		(FSL_XCVR_FIFO_WMK_RX >> 2) /* 16 */
2162306a36Sopenharmony_ci#define FSL_XCVR_MAXBURST_TX		(FSL_XCVR_FIFO_WMK_TX >> 2) /* 16 */
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#define FSL_XCVR_RX_FIFO_ADDR		0x0C00
2462306a36Sopenharmony_ci#define FSL_XCVR_TX_FIFO_ADDR		0x0E00
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci#define FSL_XCVR_VERSION		0x00  /* Version */
2762306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL		0x10  /* Control */
2862306a36Sopenharmony_ci#define FSL_XCVR_EXT_STATUS		0x20  /* Status */
2962306a36Sopenharmony_ci#define FSL_XCVR_EXT_IER0		0x30  /* Interrupt en 0 */
3062306a36Sopenharmony_ci#define FSL_XCVR_EXT_IER1		0x40  /* Interrupt en 1 */
3162306a36Sopenharmony_ci#define FSL_XCVR_EXT_ISR		0x50  /* Interrupt status */
3262306a36Sopenharmony_ci#define FSL_XCVR_EXT_ISR_SET		0x54  /* Interrupt status */
3362306a36Sopenharmony_ci#define FSL_XCVR_EXT_ISR_CLR		0x58  /* Interrupt status */
3462306a36Sopenharmony_ci#define FSL_XCVR_EXT_ISR_TOG		0x5C  /* Interrupt status */
3562306a36Sopenharmony_ci#define FSL_XCVR_IER			0x70  /* Interrupt en for M0+ */
3662306a36Sopenharmony_ci#define FSL_XCVR_ISR			0x80  /* Interrupt status */
3762306a36Sopenharmony_ci#define FSL_XCVR_ISR_SET		0x84  /* Interrupt status set */
3862306a36Sopenharmony_ci#define FSL_XCVR_ISR_CLR		0x88  /* Interrupt status clear */
3962306a36Sopenharmony_ci#define FSL_XCVR_ISR_TOG		0x8C  /* Interrupt status toggle */
4062306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_CTRL		0x90
4162306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_CTRL_SET	0x94
4262306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_CTRL_CLR	0x98
4362306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_CTRL_TOG	0x9C
4462306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_WDATA		0xA0
4562306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_RDATA		0xA4
4662306a36Sopenharmony_ci#define FSL_XCVR_CLK_CTRL		0xB0
4762306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL		0x180 /* RX datapath ctrl reg */
4862306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_SET	0x184
4962306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_CLR	0x188
5062306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_TOG	0x18c
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_DATA_0		0x190
5362306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_DATA_1		0x194
5462306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_DATA_2		0x198
5562306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_DATA_3		0x19C
5662306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_DATA_4		0x1A0
5762306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_DATA_5		0x1A4
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CNTR_CTRL	0x1C0
6062306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CNTR_CTRL_SET	0x1C4
6162306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CNTR_CTRL_CLR	0x1C8
6262306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CNTR_CTRL_TOG	0x1CC
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_TSCR		0x1D0
6562306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_BCR		0x1D4
6662306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_BCTR		0x1D8
6762306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_BCRR		0x1DC
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL		0x220 /* TX datapath ctrl reg */
7062306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_SET	0x224
7162306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_CLR	0x228
7262306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_TOG	0x22C
7362306a36Sopenharmony_ci#define FSL_XCVR_TX_CS_DATA_0		0x230 /* TX channel status bits regs */
7462306a36Sopenharmony_ci#define FSL_XCVR_TX_CS_DATA_1		0x234
7562306a36Sopenharmony_ci#define FSL_XCVR_TX_CS_DATA_2		0x238
7662306a36Sopenharmony_ci#define FSL_XCVR_TX_CS_DATA_3		0x23C
7762306a36Sopenharmony_ci#define FSL_XCVR_TX_CS_DATA_4		0x240
7862306a36Sopenharmony_ci#define FSL_XCVR_TX_CS_DATA_5		0x244
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CNTR_CTRL	0x260
8162306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CNTR_CTRL_SET	0x264
8262306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CNTR_CTRL_CLR	0x268
8362306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CNTR_CTRL_TOG	0x26C
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_TSCR		0x270
8662306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_BCR		0x274
8762306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_BCTR		0x278
8862306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_BCRR		0x27C
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci#define FSL_XCVR_DEBUG_REG_0		0x2E0
9162306a36Sopenharmony_ci#define FSL_XCVR_DEBUG_REG_1		0x2F0
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define FSL_XCVR_MAX_REG		FSL_XCVR_DEBUG_REG_1
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_CORE_RESET	BIT(31)
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_RX_CMDC_RESET	BIT(30)
9862306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_TX_CMDC_RESET	BIT(29)
9962306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_CMDC_RESET(t) (t ? BIT(29) : BIT(30))
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_RX_DPTH_RESET	BIT(28)
10262306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_TX_DPTH_RESET	BIT(27)
10362306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_DPTH_RESET(t) (t ? BIT(27) : BIT(28))
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_TX_RX_MODE	BIT(26)
10662306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_DMA_RD_DIS	BIT(25)
10762306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_DMA_WR_DIS	BIT(24)
10862306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_DMA_DIS(t)	(t ? BIT(24) : BIT(25))
10962306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_SPDIF_MODE	BIT(23)
11062306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_SLEEP_MODE	BIT(21)
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_TX_FWM_SHFT	0
11362306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_TX_FWM_MASK	GENMASK(6, 0)
11462306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_TX_FWM(i)	(((i) << FSL_XCVR_EXT_CTRL_TX_FWM_SHFT) \
11562306a36Sopenharmony_ci					  & FSL_XCVR_EXT_CTRL_TX_FWM_MASK)
11662306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_RX_FWM_SHFT	8
11762306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_RX_FWM_MASK	GENMASK(14, 8)
11862306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_RX_FWM(i)	(((i) << FSL_XCVR_EXT_CTRL_RX_FWM_SHFT) \
11962306a36Sopenharmony_ci					  & FSL_XCVR_EXT_CTRL_RX_FWM_MASK)
12062306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_PAGE_SHFT	16
12162306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_PAGE_MASK	GENMASK(19, 16)
12262306a36Sopenharmony_ci#define FSL_XCVR_EXT_CTRL_PAGE(i)	(((i) << FSL_XCVR_EXT_CTRL_PAGE_SHFT) \
12362306a36Sopenharmony_ci					  & FSL_XCVR_EXT_CTRL_PAGE_MASK)
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_NT_FIFO_ENTR	GENMASK(7, 0)
12662306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_NR_FIFO_ENTR	GENMASK(15, 8)
12762306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_CM0_SLEEPING	BIT(16)
12862306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_CM0_DEEP_SLP	BIT(17)
12962306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_CM0_SLP_HACK	BIT(18)
13062306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_RX_CMDC_RSTO	BIT(23)
13162306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_TX_CMDC_RSTO	BIT(24)
13262306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_RX_CMDC_COTO	BIT(25)
13362306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_TX_CMDC_COTO	BIT(26)
13462306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_HB_STATUS	BIT(27)
13562306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_NEW_UD4_REC	BIT(28)
13662306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_NEW_UD5_REC	BIT(29)
13762306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_NEW_UD6_REC	BIT(30)
13862306a36Sopenharmony_ci#define FSL_XCVR_EXT_STUS_HPD_INPUT	BIT(31)
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ci#define FSL_XCVR_IRQ_NEW_CS		BIT(0)
14162306a36Sopenharmony_ci#define FSL_XCVR_IRQ_NEW_UD		BIT(1)
14262306a36Sopenharmony_ci#define FSL_XCVR_IRQ_MUTE		BIT(2)
14362306a36Sopenharmony_ci#define FSL_XCVR_IRQ_CMDC_RESP_TO	BIT(3)
14462306a36Sopenharmony_ci#define FSL_XCVR_IRQ_ECC_ERR		BIT(4)
14562306a36Sopenharmony_ci#define FSL_XCVR_IRQ_PREAMBLE_MISMATCH	BIT(5)
14662306a36Sopenharmony_ci#define FSL_XCVR_IRQ_FIFO_UOFL_ERR	BIT(6)
14762306a36Sopenharmony_ci#define FSL_XCVR_IRQ_HOST_WAKEUP	BIT(7)
14862306a36Sopenharmony_ci#define FSL_XCVR_IRQ_HOST_OHPD		BIT(8)
14962306a36Sopenharmony_ci#define FSL_XCVR_IRQ_DMAC_NO_DATA_REC	BIT(9)
15062306a36Sopenharmony_ci#define FSL_XCVR_IRQ_DMAC_FMT_CHG_DET	BIT(10)
15162306a36Sopenharmony_ci#define FSL_XCVR_IRQ_HB_STATE_CHG	BIT(11)
15262306a36Sopenharmony_ci#define FSL_XCVR_IRQ_CMDC_STATUS_UPD	BIT(12)
15362306a36Sopenharmony_ci#define FSL_XCVR_IRQ_TEMP_UPD		BIT(13)
15462306a36Sopenharmony_ci#define FSL_XCVR_IRQ_DMA_RD_REQ		BIT(14)
15562306a36Sopenharmony_ci#define FSL_XCVR_IRQ_DMA_WR_REQ		BIT(15)
15662306a36Sopenharmony_ci#define FSL_XCVR_IRQ_DMAC_BME_BIT_ERR	BIT(16)
15762306a36Sopenharmony_ci#define FSL_XCVR_IRQ_PREAMBLE_MATCH	BIT(17)
15862306a36Sopenharmony_ci#define FSL_XCVR_IRQ_M_W_PRE_MISMATCH	BIT(18)
15962306a36Sopenharmony_ci#define FSL_XCVR_IRQ_B_PRE_MISMATCH	BIT(19)
16062306a36Sopenharmony_ci#define FSL_XCVR_IRQ_UNEXP_PRE_REC	BIT(20)
16162306a36Sopenharmony_ci#define FSL_XCVR_IRQ_ARC_MODE		BIT(21)
16262306a36Sopenharmony_ci#define FSL_XCVR_IRQ_CH_UD_OFLOW	BIT(22)
16362306a36Sopenharmony_ci#define FSL_XCVR_IRQ_EARC_ALL		(FSL_XCVR_IRQ_NEW_CS | \
16462306a36Sopenharmony_ci					 FSL_XCVR_IRQ_NEW_UD | \
16562306a36Sopenharmony_ci					 FSL_XCVR_IRQ_MUTE | \
16662306a36Sopenharmony_ci					 FSL_XCVR_IRQ_FIFO_UOFL_ERR | \
16762306a36Sopenharmony_ci					 FSL_XCVR_IRQ_HOST_WAKEUP | \
16862306a36Sopenharmony_ci					 FSL_XCVR_IRQ_ARC_MODE)
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci#define FSL_XCVR_ISR_CMDC_TX_EN		BIT(3)
17162306a36Sopenharmony_ci#define FSL_XCVR_ISR_HPD_TGL		BIT(15)
17262306a36Sopenharmony_ci#define FSL_XCVR_ISR_DMAC_SPARE_INT	BIT(19)
17362306a36Sopenharmony_ci#define FSL_XCVR_ISR_SET_SPDIF_RX_INT	BIT(20)
17462306a36Sopenharmony_ci#define FSL_XCVR_ISR_SET_SPDIF_TX_INT	BIT(21)
17562306a36Sopenharmony_ci#define FSL_XCVR_ISR_SET_SPDIF_MODE(t)	(t ? BIT(21) : BIT(20))
17662306a36Sopenharmony_ci#define FSL_XCVR_ISR_SET_ARC_CM_INT	BIT(22)
17762306a36Sopenharmony_ci#define FSL_XCVR_ISR_SET_ARC_SE_INT	BIT(23)
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_ADDR_MASK	GENMASK(7, 0)
18062306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_RESETN		BIT(15)
18162306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_TOG_PLL		BIT(24)
18262306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_TOG_DONE_PLL	BIT(25)
18362306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_TOG_PHY		BIT(26)
18462306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_TOG_DONE_PHY	BIT(27)
18562306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_RW_MASK		BIT(31)
18662306a36Sopenharmony_ci
18762306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_PAPB_FIFO_STATUS	BIT(0)
18862306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_DIS_PRE_ERR_CHK	BIT(1)
18962306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_DIS_NOD_REC_CHK	BIT(2)
19062306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_ECC_VUC_BIT_CHK	BIT(3)
19162306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_EN_CMP_PAR_CALC	BIT(4)
19262306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_RST_PKT_CNT_FIFO	BIT(5)
19362306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_STORE_FMT		BIT(6)
19462306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_EN_PAR_CALC	BIT(7)
19562306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_UDR		BIT(8)
19662306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_CSR		BIT(9)
19762306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_UDA		BIT(10)
19862306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_CSA		BIT(11)
19962306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_CLR_RX_FIFO	BIT(12)
20062306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_DIS_B_PRE_ERR_CHK	BIT(13)
20162306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_PABS		BIT(19)
20262306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_DTS_CDS		BIT(20)
20362306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_BLKC		BIT(21)
20462306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_MUTE_CTRL		BIT(22)
20562306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_MUTE_MODE		BIT(23)
20662306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_FMT_CHG_CTRL	BIT(24)
20762306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_FMT_CHG_MODE	BIT(25)
20862306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_LAYB_CTRL		BIT(26)
20962306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_LAYB_MODE		BIT(27)
21062306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_PRC		BIT(28)
21162306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_COMP		BIT(29)
21262306a36Sopenharmony_ci#define FSL_XCVR_RX_DPTH_CTRL_FSM		GENMASK(31, 30)
21362306a36Sopenharmony_ci
21462306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_CS_ACK		BIT(0)
21562306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_UD_ACK		BIT(1)
21662306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_CS_MOD		BIT(2)
21762306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_UD_MOD		BIT(3)
21862306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_VLD_MOD		BIT(4)
21962306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_FRM_VLD		BIT(5)
22062306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_EN_PARITY		BIT(6)
22162306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_EN_PREAMBLE	BIT(7)
22262306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_EN_ECC_INTER	BIT(8)
22362306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_BYPASS_FEM	BIT(10)
22462306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_FRM_FMT		BIT(11)
22562306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_STRT_DATA_TX	BIT(14)
22662306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_ADD_CYC_TX_OE_STR	BIT(15)
22762306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_ADD_CYC_TX_OE_END	BIT(16)
22862306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_CLK_RATIO		BIT(29)
22962306a36Sopenharmony_ci#define FSL_XCVR_TX_DPTH_CTRL_TM_NO_PRE_BME	GENMASK(31, 30)
23062306a36Sopenharmony_ci
23162306a36Sopenharmony_ci#define FSL_XCVR_PHY_AI_CTRL_AI_RESETN		BIT(15)
23262306a36Sopenharmony_ci
23362306a36Sopenharmony_ci#define FSL_XCVR_PLL_CTRL0			0x00
23462306a36Sopenharmony_ci#define FSL_XCVR_PLL_CTRL0_SET			0x04
23562306a36Sopenharmony_ci#define FSL_XCVR_PLL_CTRL0_CLR			0x08
23662306a36Sopenharmony_ci#define FSL_XCVR_PLL_NUM			0x20
23762306a36Sopenharmony_ci#define FSL_XCVR_PLL_DEN			0x30
23862306a36Sopenharmony_ci#define FSL_XCVR_PLL_PDIV			0x40
23962306a36Sopenharmony_ci#define FSL_XCVR_PLL_BANDGAP_SET		0x54
24062306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL			0x00
24162306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_SET			0x04
24262306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_CLR			0x08
24362306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL2			0x70
24462306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL2_SET			0x74
24562306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL2_CLR			0x78
24662306a36Sopenharmony_ci
24762306a36Sopenharmony_ci#define FSL_XCVR_PLL_BANDGAP_EN_VBG		BIT(0)
24862306a36Sopenharmony_ci#define FSL_XCVR_PLL_CTRL0_HROFF		BIT(13)
24962306a36Sopenharmony_ci#define FSL_XCVR_PLL_CTRL0_PWP			BIT(14)
25062306a36Sopenharmony_ci#define FSL_XCVR_PLL_CTRL0_CM0_EN		BIT(24)
25162306a36Sopenharmony_ci#define FSL_XCVR_PLL_CTRL0_CM1_EN		BIT(25)
25262306a36Sopenharmony_ci#define FSL_XCVR_PLL_CTRL0_CM2_EN		BIT(26)
25362306a36Sopenharmony_ci#define FSL_XCVR_PLL_PDIVx(v, i)		((v & 0x7) << (4 * i))
25462306a36Sopenharmony_ci
25562306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_PHY_EN		BIT(0)
25662306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_RX_CM_EN		BIT(1)
25762306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_TSDIFF_OE		BIT(5)
25862306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_SPDIF_EN		BIT(8)
25962306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_ARC_MODE_SE_EN	BIT(9)
26062306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_ARC_MODE_CM_EN	BIT(10)
26162306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_TX_CLK_MASK		GENMASK(26, 25)
26262306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_TX_CLK_HDMI_SS	BIT(25)
26362306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL_TX_CLK_AUD_SS		BIT(26)
26462306a36Sopenharmony_ci#define FSL_XCVR_PHY_CTRL2_EARC_TXMS		BIT(14)
26562306a36Sopenharmony_ci
26662306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_FS_MASK		GENMASK(31, 24)
26762306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_FS_32000		0x3000000
26862306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_FS_44100		0x0000000
26962306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_FS_48000		0x2000000
27062306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_FS_64000		0xB000000
27162306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_FS_88200		0x8000000
27262306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_FS_96000		0xA000000
27362306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_FS_176400		0xC000000
27462306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_FS_192000		0xE000000
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_CH_MASK		0x3A
27762306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_CH_U2LPCM		0x00
27862306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_CH_UMLPCM		0x20
27962306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_0_CH_U1BAUD		0x30
28062306a36Sopenharmony_ci
28162306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_1_CH_MASK		0xF000
28262306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_1_CH_2			0x0000
28362306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_1_CH_8			0x7000
28462306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_1_CH_16		0xB000
28562306a36Sopenharmony_ci#define FSL_XCVR_CS_DATA_1_CH_32		0x3000
28662306a36Sopenharmony_ci
28762306a36Sopenharmony_ci/* Data memory structures */
28862306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_CTRL_0		0x20 /* First  RX CS control register */
28962306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_CTRL_1		0x24 /* Second RX CS control register */
29062306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_BUFF_0		0x80 /* First  RX CS buffer */
29162306a36Sopenharmony_ci#define FSL_XCVR_RX_CS_BUFF_1		0xA0 /* Second RX CS buffer */
29262306a36Sopenharmony_ci#define FSL_XCVR_CAP_DATA_STR		0x300 /* Capabilities data structure */
29362306a36Sopenharmony_ci
29462306a36Sopenharmony_ci#endif /* __FSL_XCVR_H */
295