Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /**************************************************************************
0003  *
0004  * Copyright (c) (2005-2007) Imagination Technologies Limited.
0005  * Copyright (c) 2007, Intel Corporation.
0006  * All Rights Reserved.
0007  *
0008  **************************************************************************/
0009 
0010 #ifndef _PSB_REG_H_
0011 #define _PSB_REG_H_
0012 
0013 #define PSB_CR_CLKGATECTL       0x0000
0014 #define _PSB_C_CLKGATECTL_AUTO_MAN_REG      (1 << 24)
0015 #define _PSB_C_CLKGATECTL_USE_CLKG_SHIFT    (20)
0016 #define _PSB_C_CLKGATECTL_USE_CLKG_MASK     (0x3 << 20)
0017 #define _PSB_C_CLKGATECTL_DPM_CLKG_SHIFT    (16)
0018 #define _PSB_C_CLKGATECTL_DPM_CLKG_MASK     (0x3 << 16)
0019 #define _PSB_C_CLKGATECTL_TA_CLKG_SHIFT     (12)
0020 #define _PSB_C_CLKGATECTL_TA_CLKG_MASK      (0x3 << 12)
0021 #define _PSB_C_CLKGATECTL_TSP_CLKG_SHIFT    (8)
0022 #define _PSB_C_CLKGATECTL_TSP_CLKG_MASK     (0x3 << 8)
0023 #define _PSB_C_CLKGATECTL_ISP_CLKG_SHIFT    (4)
0024 #define _PSB_C_CLKGATECTL_ISP_CLKG_MASK     (0x3 << 4)
0025 #define _PSB_C_CLKGATECTL_2D_CLKG_SHIFT     (0)
0026 #define _PSB_C_CLKGATECTL_2D_CLKG_MASK      (0x3 << 0)
0027 #define _PSB_C_CLKGATECTL_CLKG_ENABLED      (0)
0028 #define _PSB_C_CLKGATECTL_CLKG_DISABLED     (1)
0029 #define _PSB_C_CLKGATECTL_CLKG_AUTO     (2)
0030 
0031 #define PSB_CR_CORE_ID          0x0010
0032 #define _PSB_CC_ID_ID_SHIFT         (16)
0033 #define _PSB_CC_ID_ID_MASK          (0xFFFF << 16)
0034 #define _PSB_CC_ID_CONFIG_SHIFT         (0)
0035 #define _PSB_CC_ID_CONFIG_MASK          (0xFFFF << 0)
0036 
0037 #define PSB_CR_CORE_REVISION        0x0014
0038 #define _PSB_CC_REVISION_DESIGNER_SHIFT     (24)
0039 #define _PSB_CC_REVISION_DESIGNER_MASK      (0xFF << 24)
0040 #define _PSB_CC_REVISION_MAJOR_SHIFT        (16)
0041 #define _PSB_CC_REVISION_MAJOR_MASK     (0xFF << 16)
0042 #define _PSB_CC_REVISION_MINOR_SHIFT        (8)
0043 #define _PSB_CC_REVISION_MINOR_MASK     (0xFF << 8)
0044 #define _PSB_CC_REVISION_MAINTENANCE_SHIFT  (0)
0045 #define _PSB_CC_REVISION_MAINTENANCE_MASK   (0xFF << 0)
0046 
0047 #define PSB_CR_DESIGNER_REV_FIELD1  0x0018
0048 
0049 #define PSB_CR_SOFT_RESET       0x0080
0050 #define _PSB_CS_RESET_TSP_RESET     (1 << 6)
0051 #define _PSB_CS_RESET_ISP_RESET     (1 << 5)
0052 #define _PSB_CS_RESET_USE_RESET     (1 << 4)
0053 #define _PSB_CS_RESET_TA_RESET      (1 << 3)
0054 #define _PSB_CS_RESET_DPM_RESET     (1 << 2)
0055 #define _PSB_CS_RESET_TWOD_RESET    (1 << 1)
0056 #define _PSB_CS_RESET_BIF_RESET         (1 << 0)
0057 
0058 #define PSB_CR_DESIGNER_REV_FIELD2  0x001C
0059 
0060 #define PSB_CR_EVENT_HOST_ENABLE2   0x0110
0061 
0062 #define PSB_CR_EVENT_STATUS2        0x0118
0063 
0064 #define PSB_CR_EVENT_HOST_CLEAR2    0x0114
0065 #define _PSB_CE2_BIF_REQUESTER_FAULT        (1 << 4)
0066 
0067 #define PSB_CR_EVENT_STATUS     0x012C
0068 
0069 #define PSB_CR_EVENT_HOST_ENABLE    0x0130
0070 
0071 #define PSB_CR_EVENT_HOST_CLEAR     0x0134
0072 #define _PSB_CE_MASTER_INTERRUPT        (1 << 31)
0073 #define _PSB_CE_TA_DPM_FAULT            (1 << 28)
0074 #define _PSB_CE_TWOD_COMPLETE           (1 << 27)
0075 #define _PSB_CE_DPM_OUT_OF_MEMORY_ZLS       (1 << 25)
0076 #define _PSB_CE_DPM_TA_MEM_FREE         (1 << 24)
0077 #define _PSB_CE_PIXELBE_END_RENDER      (1 << 18)
0078 #define _PSB_CE_SW_EVENT            (1 << 14)
0079 #define _PSB_CE_TA_FINISHED         (1 << 13)
0080 #define _PSB_CE_TA_TERMINATE            (1 << 12)
0081 #define _PSB_CE_DPM_REACHED_MEM_THRESH      (1 << 3)
0082 #define _PSB_CE_DPM_OUT_OF_MEMORY_GBL       (1 << 2)
0083 #define _PSB_CE_DPM_OUT_OF_MEMORY_MT        (1 << 1)
0084 #define _PSB_CE_DPM_3D_MEM_FREE         (1 << 0)
0085 
0086 
0087 #define PSB_USE_OFFSET_MASK     0x0007FFFF
0088 #define PSB_USE_OFFSET_SIZE     (PSB_USE_OFFSET_MASK + 1)
0089 #define PSB_CR_USE_CODE_BASE0       0x0A0C
0090 #define PSB_CR_USE_CODE_BASE1       0x0A10
0091 #define PSB_CR_USE_CODE_BASE2       0x0A14
0092 #define PSB_CR_USE_CODE_BASE3       0x0A18
0093 #define PSB_CR_USE_CODE_BASE4       0x0A1C
0094 #define PSB_CR_USE_CODE_BASE5       0x0A20
0095 #define PSB_CR_USE_CODE_BASE6       0x0A24
0096 #define PSB_CR_USE_CODE_BASE7       0x0A28
0097 #define PSB_CR_USE_CODE_BASE8       0x0A2C
0098 #define PSB_CR_USE_CODE_BASE9       0x0A30
0099 #define PSB_CR_USE_CODE_BASE10      0x0A34
0100 #define PSB_CR_USE_CODE_BASE11      0x0A38
0101 #define PSB_CR_USE_CODE_BASE12      0x0A3C
0102 #define PSB_CR_USE_CODE_BASE13      0x0A40
0103 #define PSB_CR_USE_CODE_BASE14      0x0A44
0104 #define PSB_CR_USE_CODE_BASE15      0x0A48
0105 #define PSB_CR_USE_CODE_BASE(_i)    (0x0A0C + ((_i) << 2))
0106 #define _PSB_CUC_BASE_DM_SHIFT          (25)
0107 #define _PSB_CUC_BASE_DM_MASK           (0x3 << 25)
0108 #define _PSB_CUC_BASE_ADDR_SHIFT        (0) /* 1024-bit aligned address? */
0109 #define _PSB_CUC_BASE_ADDR_ALIGNSHIFT       (7)
0110 #define _PSB_CUC_BASE_ADDR_MASK         (0x1FFFFFF << 0)
0111 #define _PSB_CUC_DM_VERTEX          (0)
0112 #define _PSB_CUC_DM_PIXEL           (1)
0113 #define _PSB_CUC_DM_RESERVED            (2)
0114 #define _PSB_CUC_DM_EDM             (3)
0115 
0116 #define PSB_CR_PDS_EXEC_BASE        0x0AB8
0117 #define _PSB_CR_PDS_EXEC_BASE_ADDR_SHIFT    (20)    /* 1MB aligned address */
0118 #define _PSB_CR_PDS_EXEC_BASE_ADDR_ALIGNSHIFT   (20)
0119 
0120 #define PSB_CR_EVENT_KICKER     0x0AC4
0121 #define _PSB_CE_KICKER_ADDRESS_SHIFT        (4) /* 128-bit aligned address */
0122 
0123 #define PSB_CR_EVENT_KICK       0x0AC8
0124 #define _PSB_CE_KICK_NOW            (1 << 0)
0125 
0126 #define PSB_CR_BIF_DIR_LIST_BASE1   0x0C38
0127 
0128 #define PSB_CR_BIF_CTRL         0x0C00
0129 #define _PSB_CB_CTRL_CLEAR_FAULT        (1 << 4)
0130 #define _PSB_CB_CTRL_INVALDC            (1 << 3)
0131 #define _PSB_CB_CTRL_FLUSH          (1 << 2)
0132 
0133 #define PSB_CR_BIF_INT_STAT     0x0C04
0134 
0135 #define PSB_CR_BIF_FAULT        0x0C08
0136 #define _PSB_CBI_STAT_PF_N_RW           (1 << 14)
0137 #define _PSB_CBI_STAT_FAULT_SHIFT       (0)
0138 #define _PSB_CBI_STAT_FAULT_MASK        (0x3FFF << 0)
0139 #define _PSB_CBI_STAT_FAULT_CACHE       (1 << 1)
0140 #define _PSB_CBI_STAT_FAULT_TA          (1 << 2)
0141 #define _PSB_CBI_STAT_FAULT_VDM         (1 << 3)
0142 #define _PSB_CBI_STAT_FAULT_2D          (1 << 4)
0143 #define _PSB_CBI_STAT_FAULT_PBE         (1 << 5)
0144 #define _PSB_CBI_STAT_FAULT_TSP         (1 << 6)
0145 #define _PSB_CBI_STAT_FAULT_ISP         (1 << 7)
0146 #define _PSB_CBI_STAT_FAULT_USSEPDS     (1 << 8)
0147 #define _PSB_CBI_STAT_FAULT_HOST        (1 << 9)
0148 
0149 #define PSB_CR_BIF_BANK0        0x0C78
0150 #define PSB_CR_BIF_BANK1        0x0C7C
0151 #define PSB_CR_BIF_DIR_LIST_BASE0   0x0C84
0152 #define PSB_CR_BIF_TWOD_REQ_BASE    0x0C88
0153 #define PSB_CR_BIF_3D_REQ_BASE      0x0CAC
0154 
0155 #define PSB_CR_2D_SOCIF         0x0E18
0156 #define _PSB_C2_SOCIF_FREESPACE_SHIFT       (0)
0157 #define _PSB_C2_SOCIF_FREESPACE_MASK        (0xFF << 0)
0158 #define _PSB_C2_SOCIF_EMPTY         (0x80 << 0)
0159 
0160 #define PSB_CR_2D_BLIT_STATUS       0x0E04
0161 #define _PSB_C2B_STATUS_BUSY            (1 << 24)
0162 #define _PSB_C2B_STATUS_COMPLETE_SHIFT      (0)
0163 #define _PSB_C2B_STATUS_COMPLETE_MASK       (0xFFFFFF << 0)
0164 
0165 /*
0166  * 2D defs.
0167  */
0168 
0169 /*
0170  * 2D Slave Port Data : Block Header's Object Type
0171  */
0172 
0173 #define PSB_2D_CLIP_BH          (0x00000000)
0174 #define PSB_2D_PAT_BH           (0x10000000)
0175 #define PSB_2D_CTRL_BH          (0x20000000)
0176 #define PSB_2D_SRC_OFF_BH       (0x30000000)
0177 #define PSB_2D_MASK_OFF_BH      (0x40000000)
0178 #define PSB_2D_RESERVED1_BH     (0x50000000)
0179 #define PSB_2D_RESERVED2_BH     (0x60000000)
0180 #define PSB_2D_FENCE_BH         (0x70000000)
0181 #define PSB_2D_BLIT_BH          (0x80000000)
0182 #define PSB_2D_SRC_SURF_BH      (0x90000000)
0183 #define PSB_2D_DST_SURF_BH      (0xA0000000)
0184 #define PSB_2D_PAT_SURF_BH      (0xB0000000)
0185 #define PSB_2D_SRC_PAL_BH       (0xC0000000)
0186 #define PSB_2D_PAT_PAL_BH       (0xD0000000)
0187 #define PSB_2D_MASK_SURF_BH     (0xE0000000)
0188 #define PSB_2D_FLUSH_BH         (0xF0000000)
0189 
0190 /*
0191  * Clip Definition block (PSB_2D_CLIP_BH)
0192  */
0193 #define PSB_2D_CLIPCOUNT_MAX        (1)
0194 #define PSB_2D_CLIPCOUNT_MASK       (0x00000000)
0195 #define PSB_2D_CLIPCOUNT_CLRMASK    (0xFFFFFFFF)
0196 #define PSB_2D_CLIPCOUNT_SHIFT      (0)
0197 /* clip rectangle min & max */
0198 #define PSB_2D_CLIP_XMAX_MASK       (0x00FFF000)
0199 #define PSB_2D_CLIP_XMAX_CLRMASK    (0xFF000FFF)
0200 #define PSB_2D_CLIP_XMAX_SHIFT      (12)
0201 #define PSB_2D_CLIP_XMIN_MASK       (0x00000FFF)
0202 #define PSB_2D_CLIP_XMIN_CLRMASK    (0x00FFF000)
0203 #define PSB_2D_CLIP_XMIN_SHIFT      (0)
0204 /* clip rectangle offset */
0205 #define PSB_2D_CLIP_YMAX_MASK       (0x00FFF000)
0206 #define PSB_2D_CLIP_YMAX_CLRMASK    (0xFF000FFF)
0207 #define PSB_2D_CLIP_YMAX_SHIFT      (12)
0208 #define PSB_2D_CLIP_YMIN_MASK       (0x00000FFF)
0209 #define PSB_2D_CLIP_YMIN_CLRMASK    (0x00FFF000)
0210 #define PSB_2D_CLIP_YMIN_SHIFT      (0)
0211 
0212 /*
0213  * Pattern Control (PSB_2D_PAT_BH)
0214  */
0215 #define PSB_2D_PAT_HEIGHT_MASK      (0x0000001F)
0216 #define PSB_2D_PAT_HEIGHT_SHIFT     (0)
0217 #define PSB_2D_PAT_WIDTH_MASK       (0x000003E0)
0218 #define PSB_2D_PAT_WIDTH_SHIFT      (5)
0219 #define PSB_2D_PAT_YSTART_MASK      (0x00007C00)
0220 #define PSB_2D_PAT_YSTART_SHIFT     (10)
0221 #define PSB_2D_PAT_XSTART_MASK      (0x000F8000)
0222 #define PSB_2D_PAT_XSTART_SHIFT     (15)
0223 
0224 /*
0225  * 2D Control block (PSB_2D_CTRL_BH)
0226  */
0227 /* Present Flags */
0228 #define PSB_2D_SRCCK_CTRL       (0x00000001)
0229 #define PSB_2D_DSTCK_CTRL       (0x00000002)
0230 #define PSB_2D_ALPHA_CTRL       (0x00000004)
0231 /* Colour Key Colour (SRC/DST)*/
0232 #define PSB_2D_CK_COL_MASK      (0xFFFFFFFF)
0233 #define PSB_2D_CK_COL_CLRMASK       (0x00000000)
0234 #define PSB_2D_CK_COL_SHIFT     (0)
0235 /* Colour Key Mask (SRC/DST)*/
0236 #define PSB_2D_CK_MASK_MASK     (0xFFFFFFFF)
0237 #define PSB_2D_CK_MASK_CLRMASK      (0x00000000)
0238 #define PSB_2D_CK_MASK_SHIFT        (0)
0239 /* Alpha Control (Alpha/RGB)*/
0240 #define PSB_2D_GBLALPHA_MASK        (0x000FF000)
0241 #define PSB_2D_GBLALPHA_CLRMASK     (0xFFF00FFF)
0242 #define PSB_2D_GBLALPHA_SHIFT       (12)
0243 #define PSB_2D_SRCALPHA_OP_MASK     (0x00700000)
0244 #define PSB_2D_SRCALPHA_OP_CLRMASK  (0xFF8FFFFF)
0245 #define PSB_2D_SRCALPHA_OP_SHIFT    (20)
0246 #define PSB_2D_SRCALPHA_OP_ONE      (0x00000000)
0247 #define PSB_2D_SRCALPHA_OP_SRC      (0x00100000)
0248 #define PSB_2D_SRCALPHA_OP_DST      (0x00200000)
0249 #define PSB_2D_SRCALPHA_OP_SG       (0x00300000)
0250 #define PSB_2D_SRCALPHA_OP_DG       (0x00400000)
0251 #define PSB_2D_SRCALPHA_OP_GBL      (0x00500000)
0252 #define PSB_2D_SRCALPHA_OP_ZERO     (0x00600000)
0253 #define PSB_2D_SRCALPHA_INVERT      (0x00800000)
0254 #define PSB_2D_SRCALPHA_INVERT_CLR  (0xFF7FFFFF)
0255 #define PSB_2D_DSTALPHA_OP_MASK     (0x07000000)
0256 #define PSB_2D_DSTALPHA_OP_CLRMASK  (0xF8FFFFFF)
0257 #define PSB_2D_DSTALPHA_OP_SHIFT    (24)
0258 #define PSB_2D_DSTALPHA_OP_ONE      (0x00000000)
0259 #define PSB_2D_DSTALPHA_OP_SRC      (0x01000000)
0260 #define PSB_2D_DSTALPHA_OP_DST      (0x02000000)
0261 #define PSB_2D_DSTALPHA_OP_SG       (0x03000000)
0262 #define PSB_2D_DSTALPHA_OP_DG       (0x04000000)
0263 #define PSB_2D_DSTALPHA_OP_GBL      (0x05000000)
0264 #define PSB_2D_DSTALPHA_OP_ZERO     (0x06000000)
0265 #define PSB_2D_DSTALPHA_INVERT      (0x08000000)
0266 #define PSB_2D_DSTALPHA_INVERT_CLR  (0xF7FFFFFF)
0267 
0268 #define PSB_2D_PRE_MULTIPLICATION_ENABLE    (0x10000000)
0269 #define PSB_2D_PRE_MULTIPLICATION_CLRMASK   (0xEFFFFFFF)
0270 #define PSB_2D_ZERO_SOURCE_ALPHA_ENABLE     (0x20000000)
0271 #define PSB_2D_ZERO_SOURCE_ALPHA_CLRMASK    (0xDFFFFFFF)
0272 
0273 /*
0274  *Source Offset (PSB_2D_SRC_OFF_BH)
0275  */
0276 #define PSB_2D_SRCOFF_XSTART_MASK   ((0x00000FFF) << 12)
0277 #define PSB_2D_SRCOFF_XSTART_SHIFT  (12)
0278 #define PSB_2D_SRCOFF_YSTART_MASK   (0x00000FFF)
0279 #define PSB_2D_SRCOFF_YSTART_SHIFT  (0)
0280 
0281 /*
0282  * Mask Offset (PSB_2D_MASK_OFF_BH)
0283  */
0284 #define PSB_2D_MASKOFF_XSTART_MASK  ((0x00000FFF) << 12)
0285 #define PSB_2D_MASKOFF_XSTART_SHIFT (12)
0286 #define PSB_2D_MASKOFF_YSTART_MASK  (0x00000FFF)
0287 #define PSB_2D_MASKOFF_YSTART_SHIFT (0)
0288 
0289 /*
0290  * 2D Fence (see PSB_2D_FENCE_BH): bits 0:27 are ignored
0291  */
0292 
0293 /*
0294  *Blit Rectangle (PSB_2D_BLIT_BH)
0295  */
0296 
0297 #define PSB_2D_ROT_MASK         (3 << 25)
0298 #define PSB_2D_ROT_CLRMASK      (~PSB_2D_ROT_MASK)
0299 #define PSB_2D_ROT_NONE         (0 << 25)
0300 #define PSB_2D_ROT_90DEGS       (1 << 25)
0301 #define PSB_2D_ROT_180DEGS      (2 << 25)
0302 #define PSB_2D_ROT_270DEGS      (3 << 25)
0303 
0304 #define PSB_2D_COPYORDER_MASK       (3 << 23)
0305 #define PSB_2D_COPYORDER_CLRMASK    (~PSB_2D_COPYORDER_MASK)
0306 #define PSB_2D_COPYORDER_TL2BR      (0 << 23)
0307 #define PSB_2D_COPYORDER_BR2TL      (1 << 23)
0308 #define PSB_2D_COPYORDER_TR2BL      (2 << 23)
0309 #define PSB_2D_COPYORDER_BL2TR      (3 << 23)
0310 
0311 #define PSB_2D_DSTCK_CLRMASK        (0xFF9FFFFF)
0312 #define PSB_2D_DSTCK_DISABLE        (0x00000000)
0313 #define PSB_2D_DSTCK_PASS       (0x00200000)
0314 #define PSB_2D_DSTCK_REJECT     (0x00400000)
0315 
0316 #define PSB_2D_SRCCK_CLRMASK        (0xFFE7FFFF)
0317 #define PSB_2D_SRCCK_DISABLE        (0x00000000)
0318 #define PSB_2D_SRCCK_PASS       (0x00080000)
0319 #define PSB_2D_SRCCK_REJECT     (0x00100000)
0320 
0321 #define PSB_2D_CLIP_ENABLE      (0x00040000)
0322 
0323 #define PSB_2D_ALPHA_ENABLE     (0x00020000)
0324 
0325 #define PSB_2D_PAT_CLRMASK      (0xFFFEFFFF)
0326 #define PSB_2D_PAT_MASK         (0x00010000)
0327 #define PSB_2D_USE_PAT          (0x00010000)
0328 #define PSB_2D_USE_FILL         (0x00000000)
0329 /*
0330  * Tungsten Graphics note on rop codes: If rop A and rop B are
0331  * identical, the mask surface will not be read and need not be
0332  * set up.
0333  */
0334 
0335 #define PSB_2D_ROP3B_MASK       (0x0000FF00)
0336 #define PSB_2D_ROP3B_CLRMASK        (0xFFFF00FF)
0337 #define PSB_2D_ROP3B_SHIFT      (8)
0338 /* rop code A */
0339 #define PSB_2D_ROP3A_MASK       (0x000000FF)
0340 #define PSB_2D_ROP3A_CLRMASK        (0xFFFFFF00)
0341 #define PSB_2D_ROP3A_SHIFT      (0)
0342 
0343 #define PSB_2D_ROP4_MASK        (0x0000FFFF)
0344 /*
0345  *  DWORD0: (Only pass if Pattern control == Use Fill Colour)
0346  *  Fill Colour RGBA8888
0347  */
0348 #define PSB_2D_FILLCOLOUR_MASK      (0xFFFFFFFF)
0349 #define PSB_2D_FILLCOLOUR_SHIFT     (0)
0350 /*
0351  *  DWORD1: (Always Present)
0352  *  X Start (Dest)
0353  *  Y Start (Dest)
0354  */
0355 #define PSB_2D_DST_XSTART_MASK      (0x00FFF000)
0356 #define PSB_2D_DST_XSTART_CLRMASK   (0xFF000FFF)
0357 #define PSB_2D_DST_XSTART_SHIFT     (12)
0358 #define PSB_2D_DST_YSTART_MASK      (0x00000FFF)
0359 #define PSB_2D_DST_YSTART_CLRMASK   (0xFFFFF000)
0360 #define PSB_2D_DST_YSTART_SHIFT     (0)
0361 /*
0362  *  DWORD2: (Always Present)
0363  *  X Size (Dest)
0364  *  Y Size (Dest)
0365  */
0366 #define PSB_2D_DST_XSIZE_MASK       (0x00FFF000)
0367 #define PSB_2D_DST_XSIZE_CLRMASK    (0xFF000FFF)
0368 #define PSB_2D_DST_XSIZE_SHIFT      (12)
0369 #define PSB_2D_DST_YSIZE_MASK       (0x00000FFF)
0370 #define PSB_2D_DST_YSIZE_CLRMASK    (0xFFFFF000)
0371 #define PSB_2D_DST_YSIZE_SHIFT      (0)
0372 
0373 /*
0374  * Source Surface (PSB_2D_SRC_SURF_BH)
0375  */
0376 /*
0377  * WORD 0
0378  */
0379 
0380 #define PSB_2D_SRC_FORMAT_MASK      (0x00078000)
0381 #define PSB_2D_SRC_1_PAL        (0x00000000)
0382 #define PSB_2D_SRC_2_PAL        (0x00008000)
0383 #define PSB_2D_SRC_4_PAL        (0x00010000)
0384 #define PSB_2D_SRC_8_PAL        (0x00018000)
0385 #define PSB_2D_SRC_8_ALPHA      (0x00020000)
0386 #define PSB_2D_SRC_4_ALPHA      (0x00028000)
0387 #define PSB_2D_SRC_332RGB       (0x00030000)
0388 #define PSB_2D_SRC_4444ARGB     (0x00038000)
0389 #define PSB_2D_SRC_555RGB       (0x00040000)
0390 #define PSB_2D_SRC_1555ARGB     (0x00048000)
0391 #define PSB_2D_SRC_565RGB       (0x00050000)
0392 #define PSB_2D_SRC_0888ARGB     (0x00058000)
0393 #define PSB_2D_SRC_8888ARGB     (0x00060000)
0394 #define PSB_2D_SRC_8888UYVY     (0x00068000)
0395 #define PSB_2D_SRC_RESERVED     (0x00070000)
0396 #define PSB_2D_SRC_1555ARGB_LOOKUP  (0x00078000)
0397 
0398 
0399 #define PSB_2D_SRC_STRIDE_MASK      (0x00007FFF)
0400 #define PSB_2D_SRC_STRIDE_CLRMASK   (0xFFFF8000)
0401 #define PSB_2D_SRC_STRIDE_SHIFT     (0)
0402 /*
0403  *  WORD 1 - Base Address
0404  */
0405 #define PSB_2D_SRC_ADDR_MASK        (0x0FFFFFFC)
0406 #define PSB_2D_SRC_ADDR_CLRMASK     (0x00000003)
0407 #define PSB_2D_SRC_ADDR_SHIFT       (2)
0408 #define PSB_2D_SRC_ADDR_ALIGNSHIFT  (2)
0409 
0410 /*
0411  * Pattern Surface (PSB_2D_PAT_SURF_BH)
0412  */
0413 /*
0414  *  WORD 0
0415  */
0416 
0417 #define PSB_2D_PAT_FORMAT_MASK      (0x00078000)
0418 #define PSB_2D_PAT_1_PAL        (0x00000000)
0419 #define PSB_2D_PAT_2_PAL        (0x00008000)
0420 #define PSB_2D_PAT_4_PAL        (0x00010000)
0421 #define PSB_2D_PAT_8_PAL        (0x00018000)
0422 #define PSB_2D_PAT_8_ALPHA      (0x00020000)
0423 #define PSB_2D_PAT_4_ALPHA      (0x00028000)
0424 #define PSB_2D_PAT_332RGB       (0x00030000)
0425 #define PSB_2D_PAT_4444ARGB     (0x00038000)
0426 #define PSB_2D_PAT_555RGB       (0x00040000)
0427 #define PSB_2D_PAT_1555ARGB     (0x00048000)
0428 #define PSB_2D_PAT_565RGB       (0x00050000)
0429 #define PSB_2D_PAT_0888ARGB     (0x00058000)
0430 #define PSB_2D_PAT_8888ARGB     (0x00060000)
0431 
0432 #define PSB_2D_PAT_STRIDE_MASK      (0x00007FFF)
0433 #define PSB_2D_PAT_STRIDE_CLRMASK   (0xFFFF8000)
0434 #define PSB_2D_PAT_STRIDE_SHIFT     (0)
0435 /*
0436  *  WORD 1 - Base Address
0437  */
0438 #define PSB_2D_PAT_ADDR_MASK        (0x0FFFFFFC)
0439 #define PSB_2D_PAT_ADDR_CLRMASK     (0x00000003)
0440 #define PSB_2D_PAT_ADDR_SHIFT       (2)
0441 #define PSB_2D_PAT_ADDR_ALIGNSHIFT  (2)
0442 
0443 /*
0444  * Destination Surface (PSB_2D_DST_SURF_BH)
0445  */
0446 /*
0447  * WORD 0
0448  */
0449 
0450 #define PSB_2D_DST_FORMAT_MASK      (0x00078000)
0451 #define PSB_2D_DST_332RGB       (0x00030000)
0452 #define PSB_2D_DST_4444ARGB     (0x00038000)
0453 #define PSB_2D_DST_555RGB       (0x00040000)
0454 #define PSB_2D_DST_1555ARGB     (0x00048000)
0455 #define PSB_2D_DST_565RGB       (0x00050000)
0456 #define PSB_2D_DST_0888ARGB     (0x00058000)
0457 #define PSB_2D_DST_8888ARGB     (0x00060000)
0458 #define PSB_2D_DST_8888AYUV     (0x00070000)
0459 
0460 #define PSB_2D_DST_STRIDE_MASK      (0x00007FFF)
0461 #define PSB_2D_DST_STRIDE_CLRMASK   (0xFFFF8000)
0462 #define PSB_2D_DST_STRIDE_SHIFT     (0)
0463 /*
0464  * WORD 1 - Base Address
0465  */
0466 #define PSB_2D_DST_ADDR_MASK        (0x0FFFFFFC)
0467 #define PSB_2D_DST_ADDR_CLRMASK     (0x00000003)
0468 #define PSB_2D_DST_ADDR_SHIFT       (2)
0469 #define PSB_2D_DST_ADDR_ALIGNSHIFT  (2)
0470 
0471 /*
0472  * Mask Surface (PSB_2D_MASK_SURF_BH)
0473  */
0474 /*
0475  * WORD 0
0476  */
0477 #define PSB_2D_MASK_STRIDE_MASK     (0x00007FFF)
0478 #define PSB_2D_MASK_STRIDE_CLRMASK  (0xFFFF8000)
0479 #define PSB_2D_MASK_STRIDE_SHIFT    (0)
0480 /*
0481  *  WORD 1 - Base Address
0482  */
0483 #define PSB_2D_MASK_ADDR_MASK       (0x0FFFFFFC)
0484 #define PSB_2D_MASK_ADDR_CLRMASK    (0x00000003)
0485 #define PSB_2D_MASK_ADDR_SHIFT      (2)
0486 #define PSB_2D_MASK_ADDR_ALIGNSHIFT (2)
0487 
0488 /*
0489  * Source Palette (PSB_2D_SRC_PAL_BH)
0490  */
0491 
0492 #define PSB_2D_SRCPAL_ADDR_SHIFT    (0)
0493 #define PSB_2D_SRCPAL_ADDR_CLRMASK  (0xF0000007)
0494 #define PSB_2D_SRCPAL_ADDR_MASK     (0x0FFFFFF8)
0495 #define PSB_2D_SRCPAL_BYTEALIGN     (1024)
0496 
0497 /*
0498  * Pattern Palette (PSB_2D_PAT_PAL_BH)
0499  */
0500 
0501 #define PSB_2D_PATPAL_ADDR_SHIFT    (0)
0502 #define PSB_2D_PATPAL_ADDR_CLRMASK  (0xF0000007)
0503 #define PSB_2D_PATPAL_ADDR_MASK     (0x0FFFFFF8)
0504 #define PSB_2D_PATPAL_BYTEALIGN     (1024)
0505 
0506 /*
0507  * Rop3 Codes (2 LS bytes)
0508  */
0509 
0510 #define PSB_2D_ROP3_SRCCOPY     (0xCCCC)
0511 #define PSB_2D_ROP3_PATCOPY     (0xF0F0)
0512 #define PSB_2D_ROP3_WHITENESS       (0xFFFF)
0513 #define PSB_2D_ROP3_BLACKNESS       (0x0000)
0514 #define PSB_2D_ROP3_SRC         (0xCC)
0515 #define PSB_2D_ROP3_PAT         (0xF0)
0516 #define PSB_2D_ROP3_DST         (0xAA)
0517 
0518 /*
0519  * Sizes.
0520  */
0521 
0522 #define PSB_SCENE_HW_COOKIE_SIZE    16
0523 #define PSB_TA_MEM_HW_COOKIE_SIZE   16
0524 
0525 /*
0526  * Scene stuff.
0527  */
0528 
0529 #define PSB_NUM_HW_SCENES       2
0530 
0531 /*
0532  * Scheduler completion actions.
0533  */
0534 
0535 #define PSB_RASTER_BLOCK        0
0536 #define PSB_RASTER          1
0537 #define PSB_RETURN          2
0538 #define PSB_TA              3
0539 
0540 /* Power management */
0541 #define PSB_PUNIT_PORT          0x04
0542 #define PSB_OSPMBA          0x78
0543 #define PSB_APMBA           0x7a
0544 #define PSB_APM_CMD         0x0
0545 #define PSB_APM_STS         0x04
0546 #define PSB_PWRGT_VID_ENC_MASK      0x30
0547 #define PSB_PWRGT_VID_DEC_MASK      0xc
0548 #define PSB_PWRGT_GL3_MASK      0xc0
0549 
0550 #define PSB_PM_SSC          0x20
0551 #define PSB_PM_SSS          0x30
0552 #define PSB_PWRGT_DISPLAY_MASK      0xc /*on a different BA than video/gfx*/
0553 /* Display SSS register bits are different in A0 vs. B0 */
0554 #define PSB_PWRGT_GFX_MASK      0x3
0555 #define PSB_PWRGT_GFX_MASK_B0       0xc3
0556 #endif