Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * (C) COPYRIGHT 2018 ARM Limited. All rights reserved.
0004  * Author: James.Qian.Wang <james.qian.wang@arm.com>
0005  *
0006  */
0007 #ifndef _D71_REG_H_
0008 #define _D71_REG_H_
0009 
0010 /* Common block registers offset */
0011 #define BLK_BLOCK_INFO      0x000
0012 #define BLK_PIPELINE_INFO   0x004
0013 #define BLK_MAX_LINE_SIZE   0x008
0014 #define BLK_VALID_INPUT_ID0 0x020
0015 #define BLK_OUTPUT_ID0      0x060
0016 #define BLK_INPUT_ID0       0x080
0017 #define BLK_IRQ_RAW_STATUS  0x0A0
0018 #define BLK_IRQ_CLEAR       0x0A4
0019 #define BLK_IRQ_MASK        0x0A8
0020 #define BLK_IRQ_STATUS      0x0AC
0021 #define BLK_STATUS      0x0B0
0022 #define BLK_INFO        0x0C0
0023 #define BLK_CONTROL     0x0D0
0024 #define BLK_SIZE        0x0D4
0025 #define BLK_IN_SIZE     0x0E0
0026 
0027 #define BLK_P0_PTR_LOW      0x100
0028 #define BLK_P0_PTR_HIGH     0x104
0029 #define BLK_P0_STRIDE       0x108
0030 #define BLK_P1_PTR_LOW      0x110
0031 #define BLK_P1_PTR_HIGH     0x114
0032 #define BLK_P1_STRIDE       0x118
0033 #define BLK_P2_PTR_LOW      0x120
0034 #define BLK_P2_PTR_HIGH     0x124
0035 
0036 #define BLOCK_INFO_N_SUBBLKS(x) ((x) & 0x000F)
0037 #define BLOCK_INFO_BLK_ID(x)    (((x) & 0x00F0) >> 4)
0038 #define BLOCK_INFO_BLK_TYPE(x)  (((x) & 0xFF00) >> 8)
0039 #define BLOCK_INFO_INPUT_ID(x)  ((x) & 0xFFF0)
0040 #define BLOCK_INFO_TYPE_ID(x)   (((x) & 0x0FF0) >> 4)
0041 
0042 #define PIPELINE_INFO_N_OUTPUTS(x)  ((x) & 0x000F)
0043 #define PIPELINE_INFO_N_VALID_INPUTS(x) (((x) & 0x0F00) >> 8)
0044 
0045 /* Common block control register bits */
0046 #define BLK_CTRL_EN     BIT(0)
0047 /* Common size macro */
0048 #define HV_SIZE(h, v)       (((h) & 0x1FFF) + (((v) & 0x1FFF) << 16))
0049 #define HV_OFFSET(h, v)     (((h) & 0xFFF) + (((v) & 0xFFF) << 16))
0050 #define HV_CROP(h, v)       (((h) & 0xFFF) + (((v) & 0xFFF) << 16))
0051 
0052 /* AD_CONTROL register */
0053 #define AD_CONTROL      0x160
0054 
0055 /* AD_CONTROL register bits */
0056 #define AD_AEN          BIT(0)
0057 #define AD_YT           BIT(1)
0058 #define AD_BS           BIT(2)
0059 #define AD_WB           BIT(3)
0060 #define AD_TH           BIT(4)
0061 
0062 /* Global Control Unit */
0063 #define GLB_ARCH_ID     0x000
0064 #define GLB_CORE_ID     0x004
0065 #define GLB_CORE_INFO       0x008
0066 #define GLB_IRQ_STATUS      0x010
0067 
0068 #define GCU_CONFIG_VALID0   0x0D4
0069 #define GCU_CONFIG_VALID1   0x0D8
0070 
0071 /* GCU_CONTROL_BITS */
0072 #define GCU_CONTROL_MODE(x) ((x) & 0x7)
0073 #define GCU_CONTROL_SRST    BIT(16)
0074 
0075 /* GCU_CONFIGURATION registers */
0076 #define GCU_CONFIGURATION_ID0   0x100
0077 #define GCU_CONFIGURATION_ID1   0x104
0078 
0079 /* GCU configuration */
0080 #define GCU_MAX_LINE_SIZE(x)    ((x) & 0xFFFF)
0081 #define GCU_MAX_NUM_LINES(x)    ((x) >> 16)
0082 #define GCU_NUM_RICH_LAYERS(x)  ((x) & 0x7)
0083 #define GCU_NUM_PIPELINES(x)    (((x) >> 3) & 0x7)
0084 #define GCU_NUM_SCALERS(x)  (((x) >> 6) & 0x7)
0085 #define GCU_DISPLAY_SPLIT_EN(x) (((x) >> 16) & 0x1)
0086 #define GCU_DISPLAY_TBU_EN(x)   (((x) >> 17) & 0x1)
0087 
0088 /* GCU opmode */
0089 #define INACTIVE_MODE       0
0090 #define TBU_CONNECT_MODE    1
0091 #define TBU_DISCONNECT_MODE 2
0092 #define DO0_ACTIVE_MODE     3
0093 #define DO1_ACTIVE_MODE     4
0094 #define DO01_ACTIVE_MODE    5
0095 
0096 /* GLB_IRQ_STATUS bits */
0097 #define GLB_IRQ_STATUS_GCU  BIT(0)
0098 #define GLB_IRQ_STATUS_LPU0 BIT(8)
0099 #define GLB_IRQ_STATUS_LPU1 BIT(9)
0100 #define GLB_IRQ_STATUS_ATU0 BIT(10)
0101 #define GLB_IRQ_STATUS_ATU1 BIT(11)
0102 #define GLB_IRQ_STATUS_ATU2 BIT(12)
0103 #define GLB_IRQ_STATUS_ATU3 BIT(13)
0104 #define GLB_IRQ_STATUS_CU0  BIT(16)
0105 #define GLB_IRQ_STATUS_CU1  BIT(17)
0106 #define GLB_IRQ_STATUS_DOU0 BIT(24)
0107 #define GLB_IRQ_STATUS_DOU1 BIT(25)
0108 
0109 #define GLB_IRQ_STATUS_PIPE0    (GLB_IRQ_STATUS_LPU0 |\
0110                  GLB_IRQ_STATUS_ATU0 |\
0111                  GLB_IRQ_STATUS_ATU1 |\
0112                  GLB_IRQ_STATUS_CU0 |\
0113                  GLB_IRQ_STATUS_DOU0)
0114 
0115 #define GLB_IRQ_STATUS_PIPE1    (GLB_IRQ_STATUS_LPU1 |\
0116                  GLB_IRQ_STATUS_ATU2 |\
0117                  GLB_IRQ_STATUS_ATU3 |\
0118                  GLB_IRQ_STATUS_CU1 |\
0119                  GLB_IRQ_STATUS_DOU1)
0120 
0121 #define GLB_IRQ_STATUS_ATU  (GLB_IRQ_STATUS_ATU0 |\
0122                  GLB_IRQ_STATUS_ATU1 |\
0123                  GLB_IRQ_STATUS_ATU2 |\
0124                  GLB_IRQ_STATUS_ATU3)
0125 
0126 /* GCU_IRQ_BITS */
0127 #define GCU_IRQ_CVAL0       BIT(0)
0128 #define GCU_IRQ_CVAL1       BIT(1)
0129 #define GCU_IRQ_MODE        BIT(4)
0130 #define GCU_IRQ_ERR     BIT(11)
0131 
0132 /* GCU_STATUS_BITS */
0133 #define GCU_STATUS_MODE(x)  ((x) & 0x7)
0134 #define GCU_STATUS_MERR     BIT(4)
0135 #define GCU_STATUS_TCS0     BIT(8)
0136 #define GCU_STATUS_TCS1     BIT(9)
0137 #define GCU_STATUS_ACTIVE   BIT(31)
0138 
0139 /* GCU_CONFIG_VALIDx BITS */
0140 #define GCU_CONFIG_CVAL     BIT(0)
0141 
0142 /* PERIPHERAL registers */
0143 #define PERIPH_MAX_LINE_SIZE    BIT(0)
0144 #define PERIPH_NUM_RICH_LAYERS  BIT(4)
0145 #define PERIPH_SPLIT_EN     BIT(8)
0146 #define PERIPH_TBU_EN       BIT(12)
0147 #define PERIPH_AFBC_DMA_EN  BIT(16)
0148 #define PERIPH_CONFIGURATION_ID 0x1D4
0149 
0150 /* LPU register */
0151 #define LPU_TBU_STATUS      0x0B4
0152 #define LPU_RAXI_CONTROL    0x0D0
0153 #define LPU_WAXI_CONTROL    0x0D4
0154 #define LPU_TBU_CONTROL     0x0D8
0155 
0156 /* LPU_xAXI_CONTROL_BITS */
0157 #define TO_RAXI_AOUTSTDCAPB(x)  (x)
0158 #define TO_RAXI_BOUTSTDCAPB(x)  ((x) << 8)
0159 #define TO_RAXI_BEN(x)      ((x) << 15)
0160 #define TO_xAXI_BURSTLEN(x) ((x) << 16)
0161 #define TO_xAXI_AxQOS(x)    ((x) << 24)
0162 #define TO_xAXI_ORD(x)      ((x) << 31)
0163 #define TO_WAXI_OUTSTDCAPB(x)   (x)
0164 
0165 #define RAXI_AOUTSTDCAPB_MASK   0x7F
0166 #define RAXI_BOUTSTDCAPB_MASK   0x7F00
0167 #define RAXI_BEN_MASK       BIT(15)
0168 #define xAXI_BURSTLEN_MASK  0x3F0000
0169 #define xAXI_AxQOS_MASK     0xF000000
0170 #define xAXI_ORD_MASK       BIT(31)
0171 #define WAXI_OUTSTDCAPB_MASK    0x3F
0172 
0173 /* LPU_TBU_CONTROL BITS */
0174 #define TO_TBU_DOUTSTDCAPB(x)   (x)
0175 #define TBU_DOUTSTDCAPB_MASK    0x3F
0176 
0177 /* LPU_IRQ_BITS */
0178 #define LPU_IRQ_OVR     BIT(9)
0179 #define LPU_IRQ_IBSY        BIT(10)
0180 #define LPU_IRQ_ERR     BIT(11)
0181 #define LPU_IRQ_EOW     BIT(12)
0182 #define LPU_IRQ_PL0     BIT(13)
0183 
0184 /* LPU_STATUS_BITS */
0185 #define LPU_STATUS_AXIED(x) ((x) & 0xF)
0186 #define LPU_STATUS_AXIE     BIT(4)
0187 #define LPU_STATUS_AXIRP    BIT(5)
0188 #define LPU_STATUS_AXIWP    BIT(6)
0189 #define LPU_STATUS_FEMPTY   BIT(11)
0190 #define LPU_STATUS_FFULL    BIT(14)
0191 #define LPU_STATUS_ACE0     BIT(16)
0192 #define LPU_STATUS_ACE1     BIT(17)
0193 #define LPU_STATUS_ACE2     BIT(18)
0194 #define LPU_STATUS_ACE3     BIT(19)
0195 #define LPU_STATUS_ACTIVE   BIT(31)
0196 
0197 #define AXIEID_MASK     0xF
0198 #define AXIE_MASK       LPU_STATUS_AXIE
0199 #define AXIRP_MASK      LPU_STATUS_AXIRP
0200 #define AXIWP_MASK      LPU_STATUS_AXIWP
0201 
0202 #define FROM_AXIEID(reg)    ((reg) & AXIEID_MASK)
0203 #define TO_AXIE(x)      ((x) << 4)
0204 #define FROM_AXIRP(reg)     (((reg) & AXIRP_MASK) >> 5)
0205 #define FROM_AXIWP(reg)     (((reg) & AXIWP_MASK) >> 6)
0206 
0207 /* LPU_TBU_STATUS_BITS */
0208 #define LPU_TBU_STATUS_TCF  BIT(1)
0209 #define LPU_TBU_STATUS_TTNG BIT(2)
0210 #define LPU_TBU_STATUS_TITR BIT(8)
0211 #define LPU_TBU_STATUS_TEMR BIT(16)
0212 #define LPU_TBU_STATUS_TTF  BIT(31)
0213 
0214 /* LPU_TBU_CONTROL BITS */
0215 #define LPU_TBU_CTRL_TLBPEN BIT(16)
0216 
0217 /* CROSSBAR CONTROL BITS */
0218 #define CBU_INPUT_CTRL_EN   BIT(0)
0219 #define CBU_NUM_INPUT_IDS   5
0220 #define CBU_NUM_OUTPUT_IDS  5
0221 
0222 /* CU register */
0223 #define CU_BG_COLOR     0x0DC
0224 #define CU_INPUT0_SIZE      0x0E0
0225 #define CU_INPUT0_OFFSET    0x0E4
0226 #define CU_INPUT0_CONTROL   0x0E8
0227 #define CU_INPUT1_SIZE      0x0F0
0228 #define CU_INPUT1_OFFSET    0x0F4
0229 #define CU_INPUT1_CONTROL   0x0F8
0230 #define CU_INPUT2_SIZE      0x100
0231 #define CU_INPUT2_OFFSET    0x104
0232 #define CU_INPUT2_CONTROL   0x108
0233 #define CU_INPUT3_SIZE      0x110
0234 #define CU_INPUT3_OFFSET    0x114
0235 #define CU_INPUT3_CONTROL   0x118
0236 #define CU_INPUT4_SIZE      0x120
0237 #define CU_INPUT4_OFFSET    0x124
0238 #define CU_INPUT4_CONTROL   0x128
0239 
0240 #define CU_PER_INPUT_REGS   4
0241 
0242 #define CU_NUM_INPUT_IDS    5
0243 #define CU_NUM_OUTPUT_IDS   1
0244 
0245 /* CU control register bits */
0246 #define CU_CTRL_COPROC      BIT(0)
0247 
0248 /* CU_IRQ_BITS */
0249 #define CU_IRQ_OVR      BIT(9)
0250 #define CU_IRQ_ERR      BIT(11)
0251 
0252 /* CU_STATUS_BITS */
0253 #define CU_STATUS_CPE       BIT(0)
0254 #define CU_STATUS_ZME       BIT(1)
0255 #define CU_STATUS_CFGE      BIT(2)
0256 #define CU_STATUS_ACTIVE    BIT(31)
0257 
0258 /* CU input control register bits */
0259 #define CU_INPUT_CTRL_EN    BIT(0)
0260 #define CU_INPUT_CTRL_PAD   BIT(1)
0261 #define CU_INPUT_CTRL_PMUL  BIT(2)
0262 #define CU_INPUT_CTRL_ALPHA(x)  (((x) & 0xFF) << 8)
0263 
0264 /* DOU register */
0265 
0266 /* DOU_IRQ_BITS */
0267 #define DOU_IRQ_UND     BIT(8)
0268 #define DOU_IRQ_ERR     BIT(11)
0269 #define DOU_IRQ_PL0     BIT(13)
0270 #define DOU_IRQ_PL1     BIT(14)
0271 
0272 /* DOU_STATUS_BITS */
0273 #define DOU_STATUS_DRIFTTO  BIT(0)
0274 #define DOU_STATUS_FRAMETO  BIT(1)
0275 #define DOU_STATUS_TETO     BIT(2)
0276 #define DOU_STATUS_CSCE     BIT(8)
0277 #define DOU_STATUS_ACTIVE   BIT(31)
0278 
0279 /* Layer registers */
0280 #define LAYER_INFO      0x0C0
0281 #define LAYER_R_CONTROL     0x0D4
0282 #define LAYER_FMT       0x0D8
0283 #define LAYER_LT_COEFFTAB   0x0DC
0284 #define LAYER_PALPHA        0x0E4
0285 
0286 #define LAYER_YUV_RGB_COEFF0    0x130
0287 
0288 #define LAYER_AD_H_CROP     0x164
0289 #define LAYER_AD_V_CROP     0x168
0290 
0291 #define LAYER_RGB_RGB_COEFF0    0x170
0292 
0293 /* L_CONTROL_BITS */
0294 #define L_EN            BIT(0)
0295 #define L_IT            BIT(4)
0296 #define L_R2R           BIT(5)
0297 #define L_FT            BIT(6)
0298 #define L_ROT(x)        (((x) & 3) << 8)
0299 #define L_HFLIP         BIT(10)
0300 #define L_VFLIP         BIT(11)
0301 #define L_TBU_EN        BIT(16)
0302 #define L_A_RCACHE(x)       (((x) & 0xF) << 28)
0303 #define L_ROT_R0        0
0304 #define L_ROT_R90       1
0305 #define L_ROT_R180      2
0306 #define L_ROT_R270      3
0307 
0308 /* LAYER_R_CONTROL BITS */
0309 #define LR_CHI422_BILINEAR  0
0310 #define LR_CHI422_REPLICATION   1
0311 #define LR_CHI420_JPEG      (0 << 2)
0312 #define LR_CHI420_MPEG      (1 << 2)
0313 
0314 #define L_ITSEL(x)      ((x) & 0xFFF)
0315 #define L_FTSEL(x)      (((x) & 0xFFF) << 16)
0316 
0317 #define LAYER_PER_PLANE_REGS    4
0318 
0319 /* Layer_WR registers */
0320 #define LAYER_WR_PROG_LINE  0x0D4
0321 #define LAYER_WR_FORMAT     0x0D8
0322 
0323 /* Layer_WR control bits */
0324 #define LW_OFM          BIT(4)
0325 #define LW_LALPHA(x)        (((x) & 0xFF) << 8)
0326 #define LW_A_WCACHE(x)      (((x) & 0xF) << 28)
0327 #define LW_TBU_EN       BIT(16)
0328 
0329 #define AxCACHE_MASK        0xF0000000
0330 
0331 /* Layer AXI R/W cache setting */
0332 #define AxCACHE_B       BIT(0)  /* Bufferable */
0333 #define AxCACHE_M       BIT(1)  /* Modifiable */
0334 #define AxCACHE_RA      BIT(2)  /* Read-Allocate */
0335 #define AxCACHE_WA      BIT(3)  /* Write-Allocate */
0336 
0337 /* Layer info bits */
0338 #define L_INFO_RF       BIT(0)
0339 #define L_INFO_CM       BIT(1)
0340 #define L_INFO_ABUF_SIZE(x) (((x) >> 4) & 0x7)
0341 #define L_INFO_YUV_MAX_LINESZ(x)    (((x) >> 16) & 0xFFFF)
0342 
0343 /* Scaler registers */
0344 #define SC_COEFFTAB     0x0DC
0345 #define SC_OUT_SIZE     0x0E4
0346 #define SC_H_CROP       0x0E8
0347 #define SC_V_CROP       0x0EC
0348 #define SC_H_INIT_PH        0x0F0
0349 #define SC_H_DELTA_PH       0x0F4
0350 #define SC_V_INIT_PH        0x0F8
0351 #define SC_V_DELTA_PH       0x0FC
0352 #define SC_ENH_LIMITS       0x130
0353 #define SC_ENH_COEFF0       0x134
0354 
0355 #define SC_MAX_ENH_COEFF    9
0356 
0357 /* SC_CTRL_BITS */
0358 #define SC_CTRL_SCL     BIT(0)
0359 #define SC_CTRL_LS      BIT(1)
0360 #define SC_CTRL_AP      BIT(4)
0361 #define SC_CTRL_IENH        BIT(8)
0362 #define SC_CTRL_RGBSM       BIT(16)
0363 #define SC_CTRL_ASM     BIT(17)
0364 
0365 #define SC_VTSEL(vtal)      ((vtal) << 16)
0366 
0367 #define SC_NUM_INPUTS_IDS   1
0368 #define SC_NUM_OUTPUTS_IDS  1
0369 
0370 #define MG_NUM_INPUTS_IDS   2
0371 #define MG_NUM_OUTPUTS_IDS  1
0372 
0373 /* Merger registers */
0374 #define MG_INPUT_ID0        BLK_INPUT_ID0
0375 #define MG_INPUT_ID1        (MG_INPUT_ID0 + 4)
0376 #define MG_SIZE         BLK_SIZE
0377 
0378 /* Splitter registers */
0379 #define SP_OVERLAP_SIZE     0xD8
0380 
0381 /* Backend registers */
0382 #define BS_INFO         0x0C0
0383 #define BS_PROG_LINE        0x0D4
0384 #define BS_PREFETCH_LINE    0x0D8
0385 #define BS_BG_COLOR     0x0DC
0386 #define BS_ACTIVESIZE       0x0E0
0387 #define BS_HINTERVALS       0x0E4
0388 #define BS_VINTERVALS       0x0E8
0389 #define BS_SYNC         0x0EC
0390 #define BS_DRIFT_TO     0x100
0391 #define BS_FRAME_TO     0x104
0392 #define BS_TE_TO        0x108
0393 #define BS_T0_INTERVAL      0x110
0394 #define BS_T1_INTERVAL      0x114
0395 #define BS_T2_INTERVAL      0x118
0396 #define BS_CRC0_LOW     0x120
0397 #define BS_CRC0_HIGH        0x124
0398 #define BS_CRC1_LOW     0x128
0399 #define BS_CRC1_HIGH        0x12C
0400 #define BS_USER         0x130
0401 
0402 /* BS control register bits */
0403 #define BS_CTRL_EN      BIT(0)
0404 #define BS_CTRL_VM      BIT(1)
0405 #define BS_CTRL_BM      BIT(2)
0406 #define BS_CTRL_HMASK       BIT(4)
0407 #define BS_CTRL_VD      BIT(5)
0408 #define BS_CTRL_TE      BIT(8)
0409 #define BS_CTRL_TS      BIT(9)
0410 #define BS_CTRL_TM      BIT(12)
0411 #define BS_CTRL_DL      BIT(16)
0412 #define BS_CTRL_SBS     BIT(17)
0413 #define BS_CTRL_CRC     BIT(18)
0414 #define BS_CTRL_PM      BIT(20)
0415 
0416 /* BS active size/intervals */
0417 #define BS_H_INTVALS(hfp, hbp)  (((hfp) & 0xFFF) + (((hbp) & 0x3FF) << 16))
0418 #define BS_V_INTVALS(vfp, vbp)  (((vfp) & 0x3FFF) + (((vbp) & 0xFF) << 16))
0419 
0420 /* BS_SYNC bits */
0421 #define BS_SYNC_HSW(x)      ((x) & 0x3FF)
0422 #define BS_SYNC_HSP     BIT(12)
0423 #define BS_SYNC_VSW(x)      (((x) & 0xFF) << 16)
0424 #define BS_SYNC_VSP     BIT(28)
0425 
0426 #define BS_NUM_INPUT_IDS    0
0427 #define BS_NUM_OUTPUT_IDS   0
0428 
0429 /* Image process registers */
0430 #define IPS_DEPTH       0x0D8
0431 #define IPS_RGB_RGB_COEFF0  0x130
0432 #define IPS_RGB_YUV_COEFF0  0x170
0433 
0434 #define IPS_DEPTH_MARK      0xF
0435 
0436 /* IPS control register bits */
0437 #define IPS_CTRL_RGB        BIT(0)
0438 #define IPS_CTRL_FT     BIT(4)
0439 #define IPS_CTRL_YUV        BIT(8)
0440 #define IPS_CTRL_CHD422     BIT(9)
0441 #define IPS_CTRL_CHD420     BIT(10)
0442 #define IPS_CTRL_LPF        BIT(11)
0443 #define IPS_CTRL_DITH       BIT(12)
0444 #define IPS_CTRL_CLAMP      BIT(16)
0445 #define IPS_CTRL_SBS        BIT(17)
0446 
0447 /* IPS info register bits */
0448 #define IPS_INFO_CHD420     BIT(10)
0449 
0450 #define IPS_NUM_INPUT_IDS   2
0451 #define IPS_NUM_OUTPUT_IDS  1
0452 
0453 /* FT_COEFF block registers */
0454 #define FT_COEFF0       0x80
0455 #define GLB_IT_COEFF        0x80
0456 
0457 /* GLB_SC_COEFF registers */
0458 #define GLB_SC_COEFF_ADDR   0x0080
0459 #define GLB_SC_COEFF_DATA   0x0084
0460 #define GLB_LT_COEFF_DATA   0x0080
0461 
0462 #define GLB_SC_COEFF_MAX_NUM    1024
0463 #define GLB_LT_COEFF_NUM    65
0464 /* GLB_SC_ADDR */
0465 #define SC_COEFF_R_ADDR     BIT(18)
0466 #define SC_COEFF_G_ADDR     BIT(17)
0467 #define SC_COEFF_B_ADDR     BIT(16)
0468 
0469 #define SC_COEFF_DATA(x, y) (((y) & 0xFFFF) | (((x) & 0xFFFF) << 16))
0470 
0471 enum d71_blk_type {
0472     D71_BLK_TYPE_GCU        = 0x00,
0473     D71_BLK_TYPE_LPU        = 0x01,
0474     D71_BLK_TYPE_CU         = 0x02,
0475     D71_BLK_TYPE_DOU        = 0x03,
0476     D71_BLK_TYPE_AEU        = 0x04,
0477     D71_BLK_TYPE_GLB_LT_COEFF   = 0x05,
0478     D71_BLK_TYPE_GLB_SCL_COEFF  = 0x06, /* SH/SV scaler coeff */
0479     D71_BLK_TYPE_GLB_SC_COEFF   = 0x07,
0480     D71_BLK_TYPE_PERIPH     = 0x08,
0481     D71_BLK_TYPE_LPU_TRUSTED    = 0x09,
0482     D71_BLK_TYPE_AEU_TRUSTED    = 0x0A,
0483     D71_BLK_TYPE_LPU_LAYER      = 0x10,
0484     D71_BLK_TYPE_LPU_WB_LAYER   = 0x11,
0485     D71_BLK_TYPE_CU_SPLITTER    = 0x20,
0486     D71_BLK_TYPE_CU_SCALER      = 0x21,
0487     D71_BLK_TYPE_CU_MERGER      = 0x22,
0488     D71_BLK_TYPE_DOU_IPS        = 0x30,
0489     D71_BLK_TYPE_DOU_BS     = 0x31,
0490     D71_BLK_TYPE_DOU_FT_COEFF   = 0x32,
0491     D71_BLK_TYPE_AEU_DS     = 0x40,
0492     D71_BLK_TYPE_AEU_AES        = 0x41,
0493     D71_BLK_TYPE_RESERVED       = 0xFF
0494 };
0495 
0496 /* Constant of components */
0497 #define D71_MAX_PIPELINE        2
0498 #define D71_PIPELINE_MAX_SCALERS    2
0499 #define D71_PIPELINE_MAX_LAYERS     4
0500 
0501 #define D71_MAX_GLB_IT_COEFF        3
0502 #define D71_MAX_GLB_SCL_COEFF       4
0503 
0504 #define D71_MAX_LAYERS_PER_LPU      4
0505 #define D71_BLOCK_MAX_INPUT     9
0506 #define D71_BLOCK_MAX_OUTPUT        5
0507 #define D71_MAX_SC_PER_CU       2
0508 
0509 #define D71_BLOCK_OFFSET_PERIPH     0xFE00
0510 #define D71_BLOCK_SIZE          0x0200
0511 
0512 #define D71_DEFAULT_PREPRETCH_LINE  5
0513 #define D71_BUS_WIDTH_16_BYTES      16
0514 
0515 #define D71_SC_MAX_UPSCALING        64
0516 #define D71_SC_MAX_DOWNSCALING      6
0517 #define D71_SC_SPLIT_OVERLAP        8
0518 #define D71_SC_ENH_SPLIT_OVERLAP    1
0519 
0520 #define D71_MG_MIN_MERGED_SIZE      4
0521 #define D71_MG_MAX_MERGED_HSIZE     4032
0522 #define D71_MG_MAX_MERGED_VSIZE     4096
0523 
0524 #define D71_PALPHA_DEF_MAP      0xFFAA5500
0525 #define D71_LAYER_CONTROL_DEFAULT   0x30000000
0526 #define D71_WB_LAYER_CONTROL_DEFAULT    0x3000FF00
0527 #define D71_BS_CONTROL_DEFAULT      0x00000002
0528 
0529 struct block_header {
0530     u32 block_info;
0531     u32 pipeline_info;
0532     u32 input_ids[D71_BLOCK_MAX_INPUT];
0533     u32 output_ids[D71_BLOCK_MAX_OUTPUT];
0534 };
0535 
0536 static inline u32 get_block_type(struct block_header *blk)
0537 {
0538     return BLOCK_INFO_BLK_TYPE(blk->block_info);
0539 }
0540 
0541 #endif /* !_D71_REG_H_ */