linux/drivers/gpu/drm/renesas/rcar-du/rcar_du_regs.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * R-Car Display Unit Registers Definitions
 *
 * Copyright (C) 2013-2015 Renesas Electronics Corporation
 *
 * Contact: Laurent Pinchart ([email protected])
 */

#ifndef __RCAR_DU_REGS_H__
#define __RCAR_DU_REGS_H__

#define DU0_REG_OFFSET
#define DU1_REG_OFFSET
#define DU2_REG_OFFSET
#define DU3_REG_OFFSET

/* -----------------------------------------------------------------------------
 * Display Control Registers
 */

#define DSYSR
#define DSYSR_ILTS
#define DSYSR_DSEC
#define DSYSR_IUPD
#define DSYSR_DRES
#define DSYSR_DEN
#define DSYSR_TVM_MASTER
#define DSYSR_TVM_SWITCH
#define DSYSR_TVM_TVSYNC
#define DSYSR_TVM_MASK
#define DSYSR_SCM_INT_NONE
#define DSYSR_SCM_INT_SYNC
#define DSYSR_SCM_INT_VIDEO
#define DSYSR_SCM_MASK

#define DSMR
#define DSMR_VSPM
#define DSMR_ODPM
#define DSMR_DIPM_DISP
#define DSMR_DIPM_CSYNC
#define DSMR_DIPM_DE
#define DSMR_DIPM_MASK
#define DSMR_CSPM
#define DSMR_DIL
#define DSMR_VSL
#define DSMR_HSL
#define DSMR_DDIS
#define DSMR_CDEL
#define DSMR_CDEM_CDE
#define DSMR_CDEM_LOW
#define DSMR_CDEM_HIGH
#define DSMR_CDEM_MASK
#define DSMR_CDED
#define DSMR_ODEV
#define DSMR_CSY_VH_OR
#define DSMR_CSY_333
#define DSMR_CSY_222
#define DSMR_CSY_MASK

#define DSSR
#define DSSR_VC1FB_DSA0
#define DSSR_VC1FB_DSA1
#define DSSR_VC1FB_DSA2
#define DSSR_VC1FB_INIT
#define DSSR_VC1FB_MASK
#define DSSR_VC0FB_DSA0
#define DSSR_VC0FB_DSA1
#define DSSR_VC0FB_DSA2
#define DSSR_VC0FB_INIT
#define DSSR_VC0FB_MASK
#define DSSR_DFB(n)
#define DSSR_TVR
#define DSSR_FRM
#define DSSR_VBK
#define DSSR_RINT
#define DSSR_HBK
#define DSSR_ADC(n)

#define DSRCR
#define DSRCR_TVCL
#define DSRCR_FRCL
#define DSRCR_VBCL
#define DSRCR_RICL
#define DSRCR_HBCL
#define DSRCR_ADCL(n)
#define DSRCR_MASK

#define DIER
#define DIER_TVE
#define DIER_FRE
#define DIER_VBE
#define DIER_RIE
#define DIER_HBE
#define DIER_ADCE(n)

#define CPCR
#define CPCR_CP4CE
#define CPCR_CP3CE
#define CPCR_CP2CE
#define CPCR_CP1CE

#define DPPR
#define DPPR_DPE(n)
#define DPPR_DPS(n, p)
#define DPPR_DPS_SHIFT(n)
#define DPPR_BPP16
#define DPPR_BPP32_P1
#define DPPR_BPP32_P2
#define DPPR_BPP32

#define DEFR
#define DEFR_CODE
#define DEFR_EXSL
#define DEFR_EXVL
#define DEFR_EXUP
#define DEFR_VCUP
#define DEFR_DEFE

#define DAPCR
#define DAPCR_CODE
#define DAPCR_AP2E
#define DAPCR_AP1E

#define DCPCR
#define DCPCR_CODE
#define DCPCR_CA2B
#define DCPCR_CD2F
#define DCPCR_DC2E
#define DCPCR_CAB
#define DCPCR_CDF
#define DCPCR_DCE

#define DEFR2
#define DEFR2_CODE
#define DEFR2_DEFE2G

#define DEFR3
#define DEFR3_CODE
#define DEFR3_EVDA
#define DEFR3_EVDM_1
#define DEFR3_EVDM_2
#define DEFR3_EVDM_3
#define DEFR3_VMSM2_EMA
#define DEFR3_VMSM1_ENA
#define DEFR3_DEFE3

#define DEFR4
#define DEFR4_CODE
#define DEFR4_LRUO
#define DEFR4_SPCE

#define DVCSR
#define DVCSR_VCnFB2_DSA0(n)
#define DVCSR_VCnFB2_DSA1(n)
#define DVCSR_VCnFB2_DSA2(n)
#define DVCSR_VCnFB2_INIT(n)
#define DVCSR_VCnFB2_MASK(n)
#define DVCSR_VCnFB_DSA0(n)
#define DVCSR_VCnFB_DSA1(n)
#define DVCSR_VCnFB_DSA2(n)
#define DVCSR_VCnFB_INIT(n)
#define DVCSR_VCnFB_MASK(n)

#define DEFR5
#define DEFR5_CODE
#define DEFR5_YCRGB2_DIS
#define DEFR5_YCRGB2_PRI1
#define DEFR5_YCRGB2_PRI2
#define DEFR5_YCRGB2_PRI3
#define DEFR5_YCRGB2_MASK
#define DEFR5_YCRGB1_DIS
#define DEFR5_YCRGB1_PRI1
#define DEFR5_YCRGB1_PRI2
#define DEFR5_YCRGB1_PRI3
#define DEFR5_YCRGB1_MASK
#define DEFR5_DEFE5

#define DDLTR
#define DDLTR_CODE
#define DDLTR_DLAR2
#define DDLTR_DLAY2
#define DDLTR_DLAY1

#define DEFR6
#define DEFR6_CODE
#define DEFR6_ODPM12_DSMR
#define DEFR6_ODPM12_DISP
#define DEFR6_ODPM12_CDE
#define DEFR6_ODPM12_MASK
#define DEFR6_ODPM02_DSMR
#define DEFR6_ODPM02_DISP
#define DEFR6_ODPM02_CDE
#define DEFR6_ODPM02_MASK
#define DEFR6_TCNE1
#define DEFR6_TCNE0
#define DEFR6_MLOS1
#define DEFR6_DEFAULT

#define DEFR7
#define DEFR7_CODE
#define DEFR7_CMME1
#define DEFR7_CMME0

/* -----------------------------------------------------------------------------
 * R8A7790-only Control Registers
 */

#define DD1SSR
#define DD1SSR_TVR
#define DD1SSR_FRM
#define DD1SSR_BUF
#define DD1SSR_VBK
#define DD1SSR_RINT
#define DD1SSR_HBK
#define DD1SSR_ADC(n)

#define DD1SRCR
#define DD1SRCR_TVR
#define DD1SRCR_FRM
#define DD1SRCR_BUF
#define DD1SRCR_VBK
#define DD1SRCR_RINT
#define DD1SRCR_HBK
#define DD1SRCR_ADC(n)

#define DD1IER
#define DD1IER_TVR
#define DD1IER_FRM
#define DD1IER_BUF
#define DD1IER_VBK
#define DD1IER_RINT
#define DD1IER_HBK
#define DD1IER_ADC(n)

#define DEFR8
#define DEFR8_CODE
#define DEFR8_VSCS
#define DEFR8_DRGBS_DU(n)
#define DEFR8_DRGBS_MASK
#define DEFR8_DEFE8

#define DOFLR
#define DOFLR_CODE
#define DOFLR_HSYCFL1
#define DOFLR_VSYCFL1
#define DOFLR_ODDFL1
#define DOFLR_DISPFL1
#define DOFLR_CDEFL1
#define DOFLR_RGBFL1
#define DOFLR_HSYCFL0
#define DOFLR_VSYCFL0
#define DOFLR_ODDFL0
#define DOFLR_DISPFL0
#define DOFLR_CDEFL0
#define DOFLR_RGBFL0

#define DIDSR
#define DIDSR_CODE
#define DIDSR_LDCS_DCLKIN(n)
#define DIDSR_LDCS_DSI(n)
#define DIDSR_LDCS_LVDS0(n)
#define DIDSR_LDCS_LVDS1(n)
#define DIDSR_LDCS_MASK(n)
#define DIDSR_PDCS_CLK(n, clk)
#define DIDSR_PDCS_MASK(n)

#define DEFR10
#define DEFR10_CODE
#define DEFR10_VSPF1_RGB
#define DEFR10_VSPF1_YC
#define DEFR10_DOCF1_RGB
#define DEFR10_DOCF1_YC
#define DEFR10_YCDF0_YCBCR444
#define DEFR10_YCDF0_YCBCR422
#define DEFR10_VSPF0_RGB
#define DEFR10_VSPF0_YC
#define DEFR10_DOCF0_RGB
#define DEFR10_DOCF0_YC
#define DEFR10_TSEL_H3_TCON1
#define DEFR10_DEFE10

#define DPLLCR
#define DPLLCR_CODE
#define DPLLCR_PLCS1
#define DPLLCR_PLCS0
#define DPLLCR_CLKE
#define DPLLCR_FDPLL(n)
#define DPLLCR_N(n)
#define DPLLCR_M(n)
#define DPLLCR_STBY
#define DPLLCR_INCS_DOTCLKIN0
#define DPLLCR_INCS_DOTCLKIN1

#define DPLLC2R
#define DPLLC2R_CODE
#define DPLLC2R_SELC
#define DPLLC2R_M(n)
#define DPLLC2R_FDPLL(n)

/* -----------------------------------------------------------------------------
 * Display Timing Generation Registers
 */

#define HDSR
#define HDER
#define VDSR
#define VDER
#define HCR
#define HSWR
#define VCR
#define VSPR
#define EQWR
#define SPWR
#define CLAMPSR
#define CLAMPWR
#define DESR
#define DEWR

/* -----------------------------------------------------------------------------
 * Display Attribute Registers
 */

#define CP1TR
#define CP2TR
#define CP3TR
#define CP4TR

#define DOOR
#define DOOR_RGB(r, g, b)
#define CDER
#define CDER_RGB(r, g, b)
#define BPOR
#define BPOR_RGB(r, g, b)

#define RINTOFSR

#define DSHPR
#define DSHPR_CODE
#define DSHPR_PRIH
#define DSHPR_PRIL_BPP16
#define DSHPR_PRIL_BPP32

/* -----------------------------------------------------------------------------
 * Display Plane Registers
 */

#define PLANE_OFF

#define PnMR
#define PnMR_VISL_VIN0
#define PnMR_VISL_VIN1
#define PnMR_VISL_VIN2
#define PnMR_VISL_VIN3
#define PnMR_YCDF_YUYV
#define PnMR_TC_R
#define PnMR_TC_CP
#define PnMR_WAE
#define PnMR_SPIM_TP
#define PnMR_SPIM_ALP
#define PnMR_SPIM_EOR
#define PnMR_SPIM_TP_OFF
#define PnMR_CPSL_CP1
#define PnMR_CPSL_CP2
#define PnMR_CPSL_CP3
#define PnMR_CPSL_CP4
#define PnMR_DC
#define PnMR_BM_MD
#define PnMR_BM_AR
#define PnMR_BM_AD
#define PnMR_BM_VC
#define PnMR_DDDF_8BPP
#define PnMR_DDDF_16BPP
#define PnMR_DDDF_ARGB
#define PnMR_DDDF_YC
#define PnMR_DDDF_MASK

#define PnMWR

#define PnALPHAR
#define PnALPHAR_ABIT_1
#define PnALPHAR_ABIT_0
#define PnALPHAR_ABIT_X

#define PnDSXR
#define PnDSYR
#define PnDPXR
#define PnDPYR

#define PnDSA0R
#define PnDSA1R
#define PnDSA2R
#define PnDSA_MASK

#define PnSPXR
#define PnSPYR
#define PnWASPR
#define PnWAMWR

#define PnBTR

#define PnTC1R
#define PnTC2R
#define PnTC3R
#define PnTC3R_CODE

#define PnMLR

#define PnSWAPR
#define PnSWAPR_DIGN
#define PnSWAPR_SPQW
#define PnSWAPR_SPLW
#define PnSWAPR_SPWD
#define PnSWAPR_SPBY

#define PnDDCR
#define PnDDCR_CODE
#define PnDDCR_LRGB1
#define PnDDCR_LRGB0

#define PnDDCR2
#define PnDDCR2_CODE
#define PnDDCR2_NV21
#define PnDDCR2_Y420
#define PnDDCR2_DIVU
#define PnDDCR2_DIVY

#define PnDDCR4
#define PnDDCR4_CODE
#define PnDDCR4_VSPS
#define PnDDCR4_SDFS_RGB
#define PnDDCR4_SDFS_YC
#define PnDDCR4_SDFS_MASK
#define PnDDCR4_EDF_NONE
#define PnDDCR4_EDF_ARGB8888
#define PnDDCR4_EDF_RGB888
#define PnDDCR4_EDF_RGB666
#define PnDDCR4_EDF_MASK

#define APnMR
#define APnMR_WAE
#define APnMR_DC
#define APnMR_BM_MD
#define APnMR_BM_AD

#define APnMWR

#define APnDSXR
#define APnDSYR
#define APnDPXR
#define APnDPYR

#define APnDSA0R
#define APnDSA1R
#define APnDSA2R

#define APnSPXR
#define APnSPYR
#define APnWASPR
#define APnWAMWR

#define APnBTR

#define APnMLR
#define APnSWAPR

/* -----------------------------------------------------------------------------
 * Display Capture Registers
 */

#define DCMR
#define DCMWR
#define DCSAR
#define DCMLR

/* -----------------------------------------------------------------------------
 * Color Palette Registers
 */

#define CP1_000R
#define CP1_255R
#define CP2_000R
#define CP2_255R
#define CP3_000R
#define CP3_255R
#define CP4_000R
#define CP4_255R

/* -----------------------------------------------------------------------------
 * External Synchronization Control Registers
 */

#define ESCR02
#define ESCR13
#define ESCR_DCLKOINV
#define ESCR_DCLKSEL_DCLKIN
#define ESCR_DCLKSEL_CLKS
#define ESCR_DCLKSEL_MASK
#define ESCR_DCLKDIS
#define ESCR_SYNCSEL_OFF
#define ESCR_SYNCSEL_EXVSYNC
#define ESCR_SYNCSEL_EXHSYNC
#define ESCR_FRQSEL_MASK

#define OTAR02
#define OTAR13

/* -----------------------------------------------------------------------------
 * Dual Display Output Control Registers
 */

#define DORCR
#define DORCR_PG1T
#define DORCR_DK1S
#define DORCR_PG1D_DS0
#define DORCR_PG1D_DS1
#define DORCR_PG1D_FIX0
#define DORCR_PG1D_DOOR
#define DORCR_PG1D_MASK
#define DORCR_DR0D
#define DORCR_PG0D_DS0
#define DORCR_PG0D_DS1
#define DORCR_PG0D_FIX0
#define DORCR_PG0D_DOOR
#define DORCR_PG0D_MASK
#define DORCR_RGPV
#define DORCR_DPRS

#define DPTSR
#define DPTSR_PnDK(n)
#define DPTSR_PnTS(n)

#define DAPTSR
#define DAPTSR_APnDK(n)
#define DAPTSR_APnTS(n)

#define DS1PR
#define DS2PR

/* -----------------------------------------------------------------------------
 * YC-RGB Conversion Coefficient Registers
 */

#define YNCR
#define YNOR
#define CRNOR
#define CBNOR
#define RCRCR
#define GCRCR
#define GCBCR
#define BCBCR

#endif /* __RCAR_DU_REGS_H__ */