18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * drivers/video/mmp/hw/mmp_ctrl.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2012 Marvell Technology Group Ltd.
68c2ecf20Sopenharmony_ci * Authors:  Guoqing Li <ligq@marvell.com>
78c2ecf20Sopenharmony_ci *          Lisa Du <cldu@marvell.com>
88c2ecf20Sopenharmony_ci *          Zhou Zhu <zzhu3@marvell.com>
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef _MMP_CTRL_H_
128c2ecf20Sopenharmony_ci#define _MMP_CTRL_H_
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <video/mmp_disp.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/* ------------< LCD register >------------ */
178c2ecf20Sopenharmony_cistruct lcd_regs {
188c2ecf20Sopenharmony_ci/* TV patch register for MMP2 */
198c2ecf20Sopenharmony_ci/* 32 bit		TV Video Frame0 Y Starting Address */
208c2ecf20Sopenharmony_ci#define LCD_TVD_START_ADDR_Y0			(0x0000)
218c2ecf20Sopenharmony_ci/* 32 bit		TV Video Frame0 U Starting Address */
228c2ecf20Sopenharmony_ci#define LCD_TVD_START_ADDR_U0			(0x0004)
238c2ecf20Sopenharmony_ci/* 32 bit		TV Video Frame0 V Starting Address */
248c2ecf20Sopenharmony_ci#define LCD_TVD_START_ADDR_V0			(0x0008)
258c2ecf20Sopenharmony_ci/* 32 bit		TV Video Frame0 Command Starting Address */
268c2ecf20Sopenharmony_ci#define LCD_TVD_START_ADDR_C0			(0x000C)
278c2ecf20Sopenharmony_ci/* 32 bit		TV Video Frame1 Y Starting Address Register*/
288c2ecf20Sopenharmony_ci#define LCD_TVD_START_ADDR_Y1			(0x0010)
298c2ecf20Sopenharmony_ci/* 32 bit		TV Video Frame1 U Starting Address Register*/
308c2ecf20Sopenharmony_ci#define LCD_TVD_START_ADDR_U1			(0x0014)
318c2ecf20Sopenharmony_ci/* 32 bit		TV Video Frame1 V Starting Address Register*/
328c2ecf20Sopenharmony_ci#define LCD_TVD_START_ADDR_V1			(0x0018)
338c2ecf20Sopenharmony_ci/* 32 bit		TV Video Frame1 Command Starting Address Register*/
348c2ecf20Sopenharmony_ci#define LCD_TVD_START_ADDR_C1			(0x001C)
358c2ecf20Sopenharmony_ci/* 32 bit		TV Video Y andC Line Length(Pitch)Register*/
368c2ecf20Sopenharmony_ci#define LCD_TVD_PITCH_YC			(0x0020)
378c2ecf20Sopenharmony_ci/* 32 bit		TV Video U andV Line Length(Pitch)Register*/
388c2ecf20Sopenharmony_ci#define LCD_TVD_PITCH_UV			(0x0024)
398c2ecf20Sopenharmony_ci/* 32 bit	  TV Video Starting Point on Screen Register*/
408c2ecf20Sopenharmony_ci#define LCD_TVD_OVSA_HPXL_VLN			(0x0028)
418c2ecf20Sopenharmony_ci/* 32 bit		TV Video Source Size Register*/
428c2ecf20Sopenharmony_ci#define LCD_TVD_HPXL_VLN			(0x002C)
438c2ecf20Sopenharmony_ci/* 32 bit	  TV Video Destination Size (After Zooming)Register*/
448c2ecf20Sopenharmony_ci#define LCD_TVDZM_HPXL_VLN			(0x0030)
458c2ecf20Sopenharmony_ci	u32 v_y0;
468c2ecf20Sopenharmony_ci	u32 v_u0;
478c2ecf20Sopenharmony_ci	u32 v_v0;
488c2ecf20Sopenharmony_ci	u32 v_c0;
498c2ecf20Sopenharmony_ci	u32 v_y1;
508c2ecf20Sopenharmony_ci	u32 v_u1;
518c2ecf20Sopenharmony_ci	u32 v_v1;
528c2ecf20Sopenharmony_ci	u32 v_c1;
538c2ecf20Sopenharmony_ci	u32 v_pitch_yc;		/* Video Y and C Line Length (Pitch) */
548c2ecf20Sopenharmony_ci	u32 v_pitch_uv;		/* Video U and V Line Length (Pitch) */
558c2ecf20Sopenharmony_ci	u32 v_start;		/* Video Starting Point on Screen */
568c2ecf20Sopenharmony_ci	u32 v_size;			/* Video Source Size */
578c2ecf20Sopenharmony_ci	u32 v_size_z;		/* Video Destination Size (After Zooming) */
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci/* 32 bit	   TV Graphic Frame 0 Starting Address Register*/
608c2ecf20Sopenharmony_ci#define LCD_TVG_START_ADDR0				(0x0034)
618c2ecf20Sopenharmony_ci/* 32 bit	  TV Graphic Frame 1 Starting Address Register*/
628c2ecf20Sopenharmony_ci#define LCD_TVG_START_ADDR1				(0x0038)
638c2ecf20Sopenharmony_ci/* 32 bit		TV Graphic Line Length(Pitch)Register*/
648c2ecf20Sopenharmony_ci#define LCD_TVG_PITCH					(0x003C)
658c2ecf20Sopenharmony_ci/* 32 bit		TV Graphic Starting Point on Screen Register*/
668c2ecf20Sopenharmony_ci#define LCD_TVG_OVSA_HPXL_VLN				(0x0040)
678c2ecf20Sopenharmony_ci/* 32 bit		TV Graphic Source Size Register*/
688c2ecf20Sopenharmony_ci#define LCD_TVG_HPXL_VLN				(0x0044)
698c2ecf20Sopenharmony_ci/* 32 bit		TV Graphic Destination size (after Zooming)Register*/
708c2ecf20Sopenharmony_ci#define LCD_TVGZM_HPXL_VLN				(0x0048)
718c2ecf20Sopenharmony_ci	u32 g_0;			/* Graphic Frame 0/1 Starting Address */
728c2ecf20Sopenharmony_ci	u32 g_1;
738c2ecf20Sopenharmony_ci	u32 g_pitch;		/* Graphic Line Length (Pitch) */
748c2ecf20Sopenharmony_ci	u32 g_start;		/* Graphic Starting Point on Screen */
758c2ecf20Sopenharmony_ci	u32 g_size;			/* Graphic Source Size */
768c2ecf20Sopenharmony_ci	u32 g_size_z;		/* Graphic Destination Size (After Zooming) */
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci/* 32 bit	  TV Hardware Cursor Starting Point on screen Register*/
798c2ecf20Sopenharmony_ci#define LCD_TVC_OVSA_HPXL_VLN				(0x004C)
808c2ecf20Sopenharmony_ci/* 32 bit		TV Hardware Cursor Size Register */
818c2ecf20Sopenharmony_ci#define LCD_TVC_HPXL_VLN				(0x0050)
828c2ecf20Sopenharmony_ci	u32 hc_start;			/* Hardware Cursor */
838c2ecf20Sopenharmony_ci	u32 hc_size;			/* Hardware Cursor */
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci/* 32 bit		TV Total Screen Size Register*/
868c2ecf20Sopenharmony_ci#define LCD_TV_V_H_TOTAL				(0x0054)
878c2ecf20Sopenharmony_ci/* 32 bit		TV Screen Active Size Register*/
888c2ecf20Sopenharmony_ci#define LCD_TV_V_H_ACTIVE				(0x0058)
898c2ecf20Sopenharmony_ci/* 32 bit		TV Screen Horizontal Porch Register*/
908c2ecf20Sopenharmony_ci#define LCD_TV_H_PORCH					(0x005C)
918c2ecf20Sopenharmony_ci/* 32 bit		TV Screen Vertical Porch Register*/
928c2ecf20Sopenharmony_ci#define LCD_TV_V_PORCH					(0x0060)
938c2ecf20Sopenharmony_ci	u32 screen_size;		/* Screen Total Size */
948c2ecf20Sopenharmony_ci	u32 screen_active;		/* Screen Active Size */
958c2ecf20Sopenharmony_ci	u32 screen_h_porch;		/* Screen Horizontal Porch */
968c2ecf20Sopenharmony_ci	u32 screen_v_porch;		/* Screen Vertical Porch */
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/* 32 bit		TV Screen Blank Color Register*/
998c2ecf20Sopenharmony_ci#define LCD_TV_BLANKCOLOR				(0x0064)
1008c2ecf20Sopenharmony_ci/* 32 bit		TV Hardware Cursor Color1 Register*/
1018c2ecf20Sopenharmony_ci#define LCD_TV_ALPHA_COLOR1				(0x0068)
1028c2ecf20Sopenharmony_ci/* 32 bit		TV Hardware Cursor Color2 Register*/
1038c2ecf20Sopenharmony_ci#define LCD_TV_ALPHA_COLOR2				(0x006C)
1048c2ecf20Sopenharmony_ci	u32 blank_color;		/* Screen Blank Color */
1058c2ecf20Sopenharmony_ci	u32 hc_Alpha_color1;	/* Hardware Cursor Color1 */
1068c2ecf20Sopenharmony_ci	u32 hc_Alpha_color2;	/* Hardware Cursor Color2 */
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci/* 32 bit		TV Video Y Color Key Control*/
1098c2ecf20Sopenharmony_ci#define LCD_TV_COLORKEY_Y				(0x0070)
1108c2ecf20Sopenharmony_ci/* 32 bit		TV Video U Color Key Control*/
1118c2ecf20Sopenharmony_ci#define LCD_TV_COLORKEY_U				(0x0074)
1128c2ecf20Sopenharmony_ci/* 32 bit		TV Video V Color Key Control*/
1138c2ecf20Sopenharmony_ci#define LCD_TV_COLORKEY_V				(0x0078)
1148c2ecf20Sopenharmony_ci	u32 v_colorkey_y;		/* Video Y Color Key Control */
1158c2ecf20Sopenharmony_ci	u32 v_colorkey_u;		/* Video U Color Key Control */
1168c2ecf20Sopenharmony_ci	u32 v_colorkey_v;		/* Video V Color Key Control */
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci/* 32 bit		TV VSYNC PulsePixel Edge Control Register*/
1198c2ecf20Sopenharmony_ci#define LCD_TV_SEPXLCNT					(0x007C)
1208c2ecf20Sopenharmony_ci	u32 vsync_ctrl;			/* VSYNC PulsePixel Edge Control */
1218c2ecf20Sopenharmony_ci};
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#define intf_ctrl(id)		((id) ? (((id) & 1) ? LCD_TVIF_CTRL : \
1248c2ecf20Sopenharmony_ci				LCD_DUMB2_CTRL) : LCD_SPU_DUMB_CTRL)
1258c2ecf20Sopenharmony_ci#define dma_ctrl0(id)	   ((id) ? (((id) & 1) ? LCD_TV_CTRL0 : \
1268c2ecf20Sopenharmony_ci				LCD_PN2_CTRL0) : LCD_SPU_DMA_CTRL0)
1278c2ecf20Sopenharmony_ci#define dma_ctrl1(id)	   ((id) ? (((id) & 1) ? LCD_TV_CTRL1 : \
1288c2ecf20Sopenharmony_ci				LCD_PN2_CTRL1) : LCD_SPU_DMA_CTRL1)
1298c2ecf20Sopenharmony_ci#define dma_ctrl(ctrl1, id)	 (ctrl1 ? dma_ctrl1(id) : dma_ctrl0(id))
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci/* 32 bit		TV Path DMA Control 0*/
1328c2ecf20Sopenharmony_ci#define LCD_TV_CTRL0					(0x0080)
1338c2ecf20Sopenharmony_ci/* 32 bit		TV Path DMA Control 1*/
1348c2ecf20Sopenharmony_ci#define LCD_TV_CTRL1					(0x0084)
1358c2ecf20Sopenharmony_ci/* 32 bit		TV Path Video Contrast*/
1368c2ecf20Sopenharmony_ci#define LCD_TV_CONTRAST					(0x0088)
1378c2ecf20Sopenharmony_ci/* 32 bit		TV Path Video Saturation*/
1388c2ecf20Sopenharmony_ci#define LCD_TV_SATURATION				(0x008C)
1398c2ecf20Sopenharmony_ci/* 32 bit		TV Path Video Hue Adjust*/
1408c2ecf20Sopenharmony_ci#define LCD_TV_CBSH_HUE					(0x0090)
1418c2ecf20Sopenharmony_ci/* 32 bit TV Path TVIF Control	Register */
1428c2ecf20Sopenharmony_ci#define LCD_TVIF_CTRL					(0x0094)
1438c2ecf20Sopenharmony_ci#define TV_VBLNK_VALID_EN				(1 << 12)
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci/* 32 bit TV Path I/O Pad Control*/
1468c2ecf20Sopenharmony_ci#define LCD_TVIOPAD_CTRL				(0x0098)
1478c2ecf20Sopenharmony_ci/* 32 bit TV Path Cloc	Divider  */
1488c2ecf20Sopenharmony_ci#define LCD_TCLK_DIV					(0x009C)
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci#define LCD_SCLK(path) ((PATH_PN == path->id) ? LCD_CFG_SCLK_DIV :\
1518c2ecf20Sopenharmony_ci	((PATH_TV == path->id) ? LCD_TCLK_DIV : LCD_PN2_SCLK_DIV))
1528c2ecf20Sopenharmony_ci#define intf_rbswap_ctrl(id)	((id) ? (((id) & 1) ? LCD_TVIF_CTRL : \
1538c2ecf20Sopenharmony_ci				PN2_IOPAD_CONTROL) : LCD_TOP_CTRL)
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci/* dither configure */
1568c2ecf20Sopenharmony_ci#define LCD_DITHER_CTRL				(0x00A0)
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci#define DITHER_TBL_INDEX_SEL(s)		((s) << 16)
1598c2ecf20Sopenharmony_ci#define DITHER_MODE2(m)				((m) << 12)
1608c2ecf20Sopenharmony_ci#define DITHER_MODE2_SHIFT			(12)
1618c2ecf20Sopenharmony_ci#define DITHER_4X8_EN2				(1 << 9)
1628c2ecf20Sopenharmony_ci#define DITHER_4X8_EN2_SHIFT		(9)
1638c2ecf20Sopenharmony_ci#define DITHER_EN2					(1 << 8)
1648c2ecf20Sopenharmony_ci#define DITHER_MODE1(m)				((m) << 4)
1658c2ecf20Sopenharmony_ci#define DITHER_MODE1_SHIFT			(4)
1668c2ecf20Sopenharmony_ci#define DITHER_4X8_EN1				(1 << 1)
1678c2ecf20Sopenharmony_ci#define DITHER_4X8_EN1_SHIFT		(1)
1688c2ecf20Sopenharmony_ci#define DITHER_EN1					(1)
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci/* dither table data was fixed by video bpp of input and output*/
1718c2ecf20Sopenharmony_ci#define DITHER_TB_4X4_INDEX0		(0x3b19f7d5)
1728c2ecf20Sopenharmony_ci#define DITHER_TB_4X4_INDEX1		(0x082ac4e6)
1738c2ecf20Sopenharmony_ci#define DITHER_TB_4X8_INDEX0		(0xf7d508e6)
1748c2ecf20Sopenharmony_ci#define DITHER_TB_4X8_INDEX1		(0x3b194c2a)
1758c2ecf20Sopenharmony_ci#define DITHER_TB_4X8_INDEX2		(0xc4e6d5f7)
1768c2ecf20Sopenharmony_ci#define DITHER_TB_4X8_INDEX3		(0x082a193b)
1778c2ecf20Sopenharmony_ci#define LCD_DITHER_TBL_DATA		(0x00A4)
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci/* Video Frame 0&1 start address registers */
1808c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_Y0	0x00C0
1818c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_U0	0x00C4
1828c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_V0	0x00C8
1838c2ecf20Sopenharmony_ci#define LCD_CFG_DMA_START_ADDR_0	0x00CC /* Cmd address */
1848c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_Y1	0x00D0
1858c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_U1	0x00D4
1868c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_V1	0x00D8
1878c2ecf20Sopenharmony_ci#define LCD_CFG_DMA_START_ADDR_1	0x00DC /* Cmd address */
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci/* YC & UV Pitch */
1908c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_PITCH_YC		0x00E0
1918c2ecf20Sopenharmony_ci#define	 SPU_DMA_PITCH_C(c)		((c)<<16)
1928c2ecf20Sopenharmony_ci#define	 SPU_DMA_PITCH_Y(y)		(y)
1938c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_PITCH_UV		0x00E4
1948c2ecf20Sopenharmony_ci#define	 SPU_DMA_PITCH_V(v)		((v)<<16)
1958c2ecf20Sopenharmony_ci#define	 SPU_DMA_PITCH_U(u)		(u)
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci/* Video Starting Point on Screen Register */
1988c2ecf20Sopenharmony_ci#define LCD_SPUT_DMA_OVSA_HPXL_VLN		0x00E8
1998c2ecf20Sopenharmony_ci#define	 CFG_DMA_OVSA_VLN(y)			((y)<<16) /* 0~0xfff */
2008c2ecf20Sopenharmony_ci#define	 CFG_DMA_OVSA_HPXL(x)			(x)	 /* 0~0xfff */
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci/* Video Size Register */
2038c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_HPXL_VLN			0x00EC
2048c2ecf20Sopenharmony_ci#define	 CFG_DMA_VLN(y)				((y)<<16)
2058c2ecf20Sopenharmony_ci#define	 CFG_DMA_HPXL(x)			(x)
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci/* Video Size After zooming Register */
2088c2ecf20Sopenharmony_ci#define LCD_SPU_DZM_HPXL_VLN			0x00F0
2098c2ecf20Sopenharmony_ci#define	 CFG_DZM_VLN(y)				((y)<<16)
2108c2ecf20Sopenharmony_ci#define	 CFG_DZM_HPXL(x)			(x)
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci/* Graphic Frame 0&1 Starting Address Register */
2138c2ecf20Sopenharmony_ci#define LCD_CFG_GRA_START_ADDR0			0x00F4
2148c2ecf20Sopenharmony_ci#define LCD_CFG_GRA_START_ADDR1			0x00F8
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci/* Graphic Frame Pitch */
2178c2ecf20Sopenharmony_ci#define LCD_CFG_GRA_PITCH			0x00FC
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci/* Graphic Starting Point on Screen Register */
2208c2ecf20Sopenharmony_ci#define LCD_SPU_GRA_OVSA_HPXL_VLN		0x0100
2218c2ecf20Sopenharmony_ci#define	 CFG_GRA_OVSA_VLN(y)			((y)<<16)
2228c2ecf20Sopenharmony_ci#define	 CFG_GRA_OVSA_HPXL(x)			(x)
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci/* Graphic Size Register */
2258c2ecf20Sopenharmony_ci#define LCD_SPU_GRA_HPXL_VLN			0x0104
2268c2ecf20Sopenharmony_ci#define	 CFG_GRA_VLN(y)				((y)<<16)
2278c2ecf20Sopenharmony_ci#define	 CFG_GRA_HPXL(x)			(x)
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci/* Graphic Size after Zooming Register */
2308c2ecf20Sopenharmony_ci#define LCD_SPU_GZM_HPXL_VLN			0x0108
2318c2ecf20Sopenharmony_ci#define	 CFG_GZM_VLN(y)				((y)<<16)
2328c2ecf20Sopenharmony_ci#define	 CFG_GZM_HPXL(x)			(x)
2338c2ecf20Sopenharmony_ci
2348c2ecf20Sopenharmony_ci/* HW Cursor Starting Point on Screen Register */
2358c2ecf20Sopenharmony_ci#define LCD_SPU_HWC_OVSA_HPXL_VLN		0x010C
2368c2ecf20Sopenharmony_ci#define	 CFG_HWC_OVSA_VLN(y)			((y)<<16)
2378c2ecf20Sopenharmony_ci#define	 CFG_HWC_OVSA_HPXL(x)			(x)
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ci/* HW Cursor Size */
2408c2ecf20Sopenharmony_ci#define LCD_SPU_HWC_HPXL_VLN			0x0110
2418c2ecf20Sopenharmony_ci#define	 CFG_HWC_VLN(y)				((y)<<16)
2428c2ecf20Sopenharmony_ci#define	 CFG_HWC_HPXL(x)			(x)
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci/* Total Screen Size Register */
2458c2ecf20Sopenharmony_ci#define LCD_SPUT_V_H_TOTAL			0x0114
2468c2ecf20Sopenharmony_ci#define	 CFG_V_TOTAL(y)				((y)<<16)
2478c2ecf20Sopenharmony_ci#define	 CFG_H_TOTAL(x)				(x)
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci/* Total Screen Active Size Register */
2508c2ecf20Sopenharmony_ci#define LCD_SPU_V_H_ACTIVE			0x0118
2518c2ecf20Sopenharmony_ci#define	 CFG_V_ACTIVE(y)			((y)<<16)
2528c2ecf20Sopenharmony_ci#define	 CFG_H_ACTIVE(x)			(x)
2538c2ecf20Sopenharmony_ci
2548c2ecf20Sopenharmony_ci/* Screen H&V Porch Register */
2558c2ecf20Sopenharmony_ci#define LCD_SPU_H_PORCH				0x011C
2568c2ecf20Sopenharmony_ci#define	 CFG_H_BACK_PORCH(b)			((b)<<16)
2578c2ecf20Sopenharmony_ci#define	 CFG_H_FRONT_PORCH(f)			(f)
2588c2ecf20Sopenharmony_ci#define LCD_SPU_V_PORCH				0x0120
2598c2ecf20Sopenharmony_ci#define	 CFG_V_BACK_PORCH(b)			((b)<<16)
2608c2ecf20Sopenharmony_ci#define	 CFG_V_FRONT_PORCH(f)			(f)
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci/* Screen Blank Color Register */
2638c2ecf20Sopenharmony_ci#define LCD_SPU_BLANKCOLOR			0x0124
2648c2ecf20Sopenharmony_ci#define  CFG_BLANKCOLOR_MASK			0x00FFFFFF
2658c2ecf20Sopenharmony_ci#define  CFG_BLANKCOLOR_R_MASK			0x000000FF
2668c2ecf20Sopenharmony_ci#define  CFG_BLANKCOLOR_G_MASK			0x0000FF00
2678c2ecf20Sopenharmony_ci#define  CFG_BLANKCOLOR_B_MASK			0x00FF0000
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ci/* HW Cursor Color 1&2 Register */
2708c2ecf20Sopenharmony_ci#define LCD_SPU_ALPHA_COLOR1			0x0128
2718c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR1				0x00FFFFFF
2728c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR1_R(red)			((red)<<16)
2738c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR1_G(green)		((green)<<8)
2748c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR1_B(blue)			(blue)
2758c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR1_R_MASK			0x000000FF
2768c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR1_G_MASK			0x0000FF00
2778c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR1_B_MASK			0x00FF0000
2788c2ecf20Sopenharmony_ci#define LCD_SPU_ALPHA_COLOR2			0x012C
2798c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR2				0x00FFFFFF
2808c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR2_R_MASK			0x000000FF
2818c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR2_G_MASK			0x0000FF00
2828c2ecf20Sopenharmony_ci#define	 CFG_HWC_COLOR2_B_MASK			0x00FF0000
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_ci/* Video YUV Color Key Control */
2858c2ecf20Sopenharmony_ci#define LCD_SPU_COLORKEY_Y			0x0130
2868c2ecf20Sopenharmony_ci#define	 CFG_CKEY_Y2(y2)			((y2)<<24)
2878c2ecf20Sopenharmony_ci#define	 CFG_CKEY_Y2_MASK			0xFF000000
2888c2ecf20Sopenharmony_ci#define	 CFG_CKEY_Y1(y1)			((y1)<<16)
2898c2ecf20Sopenharmony_ci#define	 CFG_CKEY_Y1_MASK			0x00FF0000
2908c2ecf20Sopenharmony_ci#define	 CFG_CKEY_Y(y)				((y)<<8)
2918c2ecf20Sopenharmony_ci#define	 CFG_CKEY_Y_MASK			0x0000FF00
2928c2ecf20Sopenharmony_ci#define	 CFG_ALPHA_Y(y)				(y)
2938c2ecf20Sopenharmony_ci#define	 CFG_ALPHA_Y_MASK			0x000000FF
2948c2ecf20Sopenharmony_ci#define LCD_SPU_COLORKEY_U			0x0134
2958c2ecf20Sopenharmony_ci#define	 CFG_CKEY_U2(u2)			((u2)<<24)
2968c2ecf20Sopenharmony_ci#define	 CFG_CKEY_U2_MASK			0xFF000000
2978c2ecf20Sopenharmony_ci#define	 CFG_CKEY_U1(u1)			((u1)<<16)
2988c2ecf20Sopenharmony_ci#define	 CFG_CKEY_U1_MASK			0x00FF0000
2998c2ecf20Sopenharmony_ci#define	 CFG_CKEY_U(u)				((u)<<8)
3008c2ecf20Sopenharmony_ci#define	 CFG_CKEY_U_MASK			0x0000FF00
3018c2ecf20Sopenharmony_ci#define	 CFG_ALPHA_U(u)				(u)
3028c2ecf20Sopenharmony_ci#define	 CFG_ALPHA_U_MASK			0x000000FF
3038c2ecf20Sopenharmony_ci#define LCD_SPU_COLORKEY_V			0x0138
3048c2ecf20Sopenharmony_ci#define	 CFG_CKEY_V2(v2)			((v2)<<24)
3058c2ecf20Sopenharmony_ci#define	 CFG_CKEY_V2_MASK			0xFF000000
3068c2ecf20Sopenharmony_ci#define	 CFG_CKEY_V1(v1)			((v1)<<16)
3078c2ecf20Sopenharmony_ci#define	 CFG_CKEY_V1_MASK			0x00FF0000
3088c2ecf20Sopenharmony_ci#define	 CFG_CKEY_V(v)				((v)<<8)
3098c2ecf20Sopenharmony_ci#define	 CFG_CKEY_V_MASK			0x0000FF00
3108c2ecf20Sopenharmony_ci#define	 CFG_ALPHA_V(v)				(v)
3118c2ecf20Sopenharmony_ci#define	 CFG_ALPHA_V_MASK			0x000000FF
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_ci/* Graphics/Video DMA color key enable bits in LCD_TV_CTRL1 */
3148c2ecf20Sopenharmony_ci#define	 CFG_CKEY_GRA				0x2
3158c2ecf20Sopenharmony_ci#define	 CFG_CKEY_DMA				0x1
3168c2ecf20Sopenharmony_ci
3178c2ecf20Sopenharmony_ci/* Interlace mode enable bits in LCD_TV_CTRL1 */
3188c2ecf20Sopenharmony_ci#define     CFG_TV_INTERLACE_EN                 (1 << 22)
3198c2ecf20Sopenharmony_ci#define     CFG_TV_NIB                          (1 << 0)
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_ci#define LCD_PN_SEPXLCNT				0x013c /* MMP2 */
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci/* SPI Read Data Register */
3248c2ecf20Sopenharmony_ci#define LCD_SPU_SPI_RXDATA			0x0140
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci/* Smart Panel Read Data Register */
3278c2ecf20Sopenharmony_ci#define LCD_SPU_ISA_RSDATA			0x0144
3288c2ecf20Sopenharmony_ci#define	 ISA_RXDATA_16BIT_1_DATA_MASK		0x000000FF
3298c2ecf20Sopenharmony_ci#define	 ISA_RXDATA_16BIT_2_DATA_MASK		0x0000FF00
3308c2ecf20Sopenharmony_ci#define	 ISA_RXDATA_16BIT_3_DATA_MASK		0x00FF0000
3318c2ecf20Sopenharmony_ci#define	 ISA_RXDATA_16BIT_4_DATA_MASK		0xFF000000
3328c2ecf20Sopenharmony_ci#define	 ISA_RXDATA_32BIT_1_DATA_MASK		0x00FFFFFF
3338c2ecf20Sopenharmony_ci
3348c2ecf20Sopenharmony_ci#define LCD_SPU_DBG_ISA				(0x0148) /* TTC */
3358c2ecf20Sopenharmony_ci#define LCD_SPU_DMAVLD_YC			(0x014C)
3368c2ecf20Sopenharmony_ci#define LCD_SPU_DMAVLD_UV			(0x0150)
3378c2ecf20Sopenharmony_ci#define LCD_SPU_DMAVLD_UVSPU_GRAVLD		(0x0154)
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_ci#define LCD_READ_IOPAD				(0x0148) /* MMP2*/
3408c2ecf20Sopenharmony_ci#define LCD_DMAVLD_YC				(0x014C)
3418c2ecf20Sopenharmony_ci#define LCD_DMAVLD_UV				(0x0150)
3428c2ecf20Sopenharmony_ci#define LCD_TVGGRAVLD_HLEN			(0x0154)
3438c2ecf20Sopenharmony_ci
3448c2ecf20Sopenharmony_ci/* HWC SRAM Read Data Register */
3458c2ecf20Sopenharmony_ci#define LCD_SPU_HWC_RDDAT			0x0158
3468c2ecf20Sopenharmony_ci
3478c2ecf20Sopenharmony_ci/* Gamma Table SRAM Read Data Register */
3488c2ecf20Sopenharmony_ci#define LCD_SPU_GAMMA_RDDAT			0x015c
3498c2ecf20Sopenharmony_ci#define	 CFG_GAMMA_RDDAT_MASK			0x000000FF
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ci/* Palette Table SRAM Read Data Register */
3528c2ecf20Sopenharmony_ci#define LCD_SPU_PALETTE_RDDAT			0x0160
3538c2ecf20Sopenharmony_ci#define	 CFG_PALETTE_RDDAT_MASK			0x00FFFFFF
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci#define LCD_SPU_DBG_DMATOP			(0x0164) /* TTC */
3568c2ecf20Sopenharmony_ci#define LCD_SPU_DBG_GRATOP			(0x0168)
3578c2ecf20Sopenharmony_ci#define LCD_SPU_DBG_TXCTRL			(0x016C)
3588c2ecf20Sopenharmony_ci#define LCD_SPU_DBG_SLVTOP			(0x0170)
3598c2ecf20Sopenharmony_ci#define LCD_SPU_DBG_MUXTOP			(0x0174)
3608c2ecf20Sopenharmony_ci
3618c2ecf20Sopenharmony_ci#define LCD_SLV_DBG				(0x0164) /* MMP2 */
3628c2ecf20Sopenharmony_ci#define LCD_TVDVLD_YC				(0x0168)
3638c2ecf20Sopenharmony_ci#define LCD_TVDVLD_UV				(0x016C)
3648c2ecf20Sopenharmony_ci#define LCD_TVC_RDDAT				(0x0170)
3658c2ecf20Sopenharmony_ci#define LCD_TV_GAMMA_RDDAT			(0x0174)
3668c2ecf20Sopenharmony_ci
3678c2ecf20Sopenharmony_ci/* I/O Pads Input Read Only Register */
3688c2ecf20Sopenharmony_ci#define LCD_SPU_IOPAD_IN			0x0178
3698c2ecf20Sopenharmony_ci#define	 CFG_IOPAD_IN_MASK			0x0FFFFFFF
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_ci#define LCD_TV_PALETTE_RDDAT			(0x0178) /* MMP2 */
3728c2ecf20Sopenharmony_ci
3738c2ecf20Sopenharmony_ci/* Reserved Read Only Registers */
3748c2ecf20Sopenharmony_ci#define LCD_CFG_RDREG5F				0x017C
3758c2ecf20Sopenharmony_ci#define	 IRE_FRAME_CNT_MASK			0x000000C0
3768c2ecf20Sopenharmony_ci#define	 IPE_FRAME_CNT_MASK			0x00000030
3778c2ecf20Sopenharmony_ci#define	 GRA_FRAME_CNT_MASK			0x0000000C /* Graphic */
3788c2ecf20Sopenharmony_ci#define	 DMA_FRAME_CNT_MASK			0x00000003 /* Video */
3798c2ecf20Sopenharmony_ci
3808c2ecf20Sopenharmony_ci#define LCD_FRAME_CNT				(0x017C) /* MMP2 */
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_ci/* SPI Control Register. */
3838c2ecf20Sopenharmony_ci#define LCD_SPU_SPI_CTRL			0x0180
3848c2ecf20Sopenharmony_ci#define	 CFG_SCLKCNT(div)			((div)<<24) /* 0xFF~0x2 */
3858c2ecf20Sopenharmony_ci#define	 CFG_SCLKCNT_MASK			0xFF000000
3868c2ecf20Sopenharmony_ci#define	 CFG_RXBITS(rx)				(((rx) - 1)<<16) /* 0x1F~0x1 */
3878c2ecf20Sopenharmony_ci#define	 CFG_RXBITS_MASK			0x00FF0000
3888c2ecf20Sopenharmony_ci#define	 CFG_TXBITS(tx)				(((tx) - 1)<<8) /* 0x1F~0x1 */
3898c2ecf20Sopenharmony_ci#define	 CFG_TXBITS_MASK			0x0000FF00
3908c2ecf20Sopenharmony_ci#define	 CFG_CLKINV(clk)			((clk)<<7)
3918c2ecf20Sopenharmony_ci#define	 CFG_CLKINV_MASK			0x00000080
3928c2ecf20Sopenharmony_ci#define	 CFG_KEEPXFER(transfer)			((transfer)<<6)
3938c2ecf20Sopenharmony_ci#define	 CFG_KEEPXFER_MASK			0x00000040
3948c2ecf20Sopenharmony_ci#define	 CFG_RXBITSTO0(rx)			((rx)<<5)
3958c2ecf20Sopenharmony_ci#define	 CFG_RXBITSTO0_MASK			0x00000020
3968c2ecf20Sopenharmony_ci#define	 CFG_TXBITSTO0(tx)			((tx)<<4)
3978c2ecf20Sopenharmony_ci#define	 CFG_TXBITSTO0_MASK			0x00000010
3988c2ecf20Sopenharmony_ci#define	 CFG_SPI_ENA(spi)			((spi)<<3)
3998c2ecf20Sopenharmony_ci#define	 CFG_SPI_ENA_MASK			0x00000008
4008c2ecf20Sopenharmony_ci#define	 CFG_SPI_SEL(spi)			((spi)<<2)
4018c2ecf20Sopenharmony_ci#define	 CFG_SPI_SEL_MASK			0x00000004
4028c2ecf20Sopenharmony_ci#define	 CFG_SPI_3W4WB(wire)			((wire)<<1)
4038c2ecf20Sopenharmony_ci#define	 CFG_SPI_3W4WB_MASK			0x00000002
4048c2ecf20Sopenharmony_ci#define	 CFG_SPI_START(start)			(start)
4058c2ecf20Sopenharmony_ci#define	 CFG_SPI_START_MASK			0x00000001
4068c2ecf20Sopenharmony_ci
4078c2ecf20Sopenharmony_ci/* SPI Tx Data Register */
4088c2ecf20Sopenharmony_ci#define LCD_SPU_SPI_TXDATA			0x0184
4098c2ecf20Sopenharmony_ci
4108c2ecf20Sopenharmony_ci/*
4118c2ecf20Sopenharmony_ci   1. Smart Pannel 8-bit Bus Control Register.
4128c2ecf20Sopenharmony_ci   2. AHB Slave Path Data Port Register
4138c2ecf20Sopenharmony_ci*/
4148c2ecf20Sopenharmony_ci#define LCD_SPU_SMPN_CTRL			0x0188
4158c2ecf20Sopenharmony_ci
4168c2ecf20Sopenharmony_ci/* DMA Control 0 Register */
4178c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_CTRL0			0x0190
4188c2ecf20Sopenharmony_ci#define	 CFG_NOBLENDING(nb)			((nb)<<31)
4198c2ecf20Sopenharmony_ci#define	 CFG_NOBLENDING_MASK			0x80000000
4208c2ecf20Sopenharmony_ci#define	 CFG_GAMMA_ENA(gn)			((gn)<<30)
4218c2ecf20Sopenharmony_ci#define	 CFG_GAMMA_ENA_MASK			0x40000000
4228c2ecf20Sopenharmony_ci#define	 CFG_CBSH_ENA(cn)			((cn)<<29)
4238c2ecf20Sopenharmony_ci#define	 CFG_CBSH_ENA_MASK			0x20000000
4248c2ecf20Sopenharmony_ci#define	 CFG_PALETTE_ENA(pn)			((pn)<<28)
4258c2ecf20Sopenharmony_ci#define	 CFG_PALETTE_ENA_MASK			0x10000000
4268c2ecf20Sopenharmony_ci#define	 CFG_ARBFAST_ENA(an)			((an)<<27)
4278c2ecf20Sopenharmony_ci#define	 CFG_ARBFAST_ENA_MASK			0x08000000
4288c2ecf20Sopenharmony_ci#define	 CFG_HWC_1BITMOD(mode)			((mode)<<26)
4298c2ecf20Sopenharmony_ci#define	 CFG_HWC_1BITMOD_MASK			0x04000000
4308c2ecf20Sopenharmony_ci#define	 CFG_HWC_1BITENA(mn)			((mn)<<25)
4318c2ecf20Sopenharmony_ci#define	 CFG_HWC_1BITENA_MASK			0x02000000
4328c2ecf20Sopenharmony_ci#define	 CFG_HWC_ENA(cn)			((cn)<<24)
4338c2ecf20Sopenharmony_ci#define	 CFG_HWC_ENA_MASK			0x01000000
4348c2ecf20Sopenharmony_ci#define	 CFG_DMAFORMAT(dmaformat)		((dmaformat)<<20)
4358c2ecf20Sopenharmony_ci#define	 CFG_DMAFORMAT_MASK			0x00F00000
4368c2ecf20Sopenharmony_ci#define	 CFG_GRAFORMAT(graformat)		((graformat)<<16)
4378c2ecf20Sopenharmony_ci#define	 CFG_GRAFORMAT_MASK			0x000F0000
4388c2ecf20Sopenharmony_ci/* for graphic part */
4398c2ecf20Sopenharmony_ci#define	 CFG_GRA_FTOGGLE(toggle)		((toggle)<<15)
4408c2ecf20Sopenharmony_ci#define	 CFG_GRA_FTOGGLE_MASK			0x00008000
4418c2ecf20Sopenharmony_ci#define	 CFG_GRA_HSMOOTH(smooth)		((smooth)<<14)
4428c2ecf20Sopenharmony_ci#define	 CFG_GRA_HSMOOTH_MASK			0x00004000
4438c2ecf20Sopenharmony_ci#define	 CFG_GRA_TSTMODE(test)			((test)<<13)
4448c2ecf20Sopenharmony_ci#define	 CFG_GRA_TSTMODE_MASK			0x00002000
4458c2ecf20Sopenharmony_ci#define	 CFG_GRA_SWAPRB(swap)			((swap)<<12)
4468c2ecf20Sopenharmony_ci#define	 CFG_GRA_SWAPRB_MASK			0x00001000
4478c2ecf20Sopenharmony_ci#define	 CFG_GRA_SWAPUV(swap)			((swap)<<11)
4488c2ecf20Sopenharmony_ci#define	 CFG_GRA_SWAPUV_MASK			0x00000800
4498c2ecf20Sopenharmony_ci#define	 CFG_GRA_SWAPYU(swap)			((swap)<<10)
4508c2ecf20Sopenharmony_ci#define	 CFG_GRA_SWAPYU_MASK			0x00000400
4518c2ecf20Sopenharmony_ci#define	 CFG_GRA_SWAP_MASK			0x00001C00
4528c2ecf20Sopenharmony_ci#define	 CFG_YUV2RGB_GRA(cvrt)			((cvrt)<<9)
4538c2ecf20Sopenharmony_ci#define	 CFG_YUV2RGB_GRA_MASK			0x00000200
4548c2ecf20Sopenharmony_ci#define	 CFG_GRA_ENA(gra)			((gra)<<8)
4558c2ecf20Sopenharmony_ci#define	 CFG_GRA_ENA_MASK			0x00000100
4568c2ecf20Sopenharmony_ci#define dma0_gfx_masks	(CFG_GRAFORMAT_MASK | CFG_GRA_FTOGGLE_MASK | \
4578c2ecf20Sopenharmony_ci	CFG_GRA_HSMOOTH_MASK | CFG_GRA_TSTMODE_MASK | CFG_GRA_SWAP_MASK | \
4588c2ecf20Sopenharmony_ci	CFG_YUV2RGB_GRA_MASK | CFG_GRA_ENA_MASK)
4598c2ecf20Sopenharmony_ci/* for video part */
4608c2ecf20Sopenharmony_ci#define	 CFG_DMA_FTOGGLE(toggle)		((toggle)<<7)
4618c2ecf20Sopenharmony_ci#define	 CFG_DMA_FTOGGLE_MASK			0x00000080
4628c2ecf20Sopenharmony_ci#define	 CFG_DMA_HSMOOTH(smooth)		((smooth)<<6)
4638c2ecf20Sopenharmony_ci#define	 CFG_DMA_HSMOOTH_MASK			0x00000040
4648c2ecf20Sopenharmony_ci#define	 CFG_DMA_TSTMODE(test)			((test)<<5)
4658c2ecf20Sopenharmony_ci#define	 CFG_DMA_TSTMODE_MASK			0x00000020
4668c2ecf20Sopenharmony_ci#define	 CFG_DMA_SWAPRB(swap)			((swap)<<4)
4678c2ecf20Sopenharmony_ci#define	 CFG_DMA_SWAPRB_MASK			0x00000010
4688c2ecf20Sopenharmony_ci#define	 CFG_DMA_SWAPUV(swap)			((swap)<<3)
4698c2ecf20Sopenharmony_ci#define	 CFG_DMA_SWAPUV_MASK			0x00000008
4708c2ecf20Sopenharmony_ci#define	 CFG_DMA_SWAPYU(swap)			((swap)<<2)
4718c2ecf20Sopenharmony_ci#define	 CFG_DMA_SWAPYU_MASK			0x00000004
4728c2ecf20Sopenharmony_ci#define	 CFG_DMA_SWAP_MASK			0x0000001C
4738c2ecf20Sopenharmony_ci#define	 CFG_YUV2RGB_DMA(cvrt)			((cvrt)<<1)
4748c2ecf20Sopenharmony_ci#define	 CFG_YUV2RGB_DMA_MASK			0x00000002
4758c2ecf20Sopenharmony_ci#define	 CFG_DMA_ENA(video)			(video)
4768c2ecf20Sopenharmony_ci#define	 CFG_DMA_ENA_MASK			0x00000001
4778c2ecf20Sopenharmony_ci#define dma0_vid_masks	(CFG_DMAFORMAT_MASK | CFG_DMA_FTOGGLE_MASK | \
4788c2ecf20Sopenharmony_ci	CFG_DMA_HSMOOTH_MASK | CFG_DMA_TSTMODE_MASK | CFG_DMA_SWAP_MASK | \
4798c2ecf20Sopenharmony_ci	CFG_YUV2RGB_DMA_MASK | CFG_DMA_ENA_MASK)
4808c2ecf20Sopenharmony_ci#define dma_palette(val)		((val ? 1 : 0) << 28)
4818c2ecf20Sopenharmony_ci#define dma_fmt(vid, val)		((val & 0xf) << ((vid) ? 20 : 16))
4828c2ecf20Sopenharmony_ci#define dma_swaprb(vid, val)		((val ? 1 : 0) << ((vid) ? 4 : 12))
4838c2ecf20Sopenharmony_ci#define dma_swapuv(vid, val)		((val ? 1 : 0) << ((vid) ? 3 : 11))
4848c2ecf20Sopenharmony_ci#define dma_swapyuv(vid, val)		((val ? 1 : 0) << ((vid) ? 2 : 10))
4858c2ecf20Sopenharmony_ci#define dma_csc(vid, val)		((val ? 1 : 0) << ((vid) ? 1 : 9))
4868c2ecf20Sopenharmony_ci#define dma_hsmooth(vid, val)		((val ? 1 : 0) << ((vid) ? 6 : 14))
4878c2ecf20Sopenharmony_ci#define dma_mask(vid)	(dma_palette(1) | dma_fmt(vid, 0xf) | dma_csc(vid, 1) \
4888c2ecf20Sopenharmony_ci	| dma_swaprb(vid, 1) | dma_swapuv(vid, 1) | dma_swapyuv(vid, 1))
4898c2ecf20Sopenharmony_ci
4908c2ecf20Sopenharmony_ci/* DMA Control 1 Register */
4918c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_CTRL1			0x0194
4928c2ecf20Sopenharmony_ci#define	 CFG_FRAME_TRIG(trig)			((trig)<<31)
4938c2ecf20Sopenharmony_ci#define	 CFG_FRAME_TRIG_MASK			0x80000000
4948c2ecf20Sopenharmony_ci#define	 CFG_VSYNC_TRIG(trig)			((trig)<<28)
4958c2ecf20Sopenharmony_ci#define	 CFG_VSYNC_TRIG_MASK			0x70000000
4968c2ecf20Sopenharmony_ci#define	 CFG_VSYNC_INV(inv)			((inv)<<27)
4978c2ecf20Sopenharmony_ci#define	 CFG_VSYNC_INV_MASK			0x08000000
4988c2ecf20Sopenharmony_ci#define	 CFG_COLOR_KEY_MODE(cmode)		((cmode)<<24)
4998c2ecf20Sopenharmony_ci#define	 CFG_COLOR_KEY_MASK			0x07000000
5008c2ecf20Sopenharmony_ci#define	 CFG_CARRY(carry)			((carry)<<23)
5018c2ecf20Sopenharmony_ci#define	 CFG_CARRY_MASK				0x00800000
5028c2ecf20Sopenharmony_ci#define	 CFG_LNBUF_ENA(lnbuf)			((lnbuf)<<22)
5038c2ecf20Sopenharmony_ci#define	 CFG_LNBUF_ENA_MASK			0x00400000
5048c2ecf20Sopenharmony_ci#define	 CFG_GATED_ENA(gated)			((gated)<<21)
5058c2ecf20Sopenharmony_ci#define	 CFG_GATED_ENA_MASK			0x00200000
5068c2ecf20Sopenharmony_ci#define	 CFG_PWRDN_ENA(power)			((power)<<20)
5078c2ecf20Sopenharmony_ci#define	 CFG_PWRDN_ENA_MASK			0x00100000
5088c2ecf20Sopenharmony_ci#define	 CFG_DSCALE(dscale)			((dscale)<<18)
5098c2ecf20Sopenharmony_ci#define	 CFG_DSCALE_MASK			0x000C0000
5108c2ecf20Sopenharmony_ci#define	 CFG_ALPHA_MODE(amode)			((amode)<<16)
5118c2ecf20Sopenharmony_ci#define	 CFG_ALPHA_MODE_MASK			0x00030000
5128c2ecf20Sopenharmony_ci#define	 CFG_ALPHA(alpha)			((alpha)<<8)
5138c2ecf20Sopenharmony_ci#define	 CFG_ALPHA_MASK				0x0000FF00
5148c2ecf20Sopenharmony_ci#define	 CFG_PXLCMD(pxlcmd)			(pxlcmd)
5158c2ecf20Sopenharmony_ci#define	 CFG_PXLCMD_MASK			0x000000FF
5168c2ecf20Sopenharmony_ci
5178c2ecf20Sopenharmony_ci/* SRAM Control Register */
5188c2ecf20Sopenharmony_ci#define LCD_SPU_SRAM_CTRL			0x0198
5198c2ecf20Sopenharmony_ci#define	 CFG_SRAM_INIT_WR_RD(mode)		((mode)<<14)
5208c2ecf20Sopenharmony_ci#define	 CFG_SRAM_INIT_WR_RD_MASK		0x0000C000
5218c2ecf20Sopenharmony_ci#define	 CFG_SRAM_ADDR_LCDID(id)		((id)<<8)
5228c2ecf20Sopenharmony_ci#define	 CFG_SRAM_ADDR_LCDID_MASK		0x00000F00
5238c2ecf20Sopenharmony_ci#define	 CFG_SRAM_ADDR(addr)			(addr)
5248c2ecf20Sopenharmony_ci#define	 CFG_SRAM_ADDR_MASK			0x000000FF
5258c2ecf20Sopenharmony_ci
5268c2ecf20Sopenharmony_ci/* SRAM Write Data Register */
5278c2ecf20Sopenharmony_ci#define LCD_SPU_SRAM_WRDAT			0x019C
5288c2ecf20Sopenharmony_ci
5298c2ecf20Sopenharmony_ci/* SRAM RTC/WTC Control Register */
5308c2ecf20Sopenharmony_ci#define LCD_SPU_SRAM_PARA0			0x01A0
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_ci/* SRAM Power Down Control Register */
5338c2ecf20Sopenharmony_ci#define LCD_SPU_SRAM_PARA1			0x01A4
5348c2ecf20Sopenharmony_ci#define	 CFG_CSB_256x32(hwc)			((hwc)<<15)	/* HWC */
5358c2ecf20Sopenharmony_ci#define	 CFG_CSB_256x32_MASK			0x00008000
5368c2ecf20Sopenharmony_ci#define	 CFG_CSB_256x24(palette)		((palette)<<14)	/* Palette */
5378c2ecf20Sopenharmony_ci#define	 CFG_CSB_256x24_MASK			0x00004000
5388c2ecf20Sopenharmony_ci#define	 CFG_CSB_256x8(gamma)			((gamma)<<13)	/* Gamma */
5398c2ecf20Sopenharmony_ci#define	 CFG_CSB_256x8_MASK			0x00002000
5408c2ecf20Sopenharmony_ci#define	 CFG_PDWN256x32(pdwn)			((pdwn)<<7)	/* HWC */
5418c2ecf20Sopenharmony_ci#define	 CFG_PDWN256x32_MASK			0x00000080
5428c2ecf20Sopenharmony_ci#define	 CFG_PDWN256x24(pdwn)			((pdwn)<<6)	/* Palette */
5438c2ecf20Sopenharmony_ci#define	 CFG_PDWN256x24_MASK			0x00000040
5448c2ecf20Sopenharmony_ci#define	 CFG_PDWN256x8(pdwn)			((pdwn)<<5)	/* Gamma */
5458c2ecf20Sopenharmony_ci#define	 CFG_PDWN256x8_MASK			0x00000020
5468c2ecf20Sopenharmony_ci#define	 CFG_PDWN32x32(pdwn)			((pdwn)<<3)
5478c2ecf20Sopenharmony_ci#define	 CFG_PDWN32x32_MASK			0x00000008
5488c2ecf20Sopenharmony_ci#define	 CFG_PDWN16x66(pdwn)			((pdwn)<<2)
5498c2ecf20Sopenharmony_ci#define	 CFG_PDWN16x66_MASK			0x00000004
5508c2ecf20Sopenharmony_ci#define	 CFG_PDWN32x66(pdwn)			((pdwn)<<1)
5518c2ecf20Sopenharmony_ci#define	 CFG_PDWN32x66_MASK			0x00000002
5528c2ecf20Sopenharmony_ci#define	 CFG_PDWN64x66(pdwn)			(pdwn)
5538c2ecf20Sopenharmony_ci#define	 CFG_PDWN64x66_MASK			0x00000001
5548c2ecf20Sopenharmony_ci
5558c2ecf20Sopenharmony_ci/* Smart or Dumb Panel Clock Divider */
5568c2ecf20Sopenharmony_ci#define LCD_CFG_SCLK_DIV			0x01A8
5578c2ecf20Sopenharmony_ci#define	 SCLK_SRC_SEL(src)		((src)<<31)
5588c2ecf20Sopenharmony_ci#define	 SCLK_SRC_SEL_MASK		0x80000000
5598c2ecf20Sopenharmony_ci#define  SCLK_DISABLE				(1<<28)
5608c2ecf20Sopenharmony_ci#define	 CLK_FRACDIV(frac)			((frac)<<16)
5618c2ecf20Sopenharmony_ci#define	 CLK_FRACDIV_MASK			0x0FFF0000
5628c2ecf20Sopenharmony_ci#define	 DSI1_BITCLK_DIV(div)			(div<<8)
5638c2ecf20Sopenharmony_ci#define	 DSI1_BITCLK_DIV_MASK			0x00000F00
5648c2ecf20Sopenharmony_ci#define	 CLK_INT_DIV(div)			(div)
5658c2ecf20Sopenharmony_ci#define	 CLK_INT_DIV_MASK			0x000000FF
5668c2ecf20Sopenharmony_ci
5678c2ecf20Sopenharmony_ci/* Video Contrast Register */
5688c2ecf20Sopenharmony_ci#define LCD_SPU_CONTRAST			0x01AC
5698c2ecf20Sopenharmony_ci#define	 CFG_BRIGHTNESS(bright)			((bright)<<16)
5708c2ecf20Sopenharmony_ci#define	 CFG_BRIGHTNESS_MASK			0xFFFF0000
5718c2ecf20Sopenharmony_ci#define	 CFG_CONTRAST(contrast)			(contrast)
5728c2ecf20Sopenharmony_ci#define	 CFG_CONTRAST_MASK			0x0000FFFF
5738c2ecf20Sopenharmony_ci
5748c2ecf20Sopenharmony_ci/* Video Saturation Register */
5758c2ecf20Sopenharmony_ci#define LCD_SPU_SATURATION			0x01B0
5768c2ecf20Sopenharmony_ci#define	 CFG_C_MULTS(mult)			((mult)<<16)
5778c2ecf20Sopenharmony_ci#define	 CFG_C_MULTS_MASK			0xFFFF0000
5788c2ecf20Sopenharmony_ci#define	 CFG_SATURATION(sat)			(sat)
5798c2ecf20Sopenharmony_ci#define	 CFG_SATURATION_MASK			0x0000FFFF
5808c2ecf20Sopenharmony_ci
5818c2ecf20Sopenharmony_ci/* Video Hue Adjust Register */
5828c2ecf20Sopenharmony_ci#define LCD_SPU_CBSH_HUE			0x01B4
5838c2ecf20Sopenharmony_ci#define	 CFG_SIN0(sin0)				((sin0)<<16)
5848c2ecf20Sopenharmony_ci#define	 CFG_SIN0_MASK				0xFFFF0000
5858c2ecf20Sopenharmony_ci#define	 CFG_COS0(con0)				(con0)
5868c2ecf20Sopenharmony_ci#define	 CFG_COS0_MASK				0x0000FFFF
5878c2ecf20Sopenharmony_ci
5888c2ecf20Sopenharmony_ci/* Dump LCD Panel Control Register */
5898c2ecf20Sopenharmony_ci#define LCD_SPU_DUMB_CTRL			0x01B8
5908c2ecf20Sopenharmony_ci#define	 CFG_DUMBMODE(mode)			((mode)<<28)
5918c2ecf20Sopenharmony_ci#define	 CFG_DUMBMODE_MASK			0xF0000000
5928c2ecf20Sopenharmony_ci#define	 CFG_INTFRBSWAP(mode)			((mode)<<24)
5938c2ecf20Sopenharmony_ci#define	 CFG_INTFRBSWAP_MASK			0x0F000000
5948c2ecf20Sopenharmony_ci#define	 CFG_LCDGPIO_O(data)			((data)<<20)
5958c2ecf20Sopenharmony_ci#define	 CFG_LCDGPIO_O_MASK			0x0FF00000
5968c2ecf20Sopenharmony_ci#define	 CFG_LCDGPIO_ENA(gpio)			((gpio)<<12)
5978c2ecf20Sopenharmony_ci#define	 CFG_LCDGPIO_ENA_MASK			0x000FF000
5988c2ecf20Sopenharmony_ci#define	 CFG_BIAS_OUT(bias)			((bias)<<8)
5998c2ecf20Sopenharmony_ci#define	 CFG_BIAS_OUT_MASK			0x00000100
6008c2ecf20Sopenharmony_ci#define	 CFG_REVERSE_RGB(RGB)			((RGB)<<7)
6018c2ecf20Sopenharmony_ci#define	 CFG_REVERSE_RGB_MASK			0x00000080
6028c2ecf20Sopenharmony_ci#define	 CFG_INV_COMPBLANK(blank)		((blank)<<6)
6038c2ecf20Sopenharmony_ci#define	 CFG_INV_COMPBLANK_MASK			0x00000040
6048c2ecf20Sopenharmony_ci#define	 CFG_INV_COMPSYNC(sync)			((sync)<<5)
6058c2ecf20Sopenharmony_ci#define	 CFG_INV_COMPSYNC_MASK			0x00000020
6068c2ecf20Sopenharmony_ci#define	 CFG_INV_HENA(hena)			((hena)<<4)
6078c2ecf20Sopenharmony_ci#define	 CFG_INV_HENA_MASK			0x00000010
6088c2ecf20Sopenharmony_ci#define	 CFG_INV_VSYNC(vsync)			((vsync)<<3)
6098c2ecf20Sopenharmony_ci#define	 CFG_INV_VSYNC_MASK			0x00000008
6108c2ecf20Sopenharmony_ci#define	 CFG_INV_HSYNC(hsync)			((hsync)<<2)
6118c2ecf20Sopenharmony_ci#define	 CFG_INV_HSYNC_MASK			0x00000004
6128c2ecf20Sopenharmony_ci#define	 CFG_INV_PCLK(pclk)			((pclk)<<1)
6138c2ecf20Sopenharmony_ci#define	 CFG_INV_PCLK_MASK			0x00000002
6148c2ecf20Sopenharmony_ci#define	 CFG_DUMB_ENA(dumb)			(dumb)
6158c2ecf20Sopenharmony_ci#define	 CFG_DUMB_ENA_MASK			0x00000001
6168c2ecf20Sopenharmony_ci
6178c2ecf20Sopenharmony_ci/* LCD I/O Pads Control Register */
6188c2ecf20Sopenharmony_ci#define SPU_IOPAD_CONTROL			0x01BC
6198c2ecf20Sopenharmony_ci#define	 CFG_GRA_VM_ENA(vm)			((vm)<<15)
6208c2ecf20Sopenharmony_ci#define	 CFG_GRA_VM_ENA_MASK			0x00008000
6218c2ecf20Sopenharmony_ci#define	 CFG_DMA_VM_ENA(vm)			((vm)<<13)
6228c2ecf20Sopenharmony_ci#define	 CFG_DMA_VM_ENA_MASK			0x00002000
6238c2ecf20Sopenharmony_ci#define	 CFG_CMD_VM_ENA(vm)			((vm)<<12)
6248c2ecf20Sopenharmony_ci#define	 CFG_CMD_VM_ENA_MASK			0x00001000
6258c2ecf20Sopenharmony_ci#define	 CFG_CSC(csc)				((csc)<<8)
6268c2ecf20Sopenharmony_ci#define	 CFG_CSC_MASK				0x00000300
6278c2ecf20Sopenharmony_ci#define	 CFG_BOUNDARY(size)			((size)<<5)
6288c2ecf20Sopenharmony_ci#define	 CFG_BOUNDARY_MASK			0x00000020
6298c2ecf20Sopenharmony_ci#define	 CFG_BURST(len)				((len)<<4)
6308c2ecf20Sopenharmony_ci#define	 CFG_BURST_MASK				0x00000010
6318c2ecf20Sopenharmony_ci#define	 CFG_IOPADMODE(iopad)			(iopad)
6328c2ecf20Sopenharmony_ci#define	 CFG_IOPADMODE_MASK			0x0000000F
6338c2ecf20Sopenharmony_ci
6348c2ecf20Sopenharmony_ci/* LCD Interrupt Control Register */
6358c2ecf20Sopenharmony_ci#define SPU_IRQ_ENA				0x01C0
6368c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ0_ENA(irq)		((irq)<<31)
6378c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ0_ENA_MASK		0x80000000
6388c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ1_ENA(irq)		((irq)<<30)
6398c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ1_ENA_MASK		0x40000000
6408c2ecf20Sopenharmony_ci#define	 DMA_FF_UNDERFLOW_ENA(ff)		((ff)<<29)
6418c2ecf20Sopenharmony_ci#define	 DMA_FF_UNDERFLOW_ENA_MASK		0x20000000
6428c2ecf20Sopenharmony_ci#define	 AXI_BUS_ERROR_IRQ_ENA(irq)		((irq)<<28)
6438c2ecf20Sopenharmony_ci#define	 AXI_BUS_ERROR_IRQ_ENA_MASK		0x10000000
6448c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ0_ENA(irq)		((irq)<<27)
6458c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ0_ENA_MASK		0x08000000
6468c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ1_ENA(irq)		((irq)<<26)
6478c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ1_ENA_MASK		0x04000000
6488c2ecf20Sopenharmony_ci#define	 GRA_FF_UNDERFLOW_ENA(ff)		((ff)<<25)
6498c2ecf20Sopenharmony_ci#define	 GRA_FF_UNDERFLOW_ENA_MASK		0x02000000
6508c2ecf20Sopenharmony_ci#define	 VSYNC_IRQ_ENA(vsync_irq)		((vsync_irq)<<23)
6518c2ecf20Sopenharmony_ci#define	 VSYNC_IRQ_ENA_MASK			0x00800000
6528c2ecf20Sopenharmony_ci#define	 DUMB_FRAMEDONE_ENA(fdone)		((fdone)<<22)
6538c2ecf20Sopenharmony_ci#define	 DUMB_FRAMEDONE_ENA_MASK		0x00400000
6548c2ecf20Sopenharmony_ci#define	 TWC_FRAMEDONE_ENA(fdone)		((fdone)<<21)
6558c2ecf20Sopenharmony_ci#define	 TWC_FRAMEDONE_ENA_MASK			0x00200000
6568c2ecf20Sopenharmony_ci#define	 HWC_FRAMEDONE_ENA(fdone)		((fdone)<<20)
6578c2ecf20Sopenharmony_ci#define	 HWC_FRAMEDONE_ENA_MASK			0x00100000
6588c2ecf20Sopenharmony_ci#define	 SLV_IRQ_ENA(irq)			((irq)<<19)
6598c2ecf20Sopenharmony_ci#define	 SLV_IRQ_ENA_MASK			0x00080000
6608c2ecf20Sopenharmony_ci#define	 SPI_IRQ_ENA(irq)			((irq)<<18)
6618c2ecf20Sopenharmony_ci#define	 SPI_IRQ_ENA_MASK			0x00040000
6628c2ecf20Sopenharmony_ci#define	 PWRDN_IRQ_ENA(irq)			((irq)<<17)
6638c2ecf20Sopenharmony_ci#define	 PWRDN_IRQ_ENA_MASK			0x00020000
6648c2ecf20Sopenharmony_ci#define	 AXI_LATENCY_TOO_LONG_IRQ_ENA(irq)	((irq)<<16)
6658c2ecf20Sopenharmony_ci#define  AXI_LATENCY_TOO_LONG_IRQ_ENA_MASK	0x00010000
6668c2ecf20Sopenharmony_ci#define	 CLEAN_SPU_IRQ_ISR(irq)			(irq)
6678c2ecf20Sopenharmony_ci#define	 CLEAN_SPU_IRQ_ISR_MASK			0x0000FFFF
6688c2ecf20Sopenharmony_ci#define	 TV_DMA_FRAME_IRQ0_ENA(irq)		((irq)<<15)
6698c2ecf20Sopenharmony_ci#define	 TV_DMA_FRAME_IRQ0_ENA_MASK		0x00008000
6708c2ecf20Sopenharmony_ci#define	 TV_DMA_FRAME_IRQ1_ENA(irq)		((irq)<<14)
6718c2ecf20Sopenharmony_ci#define	 TV_DMA_FRAME_IRQ1_ENA_MASK		0x00004000
6728c2ecf20Sopenharmony_ci#define	 TV_DMA_FF_UNDERFLOW_ENA(unerrun)	((unerrun)<<13)
6738c2ecf20Sopenharmony_ci#define	 TV_DMA_FF_UNDERFLOW_ENA_MASK		0x00002000
6748c2ecf20Sopenharmony_ci#define	 TVSYNC_IRQ_ENA(irq)			((irq)<<12)
6758c2ecf20Sopenharmony_ci#define	 TVSYNC_IRQ_ENA_MASK			0x00001000
6768c2ecf20Sopenharmony_ci#define	 TV_FRAME_IRQ0_ENA(irq)			((irq)<<11)
6778c2ecf20Sopenharmony_ci#define	 TV_FRAME_IRQ0_ENA_MASK			0x00000800
6788c2ecf20Sopenharmony_ci#define	 TV_FRAME_IRQ1_ENA(irq)			((irq)<<10)
6798c2ecf20Sopenharmony_ci#define	 TV_FRAME_IRQ1_ENA_MASK			0x00000400
6808c2ecf20Sopenharmony_ci#define	 TV_GRA_FF_UNDERFLOW_ENA(unerrun)	((unerrun)<<9)
6818c2ecf20Sopenharmony_ci#define	 TV_GRA_FF_UNDERFLOW_ENA_MASK		0x00000200
6828c2ecf20Sopenharmony_ci#define	 TV_FRAMEDONE_ENA(irq)			((irq)<<8)
6838c2ecf20Sopenharmony_ci#define	 TV_FRAMEDONE_ENA_MASK			0x00000100
6848c2ecf20Sopenharmony_ci
6858c2ecf20Sopenharmony_ci/* FIXME - JUST GUESS */
6868c2ecf20Sopenharmony_ci#define	 PN2_DMA_FRAME_IRQ0_ENA(irq)		((irq)<<7)
6878c2ecf20Sopenharmony_ci#define	 PN2_DMA_FRAME_IRQ0_ENA_MASK		0x00000080
6888c2ecf20Sopenharmony_ci#define	 PN2_DMA_FRAME_IRQ1_ENA(irq)		((irq)<<6)
6898c2ecf20Sopenharmony_ci#define	 PN2_DMA_FRAME_IRQ1_ENA_MASK		0x00000040
6908c2ecf20Sopenharmony_ci#define	 PN2_DMA_FF_UNDERFLOW_ENA(ff)		((ff)<<5)
6918c2ecf20Sopenharmony_ci#define	 PN2_DMA_FF_UNDERFLOW_ENA_MASK		0x00000020
6928c2ecf20Sopenharmony_ci#define	 PN2_GRA_FRAME_IRQ0_ENA(irq)		((irq)<<3)
6938c2ecf20Sopenharmony_ci#define	 PN2_GRA_FRAME_IRQ0_ENA_MASK		0x00000008
6948c2ecf20Sopenharmony_ci#define	 PN2_GRA_FRAME_IRQ1_ENA(irq)		((irq)<<2)
6958c2ecf20Sopenharmony_ci#define	 PN2_GRA_FRAME_IRQ1_ENA_MASK		0x04000004
6968c2ecf20Sopenharmony_ci#define	 PN2_GRA_FF_UNDERFLOW_ENA(ff)		((ff)<<1)
6978c2ecf20Sopenharmony_ci#define	 PN2_GRA_FF_UNDERFLOW_ENA_MASK		0x00000002
6988c2ecf20Sopenharmony_ci#define	 PN2_VSYNC_IRQ_ENA(irq)			((irq)<<0)
6998c2ecf20Sopenharmony_ci#define	 PN2_SYNC_IRQ_ENA_MASK			0x00000001
7008c2ecf20Sopenharmony_ci
7018c2ecf20Sopenharmony_ci#define gf0_imask(id)	((id) ? (((id) & 1) ? TV_FRAME_IRQ0_ENA_MASK \
7028c2ecf20Sopenharmony_ci		: PN2_GRA_FRAME_IRQ0_ENA_MASK) : GRA_FRAME_IRQ0_ENA_MASK)
7038c2ecf20Sopenharmony_ci#define gf1_imask(id)	((id) ? (((id) & 1) ? TV_FRAME_IRQ1_ENA_MASK \
7048c2ecf20Sopenharmony_ci		: PN2_GRA_FRAME_IRQ1_ENA_MASK) : GRA_FRAME_IRQ1_ENA_MASK)
7058c2ecf20Sopenharmony_ci#define vsync_imask(id)	((id) ? (((id) & 1) ? TVSYNC_IRQ_ENA_MASK \
7068c2ecf20Sopenharmony_ci		: PN2_SYNC_IRQ_ENA_MASK) : VSYNC_IRQ_ENA_MASK)
7078c2ecf20Sopenharmony_ci#define vsync_imasks	(vsync_imask(0) | vsync_imask(1))
7088c2ecf20Sopenharmony_ci
7098c2ecf20Sopenharmony_ci#define display_done_imask(id)	((id) ? (((id) & 1) ? TV_FRAMEDONE_ENA_MASK\
7108c2ecf20Sopenharmony_ci	: (PN2_DMA_FRAME_IRQ0_ENA_MASK | PN2_DMA_FRAME_IRQ1_ENA_MASK))\
7118c2ecf20Sopenharmony_ci	: DUMB_FRAMEDONE_ENA_MASK)
7128c2ecf20Sopenharmony_ci
7138c2ecf20Sopenharmony_ci#define display_done_imasks	(display_done_imask(0) | display_done_imask(1))
7148c2ecf20Sopenharmony_ci
7158c2ecf20Sopenharmony_ci#define vf0_imask(id)	((id) ? (((id) & 1) ? TV_DMA_FRAME_IRQ0_ENA_MASK \
7168c2ecf20Sopenharmony_ci		: PN2_DMA_FRAME_IRQ0_ENA_MASK) : DMA_FRAME_IRQ0_ENA_MASK)
7178c2ecf20Sopenharmony_ci#define vf1_imask(id)	((id) ? (((id) & 1) ? TV_DMA_FRAME_IRQ1_ENA_MASK \
7188c2ecf20Sopenharmony_ci		: PN2_DMA_FRAME_IRQ1_ENA_MASK) : DMA_FRAME_IRQ1_ENA_MASK)
7198c2ecf20Sopenharmony_ci
7208c2ecf20Sopenharmony_ci#define gfx_imasks	(gf0_imask(0) | gf1_imask(0) | gf0_imask(1) | \
7218c2ecf20Sopenharmony_ci		gf1_imask(1))
7228c2ecf20Sopenharmony_ci#define vid_imasks	(vf0_imask(0) | vf1_imask(0) | vf0_imask(1) | \
7238c2ecf20Sopenharmony_ci		vf1_imask(1))
7248c2ecf20Sopenharmony_ci#define vid_imask(id)	(display_done_imask(id))
7258c2ecf20Sopenharmony_ci
7268c2ecf20Sopenharmony_ci#define pn1_imasks	(gf0_imask(0) | gf1_imask(0) | vsync_imask(0) | \
7278c2ecf20Sopenharmony_ci		display_done_imask(0) | vf0_imask(0) | vf1_imask(0))
7288c2ecf20Sopenharmony_ci#define tv_imasks	(gf0_imask(1) | gf1_imask(1) | vsync_imask(1) | \
7298c2ecf20Sopenharmony_ci		display_done_imask(1) | vf0_imask(1) | vf1_imask(1))
7308c2ecf20Sopenharmony_ci#define path_imasks(id)	((id) ? (tv_imasks) : (pn1_imasks))
7318c2ecf20Sopenharmony_ci
7328c2ecf20Sopenharmony_ci/* error indications */
7338c2ecf20Sopenharmony_ci#define vid_udflow_imask(id)	((id) ? (((id) & 1) ? \
7348c2ecf20Sopenharmony_ci	(TV_DMA_FF_UNDERFLOW_ENA_MASK) : (PN2_DMA_FF_UNDERFLOW_ENA_MASK)) : \
7358c2ecf20Sopenharmony_ci	(DMA_FF_UNDERFLOW_ENA_MASK))
7368c2ecf20Sopenharmony_ci#define gfx_udflow_imask(id)	((id) ? (((id) & 1) ? \
7378c2ecf20Sopenharmony_ci	(TV_GRA_FF_UNDERFLOW_ENA_MASK) : (PN2_GRA_FF_UNDERFLOW_ENA_MASK)) : \
7388c2ecf20Sopenharmony_ci	(GRA_FF_UNDERFLOW_ENA_MASK))
7398c2ecf20Sopenharmony_ci
7408c2ecf20Sopenharmony_ci#define err_imask(id) (vid_udflow_imask(id) | gfx_udflow_imask(id) | \
7418c2ecf20Sopenharmony_ci	AXI_BUS_ERROR_IRQ_ENA_MASK | AXI_LATENCY_TOO_LONG_IRQ_ENA_MASK)
7428c2ecf20Sopenharmony_ci#define err_imasks (err_imask(0) | err_imask(1) | err_imask(2))
7438c2ecf20Sopenharmony_ci/* LCD Interrupt Status Register */
7448c2ecf20Sopenharmony_ci#define SPU_IRQ_ISR			0x01C4
7458c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ0(irq)		((irq)<<31)
7468c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ0_MASK		0x80000000
7478c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ1(irq)		((irq)<<30)
7488c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ1_MASK		0x40000000
7498c2ecf20Sopenharmony_ci#define	 DMA_FF_UNDERFLOW(ff)		((ff)<<29)
7508c2ecf20Sopenharmony_ci#define	 DMA_FF_UNDERFLOW_MASK		0x20000000
7518c2ecf20Sopenharmony_ci#define	 AXI_BUS_ERROR_IRQ(irq)		((irq)<<28)
7528c2ecf20Sopenharmony_ci#define	 AXI_BUS_ERROR_IRQ_MASK		0x10000000
7538c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ0(irq)		((irq)<<27)
7548c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ0_MASK		0x08000000
7558c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ1(irq)		((irq)<<26)
7568c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ1_MASK		0x04000000
7578c2ecf20Sopenharmony_ci#define	 GRA_FF_UNDERFLOW(ff)		((ff)<<25)
7588c2ecf20Sopenharmony_ci#define	 GRA_FF_UNDERFLOW_MASK		0x02000000
7598c2ecf20Sopenharmony_ci#define	 VSYNC_IRQ(vsync_irq)		((vsync_irq)<<23)
7608c2ecf20Sopenharmony_ci#define	 VSYNC_IRQ_MASK			0x00800000
7618c2ecf20Sopenharmony_ci#define	 DUMB_FRAMEDONE(fdone)		((fdone)<<22)
7628c2ecf20Sopenharmony_ci#define	 DUMB_FRAMEDONE_MASK		0x00400000
7638c2ecf20Sopenharmony_ci#define	 TWC_FRAMEDONE(fdone)		((fdone)<<21)
7648c2ecf20Sopenharmony_ci#define	 TWC_FRAMEDONE_MASK		0x00200000
7658c2ecf20Sopenharmony_ci#define	 HWC_FRAMEDONE(fdone)		((fdone)<<20)
7668c2ecf20Sopenharmony_ci#define	 HWC_FRAMEDONE_MASK		0x00100000
7678c2ecf20Sopenharmony_ci#define	 SLV_IRQ(irq)			((irq)<<19)
7688c2ecf20Sopenharmony_ci#define	 SLV_IRQ_MASK			0x00080000
7698c2ecf20Sopenharmony_ci#define	 SPI_IRQ(irq)			((irq)<<18)
7708c2ecf20Sopenharmony_ci#define	 SPI_IRQ_MASK			0x00040000
7718c2ecf20Sopenharmony_ci#define	 PWRDN_IRQ(irq)			((irq)<<17)
7728c2ecf20Sopenharmony_ci#define	 PWRDN_IRQ_MASK			0x00020000
7738c2ecf20Sopenharmony_ci#define	 AXI_LATENCY_TOO_LONGR_IRQ(irq)	((irq)<<16)
7748c2ecf20Sopenharmony_ci#define	 AXI_LATENCY_TOO_LONGR_IRQ_MASK	0x00010000
7758c2ecf20Sopenharmony_ci#define	 TV_DMA_FRAME_IRQ0(irq)		((irq)<<15)
7768c2ecf20Sopenharmony_ci#define	 TV_DMA_FRAME_IRQ0_MASK		0x00008000
7778c2ecf20Sopenharmony_ci#define	 TV_DMA_FRAME_IRQ1(irq)		((irq)<<14)
7788c2ecf20Sopenharmony_ci#define	 TV_DMA_FRAME_IRQ1_MASK		0x00004000
7798c2ecf20Sopenharmony_ci#define	 TV_DMA_FF_UNDERFLOW(unerrun)	((unerrun)<<13)
7808c2ecf20Sopenharmony_ci#define	 TV_DMA_FF_UNDERFLOW_MASK	0x00002000
7818c2ecf20Sopenharmony_ci#define	 TVSYNC_IRQ(irq)		((irq)<<12)
7828c2ecf20Sopenharmony_ci#define	 TVSYNC_IRQ_MASK		0x00001000
7838c2ecf20Sopenharmony_ci#define	 TV_FRAME_IRQ0(irq)		((irq)<<11)
7848c2ecf20Sopenharmony_ci#define	 TV_FRAME_IRQ0_MASK		0x00000800
7858c2ecf20Sopenharmony_ci#define	 TV_FRAME_IRQ1(irq)		((irq)<<10)
7868c2ecf20Sopenharmony_ci#define	 TV_FRAME_IRQ1_MASK		0x00000400
7878c2ecf20Sopenharmony_ci#define	 TV_GRA_FF_UNDERFLOW(unerrun)	((unerrun)<<9)
7888c2ecf20Sopenharmony_ci#define	 TV_GRA_FF_UNDERFLOW_MASK	0x00000200
7898c2ecf20Sopenharmony_ci#define	 PN2_DMA_FRAME_IRQ0(irq)	((irq)<<7)
7908c2ecf20Sopenharmony_ci#define	 PN2_DMA_FRAME_IRQ0_MASK	0x00000080
7918c2ecf20Sopenharmony_ci#define	 PN2_DMA_FRAME_IRQ1(irq)	((irq)<<6)
7928c2ecf20Sopenharmony_ci#define	 PN2_DMA_FRAME_IRQ1_MASK	0x00000040
7938c2ecf20Sopenharmony_ci#define	 PN2_DMA_FF_UNDERFLOW(ff)	((ff)<<5)
7948c2ecf20Sopenharmony_ci#define	 PN2_DMA_FF_UNDERFLOW_MASK	0x00000020
7958c2ecf20Sopenharmony_ci#define	 PN2_GRA_FRAME_IRQ0(irq)	((irq)<<3)
7968c2ecf20Sopenharmony_ci#define	 PN2_GRA_FRAME_IRQ0_MASK	0x00000008
7978c2ecf20Sopenharmony_ci#define	 PN2_GRA_FRAME_IRQ1(irq)	((irq)<<2)
7988c2ecf20Sopenharmony_ci#define	 PN2_GRA_FRAME_IRQ1_MASK	0x04000004
7998c2ecf20Sopenharmony_ci#define	 PN2_GRA_FF_UNDERFLOW(ff)	((ff)<<1)
8008c2ecf20Sopenharmony_ci#define	 PN2_GRA_FF_UNDERFLOW_MASK	0x00000002
8018c2ecf20Sopenharmony_ci#define	 PN2_VSYNC_IRQ(irq)		((irq)<<0)
8028c2ecf20Sopenharmony_ci#define	 PN2_SYNC_IRQ_MASK		0x00000001
8038c2ecf20Sopenharmony_ci
8048c2ecf20Sopenharmony_ci/* LCD FIFO Depth register */
8058c2ecf20Sopenharmony_ci#define LCD_FIFO_DEPTH			0x01c8
8068c2ecf20Sopenharmony_ci#define	 VIDEO_FIFO(fi)			((fi) << 0)
8078c2ecf20Sopenharmony_ci#define	 VIDEO_FIFO_MASK		0x00000003
8088c2ecf20Sopenharmony_ci#define	 GRAPHIC_FIFO(fi)		((fi) << 2)
8098c2ecf20Sopenharmony_ci#define	 GRAPHIC_FIFO_MASK		0x0000000c
8108c2ecf20Sopenharmony_ci
8118c2ecf20Sopenharmony_ci/* read-only */
8128c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ0_LEVEL_MASK		0x00008000
8138c2ecf20Sopenharmony_ci#define	 DMA_FRAME_IRQ1_LEVEL_MASK		0x00004000
8148c2ecf20Sopenharmony_ci#define	 DMA_FRAME_CNT_ISR_MASK			0x00003000
8158c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ0_LEVEL_MASK		0x00000800
8168c2ecf20Sopenharmony_ci#define	 GRA_FRAME_IRQ1_LEVEL_MASK		0x00000400
8178c2ecf20Sopenharmony_ci#define	 GRA_FRAME_CNT_ISR_MASK			0x00000300
8188c2ecf20Sopenharmony_ci#define	 VSYNC_IRQ_LEVEL_MASK			0x00000080
8198c2ecf20Sopenharmony_ci#define	 DUMB_FRAMEDONE_LEVEL_MASK		0x00000040
8208c2ecf20Sopenharmony_ci#define	 TWC_FRAMEDONE_LEVEL_MASK		0x00000020
8218c2ecf20Sopenharmony_ci#define	 HWC_FRAMEDONE_LEVEL_MASK		0x00000010
8228c2ecf20Sopenharmony_ci#define	 SLV_FF_EMPTY_MASK			0x00000008
8238c2ecf20Sopenharmony_ci#define	 DMA_FF_ALLEMPTY_MASK			0x00000004
8248c2ecf20Sopenharmony_ci#define	 GRA_FF_ALLEMPTY_MASK			0x00000002
8258c2ecf20Sopenharmony_ci#define	 PWRDN_IRQ_LEVEL_MASK			0x00000001
8268c2ecf20Sopenharmony_ci
8278c2ecf20Sopenharmony_ci/* 32 bit LCD Interrupt Reset Status*/
8288c2ecf20Sopenharmony_ci#define SPU_IRQ_RSR				(0x01C8)
8298c2ecf20Sopenharmony_ci/* 32 bit Panel Path Graphic Partial Display Horizontal Control Register*/
8308c2ecf20Sopenharmony_ci#define LCD_GRA_CUTHPXL				(0x01CC)
8318c2ecf20Sopenharmony_ci/* 32 bit Panel Path Graphic Partial Display Vertical Control Register*/
8328c2ecf20Sopenharmony_ci#define LCD_GRA_CUTVLN				(0x01D0)
8338c2ecf20Sopenharmony_ci/* 32 bit TV Path Graphic Partial Display	  Horizontal Control Register*/
8348c2ecf20Sopenharmony_ci#define LCD_TVG_CUTHPXL				(0x01D4)
8358c2ecf20Sopenharmony_ci/* 32 bit TV Path Graphic Partial Display Vertical Control Register*/
8368c2ecf20Sopenharmony_ci#define LCD_TVG_CUTVLN				(0x01D8)
8378c2ecf20Sopenharmony_ci/* 32 bit LCD Global Control Register*/
8388c2ecf20Sopenharmony_ci#define LCD_TOP_CTRL				(0x01DC)
8398c2ecf20Sopenharmony_ci/* 32 bit LCD SQU Line Buffer Control Register 1*/
8408c2ecf20Sopenharmony_ci#define LCD_SQULN1_CTRL				(0x01E0)
8418c2ecf20Sopenharmony_ci/* 32 bit LCD SQU Line Buffer Control Register 2*/
8428c2ecf20Sopenharmony_ci#define LCD_SQULN2_CTRL				(0x01E4)
8438c2ecf20Sopenharmony_ci#define squln_ctrl(id)	((id) ? (((id) & 1) ? LCD_SQULN2_CTRL : \
8448c2ecf20Sopenharmony_ci			LCD_PN2_SQULN1_CTRL) : LCD_SQULN1_CTRL)
8458c2ecf20Sopenharmony_ci
8468c2ecf20Sopenharmony_ci/* 32 bit LCD Mixed Overlay Control Register */
8478c2ecf20Sopenharmony_ci#define LCD_AFA_ALL2ONE				(0x01E8)
8488c2ecf20Sopenharmony_ci
8498c2ecf20Sopenharmony_ci#define LCD_PN2_SCLK_DIV			(0x01EC)
8508c2ecf20Sopenharmony_ci#define LCD_PN2_TCLK_DIV			(0x01F0)
8518c2ecf20Sopenharmony_ci#define LCD_LVDS_SCLK_DIV_WR			(0x01F4)
8528c2ecf20Sopenharmony_ci#define LCD_LVDS_SCLK_DIV_RD			(0x01FC)
8538c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_START_ADDR_Y0		(0x0200)
8548c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_START_ADDR_U0		(0x0204)
8558c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_START_ADDR_V0		(0x0208)
8568c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_START_ADDR_C0		(0x020C)
8578c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_START_ADDR_Y1		(0x0210)
8588c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_START_ADDR_U1		(0x0214)
8598c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_START_ADDR_V1		(0x0218)
8608c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_START_ADDR_C1		(0x021C)
8618c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_PITCH_YC			(0x0220)
8628c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_PITCH_UV			(0x0224)
8638c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_OVSA_HPXL_VLN		(0x0228)
8648c2ecf20Sopenharmony_ci#define PN2_LCD_DMA_HPXL_VLN			(0x022C)
8658c2ecf20Sopenharmony_ci#define PN2_LCD_DMAZM_HPXL_VLN			(0x0230)
8668c2ecf20Sopenharmony_ci#define PN2_LCD_GRA_START_ADDR0			(0x0234)
8678c2ecf20Sopenharmony_ci#define PN2_LCD_GRA_START_ADDR1			(0x0238)
8688c2ecf20Sopenharmony_ci#define PN2_LCD_GRA_PITCH			(0x023C)
8698c2ecf20Sopenharmony_ci#define PN2_LCD_GRA_OVSA_HPXL_VLN		(0x0240)
8708c2ecf20Sopenharmony_ci#define PN2_LCD_GRA_HPXL_VLN			(0x0244)
8718c2ecf20Sopenharmony_ci#define PN2_LCD_GRAZM_HPXL_VLN			(0x0248)
8728c2ecf20Sopenharmony_ci#define PN2_LCD_HWC_OVSA_HPXL_VLN		(0x024C)
8738c2ecf20Sopenharmony_ci#define PN2_LCD_HWC_HPXL_VLN			(0x0250)
8748c2ecf20Sopenharmony_ci#define LCD_PN2_V_H_TOTAL			(0x0254)
8758c2ecf20Sopenharmony_ci#define LCD_PN2_V_H_ACTIVE			(0x0258)
8768c2ecf20Sopenharmony_ci#define LCD_PN2_H_PORCH				(0x025C)
8778c2ecf20Sopenharmony_ci#define LCD_PN2_V_PORCH				(0x0260)
8788c2ecf20Sopenharmony_ci#define LCD_PN2_BLANKCOLOR			(0x0264)
8798c2ecf20Sopenharmony_ci#define LCD_PN2_ALPHA_COLOR1			(0x0268)
8808c2ecf20Sopenharmony_ci#define LCD_PN2_ALPHA_COLOR2			(0x026C)
8818c2ecf20Sopenharmony_ci#define LCD_PN2_COLORKEY_Y			(0x0270)
8828c2ecf20Sopenharmony_ci#define LCD_PN2_COLORKEY_U			(0x0274)
8838c2ecf20Sopenharmony_ci#define LCD_PN2_COLORKEY_V			(0x0278)
8848c2ecf20Sopenharmony_ci#define LCD_PN2_SEPXLCNT			(0x027C)
8858c2ecf20Sopenharmony_ci#define LCD_TV_V_H_TOTAL_FLD			(0x0280)
8868c2ecf20Sopenharmony_ci#define LCD_TV_V_PORCH_FLD			(0x0284)
8878c2ecf20Sopenharmony_ci#define LCD_TV_SEPXLCNT_FLD			(0x0288)
8888c2ecf20Sopenharmony_ci
8898c2ecf20Sopenharmony_ci#define LCD_2ND_ALPHA				(0x0294)
8908c2ecf20Sopenharmony_ci#define LCD_PN2_CONTRAST			(0x0298)
8918c2ecf20Sopenharmony_ci#define LCD_PN2_SATURATION			(0x029c)
8928c2ecf20Sopenharmony_ci#define LCD_PN2_CBSH_HUE			(0x02a0)
8938c2ecf20Sopenharmony_ci#define LCD_TIMING_EXT				(0x02C0)
8948c2ecf20Sopenharmony_ci#define LCD_PN2_LAYER_ALPHA_SEL1		(0x02c4)
8958c2ecf20Sopenharmony_ci#define LCD_PN2_CTRL0				(0x02C8)
8968c2ecf20Sopenharmony_ci#define TV_LAYER_ALPHA_SEL1			(0x02cc)
8978c2ecf20Sopenharmony_ci#define LCD_SMPN2_CTRL				(0x02D0)
8988c2ecf20Sopenharmony_ci#define LCD_IO_OVERL_MAP_CTRL			(0x02D4)
8998c2ecf20Sopenharmony_ci#define LCD_DUMB2_CTRL				(0x02d8)
9008c2ecf20Sopenharmony_ci#define LCD_PN2_CTRL1				(0x02DC)
9018c2ecf20Sopenharmony_ci#define PN2_IOPAD_CONTROL			(0x02E0)
9028c2ecf20Sopenharmony_ci#define LCD_PN2_SQULN1_CTRL			(0x02E4)
9038c2ecf20Sopenharmony_ci#define PN2_LCD_GRA_CUTHPXL			(0x02e8)
9048c2ecf20Sopenharmony_ci#define PN2_LCD_GRA_CUTVLN			(0x02ec)
9058c2ecf20Sopenharmony_ci#define LCD_PN2_SQULN2_CTRL			(0x02F0)
9068c2ecf20Sopenharmony_ci#define ALL_LAYER_ALPHA_SEL			(0x02F4)
9078c2ecf20Sopenharmony_ci
9088c2ecf20Sopenharmony_ci#define TIMING_MASTER_CONTROL			(0x02F8)
9098c2ecf20Sopenharmony_ci#define MASTER_ENH(id)				(1 << (id))
9108c2ecf20Sopenharmony_ci#define MASTER_ENV(id)				(1 << ((id) + 4))
9118c2ecf20Sopenharmony_ci
9128c2ecf20Sopenharmony_ci#define DSI_START_SEL_SHIFT(id)		(((id) << 1) + 8)
9138c2ecf20Sopenharmony_ci#define timing_master_config(path, dsi_id, lcd_id) \
9148c2ecf20Sopenharmony_ci	(MASTER_ENH(path) | MASTER_ENV(path) | \
9158c2ecf20Sopenharmony_ci	(((lcd_id) + ((dsi_id) << 1)) << DSI_START_SEL_SHIFT(path)))
9168c2ecf20Sopenharmony_ci
9178c2ecf20Sopenharmony_ci#define LCD_2ND_BLD_CTL				(0x02Fc)
9188c2ecf20Sopenharmony_ci#define LVDS_SRC_MASK				(3 << 30)
9198c2ecf20Sopenharmony_ci#define LVDS_SRC_SHIFT				(30)
9208c2ecf20Sopenharmony_ci#define LVDS_FMT_MASK				(1 << 28)
9218c2ecf20Sopenharmony_ci#define LVDS_FMT_SHIFT				(28)
9228c2ecf20Sopenharmony_ci
9238c2ecf20Sopenharmony_ci#define CLK_SCLK	(1 << 0)
9248c2ecf20Sopenharmony_ci#define CLK_LVDS_RD	(1 << 1)
9258c2ecf20Sopenharmony_ci#define CLK_LVDS_WR	(1 << 2)
9268c2ecf20Sopenharmony_ci
9278c2ecf20Sopenharmony_ci#define gra_partdisp_ctrl_hor(id)	((id) ? (((id) & 1) ? \
9288c2ecf20Sopenharmony_ci	LCD_TVG_CUTHPXL : PN2_LCD_GRA_CUTHPXL) : LCD_GRA_CUTHPXL)
9298c2ecf20Sopenharmony_ci#define gra_partdisp_ctrl_ver(id)	((id) ? (((id) & 1) ? \
9308c2ecf20Sopenharmony_ci	LCD_TVG_CUTVLN : PN2_LCD_GRA_CUTVLN) : LCD_GRA_CUTVLN)
9318c2ecf20Sopenharmony_ci
9328c2ecf20Sopenharmony_ci/*
9338c2ecf20Sopenharmony_ci * defined for Configure Dumb Mode
9348c2ecf20Sopenharmony_ci * defined for Configure Dumb Mode
9358c2ecf20Sopenharmony_ci * DUMB LCD Panel bit[31:28]
9368c2ecf20Sopenharmony_ci */
9378c2ecf20Sopenharmony_ci#define DUMB16_RGB565_0		0x0
9388c2ecf20Sopenharmony_ci#define DUMB16_RGB565_1		0x1
9398c2ecf20Sopenharmony_ci#define DUMB18_RGB666_0		0x2
9408c2ecf20Sopenharmony_ci#define DUMB18_RGB666_1		0x3
9418c2ecf20Sopenharmony_ci#define DUMB12_RGB444_0		0x4
9428c2ecf20Sopenharmony_ci#define DUMB12_RGB444_1		0x5
9438c2ecf20Sopenharmony_ci#define DUMB24_RGB888_0		0x6
9448c2ecf20Sopenharmony_ci#define DUMB_BLANK		0x7
9458c2ecf20Sopenharmony_ci
9468c2ecf20Sopenharmony_ci/*
9478c2ecf20Sopenharmony_ci * defined for Configure I/O Pin Allocation Mode
9488c2ecf20Sopenharmony_ci * LCD LCD I/O Pads control register bit[3:0]
9498c2ecf20Sopenharmony_ci */
9508c2ecf20Sopenharmony_ci#define IOPAD_DUMB24		0x0
9518c2ecf20Sopenharmony_ci#define IOPAD_DUMB18SPI		0x1
9528c2ecf20Sopenharmony_ci#define IOPAD_DUMB18GPIO	0x2
9538c2ecf20Sopenharmony_ci#define IOPAD_DUMB16SPI		0x3
9548c2ecf20Sopenharmony_ci#define IOPAD_DUMB16GPIO	0x4
9558c2ecf20Sopenharmony_ci#define IOPAD_DUMB12		0x5
9568c2ecf20Sopenharmony_ci#define IOPAD_SMART18SPI	0x6
9578c2ecf20Sopenharmony_ci#define IOPAD_SMART16SPI	0x7
9588c2ecf20Sopenharmony_ci#define IOPAD_SMART8BOTH	0x8
9598c2ecf20Sopenharmony_ci#define IOPAD_DUMB18_SMART8	0x9
9608c2ecf20Sopenharmony_ci#define IOPAD_DUMB16_SMART8SPI	0xa
9618c2ecf20Sopenharmony_ci#define IOPAD_DUMB16_SMART8GPIO	0xb
9628c2ecf20Sopenharmony_ci#define IOPAD_DUMB16_DUMB16	0xc
9638c2ecf20Sopenharmony_ci#define IOPAD_SMART8_SMART8	0xc
9648c2ecf20Sopenharmony_ci
9658c2ecf20Sopenharmony_ci/*
9668c2ecf20Sopenharmony_ci *defined for indicating boundary and cycle burst length
9678c2ecf20Sopenharmony_ci */
9688c2ecf20Sopenharmony_ci#define  CFG_BOUNDARY_1KB			(1<<5)
9698c2ecf20Sopenharmony_ci#define  CFG_BOUNDARY_4KB			(0<<5)
9708c2ecf20Sopenharmony_ci#define	 CFG_CYC_BURST_LEN16			(1<<4)
9718c2ecf20Sopenharmony_ci#define	 CFG_CYC_BURST_LEN8			(0<<4)
9728c2ecf20Sopenharmony_ci
9738c2ecf20Sopenharmony_ci/* SRAM ID */
9748c2ecf20Sopenharmony_ci#define SRAMID_GAMMA_YR			0x0
9758c2ecf20Sopenharmony_ci#define SRAMID_GAMMA_UG			0x1
9768c2ecf20Sopenharmony_ci#define SRAMID_GAMMA_VB			0x2
9778c2ecf20Sopenharmony_ci#define SRAMID_PALATTE			0x3
9788c2ecf20Sopenharmony_ci#define SRAMID_HWC			0xf
9798c2ecf20Sopenharmony_ci
9808c2ecf20Sopenharmony_ci/* SRAM INIT Read/Write */
9818c2ecf20Sopenharmony_ci#define SRAMID_INIT_READ		0x0
9828c2ecf20Sopenharmony_ci#define SRAMID_INIT_WRITE		0x2
9838c2ecf20Sopenharmony_ci#define SRAMID_INIT_DEFAULT		0x3
9848c2ecf20Sopenharmony_ci
9858c2ecf20Sopenharmony_ci/*
9868c2ecf20Sopenharmony_ci * defined VSYNC selection mode for DMA control 1 register
9878c2ecf20Sopenharmony_ci * DMA1 bit[30:28]
9888c2ecf20Sopenharmony_ci */
9898c2ecf20Sopenharmony_ci#define VMODE_SMPN			0x0
9908c2ecf20Sopenharmony_ci#define VMODE_SMPNIRQ			0x1
9918c2ecf20Sopenharmony_ci#define VMODE_DUMB			0x2
9928c2ecf20Sopenharmony_ci#define VMODE_IPE			0x3
9938c2ecf20Sopenharmony_ci#define VMODE_IRE			0x4
9948c2ecf20Sopenharmony_ci
9958c2ecf20Sopenharmony_ci/*
9968c2ecf20Sopenharmony_ci * defined Configure Alpha and Alpha mode for DMA control 1 register
9978c2ecf20Sopenharmony_ci * DMA1 bit[15:08](alpha) / bit[17:16](alpha mode)
9988c2ecf20Sopenharmony_ci */
9998c2ecf20Sopenharmony_ci/* ALPHA mode */
10008c2ecf20Sopenharmony_ci#define MODE_ALPHA_DMA			0x0
10018c2ecf20Sopenharmony_ci#define MODE_ALPHA_GRA			0x1
10028c2ecf20Sopenharmony_ci#define MODE_ALPHA_CFG			0x2
10038c2ecf20Sopenharmony_ci
10048c2ecf20Sopenharmony_ci/* alpha value */
10058c2ecf20Sopenharmony_ci#define ALPHA_NOGRAPHIC			0xFF	  /* all video, no graphic */
10068c2ecf20Sopenharmony_ci#define ALPHA_NOVIDEO			0x00	  /* all graphic, no video */
10078c2ecf20Sopenharmony_ci#define ALPHA_GRAPHNVIDEO		0x0F	  /* Selects graphic & video */
10088c2ecf20Sopenharmony_ci
10098c2ecf20Sopenharmony_ci/*
10108c2ecf20Sopenharmony_ci * defined Pixel Command for DMA control 1 register
10118c2ecf20Sopenharmony_ci * DMA1 bit[07:00]
10128c2ecf20Sopenharmony_ci */
10138c2ecf20Sopenharmony_ci#define PIXEL_CMD			0x81
10148c2ecf20Sopenharmony_ci
10158c2ecf20Sopenharmony_ci/* DSI */
10168c2ecf20Sopenharmony_ci/* DSI1 - 4 Lane Controller base */
10178c2ecf20Sopenharmony_ci#define DSI1_REGS_PHYSICAL_BASE		0xD420B800
10188c2ecf20Sopenharmony_ci/* DSI2 - 3 Lane Controller base */
10198c2ecf20Sopenharmony_ci#define DSI2_REGS_PHYSICAL_BASE		0xD420BA00
10208c2ecf20Sopenharmony_ci
10218c2ecf20Sopenharmony_ci/*	   DSI Controller Registers	   */
10228c2ecf20Sopenharmony_cistruct dsi_lcd_regs {
10238c2ecf20Sopenharmony_ci#define DSI_LCD1_CTRL_0  0x100   /* DSI Active Panel 1 Control register 0 */
10248c2ecf20Sopenharmony_ci#define DSI_LCD1_CTRL_1  0x104   /* DSI Active Panel 1 Control register 1 */
10258c2ecf20Sopenharmony_ci	u32 ctrl0;
10268c2ecf20Sopenharmony_ci	u32 ctrl1;
10278c2ecf20Sopenharmony_ci	u32 reserved1[2];
10288c2ecf20Sopenharmony_ci
10298c2ecf20Sopenharmony_ci#define DSI_LCD1_TIMING_0		0x110   /* Timing register 0 */
10308c2ecf20Sopenharmony_ci#define DSI_LCD1_TIMING_1		0x114   /* Timing register 1 */
10318c2ecf20Sopenharmony_ci#define DSI_LCD1_TIMING_2		0x118   /* Timing register 2 */
10328c2ecf20Sopenharmony_ci#define DSI_LCD1_TIMING_3		0x11C   /* Timing register 3 */
10338c2ecf20Sopenharmony_ci#define DSI_LCD1_WC_0			0x120   /* Word Count register 0 */
10348c2ecf20Sopenharmony_ci#define DSI_LCD1_WC_1			0x124   /* Word Count register 1 */
10358c2ecf20Sopenharmony_ci#define DSI_LCD1_WC_2			0x128	 /* Word Count register 2 */
10368c2ecf20Sopenharmony_ci	u32 timing0;
10378c2ecf20Sopenharmony_ci	u32 timing1;
10388c2ecf20Sopenharmony_ci	u32 timing2;
10398c2ecf20Sopenharmony_ci	u32 timing3;
10408c2ecf20Sopenharmony_ci	u32 wc0;
10418c2ecf20Sopenharmony_ci	u32 wc1;
10428c2ecf20Sopenharmony_ci	u32 wc2;
10438c2ecf20Sopenharmony_ci	u32 reserved2[1];
10448c2ecf20Sopenharmony_ci	u32 slot_cnt0;
10458c2ecf20Sopenharmony_ci	u32 slot_cnt1;
10468c2ecf20Sopenharmony_ci	u32 reserved3[2];
10478c2ecf20Sopenharmony_ci	u32 status_0;
10488c2ecf20Sopenharmony_ci	u32 status_1;
10498c2ecf20Sopenharmony_ci	u32 status_2;
10508c2ecf20Sopenharmony_ci	u32 status_3;
10518c2ecf20Sopenharmony_ci	u32 status_4;
10528c2ecf20Sopenharmony_ci};
10538c2ecf20Sopenharmony_ci
10548c2ecf20Sopenharmony_cistruct dsi_regs {
10558c2ecf20Sopenharmony_ci#define DSI_CTRL_0	  0x000   /* DSI control register 0 */
10568c2ecf20Sopenharmony_ci#define DSI_CTRL_1	  0x004   /* DSI control register 1 */
10578c2ecf20Sopenharmony_ci	u32 ctrl0;
10588c2ecf20Sopenharmony_ci	u32 ctrl1;
10598c2ecf20Sopenharmony_ci	u32 reserved1[2];
10608c2ecf20Sopenharmony_ci	u32 irq_status;
10618c2ecf20Sopenharmony_ci	u32 irq_mask;
10628c2ecf20Sopenharmony_ci	u32 reserved2[2];
10638c2ecf20Sopenharmony_ci
10648c2ecf20Sopenharmony_ci#define DSI_CPU_CMD_0   0x020   /* DSI CPU packet command register 0 */
10658c2ecf20Sopenharmony_ci#define DSI_CPU_CMD_1   0x024   /* DSU CPU Packet Command Register 1 */
10668c2ecf20Sopenharmony_ci#define DSI_CPU_CMD_3	0x02C   /* DSU CPU Packet Command Register 3 */
10678c2ecf20Sopenharmony_ci#define DSI_CPU_WDAT_0	0x030   /* DSI CUP */
10688c2ecf20Sopenharmony_ci	u32 cmd0;
10698c2ecf20Sopenharmony_ci	u32 cmd1;
10708c2ecf20Sopenharmony_ci	u32 cmd2;
10718c2ecf20Sopenharmony_ci	u32 cmd3;
10728c2ecf20Sopenharmony_ci	u32 dat0;
10738c2ecf20Sopenharmony_ci	u32 status0;
10748c2ecf20Sopenharmony_ci	u32 status1;
10758c2ecf20Sopenharmony_ci	u32 status2;
10768c2ecf20Sopenharmony_ci	u32 status3;
10778c2ecf20Sopenharmony_ci	u32 status4;
10788c2ecf20Sopenharmony_ci	u32 reserved3[2];
10798c2ecf20Sopenharmony_ci
10808c2ecf20Sopenharmony_ci	u32 smt_cmd;
10818c2ecf20Sopenharmony_ci	u32 smt_ctrl0;
10828c2ecf20Sopenharmony_ci	u32 smt_ctrl1;
10838c2ecf20Sopenharmony_ci	u32 reserved4[1];
10848c2ecf20Sopenharmony_ci
10858c2ecf20Sopenharmony_ci	u32 rx0_status;
10868c2ecf20Sopenharmony_ci
10878c2ecf20Sopenharmony_ci/* Rx Packet Header - data from slave device */
10888c2ecf20Sopenharmony_ci#define DSI_RX_PKT_HDR_0 0x064
10898c2ecf20Sopenharmony_ci	u32 rx0_header;
10908c2ecf20Sopenharmony_ci	u32 rx1_status;
10918c2ecf20Sopenharmony_ci	u32 rx1_header;
10928c2ecf20Sopenharmony_ci	u32 rx_ctrl;
10938c2ecf20Sopenharmony_ci	u32 rx_ctrl1;
10948c2ecf20Sopenharmony_ci	u32 rx2_status;
10958c2ecf20Sopenharmony_ci	u32 rx2_header;
10968c2ecf20Sopenharmony_ci	u32 reserved5[1];
10978c2ecf20Sopenharmony_ci
10988c2ecf20Sopenharmony_ci	u32 phy_ctrl1;
10998c2ecf20Sopenharmony_ci#define DSI_PHY_CTRL_2		0x088   /* DSI DPHI Control Register 2 */
11008c2ecf20Sopenharmony_ci#define DSI_PHY_CTRL_3		0x08C   /* DPHY Control Register 3 */
11018c2ecf20Sopenharmony_ci	u32 phy_ctrl2;
11028c2ecf20Sopenharmony_ci	u32 phy_ctrl3;
11038c2ecf20Sopenharmony_ci	u32 phy_status0;
11048c2ecf20Sopenharmony_ci	u32 phy_status1;
11058c2ecf20Sopenharmony_ci	u32 reserved6[5];
11068c2ecf20Sopenharmony_ci	u32 phy_status2;
11078c2ecf20Sopenharmony_ci
11088c2ecf20Sopenharmony_ci#define DSI_PHY_RCOMP_0		0x0B0   /* DPHY Rcomp Control Register */
11098c2ecf20Sopenharmony_ci	u32 phy_rcomp0;
11108c2ecf20Sopenharmony_ci	u32 reserved7[3];
11118c2ecf20Sopenharmony_ci#define DSI_PHY_TIME_0		0x0C0   /* DPHY Timing Control Register 0 */
11128c2ecf20Sopenharmony_ci#define DSI_PHY_TIME_1		0x0C4   /* DPHY Timing Control Register 1 */
11138c2ecf20Sopenharmony_ci#define DSI_PHY_TIME_2		0x0C8   /* DPHY Timing Control Register 2 */
11148c2ecf20Sopenharmony_ci#define DSI_PHY_TIME_3		0x0CC   /* DPHY Timing Control Register 3 */
11158c2ecf20Sopenharmony_ci#define DSI_PHY_TIME_4		0x0D0   /* DPHY Timing Control Register 4 */
11168c2ecf20Sopenharmony_ci#define DSI_PHY_TIME_5		0x0D4   /* DPHY Timing Control Register 5 */
11178c2ecf20Sopenharmony_ci	u32 phy_timing0;
11188c2ecf20Sopenharmony_ci	u32 phy_timing1;
11198c2ecf20Sopenharmony_ci	u32 phy_timing2;
11208c2ecf20Sopenharmony_ci	u32 phy_timing3;
11218c2ecf20Sopenharmony_ci	u32 phy_code_0;
11228c2ecf20Sopenharmony_ci	u32 phy_code_1;
11238c2ecf20Sopenharmony_ci	u32 reserved8[2];
11248c2ecf20Sopenharmony_ci	u32 mem_ctrl;
11258c2ecf20Sopenharmony_ci	u32 tx_timer;
11268c2ecf20Sopenharmony_ci	u32 rx_timer;
11278c2ecf20Sopenharmony_ci	u32 turn_timer;
11288c2ecf20Sopenharmony_ci	u32 reserved9[4];
11298c2ecf20Sopenharmony_ci
11308c2ecf20Sopenharmony_ci#define DSI_LCD1_CTRL_0  0x100   /* DSI Active Panel 1 Control register 0 */
11318c2ecf20Sopenharmony_ci#define DSI_LCD1_CTRL_1  0x104   /* DSI Active Panel 1 Control register 1 */
11328c2ecf20Sopenharmony_ci#define DSI_LCD1_TIMING_0		0x110   /* Timing register 0 */
11338c2ecf20Sopenharmony_ci#define DSI_LCD1_TIMING_1		0x114   /* Timing register 1 */
11348c2ecf20Sopenharmony_ci#define DSI_LCD1_TIMING_2		0x118   /* Timing register 2 */
11358c2ecf20Sopenharmony_ci#define DSI_LCD1_TIMING_3		0x11C   /* Timing register 3 */
11368c2ecf20Sopenharmony_ci#define DSI_LCD1_WC_0			0x120   /* Word Count register 0 */
11378c2ecf20Sopenharmony_ci#define DSI_LCD1_WC_1			0x124   /* Word Count register 1 */
11388c2ecf20Sopenharmony_ci#define DSI_LCD1_WC_2			0x128   /* Word Count register 2 */
11398c2ecf20Sopenharmony_ci	struct dsi_lcd_regs lcd1;
11408c2ecf20Sopenharmony_ci	u32 reserved10[11];
11418c2ecf20Sopenharmony_ci	struct dsi_lcd_regs lcd2;
11428c2ecf20Sopenharmony_ci};
11438c2ecf20Sopenharmony_ci
11448c2ecf20Sopenharmony_ci#define DSI_LCD2_CTRL_0  0x180   /* DSI Active Panel 2 Control register 0 */
11458c2ecf20Sopenharmony_ci#define DSI_LCD2_CTRL_1  0x184   /* DSI Active Panel 2 Control register 1 */
11468c2ecf20Sopenharmony_ci#define DSI_LCD2_TIMING_0		0x190   /* Timing register 0 */
11478c2ecf20Sopenharmony_ci#define DSI_LCD2_TIMING_1		0x194   /* Timing register 1 */
11488c2ecf20Sopenharmony_ci#define DSI_LCD2_TIMING_2		0x198   /* Timing register 2 */
11498c2ecf20Sopenharmony_ci#define DSI_LCD2_TIMING_3		0x19C   /* Timing register 3 */
11508c2ecf20Sopenharmony_ci#define DSI_LCD2_WC_0			0x1A0   /* Word Count register 0 */
11518c2ecf20Sopenharmony_ci#define DSI_LCD2_WC_1			0x1A4   /* Word Count register 1 */
11528c2ecf20Sopenharmony_ci#define DSI_LCD2_WC_2			0x1A8	 /* Word Count register 2 */
11538c2ecf20Sopenharmony_ci
11548c2ecf20Sopenharmony_ci/*	DSI_CTRL_0		0x0000	DSI Control Register 0 */
11558c2ecf20Sopenharmony_ci#define DSI_CTRL_0_CFG_SOFT_RST			(1<<31)
11568c2ecf20Sopenharmony_ci#define DSI_CTRL_0_CFG_SOFT_RST_REG		(1<<30)
11578c2ecf20Sopenharmony_ci#define DSI_CTRL_0_CFG_LCD1_TX_EN		(1<<8)
11588c2ecf20Sopenharmony_ci#define DSI_CTRL_0_CFG_LCD1_SLV			(1<<4)
11598c2ecf20Sopenharmony_ci#define DSI_CTRL_0_CFG_LCD1_EN			(1<<0)
11608c2ecf20Sopenharmony_ci
11618c2ecf20Sopenharmony_ci/*	DSI_CTRL_1		0x0004	DSI Control Register 1 */
11628c2ecf20Sopenharmony_ci#define DSI_CTRL_1_CFG_EOTP			(1<<8)
11638c2ecf20Sopenharmony_ci#define DSI_CTRL_1_CFG_RSVD			(2<<4)
11648c2ecf20Sopenharmony_ci#define DSI_CTRL_1_CFG_LCD2_VCH_NO_MASK		(3<<2)
11658c2ecf20Sopenharmony_ci#define DSI_CTRL_1_CFG_LCD2_VCH_NO_SHIFT	2
11668c2ecf20Sopenharmony_ci#define DSI_CTRL_1_CFG_LCD1_VCH_NO_MASK		(3<<0)
11678c2ecf20Sopenharmony_ci#define DSI_CTRL_1_CFG_LCD1_VCH_NO_SHIFT	0
11688c2ecf20Sopenharmony_ci
11698c2ecf20Sopenharmony_ci/*	DSI_LCD1_CTRL_1	0x0104	DSI Active Panel 1 Control Register 1 */
11708c2ecf20Sopenharmony_ci/* LCD 1 Vsync Reset Enable */
11718c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_VSYNC_RST_EN	(1<<31)
11728c2ecf20Sopenharmony_ci/* LCD 1 2K Pixel Buffer Mode Enable */
11738c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_M2K_EN		(1<<30)
11748c2ecf20Sopenharmony_ci/*		Bit(s) DSI_LCD1_CTRL_1_RSRV_29_23 reserved */
11758c2ecf20Sopenharmony_ci/* Long Blanking Packet Enable */
11768c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_HLP_PKT_EN	(1<<22)
11778c2ecf20Sopenharmony_ci/* Extra Long Blanking Packet Enable */
11788c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_HEX_PKT_EN	(1<<21)
11798c2ecf20Sopenharmony_ci/* Front Porch Packet Enable */
11808c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_HFP_PKT_EN	(1<<20)
11818c2ecf20Sopenharmony_ci/* hact Packet Enable */
11828c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_HACT_PKT_EN	(1<<19)
11838c2ecf20Sopenharmony_ci/* Back Porch Packet Enable */
11848c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_HBP_PKT_EN	(1<<18)
11858c2ecf20Sopenharmony_ci/* hse Packet Enable */
11868c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_HSE_PKT_EN	(1<<17)
11878c2ecf20Sopenharmony_ci/* hsa Packet Enable */
11888c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_HSA_PKT_EN	(1<<16)
11898c2ecf20Sopenharmony_ci/* All Item Enable after Pixel Data */
11908c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_ALL_SLOT_EN	(1<<15)
11918c2ecf20Sopenharmony_ci/* Extra Long Packet Enable after Pixel Data */
11928c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_HEX_SLOT_EN	(1<<14)
11938c2ecf20Sopenharmony_ci/*		Bit(s) DSI_LCD1_CTRL_1_RSRV_13_11 reserved */
11948c2ecf20Sopenharmony_ci/* Turn Around Bus at Last h Line */
11958c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_LAST_LINE_TURN	(1<<10)
11968c2ecf20Sopenharmony_ci/* Go to Low Power Every Frame */
11978c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_LPM_FRAME_EN	(1<<9)
11988c2ecf20Sopenharmony_ci/* Go to Low Power Every Line */
11998c2ecf20Sopenharmony_ci#define	DSI_LCD1_CTRL_1_CFG_L1_LPM_LINE_EN	(1<<8)
12008c2ecf20Sopenharmony_ci/*		Bit(s) DSI_LCD1_CTRL_1_RSRV_7_4 reserved */
12018c2ecf20Sopenharmony_ci/* DSI Transmission Mode for LCD 1 */
12028c2ecf20Sopenharmony_ci#define DSI_LCD1_CTRL_1_CFG_L1_BURST_MODE_SHIFT	2
12038c2ecf20Sopenharmony_ci#define DSI_LCD1_CTRL_1_CFG_L1_BURST_MODE_MASK	(3<<2)
12048c2ecf20Sopenharmony_ci/* LCD 1 Input Data RGB Mode for LCD 1 */
12058c2ecf20Sopenharmony_ci#define DSI_LCD2_CTRL_1_CFG_L1_RGB_TYPE_SHIFT	0
12068c2ecf20Sopenharmony_ci#define DSI_LCD2_CTRL_1_CFG_L1_RGB_TYPE_MASK	(3<<2)
12078c2ecf20Sopenharmony_ci
12088c2ecf20Sopenharmony_ci/*	DSI_PHY_CTRL_2		0x0088	DPHY Control Register 2 */
12098c2ecf20Sopenharmony_ci/*		Bit(s) DSI_PHY_CTRL_2_RSRV_31_12 reserved */
12108c2ecf20Sopenharmony_ci/* DPHY LP Receiver Enable */
12118c2ecf20Sopenharmony_ci#define	DSI_PHY_CTRL_2_CFG_CSR_LANE_RESC_EN_MASK	(0xf<<8)
12128c2ecf20Sopenharmony_ci#define	DSI_PHY_CTRL_2_CFG_CSR_LANE_RESC_EN_SHIFT	8
12138c2ecf20Sopenharmony_ci/* DPHY Data Lane Enable */
12148c2ecf20Sopenharmony_ci#define	DSI_PHY_CTRL_2_CFG_CSR_LANE_EN_MASK		(0xf<<4)
12158c2ecf20Sopenharmony_ci#define	DSI_PHY_CTRL_2_CFG_CSR_LANE_EN_SHIFT		4
12168c2ecf20Sopenharmony_ci/* DPHY Bus Turn Around */
12178c2ecf20Sopenharmony_ci#define	DSI_PHY_CTRL_2_CFG_CSR_LANE_TURN_MASK		(0xf)
12188c2ecf20Sopenharmony_ci#define	DSI_PHY_CTRL_2_CFG_CSR_LANE_TURN_SHIFT		0
12198c2ecf20Sopenharmony_ci
12208c2ecf20Sopenharmony_ci/*	DSI_CPU_CMD_1		0x0024	DSI CPU Packet Command Register 1 */
12218c2ecf20Sopenharmony_ci/*		Bit(s) DSI_CPU_CMD_1_RSRV_31_24 reserved */
12228c2ecf20Sopenharmony_ci/* LPDT TX Enable */
12238c2ecf20Sopenharmony_ci#define	DSI_CPU_CMD_1_CFG_TXLP_LPDT_MASK		(0xf<<20)
12248c2ecf20Sopenharmony_ci#define	DSI_CPU_CMD_1_CFG_TXLP_LPDT_SHIFT		20
12258c2ecf20Sopenharmony_ci/* ULPS TX Enable */
12268c2ecf20Sopenharmony_ci#define	DSI_CPU_CMD_1_CFG_TXLP_ULPS_MASK		(0xf<<16)
12278c2ecf20Sopenharmony_ci#define	DSI_CPU_CMD_1_CFG_TXLP_ULPS_SHIFT		16
12288c2ecf20Sopenharmony_ci/* Low Power TX Trigger Code */
12298c2ecf20Sopenharmony_ci#define	DSI_CPU_CMD_1_CFG_TXLP_TRIGGER_CODE_MASK	(0xffff)
12308c2ecf20Sopenharmony_ci#define	DSI_CPU_CMD_1_CFG_TXLP_TRIGGER_CODE_SHIFT	0
12318c2ecf20Sopenharmony_ci
12328c2ecf20Sopenharmony_ci/*	DSI_PHY_TIME_0	0x00c0	DPHY Timing Control Register 0 */
12338c2ecf20Sopenharmony_ci/* Length of HS Exit Period in tx_clk_esc Cycles */
12348c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_0_CFG_CSR_TIME_HS_EXIT_MASK	(0xff<<24)
12358c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_0_CFG_CSR_TIME_HS_EXIT_SHIFT	24
12368c2ecf20Sopenharmony_ci/* DPHY HS Trail Period Length */
12378c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_0_CFG_CSR_TIME_HS_TRAIL_MASK	(0xff<<16)
12388c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_0_CFG_CSR_TIME_HS_TRAIL_SHIFT	16
12398c2ecf20Sopenharmony_ci/* DPHY HS Zero State Length */
12408c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_0_CDG_CSR_TIME_HS_ZERO_MASK	(0xff<<8)
12418c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_0_CDG_CSR_TIME_HS_ZERO_SHIFT	8
12428c2ecf20Sopenharmony_ci/* DPHY HS Prepare State Length */
12438c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_0_CFG_CSR_TIME_HS_PREP_MASK	(0xff)
12448c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_0_CFG_CSR_TIME_HS_PREP_SHIFT	0
12458c2ecf20Sopenharmony_ci
12468c2ecf20Sopenharmony_ci/*	DSI_PHY_TIME_1		0x00c4	DPHY Timing Control Register 1 */
12478c2ecf20Sopenharmony_ci/* Time to Drive LP-00 by New Transmitter */
12488c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_1_CFG_CSR_TIME_TA_GET_MASK		(0xff<<24)
12498c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_1_CFG_CSR_TIME_TA_GET_SHIFT	24
12508c2ecf20Sopenharmony_ci/* Time to Drive LP-00 after Turn Request */
12518c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_1_CFG_CSR_TIME_TA_GO_MASK		(0xff<<16)
12528c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_1_CFG_CSR_TIME_TA_GO_SHIFT		16
12538c2ecf20Sopenharmony_ci/* DPHY HS Wakeup Period Length */
12548c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_1_CFG_CSR_TIME_WAKEUP_MASK		(0xffff)
12558c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_1_CFG_CSR_TIME_WAKEUP_SHIFT	0
12568c2ecf20Sopenharmony_ci
12578c2ecf20Sopenharmony_ci/*	DSI_PHY_TIME_2		0x00c8	DPHY Timing Control Register 2 */
12588c2ecf20Sopenharmony_ci/* DPHY CLK Exit Period Length */
12598c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_2_CFG_CSR_TIME_CK_EXIT_MASK	(0xff<<24)
12608c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_2_CFG_CSR_TIME_CK_EXIT_SHIFT	24
12618c2ecf20Sopenharmony_ci/* DPHY CLK Trail Period Length */
12628c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_2_CFG_CSR_TIME_CK_TRAIL_MASK	(0xff<<16)
12638c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_2_CFG_CSR_TIME_CK_TRAIL_SHIFT	16
12648c2ecf20Sopenharmony_ci/* DPHY CLK Zero State Length */
12658c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_2_CFG_CSR_TIME_CK_ZERO_MASK	(0xff<<8)
12668c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_2_CFG_CSR_TIME_CK_ZERO_SHIFT	8
12678c2ecf20Sopenharmony_ci/* DPHY CLK LP Length */
12688c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_2_CFG_CSR_TIME_CK_LPX_MASK		(0xff)
12698c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_2_CFG_CSR_TIME_CK_LPX_SHIFT	0
12708c2ecf20Sopenharmony_ci
12718c2ecf20Sopenharmony_ci/*	DSI_PHY_TIME_3		0x00cc	DPHY Timing Control Register 3 */
12728c2ecf20Sopenharmony_ci/*		Bit(s) DSI_PHY_TIME_3_RSRV_31_16 reserved */
12738c2ecf20Sopenharmony_ci/* DPHY LP Length */
12748c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_3_CFG_CSR_TIME_LPX_MASK		(0xff<<8)
12758c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_3_CFG_CSR_TIME_LPX_SHIFT		8
12768c2ecf20Sopenharmony_ci/* DPHY HS req to rdy Length */
12778c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_MASK		(0xff)
12788c2ecf20Sopenharmony_ci#define	DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_SHIFT	0
12798c2ecf20Sopenharmony_ci
12808c2ecf20Sopenharmony_ci#define DSI_ESC_CLK				66  /* Unit: Mhz */
12818c2ecf20Sopenharmony_ci#define DSI_ESC_CLK_T				15  /* Unit: ns */
12828c2ecf20Sopenharmony_ci
12838c2ecf20Sopenharmony_ci/* LVDS */
12848c2ecf20Sopenharmony_ci/* LVDS_PHY_CTRL */
12858c2ecf20Sopenharmony_ci#define LVDS_PHY_CTL				0x2A4
12868c2ecf20Sopenharmony_ci#define LVDS_PLL_LOCK				(1 << 31)
12878c2ecf20Sopenharmony_ci#define LVDS_PHY_EXT_MASK			(7 << 28)
12888c2ecf20Sopenharmony_ci#define LVDS_PHY_EXT_SHIFT			(28)
12898c2ecf20Sopenharmony_ci#define LVDS_CLK_PHASE_MASK			(0x7f << 16)
12908c2ecf20Sopenharmony_ci#define LVDS_CLK_PHASE_SHIFT			(16)
12918c2ecf20Sopenharmony_ci#define LVDS_SSC_RESET_EXT			(1 << 13)
12928c2ecf20Sopenharmony_ci#define LVDS_SSC_MODE_DOWN_SPREAD		(1 << 12)
12938c2ecf20Sopenharmony_ci#define LVDS_SSC_EN				(1 << 11)
12948c2ecf20Sopenharmony_ci#define LVDS_PU_PLL				(1 << 10)
12958c2ecf20Sopenharmony_ci#define LVDS_PU_TX				(1 << 9)
12968c2ecf20Sopenharmony_ci#define LVDS_PU_IVREF				(1 << 8)
12978c2ecf20Sopenharmony_ci#define LVDS_CLK_SEL				(1 << 7)
12988c2ecf20Sopenharmony_ci#define LVDS_CLK_SEL_LVDS_PCLK			(1 << 7)
12998c2ecf20Sopenharmony_ci#define LVDS_PD_CH_MASK				(0x3f << 1)
13008c2ecf20Sopenharmony_ci#define LVDS_PD_CH(ch)				((ch) << 1)
13018c2ecf20Sopenharmony_ci#define LVDS_RST				(1 << 0)
13028c2ecf20Sopenharmony_ci
13038c2ecf20Sopenharmony_ci#define LVDS_PHY_CTL_EXT	0x2A8
13048c2ecf20Sopenharmony_ci
13058c2ecf20Sopenharmony_ci/* LVDS_PHY_CTRL_EXT1 */
13068c2ecf20Sopenharmony_ci#define LVDS_SSC_RNGE_MASK			(0x7ff << 16)
13078c2ecf20Sopenharmony_ci#define LVDS_SSC_RNGE_SHIFT			(16)
13088c2ecf20Sopenharmony_ci#define LVDS_RESERVE_IN_MASK			(0xf << 12)
13098c2ecf20Sopenharmony_ci#define LVDS_RESERVE_IN_SHIFT			(12)
13108c2ecf20Sopenharmony_ci#define LVDS_TEST_MON_MASK			(0x7 << 8)
13118c2ecf20Sopenharmony_ci#define LVDS_TEST_MON_SHIFT			(8)
13128c2ecf20Sopenharmony_ci#define LVDS_POL_SWAP_MASK			(0x3f << 0)
13138c2ecf20Sopenharmony_ci#define LVDS_POL_SWAP_SHIFT			(0)
13148c2ecf20Sopenharmony_ci
13158c2ecf20Sopenharmony_ci/* LVDS_PHY_CTRL_EXT2 */
13168c2ecf20Sopenharmony_ci#define LVDS_TX_DIF_AMP_MASK			(0xf << 24)
13178c2ecf20Sopenharmony_ci#define LVDS_TX_DIF_AMP_SHIFT			(24)
13188c2ecf20Sopenharmony_ci#define LVDS_TX_DIF_CM_MASK			(0x3 << 22)
13198c2ecf20Sopenharmony_ci#define LVDS_TX_DIF_CM_SHIFT			(22)
13208c2ecf20Sopenharmony_ci#define LVDS_SELLV_TXCLK_MASK			(0x1f << 16)
13218c2ecf20Sopenharmony_ci#define LVDS_SELLV_TXCLK_SHIFT			(16)
13228c2ecf20Sopenharmony_ci#define LVDS_TX_CMFB_EN				(0x1 << 15)
13238c2ecf20Sopenharmony_ci#define LVDS_TX_TERM_EN				(0x1 << 14)
13248c2ecf20Sopenharmony_ci#define LVDS_SELLV_TXDATA_MASK			(0x1f << 8)
13258c2ecf20Sopenharmony_ci#define LVDS_SELLV_TXDATA_SHIFT			(8)
13268c2ecf20Sopenharmony_ci#define LVDS_SELLV_OP7_MASK			(0x3 << 6)
13278c2ecf20Sopenharmony_ci#define LVDS_SELLV_OP7_SHIFT			(6)
13288c2ecf20Sopenharmony_ci#define LVDS_SELLV_OP6_MASK			(0x3 << 4)
13298c2ecf20Sopenharmony_ci#define LVDS_SELLV_OP6_SHIFT			(4)
13308c2ecf20Sopenharmony_ci#define LVDS_SELLV_OP9_MASK			(0x3 << 2)
13318c2ecf20Sopenharmony_ci#define LVDS_SELLV_OP9_SHIFT			(2)
13328c2ecf20Sopenharmony_ci#define LVDS_STRESSTST_EN			(0x1 << 0)
13338c2ecf20Sopenharmony_ci
13348c2ecf20Sopenharmony_ci/* LVDS_PHY_CTRL_EXT3 */
13358c2ecf20Sopenharmony_ci#define LVDS_KVCO_MASK				(0xf << 28)
13368c2ecf20Sopenharmony_ci#define LVDS_KVCO_SHIFT				(28)
13378c2ecf20Sopenharmony_ci#define LVDS_CTUNE_MASK				(0x3 << 26)
13388c2ecf20Sopenharmony_ci#define LVDS_CTUNE_SHIFT			(26)
13398c2ecf20Sopenharmony_ci#define LVDS_VREG_IVREF_MASK			(0x3 << 24)
13408c2ecf20Sopenharmony_ci#define LVDS_VREG_IVREF_SHIFT			(24)
13418c2ecf20Sopenharmony_ci#define LVDS_VDDL_MASK				(0xf << 20)
13428c2ecf20Sopenharmony_ci#define LVDS_VDDL_SHIFT				(20)
13438c2ecf20Sopenharmony_ci#define LVDS_VDDM_MASK				(0x3 << 18)
13448c2ecf20Sopenharmony_ci#define LVDS_VDDM_SHIFT				(18)
13458c2ecf20Sopenharmony_ci#define LVDS_FBDIV_MASK				(0xf << 8)
13468c2ecf20Sopenharmony_ci#define LVDS_FBDIV_SHIFT			(8)
13478c2ecf20Sopenharmony_ci#define LVDS_REFDIV_MASK			(0x7f << 0)
13488c2ecf20Sopenharmony_ci#define LVDS_REFDIV_SHIFT			(0)
13498c2ecf20Sopenharmony_ci
13508c2ecf20Sopenharmony_ci/* LVDS_PHY_CTRL_EXT4 */
13518c2ecf20Sopenharmony_ci#define LVDS_SSC_FREQ_DIV_MASK			(0xffff << 16)
13528c2ecf20Sopenharmony_ci#define LVDS_SSC_FREQ_DIV_SHIFT			(16)
13538c2ecf20Sopenharmony_ci#define LVDS_INTPI_MASK				(0xf << 12)
13548c2ecf20Sopenharmony_ci#define LVDS_INTPI_SHIFT			(12)
13558c2ecf20Sopenharmony_ci#define LVDS_VCODIV_SEL_SE_MASK			(0xf << 8)
13568c2ecf20Sopenharmony_ci#define LVDS_VCODIV_SEL_SE_SHIFT		(8)
13578c2ecf20Sopenharmony_ci#define LVDS_RESET_INTP_EXT			(0x1 << 7)
13588c2ecf20Sopenharmony_ci#define LVDS_VCO_VRNG_MASK			(0x7 << 4)
13598c2ecf20Sopenharmony_ci#define LVDS_VCO_VRNG_SHIFT			(4)
13608c2ecf20Sopenharmony_ci#define LVDS_PI_EN				(0x1 << 3)
13618c2ecf20Sopenharmony_ci#define LVDS_ICP_MASK				(0x7 << 0)
13628c2ecf20Sopenharmony_ci#define LVDS_ICP_SHIFT				(0)
13638c2ecf20Sopenharmony_ci
13648c2ecf20Sopenharmony_ci/* LVDS_PHY_CTRL_EXT5 */
13658c2ecf20Sopenharmony_ci#define LVDS_FREQ_OFFSET_MASK			(0x1ffff << 15)
13668c2ecf20Sopenharmony_ci#define LVDS_FREQ_OFFSET_SHIFT			(15)
13678c2ecf20Sopenharmony_ci#define LVDS_FREQ_OFFSET_VALID			(0x1 << 2)
13688c2ecf20Sopenharmony_ci#define LVDS_FREQ_OFFSET_MODE_CK_DIV4_OUT	(0x1 << 1)
13698c2ecf20Sopenharmony_ci#define LVDS_FREQ_OFFSET_MODE_EN		(0x1 << 0)
13708c2ecf20Sopenharmony_ci
13718c2ecf20Sopenharmony_cienum {
13728c2ecf20Sopenharmony_ci	PATH_PN = 0,
13738c2ecf20Sopenharmony_ci	PATH_TV,
13748c2ecf20Sopenharmony_ci	PATH_P2,
13758c2ecf20Sopenharmony_ci};
13768c2ecf20Sopenharmony_ci
13778c2ecf20Sopenharmony_ci/*
13788c2ecf20Sopenharmony_ci * mmp path describes part of mmp path related info:
13798c2ecf20Sopenharmony_ci * which is hiden in display driver and not exported to buffer driver
13808c2ecf20Sopenharmony_ci */
13818c2ecf20Sopenharmony_cistruct mmphw_ctrl;
13828c2ecf20Sopenharmony_cistruct mmphw_path_plat {
13838c2ecf20Sopenharmony_ci	int id;
13848c2ecf20Sopenharmony_ci	struct mmphw_ctrl *ctrl;
13858c2ecf20Sopenharmony_ci	struct mmp_path *path;
13868c2ecf20Sopenharmony_ci	u32 path_config;
13878c2ecf20Sopenharmony_ci	u32 link_config;
13888c2ecf20Sopenharmony_ci	u32 dsi_rbswap;
13898c2ecf20Sopenharmony_ci};
13908c2ecf20Sopenharmony_ci
13918c2ecf20Sopenharmony_ci/* mmp ctrl describes mmp controller related info */
13928c2ecf20Sopenharmony_cistruct mmphw_ctrl {
13938c2ecf20Sopenharmony_ci	/* platform related, get from config */
13948c2ecf20Sopenharmony_ci	const char *name;
13958c2ecf20Sopenharmony_ci	int irq;
13968c2ecf20Sopenharmony_ci	void __iomem *reg_base;
13978c2ecf20Sopenharmony_ci	struct clk *clk;
13988c2ecf20Sopenharmony_ci
13998c2ecf20Sopenharmony_ci	/* sys info */
14008c2ecf20Sopenharmony_ci	struct device *dev;
14018c2ecf20Sopenharmony_ci
14028c2ecf20Sopenharmony_ci	/* state */
14038c2ecf20Sopenharmony_ci	int open_count;
14048c2ecf20Sopenharmony_ci	int status;
14058c2ecf20Sopenharmony_ci	struct mutex access_ok;
14068c2ecf20Sopenharmony_ci
14078c2ecf20Sopenharmony_ci	/*pathes*/
14088c2ecf20Sopenharmony_ci	int path_num;
14098c2ecf20Sopenharmony_ci	struct mmphw_path_plat path_plats[];
14108c2ecf20Sopenharmony_ci};
14118c2ecf20Sopenharmony_ci
14128c2ecf20Sopenharmony_cistatic inline int overlay_is_vid(struct mmp_overlay *overlay)
14138c2ecf20Sopenharmony_ci{
14148c2ecf20Sopenharmony_ci	return overlay->dmafetch_id & 1;
14158c2ecf20Sopenharmony_ci}
14168c2ecf20Sopenharmony_ci
14178c2ecf20Sopenharmony_cistatic inline struct mmphw_path_plat *path_to_path_plat(struct mmp_path *path)
14188c2ecf20Sopenharmony_ci{
14198c2ecf20Sopenharmony_ci	return (struct mmphw_path_plat *)path->plat_data;
14208c2ecf20Sopenharmony_ci}
14218c2ecf20Sopenharmony_ci
14228c2ecf20Sopenharmony_cistatic inline struct mmphw_ctrl *path_to_ctrl(struct mmp_path *path)
14238c2ecf20Sopenharmony_ci{
14248c2ecf20Sopenharmony_ci	return path_to_path_plat(path)->ctrl;
14258c2ecf20Sopenharmony_ci}
14268c2ecf20Sopenharmony_ci
14278c2ecf20Sopenharmony_cistatic inline struct mmphw_ctrl *overlay_to_ctrl(struct mmp_overlay *overlay)
14288c2ecf20Sopenharmony_ci{
14298c2ecf20Sopenharmony_ci	return path_to_ctrl(overlay->path);
14308c2ecf20Sopenharmony_ci}
14318c2ecf20Sopenharmony_ci
14328c2ecf20Sopenharmony_cistatic inline void __iomem *ctrl_regs(struct mmp_path *path)
14338c2ecf20Sopenharmony_ci{
14348c2ecf20Sopenharmony_ci	return path_to_ctrl(path)->reg_base;
14358c2ecf20Sopenharmony_ci}
14368c2ecf20Sopenharmony_ci
14378c2ecf20Sopenharmony_ci/* path regs, for regs symmetrical for both pathes */
14388c2ecf20Sopenharmony_cistatic inline struct lcd_regs *path_regs(struct mmp_path *path)
14398c2ecf20Sopenharmony_ci{
14408c2ecf20Sopenharmony_ci	if (path->id == PATH_PN)
14418c2ecf20Sopenharmony_ci		return (struct lcd_regs __force *)(ctrl_regs(path) + 0xc0);
14428c2ecf20Sopenharmony_ci	else if (path->id == PATH_TV)
14438c2ecf20Sopenharmony_ci		return (struct lcd_regs __force  *)ctrl_regs(path);
14448c2ecf20Sopenharmony_ci	else if (path->id == PATH_P2)
14458c2ecf20Sopenharmony_ci		return (struct lcd_regs __force *)(ctrl_regs(path) + 0x200);
14468c2ecf20Sopenharmony_ci	else {
14478c2ecf20Sopenharmony_ci		dev_err(path->dev, "path id %d invalid\n", path->id);
14488c2ecf20Sopenharmony_ci		BUG_ON(1);
14498c2ecf20Sopenharmony_ci		return NULL;
14508c2ecf20Sopenharmony_ci	}
14518c2ecf20Sopenharmony_ci}
14528c2ecf20Sopenharmony_ci
14538c2ecf20Sopenharmony_ci#ifdef CONFIG_MMP_DISP_SPI
14548c2ecf20Sopenharmony_ciextern int lcd_spi_register(struct mmphw_ctrl *ctrl);
14558c2ecf20Sopenharmony_ci#endif
14568c2ecf20Sopenharmony_ci#endif	/* _MMP_CTRL_H_ */
1457