18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * TI AM437x Image Sensor Interface Registers
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2013 - 2014 Texas Instruments, Inc.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Benoit Parrot <bparrot@ti.com>
88c2ecf20Sopenharmony_ci * Lad, Prabhakar <prabhakar.csengg@gmail.com>
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef AM437X_VPFE_REGS_H
128c2ecf20Sopenharmony_ci#define AM437X_VPFE_REGS_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/* VPFE module register offset */
158c2ecf20Sopenharmony_ci#define VPFE_REVISION				0x0
168c2ecf20Sopenharmony_ci#define VPFE_PCR				0x4
178c2ecf20Sopenharmony_ci#define VPFE_SYNMODE				0x8
188c2ecf20Sopenharmony_ci#define VPFE_HD_VD_WID				0xc
198c2ecf20Sopenharmony_ci#define VPFE_PIX_LINES				0x10
208c2ecf20Sopenharmony_ci#define VPFE_HORZ_INFO				0x14
218c2ecf20Sopenharmony_ci#define VPFE_VERT_START				0x18
228c2ecf20Sopenharmony_ci#define VPFE_VERT_LINES				0x1c
238c2ecf20Sopenharmony_ci#define VPFE_CULLING				0x20
248c2ecf20Sopenharmony_ci#define VPFE_HSIZE_OFF				0x24
258c2ecf20Sopenharmony_ci#define VPFE_SDOFST				0x28
268c2ecf20Sopenharmony_ci#define VPFE_SDR_ADDR				0x2c
278c2ecf20Sopenharmony_ci#define VPFE_CLAMP				0x30
288c2ecf20Sopenharmony_ci#define VPFE_DCSUB				0x34
298c2ecf20Sopenharmony_ci#define VPFE_COLPTN				0x38
308c2ecf20Sopenharmony_ci#define VPFE_BLKCMP				0x3c
318c2ecf20Sopenharmony_ci#define VPFE_VDINT				0x48
328c2ecf20Sopenharmony_ci#define VPFE_ALAW				0x4c
338c2ecf20Sopenharmony_ci#define VPFE_REC656IF				0x50
348c2ecf20Sopenharmony_ci#define VPFE_CCDCFG				0x54
358c2ecf20Sopenharmony_ci#define VPFE_DMA_CNTL				0x98
368c2ecf20Sopenharmony_ci#define VPFE_SYSCONFIG				0x104
378c2ecf20Sopenharmony_ci#define VPFE_CONFIG				0x108
388c2ecf20Sopenharmony_ci#define VPFE_IRQ_EOI				0x110
398c2ecf20Sopenharmony_ci#define VPFE_IRQ_STS_RAW			0x114
408c2ecf20Sopenharmony_ci#define VPFE_IRQ_STS				0x118
418c2ecf20Sopenharmony_ci#define VPFE_IRQ_EN_SET				0x11c
428c2ecf20Sopenharmony_ci#define VPFE_IRQ_EN_CLR				0x120
438c2ecf20Sopenharmony_ci#define VPFE_REG_END				0x124
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci/* Define bit fields within selected registers */
468c2ecf20Sopenharmony_ci#define VPFE_FID_POL_MASK			1
478c2ecf20Sopenharmony_ci#define VPFE_FID_POL_SHIFT			4
488c2ecf20Sopenharmony_ci#define VPFE_HD_POL_MASK			1
498c2ecf20Sopenharmony_ci#define VPFE_HD_POL_SHIFT			3
508c2ecf20Sopenharmony_ci#define VPFE_VD_POL_MASK			1
518c2ecf20Sopenharmony_ci#define VPFE_VD_POL_SHIFT			2
528c2ecf20Sopenharmony_ci#define VPFE_HSIZE_OFF_MASK			0xffffffe0
538c2ecf20Sopenharmony_ci#define VPFE_32BYTE_ALIGN_VAL			31
548c2ecf20Sopenharmony_ci#define VPFE_FRM_FMT_MASK			0x1
558c2ecf20Sopenharmony_ci#define VPFE_FRM_FMT_SHIFT			7
568c2ecf20Sopenharmony_ci#define VPFE_DATA_SZ_MASK			7
578c2ecf20Sopenharmony_ci#define VPFE_DATA_SZ_SHIFT			8
588c2ecf20Sopenharmony_ci#define VPFE_PIX_FMT_MASK			3
598c2ecf20Sopenharmony_ci#define VPFE_PIX_FMT_SHIFT			12
608c2ecf20Sopenharmony_ci#define VPFE_VP2SDR_DISABLE			0xfffbffff
618c2ecf20Sopenharmony_ci#define VPFE_WEN_ENABLE				BIT(17)
628c2ecf20Sopenharmony_ci#define VPFE_SDR2RSZ_DISABLE			0xfff7ffff
638c2ecf20Sopenharmony_ci#define VPFE_VDHDEN_ENABLE			BIT(16)
648c2ecf20Sopenharmony_ci#define VPFE_LPF_ENABLE				BIT(14)
658c2ecf20Sopenharmony_ci#define VPFE_ALAW_ENABLE			BIT(3)
668c2ecf20Sopenharmony_ci#define VPFE_ALAW_GAMMA_WD_MASK			7
678c2ecf20Sopenharmony_ci#define VPFE_BLK_CLAMP_ENABLE			BIT(31)
688c2ecf20Sopenharmony_ci#define VPFE_BLK_SGAIN_MASK			0x1f
698c2ecf20Sopenharmony_ci#define VPFE_BLK_ST_PXL_MASK			0x7fff
708c2ecf20Sopenharmony_ci#define VPFE_BLK_ST_PXL_SHIFT			10
718c2ecf20Sopenharmony_ci#define VPFE_BLK_SAMPLE_LN_MASK			7
728c2ecf20Sopenharmony_ci#define VPFE_BLK_SAMPLE_LN_SHIFT		28
738c2ecf20Sopenharmony_ci#define VPFE_BLK_SAMPLE_LINE_MASK		7
748c2ecf20Sopenharmony_ci#define VPFE_BLK_SAMPLE_LINE_SHIFT		25
758c2ecf20Sopenharmony_ci#define VPFE_BLK_DC_SUB_MASK			0x03fff
768c2ecf20Sopenharmony_ci#define VPFE_BLK_COMP_MASK			0xff
778c2ecf20Sopenharmony_ci#define VPFE_BLK_COMP_GB_COMP_SHIFT		8
788c2ecf20Sopenharmony_ci#define VPFE_BLK_COMP_GR_COMP_SHIFT		16
798c2ecf20Sopenharmony_ci#define VPFE_BLK_COMP_R_COMP_SHIFT		24
808c2ecf20Sopenharmony_ci#define VPFE_LATCH_ON_VSYNC_DISABLE		BIT(15)
818c2ecf20Sopenharmony_ci#define VPFE_DATA_PACK_ENABLE			BIT(11)
828c2ecf20Sopenharmony_ci#define VPFE_HORZ_INFO_SPH_SHIFT		16
838c2ecf20Sopenharmony_ci#define VPFE_VERT_START_SLV0_SHIFT		16
848c2ecf20Sopenharmony_ci#define VPFE_VDINT_VDINT0_SHIFT			16
858c2ecf20Sopenharmony_ci#define VPFE_VDINT_VDINT1_MASK			0xffff
868c2ecf20Sopenharmony_ci#define VPFE_PPC_RAW				1
878c2ecf20Sopenharmony_ci#define VPFE_DCSUB_DEFAULT_VAL			0
888c2ecf20Sopenharmony_ci#define VPFE_CLAMP_DEFAULT_VAL			0
898c2ecf20Sopenharmony_ci#define VPFE_COLPTN_VAL				0xbb11bb11
908c2ecf20Sopenharmony_ci#define VPFE_TWO_BYTES_PER_PIXEL		2
918c2ecf20Sopenharmony_ci#define VPFE_INTERLACED_IMAGE_INVERT		0x4b6d
928c2ecf20Sopenharmony_ci#define VPFE_INTERLACED_NO_IMAGE_INVERT		0x0249
938c2ecf20Sopenharmony_ci#define VPFE_PROGRESSIVE_IMAGE_INVERT		0x4000
948c2ecf20Sopenharmony_ci#define VPFE_PROGRESSIVE_NO_IMAGE_INVERT	0
958c2ecf20Sopenharmony_ci#define VPFE_INTERLACED_HEIGHT_SHIFT		1
968c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_INPMOD_SHIFT		12
978c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_INPMOD_MASK		3
988c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_8BITS			(7 << 8)
998c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_10BITS			(6 << 8)
1008c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_11BITS			(5 << 8)
1018c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_12BITS			(4 << 8)
1028c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_13BITS			(3 << 8)
1038c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_14BITS			(2 << 8)
1048c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_15BITS			(1 << 8)
1058c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_16BITS			(0 << 8)
1068c2ecf20Sopenharmony_ci#define VPFE_SYN_FLDMODE_MASK			1
1078c2ecf20Sopenharmony_ci#define VPFE_SYN_FLDMODE_SHIFT			7
1088c2ecf20Sopenharmony_ci#define VPFE_REC656IF_BT656_EN			3
1098c2ecf20Sopenharmony_ci#define VPFE_SYN_MODE_VD_POL_NEGATIVE		BIT(2)
1108c2ecf20Sopenharmony_ci#define VPFE_CCDCFG_Y8POS_SHIFT			11
1118c2ecf20Sopenharmony_ci#define VPFE_CCDCFG_BW656_10BIT			BIT(5)
1128c2ecf20Sopenharmony_ci#define VPFE_SDOFST_FIELD_INTERLEAVED		0x249
1138c2ecf20Sopenharmony_ci#define VPFE_NO_CULLING				0xffff00ff
1148c2ecf20Sopenharmony_ci#define VPFE_VDINT0				BIT(0)
1158c2ecf20Sopenharmony_ci#define VPFE_VDINT1				BIT(1)
1168c2ecf20Sopenharmony_ci#define VPFE_VDINT2				BIT(2)
1178c2ecf20Sopenharmony_ci#define VPFE_DMA_CNTL_OVERFLOW			BIT(31)
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci#define VPFE_CONFIG_PCLK_INV_SHIFT		0
1208c2ecf20Sopenharmony_ci#define VPFE_CONFIG_PCLK_INV_MASK		1
1218c2ecf20Sopenharmony_ci#define VPFE_CONFIG_PCLK_INV_NOT_INV		0
1228c2ecf20Sopenharmony_ci#define VPFE_CONFIG_PCLK_INV_INV		1
1238c2ecf20Sopenharmony_ci#define VPFE_CONFIG_EN_SHIFT			1
1248c2ecf20Sopenharmony_ci#define VPFE_CONFIG_EN_MASK			2
1258c2ecf20Sopenharmony_ci#define VPFE_CONFIG_EN_DISABLE			0
1268c2ecf20Sopenharmony_ci#define VPFE_CONFIG_EN_ENABLE			1
1278c2ecf20Sopenharmony_ci#define VPFE_CONFIG_ST_SHIFT			2
1288c2ecf20Sopenharmony_ci#define VPFE_CONFIG_ST_MASK			4
1298c2ecf20Sopenharmony_ci#define VPFE_CONFIG_ST_OCP_ACTIVE		0
1308c2ecf20Sopenharmony_ci#define VPFE_CONFIG_ST_OCP_STANDBY		1
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#endif		/* AM437X_VPFE_REGS_H */
133