linux/include/video/samsung_fimd.h

/* SPDX-License-Identifier: GPL-2.0-only */
/* include/video/samsung_fimd.h
 *
 * Copyright 2008 Openmoko, Inc.
 * Copyright 2008 Simtec Electronics
 *      http://armlinux.simtec.co.uk/
 *      Ben Dooks <[email protected]>
 *
 * S3C Platform - new-style fimd and framebuffer register definitions
 *
 * This is the register set for the fimd and new style framebuffer interface
 * found from the S3C2443 onwards into the S3C2416, S3C2450, the
 * S3C64XX series such as the S3C6400 and S3C6410, and Exynos series.
*/

/* VIDCON0 */

#define VIDCON0
#define VIDCON0_DSI_EN
#define VIDCON0_INTERLACE
#define VIDCON0_VIDOUT_MASK
#define VIDCON0_VIDOUT_SHIFT
#define VIDCON0_VIDOUT_RGB
#define VIDCON0_VIDOUT_TV
#define VIDCON0_VIDOUT_I80_LDI0
#define VIDCON0_VIDOUT_I80_LDI1
#define VIDCON0_VIDOUT_WB_RGB
#define VIDCON0_VIDOUT_WB_I80_LDI0
#define VIDCON0_VIDOUT_WB_I80_LDI1

#define VIDCON0_L1_DATA_MASK
#define VIDCON0_L1_DATA_SHIFT
#define VIDCON0_L1_DATA_16BPP
#define VIDCON0_L1_DATA_18BPP16
#define VIDCON0_L1_DATA_18BPP9
#define VIDCON0_L1_DATA_24BPP
#define VIDCON0_L1_DATA_18BPP
#define VIDCON0_L1_DATA_16BPP8

#define VIDCON0_L0_DATA_MASK
#define VIDCON0_L0_DATA_SHIFT
#define VIDCON0_L0_DATA_16BPP
#define VIDCON0_L0_DATA_18BPP16
#define VIDCON0_L0_DATA_18BPP9
#define VIDCON0_L0_DATA_24BPP
#define VIDCON0_L0_DATA_18BPP
#define VIDCON0_L0_DATA_16BPP8

#define VIDCON0_PNRMODE_MASK
#define VIDCON0_PNRMODE_SHIFT
#define VIDCON0_PNRMODE_RGB
#define VIDCON0_PNRMODE_BGR
#define VIDCON0_PNRMODE_SERIAL_RGB
#define VIDCON0_PNRMODE_SERIAL_BGR

#define VIDCON0_CLKVALUP
#define VIDCON0_CLKVAL_F_MASK
#define VIDCON0_CLKVAL_F_SHIFT
#define VIDCON0_CLKVAL_F_LIMIT
#define VIDCON0_CLKVAL_F(_x)
#define VIDCON0_VLCKFREE
#define VIDCON0_CLKDIR

#define VIDCON0_CLKSEL_MASK
#define VIDCON0_CLKSEL_SHIFT
#define VIDCON0_CLKSEL_HCLK
#define VIDCON0_CLKSEL_LCD
#define VIDCON0_CLKSEL_27M

#define VIDCON0_ENVID
#define VIDCON0_ENVID_F

#define VIDCON1
#define VIDCON1_LINECNT_MASK
#define VIDCON1_LINECNT_SHIFT
#define VIDCON1_LINECNT_GET(_v)
#define VIDCON1_FSTATUS_EVEN
#define VIDCON1_VSTATUS_MASK
#define VIDCON1_VSTATUS_SHIFT
#define VIDCON1_VSTATUS_VSYNC
#define VIDCON1_VSTATUS_BACKPORCH
#define VIDCON1_VSTATUS_ACTIVE
#define VIDCON1_VSTATUS_FRONTPORCH
#define VIDCON1_VCLK_MASK
#define VIDCON1_VCLK_HOLD
#define VIDCON1_VCLK_RUN

#define VIDCON1_INV_VCLK
#define VIDCON1_INV_HSYNC
#define VIDCON1_INV_VSYNC
#define VIDCON1_INV_VDEN

/* VIDCON2 */

#define VIDCON2
#define VIDCON2_EN601
#define VIDCON2_TVFMTSEL_SW

#define VIDCON2_TVFMTSEL1_MASK
#define VIDCON2_TVFMTSEL1_SHIFT
#define VIDCON2_TVFMTSEL1_RGB
#define VIDCON2_TVFMTSEL1_YUV422
#define VIDCON2_TVFMTSEL1_YUV444

#define VIDCON2_ORGYCbCr
#define VIDCON2_YUVORDCrCb

/* PRTCON (S3C6410)
 * Might not be present in the S3C6410 documentation,
 * but tests prove it's there almost for sure; shouldn't hurt in any case.
 */
#define PRTCON
#define PRTCON_PROTECT

/* VIDTCON0 */

#define VIDTCON0
#define VIDTCON0_VBPDE_MASK
#define VIDTCON0_VBPDE_SHIFT
#define VIDTCON0_VBPDE_LIMIT
#define VIDTCON0_VBPDE(_x)

#define VIDTCON0_VBPD_MASK
#define VIDTCON0_VBPD_SHIFT
#define VIDTCON0_VBPD_LIMIT
#define VIDTCON0_VBPD(_x)

#define VIDTCON0_VFPD_MASK
#define VIDTCON0_VFPD_SHIFT
#define VIDTCON0_VFPD_LIMIT
#define VIDTCON0_VFPD(_x)

#define VIDTCON0_VSPW_MASK
#define VIDTCON0_VSPW_SHIFT
#define VIDTCON0_VSPW_LIMIT
#define VIDTCON0_VSPW(_x)

/* VIDTCON1 */

#define VIDTCON1
#define VIDTCON1_VFPDE_MASK
#define VIDTCON1_VFPDE_SHIFT
#define VIDTCON1_VFPDE_LIMIT
#define VIDTCON1_VFPDE(_x)

#define VIDTCON1_HBPD_MASK
#define VIDTCON1_HBPD_SHIFT
#define VIDTCON1_HBPD_LIMIT
#define VIDTCON1_HBPD(_x)

#define VIDTCON1_HFPD_MASK
#define VIDTCON1_HFPD_SHIFT
#define VIDTCON1_HFPD_LIMIT
#define VIDTCON1_HFPD(_x)

#define VIDTCON1_HSPW_MASK
#define VIDTCON1_HSPW_SHIFT
#define VIDTCON1_HSPW_LIMIT
#define VIDTCON1_HSPW(_x)

#define VIDTCON2
#define VIDTCON2_LINEVAL_E(_x)
#define VIDTCON2_LINEVAL_MASK
#define VIDTCON2_LINEVAL_SHIFT
#define VIDTCON2_LINEVAL_LIMIT
#define VIDTCON2_LINEVAL(_x)

#define VIDTCON2_HOZVAL_E(_x)
#define VIDTCON2_HOZVAL_MASK
#define VIDTCON2_HOZVAL_SHIFT
#define VIDTCON2_HOZVAL_LIMIT
#define VIDTCON2_HOZVAL(_x)

/* WINCONx */

#define WINCON(_win)
#define WINCONx_CSCCON_EQ601
#define WINCONx_CSCCON_EQ709
#define WINCONx_CSCWIDTH_MASK
#define WINCONx_CSCWIDTH_SHIFT
#define WINCONx_CSCWIDTH_WIDE
#define WINCONx_CSCWIDTH_NARROW
#define WINCONx_ENLOCAL
#define WINCONx_BUFSTATUS
#define WINCONx_BUFSEL
#define WINCONx_BUFAUTOEN
#define WINCONx_BITSWP
#define WINCONx_BYTSWP
#define WINCONx_HAWSWP
#define WINCONx_WSWP
#define WINCONx_YCbCr
#define WINCONx_BURSTLEN_MASK
#define WINCONx_BURSTLEN_SHIFT
#define WINCONx_BURSTLEN_16WORD
#define WINCONx_BURSTLEN_8WORD
#define WINCONx_BURSTLEN_4WORD
#define WINCONx_ENWIN
#define WINCONx_BLEND_MODE_MASK

#define WINCON0_BPPMODE_MASK
#define WINCON0_BPPMODE_SHIFT
#define WINCON0_BPPMODE_1BPP
#define WINCON0_BPPMODE_2BPP
#define WINCON0_BPPMODE_4BPP
#define WINCON0_BPPMODE_8BPP_PALETTE
#define WINCON0_BPPMODE_16BPP_565
#define WINCON0_BPPMODE_16BPP_1555
#define WINCON0_BPPMODE_18BPP_666
#define WINCON0_BPPMODE_24BPP_888

#define WINCON1_LOCALSEL_CAMIF
#define WINCON1_ALPHA_MUL
#define WINCON1_BLD_PIX
#define WINCON1_BPPMODE_MASK
#define WINCON1_BPPMODE_SHIFT
#define WINCON1_BPPMODE_1BPP
#define WINCON1_BPPMODE_2BPP
#define WINCON1_BPPMODE_4BPP
#define WINCON1_BPPMODE_8BPP_PALETTE
#define WINCON1_BPPMODE_8BPP_1232
#define WINCON1_BPPMODE_16BPP_565
#define WINCON1_BPPMODE_16BPP_A1555
#define WINCON1_BPPMODE_16BPP_I1555
#define WINCON1_BPPMODE_18BPP_666
#define WINCON1_BPPMODE_18BPP_A1665
#define WINCON1_BPPMODE_19BPP_A1666
#define WINCON1_BPPMODE_24BPP_888
#define WINCON1_BPPMODE_24BPP_A1887
#define WINCON1_BPPMODE_25BPP_A1888
#define WINCON1_BPPMODE_28BPP_A4888
#define WINCON1_ALPHA_SEL

/* S5PV210 */
#define SHADOWCON
#define SHADOWCON_WINx_PROTECT(_win)
/* DMA channels (all windows) */
#define SHADOWCON_CHx_ENABLE(_win)
/* Local input channels (windows 0-2) */
#define SHADOWCON_CHx_LOCAL_ENABLE(_win)

/* VIDOSDx */

#define VIDOSD_BASE
#define VIDOSDxA_TOPLEFT_X_E(_x)
#define VIDOSDxA_TOPLEFT_X_MASK
#define VIDOSDxA_TOPLEFT_X_SHIFT
#define VIDOSDxA_TOPLEFT_X_LIMIT
#define VIDOSDxA_TOPLEFT_X(_x)

#define VIDOSDxA_TOPLEFT_Y_E(_x)
#define VIDOSDxA_TOPLEFT_Y_MASK
#define VIDOSDxA_TOPLEFT_Y_SHIFT
#define VIDOSDxA_TOPLEFT_Y_LIMIT
#define VIDOSDxA_TOPLEFT_Y(_x)

#define VIDOSDxB_BOTRIGHT_X_E(_x)
#define VIDOSDxB_BOTRIGHT_X_MASK
#define VIDOSDxB_BOTRIGHT_X_SHIFT
#define VIDOSDxB_BOTRIGHT_X_LIMIT
#define VIDOSDxB_BOTRIGHT_X(_x)

#define VIDOSDxB_BOTRIGHT_Y_E(_x)
#define VIDOSDxB_BOTRIGHT_Y_MASK
#define VIDOSDxB_BOTRIGHT_Y_SHIFT
#define VIDOSDxB_BOTRIGHT_Y_LIMIT
#define VIDOSDxB_BOTRIGHT_Y(_x)

/* For VIDOSD[1..4]C */
#define VIDISD14C_ALPHA0_R(_x)
#define VIDISD14C_ALPHA0_G_MASK
#define VIDISD14C_ALPHA0_G_SHIFT
#define VIDISD14C_ALPHA0_G_LIMIT
#define VIDISD14C_ALPHA0_G(_x)
#define VIDISD14C_ALPHA0_B_MASK
#define VIDISD14C_ALPHA0_B_SHIFT
#define VIDISD14C_ALPHA0_B_LIMIT
#define VIDISD14C_ALPHA0_B(_x)
#define VIDISD14C_ALPHA1_R_MASK
#define VIDISD14C_ALPHA1_R_SHIFT
#define VIDISD14C_ALPHA1_R_LIMIT
#define VIDISD14C_ALPHA1_R(_x)
#define VIDISD14C_ALPHA1_G_MASK
#define VIDISD14C_ALPHA1_G_SHIFT
#define VIDISD14C_ALPHA1_G_LIMIT
#define VIDISD14C_ALPHA1_G(_x)
#define VIDISD14C_ALPHA1_B_MASK
#define VIDISD14C_ALPHA1_B_SHIFT
#define VIDISD14C_ALPHA1_B_LIMIT
#define VIDISD14C_ALPHA1_B(_x)

#define VIDW_ALPHA
#define VIDW_ALPHA_R(_x)
#define VIDW_ALPHA_G(_x)
#define VIDW_ALPHA_B(_x)

/* Video buffer addresses */
#define VIDW_BUF_START(_buff)
#define VIDW_BUF_START_S(_buff)
#define VIDW_BUF_START1(_buff)
#define VIDW_BUF_END(_buff)
#define VIDW_BUF_END1(_buff)
#define VIDW_BUF_SIZE(_buff)

#define VIDW_BUF_SIZE_OFFSET_E(_x)
#define VIDW_BUF_SIZE_OFFSET_MASK
#define VIDW_BUF_SIZE_OFFSET_SHIFT
#define VIDW_BUF_SIZE_OFFSET_LIMIT
#define VIDW_BUF_SIZE_OFFSET(_x)

#define VIDW_BUF_SIZE_PAGEWIDTH_E(_x)
#define VIDW_BUF_SIZE_PAGEWIDTH_MASK
#define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT
#define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT
#define VIDW_BUF_SIZE_PAGEWIDTH(_x)

/* Interrupt controls and status */

#define VIDINTCON0
#define VIDINTCON0_FIFOINTERVAL_MASK
#define VIDINTCON0_FIFOINTERVAL_SHIFT
#define VIDINTCON0_FIFOINTERVAL_LIMIT
#define VIDINTCON0_FIFOINTERVAL(_x)

#define VIDINTCON0_INT_SYSMAINCON
#define VIDINTCON0_INT_SYSSUBCON
#define VIDINTCON0_INT_I80IFDONE

#define VIDINTCON0_FRAMESEL0_MASK
#define VIDINTCON0_FRAMESEL0_SHIFT
#define VIDINTCON0_FRAMESEL0_BACKPORCH
#define VIDINTCON0_FRAMESEL0_VSYNC
#define VIDINTCON0_FRAMESEL0_ACTIVE
#define VIDINTCON0_FRAMESEL0_FRONTPORCH

#define VIDINTCON0_FRAMESEL1
#define VIDINTCON0_FRAMESEL1_MASK
#define VIDINTCON0_FRAMESEL1_NONE
#define VIDINTCON0_FRAMESEL1_BACKPORCH
#define VIDINTCON0_FRAMESEL1_VSYNC
#define VIDINTCON0_FRAMESEL1_FRONTPORCH

#define VIDINTCON0_INT_FRAME
#define VIDINTCON0_FIFIOSEL_MASK
#define VIDINTCON0_FIFIOSEL_SHIFT
#define VIDINTCON0_FIFIOSEL_WINDOW0
#define VIDINTCON0_FIFIOSEL_WINDOW1
#define VIDINTCON0_FIFIOSEL_WINDOW2
#define VIDINTCON0_FIFIOSEL_WINDOW3
#define VIDINTCON0_FIFIOSEL_WINDOW4

#define VIDINTCON0_FIFOLEVEL_MASK
#define VIDINTCON0_FIFOLEVEL_SHIFT
#define VIDINTCON0_FIFOLEVEL_TO25PC
#define VIDINTCON0_FIFOLEVEL_TO50PC
#define VIDINTCON0_FIFOLEVEL_TO75PC
#define VIDINTCON0_FIFOLEVEL_EMPTY
#define VIDINTCON0_FIFOLEVEL_FULL

#define VIDINTCON0_INT_FIFO_MASK
#define VIDINTCON0_INT_FIFO_SHIFT
#define VIDINTCON0_INT_ENABLE

#define VIDINTCON1
#define VIDINTCON1_INT_I80
#define VIDINTCON1_INT_FRAME
#define VIDINTCON1_INT_FIFO

/* Window colour-key control registers */
#define WKEYCON

#define WKEYCON0
#define WKEYCON1

#define WxKEYCON0_KEYBL_EN
#define WxKEYCON0_KEYEN_F
#define WxKEYCON0_DIRCON
#define WxKEYCON0_COMPKEY_MASK
#define WxKEYCON0_COMPKEY_SHIFT
#define WxKEYCON0_COMPKEY_LIMIT
#define WxKEYCON0_COMPKEY(_x)
#define WxKEYCON1_COLVAL_MASK
#define WxKEYCON1_COLVAL_SHIFT
#define WxKEYCON1_COLVAL_LIMIT
#define WxKEYCON1_COLVAL(_x)

/* Dithering control */
#define DITHMODE
#define DITHMODE_R_POS_MASK
#define DITHMODE_R_POS_SHIFT
#define DITHMODE_R_POS_8BIT
#define DITHMODE_R_POS_6BIT
#define DITHMODE_R_POS_5BIT
#define DITHMODE_G_POS_MASK
#define DITHMODE_G_POS_SHIFT
#define DITHMODE_G_POS_8BIT
#define DITHMODE_G_POS_6BIT
#define DITHMODE_G_POS_5BIT
#define DITHMODE_B_POS_MASK
#define DITHMODE_B_POS_SHIFT
#define DITHMODE_B_POS_8BIT
#define DITHMODE_B_POS_6BIT
#define DITHMODE_B_POS_5BIT
#define DITHMODE_DITH_EN

/* Window blanking (MAP) */
#define WINxMAP(_win)
#define WINxMAP_MAP
#define WINxMAP_MAP_COLOUR_MASK
#define WINxMAP_MAP_COLOUR_SHIFT
#define WINxMAP_MAP_COLOUR_LIMIT
#define WINxMAP_MAP_COLOUR(_x)

/* Winodw palette control */
#define WPALCON
#define WPALCON_PAL_UPDATE
#define WPALCON_W4PAL_16BPP_A555
#define WPALCON_W3PAL_16BPP_A555
#define WPALCON_W2PAL_16BPP_A555
#define WPALCON_W1PAL_MASK
#define WPALCON_W1PAL_SHIFT
#define WPALCON_W1PAL_25BPP_A888
#define WPALCON_W1PAL_24BPP
#define WPALCON_W1PAL_19BPP_A666
#define WPALCON_W1PAL_18BPP_A665
#define WPALCON_W1PAL_18BPP
#define WPALCON_W1PAL_16BPP_A555
#define WPALCON_W1PAL_16BPP_565
#define WPALCON_W0PAL_MASK
#define WPALCON_W0PAL_SHIFT
#define WPALCON_W0PAL_25BPP_A888
#define WPALCON_W0PAL_24BPP
#define WPALCON_W0PAL_19BPP_A666
#define WPALCON_W0PAL_18BPP_A665
#define WPALCON_W0PAL_18BPP
#define WPALCON_W0PAL_16BPP_A555
#define WPALCON_W0PAL_16BPP_565

/* Blending equation control */
#define BLENDEQx(_win)
#define BLENDEQ_ZERO
#define BLENDEQ_ONE
#define BLENDEQ_ALPHA_A
#define BLENDEQ_ONE_MINUS_ALPHA_A
#define BLENDEQ_ALPHA0
#define BLENDEQ_B_FUNC_F(_x)
#define BLENDEQ_A_FUNC_F(_x)
#define BLENDCON
#define BLENDCON_NEW_MASK
#define BLENDCON_NEW_8BIT_ALPHA_VALUE
#define BLENDCON_NEW_4BIT_ALPHA_VALUE

/* Display port clock control */
#define DP_MIE_CLKCON
#define DP_MIE_CLK_DISABLE
#define DP_MIE_CLK_DP_ENABLE
#define DP_MIE_CLK_MIE_ENABLE

/* Notes on per-window bpp settings
 *
 * Value	Win0	 Win1	  Win2	   Win3	    Win 4
 * 0000		1(P)	 1(P)	  1(P)	   1(P)	    1(P)
 * 0001		2(P)	 2(P)     2(P)	   2(P)	    2(P)
 * 0010		4(P)	 4(P)     4(P)	   4(P)     -none-
 * 0011		8(P)	 8(P)     -none-   -none-   -none-
 * 0100		-none-	 8(A232)  8(A232)  -none-   -none-
 * 0101		16(565)	 16(565)  16(565)  16(565)   16(565)
 * 0110		-none-	 16(A555) 16(A555) 16(A555)  16(A555)
 * 0111		16(I555) 16(I565) 16(I555) 16(I555)  16(I555)
 * 1000		18(666)	 18(666)  18(666)  18(666)   18(666)
 * 1001		-none-	 18(A665) 18(A665) 18(A665)  16(A665)
 * 1010		-none-	 19(A666) 19(A666) 19(A666)  19(A666)
 * 1011		24(888)	 24(888)  24(888)  24(888)   24(888)
 * 1100		-none-	 24(A887) 24(A887) 24(A887)  24(A887)
 * 1101		-none-	 25(A888) 25(A888) 25(A888)  25(A888)
 * 1110		-none-	 -none-	  -none-   -none-    -none-
 * 1111		-none-	 -none-   -none-   -none-    -none-
*/

#define WIN_RGB_ORDER(_win)
#define WIN_RGB_ORDER_FORWARD
#define WIN_RGB_ORDER_REVERSE

/* FIMD Version 8 register offset definitions */
#define FIMD_V8_VIDTCON0
#define FIMD_V8_VIDTCON1
#define FIMD_V8_VIDTCON2
#define FIMD_V8_VIDTCON3
#define FIMD_V8_VIDCON1