18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __PXA168FB_H__
38c2ecf20Sopenharmony_ci#define __PXA168FB_H__
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/* ------------< LCD register >------------ */
68c2ecf20Sopenharmony_ci/* Video Frame 0&1 start address registers */
78c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_Y0		0x00C0
88c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_U0		0x00C4
98c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_V0		0x00C8
108c2ecf20Sopenharmony_ci#define LCD_CFG_DMA_START_ADDR_0		0x00CC /* Cmd address */
118c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_Y1		0x00D0
128c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_U1		0x00D4
138c2ecf20Sopenharmony_ci#define	LCD_SPU_DMA_START_ADDR_V1		0x00D8
148c2ecf20Sopenharmony_ci#define LCD_CFG_DMA_START_ADDR_1		0x00DC /* Cmd address */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/* YC & UV Pitch */
178c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_PITCH_YC			0x00E0
188c2ecf20Sopenharmony_ci#define     SPU_DMA_PITCH_C(c)			((c) << 16)
198c2ecf20Sopenharmony_ci#define     SPU_DMA_PITCH_Y(y)			(y)
208c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_PITCH_UV			0x00E4
218c2ecf20Sopenharmony_ci#define     SPU_DMA_PITCH_V(v)			((v) << 16)
228c2ecf20Sopenharmony_ci#define     SPU_DMA_PITCH_U(u)			(u)
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/* Video Starting Point on Screen Register */
258c2ecf20Sopenharmony_ci#define LCD_SPUT_DMA_OVSA_HPXL_VLN		0x00E8
268c2ecf20Sopenharmony_ci#define     CFG_DMA_OVSA_VLN(y)			((y) << 16) /* 0~0xfff */
278c2ecf20Sopenharmony_ci#define     CFG_DMA_OVSA_HPXL(x)		(x)     /* 0~0xfff */
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/* Video Size Register */
308c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_HPXL_VLN			0x00EC
318c2ecf20Sopenharmony_ci#define     CFG_DMA_VLN(y)			((y) << 16)
328c2ecf20Sopenharmony_ci#define     CFG_DMA_HPXL(x)			(x)
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci/* Video Size After zooming Register */
358c2ecf20Sopenharmony_ci#define LCD_SPU_DZM_HPXL_VLN			0x00F0
368c2ecf20Sopenharmony_ci#define     CFG_DZM_VLN(y)			((y) << 16)
378c2ecf20Sopenharmony_ci#define     CFG_DZM_HPXL(x)			(x)
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci/* Graphic Frame 0&1 Starting Address Register */
408c2ecf20Sopenharmony_ci#define LCD_CFG_GRA_START_ADDR0			0x00F4
418c2ecf20Sopenharmony_ci#define LCD_CFG_GRA_START_ADDR1			0x00F8
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci/* Graphic Frame Pitch */
448c2ecf20Sopenharmony_ci#define LCD_CFG_GRA_PITCH			0x00FC
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/* Graphic Starting Point on Screen Register */
478c2ecf20Sopenharmony_ci#define LCD_SPU_GRA_OVSA_HPXL_VLN		0x0100
488c2ecf20Sopenharmony_ci#define     CFG_GRA_OVSA_VLN(y)			((y) << 16)
498c2ecf20Sopenharmony_ci#define     CFG_GRA_OVSA_HPXL(x)		(x)
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci/* Graphic Size Register */
528c2ecf20Sopenharmony_ci#define LCD_SPU_GRA_HPXL_VLN			0x0104
538c2ecf20Sopenharmony_ci#define     CFG_GRA_VLN(y)			((y) << 16)
548c2ecf20Sopenharmony_ci#define     CFG_GRA_HPXL(x)			(x)
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/* Graphic Size after Zooming Register */
578c2ecf20Sopenharmony_ci#define LCD_SPU_GZM_HPXL_VLN			0x0108
588c2ecf20Sopenharmony_ci#define     CFG_GZM_VLN(y)			((y) << 16)
598c2ecf20Sopenharmony_ci#define     CFG_GZM_HPXL(x)			(x)
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci/* HW Cursor Starting Point on Screen Register */
628c2ecf20Sopenharmony_ci#define LCD_SPU_HWC_OVSA_HPXL_VLN		0x010C
638c2ecf20Sopenharmony_ci#define     CFG_HWC_OVSA_VLN(y)			((y) << 16)
648c2ecf20Sopenharmony_ci#define     CFG_HWC_OVSA_HPXL(x)		(x)
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/* HW Cursor Size */
678c2ecf20Sopenharmony_ci#define LCD_SPU_HWC_HPXL_VLN			0x0110
688c2ecf20Sopenharmony_ci#define     CFG_HWC_VLN(y)			((y) << 16)
698c2ecf20Sopenharmony_ci#define     CFG_HWC_HPXL(x)			(x)
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci/* Total Screen Size Register */
728c2ecf20Sopenharmony_ci#define LCD_SPUT_V_H_TOTAL			0x0114
738c2ecf20Sopenharmony_ci#define     CFG_V_TOTAL(y)			((y) << 16)
748c2ecf20Sopenharmony_ci#define     CFG_H_TOTAL(x)			(x)
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci/* Total Screen Active Size Register */
778c2ecf20Sopenharmony_ci#define LCD_SPU_V_H_ACTIVE			0x0118
788c2ecf20Sopenharmony_ci#define     CFG_V_ACTIVE(y)			((y) << 16)
798c2ecf20Sopenharmony_ci#define     CFG_H_ACTIVE(x)			(x)
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci/* Screen H&V Porch Register */
828c2ecf20Sopenharmony_ci#define LCD_SPU_H_PORCH				0x011C
838c2ecf20Sopenharmony_ci#define     CFG_H_BACK_PORCH(b)			((b) << 16)
848c2ecf20Sopenharmony_ci#define     CFG_H_FRONT_PORCH(f)		(f)
858c2ecf20Sopenharmony_ci#define LCD_SPU_V_PORCH				0x0120
868c2ecf20Sopenharmony_ci#define     CFG_V_BACK_PORCH(b)			((b) << 16)
878c2ecf20Sopenharmony_ci#define     CFG_V_FRONT_PORCH(f)		(f)
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci/* Screen Blank Color Register */
908c2ecf20Sopenharmony_ci#define LCD_SPU_BLANKCOLOR			0x0124
918c2ecf20Sopenharmony_ci#define     CFG_BLANKCOLOR_MASK			0x00FFFFFF
928c2ecf20Sopenharmony_ci#define     CFG_BLANKCOLOR_R_MASK		0x000000FF
938c2ecf20Sopenharmony_ci#define     CFG_BLANKCOLOR_G_MASK		0x0000FF00
948c2ecf20Sopenharmony_ci#define     CFG_BLANKCOLOR_B_MASK		0x00FF0000
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci/* HW Cursor Color 1&2 Register */
978c2ecf20Sopenharmony_ci#define LCD_SPU_ALPHA_COLOR1			0x0128
988c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR1			0x00FFFFFF
998c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR1_R(red)		((red) << 16)
1008c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR1_G(green)		((green) << 8)
1018c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR1_B(blue)		(blue)
1028c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR1_R_MASK		0x000000FF
1038c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR1_G_MASK		0x0000FF00
1048c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR1_B_MASK		0x00FF0000
1058c2ecf20Sopenharmony_ci#define LCD_SPU_ALPHA_COLOR2			0x012C
1068c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR2			0x00FFFFFF
1078c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR2_R_MASK		0x000000FF
1088c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR2_G_MASK		0x0000FF00
1098c2ecf20Sopenharmony_ci#define     CFG_HWC_COLOR2_B_MASK		0x00FF0000
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci/* Video YUV Color Key Control */
1128c2ecf20Sopenharmony_ci#define LCD_SPU_COLORKEY_Y			0x0130
1138c2ecf20Sopenharmony_ci#define     CFG_CKEY_Y2(y2)			((y2) << 24)
1148c2ecf20Sopenharmony_ci#define     CFG_CKEY_Y2_MASK			0xFF000000
1158c2ecf20Sopenharmony_ci#define     CFG_CKEY_Y1(y1)			((y1) << 16)
1168c2ecf20Sopenharmony_ci#define     CFG_CKEY_Y1_MASK			0x00FF0000
1178c2ecf20Sopenharmony_ci#define     CFG_CKEY_Y(y)			((y) << 8)
1188c2ecf20Sopenharmony_ci#define     CFG_CKEY_Y_MASK			0x0000FF00
1198c2ecf20Sopenharmony_ci#define     CFG_ALPHA_Y(y)			(y)
1208c2ecf20Sopenharmony_ci#define     CFG_ALPHA_Y_MASK			0x000000FF
1218c2ecf20Sopenharmony_ci#define LCD_SPU_COLORKEY_U			0x0134
1228c2ecf20Sopenharmony_ci#define     CFG_CKEY_U2(u2)			((u2) << 24)
1238c2ecf20Sopenharmony_ci#define     CFG_CKEY_U2_MASK			0xFF000000
1248c2ecf20Sopenharmony_ci#define     CFG_CKEY_U1(u1)			((u1) << 16)
1258c2ecf20Sopenharmony_ci#define     CFG_CKEY_U1_MASK			0x00FF0000
1268c2ecf20Sopenharmony_ci#define     CFG_CKEY_U(u)			((u) << 8)
1278c2ecf20Sopenharmony_ci#define     CFG_CKEY_U_MASK			0x0000FF00
1288c2ecf20Sopenharmony_ci#define     CFG_ALPHA_U(u)			(u)
1298c2ecf20Sopenharmony_ci#define     CFG_ALPHA_U_MASK			0x000000FF
1308c2ecf20Sopenharmony_ci#define LCD_SPU_COLORKEY_V			0x0138
1318c2ecf20Sopenharmony_ci#define     CFG_CKEY_V2(v2)			((v2) << 24)
1328c2ecf20Sopenharmony_ci#define     CFG_CKEY_V2_MASK			0xFF000000
1338c2ecf20Sopenharmony_ci#define     CFG_CKEY_V1(v1)			((v1) << 16)
1348c2ecf20Sopenharmony_ci#define     CFG_CKEY_V1_MASK			0x00FF0000
1358c2ecf20Sopenharmony_ci#define     CFG_CKEY_V(v)			((v) << 8)
1368c2ecf20Sopenharmony_ci#define     CFG_CKEY_V_MASK			0x0000FF00
1378c2ecf20Sopenharmony_ci#define     CFG_ALPHA_V(v)			(v)
1388c2ecf20Sopenharmony_ci#define     CFG_ALPHA_V_MASK			0x000000FF
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci/* SPI Read Data Register */
1418c2ecf20Sopenharmony_ci#define LCD_SPU_SPI_RXDATA			0x0140
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci/* Smart Panel Read Data Register */
1448c2ecf20Sopenharmony_ci#define LCD_SPU_ISA_RSDATA			0x0144
1458c2ecf20Sopenharmony_ci#define     ISA_RXDATA_16BIT_1_DATA_MASK	0x000000FF
1468c2ecf20Sopenharmony_ci#define     ISA_RXDATA_16BIT_2_DATA_MASK	0x0000FF00
1478c2ecf20Sopenharmony_ci#define     ISA_RXDATA_16BIT_3_DATA_MASK	0x00FF0000
1488c2ecf20Sopenharmony_ci#define     ISA_RXDATA_16BIT_4_DATA_MASK	0xFF000000
1498c2ecf20Sopenharmony_ci#define     ISA_RXDATA_32BIT_1_DATA_MASK	0x00FFFFFF
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci/* HWC SRAM Read Data Register */
1528c2ecf20Sopenharmony_ci#define LCD_SPU_HWC_RDDAT			0x0158
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci/* Gamma Table SRAM Read Data Register */
1558c2ecf20Sopenharmony_ci#define LCD_SPU_GAMMA_RDDAT			0x015c
1568c2ecf20Sopenharmony_ci#define     CFG_GAMMA_RDDAT_MASK		0x000000FF
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci/* Palette Table SRAM Read Data Register */
1598c2ecf20Sopenharmony_ci#define LCD_SPU_PALETTE_RDDAT			0x0160
1608c2ecf20Sopenharmony_ci#define     CFG_PALETTE_RDDAT_MASK		0x00FFFFFF
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci/* I/O Pads Input Read Only Register */
1638c2ecf20Sopenharmony_ci#define LCD_SPU_IOPAD_IN			0x0178
1648c2ecf20Sopenharmony_ci#define     CFG_IOPAD_IN_MASK			0x0FFFFFFF
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci/* Reserved Read Only Registers */
1678c2ecf20Sopenharmony_ci#define LCD_CFG_RDREG5F				0x017C
1688c2ecf20Sopenharmony_ci#define     IRE_FRAME_CNT_MASK			0x000000C0
1698c2ecf20Sopenharmony_ci#define     IPE_FRAME_CNT_MASK			0x00000030
1708c2ecf20Sopenharmony_ci#define     GRA_FRAME_CNT_MASK			0x0000000C  /* Graphic */
1718c2ecf20Sopenharmony_ci#define     DMA_FRAME_CNT_MASK			0x00000003  /* Video */
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci/* SPI Control Register. */
1748c2ecf20Sopenharmony_ci#define LCD_SPU_SPI_CTRL			0x0180
1758c2ecf20Sopenharmony_ci#define     CFG_SCLKCNT(div)			((div) << 24)  /* 0xFF~0x2 */
1768c2ecf20Sopenharmony_ci#define     CFG_SCLKCNT_MASK			0xFF000000
1778c2ecf20Sopenharmony_ci#define     CFG_RXBITS(rx)			((rx) << 16)   /* 0x1F~0x1 */
1788c2ecf20Sopenharmony_ci#define     CFG_RXBITS_MASK			0x00FF0000
1798c2ecf20Sopenharmony_ci#define     CFG_TXBITS(tx)			((tx) << 8)    /* 0x1F~0x1 */
1808c2ecf20Sopenharmony_ci#define     CFG_TXBITS_MASK			0x0000FF00
1818c2ecf20Sopenharmony_ci#define     CFG_CLKINV(clk)			((clk) << 7)
1828c2ecf20Sopenharmony_ci#define     CFG_CLKINV_MASK			0x00000080
1838c2ecf20Sopenharmony_ci#define     CFG_KEEPXFER(transfer)		((transfer) << 6)
1848c2ecf20Sopenharmony_ci#define     CFG_KEEPXFER_MASK			0x00000040
1858c2ecf20Sopenharmony_ci#define     CFG_RXBITSTO0(rx)			((rx) << 5)
1868c2ecf20Sopenharmony_ci#define     CFG_RXBITSTO0_MASK			0x00000020
1878c2ecf20Sopenharmony_ci#define     CFG_TXBITSTO0(tx)			((tx) << 4)
1888c2ecf20Sopenharmony_ci#define     CFG_TXBITSTO0_MASK			0x00000010
1898c2ecf20Sopenharmony_ci#define     CFG_SPI_ENA(spi)			((spi) << 3)
1908c2ecf20Sopenharmony_ci#define     CFG_SPI_ENA_MASK			0x00000008
1918c2ecf20Sopenharmony_ci#define     CFG_SPI_SEL(spi)			((spi) << 2)
1928c2ecf20Sopenharmony_ci#define     CFG_SPI_SEL_MASK			0x00000004
1938c2ecf20Sopenharmony_ci#define     CFG_SPI_3W4WB(wire)			((wire) << 1)
1948c2ecf20Sopenharmony_ci#define     CFG_SPI_3W4WB_MASK			0x00000002
1958c2ecf20Sopenharmony_ci#define     CFG_SPI_START(start)		(start)
1968c2ecf20Sopenharmony_ci#define     CFG_SPI_START_MASK			0x00000001
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci/* SPI Tx Data Register */
1998c2ecf20Sopenharmony_ci#define LCD_SPU_SPI_TXDATA			0x0184
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci/*
2028c2ecf20Sopenharmony_ci   1. Smart Pannel 8-bit Bus Control Register.
2038c2ecf20Sopenharmony_ci   2. AHB Slave Path Data Port Register
2048c2ecf20Sopenharmony_ci*/
2058c2ecf20Sopenharmony_ci#define LCD_SPU_SMPN_CTRL			0x0188
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci/* DMA Control 0 Register */
2088c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_CTRL0			0x0190
2098c2ecf20Sopenharmony_ci#define     CFG_NOBLENDING(nb)			((nb) << 31)
2108c2ecf20Sopenharmony_ci#define     CFG_NOBLENDING_MASK			0x80000000
2118c2ecf20Sopenharmony_ci#define     CFG_GAMMA_ENA(gn)			((gn) << 30)
2128c2ecf20Sopenharmony_ci#define     CFG_GAMMA_ENA_MASK			0x40000000
2138c2ecf20Sopenharmony_ci#define     CFG_CBSH_ENA(cn)			((cn) << 29)
2148c2ecf20Sopenharmony_ci#define     CFG_CBSH_ENA_MASK			0x20000000
2158c2ecf20Sopenharmony_ci#define     CFG_PALETTE_ENA(pn)			((pn) << 28)
2168c2ecf20Sopenharmony_ci#define     CFG_PALETTE_ENA_MASK		0x10000000
2178c2ecf20Sopenharmony_ci#define     CFG_ARBFAST_ENA(an)			((an) << 27)
2188c2ecf20Sopenharmony_ci#define     CFG_ARBFAST_ENA_MASK		0x08000000
2198c2ecf20Sopenharmony_ci#define     CFG_HWC_1BITMOD(mode)		((mode) << 26)
2208c2ecf20Sopenharmony_ci#define     CFG_HWC_1BITMOD_MASK		0x04000000
2218c2ecf20Sopenharmony_ci#define     CFG_HWC_1BITENA(mn)			((mn) << 25)
2228c2ecf20Sopenharmony_ci#define     CFG_HWC_1BITENA_MASK		0x02000000
2238c2ecf20Sopenharmony_ci#define     CFG_HWC_ENA(cn)		        ((cn) << 24)
2248c2ecf20Sopenharmony_ci#define     CFG_HWC_ENA_MASK			0x01000000
2258c2ecf20Sopenharmony_ci#define     CFG_DMAFORMAT(dmaformat)		((dmaformat) << 20)
2268c2ecf20Sopenharmony_ci#define     CFG_DMAFORMAT_MASK			0x00F00000
2278c2ecf20Sopenharmony_ci#define     CFG_GRAFORMAT(graformat)		((graformat) << 16)
2288c2ecf20Sopenharmony_ci#define     CFG_GRAFORMAT_MASK			0x000F0000
2298c2ecf20Sopenharmony_ci/* for graphic part */
2308c2ecf20Sopenharmony_ci#define     CFG_GRA_FTOGGLE(toggle)		((toggle) << 15)
2318c2ecf20Sopenharmony_ci#define     CFG_GRA_FTOGGLE_MASK		0x00008000
2328c2ecf20Sopenharmony_ci#define     CFG_GRA_HSMOOTH(smooth)		((smooth) << 14)
2338c2ecf20Sopenharmony_ci#define     CFG_GRA_HSMOOTH_MASK		0x00004000
2348c2ecf20Sopenharmony_ci#define     CFG_GRA_TSTMODE(test)		((test) << 13)
2358c2ecf20Sopenharmony_ci#define     CFG_GRA_TSTMODE_MASK		0x00002000
2368c2ecf20Sopenharmony_ci#define     CFG_GRA_SWAPRB(swap)		((swap) << 12)
2378c2ecf20Sopenharmony_ci#define     CFG_GRA_SWAPRB_MASK			0x00001000
2388c2ecf20Sopenharmony_ci#define     CFG_GRA_SWAPUV(swap)		((swap) << 11)
2398c2ecf20Sopenharmony_ci#define     CFG_GRA_SWAPUV_MASK			0x00000800
2408c2ecf20Sopenharmony_ci#define     CFG_GRA_SWAPYU(swap)		((swap) << 10)
2418c2ecf20Sopenharmony_ci#define     CFG_GRA_SWAPYU_MASK			0x00000400
2428c2ecf20Sopenharmony_ci#define     CFG_YUV2RGB_GRA(cvrt)		((cvrt) << 9)
2438c2ecf20Sopenharmony_ci#define     CFG_YUV2RGB_GRA_MASK		0x00000200
2448c2ecf20Sopenharmony_ci#define     CFG_GRA_ENA(gra)			((gra) << 8)
2458c2ecf20Sopenharmony_ci#define     CFG_GRA_ENA_MASK			0x00000100
2468c2ecf20Sopenharmony_ci/* for video part */
2478c2ecf20Sopenharmony_ci#define     CFG_DMA_FTOGGLE(toggle)		((toggle) << 7)
2488c2ecf20Sopenharmony_ci#define     CFG_DMA_FTOGGLE_MASK		0x00000080
2498c2ecf20Sopenharmony_ci#define     CFG_DMA_HSMOOTH(smooth)		((smooth) << 6)
2508c2ecf20Sopenharmony_ci#define     CFG_DMA_HSMOOTH_MASK		0x00000040
2518c2ecf20Sopenharmony_ci#define     CFG_DMA_TSTMODE(test)		((test) << 5)
2528c2ecf20Sopenharmony_ci#define     CFG_DMA_TSTMODE_MASK		0x00000020
2538c2ecf20Sopenharmony_ci#define     CFG_DMA_SWAPRB(swap)		((swap) << 4)
2548c2ecf20Sopenharmony_ci#define     CFG_DMA_SWAPRB_MASK			0x00000010
2558c2ecf20Sopenharmony_ci#define     CFG_DMA_SWAPUV(swap)		((swap) << 3)
2568c2ecf20Sopenharmony_ci#define     CFG_DMA_SWAPUV_MASK			0x00000008
2578c2ecf20Sopenharmony_ci#define     CFG_DMA_SWAPYU(swap)		((swap) << 2)
2588c2ecf20Sopenharmony_ci#define     CFG_DMA_SWAPYU_MASK			0x00000004
2598c2ecf20Sopenharmony_ci#define     CFG_DMA_SWAP_MASK			0x0000001C
2608c2ecf20Sopenharmony_ci#define     CFG_YUV2RGB_DMA(cvrt)		((cvrt) << 1)
2618c2ecf20Sopenharmony_ci#define     CFG_YUV2RGB_DMA_MASK		0x00000002
2628c2ecf20Sopenharmony_ci#define     CFG_DMA_ENA(video)			(video)
2638c2ecf20Sopenharmony_ci#define     CFG_DMA_ENA_MASK			0x00000001
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci/* DMA Control 1 Register */
2668c2ecf20Sopenharmony_ci#define LCD_SPU_DMA_CTRL1			0x0194
2678c2ecf20Sopenharmony_ci#define     CFG_FRAME_TRIG(trig)		((trig) << 31)
2688c2ecf20Sopenharmony_ci#define     CFG_FRAME_TRIG_MASK			0x80000000
2698c2ecf20Sopenharmony_ci#define     CFG_VSYNC_TRIG(trig)		((trig) << 28)
2708c2ecf20Sopenharmony_ci#define     CFG_VSYNC_TRIG_MASK			0x70000000
2718c2ecf20Sopenharmony_ci#define     CFG_VSYNC_INV(inv)			((inv) << 27)
2728c2ecf20Sopenharmony_ci#define     CFG_VSYNC_INV_MASK			0x08000000
2738c2ecf20Sopenharmony_ci#define     CFG_COLOR_KEY_MODE(cmode)		((cmode) << 24)
2748c2ecf20Sopenharmony_ci#define     CFG_COLOR_KEY_MASK			0x07000000
2758c2ecf20Sopenharmony_ci#define     CFG_CARRY(carry)			((carry) << 23)
2768c2ecf20Sopenharmony_ci#define     CFG_CARRY_MASK			0x00800000
2778c2ecf20Sopenharmony_ci#define     CFG_LNBUF_ENA(lnbuf)		((lnbuf) << 22)
2788c2ecf20Sopenharmony_ci#define     CFG_LNBUF_ENA_MASK			0x00400000
2798c2ecf20Sopenharmony_ci#define     CFG_GATED_ENA(gated)		((gated) << 21)
2808c2ecf20Sopenharmony_ci#define     CFG_GATED_ENA_MASK			0x00200000
2818c2ecf20Sopenharmony_ci#define     CFG_PWRDN_ENA(power)		((power) << 20)
2828c2ecf20Sopenharmony_ci#define     CFG_PWRDN_ENA_MASK			0x00100000
2838c2ecf20Sopenharmony_ci#define     CFG_DSCALE(dscale)			((dscale) << 18)
2848c2ecf20Sopenharmony_ci#define     CFG_DSCALE_MASK			0x000C0000
2858c2ecf20Sopenharmony_ci#define     CFG_ALPHA_MODE(amode)		((amode) << 16)
2868c2ecf20Sopenharmony_ci#define     CFG_ALPHA_MODE_MASK			0x00030000
2878c2ecf20Sopenharmony_ci#define     CFG_ALPHA(alpha)			((alpha) << 8)
2888c2ecf20Sopenharmony_ci#define     CFG_ALPHA_MASK			0x0000FF00
2898c2ecf20Sopenharmony_ci#define     CFG_PXLCMD(pxlcmd)			(pxlcmd)
2908c2ecf20Sopenharmony_ci#define     CFG_PXLCMD_MASK			0x000000FF
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_ci/* SRAM Control Register */
2938c2ecf20Sopenharmony_ci#define LCD_SPU_SRAM_CTRL			0x0198
2948c2ecf20Sopenharmony_ci#define     CFG_SRAM_INIT_WR_RD(mode)		((mode) << 14)
2958c2ecf20Sopenharmony_ci#define     CFG_SRAM_INIT_WR_RD_MASK		0x0000C000
2968c2ecf20Sopenharmony_ci#define     CFG_SRAM_ADDR_LCDID(id)		((id) << 8)
2978c2ecf20Sopenharmony_ci#define     CFG_SRAM_ADDR_LCDID_MASK		0x00000F00
2988c2ecf20Sopenharmony_ci#define     CFG_SRAM_ADDR(addr)			(addr)
2998c2ecf20Sopenharmony_ci#define     CFG_SRAM_ADDR_MASK			0x000000FF
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci/* SRAM Write Data Register */
3028c2ecf20Sopenharmony_ci#define LCD_SPU_SRAM_WRDAT			0x019C
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci/* SRAM RTC/WTC Control Register */
3058c2ecf20Sopenharmony_ci#define LCD_SPU_SRAM_PARA0			0x01A0
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_ci/* SRAM Power Down Control Register */
3088c2ecf20Sopenharmony_ci#define LCD_SPU_SRAM_PARA1			0x01A4
3098c2ecf20Sopenharmony_ci#define     CFG_CSB_256x32(hwc)			((hwc) << 15)	/* HWC */
3108c2ecf20Sopenharmony_ci#define     CFG_CSB_256x32_MASK			0x00008000
3118c2ecf20Sopenharmony_ci#define     CFG_CSB_256x24(palette)		((palette) << 14)	/* Palette */
3128c2ecf20Sopenharmony_ci#define     CFG_CSB_256x24_MASK			0x00004000
3138c2ecf20Sopenharmony_ci#define     CFG_CSB_256x8(gamma)		((gamma) << 13)	/* Gamma */
3148c2ecf20Sopenharmony_ci#define     CFG_CSB_256x8_MASK			0x00002000
3158c2ecf20Sopenharmony_ci#define     CFG_PDWN256x32(pdwn)		((pdwn) << 7)	/* HWC */
3168c2ecf20Sopenharmony_ci#define     CFG_PDWN256x32_MASK			0x00000080
3178c2ecf20Sopenharmony_ci#define     CFG_PDWN256x24(pdwn)		((pdwn) << 6)	/* Palette */
3188c2ecf20Sopenharmony_ci#define     CFG_PDWN256x24_MASK			0x00000040
3198c2ecf20Sopenharmony_ci#define     CFG_PDWN256x8(pdwn)			((pdwn) << 5)	/* Gamma */
3208c2ecf20Sopenharmony_ci#define     CFG_PDWN256x8_MASK			0x00000020
3218c2ecf20Sopenharmony_ci#define     CFG_PDWN32x32(pdwn)			((pdwn) << 3)
3228c2ecf20Sopenharmony_ci#define     CFG_PDWN32x32_MASK			0x00000008
3238c2ecf20Sopenharmony_ci#define     CFG_PDWN16x66(pdwn)			((pdwn) << 2)
3248c2ecf20Sopenharmony_ci#define     CFG_PDWN16x66_MASK			0x00000004
3258c2ecf20Sopenharmony_ci#define     CFG_PDWN32x66(pdwn)			((pdwn) << 1)
3268c2ecf20Sopenharmony_ci#define     CFG_PDWN32x66_MASK			0x00000002
3278c2ecf20Sopenharmony_ci#define     CFG_PDWN64x66(pdwn)			(pdwn)
3288c2ecf20Sopenharmony_ci#define     CFG_PDWN64x66_MASK			0x00000001
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci/* Smart or Dumb Panel Clock Divider */
3318c2ecf20Sopenharmony_ci#define LCD_CFG_SCLK_DIV			0x01A8
3328c2ecf20Sopenharmony_ci#define     SCLK_SOURCE_SELECT(src)		((src) << 31)
3338c2ecf20Sopenharmony_ci#define     SCLK_SOURCE_SELECT_MASK		0x80000000
3348c2ecf20Sopenharmony_ci#define     CLK_FRACDIV(frac)			((frac) << 16)
3358c2ecf20Sopenharmony_ci#define     CLK_FRACDIV_MASK			0x0FFF0000
3368c2ecf20Sopenharmony_ci#define     CLK_INT_DIV(div)			(div)
3378c2ecf20Sopenharmony_ci#define     CLK_INT_DIV_MASK			0x0000FFFF
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_ci/* Video Contrast Register */
3408c2ecf20Sopenharmony_ci#define LCD_SPU_CONTRAST			0x01AC
3418c2ecf20Sopenharmony_ci#define     CFG_BRIGHTNESS(bright)		((bright) << 16)
3428c2ecf20Sopenharmony_ci#define     CFG_BRIGHTNESS_MASK			0xFFFF0000
3438c2ecf20Sopenharmony_ci#define     CFG_CONTRAST(contrast)		(contrast)
3448c2ecf20Sopenharmony_ci#define     CFG_CONTRAST_MASK			0x0000FFFF
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_ci/* Video Saturation Register */
3478c2ecf20Sopenharmony_ci#define LCD_SPU_SATURATION			0x01B0
3488c2ecf20Sopenharmony_ci#define     CFG_C_MULTS(mult)			((mult) << 16)
3498c2ecf20Sopenharmony_ci#define     CFG_C_MULTS_MASK			0xFFFF0000
3508c2ecf20Sopenharmony_ci#define     CFG_SATURATION(sat)			(sat)
3518c2ecf20Sopenharmony_ci#define     CFG_SATURATION_MASK			0x0000FFFF
3528c2ecf20Sopenharmony_ci
3538c2ecf20Sopenharmony_ci/* Video Hue Adjust Register */
3548c2ecf20Sopenharmony_ci#define LCD_SPU_CBSH_HUE			0x01B4
3558c2ecf20Sopenharmony_ci#define     CFG_SIN0(sin0)			((sin0) << 16)
3568c2ecf20Sopenharmony_ci#define     CFG_SIN0_MASK			0xFFFF0000
3578c2ecf20Sopenharmony_ci#define     CFG_COS0(con0)			(con0)
3588c2ecf20Sopenharmony_ci#define     CFG_COS0_MASK			0x0000FFFF
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_ci/* Dump LCD Panel Control Register */
3618c2ecf20Sopenharmony_ci#define LCD_SPU_DUMB_CTRL			0x01B8
3628c2ecf20Sopenharmony_ci#define     CFG_DUMBMODE(mode)			((mode) << 28)
3638c2ecf20Sopenharmony_ci#define     CFG_DUMBMODE_MASK			0xF0000000
3648c2ecf20Sopenharmony_ci#define     CFG_LCDGPIO_O(data)			((data) << 20)
3658c2ecf20Sopenharmony_ci#define     CFG_LCDGPIO_O_MASK			0x0FF00000
3668c2ecf20Sopenharmony_ci#define     CFG_LCDGPIO_ENA(gpio)		((gpio) << 12)
3678c2ecf20Sopenharmony_ci#define     CFG_LCDGPIO_ENA_MASK		0x000FF000
3688c2ecf20Sopenharmony_ci#define     CFG_BIAS_OUT(bias)			((bias) << 8)
3698c2ecf20Sopenharmony_ci#define     CFG_BIAS_OUT_MASK			0x00000100
3708c2ecf20Sopenharmony_ci#define     CFG_REVERSE_RGB(rRGB)		((rRGB) << 7)
3718c2ecf20Sopenharmony_ci#define     CFG_REVERSE_RGB_MASK		0x00000080
3728c2ecf20Sopenharmony_ci#define     CFG_INV_COMPBLANK(blank)		((blank) << 6)
3738c2ecf20Sopenharmony_ci#define     CFG_INV_COMPBLANK_MASK		0x00000040
3748c2ecf20Sopenharmony_ci#define     CFG_INV_COMPSYNC(sync)		((sync) << 5)
3758c2ecf20Sopenharmony_ci#define     CFG_INV_COMPSYNC_MASK		0x00000020
3768c2ecf20Sopenharmony_ci#define     CFG_INV_HENA(hena)			((hena) << 4)
3778c2ecf20Sopenharmony_ci#define     CFG_INV_HENA_MASK			0x00000010
3788c2ecf20Sopenharmony_ci#define     CFG_INV_VSYNC(vsync)		((vsync) << 3)
3798c2ecf20Sopenharmony_ci#define     CFG_INV_VSYNC_MASK			0x00000008
3808c2ecf20Sopenharmony_ci#define     CFG_INV_HSYNC(hsync)		((hsync) << 2)
3818c2ecf20Sopenharmony_ci#define     CFG_INV_HSYNC_MASK			0x00000004
3828c2ecf20Sopenharmony_ci#define     CFG_INV_PCLK(pclk)			((pclk) << 1)
3838c2ecf20Sopenharmony_ci#define     CFG_INV_PCLK_MASK			0x00000002
3848c2ecf20Sopenharmony_ci#define     CFG_DUMB_ENA(dumb)			(dumb)
3858c2ecf20Sopenharmony_ci#define     CFG_DUMB_ENA_MASK			0x00000001
3868c2ecf20Sopenharmony_ci
3878c2ecf20Sopenharmony_ci/* LCD I/O Pads Control Register */
3888c2ecf20Sopenharmony_ci#define SPU_IOPAD_CONTROL			0x01BC
3898c2ecf20Sopenharmony_ci#define     CFG_GRA_VM_ENA(vm)			((vm) << 15)        /* gfx */
3908c2ecf20Sopenharmony_ci#define     CFG_GRA_VM_ENA_MASK			0x00008000
3918c2ecf20Sopenharmony_ci#define     CFG_DMA_VM_ENA(vm)			((vm) << 13)	/* video */
3928c2ecf20Sopenharmony_ci#define     CFG_DMA_VM_ENA_MASK			0x00002000
3938c2ecf20Sopenharmony_ci#define     CFG_CMD_VM_ENA(vm)			((vm) << 13)
3948c2ecf20Sopenharmony_ci#define     CFG_CMD_VM_ENA_MASK			0x00000800
3958c2ecf20Sopenharmony_ci#define     CFG_CSC(csc)			((csc) << 8)	/* csc */
3968c2ecf20Sopenharmony_ci#define     CFG_CSC_MASK			0x00000300
3978c2ecf20Sopenharmony_ci#define     CFG_AXICTRL(axi)			((axi) << 4)
3988c2ecf20Sopenharmony_ci#define     CFG_AXICTRL_MASK			0x000000F0
3998c2ecf20Sopenharmony_ci#define     CFG_IOPADMODE(iopad)		(iopad)
4008c2ecf20Sopenharmony_ci#define     CFG_IOPADMODE_MASK			0x0000000F
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci/* LCD Interrupt Control Register */
4038c2ecf20Sopenharmony_ci#define SPU_IRQ_ENA				0x01C0
4048c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ0_ENA(irq)		((irq) << 31)
4058c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ0_ENA_MASK		0x80000000
4068c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ1_ENA(irq)		((irq) << 30)
4078c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ1_ENA_MASK		0x40000000
4088c2ecf20Sopenharmony_ci#define     DMA_FF_UNDERFLOW_ENA(ff)		((ff) << 29)
4098c2ecf20Sopenharmony_ci#define     DMA_FF_UNDERFLOW_ENA_MASK		0x20000000
4108c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ0_ENA(irq)		((irq) << 27)
4118c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ0_ENA_MASK		0x08000000
4128c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ1_ENA(irq)		((irq) << 26)
4138c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ1_ENA_MASK		0x04000000
4148c2ecf20Sopenharmony_ci#define     GRA_FF_UNDERFLOW_ENA(ff)		((ff) << 25)
4158c2ecf20Sopenharmony_ci#define     GRA_FF_UNDERFLOW_ENA_MASK		0x02000000
4168c2ecf20Sopenharmony_ci#define     VSYNC_IRQ_ENA(vsync_irq)		((vsync_irq) << 23)
4178c2ecf20Sopenharmony_ci#define     VSYNC_IRQ_ENA_MASK			0x00800000
4188c2ecf20Sopenharmony_ci#define     DUMB_FRAMEDONE_ENA(fdone)		((fdone) << 22)
4198c2ecf20Sopenharmony_ci#define     DUMB_FRAMEDONE_ENA_MASK		0x00400000
4208c2ecf20Sopenharmony_ci#define     TWC_FRAMEDONE_ENA(fdone)		((fdone) << 21)
4218c2ecf20Sopenharmony_ci#define     TWC_FRAMEDONE_ENA_MASK		0x00200000
4228c2ecf20Sopenharmony_ci#define     HWC_FRAMEDONE_ENA(fdone)		((fdone) << 20)
4238c2ecf20Sopenharmony_ci#define     HWC_FRAMEDONE_ENA_MASK		0x00100000
4248c2ecf20Sopenharmony_ci#define     SLV_IRQ_ENA(irq)			((irq) << 19)
4258c2ecf20Sopenharmony_ci#define     SLV_IRQ_ENA_MASK			0x00080000
4268c2ecf20Sopenharmony_ci#define     SPI_IRQ_ENA(irq)			((irq) << 18)
4278c2ecf20Sopenharmony_ci#define     SPI_IRQ_ENA_MASK			0x00040000
4288c2ecf20Sopenharmony_ci#define     PWRDN_IRQ_ENA(irq)			((irq) << 17)
4298c2ecf20Sopenharmony_ci#define     PWRDN_IRQ_ENA_MASK			0x00020000
4308c2ecf20Sopenharmony_ci#define     ERR_IRQ_ENA(irq)			((irq) << 16)
4318c2ecf20Sopenharmony_ci#define     ERR_IRQ_ENA_MASK			0x00010000
4328c2ecf20Sopenharmony_ci#define     CLEAN_SPU_IRQ_ISR(irq)		(irq)
4338c2ecf20Sopenharmony_ci#define     CLEAN_SPU_IRQ_ISR_MASK		0x0000FFFF
4348c2ecf20Sopenharmony_ci
4358c2ecf20Sopenharmony_ci/* LCD Interrupt Status Register */
4368c2ecf20Sopenharmony_ci#define SPU_IRQ_ISR				0x01C4
4378c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ0(irq)			((irq) << 31)
4388c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ0_MASK			0x80000000
4398c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ1(irq)			((irq) << 30)
4408c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ1_MASK			0x40000000
4418c2ecf20Sopenharmony_ci#define     DMA_FF_UNDERFLOW(ff)		((ff) << 29)
4428c2ecf20Sopenharmony_ci#define     DMA_FF_UNDERFLOW_MASK		0x20000000
4438c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ0(irq)			((irq) << 27)
4448c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ0_MASK			0x08000000
4458c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ1(irq)			((irq) << 26)
4468c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ1_MASK			0x04000000
4478c2ecf20Sopenharmony_ci#define     GRA_FF_UNDERFLOW(ff)		((ff) << 25)
4488c2ecf20Sopenharmony_ci#define     GRA_FF_UNDERFLOW_MASK		0x02000000
4498c2ecf20Sopenharmony_ci#define     VSYNC_IRQ(vsync_irq)		((vsync_irq) << 23)
4508c2ecf20Sopenharmony_ci#define     VSYNC_IRQ_MASK			0x00800000
4518c2ecf20Sopenharmony_ci#define     DUMB_FRAMEDONE(fdone)		((fdone) << 22)
4528c2ecf20Sopenharmony_ci#define     DUMB_FRAMEDONE_MASK			0x00400000
4538c2ecf20Sopenharmony_ci#define     TWC_FRAMEDONE(fdone)		((fdone) << 21)
4548c2ecf20Sopenharmony_ci#define     TWC_FRAMEDONE_MASK			0x00200000
4558c2ecf20Sopenharmony_ci#define     HWC_FRAMEDONE(fdone)		((fdone) << 20)
4568c2ecf20Sopenharmony_ci#define     HWC_FRAMEDONE_MASK			0x00100000
4578c2ecf20Sopenharmony_ci#define     SLV_IRQ(irq)			((irq) << 19)
4588c2ecf20Sopenharmony_ci#define     SLV_IRQ_MASK			0x00080000
4598c2ecf20Sopenharmony_ci#define     SPI_IRQ(irq)			((irq) << 18)
4608c2ecf20Sopenharmony_ci#define     SPI_IRQ_MASK			0x00040000
4618c2ecf20Sopenharmony_ci#define     PWRDN_IRQ(irq)			((irq) << 17)
4628c2ecf20Sopenharmony_ci#define     PWRDN_IRQ_MASK			0x00020000
4638c2ecf20Sopenharmony_ci#define     ERR_IRQ(irq)			((irq) << 16)
4648c2ecf20Sopenharmony_ci#define     ERR_IRQ_MASK			0x00010000
4658c2ecf20Sopenharmony_ci/* read-only */
4668c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ0_LEVEL_MASK		0x00008000
4678c2ecf20Sopenharmony_ci#define     DMA_FRAME_IRQ1_LEVEL_MASK		0x00004000
4688c2ecf20Sopenharmony_ci#define     DMA_FRAME_CNT_ISR_MASK		0x00003000
4698c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ0_LEVEL_MASK		0x00000800
4708c2ecf20Sopenharmony_ci#define     GRA_FRAME_IRQ1_LEVEL_MASK		0x00000400
4718c2ecf20Sopenharmony_ci#define     GRA_FRAME_CNT_ISR_MASK		0x00000300
4728c2ecf20Sopenharmony_ci#define     VSYNC_IRQ_LEVEL_MASK		0x00000080
4738c2ecf20Sopenharmony_ci#define     DUMB_FRAMEDONE_LEVEL_MASK		0x00000040
4748c2ecf20Sopenharmony_ci#define     TWC_FRAMEDONE_LEVEL_MASK		0x00000020
4758c2ecf20Sopenharmony_ci#define     HWC_FRAMEDONE_LEVEL_MASK		0x00000010
4768c2ecf20Sopenharmony_ci#define     SLV_FF_EMPTY_MASK			0x00000008
4778c2ecf20Sopenharmony_ci#define     DMA_FF_ALLEMPTY_MASK		0x00000004
4788c2ecf20Sopenharmony_ci#define     GRA_FF_ALLEMPTY_MASK		0x00000002
4798c2ecf20Sopenharmony_ci#define     PWRDN_IRQ_LEVEL_MASK		0x00000001
4808c2ecf20Sopenharmony_ci
4818c2ecf20Sopenharmony_ci
4828c2ecf20Sopenharmony_ci/*
4838c2ecf20Sopenharmony_ci * defined Video Memory Color format for DMA control 0 register
4848c2ecf20Sopenharmony_ci * DMA0 bit[23:20]
4858c2ecf20Sopenharmony_ci */
4868c2ecf20Sopenharmony_ci#define VMODE_RGB565		0x0
4878c2ecf20Sopenharmony_ci#define VMODE_RGB1555		0x1
4888c2ecf20Sopenharmony_ci#define VMODE_RGB888PACKED	0x2
4898c2ecf20Sopenharmony_ci#define VMODE_RGB888UNPACKED	0x3
4908c2ecf20Sopenharmony_ci#define VMODE_RGBA888		0x4
4918c2ecf20Sopenharmony_ci#define VMODE_YUV422PACKED	0x5
4928c2ecf20Sopenharmony_ci#define VMODE_YUV422PLANAR	0x6
4938c2ecf20Sopenharmony_ci#define VMODE_YUV420PLANAR	0x7
4948c2ecf20Sopenharmony_ci#define VMODE_SMPNCMD		0x8
4958c2ecf20Sopenharmony_ci#define VMODE_PALETTE4BIT	0x9
4968c2ecf20Sopenharmony_ci#define VMODE_PALETTE8BIT	0xa
4978c2ecf20Sopenharmony_ci#define VMODE_RESERVED		0xb
4988c2ecf20Sopenharmony_ci
4998c2ecf20Sopenharmony_ci/*
5008c2ecf20Sopenharmony_ci * defined Graphic Memory Color format for DMA control 0 register
5018c2ecf20Sopenharmony_ci * DMA0 bit[19:16]
5028c2ecf20Sopenharmony_ci */
5038c2ecf20Sopenharmony_ci#define GMODE_RGB565		0x0
5048c2ecf20Sopenharmony_ci#define GMODE_RGB1555		0x1
5058c2ecf20Sopenharmony_ci#define GMODE_RGB888PACKED	0x2
5068c2ecf20Sopenharmony_ci#define GMODE_RGB888UNPACKED	0x3
5078c2ecf20Sopenharmony_ci#define GMODE_RGBA888		0x4
5088c2ecf20Sopenharmony_ci#define GMODE_YUV422PACKED	0x5
5098c2ecf20Sopenharmony_ci#define GMODE_YUV422PLANAR	0x6
5108c2ecf20Sopenharmony_ci#define GMODE_YUV420PLANAR	0x7
5118c2ecf20Sopenharmony_ci#define GMODE_SMPNCMD		0x8
5128c2ecf20Sopenharmony_ci#define GMODE_PALETTE4BIT	0x9
5138c2ecf20Sopenharmony_ci#define GMODE_PALETTE8BIT	0xa
5148c2ecf20Sopenharmony_ci#define GMODE_RESERVED		0xb
5158c2ecf20Sopenharmony_ci
5168c2ecf20Sopenharmony_ci/*
5178c2ecf20Sopenharmony_ci * define for DMA control 1 register
5188c2ecf20Sopenharmony_ci */
5198c2ecf20Sopenharmony_ci#define DMA1_FRAME_TRIG		31 /* bit location */
5208c2ecf20Sopenharmony_ci#define DMA1_VSYNC_MODE		28
5218c2ecf20Sopenharmony_ci#define DMA1_VSYNC_INV		27
5228c2ecf20Sopenharmony_ci#define DMA1_CKEY		24
5238c2ecf20Sopenharmony_ci#define DMA1_CARRY		23
5248c2ecf20Sopenharmony_ci#define DMA1_LNBUF_ENA		22
5258c2ecf20Sopenharmony_ci#define DMA1_GATED_ENA		21
5268c2ecf20Sopenharmony_ci#define DMA1_PWRDN_ENA		20
5278c2ecf20Sopenharmony_ci#define DMA1_DSCALE		18
5288c2ecf20Sopenharmony_ci#define DMA1_ALPHA_MODE		16
5298c2ecf20Sopenharmony_ci#define DMA1_ALPHA		08
5308c2ecf20Sopenharmony_ci#define DMA1_PXLCMD		00
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_ci/*
5338c2ecf20Sopenharmony_ci * defined for Configure Dumb Mode
5348c2ecf20Sopenharmony_ci * DUMB LCD Panel bit[31:28]
5358c2ecf20Sopenharmony_ci */
5368c2ecf20Sopenharmony_ci#define DUMB16_RGB565_0		0x0
5378c2ecf20Sopenharmony_ci#define DUMB16_RGB565_1		0x1
5388c2ecf20Sopenharmony_ci#define DUMB18_RGB666_0		0x2
5398c2ecf20Sopenharmony_ci#define DUMB18_RGB666_1		0x3
5408c2ecf20Sopenharmony_ci#define DUMB12_RGB444_0		0x4
5418c2ecf20Sopenharmony_ci#define DUMB12_RGB444_1		0x5
5428c2ecf20Sopenharmony_ci#define DUMB24_RGB888_0		0x6
5438c2ecf20Sopenharmony_ci#define DUMB_BLANK		0x7
5448c2ecf20Sopenharmony_ci
5458c2ecf20Sopenharmony_ci/*
5468c2ecf20Sopenharmony_ci * defined for Configure I/O Pin Allocation Mode
5478c2ecf20Sopenharmony_ci * LCD LCD I/O Pads control register bit[3:0]
5488c2ecf20Sopenharmony_ci */
5498c2ecf20Sopenharmony_ci#define IOPAD_DUMB24		0x0
5508c2ecf20Sopenharmony_ci#define IOPAD_DUMB18SPI		0x1
5518c2ecf20Sopenharmony_ci#define IOPAD_DUMB18GPIO	0x2
5528c2ecf20Sopenharmony_ci#define IOPAD_DUMB16SPI		0x3
5538c2ecf20Sopenharmony_ci#define IOPAD_DUMB16GPIO	0x4
5548c2ecf20Sopenharmony_ci#define IOPAD_DUMB12		0x5
5558c2ecf20Sopenharmony_ci#define IOPAD_SMART18SPI	0x6
5568c2ecf20Sopenharmony_ci#define IOPAD_SMART16SPI	0x7
5578c2ecf20Sopenharmony_ci#define IOPAD_SMART8BOTH	0x8
5588c2ecf20Sopenharmony_ci
5598c2ecf20Sopenharmony_ci#endif /* __PXA168FB_H__ */
560