linux/drivers/gpu/drm/gma500/psb_reg.h

/* SPDX-License-Identifier: GPL-2.0-only */
/**************************************************************************
 *
 * Copyright (c) (2005-2007) Imagination Technologies Limited.
 * Copyright (c) 2007, Intel Corporation.
 * All Rights Reserved.
 *
 **************************************************************************/

#ifndef _PSB_REG_H_
#define _PSB_REG_H_

#define PSB_CR_CLKGATECTL
#define _PSB_C_CLKGATECTL_AUTO_MAN_REG
#define _PSB_C_CLKGATECTL_USE_CLKG_SHIFT
#define _PSB_C_CLKGATECTL_USE_CLKG_MASK
#define _PSB_C_CLKGATECTL_DPM_CLKG_SHIFT
#define _PSB_C_CLKGATECTL_DPM_CLKG_MASK
#define _PSB_C_CLKGATECTL_TA_CLKG_SHIFT
#define _PSB_C_CLKGATECTL_TA_CLKG_MASK
#define _PSB_C_CLKGATECTL_TSP_CLKG_SHIFT
#define _PSB_C_CLKGATECTL_TSP_CLKG_MASK
#define _PSB_C_CLKGATECTL_ISP_CLKG_SHIFT
#define _PSB_C_CLKGATECTL_ISP_CLKG_MASK
#define _PSB_C_CLKGATECTL_2D_CLKG_SHIFT
#define _PSB_C_CLKGATECTL_2D_CLKG_MASK
#define _PSB_C_CLKGATECTL_CLKG_ENABLED
#define _PSB_C_CLKGATECTL_CLKG_DISABLED
#define _PSB_C_CLKGATECTL_CLKG_AUTO

#define PSB_CR_CORE_ID
#define _PSB_CC_ID_ID_SHIFT
#define _PSB_CC_ID_ID_MASK
#define _PSB_CC_ID_CONFIG_SHIFT
#define _PSB_CC_ID_CONFIG_MASK

#define PSB_CR_CORE_REVISION
#define _PSB_CC_REVISION_DESIGNER_SHIFT
#define _PSB_CC_REVISION_DESIGNER_MASK
#define _PSB_CC_REVISION_MAJOR_SHIFT
#define _PSB_CC_REVISION_MAJOR_MASK
#define _PSB_CC_REVISION_MINOR_SHIFT
#define _PSB_CC_REVISION_MINOR_MASK
#define _PSB_CC_REVISION_MAINTENANCE_SHIFT
#define _PSB_CC_REVISION_MAINTENANCE_MASK

#define PSB_CR_DESIGNER_REV_FIELD1

#define PSB_CR_SOFT_RESET
#define _PSB_CS_RESET_TSP_RESET
#define _PSB_CS_RESET_ISP_RESET
#define _PSB_CS_RESET_USE_RESET
#define _PSB_CS_RESET_TA_RESET
#define _PSB_CS_RESET_DPM_RESET
#define _PSB_CS_RESET_TWOD_RESET
#define _PSB_CS_RESET_BIF_RESET

#define PSB_CR_DESIGNER_REV_FIELD2

#define PSB_CR_EVENT_HOST_ENABLE2

#define PSB_CR_EVENT_STATUS2

#define PSB_CR_EVENT_HOST_CLEAR2
#define _PSB_CE2_BIF_REQUESTER_FAULT

#define PSB_CR_EVENT_STATUS

#define PSB_CR_EVENT_HOST_ENABLE

#define PSB_CR_EVENT_HOST_CLEAR
#define _PSB_CE_MASTER_INTERRUPT
#define _PSB_CE_TA_DPM_FAULT
#define _PSB_CE_TWOD_COMPLETE
#define _PSB_CE_DPM_OUT_OF_MEMORY_ZLS
#define _PSB_CE_DPM_TA_MEM_FREE
#define _PSB_CE_PIXELBE_END_RENDER
#define _PSB_CE_SW_EVENT
#define _PSB_CE_TA_FINISHED
#define _PSB_CE_TA_TERMINATE
#define _PSB_CE_DPM_REACHED_MEM_THRESH
#define _PSB_CE_DPM_OUT_OF_MEMORY_GBL
#define _PSB_CE_DPM_OUT_OF_MEMORY_MT
#define _PSB_CE_DPM_3D_MEM_FREE


#define PSB_USE_OFFSET_MASK
#define PSB_USE_OFFSET_SIZE
#define PSB_CR_USE_CODE_BASE0
#define PSB_CR_USE_CODE_BASE1
#define PSB_CR_USE_CODE_BASE2
#define PSB_CR_USE_CODE_BASE3
#define PSB_CR_USE_CODE_BASE4
#define PSB_CR_USE_CODE_BASE5
#define PSB_CR_USE_CODE_BASE6
#define PSB_CR_USE_CODE_BASE7
#define PSB_CR_USE_CODE_BASE8
#define PSB_CR_USE_CODE_BASE9
#define PSB_CR_USE_CODE_BASE10
#define PSB_CR_USE_CODE_BASE11
#define PSB_CR_USE_CODE_BASE12
#define PSB_CR_USE_CODE_BASE13
#define PSB_CR_USE_CODE_BASE14
#define PSB_CR_USE_CODE_BASE15
#define PSB_CR_USE_CODE_BASE(_i)
#define _PSB_CUC_BASE_DM_SHIFT
#define _PSB_CUC_BASE_DM_MASK
#define _PSB_CUC_BASE_ADDR_SHIFT
#define _PSB_CUC_BASE_ADDR_ALIGNSHIFT
#define _PSB_CUC_BASE_ADDR_MASK
#define _PSB_CUC_DM_VERTEX
#define _PSB_CUC_DM_PIXEL
#define _PSB_CUC_DM_RESERVED
#define _PSB_CUC_DM_EDM

#define PSB_CR_PDS_EXEC_BASE
#define _PSB_CR_PDS_EXEC_BASE_ADDR_SHIFT
#define _PSB_CR_PDS_EXEC_BASE_ADDR_ALIGNSHIFT

#define PSB_CR_EVENT_KICKER
#define _PSB_CE_KICKER_ADDRESS_SHIFT

#define PSB_CR_EVENT_KICK
#define _PSB_CE_KICK_NOW

#define PSB_CR_BIF_DIR_LIST_BASE1

#define PSB_CR_BIF_CTRL
#define _PSB_CB_CTRL_CLEAR_FAULT
#define _PSB_CB_CTRL_INVALDC
#define _PSB_CB_CTRL_FLUSH

#define PSB_CR_BIF_INT_STAT

#define PSB_CR_BIF_FAULT
#define _PSB_CBI_STAT_PF_N_RW
#define _PSB_CBI_STAT_FAULT_SHIFT
#define _PSB_CBI_STAT_FAULT_MASK
#define _PSB_CBI_STAT_FAULT_CACHE
#define _PSB_CBI_STAT_FAULT_TA
#define _PSB_CBI_STAT_FAULT_VDM
#define _PSB_CBI_STAT_FAULT_2D
#define _PSB_CBI_STAT_FAULT_PBE
#define _PSB_CBI_STAT_FAULT_TSP
#define _PSB_CBI_STAT_FAULT_ISP
#define _PSB_CBI_STAT_FAULT_USSEPDS
#define _PSB_CBI_STAT_FAULT_HOST

#define PSB_CR_BIF_BANK0
#define PSB_CR_BIF_BANK1
#define PSB_CR_BIF_DIR_LIST_BASE0
#define PSB_CR_BIF_TWOD_REQ_BASE
#define PSB_CR_BIF_3D_REQ_BASE

#define PSB_CR_2D_SOCIF
#define _PSB_C2_SOCIF_FREESPACE_SHIFT
#define _PSB_C2_SOCIF_FREESPACE_MASK
#define _PSB_C2_SOCIF_EMPTY

#define PSB_CR_2D_BLIT_STATUS
#define _PSB_C2B_STATUS_BUSY
#define _PSB_C2B_STATUS_COMPLETE_SHIFT
#define _PSB_C2B_STATUS_COMPLETE_MASK

/*
 * 2D defs.
 */

/*
 * 2D Slave Port Data : Block Header's Object Type
 */

#define PSB_2D_CLIP_BH
#define PSB_2D_PAT_BH
#define PSB_2D_CTRL_BH
#define PSB_2D_SRC_OFF_BH
#define PSB_2D_MASK_OFF_BH
#define PSB_2D_RESERVED1_BH
#define PSB_2D_RESERVED2_BH
#define PSB_2D_FENCE_BH
#define PSB_2D_BLIT_BH
#define PSB_2D_SRC_SURF_BH
#define PSB_2D_DST_SURF_BH
#define PSB_2D_PAT_SURF_BH
#define PSB_2D_SRC_PAL_BH
#define PSB_2D_PAT_PAL_BH
#define PSB_2D_MASK_SURF_BH
#define PSB_2D_FLUSH_BH

/*
 * Clip Definition block (PSB_2D_CLIP_BH)
 */
#define PSB_2D_CLIPCOUNT_MAX
#define PSB_2D_CLIPCOUNT_MASK
#define PSB_2D_CLIPCOUNT_CLRMASK
#define PSB_2D_CLIPCOUNT_SHIFT
/* clip rectangle min & max */
#define PSB_2D_CLIP_XMAX_MASK
#define PSB_2D_CLIP_XMAX_CLRMASK
#define PSB_2D_CLIP_XMAX_SHIFT
#define PSB_2D_CLIP_XMIN_MASK
#define PSB_2D_CLIP_XMIN_CLRMASK
#define PSB_2D_CLIP_XMIN_SHIFT
/* clip rectangle offset */
#define PSB_2D_CLIP_YMAX_MASK
#define PSB_2D_CLIP_YMAX_CLRMASK
#define PSB_2D_CLIP_YMAX_SHIFT
#define PSB_2D_CLIP_YMIN_MASK
#define PSB_2D_CLIP_YMIN_CLRMASK
#define PSB_2D_CLIP_YMIN_SHIFT

/*
 * Pattern Control (PSB_2D_PAT_BH)
 */
#define PSB_2D_PAT_HEIGHT_MASK
#define PSB_2D_PAT_HEIGHT_SHIFT
#define PSB_2D_PAT_WIDTH_MASK
#define PSB_2D_PAT_WIDTH_SHIFT
#define PSB_2D_PAT_YSTART_MASK
#define PSB_2D_PAT_YSTART_SHIFT
#define PSB_2D_PAT_XSTART_MASK
#define PSB_2D_PAT_XSTART_SHIFT

/*
 * 2D Control block (PSB_2D_CTRL_BH)
 */
/* Present Flags */
#define PSB_2D_SRCCK_CTRL
#define PSB_2D_DSTCK_CTRL
#define PSB_2D_ALPHA_CTRL
/* Colour Key Colour (SRC/DST)*/
#define PSB_2D_CK_COL_MASK
#define PSB_2D_CK_COL_CLRMASK
#define PSB_2D_CK_COL_SHIFT
/* Colour Key Mask (SRC/DST)*/
#define PSB_2D_CK_MASK_MASK
#define PSB_2D_CK_MASK_CLRMASK
#define PSB_2D_CK_MASK_SHIFT
/* Alpha Control (Alpha/RGB)*/
#define PSB_2D_GBLALPHA_MASK
#define PSB_2D_GBLALPHA_CLRMASK
#define PSB_2D_GBLALPHA_SHIFT
#define PSB_2D_SRCALPHA_OP_MASK
#define PSB_2D_SRCALPHA_OP_CLRMASK
#define PSB_2D_SRCALPHA_OP_SHIFT
#define PSB_2D_SRCALPHA_OP_ONE
#define PSB_2D_SRCALPHA_OP_SRC
#define PSB_2D_SRCALPHA_OP_DST
#define PSB_2D_SRCALPHA_OP_SG
#define PSB_2D_SRCALPHA_OP_DG
#define PSB_2D_SRCALPHA_OP_GBL
#define PSB_2D_SRCALPHA_OP_ZERO
#define PSB_2D_SRCALPHA_INVERT
#define PSB_2D_SRCALPHA_INVERT_CLR
#define PSB_2D_DSTALPHA_OP_MASK
#define PSB_2D_DSTALPHA_OP_CLRMASK
#define PSB_2D_DSTALPHA_OP_SHIFT
#define PSB_2D_DSTALPHA_OP_ONE
#define PSB_2D_DSTALPHA_OP_SRC
#define PSB_2D_DSTALPHA_OP_DST
#define PSB_2D_DSTALPHA_OP_SG
#define PSB_2D_DSTALPHA_OP_DG
#define PSB_2D_DSTALPHA_OP_GBL
#define PSB_2D_DSTALPHA_OP_ZERO
#define PSB_2D_DSTALPHA_INVERT
#define PSB_2D_DSTALPHA_INVERT_CLR

#define PSB_2D_PRE_MULTIPLICATION_ENABLE
#define PSB_2D_PRE_MULTIPLICATION_CLRMASK
#define PSB_2D_ZERO_SOURCE_ALPHA_ENABLE
#define PSB_2D_ZERO_SOURCE_ALPHA_CLRMASK

/*
 *Source Offset (PSB_2D_SRC_OFF_BH)
 */
#define PSB_2D_SRCOFF_XSTART_MASK
#define PSB_2D_SRCOFF_XSTART_SHIFT
#define PSB_2D_SRCOFF_YSTART_MASK
#define PSB_2D_SRCOFF_YSTART_SHIFT

/*
 * Mask Offset (PSB_2D_MASK_OFF_BH)
 */
#define PSB_2D_MASKOFF_XSTART_MASK
#define PSB_2D_MASKOFF_XSTART_SHIFT
#define PSB_2D_MASKOFF_YSTART_MASK
#define PSB_2D_MASKOFF_YSTART_SHIFT

/*
 * 2D Fence (see PSB_2D_FENCE_BH): bits 0:27 are ignored
 */

/*
 *Blit Rectangle (PSB_2D_BLIT_BH)
 */

#define PSB_2D_ROT_MASK
#define PSB_2D_ROT_CLRMASK
#define PSB_2D_ROT_NONE
#define PSB_2D_ROT_90DEGS
#define PSB_2D_ROT_180DEGS
#define PSB_2D_ROT_270DEGS

#define PSB_2D_COPYORDER_MASK
#define PSB_2D_COPYORDER_CLRMASK
#define PSB_2D_COPYORDER_TL2BR
#define PSB_2D_COPYORDER_BR2TL
#define PSB_2D_COPYORDER_TR2BL
#define PSB_2D_COPYORDER_BL2TR

#define PSB_2D_DSTCK_CLRMASK
#define PSB_2D_DSTCK_DISABLE
#define PSB_2D_DSTCK_PASS
#define PSB_2D_DSTCK_REJECT

#define PSB_2D_SRCCK_CLRMASK
#define PSB_2D_SRCCK_DISABLE
#define PSB_2D_SRCCK_PASS
#define PSB_2D_SRCCK_REJECT

#define PSB_2D_CLIP_ENABLE

#define PSB_2D_ALPHA_ENABLE

#define PSB_2D_PAT_CLRMASK
#define PSB_2D_PAT_MASK
#define PSB_2D_USE_PAT
#define PSB_2D_USE_FILL
/*
 * Tungsten Graphics note on rop codes: If rop A and rop B are
 * identical, the mask surface will not be read and need not be
 * set up.
 */

#define PSB_2D_ROP3B_MASK
#define PSB_2D_ROP3B_CLRMASK
#define PSB_2D_ROP3B_SHIFT
/* rop code A */
#define PSB_2D_ROP3A_MASK
#define PSB_2D_ROP3A_CLRMASK
#define PSB_2D_ROP3A_SHIFT

#define PSB_2D_ROP4_MASK
/*
 *	DWORD0:	(Only pass if Pattern control == Use Fill Colour)
 *	Fill Colour RGBA8888
 */
#define PSB_2D_FILLCOLOUR_MASK
#define PSB_2D_FILLCOLOUR_SHIFT
/*
 *	DWORD1: (Always Present)
 *	X Start (Dest)
 *	Y Start (Dest)
 */
#define PSB_2D_DST_XSTART_MASK
#define PSB_2D_DST_XSTART_CLRMASK
#define PSB_2D_DST_XSTART_SHIFT
#define PSB_2D_DST_YSTART_MASK
#define PSB_2D_DST_YSTART_CLRMASK
#define PSB_2D_DST_YSTART_SHIFT
/*
 *	DWORD2: (Always Present)
 *	X Size (Dest)
 *	Y Size (Dest)
 */
#define PSB_2D_DST_XSIZE_MASK
#define PSB_2D_DST_XSIZE_CLRMASK
#define PSB_2D_DST_XSIZE_SHIFT
#define PSB_2D_DST_YSIZE_MASK
#define PSB_2D_DST_YSIZE_CLRMASK
#define PSB_2D_DST_YSIZE_SHIFT

/*
 * Source Surface (PSB_2D_SRC_SURF_BH)
 */
/*
 * WORD 0
 */

#define PSB_2D_SRC_FORMAT_MASK
#define PSB_2D_SRC_1_PAL
#define PSB_2D_SRC_2_PAL
#define PSB_2D_SRC_4_PAL
#define PSB_2D_SRC_8_PAL
#define PSB_2D_SRC_8_ALPHA
#define PSB_2D_SRC_4_ALPHA
#define PSB_2D_SRC_332RGB
#define PSB_2D_SRC_4444ARGB
#define PSB_2D_SRC_555RGB
#define PSB_2D_SRC_1555ARGB
#define PSB_2D_SRC_565RGB
#define PSB_2D_SRC_0888ARGB
#define PSB_2D_SRC_8888ARGB
#define PSB_2D_SRC_8888UYVY
#define PSB_2D_SRC_RESERVED
#define PSB_2D_SRC_1555ARGB_LOOKUP


#define PSB_2D_SRC_STRIDE_MASK
#define PSB_2D_SRC_STRIDE_CLRMASK
#define PSB_2D_SRC_STRIDE_SHIFT
/*
 *  WORD 1 - Base Address
 */
#define PSB_2D_SRC_ADDR_MASK
#define PSB_2D_SRC_ADDR_CLRMASK
#define PSB_2D_SRC_ADDR_SHIFT
#define PSB_2D_SRC_ADDR_ALIGNSHIFT

/*
 * Pattern Surface (PSB_2D_PAT_SURF_BH)
 */
/*
 *  WORD 0
 */

#define PSB_2D_PAT_FORMAT_MASK
#define PSB_2D_PAT_1_PAL
#define PSB_2D_PAT_2_PAL
#define PSB_2D_PAT_4_PAL
#define PSB_2D_PAT_8_PAL
#define PSB_2D_PAT_8_ALPHA
#define PSB_2D_PAT_4_ALPHA
#define PSB_2D_PAT_332RGB
#define PSB_2D_PAT_4444ARGB
#define PSB_2D_PAT_555RGB
#define PSB_2D_PAT_1555ARGB
#define PSB_2D_PAT_565RGB
#define PSB_2D_PAT_0888ARGB
#define PSB_2D_PAT_8888ARGB

#define PSB_2D_PAT_STRIDE_MASK
#define PSB_2D_PAT_STRIDE_CLRMASK
#define PSB_2D_PAT_STRIDE_SHIFT
/*
 *  WORD 1 - Base Address
 */
#define PSB_2D_PAT_ADDR_MASK
#define PSB_2D_PAT_ADDR_CLRMASK
#define PSB_2D_PAT_ADDR_SHIFT
#define PSB_2D_PAT_ADDR_ALIGNSHIFT

/*
 * Destination Surface (PSB_2D_DST_SURF_BH)
 */
/*
 * WORD 0
 */

#define PSB_2D_DST_FORMAT_MASK
#define PSB_2D_DST_332RGB
#define PSB_2D_DST_4444ARGB
#define PSB_2D_DST_555RGB
#define PSB_2D_DST_1555ARGB
#define PSB_2D_DST_565RGB
#define PSB_2D_DST_0888ARGB
#define PSB_2D_DST_8888ARGB
#define PSB_2D_DST_8888AYUV

#define PSB_2D_DST_STRIDE_MASK
#define PSB_2D_DST_STRIDE_CLRMASK
#define PSB_2D_DST_STRIDE_SHIFT
/*
 * WORD 1 - Base Address
 */
#define PSB_2D_DST_ADDR_MASK
#define PSB_2D_DST_ADDR_CLRMASK
#define PSB_2D_DST_ADDR_SHIFT
#define PSB_2D_DST_ADDR_ALIGNSHIFT

/*
 * Mask Surface (PSB_2D_MASK_SURF_BH)
 */
/*
 * WORD 0
 */
#define PSB_2D_MASK_STRIDE_MASK
#define PSB_2D_MASK_STRIDE_CLRMASK
#define PSB_2D_MASK_STRIDE_SHIFT
/*
 *  WORD 1 - Base Address
 */
#define PSB_2D_MASK_ADDR_MASK
#define PSB_2D_MASK_ADDR_CLRMASK
#define PSB_2D_MASK_ADDR_SHIFT
#define PSB_2D_MASK_ADDR_ALIGNSHIFT

/*
 * Source Palette (PSB_2D_SRC_PAL_BH)
 */

#define PSB_2D_SRCPAL_ADDR_SHIFT
#define PSB_2D_SRCPAL_ADDR_CLRMASK
#define PSB_2D_SRCPAL_ADDR_MASK
#define PSB_2D_SRCPAL_BYTEALIGN

/*
 * Pattern Palette (PSB_2D_PAT_PAL_BH)
 */

#define PSB_2D_PATPAL_ADDR_SHIFT
#define PSB_2D_PATPAL_ADDR_CLRMASK
#define PSB_2D_PATPAL_ADDR_MASK
#define PSB_2D_PATPAL_BYTEALIGN

/*
 * Rop3 Codes (2 LS bytes)
 */

#define PSB_2D_ROP3_SRCCOPY
#define PSB_2D_ROP3_PATCOPY
#define PSB_2D_ROP3_WHITENESS
#define PSB_2D_ROP3_BLACKNESS
#define PSB_2D_ROP3_SRC
#define PSB_2D_ROP3_PAT
#define PSB_2D_ROP3_DST

/*
 * Sizes.
 */

#define PSB_SCENE_HW_COOKIE_SIZE
#define PSB_TA_MEM_HW_COOKIE_SIZE

/*
 * Scene stuff.
 */

#define PSB_NUM_HW_SCENES

/*
 * Scheduler completion actions.
 */

#define PSB_RASTER_BLOCK
#define PSB_RASTER
#define PSB_RETURN
#define PSB_TA

/* Power management */
#define PSB_PUNIT_PORT
#define PSB_OSPMBA
#define PSB_APMBA
#define PSB_APM_CMD
#define PSB_APM_STS
#define PSB_PWRGT_VID_ENC_MASK
#define PSB_PWRGT_VID_DEC_MASK
#define PSB_PWRGT_GL3_MASK

#define PSB_PM_SSC
#define PSB_PM_SSS
#define PSB_PWRGT_DISPLAY_MASK
/* Display SSS register bits are different in A0 vs. B0 */
#define PSB_PWRGT_GFX_MASK
#define PSB_PWRGT_GFX_MASK_B0
#endif