18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * vsp1_regs.h  --  R-Car VSP1 Registers Definitions
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2013 Renesas Electronics Corporation
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef __VSP1_REGS_H__
118c2ecf20Sopenharmony_ci#define __VSP1_REGS_H__
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
148c2ecf20Sopenharmony_ci * General Control Registers
158c2ecf20Sopenharmony_ci */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define VI6_CMD(n)			(0x0000 + (n) * 4)
188c2ecf20Sopenharmony_ci#define VI6_CMD_UPDHDR			BIT(4)
198c2ecf20Sopenharmony_ci#define VI6_CMD_STRCMD			BIT(0)
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define VI6_CLK_DCSWT			0x0018
228c2ecf20Sopenharmony_ci#define VI6_CLK_DCSWT_CSTPW_MASK	(0xff << 8)
238c2ecf20Sopenharmony_ci#define VI6_CLK_DCSWT_CSTPW_SHIFT	8
248c2ecf20Sopenharmony_ci#define VI6_CLK_DCSWT_CSTRW_MASK	(0xff << 0)
258c2ecf20Sopenharmony_ci#define VI6_CLK_DCSWT_CSTRW_SHIFT	0
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define VI6_SRESET			0x0028
288c2ecf20Sopenharmony_ci#define VI6_SRESET_SRTS(n)		BIT(n)
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define VI6_STATUS			0x0038
318c2ecf20Sopenharmony_ci#define VI6_STATUS_FLD_STD(n)		BIT((n) + 28)
328c2ecf20Sopenharmony_ci#define VI6_STATUS_SYS_ACT(n)		BIT((n) + 8)
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define VI6_WPF_IRQ_ENB(n)		(0x0048 + (n) * 12)
358c2ecf20Sopenharmony_ci#define VI6_WFP_IRQ_ENB_DFEE		BIT(1)
368c2ecf20Sopenharmony_ci#define VI6_WFP_IRQ_ENB_FREE		BIT(0)
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#define VI6_WPF_IRQ_STA(n)		(0x004c + (n) * 12)
398c2ecf20Sopenharmony_ci#define VI6_WFP_IRQ_STA_DFE		BIT(1)
408c2ecf20Sopenharmony_ci#define VI6_WFP_IRQ_STA_FRE		BIT(0)
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define VI6_DISP_IRQ_ENB(n)		(0x0078 + (n) * 60)
438c2ecf20Sopenharmony_ci#define VI6_DISP_IRQ_ENB_DSTE		BIT(8)
448c2ecf20Sopenharmony_ci#define VI6_DISP_IRQ_ENB_MAEE		BIT(5)
458c2ecf20Sopenharmony_ci#define VI6_DISP_IRQ_ENB_LNEE(n)	BIT(n)
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define VI6_DISP_IRQ_STA(n)		(0x007c + (n) * 60)
488c2ecf20Sopenharmony_ci#define VI6_DISP_IRQ_STA_DST		BIT(8)
498c2ecf20Sopenharmony_ci#define VI6_DISP_IRQ_STA_MAE		BIT(5)
508c2ecf20Sopenharmony_ci#define VI6_DISP_IRQ_STA_LNE(n)		BIT(n)
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define VI6_WPF_LINE_COUNT(n)		(0x0084 + (n) * 4)
538c2ecf20Sopenharmony_ci#define VI6_WPF_LINE_COUNT_MASK		(0x1fffff << 0)
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
568c2ecf20Sopenharmony_ci * Display List Control Registers
578c2ecf20Sopenharmony_ci */
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci#define VI6_DL_CTRL			0x0100
608c2ecf20Sopenharmony_ci#define VI6_DL_CTRL_AR_WAIT_MASK	(0xffff << 16)
618c2ecf20Sopenharmony_ci#define VI6_DL_CTRL_AR_WAIT_SHIFT	16
628c2ecf20Sopenharmony_ci#define VI6_DL_CTRL_DC2			BIT(12)
638c2ecf20Sopenharmony_ci#define VI6_DL_CTRL_DC1			BIT(8)
648c2ecf20Sopenharmony_ci#define VI6_DL_CTRL_DC0			BIT(4)
658c2ecf20Sopenharmony_ci#define VI6_DL_CTRL_CFM0		BIT(2)
668c2ecf20Sopenharmony_ci#define VI6_DL_CTRL_NH0			BIT(1)
678c2ecf20Sopenharmony_ci#define VI6_DL_CTRL_DLE			BIT(0)
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#define VI6_DL_HDR_ADDR(n)		(0x0104 + (n) * 4)
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci#define VI6_DL_SWAP			0x0114
728c2ecf20Sopenharmony_ci#define VI6_DL_SWAP_LWS			BIT(2)
738c2ecf20Sopenharmony_ci#define VI6_DL_SWAP_WDS			BIT(1)
748c2ecf20Sopenharmony_ci#define VI6_DL_SWAP_BTS			BIT(0)
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#define VI6_DL_EXT_CTRL(n)		(0x011c + (n) * 36)
778c2ecf20Sopenharmony_ci#define VI6_DL_EXT_CTRL_NWE		BIT(16)
788c2ecf20Sopenharmony_ci#define VI6_DL_EXT_CTRL_POLINT_MASK	(0x3f << 8)
798c2ecf20Sopenharmony_ci#define VI6_DL_EXT_CTRL_POLINT_SHIFT	8
808c2ecf20Sopenharmony_ci#define VI6_DL_EXT_CTRL_DLPRI		BIT(5)
818c2ecf20Sopenharmony_ci#define VI6_DL_EXT_CTRL_EXPRI		BIT(4)
828c2ecf20Sopenharmony_ci#define VI6_DL_EXT_CTRL_EXT		BIT(0)
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci#define VI6_DL_EXT_AUTOFLD_INT		BIT(0)
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define VI6_DL_BODY_SIZE		0x0120
878c2ecf20Sopenharmony_ci#define VI6_DL_BODY_SIZE_UPD		BIT(24)
888c2ecf20Sopenharmony_ci#define VI6_DL_BODY_SIZE_BS_MASK	(0x1ffff << 0)
898c2ecf20Sopenharmony_ci#define VI6_DL_BODY_SIZE_BS_SHIFT	0
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
928c2ecf20Sopenharmony_ci * RPF Control Registers
938c2ecf20Sopenharmony_ci */
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define VI6_RPF_OFFSET			0x100
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_BSIZE		0x0300
988c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_BSIZE_BHSIZE_MASK	(0x1fff << 16)
998c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_BSIZE_BHSIZE_SHIFT	16
1008c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_BSIZE_BVSIZE_MASK	(0x1fff << 0)
1018c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_BSIZE_BVSIZE_SHIFT	0
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_ESIZE		0x0304
1048c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_ESIZE_EHSIZE_MASK	(0x1fff << 16)
1058c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_ESIZE_EHSIZE_SHIFT	16
1068c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_ESIZE_EVSIZE_MASK	(0x1fff << 0)
1078c2ecf20Sopenharmony_ci#define VI6_RPF_SRC_ESIZE_EVSIZE_SHIFT	0
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT			0x0308
1108c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_VIR		BIT(28)
1118c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_CIPM		BIT(16)
1128c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_SPYCS		BIT(15)
1138c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_SPUVS		BIT(14)
1148c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_CEXT_ZERO		(0 << 12)
1158c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_CEXT_EXT		(1 << 12)
1168c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_CEXT_ONE		(2 << 12)
1178c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_CEXT_MASK		(3 << 12)
1188c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_RDTM_BT601	(0 << 9)
1198c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_RDTM_BT601_EXT	(1 << 9)
1208c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_RDTM_BT709	(2 << 9)
1218c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_RDTM_BT709_EXT	(3 << 9)
1228c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_RDTM_MASK		(7 << 9)
1238c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_CSC		BIT(8)
1248c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_RDFMT_MASK	(0x7f << 0)
1258c2ecf20Sopenharmony_ci#define VI6_RPF_INFMT_RDFMT_SHIFT	0
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci#define VI6_RPF_DSWAP			0x030c
1288c2ecf20Sopenharmony_ci#define VI6_RPF_DSWAP_A_LLS		BIT(11)
1298c2ecf20Sopenharmony_ci#define VI6_RPF_DSWAP_A_LWS		BIT(10)
1308c2ecf20Sopenharmony_ci#define VI6_RPF_DSWAP_A_WDS		BIT(9)
1318c2ecf20Sopenharmony_ci#define VI6_RPF_DSWAP_A_BTS		BIT(8)
1328c2ecf20Sopenharmony_ci#define VI6_RPF_DSWAP_P_LLS		BIT(3)
1338c2ecf20Sopenharmony_ci#define VI6_RPF_DSWAP_P_LWS		BIT(2)
1348c2ecf20Sopenharmony_ci#define VI6_RPF_DSWAP_P_WDS		BIT(1)
1358c2ecf20Sopenharmony_ci#define VI6_RPF_DSWAP_P_BTS		BIT(0)
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci#define VI6_RPF_LOC			0x0310
1388c2ecf20Sopenharmony_ci#define VI6_RPF_LOC_HCOORD_MASK		(0x1fff << 16)
1398c2ecf20Sopenharmony_ci#define VI6_RPF_LOC_HCOORD_SHIFT	16
1408c2ecf20Sopenharmony_ci#define VI6_RPF_LOC_VCOORD_MASK		(0x1fff << 0)
1418c2ecf20Sopenharmony_ci#define VI6_RPF_LOC_VCOORD_SHIFT	0
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL		0x0314
1448c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ASEL_PACKED	(0 << 28)
1458c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ASEL_8B_PLANE	(1 << 28)
1468c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ASEL_SELECT	(2 << 28)
1478c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ASEL_1B_PLANE	(3 << 28)
1488c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ASEL_FIXED	(4 << 28)
1498c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ASEL_MASK	(7 << 28)
1508c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ASEL_SHIFT	28
1518c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_IROP_MASK	(0xf << 24)
1528c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_IROP_SHIFT	24
1538c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_BSEL		BIT(23)
1548c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_AEXT_ZERO	(0 << 18)
1558c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_AEXT_EXT	(1 << 18)
1568c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_AEXT_ONE	(2 << 18)
1578c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_AEXT_MASK	(3 << 18)
1588c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ALPHA1_MASK	(0xff << 8)
1598c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ALPHA1_SHIFT	8
1608c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ALPHA0_MASK	(0xff << 0)
1618c2ecf20Sopenharmony_ci#define VI6_RPF_ALPH_SEL_ALPHA0_SHIFT	0
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci#define VI6_RPF_VRTCOL_SET		0x0318
1648c2ecf20Sopenharmony_ci#define VI6_RPF_VRTCOL_SET_LAYA_MASK	(0xff << 24)
1658c2ecf20Sopenharmony_ci#define VI6_RPF_VRTCOL_SET_LAYA_SHIFT	24
1668c2ecf20Sopenharmony_ci#define VI6_RPF_VRTCOL_SET_LAYR_MASK	(0xff << 16)
1678c2ecf20Sopenharmony_ci#define VI6_RPF_VRTCOL_SET_LAYR_SHIFT	16
1688c2ecf20Sopenharmony_ci#define VI6_RPF_VRTCOL_SET_LAYG_MASK	(0xff << 8)
1698c2ecf20Sopenharmony_ci#define VI6_RPF_VRTCOL_SET_LAYG_SHIFT	8
1708c2ecf20Sopenharmony_ci#define VI6_RPF_VRTCOL_SET_LAYB_MASK	(0xff << 0)
1718c2ecf20Sopenharmony_ci#define VI6_RPF_VRTCOL_SET_LAYB_SHIFT	0
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_CTRL		0x031c
1748c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_CTRL_MSK_EN		BIT(24)
1758c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_CTRL_MGR_MASK	(0xff << 16)
1768c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_CTRL_MGR_SHIFT	16
1778c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_CTRL_MGG_MASK	(0xff << 8)
1788c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_CTRL_MGG_SHIFT	8
1798c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_CTRL_MGB_MASK	(0xff << 0)
1808c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_CTRL_MGB_SHIFT	0
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET0		0x0320
1838c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET1		0x0324
1848c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET_MSA_MASK	(0xff << 24)
1858c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET_MSA_SHIFT	24
1868c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET_MSR_MASK	(0xff << 16)
1878c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET_MSR_SHIFT	16
1888c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET_MSG_MASK	(0xff << 8)
1898c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET_MSG_SHIFT	8
1908c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET_MSB_MASK	(0xff << 0)
1918c2ecf20Sopenharmony_ci#define VI6_RPF_MSK_SET_MSB_SHIFT	0
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_CTRL		0x0328
1948c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_CTRL_CV		BIT(4)
1958c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_CTRL_SAPE1		BIT(1)
1968c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_CTRL_SAPE0		BIT(0)
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET0		0x032c
1998c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET1		0x0330
2008c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET_AP_MASK	(0xff << 24)
2018c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET_AP_SHIFT	24
2028c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET_R_MASK		(0xff << 16)
2038c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET_R_SHIFT	16
2048c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET_GY_MASK	(0xff << 8)
2058c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET_GY_SHIFT	8
2068c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET_B_MASK		(0xff << 0)
2078c2ecf20Sopenharmony_ci#define VI6_RPF_CKEY_SET_B_SHIFT	0
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci#define VI6_RPF_SRCM_PSTRIDE		0x0334
2108c2ecf20Sopenharmony_ci#define VI6_RPF_SRCM_PSTRIDE_Y_SHIFT	16
2118c2ecf20Sopenharmony_ci#define VI6_RPF_SRCM_PSTRIDE_C_SHIFT	0
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci#define VI6_RPF_SRCM_ASTRIDE		0x0338
2148c2ecf20Sopenharmony_ci#define VI6_RPF_SRCM_PSTRIDE_A_SHIFT	0
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci#define VI6_RPF_SRCM_ADDR_Y		0x033c
2178c2ecf20Sopenharmony_ci#define VI6_RPF_SRCM_ADDR_C0		0x0340
2188c2ecf20Sopenharmony_ci#define VI6_RPF_SRCM_ADDR_C1		0x0344
2198c2ecf20Sopenharmony_ci#define VI6_RPF_SRCM_ADDR_AI		0x0348
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci#define VI6_RPF_MULT_ALPHA		0x036c
2228c2ecf20Sopenharmony_ci#define VI6_RPF_MULT_ALPHA_A_MMD_NONE	(0 << 12)
2238c2ecf20Sopenharmony_ci#define VI6_RPF_MULT_ALPHA_A_MMD_RATIO	(1 << 12)
2248c2ecf20Sopenharmony_ci#define VI6_RPF_MULT_ALPHA_P_MMD_NONE	(0 << 8)
2258c2ecf20Sopenharmony_ci#define VI6_RPF_MULT_ALPHA_P_MMD_RATIO	(1 << 8)
2268c2ecf20Sopenharmony_ci#define VI6_RPF_MULT_ALPHA_P_MMD_IMAGE	(2 << 8)
2278c2ecf20Sopenharmony_ci#define VI6_RPF_MULT_ALPHA_P_MMD_BOTH	(3 << 8)
2288c2ecf20Sopenharmony_ci#define VI6_RPF_MULT_ALPHA_RATIO_MASK	(0xff << 0)
2298c2ecf20Sopenharmony_ci#define VI6_RPF_MULT_ALPHA_RATIO_SHIFT	0
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
2328c2ecf20Sopenharmony_ci * WPF Control Registers
2338c2ecf20Sopenharmony_ci */
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ci#define VI6_WPF_OFFSET			0x100
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF			0x1000
2388c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_VIRACT_DIS	(0 << 28)
2398c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_VIRACT_SUB	(1 << 28)
2408c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_VIRACT_MST	(2 << 28)
2418c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_VIRACT_MASK	(3 << 28)
2428c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_VIRACT2_DIS	(0 << 24)
2438c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_VIRACT2_SUB	(1 << 24)
2448c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_VIRACT2_MST	(2 << 24)
2458c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_VIRACT2_MASK	(3 << 24)
2468c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_RPF_ACT_DIS(n)	(0 << ((n) * 2))
2478c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_RPF_ACT_SUB(n)	(1 << ((n) * 2))
2488c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_RPF_ACT_MST(n)	(2 << ((n) * 2))
2498c2ecf20Sopenharmony_ci#define VI6_WPF_SRCRPF_RPF_ACT_MASK(n)	(3 << ((n) * 2))
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci#define VI6_WPF_HSZCLIP			0x1004
2528c2ecf20Sopenharmony_ci#define VI6_WPF_VSZCLIP			0x1008
2538c2ecf20Sopenharmony_ci#define VI6_WPF_SZCLIP_EN		BIT(28)
2548c2ecf20Sopenharmony_ci#define VI6_WPF_SZCLIP_OFST_MASK	(0xff << 16)
2558c2ecf20Sopenharmony_ci#define VI6_WPF_SZCLIP_OFST_SHIFT	16
2568c2ecf20Sopenharmony_ci#define VI6_WPF_SZCLIP_SIZE_MASK	(0xfff << 0)
2578c2ecf20Sopenharmony_ci#define VI6_WPF_SZCLIP_SIZE_SHIFT	0
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT			0x100c
2608c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_PDV_MASK		(0xff << 24)
2618c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_PDV_SHIFT	24
2628c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_PXA		BIT(23)
2638c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_ROT		BIT(18)
2648c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_HFLP		BIT(17)
2658c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_FLP		BIT(16)
2668c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_SPYCS		BIT(15)
2678c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_SPUVS		BIT(14)
2688c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_DITH_DIS		(0 << 12)
2698c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_DITH_EN		(3 << 12)
2708c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_DITH_MASK	(3 << 12)
2718c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_WRTM_BT601	(0 << 9)
2728c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_WRTM_BT601_EXT	(1 << 9)
2738c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_WRTM_BT709	(2 << 9)
2748c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_WRTM_BT709_EXT	(3 << 9)
2758c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_WRTM_MASK	(7 << 9)
2768c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_CSC		BIT(8)
2778c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_WRFMT_MASK	(0x7f << 0)
2788c2ecf20Sopenharmony_ci#define VI6_WPF_OUTFMT_WRFMT_SHIFT	0
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci#define VI6_WPF_DSWAP			0x1010
2818c2ecf20Sopenharmony_ci#define VI6_WPF_DSWAP_P_LLS		BIT(3)
2828c2ecf20Sopenharmony_ci#define VI6_WPF_DSWAP_P_LWS		BIT(2)
2838c2ecf20Sopenharmony_ci#define VI6_WPF_DSWAP_P_WDS		BIT(1)
2848c2ecf20Sopenharmony_ci#define VI6_WPF_DSWAP_P_BTS		BIT(0)
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL			0x1014
2878c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_CBRM		BIT(28)
2888c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_ABRM_TRUNC	(0 << 24)
2898c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_ABRM_ROUND	(1 << 24)
2908c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_ABRM_THRESH	(2 << 24)
2918c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_ABRM_MASK	(3 << 24)
2928c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_ATHRESH_MASK	(0xff << 16)
2938c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_ATHRESH_SHIFT	16
2948c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_CLMD_FULL	(0 << 12)
2958c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_CLMD_CLIP	(1 << 12)
2968c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_CLMD_EXT	(2 << 12)
2978c2ecf20Sopenharmony_ci#define VI6_WPF_RNDCTRL_CLMD_MASK	(3 << 12)
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci#define VI6_WPF_ROT_CTRL		0x1018
3008c2ecf20Sopenharmony_ci#define VI6_WPF_ROT_CTRL_LN16		BIT(17)
3018c2ecf20Sopenharmony_ci#define VI6_WPF_ROT_CTRL_LMEM_WD_MASK	(0x1fff << 0)
3028c2ecf20Sopenharmony_ci#define VI6_WPF_ROT_CTRL_LMEM_WD_SHIFT	0
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci#define VI6_WPF_DSTM_STRIDE_Y		0x101c
3058c2ecf20Sopenharmony_ci#define VI6_WPF_DSTM_STRIDE_C		0x1020
3068c2ecf20Sopenharmony_ci#define VI6_WPF_DSTM_ADDR_Y		0x1024
3078c2ecf20Sopenharmony_ci#define VI6_WPF_DSTM_ADDR_C0		0x1028
3088c2ecf20Sopenharmony_ci#define VI6_WPF_DSTM_ADDR_C1		0x102c
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_ci#define VI6_WPF_WRBCK_CTRL(n)		(0x1034 + (n) * 0x100)
3118c2ecf20Sopenharmony_ci#define VI6_WPF_WRBCK_CTRL_WBMD		BIT(0)
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
3148c2ecf20Sopenharmony_ci * UIF Control Registers
3158c2ecf20Sopenharmony_ci */
3168c2ecf20Sopenharmony_ci
3178c2ecf20Sopenharmony_ci#define VI6_UIF_OFFSET			0x100
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMCR		0x1c00
3208c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMCR_CMPRU	BIT(16)
3218c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMCR_CMPR	BIT(0)
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMSTR		0x1c04
3248c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMSTR_CMPPRE	BIT(1)
3258c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMSTR_CMPST	BIT(0)
3268c2ecf20Sopenharmony_ci
3278c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMCLSTR	0x1c08
3288c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMCLSTR_CMPCLPRE	BIT(1)
3298c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMCLSTR_CMPCLST	BIT(0)
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMIENR		0x1c0c
3328c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMIENR_CMPPREIEN	BIT(1)
3338c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMIENR_CMPIEN		BIT(0)
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMMDR		0x1c10
3368c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMMDR_INTHRH(n)	((n) << 16)
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMPMR		0x1c14
3398c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMPMR_CMPDFF(n)	((n) << 17)
3408c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMPMR_CMPDFA(n)	((n) << 8)
3418c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMPMR_CMPDAUF		BIT(7)
3428c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMPMR_SEL(n)		((n) << 0)
3438c2ecf20Sopenharmony_ci
3448c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMECRCR	0x1c18
3458c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMCCRCR	0x1c1c
3468c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMSPXR		0x1c20
3478c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMSPYR		0x1c24
3488c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMSZXR		0x1c28
3498c2ecf20Sopenharmony_ci#define VI6_UIF_DISCOM_DOCMSZYR		0x1c2c
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
3528c2ecf20Sopenharmony_ci * DPR Control Registers
3538c2ecf20Sopenharmony_ci */
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci#define VI6_DPR_RPF_ROUTE(n)		(0x2000 + (n) * 4)
3568c2ecf20Sopenharmony_ci
3578c2ecf20Sopenharmony_ci#define VI6_DPR_WPF_FPORCH(n)		(0x2014 + (n) * 4)
3588c2ecf20Sopenharmony_ci#define VI6_DPR_WPF_FPORCH_FP_WPFN	(5 << 8)
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_ci#define VI6_DPR_SRU_ROUTE		0x2024
3618c2ecf20Sopenharmony_ci#define VI6_DPR_UDS_ROUTE(n)		(0x2028 + (n) * 4)
3628c2ecf20Sopenharmony_ci#define VI6_DPR_LUT_ROUTE		0x203c
3638c2ecf20Sopenharmony_ci#define VI6_DPR_CLU_ROUTE		0x2040
3648c2ecf20Sopenharmony_ci#define VI6_DPR_HST_ROUTE		0x2044
3658c2ecf20Sopenharmony_ci#define VI6_DPR_HSI_ROUTE		0x2048
3668c2ecf20Sopenharmony_ci#define VI6_DPR_BRU_ROUTE		0x204c
3678c2ecf20Sopenharmony_ci#define VI6_DPR_ILV_BRS_ROUTE		0x2050
3688c2ecf20Sopenharmony_ci#define VI6_DPR_ROUTE_BRSSEL		BIT(28)
3698c2ecf20Sopenharmony_ci#define VI6_DPR_ROUTE_FXA_MASK		(0xff << 16)
3708c2ecf20Sopenharmony_ci#define VI6_DPR_ROUTE_FXA_SHIFT		16
3718c2ecf20Sopenharmony_ci#define VI6_DPR_ROUTE_FP_MASK		(0x3f << 8)
3728c2ecf20Sopenharmony_ci#define VI6_DPR_ROUTE_FP_SHIFT		8
3738c2ecf20Sopenharmony_ci#define VI6_DPR_ROUTE_RT_MASK		(0x3f << 0)
3748c2ecf20Sopenharmony_ci#define VI6_DPR_ROUTE_RT_SHIFT		0
3758c2ecf20Sopenharmony_ci
3768c2ecf20Sopenharmony_ci#define VI6_DPR_HGO_SMPPT		0x2054
3778c2ecf20Sopenharmony_ci#define VI6_DPR_HGT_SMPPT		0x2058
3788c2ecf20Sopenharmony_ci#define VI6_DPR_SMPPT_TGW_MASK		(7 << 8)
3798c2ecf20Sopenharmony_ci#define VI6_DPR_SMPPT_TGW_SHIFT		8
3808c2ecf20Sopenharmony_ci#define VI6_DPR_SMPPT_PT_MASK		(0x3f << 0)
3818c2ecf20Sopenharmony_ci#define VI6_DPR_SMPPT_PT_SHIFT		0
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_ci#define VI6_DPR_UIF_ROUTE(n)		(0x2074 + (n) * 4)
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_RPF(n)		(n)
3868c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_UIF(n)		(12 + (n))
3878c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_SRU		16
3888c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_UDS(n)		(17 + (n))
3898c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_LUT		22
3908c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_BRU_IN(n)		(((n) <= 3) ? 23 + (n) : 49)
3918c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_BRU_OUT		27
3928c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_CLU		29
3938c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_HST		30
3948c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_HSI		31
3958c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_BRS_IN(n)		(38 + (n))
3968c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_LIF		55		/* Gen2 only */
3978c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_WPF(n)		(56 + (n))
3988c2ecf20Sopenharmony_ci#define VI6_DPR_NODE_UNUSED		63
3998c2ecf20Sopenharmony_ci
4008c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
4018c2ecf20Sopenharmony_ci * SRU Control Registers
4028c2ecf20Sopenharmony_ci */
4038c2ecf20Sopenharmony_ci
4048c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0			0x2200
4058c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0_PARAM0_MASK	(0x1ff << 16)
4068c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0_PARAM0_SHIFT	16
4078c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0_PARAM1_MASK	(0x1f << 8)
4088c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0_PARAM1_SHIFT	8
4098c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0_MODE_UPSCALE	(4 << 4)
4108c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0_PARAM2		BIT(3)
4118c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0_PARAM3		BIT(2)
4128c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0_PARAM4		BIT(1)
4138c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL0_EN		BIT(0)
4148c2ecf20Sopenharmony_ci
4158c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL1			0x2204
4168c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL1_PARAM5		0x7ff
4178c2ecf20Sopenharmony_ci
4188c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL2			0x2208
4198c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL2_PARAM6_SHIFT	16
4208c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL2_PARAM7_SHIFT	8
4218c2ecf20Sopenharmony_ci#define VI6_SRU_CTRL2_PARAM8_SHIFT	0
4228c2ecf20Sopenharmony_ci
4238c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
4248c2ecf20Sopenharmony_ci * UDS Control Registers
4258c2ecf20Sopenharmony_ci */
4268c2ecf20Sopenharmony_ci
4278c2ecf20Sopenharmony_ci#define VI6_UDS_OFFSET			0x100
4288c2ecf20Sopenharmony_ci
4298c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL			0x2300
4308c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_AMD		BIT(30)
4318c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_FMD		BIT(29)
4328c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_BLADV		BIT(28)
4338c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_AON		BIT(25)
4348c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_ATHON		BIT(24)
4358c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_BC			BIT(20)
4368c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_NE_A		BIT(19)
4378c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_NE_RCR		BIT(18)
4388c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_NE_GY		BIT(17)
4398c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_NE_BCB		BIT(16)
4408c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_AMDSLH		BIT(2)
4418c2ecf20Sopenharmony_ci#define VI6_UDS_CTRL_TDIPC		BIT(1)
4428c2ecf20Sopenharmony_ci
4438c2ecf20Sopenharmony_ci#define VI6_UDS_SCALE			0x2304
4448c2ecf20Sopenharmony_ci#define VI6_UDS_SCALE_HMANT_MASK	(0xf << 28)
4458c2ecf20Sopenharmony_ci#define VI6_UDS_SCALE_HMANT_SHIFT	28
4468c2ecf20Sopenharmony_ci#define VI6_UDS_SCALE_HFRAC_MASK	(0xfff << 16)
4478c2ecf20Sopenharmony_ci#define VI6_UDS_SCALE_HFRAC_SHIFT	16
4488c2ecf20Sopenharmony_ci#define VI6_UDS_SCALE_VMANT_MASK	(0xf << 12)
4498c2ecf20Sopenharmony_ci#define VI6_UDS_SCALE_VMANT_SHIFT	12
4508c2ecf20Sopenharmony_ci#define VI6_UDS_SCALE_VFRAC_MASK	(0xfff << 0)
4518c2ecf20Sopenharmony_ci#define VI6_UDS_SCALE_VFRAC_SHIFT	0
4528c2ecf20Sopenharmony_ci
4538c2ecf20Sopenharmony_ci#define VI6_UDS_ALPTH			0x2308
4548c2ecf20Sopenharmony_ci#define VI6_UDS_ALPTH_TH1_MASK		(0xff << 8)
4558c2ecf20Sopenharmony_ci#define VI6_UDS_ALPTH_TH1_SHIFT		8
4568c2ecf20Sopenharmony_ci#define VI6_UDS_ALPTH_TH0_MASK		(0xff << 0)
4578c2ecf20Sopenharmony_ci#define VI6_UDS_ALPTH_TH0_SHIFT		0
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_ci#define VI6_UDS_ALPVAL			0x230c
4608c2ecf20Sopenharmony_ci#define VI6_UDS_ALPVAL_VAL2_MASK	(0xff << 16)
4618c2ecf20Sopenharmony_ci#define VI6_UDS_ALPVAL_VAL2_SHIFT	16
4628c2ecf20Sopenharmony_ci#define VI6_UDS_ALPVAL_VAL1_MASK	(0xff << 8)
4638c2ecf20Sopenharmony_ci#define VI6_UDS_ALPVAL_VAL1_SHIFT	8
4648c2ecf20Sopenharmony_ci#define VI6_UDS_ALPVAL_VAL0_MASK	(0xff << 0)
4658c2ecf20Sopenharmony_ci#define VI6_UDS_ALPVAL_VAL0_SHIFT	0
4668c2ecf20Sopenharmony_ci
4678c2ecf20Sopenharmony_ci#define VI6_UDS_PASS_BWIDTH		0x2310
4688c2ecf20Sopenharmony_ci#define VI6_UDS_PASS_BWIDTH_H_MASK	(0x7f << 16)
4698c2ecf20Sopenharmony_ci#define VI6_UDS_PASS_BWIDTH_H_SHIFT	16
4708c2ecf20Sopenharmony_ci#define VI6_UDS_PASS_BWIDTH_V_MASK	(0x7f << 0)
4718c2ecf20Sopenharmony_ci#define VI6_UDS_PASS_BWIDTH_V_SHIFT	0
4728c2ecf20Sopenharmony_ci
4738c2ecf20Sopenharmony_ci#define VI6_UDS_HPHASE			0x2314
4748c2ecf20Sopenharmony_ci#define VI6_UDS_HPHASE_HSTP_MASK	(0xfff << 16)
4758c2ecf20Sopenharmony_ci#define VI6_UDS_HPHASE_HSTP_SHIFT	16
4768c2ecf20Sopenharmony_ci#define VI6_UDS_HPHASE_HEDP_MASK	(0xfff << 0)
4778c2ecf20Sopenharmony_ci#define VI6_UDS_HPHASE_HEDP_SHIFT	0
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_ci#define VI6_UDS_IPC			0x2318
4808c2ecf20Sopenharmony_ci#define VI6_UDS_IPC_FIELD		BIT(27)
4818c2ecf20Sopenharmony_ci#define VI6_UDS_IPC_VEDP_MASK		(0xfff << 0)
4828c2ecf20Sopenharmony_ci#define VI6_UDS_IPC_VEDP_SHIFT		0
4838c2ecf20Sopenharmony_ci
4848c2ecf20Sopenharmony_ci#define VI6_UDS_HSZCLIP			0x231c
4858c2ecf20Sopenharmony_ci#define VI6_UDS_HSZCLIP_HCEN		BIT(28)
4868c2ecf20Sopenharmony_ci#define VI6_UDS_HSZCLIP_HCL_OFST_MASK	(0xff << 16)
4878c2ecf20Sopenharmony_ci#define VI6_UDS_HSZCLIP_HCL_OFST_SHIFT	16
4888c2ecf20Sopenharmony_ci#define VI6_UDS_HSZCLIP_HCL_SIZE_MASK	(0x1fff << 0)
4898c2ecf20Sopenharmony_ci#define VI6_UDS_HSZCLIP_HCL_SIZE_SHIFT	0
4908c2ecf20Sopenharmony_ci
4918c2ecf20Sopenharmony_ci#define VI6_UDS_CLIP_SIZE		0x2324
4928c2ecf20Sopenharmony_ci#define VI6_UDS_CLIP_SIZE_HSIZE_MASK	(0x1fff << 16)
4938c2ecf20Sopenharmony_ci#define VI6_UDS_CLIP_SIZE_HSIZE_SHIFT	16
4948c2ecf20Sopenharmony_ci#define VI6_UDS_CLIP_SIZE_VSIZE_MASK	(0x1fff << 0)
4958c2ecf20Sopenharmony_ci#define VI6_UDS_CLIP_SIZE_VSIZE_SHIFT	0
4968c2ecf20Sopenharmony_ci
4978c2ecf20Sopenharmony_ci#define VI6_UDS_FILL_COLOR		0x2328
4988c2ecf20Sopenharmony_ci#define VI6_UDS_FILL_COLOR_RFILC_MASK	(0xff << 16)
4998c2ecf20Sopenharmony_ci#define VI6_UDS_FILL_COLOR_RFILC_SHIFT	16
5008c2ecf20Sopenharmony_ci#define VI6_UDS_FILL_COLOR_GFILC_MASK	(0xff << 8)
5018c2ecf20Sopenharmony_ci#define VI6_UDS_FILL_COLOR_GFILC_SHIFT	8
5028c2ecf20Sopenharmony_ci#define VI6_UDS_FILL_COLOR_BFILC_MASK	(0xff << 0)
5038c2ecf20Sopenharmony_ci#define VI6_UDS_FILL_COLOR_BFILC_SHIFT	0
5048c2ecf20Sopenharmony_ci
5058c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
5068c2ecf20Sopenharmony_ci * LUT Control Registers
5078c2ecf20Sopenharmony_ci */
5088c2ecf20Sopenharmony_ci
5098c2ecf20Sopenharmony_ci#define VI6_LUT_CTRL			0x2800
5108c2ecf20Sopenharmony_ci#define VI6_LUT_CTRL_EN			BIT(0)
5118c2ecf20Sopenharmony_ci
5128c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
5138c2ecf20Sopenharmony_ci * CLU Control Registers
5148c2ecf20Sopenharmony_ci */
5158c2ecf20Sopenharmony_ci
5168c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL			0x2900
5178c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL_AAI		BIT(28)
5188c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL_MVS		BIT(24)
5198c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL_AX1I_2D		(3 << 14)
5208c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL_AX2I_2D		(1 << 12)
5218c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL_OS0_2D		(3 << 8)
5228c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL_OS1_2D		(1 << 6)
5238c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL_OS2_2D		(3 << 4)
5248c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL_M2D		BIT(1)
5258c2ecf20Sopenharmony_ci#define VI6_CLU_CTRL_EN			BIT(0)
5268c2ecf20Sopenharmony_ci
5278c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
5288c2ecf20Sopenharmony_ci * HST Control Registers
5298c2ecf20Sopenharmony_ci */
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci#define VI6_HST_CTRL			0x2a00
5328c2ecf20Sopenharmony_ci#define VI6_HST_CTRL_EN			BIT(0)
5338c2ecf20Sopenharmony_ci
5348c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
5358c2ecf20Sopenharmony_ci * HSI Control Registers
5368c2ecf20Sopenharmony_ci */
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci#define VI6_HSI_CTRL			0x2b00
5398c2ecf20Sopenharmony_ci#define VI6_HSI_CTRL_EN			BIT(0)
5408c2ecf20Sopenharmony_ci
5418c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
5428c2ecf20Sopenharmony_ci * BRS and BRU Control Registers
5438c2ecf20Sopenharmony_ci */
5448c2ecf20Sopenharmony_ci
5458c2ecf20Sopenharmony_ci#define VI6_ROP_NOP			0
5468c2ecf20Sopenharmony_ci#define VI6_ROP_AND			1
5478c2ecf20Sopenharmony_ci#define VI6_ROP_AND_REV			2
5488c2ecf20Sopenharmony_ci#define VI6_ROP_COPY			3
5498c2ecf20Sopenharmony_ci#define VI6_ROP_AND_INV			4
5508c2ecf20Sopenharmony_ci#define VI6_ROP_CLEAR			5
5518c2ecf20Sopenharmony_ci#define VI6_ROP_XOR			6
5528c2ecf20Sopenharmony_ci#define VI6_ROP_OR			7
5538c2ecf20Sopenharmony_ci#define VI6_ROP_NOR			8
5548c2ecf20Sopenharmony_ci#define VI6_ROP_EQUIV			9
5558c2ecf20Sopenharmony_ci#define VI6_ROP_INVERT			10
5568c2ecf20Sopenharmony_ci#define VI6_ROP_OR_REV			11
5578c2ecf20Sopenharmony_ci#define VI6_ROP_COPY_INV		12
5588c2ecf20Sopenharmony_ci#define VI6_ROP_OR_INV			13
5598c2ecf20Sopenharmony_ci#define VI6_ROP_NAND			14
5608c2ecf20Sopenharmony_ci#define VI6_ROP_SET			15
5618c2ecf20Sopenharmony_ci
5628c2ecf20Sopenharmony_ci#define VI6_BRU_BASE			0x2c00
5638c2ecf20Sopenharmony_ci#define VI6_BRS_BASE			0x3900
5648c2ecf20Sopenharmony_ci
5658c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL			0x0000
5668c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_NRM		BIT(28)
5678c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_DnON		(1 << (16 + (n)))
5688c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_DITHn_OFF	(0 << ((n) * 4))
5698c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_DITHn_18BPP	(1 << ((n) * 4))
5708c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_DITHn_16BPP	(2 << ((n) * 4))
5718c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_DITHn_15BPP	(3 << ((n) * 4))
5728c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_DITHn_12BPP	(4 << ((n) * 4))
5738c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_DITHn_8BPP	(5 << ((n) * 4))
5748c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_DITHn_MASK	(7 << ((n) * 4))
5758c2ecf20Sopenharmony_ci#define VI6_BRU_INCTRL_DITHn_SHIFT	((n) * 4)
5768c2ecf20Sopenharmony_ci
5778c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_SIZE		0x0004
5788c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_SIZE_HSIZE_MASK	(0x1fff << 16)
5798c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_SIZE_HSIZE_SHIFT	16
5808c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_SIZE_VSIZE_MASK	(0x1fff << 0)
5818c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_SIZE_VSIZE_SHIFT	0
5828c2ecf20Sopenharmony_ci
5838c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_LOC		0x0008
5848c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_LOC_HCOORD_MASK	(0x1fff << 16)
5858c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_LOC_HCOORD_SHIFT	16
5868c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_LOC_VCOORD_MASK	(0x1fff << 0)
5878c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_LOC_VCOORD_SHIFT	0
5888c2ecf20Sopenharmony_ci
5898c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_COL		0x000c
5908c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_COL_A_MASK	(0xff << 24)
5918c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_COL_A_SHIFT	24
5928c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_COL_RCR_MASK	(0xff << 16)
5938c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_COL_RCR_SHIFT	16
5948c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_COL_GY_MASK	(0xff << 8)
5958c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_COL_GY_SHIFT	8
5968c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_COL_BCB_MASK	(0xff << 0)
5978c2ecf20Sopenharmony_ci#define VI6_BRU_VIRRPF_COL_BCB_SHIFT	0
5988c2ecf20Sopenharmony_ci
5998c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL(n)			(0x0010 + (n) * 8 + ((n) <= 3 ? 0 : 4))
6008c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_RBC		BIT(31)
6018c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_DSTSEL_BRUIN(n)	(((n) <= 3 ? (n) : (n)+1) << 20)
6028c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_DSTSEL_VRPF	(4 << 20)
6038c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_DSTSEL_MASK	(7 << 20)
6048c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_SRCSEL_BRUIN(n)	(((n) <= 3 ? (n) : (n)+1) << 16)
6058c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_SRCSEL_VRPF	(4 << 16)
6068c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_SRCSEL_MASK	(7 << 16)
6078c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_CROP(rop)		((rop) << 4)
6088c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_CROP_MASK		(0xf << 4)
6098c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_AROP(rop)		((rop) << 0)
6108c2ecf20Sopenharmony_ci#define VI6_BRU_CTRL_AROP_MASK		(0xf << 0)
6118c2ecf20Sopenharmony_ci
6128c2ecf20Sopenharmony_ci#define VI6_BRU_BLD(n)			(0x0014 + (n) * 8 + ((n) <= 3 ? 0 : 4))
6138c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CBES		BIT(31)
6148c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDX_DST_A		(0 << 28)
6158c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDX_255_DST_A	(1 << 28)
6168c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDX_SRC_A		(2 << 28)
6178c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDX_255_SRC_A	(3 << 28)
6188c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDX_COEFX		(4 << 28)
6198c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDX_MASK		(7 << 28)
6208c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDY_DST_A		(0 << 24)
6218c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDY_255_DST_A	(1 << 24)
6228c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDY_SRC_A		(2 << 24)
6238c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDY_255_SRC_A	(3 << 24)
6248c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDY_COEFY		(4 << 24)
6258c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDY_MASK		(7 << 24)
6268c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_CCMDY_SHIFT		24
6278c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ABES		BIT(23)
6288c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDX_DST_A		(0 << 20)
6298c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDX_255_DST_A	(1 << 20)
6308c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDX_SRC_A		(2 << 20)
6318c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDX_255_SRC_A	(3 << 20)
6328c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDX_COEFX		(4 << 20)
6338c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDX_MASK		(7 << 20)
6348c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDY_DST_A		(0 << 16)
6358c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDY_255_DST_A	(1 << 16)
6368c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDY_SRC_A		(2 << 16)
6378c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDY_255_SRC_A	(3 << 16)
6388c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDY_COEFY		(4 << 16)
6398c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_ACMDY_MASK		(7 << 16)
6408c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_COEFX_MASK		(0xff << 8)
6418c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_COEFX_SHIFT		8
6428c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_COEFY_MASK		(0xff << 0)
6438c2ecf20Sopenharmony_ci#define VI6_BRU_BLD_COEFY_SHIFT		0
6448c2ecf20Sopenharmony_ci
6458c2ecf20Sopenharmony_ci#define VI6_BRU_ROP			0x0030	/* Only available on BRU */
6468c2ecf20Sopenharmony_ci#define VI6_BRU_ROP_DSTSEL_BRUIN(n)	(((n) <= 3 ? (n) : (n)+1) << 20)
6478c2ecf20Sopenharmony_ci#define VI6_BRU_ROP_DSTSEL_VRPF		(4 << 20)
6488c2ecf20Sopenharmony_ci#define VI6_BRU_ROP_DSTSEL_MASK		(7 << 20)
6498c2ecf20Sopenharmony_ci#define VI6_BRU_ROP_CROP(rop)		((rop) << 4)
6508c2ecf20Sopenharmony_ci#define VI6_BRU_ROP_CROP_MASK		(0xf << 4)
6518c2ecf20Sopenharmony_ci#define VI6_BRU_ROP_AROP(rop)		((rop) << 0)
6528c2ecf20Sopenharmony_ci#define VI6_BRU_ROP_AROP_MASK		(0xf << 0)
6538c2ecf20Sopenharmony_ci
6548c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
6558c2ecf20Sopenharmony_ci * HGO Control Registers
6568c2ecf20Sopenharmony_ci */
6578c2ecf20Sopenharmony_ci
6588c2ecf20Sopenharmony_ci#define VI6_HGO_OFFSET			0x3000
6598c2ecf20Sopenharmony_ci#define VI6_HGO_OFFSET_HOFFSET_SHIFT	16
6608c2ecf20Sopenharmony_ci#define VI6_HGO_OFFSET_VOFFSET_SHIFT	0
6618c2ecf20Sopenharmony_ci#define VI6_HGO_SIZE			0x3004
6628c2ecf20Sopenharmony_ci#define VI6_HGO_SIZE_HSIZE_SHIFT	16
6638c2ecf20Sopenharmony_ci#define VI6_HGO_SIZE_VSIZE_SHIFT	0
6648c2ecf20Sopenharmony_ci#define VI6_HGO_MODE			0x3008
6658c2ecf20Sopenharmony_ci#define VI6_HGO_MODE_STEP		BIT(10)
6668c2ecf20Sopenharmony_ci#define VI6_HGO_MODE_MAXRGB		BIT(7)
6678c2ecf20Sopenharmony_ci#define VI6_HGO_MODE_OFSB_R		BIT(6)
6688c2ecf20Sopenharmony_ci#define VI6_HGO_MODE_OFSB_G		BIT(5)
6698c2ecf20Sopenharmony_ci#define VI6_HGO_MODE_OFSB_B		BIT(4)
6708c2ecf20Sopenharmony_ci#define VI6_HGO_MODE_HRATIO_SHIFT	2
6718c2ecf20Sopenharmony_ci#define VI6_HGO_MODE_VRATIO_SHIFT	0
6728c2ecf20Sopenharmony_ci#define VI6_HGO_LB_TH			0x300c
6738c2ecf20Sopenharmony_ci#define VI6_HGO_LBn_H(n)		(0x3010 + (n) * 8)
6748c2ecf20Sopenharmony_ci#define VI6_HGO_LBn_V(n)		(0x3014 + (n) * 8)
6758c2ecf20Sopenharmony_ci#define VI6_HGO_R_HISTO(n)		(0x3030 + (n) * 4)
6768c2ecf20Sopenharmony_ci#define VI6_HGO_R_MAXMIN		0x3130
6778c2ecf20Sopenharmony_ci#define VI6_HGO_R_SUM			0x3134
6788c2ecf20Sopenharmony_ci#define VI6_HGO_R_LB_DET		0x3138
6798c2ecf20Sopenharmony_ci#define VI6_HGO_G_HISTO(n)		(0x3140 + (n) * 4)
6808c2ecf20Sopenharmony_ci#define VI6_HGO_G_MAXMIN		0x3240
6818c2ecf20Sopenharmony_ci#define VI6_HGO_G_SUM			0x3244
6828c2ecf20Sopenharmony_ci#define VI6_HGO_G_LB_DET		0x3248
6838c2ecf20Sopenharmony_ci#define VI6_HGO_B_HISTO(n)		(0x3250 + (n) * 4)
6848c2ecf20Sopenharmony_ci#define VI6_HGO_B_MAXMIN		0x3350
6858c2ecf20Sopenharmony_ci#define VI6_HGO_B_SUM			0x3354
6868c2ecf20Sopenharmony_ci#define VI6_HGO_B_LB_DET		0x3358
6878c2ecf20Sopenharmony_ci#define VI6_HGO_EXT_HIST_ADDR		0x335c
6888c2ecf20Sopenharmony_ci#define VI6_HGO_EXT_HIST_DATA		0x3360
6898c2ecf20Sopenharmony_ci#define VI6_HGO_REGRST			0x33fc
6908c2ecf20Sopenharmony_ci#define VI6_HGO_REGRST_RCLEA		BIT(0)
6918c2ecf20Sopenharmony_ci
6928c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
6938c2ecf20Sopenharmony_ci * HGT Control Registers
6948c2ecf20Sopenharmony_ci */
6958c2ecf20Sopenharmony_ci
6968c2ecf20Sopenharmony_ci#define VI6_HGT_OFFSET			0x3400
6978c2ecf20Sopenharmony_ci#define VI6_HGT_OFFSET_HOFFSET_SHIFT	16
6988c2ecf20Sopenharmony_ci#define VI6_HGT_OFFSET_VOFFSET_SHIFT	0
6998c2ecf20Sopenharmony_ci#define VI6_HGT_SIZE			0x3404
7008c2ecf20Sopenharmony_ci#define VI6_HGT_SIZE_HSIZE_SHIFT	16
7018c2ecf20Sopenharmony_ci#define VI6_HGT_SIZE_VSIZE_SHIFT	0
7028c2ecf20Sopenharmony_ci#define VI6_HGT_MODE			0x3408
7038c2ecf20Sopenharmony_ci#define VI6_HGT_MODE_HRATIO_SHIFT	2
7048c2ecf20Sopenharmony_ci#define VI6_HGT_MODE_VRATIO_SHIFT	0
7058c2ecf20Sopenharmony_ci#define VI6_HGT_HUE_AREA(n)		(0x340c + (n) * 4)
7068c2ecf20Sopenharmony_ci#define VI6_HGT_HUE_AREA_LOWER_SHIFT	16
7078c2ecf20Sopenharmony_ci#define VI6_HGT_HUE_AREA_UPPER_SHIFT	0
7088c2ecf20Sopenharmony_ci#define VI6_HGT_LB_TH			0x3424
7098c2ecf20Sopenharmony_ci#define VI6_HGT_LBn_H(n)		(0x3428 + (n) * 8)
7108c2ecf20Sopenharmony_ci#define VI6_HGT_LBn_V(n)		(0x342c + (n) * 8)
7118c2ecf20Sopenharmony_ci#define VI6_HGT_HISTO(m, n)		(0x3450 + (m) * 128 + (n) * 4)
7128c2ecf20Sopenharmony_ci#define VI6_HGT_MAXMIN			0x3750
7138c2ecf20Sopenharmony_ci#define VI6_HGT_SUM			0x3754
7148c2ecf20Sopenharmony_ci#define VI6_HGT_LB_DET			0x3758
7158c2ecf20Sopenharmony_ci#define VI6_HGT_REGRST			0x37fc
7168c2ecf20Sopenharmony_ci#define VI6_HGT_REGRST_RCLEA		BIT(0)
7178c2ecf20Sopenharmony_ci
7188c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
7198c2ecf20Sopenharmony_ci * LIF Control Registers
7208c2ecf20Sopenharmony_ci */
7218c2ecf20Sopenharmony_ci
7228c2ecf20Sopenharmony_ci#define VI6_LIF_OFFSET			(-0x100)
7238c2ecf20Sopenharmony_ci
7248c2ecf20Sopenharmony_ci#define VI6_LIF_CTRL			0x3b00
7258c2ecf20Sopenharmony_ci#define VI6_LIF_CTRL_OBTH_MASK		(0x7ff << 16)
7268c2ecf20Sopenharmony_ci#define VI6_LIF_CTRL_OBTH_SHIFT		16
7278c2ecf20Sopenharmony_ci#define VI6_LIF_CTRL_CFMT		BIT(4)
7288c2ecf20Sopenharmony_ci#define VI6_LIF_CTRL_REQSEL		BIT(1)
7298c2ecf20Sopenharmony_ci#define VI6_LIF_CTRL_LIF_EN		BIT(0)
7308c2ecf20Sopenharmony_ci
7318c2ecf20Sopenharmony_ci#define VI6_LIF_CSBTH			0x3b04
7328c2ecf20Sopenharmony_ci#define VI6_LIF_CSBTH_HBTH_MASK		(0x7ff << 16)
7338c2ecf20Sopenharmony_ci#define VI6_LIF_CSBTH_HBTH_SHIFT	16
7348c2ecf20Sopenharmony_ci#define VI6_LIF_CSBTH_LBTH_MASK		(0x7ff << 0)
7358c2ecf20Sopenharmony_ci#define VI6_LIF_CSBTH_LBTH_SHIFT	0
7368c2ecf20Sopenharmony_ci
7378c2ecf20Sopenharmony_ci#define VI6_LIF_LBA			0x3b0c
7388c2ecf20Sopenharmony_ci#define VI6_LIF_LBA_LBA0		BIT(31)
7398c2ecf20Sopenharmony_ci#define VI6_LIF_LBA_LBA1_MASK		(0xfff << 16)
7408c2ecf20Sopenharmony_ci#define VI6_LIF_LBA_LBA1_SHIFT		16
7418c2ecf20Sopenharmony_ci
7428c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
7438c2ecf20Sopenharmony_ci * Security Control Registers
7448c2ecf20Sopenharmony_ci */
7458c2ecf20Sopenharmony_ci
7468c2ecf20Sopenharmony_ci#define VI6_SECURITY_CTRL0		0x3d00
7478c2ecf20Sopenharmony_ci#define VI6_SECURITY_CTRL1		0x3d04
7488c2ecf20Sopenharmony_ci
7498c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
7508c2ecf20Sopenharmony_ci * IP Version Registers
7518c2ecf20Sopenharmony_ci */
7528c2ecf20Sopenharmony_ci
7538c2ecf20Sopenharmony_ci#define VI6_IP_VERSION			0x3f00
7548c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MASK		(0xffff << 0)
7558c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_MASK	(0xff << 8)
7568c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPS_H2	(0x09 << 8)
7578c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPR_H2	(0x0a << 8)
7588c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPD_GEN2	(0x0b << 8)
7598c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPS_M2	(0x0c << 8)
7608c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPS_V2H	(0x12 << 8)
7618c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPD_V2H	(0x13 << 8)
7628c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPI_GEN3	(0x14 << 8)
7638c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPBD_GEN3	(0x15 << 8)
7648c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPBC_GEN3	(0x16 << 8)
7658c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPD_GEN3	(0x17 << 8)
7668c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPD_V3	(0x18 << 8)
7678c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPDL_GEN3	(0x19 << 8)
7688c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_MODEL_VSPBS_GEN3	(0x1a << 8)
7698c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_MASK		(0xff << 0)
7708c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_H2		(0x01 << 0)
7718c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_V2H		(0x01 << 0)
7728c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_V3M		(0x01 << 0)
7738c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_M2		(0x02 << 0)
7748c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_M3W		(0x02 << 0)
7758c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_V3H		(0x02 << 0)
7768c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_H3		(0x03 << 0)
7778c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_D3		(0x04 << 0)
7788c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_M3N		(0x04 << 0)
7798c2ecf20Sopenharmony_ci#define VI6_IP_VERSION_SOC_E3		(0x04 << 0)
7808c2ecf20Sopenharmony_ci
7818c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
7828c2ecf20Sopenharmony_ci * RPF CLUT Registers
7838c2ecf20Sopenharmony_ci */
7848c2ecf20Sopenharmony_ci
7858c2ecf20Sopenharmony_ci#define VI6_CLUT_TABLE			0x4000
7868c2ecf20Sopenharmony_ci
7878c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
7888c2ecf20Sopenharmony_ci * 1D LUT Registers
7898c2ecf20Sopenharmony_ci */
7908c2ecf20Sopenharmony_ci
7918c2ecf20Sopenharmony_ci#define VI6_LUT_TABLE			0x7000
7928c2ecf20Sopenharmony_ci
7938c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
7948c2ecf20Sopenharmony_ci * 3D LUT Registers
7958c2ecf20Sopenharmony_ci */
7968c2ecf20Sopenharmony_ci
7978c2ecf20Sopenharmony_ci#define VI6_CLU_ADDR			0x7400
7988c2ecf20Sopenharmony_ci#define VI6_CLU_DATA			0x7404
7998c2ecf20Sopenharmony_ci
8008c2ecf20Sopenharmony_ci/* -----------------------------------------------------------------------------
8018c2ecf20Sopenharmony_ci * Formats
8028c2ecf20Sopenharmony_ci */
8038c2ecf20Sopenharmony_ci
8048c2ecf20Sopenharmony_ci#define VI6_FMT_RGB_332			0x00
8058c2ecf20Sopenharmony_ci#define VI6_FMT_XRGB_4444		0x01
8068c2ecf20Sopenharmony_ci#define VI6_FMT_RGBX_4444		0x02
8078c2ecf20Sopenharmony_ci#define VI6_FMT_XRGB_1555		0x04
8088c2ecf20Sopenharmony_ci#define VI6_FMT_RGBX_5551		0x05
8098c2ecf20Sopenharmony_ci#define VI6_FMT_RGB_565			0x06
8108c2ecf20Sopenharmony_ci#define VI6_FMT_AXRGB_86666		0x07
8118c2ecf20Sopenharmony_ci#define VI6_FMT_RGBXA_66668		0x08
8128c2ecf20Sopenharmony_ci#define VI6_FMT_XRGBA_66668		0x09
8138c2ecf20Sopenharmony_ci#define VI6_FMT_ARGBX_86666		0x0a
8148c2ecf20Sopenharmony_ci#define VI6_FMT_AXRXGXB_8262626		0x0b
8158c2ecf20Sopenharmony_ci#define VI6_FMT_XRXGXBA_2626268		0x0c
8168c2ecf20Sopenharmony_ci#define VI6_FMT_ARXGXBX_8626262		0x0d
8178c2ecf20Sopenharmony_ci#define VI6_FMT_RXGXBXA_6262628		0x0e
8188c2ecf20Sopenharmony_ci#define VI6_FMT_XRGB_6666		0x0f
8198c2ecf20Sopenharmony_ci#define VI6_FMT_RGBX_6666		0x10
8208c2ecf20Sopenharmony_ci#define VI6_FMT_XRXGXB_262626		0x11
8218c2ecf20Sopenharmony_ci#define VI6_FMT_RXGXBX_626262		0x12
8228c2ecf20Sopenharmony_ci#define VI6_FMT_ARGB_8888		0x13
8238c2ecf20Sopenharmony_ci#define VI6_FMT_RGBA_8888		0x14
8248c2ecf20Sopenharmony_ci#define VI6_FMT_RGB_888			0x15
8258c2ecf20Sopenharmony_ci#define VI6_FMT_XRGXGB_763763		0x16
8268c2ecf20Sopenharmony_ci#define VI6_FMT_XXRGB_86666		0x17
8278c2ecf20Sopenharmony_ci#define VI6_FMT_BGR_888			0x18
8288c2ecf20Sopenharmony_ci#define VI6_FMT_ARGB_4444		0x19
8298c2ecf20Sopenharmony_ci#define VI6_FMT_RGBA_4444		0x1a
8308c2ecf20Sopenharmony_ci#define VI6_FMT_ARGB_1555		0x1b
8318c2ecf20Sopenharmony_ci#define VI6_FMT_RGBA_5551		0x1c
8328c2ecf20Sopenharmony_ci#define VI6_FMT_ABGR_4444		0x1d
8338c2ecf20Sopenharmony_ci#define VI6_FMT_BGRA_4444		0x1e
8348c2ecf20Sopenharmony_ci#define VI6_FMT_ABGR_1555		0x1f
8358c2ecf20Sopenharmony_ci#define VI6_FMT_BGRA_5551		0x20
8368c2ecf20Sopenharmony_ci#define VI6_FMT_XBXGXR_262626		0x21
8378c2ecf20Sopenharmony_ci#define VI6_FMT_ABGR_8888		0x22
8388c2ecf20Sopenharmony_ci#define VI6_FMT_XXRGB_88565		0x23
8398c2ecf20Sopenharmony_ci
8408c2ecf20Sopenharmony_ci#define VI6_FMT_Y_UV_444		0x40
8418c2ecf20Sopenharmony_ci#define VI6_FMT_Y_UV_422		0x41
8428c2ecf20Sopenharmony_ci#define VI6_FMT_Y_UV_420		0x42
8438c2ecf20Sopenharmony_ci#define VI6_FMT_YUV_444			0x46
8448c2ecf20Sopenharmony_ci#define VI6_FMT_YUYV_422		0x47
8458c2ecf20Sopenharmony_ci#define VI6_FMT_YYUV_422		0x48
8468c2ecf20Sopenharmony_ci#define VI6_FMT_YUV_420			0x49
8478c2ecf20Sopenharmony_ci#define VI6_FMT_Y_U_V_444		0x4a
8488c2ecf20Sopenharmony_ci#define VI6_FMT_Y_U_V_422		0x4b
8498c2ecf20Sopenharmony_ci#define VI6_FMT_Y_U_V_420		0x4c
8508c2ecf20Sopenharmony_ci
8518c2ecf20Sopenharmony_ci#endif /* __VSP1_REGS_H__ */
852