162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2022 Marek Vasut <marex@denx.de>
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * i.MX8MP/i.MXRT LCDIF LCD controller driver.
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#ifndef __LCDIF_REGS_H__
962306a36Sopenharmony_ci#define __LCDIF_REGS_H__
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#define REG_SET	4
1262306a36Sopenharmony_ci#define REG_CLR	8
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci/* V8 register set */
1562306a36Sopenharmony_ci#define LCDC_V8_CTRL			0x00
1662306a36Sopenharmony_ci#define LCDC_V8_DISP_PARA		0x10
1762306a36Sopenharmony_ci#define LCDC_V8_DISP_SIZE		0x14
1862306a36Sopenharmony_ci#define LCDC_V8_HSYN_PARA		0x18
1962306a36Sopenharmony_ci#define LCDC_V8_VSYN_PARA		0x1c
2062306a36Sopenharmony_ci#define LCDC_V8_VSYN_HSYN_WIDTH		0x20
2162306a36Sopenharmony_ci#define LCDC_V8_INT_STATUS_D0		0x24
2262306a36Sopenharmony_ci#define LCDC_V8_INT_ENABLE_D0		0x28
2362306a36Sopenharmony_ci#define LCDC_V8_INT_STATUS_D1		0x30
2462306a36Sopenharmony_ci#define LCDC_V8_INT_ENABLE_D1		0x34
2562306a36Sopenharmony_ci#define LCDC_V8_CTRLDESCL0_1		0x200
2662306a36Sopenharmony_ci#define LCDC_V8_CTRLDESCL0_3		0x208
2762306a36Sopenharmony_ci#define LCDC_V8_CTRLDESCL_LOW0_4	0x20c
2862306a36Sopenharmony_ci#define LCDC_V8_CTRLDESCL_HIGH0_4	0x210
2962306a36Sopenharmony_ci#define LCDC_V8_CTRLDESCL0_5		0x214
3062306a36Sopenharmony_ci#define LCDC_V8_CSC0_CTRL		0x21c
3162306a36Sopenharmony_ci#define LCDC_V8_CSC0_COEF0		0x220
3262306a36Sopenharmony_ci#define LCDC_V8_CSC0_COEF1		0x224
3362306a36Sopenharmony_ci#define LCDC_V8_CSC0_COEF2		0x228
3462306a36Sopenharmony_ci#define LCDC_V8_CSC0_COEF3		0x22c
3562306a36Sopenharmony_ci#define LCDC_V8_CSC0_COEF4		0x230
3662306a36Sopenharmony_ci#define LCDC_V8_CSC0_COEF5		0x234
3762306a36Sopenharmony_ci#define LCDC_V8_PANIC0_THRES		0x238
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#define CTRL_SFTRST			BIT(31)
4062306a36Sopenharmony_ci#define CTRL_CLKGATE			BIT(30)
4162306a36Sopenharmony_ci#define CTRL_BYPASS_COUNT		BIT(19)
4262306a36Sopenharmony_ci#define CTRL_VSYNC_MODE			BIT(18)
4362306a36Sopenharmony_ci#define CTRL_DOTCLK_MODE		BIT(17)
4462306a36Sopenharmony_ci#define CTRL_DATA_SELECT		BIT(16)
4562306a36Sopenharmony_ci#define CTRL_BUS_WIDTH_16		(0 << 10)
4662306a36Sopenharmony_ci#define CTRL_BUS_WIDTH_8		(1 << 10)
4762306a36Sopenharmony_ci#define CTRL_BUS_WIDTH_18		(2 << 10)
4862306a36Sopenharmony_ci#define CTRL_BUS_WIDTH_24		(3 << 10)
4962306a36Sopenharmony_ci#define CTRL_BUS_WIDTH_MASK		(0x3 << 10)
5062306a36Sopenharmony_ci#define CTRL_WORD_LENGTH_16		(0 << 8)
5162306a36Sopenharmony_ci#define CTRL_WORD_LENGTH_8		(1 << 8)
5262306a36Sopenharmony_ci#define CTRL_WORD_LENGTH_18		(2 << 8)
5362306a36Sopenharmony_ci#define CTRL_WORD_LENGTH_24		(3 << 8)
5462306a36Sopenharmony_ci#define CTRL_MASTER			BIT(5)
5562306a36Sopenharmony_ci#define CTRL_DF16			BIT(3)
5662306a36Sopenharmony_ci#define CTRL_DF18			BIT(2)
5762306a36Sopenharmony_ci#define CTRL_DF24			BIT(1)
5862306a36Sopenharmony_ci#define CTRL_RUN			BIT(0)
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci#define CTRL1_RECOVER_ON_UNDERFLOW	BIT(24)
6162306a36Sopenharmony_ci#define CTRL1_FIFO_CLEAR		BIT(21)
6262306a36Sopenharmony_ci#define CTRL1_SET_BYTE_PACKAGING(x)	(((x) & 0xf) << 16)
6362306a36Sopenharmony_ci#define CTRL1_GET_BYTE_PACKAGING(x)	(((x) >> 16) & 0xf)
6462306a36Sopenharmony_ci#define CTRL1_CUR_FRAME_DONE_IRQ_EN	BIT(13)
6562306a36Sopenharmony_ci#define CTRL1_CUR_FRAME_DONE_IRQ	BIT(9)
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci#define CTRL2_SET_OUTSTANDING_REQS_1	0
6862306a36Sopenharmony_ci#define CTRL2_SET_OUTSTANDING_REQS_2	(0x1 << 21)
6962306a36Sopenharmony_ci#define CTRL2_SET_OUTSTANDING_REQS_4	(0x2 << 21)
7062306a36Sopenharmony_ci#define CTRL2_SET_OUTSTANDING_REQS_8	(0x3 << 21)
7162306a36Sopenharmony_ci#define CTRL2_SET_OUTSTANDING_REQS_16	(0x4 << 21)
7262306a36Sopenharmony_ci#define CTRL2_SET_OUTSTANDING_REQS_MASK	(0x7 << 21)
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#define TRANSFER_COUNT_SET_VCOUNT(x)	(((x) & 0xffff) << 16)
7562306a36Sopenharmony_ci#define TRANSFER_COUNT_GET_VCOUNT(x)	(((x) >> 16) & 0xffff)
7662306a36Sopenharmony_ci#define TRANSFER_COUNT_SET_HCOUNT(x)	((x) & 0xffff)
7762306a36Sopenharmony_ci#define TRANSFER_COUNT_GET_HCOUNT(x)	((x) & 0xffff)
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci#define VDCTRL0_ENABLE_PRESENT		BIT(28)
8062306a36Sopenharmony_ci#define VDCTRL0_VSYNC_ACT_HIGH		BIT(27)
8162306a36Sopenharmony_ci#define VDCTRL0_HSYNC_ACT_HIGH		BIT(26)
8262306a36Sopenharmony_ci#define VDCTRL0_DOTCLK_ACT_FALLING	BIT(25)
8362306a36Sopenharmony_ci#define VDCTRL0_ENABLE_ACT_HIGH		BIT(24)
8462306a36Sopenharmony_ci#define VDCTRL0_VSYNC_PERIOD_UNIT	BIT(21)
8562306a36Sopenharmony_ci#define VDCTRL0_VSYNC_PULSE_WIDTH_UNIT	BIT(20)
8662306a36Sopenharmony_ci#define VDCTRL0_HALF_LINE		BIT(19)
8762306a36Sopenharmony_ci#define VDCTRL0_HALF_LINE_MODE		BIT(18)
8862306a36Sopenharmony_ci#define VDCTRL0_SET_VSYNC_PULSE_WIDTH(x) ((x) & 0x3ffff)
8962306a36Sopenharmony_ci#define VDCTRL0_GET_VSYNC_PULSE_WIDTH(x) ((x) & 0x3ffff)
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci#define VDCTRL2_SET_HSYNC_PERIOD(x)	((x) & 0x3ffff)
9262306a36Sopenharmony_ci#define VDCTRL2_GET_HSYNC_PERIOD(x)	((x) & 0x3ffff)
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci#define VDCTRL3_MUX_SYNC_SIGNALS	BIT(29)
9562306a36Sopenharmony_ci#define VDCTRL3_VSYNC_ONLY		BIT(28)
9662306a36Sopenharmony_ci#define SET_HOR_WAIT_CNT(x)		(((x) & 0xfff) << 16)
9762306a36Sopenharmony_ci#define GET_HOR_WAIT_CNT(x)		(((x) >> 16) & 0xfff)
9862306a36Sopenharmony_ci#define SET_VERT_WAIT_CNT(x)		((x) & 0xffff)
9962306a36Sopenharmony_ci#define GET_VERT_WAIT_CNT(x)		((x) & 0xffff)
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci#define VDCTRL4_SET_DOTCLK_DLY(x)	(((x) & 0x7) << 29) /* v4 only */
10262306a36Sopenharmony_ci#define VDCTRL4_GET_DOTCLK_DLY(x)	(((x) >> 29) & 0x7) /* v4 only */
10362306a36Sopenharmony_ci#define VDCTRL4_SYNC_SIGNALS_ON		BIT(18)
10462306a36Sopenharmony_ci#define SET_DOTCLK_H_VALID_DATA_CNT(x)	((x) & 0x3ffff)
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci#define DEBUG0_HSYNC			BIT(26)
10762306a36Sopenharmony_ci#define DEBUG0_VSYNC			BIT(25)
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci#define AS_CTRL_PS_DISABLE		BIT(23)
11062306a36Sopenharmony_ci#define AS_CTRL_ALPHA_INVERT		BIT(20)
11162306a36Sopenharmony_ci#define AS_CTRL_ALPHA(a)		(((a) & 0xff) << 8)
11262306a36Sopenharmony_ci#define AS_CTRL_FORMAT_RGB565		(0xe << 4)
11362306a36Sopenharmony_ci#define AS_CTRL_FORMAT_RGB444		(0xd << 4)
11462306a36Sopenharmony_ci#define AS_CTRL_FORMAT_RGB555		(0xc << 4)
11562306a36Sopenharmony_ci#define AS_CTRL_FORMAT_ARGB4444		(0x9 << 4)
11662306a36Sopenharmony_ci#define AS_CTRL_FORMAT_ARGB1555		(0x8 << 4)
11762306a36Sopenharmony_ci#define AS_CTRL_FORMAT_RGB888		(0x4 << 4)
11862306a36Sopenharmony_ci#define AS_CTRL_FORMAT_ARGB8888		(0x0 << 4)
11962306a36Sopenharmony_ci#define AS_CTRL_ENABLE_COLORKEY		BIT(3)
12062306a36Sopenharmony_ci#define AS_CTRL_ALPHA_CTRL_ROP		(3 << 1)
12162306a36Sopenharmony_ci#define AS_CTRL_ALPHA_CTRL_MULTIPLY	(2 << 1)
12262306a36Sopenharmony_ci#define AS_CTRL_ALPHA_CTRL_OVERRIDE	(1 << 1)
12362306a36Sopenharmony_ci#define AS_CTRL_ALPHA_CTRL_EMBEDDED	(0 << 1)
12462306a36Sopenharmony_ci#define AS_CTRL_AS_ENABLE		BIT(0)
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci/* V8 register set */
12762306a36Sopenharmony_ci#define CTRL_SW_RESET			BIT(31)
12862306a36Sopenharmony_ci#define CTRL_FETCH_START_OPTION_FPV	0
12962306a36Sopenharmony_ci#define CTRL_FETCH_START_OPTION_PWV	BIT(8)
13062306a36Sopenharmony_ci#define CTRL_FETCH_START_OPTION_BPV	BIT(9)
13162306a36Sopenharmony_ci#define CTRL_FETCH_START_OPTION_RESV	GENMASK(9, 8)
13262306a36Sopenharmony_ci#define CTRL_FETCH_START_OPTION_MASK	GENMASK(9, 8)
13362306a36Sopenharmony_ci#define CTRL_NEG			BIT(4)
13462306a36Sopenharmony_ci#define CTRL_INV_PXCK			BIT(3)
13562306a36Sopenharmony_ci#define CTRL_INV_DE			BIT(2)
13662306a36Sopenharmony_ci#define CTRL_INV_VS			BIT(1)
13762306a36Sopenharmony_ci#define CTRL_INV_HS			BIT(0)
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ci#define DISP_PARA_DISP_ON		BIT(31)
14062306a36Sopenharmony_ci#define DISP_PARA_SWAP_EN		BIT(30)
14162306a36Sopenharmony_ci#define DISP_PARA_LINE_PATTERN_UYVY_H	(0xd << 26)
14262306a36Sopenharmony_ci#define DISP_PARA_LINE_PATTERN_RGB565	(0x7 << 26)
14362306a36Sopenharmony_ci#define DISP_PARA_LINE_PATTERN_RGB888	(0x0 << 26)
14462306a36Sopenharmony_ci#define DISP_PARA_LINE_PATTERN_MASK	GENMASK(29, 26)
14562306a36Sopenharmony_ci#define DISP_PARA_DISP_MODE_MASK	GENMASK(25, 24)
14662306a36Sopenharmony_ci#define DISP_PARA_BGND_R_MASK		GENMASK(23, 16)
14762306a36Sopenharmony_ci#define DISP_PARA_BGND_G_MASK		GENMASK(15, 8)
14862306a36Sopenharmony_ci#define DISP_PARA_BGND_B_MASK		GENMASK(7, 0)
14962306a36Sopenharmony_ci
15062306a36Sopenharmony_ci#define DISP_SIZE_DELTA_Y(n)		(((n) & 0xffff) << 16)
15162306a36Sopenharmony_ci#define DISP_SIZE_DELTA_Y_MASK		GENMASK(31, 16)
15262306a36Sopenharmony_ci#define DISP_SIZE_DELTA_X(n)		((n) & 0xffff)
15362306a36Sopenharmony_ci#define DISP_SIZE_DELTA_X_MASK		GENMASK(15, 0)
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci#define HSYN_PARA_BP_H(n)		(((n) & 0xffff) << 16)
15662306a36Sopenharmony_ci#define HSYN_PARA_BP_H_MASK		GENMASK(31, 16)
15762306a36Sopenharmony_ci#define HSYN_PARA_FP_H(n)		((n) & 0xffff)
15862306a36Sopenharmony_ci#define HSYN_PARA_FP_H_MASK		GENMASK(15, 0)
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ci#define VSYN_PARA_BP_V(n)		(((n) & 0xffff) << 16)
16162306a36Sopenharmony_ci#define VSYN_PARA_BP_V_MASK		GENMASK(31, 16)
16262306a36Sopenharmony_ci#define VSYN_PARA_FP_V(n)		((n) & 0xffff)
16362306a36Sopenharmony_ci#define VSYN_PARA_FP_V_MASK		GENMASK(15, 0)
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ci#define VSYN_HSYN_WIDTH_PW_V(n)		(((n) & 0xffff) << 16)
16662306a36Sopenharmony_ci#define VSYN_HSYN_WIDTH_PW_V_MASK	GENMASK(31, 16)
16762306a36Sopenharmony_ci#define VSYN_HSYN_WIDTH_PW_H(n)		((n) & 0xffff)
16862306a36Sopenharmony_ci#define VSYN_HSYN_WIDTH_PW_H_MASK	GENMASK(15, 0)
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci#define INT_STATUS_D0_FIFO_EMPTY	BIT(24)
17162306a36Sopenharmony_ci#define INT_STATUS_D0_DMA_DONE		BIT(16)
17262306a36Sopenharmony_ci#define INT_STATUS_D0_DMA_ERR		BIT(8)
17362306a36Sopenharmony_ci#define INT_STATUS_D0_VS_BLANK		BIT(2)
17462306a36Sopenharmony_ci#define INT_STATUS_D0_UNDERRUN		BIT(1)
17562306a36Sopenharmony_ci#define INT_STATUS_D0_VSYNC		BIT(0)
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci#define INT_ENABLE_D0_FIFO_EMPTY_EN	BIT(24)
17862306a36Sopenharmony_ci#define INT_ENABLE_D0_DMA_DONE_EN	BIT(16)
17962306a36Sopenharmony_ci#define INT_ENABLE_D0_DMA_ERR_EN	BIT(8)
18062306a36Sopenharmony_ci#define INT_ENABLE_D0_VS_BLANK_EN	BIT(2)
18162306a36Sopenharmony_ci#define INT_ENABLE_D0_UNDERRUN_EN	BIT(1)
18262306a36Sopenharmony_ci#define INT_ENABLE_D0_VSYNC_EN		BIT(0)
18362306a36Sopenharmony_ci
18462306a36Sopenharmony_ci#define INT_STATUS_D1_PLANE_PANIC	BIT(0)
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ci#define INT_ENABLE_D1_PLANE_PANIC_EN	BIT(0)
18762306a36Sopenharmony_ci
18862306a36Sopenharmony_ci#define CTRLDESCL0_1_HEIGHT(n)		(((n) & 0xffff) << 16)
18962306a36Sopenharmony_ci#define CTRLDESCL0_1_HEIGHT_MASK	GENMASK(31, 16)
19062306a36Sopenharmony_ci#define CTRLDESCL0_1_WIDTH(n)		((n) & 0xffff)
19162306a36Sopenharmony_ci#define CTRLDESCL0_1_WIDTH_MASK		GENMASK(15, 0)
19262306a36Sopenharmony_ci
19362306a36Sopenharmony_ci#define CTRLDESCL0_3_P_SIZE(n)		(((n) << 20) & CTRLDESCL0_3_P_SIZE_MASK)
19462306a36Sopenharmony_ci#define CTRLDESCL0_3_P_SIZE_MASK	GENMASK(22, 20)
19562306a36Sopenharmony_ci#define CTRLDESCL0_3_T_SIZE(n)		(((n) << 16) & CTRLDESCL0_3_T_SIZE_MASK)
19662306a36Sopenharmony_ci#define CTRLDESCL0_3_T_SIZE_MASK	GENMASK(17, 16)
19762306a36Sopenharmony_ci#define CTRLDESCL0_3_PITCH(n)		((n) & 0xffff)
19862306a36Sopenharmony_ci#define CTRLDESCL0_3_PITCH_MASK		GENMASK(15, 0)
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci#define CTRLDESCL_HIGH0_4_ADDR_HIGH(n)	((n) & 0xf)
20162306a36Sopenharmony_ci#define CTRLDESCL_HIGH0_4_ADDR_HIGH_MASK	GENMASK(3, 0)
20262306a36Sopenharmony_ci
20362306a36Sopenharmony_ci#define CTRLDESCL0_5_EN			BIT(31)
20462306a36Sopenharmony_ci#define CTRLDESCL0_5_SHADOW_LOAD_EN	BIT(30)
20562306a36Sopenharmony_ci#define CTRLDESCL0_5_BPP_16_RGB565	(0x4 << 24)
20662306a36Sopenharmony_ci#define CTRLDESCL0_5_BPP_16_ARGB1555	(0x5 << 24)
20762306a36Sopenharmony_ci#define CTRLDESCL0_5_BPP_16_ARGB4444	(0x6 << 24)
20862306a36Sopenharmony_ci#define CTRLDESCL0_5_BPP_YCbCr422	(0x7 << 24)
20962306a36Sopenharmony_ci#define CTRLDESCL0_5_BPP_24_RGB888	(0x8 << 24)
21062306a36Sopenharmony_ci#define CTRLDESCL0_5_BPP_32_ARGB8888	(0x9 << 24)
21162306a36Sopenharmony_ci#define CTRLDESCL0_5_BPP_32_ABGR8888	(0xa << 24)
21262306a36Sopenharmony_ci#define CTRLDESCL0_5_BPP_MASK		GENMASK(27, 24)
21362306a36Sopenharmony_ci#define CTRLDESCL0_5_YUV_FORMAT_Y2VY1U	(0x0 << 14)
21462306a36Sopenharmony_ci#define CTRLDESCL0_5_YUV_FORMAT_Y2UY1V	(0x1 << 14)
21562306a36Sopenharmony_ci#define CTRLDESCL0_5_YUV_FORMAT_VY2UY1	(0x2 << 14)
21662306a36Sopenharmony_ci#define CTRLDESCL0_5_YUV_FORMAT_UY2VY1	(0x3 << 14)
21762306a36Sopenharmony_ci#define CTRLDESCL0_5_YUV_FORMAT_MASK	GENMASK(15, 14)
21862306a36Sopenharmony_ci
21962306a36Sopenharmony_ci#define CSC0_CTRL_CSC_MODE_YUV2RGB	(0x0 << 1)
22062306a36Sopenharmony_ci#define CSC0_CTRL_CSC_MODE_YCbCr2RGB	(0x1 << 1)
22162306a36Sopenharmony_ci#define CSC0_CTRL_CSC_MODE_RGB2YUV	(0x2 << 1)
22262306a36Sopenharmony_ci#define CSC0_CTRL_CSC_MODE_RGB2YCbCr	(0x3 << 1)
22362306a36Sopenharmony_ci#define CSC0_CTRL_CSC_MODE_MASK		GENMASK(2, 1)
22462306a36Sopenharmony_ci#define CSC0_CTRL_BYPASS		BIT(0)
22562306a36Sopenharmony_ci
22662306a36Sopenharmony_ci#define CSC0_COEF0_A2(n)		(((n) << 16) & CSC0_COEF0_A2_MASK)
22762306a36Sopenharmony_ci#define CSC0_COEF0_A2_MASK		GENMASK(26, 16)
22862306a36Sopenharmony_ci#define CSC0_COEF0_A1(n)		((n) & CSC0_COEF0_A1_MASK)
22962306a36Sopenharmony_ci#define CSC0_COEF0_A1_MASK		GENMASK(10, 0)
23062306a36Sopenharmony_ci
23162306a36Sopenharmony_ci#define CSC0_COEF1_B1(n)		(((n) << 16) & CSC0_COEF1_B1_MASK)
23262306a36Sopenharmony_ci#define CSC0_COEF1_B1_MASK		GENMASK(26, 16)
23362306a36Sopenharmony_ci#define CSC0_COEF1_A3(n)		((n) & CSC0_COEF1_A3_MASK)
23462306a36Sopenharmony_ci#define CSC0_COEF1_A3_MASK		GENMASK(10, 0)
23562306a36Sopenharmony_ci
23662306a36Sopenharmony_ci#define CSC0_COEF2_B3(n)		(((n) << 16) & CSC0_COEF2_B3_MASK)
23762306a36Sopenharmony_ci#define CSC0_COEF2_B3_MASK		GENMASK(26, 16)
23862306a36Sopenharmony_ci#define CSC0_COEF2_B2(n)		((n) & CSC0_COEF2_B2_MASK)
23962306a36Sopenharmony_ci#define CSC0_COEF2_B2_MASK		GENMASK(10, 0)
24062306a36Sopenharmony_ci
24162306a36Sopenharmony_ci#define CSC0_COEF3_C2(n)		(((n) << 16) & CSC0_COEF3_C2_MASK)
24262306a36Sopenharmony_ci#define CSC0_COEF3_C2_MASK		GENMASK(26, 16)
24362306a36Sopenharmony_ci#define CSC0_COEF3_C1(n)		((n) & CSC0_COEF3_C1_MASK)
24462306a36Sopenharmony_ci#define CSC0_COEF3_C1_MASK		GENMASK(10, 0)
24562306a36Sopenharmony_ci
24662306a36Sopenharmony_ci#define CSC0_COEF4_D1(n)		(((n) << 16) & CSC0_COEF4_D1_MASK)
24762306a36Sopenharmony_ci#define CSC0_COEF4_D1_MASK		GENMASK(24, 16)
24862306a36Sopenharmony_ci#define CSC0_COEF4_C3(n)		((n) & CSC0_COEF4_C3_MASK)
24962306a36Sopenharmony_ci#define CSC0_COEF4_C3_MASK		GENMASK(10, 0)
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ci#define CSC0_COEF5_D3(n)		(((n) << 16) & CSC0_COEF5_D3_MASK)
25262306a36Sopenharmony_ci#define CSC0_COEF5_D3_MASK		GENMASK(24, 16)
25362306a36Sopenharmony_ci#define CSC0_COEF5_D2(n)		((n) & CSC0_COEF5_D2_MASK)
25462306a36Sopenharmony_ci#define CSC0_COEF5_D2_MASK		GENMASK(8, 0)
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ci#define PANIC0_THRES_LOW_MASK		GENMASK(24, 16)
25762306a36Sopenharmony_ci#define PANIC0_THRES_HIGH_MASK		GENMASK(8, 0)
25862306a36Sopenharmony_ci#define PANIC0_THRES_MAX		511
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_ci#define LCDIF_MIN_XRES			120
26162306a36Sopenharmony_ci#define LCDIF_MIN_YRES			120
26262306a36Sopenharmony_ci#define LCDIF_MAX_XRES			0xffff
26362306a36Sopenharmony_ci#define LCDIF_MAX_YRES			0xffff
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_ci#endif /* __LCDIF_REGS_H__ */
266