18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * TI CAL camera interface driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2015 Texas Instruments Inc.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Benoit Parrot, <bparrot@ti.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef __TI_CAL_REGS_H
118c2ecf20Sopenharmony_ci#define __TI_CAL_REGS_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/*
148c2ecf20Sopenharmony_ci * struct cal_dev.flags possibilities
158c2ecf20Sopenharmony_ci *
168c2ecf20Sopenharmony_ci * DRA72_CAL_PRE_ES2_LDO_DISABLE:
178c2ecf20Sopenharmony_ci *   Errata i913: CSI2 LDO Needs to be disabled when module is powered on
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci *   Enabling CSI2 LDO shorts it to core supply. It is crucial the 2 CSI2
208c2ecf20Sopenharmony_ci *   LDOs on the device are disabled if CSI-2 module is powered on
218c2ecf20Sopenharmony_ci *   (0x4845 B304 | 0x4845 B384 [28:27] = 0x1) or in ULPS (0x4845 B304
228c2ecf20Sopenharmony_ci *   | 0x4845 B384 [28:27] = 0x2) mode. Common concerns include: high
238c2ecf20Sopenharmony_ci *   current draw on the module supply in active mode.
248c2ecf20Sopenharmony_ci *
258c2ecf20Sopenharmony_ci *   Errata does not apply when CSI-2 module is powered off
268c2ecf20Sopenharmony_ci *   (0x4845 B304 | 0x4845 B384 [28:27] = 0x0).
278c2ecf20Sopenharmony_ci *
288c2ecf20Sopenharmony_ci * SW Workaround:
298c2ecf20Sopenharmony_ci *	Set the following register bits to disable the LDO,
308c2ecf20Sopenharmony_ci *	which is essentially CSI2 REG10 bit 6:
318c2ecf20Sopenharmony_ci *
328c2ecf20Sopenharmony_ci *		Core 0:  0x4845 B828 = 0x0000 0040
338c2ecf20Sopenharmony_ci *		Core 1:  0x4845 B928 = 0x0000 0040
348c2ecf20Sopenharmony_ci */
358c2ecf20Sopenharmony_ci#define DRA72_CAL_PRE_ES2_LDO_DISABLE BIT(0)
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/* CAL register offsets */
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define CAL_HL_REVISION			0x0000
408c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO			0x0004
418c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG		0x0010
428c2ecf20Sopenharmony_ci#define CAL_HL_IRQ_EOI			0x001c
438c2ecf20Sopenharmony_ci#define CAL_HL_IRQSTATUS_RAW(m)		(0x20U + (m) * 0x10U)
448c2ecf20Sopenharmony_ci#define CAL_HL_IRQSTATUS(m)		(0x24U + (m) * 0x10U)
458c2ecf20Sopenharmony_ci#define CAL_HL_IRQENABLE_SET(m)		(0x28U + (m) * 0x10U)
468c2ecf20Sopenharmony_ci#define CAL_HL_IRQENABLE_CLR(m)		(0x2cU + (m) * 0x10U)
478c2ecf20Sopenharmony_ci#define CAL_PIX_PROC(m)			(0xc0U + (m) * 0x4U)
488c2ecf20Sopenharmony_ci#define CAL_CTRL			0x100
498c2ecf20Sopenharmony_ci#define CAL_CTRL1			0x104
508c2ecf20Sopenharmony_ci#define CAL_LINE_NUMBER_EVT		0x108
518c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL1			0x120
528c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2			0x124
538c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL1			0x130
548c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL2			0x134
558c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL			0x140
568c2ecf20Sopenharmony_ci#define CAL_RD_DMA_PIX_ADDR		0x144
578c2ecf20Sopenharmony_ci#define CAL_RD_DMA_PIX_OFST		0x148
588c2ecf20Sopenharmony_ci#define CAL_RD_DMA_XSIZE		0x14c
598c2ecf20Sopenharmony_ci#define CAL_RD_DMA_YSIZE		0x150
608c2ecf20Sopenharmony_ci#define CAL_RD_DMA_INIT_ADDR		0x154
618c2ecf20Sopenharmony_ci#define CAL_RD_DMA_INIT_OFST		0x168
628c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2		0x16c
638c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL(m)		(0x200U + (m) * 0x10U)
648c2ecf20Sopenharmony_ci#define CAL_WR_DMA_ADDR(m)		(0x204U + (m) * 0x10U)
658c2ecf20Sopenharmony_ci#define CAL_WR_DMA_OFST(m)		(0x208U + (m) * 0x10U)
668c2ecf20Sopenharmony_ci#define CAL_WR_DMA_XSIZE(m)		(0x20cU + (m) * 0x10U)
678c2ecf20Sopenharmony_ci#define CAL_CSI2_PPI_CTRL(m)		(0x300U + (m) * 0x80U)
688c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG(m)	(0x304U + (m) * 0x80U)
698c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQSTATUS(m)	(0x308U + (m) * 0x80U)
708c2ecf20Sopenharmony_ci#define CAL_CSI2_SHORT_PACKET(m)	(0x30cU + (m) * 0x80U)
718c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQENABLE(m)	(0x310U + (m) * 0x80U)
728c2ecf20Sopenharmony_ci#define CAL_CSI2_TIMING(m)		(0x314U + (m) * 0x80U)
738c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQENABLE(m)	(0x318U + (m) * 0x80U)
748c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQSTATUS(m)	(0x328U + (m) * 0x80U)
758c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX0(m)		(0x330U + (m) * 0x80U)
768c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX1(m)		(0x334U + (m) * 0x80U)
778c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX2(m)		(0x338U + (m) * 0x80U)
788c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX3(m)		(0x33cU + (m) * 0x80U)
798c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX4(m)		(0x340U + (m) * 0x80U)
808c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX5(m)		(0x344U + (m) * 0x80U)
818c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX6(m)		(0x348U + (m) * 0x80U)
828c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX7(m)		(0x34cU + (m) * 0x80U)
838c2ecf20Sopenharmony_ci#define CAL_CSI2_STATUS0(m)		(0x350U + (m) * 0x80U)
848c2ecf20Sopenharmony_ci#define CAL_CSI2_STATUS1(m)		(0x354U + (m) * 0x80U)
858c2ecf20Sopenharmony_ci#define CAL_CSI2_STATUS2(m)		(0x358U + (m) * 0x80U)
868c2ecf20Sopenharmony_ci#define CAL_CSI2_STATUS3(m)		(0x35cU + (m) * 0x80U)
878c2ecf20Sopenharmony_ci#define CAL_CSI2_STATUS4(m)		(0x360U + (m) * 0x80U)
888c2ecf20Sopenharmony_ci#define CAL_CSI2_STATUS5(m)		(0x364U + (m) * 0x80U)
898c2ecf20Sopenharmony_ci#define CAL_CSI2_STATUS6(m)		(0x368U + (m) * 0x80U)
908c2ecf20Sopenharmony_ci#define CAL_CSI2_STATUS7(m)		(0x36cU + (m) * 0x80U)
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci/* CAL CSI2 PHY register offsets */
938c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG0		0x000
948c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG1		0x004
958c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG2		0x008
968c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG10		0x028
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/* CAL Control Module Core Camerrx Control register offsets */
998c2ecf20Sopenharmony_ci#define CM_CTRL_CORE_CAMERRX_CONTROL	0x000
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci/*********************************************************************
1028c2ecf20Sopenharmony_ci* Field Definition Macros
1038c2ecf20Sopenharmony_ci*********************************************************************/
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci#define CAL_HL_REVISION_MINOR_MASK		GENMASK(5, 0)
1068c2ecf20Sopenharmony_ci#define CAL_HL_REVISION_CUSTOM_MASK		GENMASK(7, 6)
1078c2ecf20Sopenharmony_ci#define CAL_HL_REVISION_MAJOR_MASK		GENMASK(10, 8)
1088c2ecf20Sopenharmony_ci#define CAL_HL_REVISION_RTL_MASK		GENMASK(15, 11)
1098c2ecf20Sopenharmony_ci#define CAL_HL_REVISION_FUNC_MASK		GENMASK(27, 16)
1108c2ecf20Sopenharmony_ci#define CAL_HL_REVISION_SCHEME_MASK		GENMASK(31, 30)
1118c2ecf20Sopenharmony_ci#define CAL_HL_REVISION_SCHEME_H08			1
1128c2ecf20Sopenharmony_ci#define CAL_HL_REVISION_SCHEME_LEGACY			0
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_WFIFO_MASK		GENMASK(3, 0)
1158c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_RFIFO_MASK		GENMASK(7, 4)
1168c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_PCTX_MASK			GENMASK(12, 8)
1178c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_WCTX_MASK			GENMASK(18, 13)
1188c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_VFIFO_MASK		GENMASK(22, 19)
1198c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_NCPORT_MASK		GENMASK(27, 23)
1208c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_NPPI_CTXS0_MASK		GENMASK(29, 28)
1218c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_NPPI_CTXS1_MASK		GENMASK(31, 30)
1228c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_NPPI_CONTEXTS_ZERO		0
1238c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_NPPI_CONTEXTS_FOUR		1
1248c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_NPPI_CONTEXTS_EIGHT		2
1258c2ecf20Sopenharmony_ci#define CAL_HL_HWINFO_NPPI_CONTEXTS_RESERVED		3
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_SOFTRESET_MASK		BIT(0)
1288c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_SOFTRESET_DONE			0x0
1298c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_SOFTRESET_PENDING		0x1
1308c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_SOFTRESET_NOACTION		0x0
1318c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_SOFTRESET_RESET		0x1
1328c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_IDLE_MASK		GENMASK(3, 2)
1338c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_IDLEMODE_FORCE			0
1348c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_IDLEMODE_NO			1
1358c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_IDLEMODE_SMART1		2
1368c2ecf20Sopenharmony_ci#define CAL_HL_SYSCONFIG_IDLEMODE_SMART2		3
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci#define CAL_HL_IRQ_EOI_LINE_NUMBER_MASK		BIT(0)
1398c2ecf20Sopenharmony_ci#define CAL_HL_IRQ_EOI_LINE_NUMBER_READ0		0
1408c2ecf20Sopenharmony_ci#define CAL_HL_IRQ_EOI_LINE_NUMBER_EOI0			0
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci#define CAL_HL_IRQ_MASK(m)			BIT(m)
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci#define CAL_HL_IRQ_OCPO_ERR_MASK		BIT(6)
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci#define CAL_HL_IRQ_CIO_MASK(i)			BIT(16 + (i) * 8)
1478c2ecf20Sopenharmony_ci#define CAL_HL_IRQ_VC_MASK(i)			BIT(17 + (i) * 8)
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EN_MASK			BIT(0)
1508c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_MASK		GENMASK(4, 1)
1518c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B6				0x0
1528c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B7				0x1
1538c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B8				0x2
1548c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B10			0x3
1558c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B10_MIPI			0x4
1568c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B12			0x5
1578c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B12_MIPI			0x6
1588c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B14			0x7
1598c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B14_MIPI			0x8
1608c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B16_BE			0x9
1618c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_EXTRACT_B16_LE			0xa
1628c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_MASK			GENMASK(9, 5)
1638c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_BYPASS			0x0
1648c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_10_8_1			0x2
1658c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_12_8_1			0x8
1668c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_10_7_1			0x4
1678c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_10_7_2			0x5
1688c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_10_6_1			0x6
1698c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_10_6_2			0x7
1708c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_12_7_1			0xa
1718c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_12_6_1			0xc
1728c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_14_10			0xe
1738c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_14_8_1			0x10
1748c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_16_12_1			0x12
1758c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_16_10_1			0x14
1768c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCMD_DPCM_16_8_1			0x16
1778c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCME_MASK			GENMASK(15, 11)
1788c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCME_BYPASS			0x0
1798c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCME_DPCM_10_8_1			0x2
1808c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCME_DPCM_12_8_1			0x8
1818c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCME_DPCM_14_10			0xe
1828c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCME_DPCM_14_8_1			0x10
1838c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCME_DPCM_16_12_1			0x12
1848c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCME_DPCM_16_10_1			0x14
1858c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_DPCME_DPCM_16_8_1			0x16
1868c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_PACK_MASK			GENMASK(18, 16)
1878c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_PACK_B8				0x0
1888c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_PACK_B10_MIPI			0x2
1898c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_PACK_B12				0x3
1908c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_PACK_B12_MIPI			0x4
1918c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_PACK_B16				0x5
1928c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_PACK_ARGB				0x6
1938c2ecf20Sopenharmony_ci#define CAL_PIX_PROC_CPORT_MASK			GENMASK(23, 19)
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci#define CAL_CTRL_POSTED_WRITES_MASK		BIT(0)
1968c2ecf20Sopenharmony_ci#define CAL_CTRL_POSTED_WRITES_NONPOSTED		0
1978c2ecf20Sopenharmony_ci#define CAL_CTRL_POSTED_WRITES				1
1988c2ecf20Sopenharmony_ci#define CAL_CTRL_TAGCNT_MASK			GENMASK(4, 1)
1998c2ecf20Sopenharmony_ci#define CAL_CTRL_BURSTSIZE_MASK			GENMASK(6, 5)
2008c2ecf20Sopenharmony_ci#define CAL_CTRL_BURSTSIZE_BURST16			0x0
2018c2ecf20Sopenharmony_ci#define CAL_CTRL_BURSTSIZE_BURST32			0x1
2028c2ecf20Sopenharmony_ci#define CAL_CTRL_BURSTSIZE_BURST64			0x2
2038c2ecf20Sopenharmony_ci#define CAL_CTRL_BURSTSIZE_BURST128			0x3
2048c2ecf20Sopenharmony_ci#define CAL_CTRL_LL_FORCE_STATE_MASK		GENMASK(12, 7)
2058c2ecf20Sopenharmony_ci#define CAL_CTRL_MFLAGL_MASK			GENMASK(20, 13)
2068c2ecf20Sopenharmony_ci#define CAL_CTRL_PWRSCPCLK_MASK			BIT(21)
2078c2ecf20Sopenharmony_ci#define CAL_CTRL_PWRSCPCLK_AUTO				0
2088c2ecf20Sopenharmony_ci#define CAL_CTRL_PWRSCPCLK_FORCE			1
2098c2ecf20Sopenharmony_ci#define CAL_CTRL_RD_DMA_STALL_MASK		BIT(22)
2108c2ecf20Sopenharmony_ci#define CAL_CTRL_MFLAGH_MASK			GENMASK(31, 24)
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci#define CAL_CTRL1_PPI_GROUPING_MASK		GENMASK(1, 0)
2138c2ecf20Sopenharmony_ci#define CAL_CTRL1_PPI_GROUPING_DISABLED			0
2148c2ecf20Sopenharmony_ci#define CAL_CTRL1_PPI_GROUPING_RESERVED			1
2158c2ecf20Sopenharmony_ci#define CAL_CTRL1_PPI_GROUPING_0			2
2168c2ecf20Sopenharmony_ci#define CAL_CTRL1_PPI_GROUPING_1			3
2178c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE01_MASK		GENMASK(3, 2)
2188c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE01_DISABLED			0
2198c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE01_PIX1			1
2208c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE01_PIX4			2
2218c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE01_RESERVED			3
2228c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE23_MASK		GENMASK(5, 4)
2238c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE23_DISABLED			0
2248c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE23_PIX1			1
2258c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE23_PIX4			2
2268c2ecf20Sopenharmony_ci#define CAL_CTRL1_INTERLEAVE23_RESERVED			3
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci#define CAL_LINE_NUMBER_EVT_CPORT_MASK		GENMASK(4, 0)
2298c2ecf20Sopenharmony_ci#define CAL_LINE_NUMBER_EVT_MASK		GENMASK(29, 16)
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL1_PCLK_MASK		GENMASK(16, 0)
2328c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL1_XBLK_MASK		GENMASK(24, 17)
2338c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL1_YBLK_MASK		GENMASK(30, 25)
2348c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL1_WIDTH_MASK		BIT(31)
2358c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL1_WIDTH_ONE			0
2368c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL1_WIDTH_TWO			1
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_CPORT_MASK		GENMASK(4, 0)
2398c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_FREERUNNING_MASK	BIT(15)
2408c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_FREERUNNING_GATED		0
2418c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_FREERUNNING_FREE		1
2428c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_FS_RESETS_MASK		BIT(16)
2438c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_FS_RESETS_NO			0
2448c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_FS_RESETS_YES			1
2458c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_FSM_RESET_MASK		BIT(17)
2468c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_FSM_RESET_NOEFFECT		0
2478c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_FSM_RESET			1
2488c2ecf20Sopenharmony_ci#define CAL_VPORT_CTRL2_RDY_THR_MASK		GENMASK(31, 18)
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL1_PCLK_MASK			GENMASK(16, 0)
2518c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL1_XBLK_MASK			GENMASK(24, 17)
2528c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL1_YBLK_MASK			GENMASK(30, 25)
2538c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL1_BYSINEN_MASK		BIT(31)
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL2_CPORTIN_MASK		GENMASK(4, 0)
2568c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL2_CPORTOUT_MASK		GENMASK(9, 5)
2578c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL2_DUPLICATEDDATA_MASK	BIT(10)
2588c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL2_DUPLICATEDDATA_NO			0
2598c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL2_DUPLICATEDDATA_YES		1
2608c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL2_FREERUNNING_MASK		BIT(11)
2618c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL2_FREERUNNING_NO			0
2628c2ecf20Sopenharmony_ci#define CAL_BYS_CTRL2_FREERUNNING_YES			1
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL_GO_MASK			BIT(0)
2658c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL_GO_DIS				0
2668c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL_GO_EN				1
2678c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL_GO_IDLE				0
2688c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL_GO_BUSY				1
2698c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL_INIT_MASK		BIT(1)
2708c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL_BW_LIMITER_MASK		GENMASK(10, 2)
2718c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL_OCP_TAG_CNT_MASK	GENMASK(14, 11)
2728c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL_PCLK_MASK		GENMASK(31, 15)
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci#define CAL_RD_DMA_PIX_ADDR_MASK		GENMASK(31, 3)
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci#define CAL_RD_DMA_PIX_OFST_MASK		GENMASK(31, 4)
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci#define CAL_RD_DMA_XSIZE_MASK			GENMASK(31, 19)
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci#define CAL_RD_DMA_YSIZE_MASK			GENMASK(29, 16)
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ci#define CAL_RD_DMA_INIT_ADDR_MASK		GENMASK(31, 3)
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_ci#define CAL_RD_DMA_INIT_OFST_MASK		GENMASK(31, 3)
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_CIRC_MODE_MASK		GENMASK(2, 0)
2878c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_CIRC_MODE_DIS			0
2888c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_CIRC_MODE_ONE			1
2898c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_CIRC_MODE_FOUR			2
2908c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_CIRC_MODE_SIXTEEN		3
2918c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_CIRC_MODE_SIXTYFOUR		4
2928c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_CIRC_MODE_RESERVED		5
2938c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_ICM_CSTART_MASK	BIT(3)
2948c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_PATTERN_MASK		GENMASK(5, 4)
2958c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_PATTERN_LINEAR			0
2968c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_PATTERN_YUV420			1
2978c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_PATTERN_RD2SKIP2		2
2988c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_PATTERN_RD2SKIP4		3
2998c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_BYSOUT_LE_WAIT_MASK	BIT(6)
3008c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_BYSOUT_LE_WAIT_FREERUNNING	0
3018c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_BYSOUT_LE_WAIT_WAITFORBYSOUT	1
3028c2ecf20Sopenharmony_ci#define CAL_RD_DMA_CTRL2_CIRC_SIZE_MASK		GENMASK(29, 16)
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_MODE_MASK		GENMASK(2, 0)
3058c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_MODE_DIS			0
3068c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_MODE_SHD			1
3078c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_MODE_CNT			2
3088c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_MODE_CNT_INIT			3
3098c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_MODE_CONST			4
3108c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_MODE_RESERVED			5
3118c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_PATTERN_MASK		GENMASK(4, 3)
3128c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_PATTERN_LINEAR			0
3138c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_PATTERN_WR2SKIP2		2
3148c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_PATTERN_WR2SKIP4		3
3158c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_PATTERN_RESERVED		1
3168c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_ICM_PSTART_MASK		BIT(5)
3178c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_DTAG_MASK		GENMASK(8, 6)
3188c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_DTAG_ATT_HDR			0
3198c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_DTAG_ATT_DAT			1
3208c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_DTAG				2
3218c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_DTAG_PIX_HDR			3
3228c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_DTAG_PIX_DAT			4
3238c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_DTAG_D5				5
3248c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_DTAG_D6				6
3258c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_DTAG_D7				7
3268c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_CPORT_MASK		GENMASK(13, 9)
3278c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_STALL_RD_MASK		BIT(14)
3288c2ecf20Sopenharmony_ci#define CAL_WR_DMA_CTRL_YSIZE_MASK		GENMASK(31, 18)
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci#define CAL_WR_DMA_ADDR_MASK			GENMASK(31, 4)
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci#define CAL_WR_DMA_OFST_MASK			GENMASK(18, 4)
3338c2ecf20Sopenharmony_ci#define CAL_WR_DMA_OFST_CIRC_MODE_MASK		GENMASK(23, 22)
3348c2ecf20Sopenharmony_ci#define CAL_WR_DMA_OFST_CIRC_MODE_ONE			1
3358c2ecf20Sopenharmony_ci#define CAL_WR_DMA_OFST_CIRC_MODE_FOUR			2
3368c2ecf20Sopenharmony_ci#define CAL_WR_DMA_OFST_CIRC_MODE_SIXTYFOUR		3
3378c2ecf20Sopenharmony_ci#define CAL_WR_DMA_OFST_CIRC_MODE_DISABLED		0
3388c2ecf20Sopenharmony_ci#define CAL_WR_DMA_OFST_CIRC_SIZE_MASK		GENMASK(31, 24)
3398c2ecf20Sopenharmony_ci
3408c2ecf20Sopenharmony_ci#define CAL_WR_DMA_XSIZE_XSKIP_MASK		GENMASK(15, 3)
3418c2ecf20Sopenharmony_ci#define CAL_WR_DMA_XSIZE_MASK			GENMASK(31, 19)
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci#define CAL_CSI2_PPI_CTRL_IF_EN_MASK		BIT(0)
3448c2ecf20Sopenharmony_ci#define CAL_CSI2_PPI_CTRL_ECC_EN_MASK		BIT(2)
3458c2ecf20Sopenharmony_ci#define CAL_CSI2_PPI_CTRL_FRAME_MASK		BIT(3)
3468c2ecf20Sopenharmony_ci#define CAL_CSI2_PPI_CTRL_FRAME_IMMEDIATE		0
3478c2ecf20Sopenharmony_ci#define CAL_CSI2_PPI_CTRL_FRAME				1
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_CLOCK_POSITION_MASK	GENMASK(2, 0)
3508c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_POSITION_5			5
3518c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_POSITION_4			4
3528c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_POSITION_3			3
3538c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_POSITION_2			2
3548c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_POSITION_1			1
3558c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_POSITION_NOT_USED		0
3568c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_CLOCK_POL_MASK		BIT(3)
3578c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_POL_PLUSMINUS			0
3588c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_POL_MINUSPLUS			1
3598c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_DATA1_POSITION_MASK	GENMASK(6, 4)
3608c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_DATA1_POL_MASK		BIT(7)
3618c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_DATA2_POSITION_MASK	GENMASK(10, 8)
3628c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_DATA2_POL_MASK		BIT(11)
3638c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_DATA3_POSITION_MASK	GENMASK(14, 12)
3648c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_DATA3_POL_MASK		BIT(15)
3658c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_DATA4_POSITION_MASK	GENMASK(18, 16)
3668c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_DATA4_POL_MASK		BIT(19)
3678c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_PWR_AUTO_MASK		BIT(24)
3688c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_PWR_STATUS_MASK		GENMASK(26, 25)
3698c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_PWR_STATUS_STATE_OFF		0
3708c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_PWR_STATUS_STATE_ON		1
3718c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_PWR_STATUS_STATE_ULP		2
3728c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_PWR_CMD_MASK		GENMASK(28, 27)
3738c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_PWR_CMD_STATE_OFF		0
3748c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_PWR_CMD_STATE_ON			1
3758c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_PWR_CMD_STATE_ULP		2
3768c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_RESET_DONE_MASK		BIT(29)
3778c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_RESET_DONE_RESETCOMPLETED	1
3788c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_RESET_DONE_RESETONGOING		0
3798c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_RESET_CTRL_MASK		BIT(30)
3808c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_RESET_CTRL			0
3818c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_CFG_RESET_CTRL_OPERATIONAL		1
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_ci#define CAL_CSI2_SHORT_PACKET_MASK	GENMASK(23, 0)
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTHS1_MASK		BIT(0)
3868c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTHS2_MASK		BIT(1)
3878c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTHS3_MASK		BIT(2)
3888c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTHS4_MASK		BIT(3)
3898c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTHS5_MASK		BIT(4)
3908c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTSYNCHS1_MASK	BIT(5)
3918c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTSYNCHS2_MASK	BIT(6)
3928c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTSYNCHS3_MASK	BIT(7)
3938c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTSYNCHS4_MASK	BIT(8)
3948c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRSOTSYNCHS5_MASK	BIT(9)
3958c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRESC1_MASK		BIT(10)
3968c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRESC2_MASK		BIT(11)
3978c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRESC3_MASK		BIT(12)
3988c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRESC4_MASK		BIT(13)
3998c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRESC5_MASK		BIT(14)
4008c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRCONTROL1_MASK		BIT(15)
4018c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRCONTROL2_MASK		BIT(16)
4028c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRCONTROL3_MASK		BIT(17)
4038c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRCONTROL4_MASK		BIT(18)
4048c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ERRCONTROL5_MASK		BIT(19)
4058c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_LANE_ERRORS_MASK		GENMASK(19, 0)
4068c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_STATEULPM1_MASK		BIT(20)
4078c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_STATEULPM2_MASK		BIT(21)
4088c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_STATEULPM3_MASK		BIT(22)
4098c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_STATEULPM4_MASK		BIT(23)
4108c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_STATEULPM5_MASK		BIT(24)
4118c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_STATEALLULPMENTER_MASK	BIT(25)
4128c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_STATEALLULPMEXIT_MASK	BIT(26)
4138c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_FIFO_OVR_MASK		BIT(27)
4148c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_SHORT_PACKET_MASK	BIT(28)
4158c2ecf20Sopenharmony_ci#define CAL_CSI2_COMPLEXIO_IRQ_ECC_NO_CORRECTION_MASK	BIT(30)
4168c2ecf20Sopenharmony_ci
4178c2ecf20Sopenharmony_ci#define CAL_CSI2_TIMING_STOP_STATE_COUNTER_IO1_MASK	GENMASK(12, 0)
4188c2ecf20Sopenharmony_ci#define CAL_CSI2_TIMING_STOP_STATE_X4_IO1_MASK		BIT(13)
4198c2ecf20Sopenharmony_ci#define CAL_CSI2_TIMING_STOP_STATE_X16_IO1_MASK		BIT(14)
4208c2ecf20Sopenharmony_ci#define CAL_CSI2_TIMING_FORCE_RX_MODE_IO1_MASK		BIT(15)
4218c2ecf20Sopenharmony_ci
4228c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_FS_IRQ_0_MASK			BIT(0)
4238c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_FE_IRQ_0_MASK			BIT(1)
4248c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_LS_IRQ_0_MASK			BIT(2)
4258c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_LE_IRQ_0_MASK			BIT(3)
4268c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_CS_IRQ_0_MASK			BIT(4)
4278c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_ECC_CORRECTION0_IRQ_0_MASK	BIT(5)
4288c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_FS_IRQ_1_MASK			BIT(8)
4298c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_FE_IRQ_1_MASK			BIT(9)
4308c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_LS_IRQ_1_MASK			BIT(10)
4318c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_LE_IRQ_1_MASK			BIT(11)
4328c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_CS_IRQ_1_MASK			BIT(12)
4338c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_ECC_CORRECTION0_IRQ_1_MASK	BIT(13)
4348c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_FS_IRQ_2_MASK			BIT(16)
4358c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_FE_IRQ_2_MASK			BIT(17)
4368c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_LS_IRQ_2_MASK			BIT(18)
4378c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_LE_IRQ_2_MASK			BIT(19)
4388c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_CS_IRQ_2_MASK			BIT(20)
4398c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_ECC_CORRECTION0_IRQ_2_MASK	BIT(21)
4408c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_FS_IRQ_3_MASK			BIT(24)
4418c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_FE_IRQ_3_MASK			BIT(25)
4428c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_LS_IRQ_3_MASK			BIT(26)
4438c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_LE_IRQ_3_MASK			BIT(27)
4448c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_CS_IRQ_3_MASK			BIT(28)
4458c2ecf20Sopenharmony_ci#define CAL_CSI2_VC_IRQ_ECC_CORRECTION0_IRQ_3_MASK	BIT(29)
4468c2ecf20Sopenharmony_ci
4478c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_DT_MASK		GENMASK(5, 0)
4488c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_VC_MASK		GENMASK(7, 6)
4498c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_CPORT_MASK		GENMASK(12, 8)
4508c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_ATT_MASK		BIT(13)
4518c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_ATT_PIX			0
4528c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_ATT			1
4538c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_PACK_MODE_MASK	BIT(14)
4548c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_PACK_MODE_LINE		0
4558c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_PACK_MODE_FRAME		1
4568c2ecf20Sopenharmony_ci#define CAL_CSI2_CTX_LINES_MASK		GENMASK(29, 16)
4578c2ecf20Sopenharmony_ci
4588c2ecf20Sopenharmony_ci#define CAL_CSI2_STATUS_FRAME_MASK	GENMASK(15, 0)
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG0_THS_SETTLE_MASK	GENMASK(7, 0)
4618c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG0_THS_TERM_MASK		GENMASK(15, 8)
4628c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG0_HSCLOCKCONFIG_MASK	BIT(24)
4638c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG0_HSCLOCKCONFIG_DISABLE		1
4648c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG0_HSCLOCKCONFIG_ENABLE		0
4658c2ecf20Sopenharmony_ci
4668c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG1_TCLK_SETTLE_MASK			GENMASK(7, 0)
4678c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG1_CTRLCLK_DIV_FACTOR_MASK		GENMASK(9, 8)
4688c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG1_DPHY_HS_SYNC_PATTERN_MASK		GENMASK(17, 10)
4698c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG1_TCLK_TERM_MASK			GENMASK(24, 18)
4708c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG1_CLOCK_MISS_DETECTOR_STATUS_MASK	BIT(25)
4718c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG1_CLOCK_MISS_DETECTOR_STATUS_ERROR		1
4728c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG1_CLOCK_MISS_DETECTOR_STATUS_SUCCESS		0
4738c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG1_RESET_DONE_STATUS_MASK		GENMASK(29, 28)
4748c2ecf20Sopenharmony_ci
4758c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG10_I933_LDO_DISABLE_MASK		BIT(6)
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG2_CCP2_SYNC_PATTERN_MASK		GENMASK(23, 0)
4788c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG2_TRIGGER_CMD_RXTRIGESC3_MASK		GENMASK(25, 24)
4798c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG2_TRIGGER_CMD_RXTRIGESC2_MASK		GENMASK(27, 26)
4808c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG2_TRIGGER_CMD_RXTRIGESC1_MASK		GENMASK(29, 28)
4818c2ecf20Sopenharmony_ci#define CAL_CSI2_PHY_REG2_TRIGGER_CMD_RXTRIGESC0_MASK		GENMASK(31, 30)
4828c2ecf20Sopenharmony_ci
4838c2ecf20Sopenharmony_ci#define CM_CAMERRX_CTRL_CSI1_CTRLCLKEN_MASK			BIT(0)
4848c2ecf20Sopenharmony_ci#define CM_CAMERRX_CTRL_CSI1_CAMMODE_MASK			GENMASK(2, 1)
4858c2ecf20Sopenharmony_ci#define CM_CAMERRX_CTRL_CSI1_LANEENABLE_MASK			GENMASK(4, 3)
4868c2ecf20Sopenharmony_ci#define CM_CAMERRX_CTRL_CSI1_MODE_MASK				BIT(5)
4878c2ecf20Sopenharmony_ci#define CM_CAMERRX_CTRL_CSI0_CTRLCLKEN_MASK			BIT(10)
4888c2ecf20Sopenharmony_ci#define CM_CAMERRX_CTRL_CSI0_CAMMODE_MASK			GENMASK(12, 11)
4898c2ecf20Sopenharmony_ci#define CM_CAMERRX_CTRL_CSI0_LANEENABLE_MASK			GENMASK(16, 13)
4908c2ecf20Sopenharmony_ci#define CM_CAMERRX_CTRL_CSI0_MODE_MASK				BIT(17)
4918c2ecf20Sopenharmony_ci
4928c2ecf20Sopenharmony_ci#endif
493