Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * linux/drivers/video/w100fb.h
0004  *
0005  * Frame Buffer Device for ATI w100 (Wallaby)
0006  *
0007  * Copyright (C) 2002, ATI Corp.
0008  * Copyright (C) 2004-2005 Richard Purdie
0009  * Copyright (c) 2005 Ian Molton <spyro@f2s.com>
0010  *
0011  * Modified to work with 2.6 by Richard Purdie <rpurdie@rpsys.net>
0012  *
0013  * w32xx support by Ian Molton
0014  */
0015 
0016 #if !defined (_W100FB_H)
0017 #define _W100FB_H
0018 
0019 /* Block CIF Start: */
0020 #define mmCHIP_ID           0x0000
0021 #define mmREVISION_ID       0x0004
0022 #define mmWRAP_BUF_A        0x0008
0023 #define mmWRAP_BUF_B        0x000C
0024 #define mmWRAP_TOP_DIR      0x0010
0025 #define mmWRAP_START_DIR    0x0014
0026 #define mmCIF_CNTL          0x0018
0027 #define mmCFGREG_BASE       0x001C
0028 #define mmCIF_IO            0x0020
0029 #define mmCIF_READ_DBG      0x0024
0030 #define mmCIF_WRITE_DBG     0x0028
0031 #define cfgIND_ADDR_A_0     0x0000
0032 #define cfgIND_ADDR_A_1     0x0001
0033 #define cfgIND_ADDR_A_2     0x0002
0034 #define cfgIND_DATA_A       0x0003
0035 #define cfgREG_BASE         0x0004
0036 #define cfgINTF_CNTL        0x0005
0037 #define cfgSTATUS           0x0006
0038 #define cfgCPU_DEFAULTS     0x0007
0039 #define cfgIND_ADDR_B_0     0x0008
0040 #define cfgIND_ADDR_B_1     0x0009
0041 #define cfgIND_ADDR_B_2     0x000A
0042 #define cfgIND_DATA_B       0x000B
0043 #define cfgPM4_RPTR         0x000C
0044 #define cfgSCRATCH          0x000D
0045 #define cfgPM4_WRPTR_0      0x000E
0046 #define cfgPM4_WRPTR_1      0x000F
0047 /* Block CIF End: */
0048 
0049 /* Block CP Start: */
0050 #define mmSCRATCH_UMSK      0x0280
0051 #define mmSCRATCH_ADDR      0x0284
0052 #define mmGEN_INT_CNTL      0x0200
0053 #define mmGEN_INT_STATUS    0x0204
0054 /* Block CP End: */
0055 
0056 /* Block DISPLAY Start: */
0057 #define mmLCD_FORMAT        0x0410
0058 #define mmGRAPHIC_CTRL      0x0414
0059 #define mmGRAPHIC_OFFSET    0x0418
0060 #define mmGRAPHIC_PITCH     0x041C
0061 #define mmCRTC_TOTAL        0x0420
0062 #define mmACTIVE_H_DISP     0x0424
0063 #define mmACTIVE_V_DISP     0x0428
0064 #define mmGRAPHIC_H_DISP    0x042C
0065 #define mmGRAPHIC_V_DISP    0x0430
0066 #define mmVIDEO_CTRL        0x0434
0067 #define mmGRAPHIC_KEY       0x0438
0068 #define mmBRIGHTNESS_CNTL   0x045C
0069 #define mmDISP_INT_CNTL     0x0488
0070 #define mmCRTC_SS           0x048C
0071 #define mmCRTC_LS           0x0490
0072 #define mmCRTC_REV          0x0494
0073 #define mmCRTC_DCLK         0x049C
0074 #define mmCRTC_GS           0x04A0
0075 #define mmCRTC_VPOS_GS      0x04A4
0076 #define mmCRTC_GCLK         0x04A8
0077 #define mmCRTC_GOE          0x04AC
0078 #define mmCRTC_FRAME        0x04B0
0079 #define mmCRTC_FRAME_VPOS   0x04B4
0080 #define mmGPIO_DATA         0x04B8
0081 #define mmGPIO_CNTL1        0x04BC
0082 #define mmGPIO_CNTL2        0x04C0
0083 #define mmLCDD_CNTL1        0x04C4
0084 #define mmLCDD_CNTL2        0x04C8
0085 #define mmGENLCD_CNTL1      0x04CC
0086 #define mmGENLCD_CNTL2      0x04D0
0087 #define mmDISP_DEBUG        0x04D4
0088 #define mmDISP_DB_BUF_CNTL  0x04D8
0089 #define mmDISP_CRC_SIG      0x04DC
0090 #define mmCRTC_DEFAULT_COUNT    0x04E0
0091 #define mmLCD_BACKGROUND_COLOR  0x04E4
0092 #define mmCRTC_PS2          0x04E8
0093 #define mmCRTC_PS2_VPOS     0x04EC
0094 #define mmCRTC_PS1_ACTIVE   0x04F0
0095 #define mmCRTC_PS1_NACTIVE  0x04F4
0096 #define mmCRTC_GCLK_EXT     0x04F8
0097 #define mmCRTC_ALW          0x04FC
0098 #define mmCRTC_ALW_VPOS     0x0500
0099 #define mmCRTC_PSK          0x0504
0100 #define mmCRTC_PSK_HPOS     0x0508
0101 #define mmCRTC_CV4_START    0x050C
0102 #define mmCRTC_CV4_END      0x0510
0103 #define mmCRTC_CV4_HPOS     0x0514
0104 #define mmCRTC_ECK          0x051C
0105 #define mmREFRESH_CNTL      0x0520
0106 #define mmGENLCD_CNTL3      0x0524
0107 #define mmGPIO_DATA2        0x0528
0108 #define mmGPIO_CNTL3        0x052C
0109 #define mmGPIO_CNTL4        0x0530
0110 #define mmCHIP_STRAP        0x0534
0111 #define mmDISP_DEBUG2       0x0538
0112 #define mmDEBUG_BUS_CNTL    0x053C
0113 #define mmGAMMA_VALUE1      0x0540
0114 #define mmGAMMA_VALUE2      0x0544
0115 #define mmGAMMA_SLOPE       0x0548
0116 #define mmGEN_STATUS        0x054C
0117 #define mmHW_INT            0x0550
0118 /* Block DISPLAY End: */
0119 
0120 /* Block GFX Start: */
0121 #define mmDST_OFFSET          0x1004
0122 #define mmDST_PITCH           0x1008
0123 #define mmDST_Y_X             0x1038
0124 #define mmDST_WIDTH_HEIGHT    0x1198
0125 #define mmDP_GUI_MASTER_CNTL  0x106C
0126 #define mmBRUSH_OFFSET        0x108C
0127 #define mmBRUSH_Y_X           0x1074
0128 #define mmDP_BRUSH_FRGD_CLR   0x107C
0129 #define mmSRC_OFFSET          0x11AC
0130 #define mmSRC_PITCH           0x11B0
0131 #define mmSRC_Y_X             0x1034
0132 #define mmDEFAULT_PITCH_OFFSET      0x10A0
0133 #define mmDEFAULT_SC_BOTTOM_RIGHT   0x10A8
0134 #define mmDEFAULT2_SC_BOTTOM_RIGHT  0x10AC
0135 #define mmSC_TOP_LEFT         0x11BC
0136 #define mmSC_BOTTOM_RIGHT     0x11C0
0137 #define mmSRC_SC_BOTTOM_RIGHT 0x11C4
0138 #define mmGLOBAL_ALPHA        0x1210
0139 #define mmFILTER_COEF         0x1214
0140 #define mmMVC_CNTL_START      0x11E0
0141 #define mmE2_ARITHMETIC_CNTL  0x1220
0142 #define mmDP_CNTL             0x11C8
0143 #define mmDP_CNTL_DST_DIR     0x11CC
0144 #define mmDP_DATATYPE         0x12C4
0145 #define mmDP_MIX              0x12C8
0146 #define mmDP_WRITE_MSK        0x12CC
0147 #define mmENG_CNTL            0x13E8
0148 #define mmENG_PERF_CNT        0x13F0
0149 /* Block GFX End: */
0150 
0151 /* Block IDCT Start: */
0152 #define mmIDCT_RUNS         0x0C00
0153 #define mmIDCT_LEVELS       0x0C04
0154 #define mmIDCT_CONTROL      0x0C3C
0155 #define mmIDCT_AUTH_CONTROL 0x0C08
0156 #define mmIDCT_AUTH         0x0C0C
0157 /* Block IDCT End: */
0158 
0159 /* Block MC Start: */
0160 #define mmMEM_CNTL             0x0180
0161 #define mmMEM_ARB              0x0184
0162 #define mmMC_FB_LOCATION       0x0188
0163 #define mmMEM_EXT_CNTL         0x018C
0164 #define mmMC_EXT_MEM_LOCATION  0x0190
0165 #define mmMEM_EXT_TIMING_CNTL  0x0194
0166 #define mmMEM_SDRAM_MODE_REG   0x0198
0167 #define mmMEM_IO_CNTL          0x019C
0168 #define mmMC_DEBUG             0x01A0
0169 #define mmMC_BIST_CTRL         0x01A4
0170 #define mmMC_BIST_COLLAR_READ  0x01A8
0171 #define mmTC_MISMATCH          0x01AC
0172 #define mmMC_PERF_MON_CNTL     0x01B0
0173 #define mmMC_PERF_COUNTERS     0x01B4
0174 /* Block MC End: */
0175 
0176 /* Block BM Start: */
0177 #define mmBM_EXT_MEM_BANDWIDTH    0x0A00
0178 #define mmBM_OFFSET               0x0A04
0179 #define mmBM_MEM_EXT_TIMING_CNTL  0x0A08
0180 #define mmBM_MEM_EXT_CNTL         0x0A0C
0181 #define mmBM_MEM_MODE_REG         0x0A10
0182 #define mmBM_MEM_IO_CNTL          0x0A18
0183 #define mmBM_CONFIG               0x0A1C
0184 #define mmBM_STATUS               0x0A20
0185 #define mmBM_DEBUG                0x0A24
0186 #define mmBM_PERF_MON_CNTL        0x0A28
0187 #define mmBM_PERF_COUNTERS        0x0A2C
0188 #define mmBM_PERF2_MON_CNTL       0x0A30
0189 #define mmBM_PERF2_COUNTERS       0x0A34
0190 /* Block BM End: */
0191 
0192 /* Block RBBM Start: */
0193 #define mmWAIT_UNTIL        0x1400
0194 #define mmISYNC_CNTL        0x1404
0195 #define mmRBBM_STATUS       0x0140
0196 #define mmRBBM_CNTL         0x0144
0197 #define mmNQWAIT_UNTIL      0x0150
0198 /* Block RBBM End: */
0199 
0200 /* Block CG Start: */
0201 #define mmCLK_PIN_CNTL      0x0080
0202 #define mmPLL_REF_FB_DIV    0x0084
0203 #define mmPLL_CNTL          0x0088
0204 #define mmSCLK_CNTL         0x008C
0205 #define mmPCLK_CNTL         0x0090
0206 #define mmCLK_TEST_CNTL     0x0094
0207 #define mmPWRMGT_CNTL       0x0098
0208 #define mmPWRMGT_STATUS     0x009C
0209 /* Block CG End: */
0210 
0211 /* default value definitions */
0212 #define defWRAP_TOP_DIR        0x00000000
0213 #define defWRAP_START_DIR      0x00000000
0214 #define defCFGREG_BASE         0x00000000
0215 #define defCIF_IO              0x000C0902
0216 #define defINTF_CNTL           0x00000011
0217 #define defCPU_DEFAULTS        0x00000006
0218 #define defHW_INT              0x00000000
0219 #define defMC_EXT_MEM_LOCATION 0x07ff0000
0220 #define defTC_MISMATCH         0x00000000
0221 
0222 #define W100_CFG_BASE          0x0
0223 #define W100_CFG_LEN           0x10
0224 #define W100_REG_BASE          0x10000
0225 #define W100_REG_LEN           0x2000
0226 #define MEM_INT_BASE_VALUE     0x100000
0227 #define MEM_EXT_BASE_VALUE     0x800000
0228 #define MEM_INT_SIZE           0x05ffff
0229 #define MEM_WINDOW_BASE        0x100000
0230 #define MEM_WINDOW_SIZE        0xf00000
0231 
0232 #define WRAP_BUF_BASE_VALUE    0x80000
0233 #define WRAP_BUF_TOP_VALUE     0xbffff
0234 
0235 #define CHIP_ID_W100           0x57411002
0236 #define CHIP_ID_W3200          0x56441002
0237 #define CHIP_ID_W3220          0x57441002
0238 
0239 /* Register structure definitions */
0240 
0241 struct wrap_top_dir_t {
0242     u32 top_addr  : 23;
0243     u32           : 9;
0244 } __attribute__((packed));
0245 
0246 union wrap_top_dir_u {
0247     u32 val : 32;
0248     struct wrap_top_dir_t f;
0249 } __attribute__((packed));
0250 
0251 struct wrap_start_dir_t {
0252     u32 start_addr : 23;
0253     u32            : 9;
0254 } __attribute__((packed));
0255 
0256 union wrap_start_dir_u {
0257     u32 val : 32;
0258     struct wrap_start_dir_t f;
0259 } __attribute__((packed));
0260 
0261 struct cif_cntl_t {
0262     u32 swap_reg                 : 2;
0263     u32 swap_fbuf_1              : 2;
0264     u32 swap_fbuf_2              : 2;
0265     u32 swap_fbuf_3              : 2;
0266     u32 pmi_int_disable          : 1;
0267     u32 pmi_schmen_disable       : 1;
0268     u32 intb_oe                  : 1;
0269     u32 en_wait_to_compensate_dq_prop_dly  : 1;
0270     u32 compensate_wait_rd_size  : 2;
0271     u32 wait_asserted_timeout_val  : 2;
0272     u32 wait_masked_val          : 2;
0273     u32 en_wait_timeout          : 1;
0274     u32 en_one_clk_setup_before_wait  : 1;
0275     u32 interrupt_active_high    : 1;
0276     u32 en_overwrite_straps      : 1;
0277     u32 strap_wait_active_hi     : 1;
0278     u32 lat_busy_count           : 2;
0279     u32 lat_rd_pm4_sclk_busy     : 1;
0280     u32 dis_system_bits          : 1;
0281     u32 dis_mr                   : 1;
0282     u32 cif_spare_1              : 4;
0283 } __attribute__((packed));
0284 
0285 union cif_cntl_u {
0286     u32 val : 32;
0287     struct cif_cntl_t f;
0288 } __attribute__((packed));
0289 
0290 struct cfgreg_base_t {
0291     u32 cfgreg_base  : 24;
0292     u32              : 8;
0293 } __attribute__((packed));
0294 
0295 union cfgreg_base_u {
0296     u32 val : 32;
0297     struct cfgreg_base_t f;
0298 } __attribute__((packed));
0299 
0300 struct cif_io_t {
0301     u32 dq_srp     : 1;
0302     u32 dq_srn     : 1;
0303     u32 dq_sp      : 4;
0304     u32 dq_sn      : 4;
0305     u32 waitb_srp  : 1;
0306     u32 waitb_srn  : 1;
0307     u32 waitb_sp   : 4;
0308     u32 waitb_sn   : 4;
0309     u32 intb_srp   : 1;
0310     u32 intb_srn   : 1;
0311     u32 intb_sp    : 4;
0312     u32 intb_sn    : 4;
0313     u32            : 2;
0314 } __attribute__((packed));
0315 
0316 union cif_io_u {
0317     u32 val : 32;
0318     struct cif_io_t f;
0319 } __attribute__((packed));
0320 
0321 struct cif_read_dbg_t {
0322     u32 unpacker_pre_fetch_trig_gen  : 2;
0323     u32 dly_second_rd_fetch_trig     : 1;
0324     u32 rst_rd_burst_id              : 1;
0325     u32 dis_rd_burst_id              : 1;
0326     u32 en_block_rd_when_packer_is_not_emp : 1;
0327     u32 dis_pre_fetch_cntl_sm        : 1;
0328     u32 rbbm_chrncy_dis              : 1;
0329     u32 rbbm_rd_after_wr_lat         : 2;
0330     u32 dis_be_during_rd             : 1;
0331     u32 one_clk_invalidate_pulse     : 1;
0332     u32 dis_chnl_priority            : 1;
0333     u32 rst_read_path_a_pls          : 1;
0334     u32 rst_read_path_b_pls          : 1;
0335     u32 dis_reg_rd_fetch_trig        : 1;
0336     u32 dis_rd_fetch_trig_from_ind_addr : 1;
0337     u32 dis_rd_same_byte_to_trig_fetch : 1;
0338     u32 dis_dir_wrap                 : 1;
0339     u32 dis_ring_buf_to_force_dec    : 1;
0340     u32 dis_addr_comp_in_16bit       : 1;
0341     u32 clr_w                        : 1;
0342     u32 err_rd_tag_is_3              : 1;
0343     u32 err_load_when_ful_a          : 1;
0344     u32 err_load_when_ful_b          : 1;
0345     u32                              : 7;
0346 } __attribute__((packed));
0347 
0348 union cif_read_dbg_u {
0349     u32 val : 32;
0350     struct cif_read_dbg_t f;
0351 } __attribute__((packed));
0352 
0353 struct cif_write_dbg_t {
0354     u32 packer_timeout_count          : 2;
0355     u32 en_upper_load_cond            : 1;
0356     u32 en_chnl_change_cond           : 1;
0357     u32 dis_addr_comp_cond            : 1;
0358     u32 dis_load_same_byte_addr_cond  : 1;
0359     u32 dis_timeout_cond              : 1;
0360     u32 dis_timeout_during_rbbm       : 1;
0361     u32 dis_packer_ful_during_rbbm_timeout : 1;
0362     u32 en_dword_split_to_rbbm        : 1;
0363     u32 en_dummy_val                  : 1;
0364     u32 dummy_val_sel                 : 1;
0365     u32 mask_pm4_wrptr_dec            : 1;
0366     u32 dis_mc_clean_cond             : 1;
0367     u32 err_two_reqi_during_ful       : 1;
0368     u32 err_reqi_during_idle_clk      : 1;
0369     u32 err_global                    : 1;
0370     u32 en_wr_buf_dbg_load            : 1;
0371     u32 en_wr_buf_dbg_path            : 1;
0372     u32 sel_wr_buf_byte               : 3;
0373     u32 dis_rd_flush_wr               : 1;
0374     u32 dis_packer_ful_cond           : 1;
0375     u32 dis_invalidate_by_ops_chnl    : 1;
0376     u32 en_halt_when_reqi_err         : 1;
0377     u32 cif_spare_2                   : 5;
0378     u32                               : 1;
0379 } __attribute__((packed));
0380 
0381 union cif_write_dbg_u {
0382     u32 val : 32;
0383     struct cif_write_dbg_t f;
0384 } __attribute__((packed));
0385 
0386 
0387 struct intf_cntl_t {
0388     unsigned char ad_inc_a            : 1;
0389     unsigned char ring_buf_a          : 1;
0390     unsigned char rd_fetch_trigger_a  : 1;
0391     unsigned char rd_data_rdy_a       : 1;
0392     unsigned char ad_inc_b            : 1;
0393     unsigned char ring_buf_b          : 1;
0394     unsigned char rd_fetch_trigger_b  : 1;
0395     unsigned char rd_data_rdy_b       : 1;
0396 } __attribute__((packed));
0397 
0398 union intf_cntl_u {
0399     unsigned char val : 8;
0400     struct intf_cntl_t f;
0401 } __attribute__((packed));
0402 
0403 struct cpu_defaults_t {
0404     unsigned char unpack_rd_data     : 1;
0405     unsigned char access_ind_addr_a  : 1;
0406     unsigned char access_ind_addr_b  : 1;
0407     unsigned char access_scratch_reg : 1;
0408     unsigned char pack_wr_data       : 1;
0409     unsigned char transition_size    : 1;
0410     unsigned char en_read_buf_mode   : 1;
0411     unsigned char rd_fetch_scratch   : 1;
0412 } __attribute__((packed));
0413 
0414 union cpu_defaults_u {
0415     unsigned char val : 8;
0416     struct cpu_defaults_t f;
0417 } __attribute__((packed));
0418 
0419 struct crtc_total_t {
0420     u32 crtc_h_total : 10;
0421     u32              : 6;
0422     u32 crtc_v_total : 10;
0423     u32              : 6;
0424 } __attribute__((packed));
0425 
0426 union crtc_total_u {
0427     u32 val : 32;
0428     struct crtc_total_t f;
0429 } __attribute__((packed));
0430 
0431 struct crtc_ss_t {
0432     u32 ss_start    : 10;
0433     u32             : 6;
0434     u32 ss_end      : 10;
0435     u32             : 2;
0436     u32 ss_align    : 1;
0437     u32 ss_pol      : 1;
0438     u32 ss_run_mode : 1;
0439     u32 ss_en       : 1;
0440 } __attribute__((packed));
0441 
0442 union crtc_ss_u {
0443     u32 val : 32;
0444     struct crtc_ss_t f;
0445 } __attribute__((packed));
0446 
0447 struct active_h_disp_t {
0448     u32 active_h_start  : 10;
0449     u32                 : 6;
0450     u32 active_h_end    : 10;
0451     u32                 : 6;
0452 } __attribute__((packed));
0453 
0454 union active_h_disp_u {
0455     u32 val : 32;
0456     struct active_h_disp_t f;
0457 } __attribute__((packed));
0458 
0459 struct active_v_disp_t {
0460     u32 active_v_start  : 10;
0461     u32                 : 6;
0462     u32 active_v_end    : 10;
0463     u32                 : 6;
0464 } __attribute__((packed));
0465 
0466 union active_v_disp_u {
0467     u32 val : 32;
0468     struct active_v_disp_t f;
0469 } __attribute__((packed));
0470 
0471 struct graphic_h_disp_t {
0472     u32 graphic_h_start : 10;
0473     u32                 : 6;
0474     u32 graphic_h_end   : 10;
0475     u32                 : 6;
0476 } __attribute__((packed));
0477 
0478 union graphic_h_disp_u {
0479     u32 val : 32;
0480     struct graphic_h_disp_t f;
0481 } __attribute__((packed));
0482 
0483 struct graphic_v_disp_t {
0484     u32 graphic_v_start : 10;
0485     u32                 : 6;
0486     u32 graphic_v_end   : 10;
0487     u32                 : 6;
0488 } __attribute__((packed));
0489 
0490 union graphic_v_disp_u{
0491     u32 val : 32;
0492     struct graphic_v_disp_t f;
0493 } __attribute__((packed));
0494 
0495 struct graphic_ctrl_t_w100 {
0496     u32 color_depth       : 3;
0497     u32 portrait_mode     : 2;
0498     u32 low_power_on      : 1;
0499     u32 req_freq          : 4;
0500     u32 en_crtc           : 1;
0501     u32 en_graphic_req    : 1;
0502     u32 en_graphic_crtc   : 1;
0503     u32 total_req_graphic : 9;
0504     u32 lcd_pclk_on       : 1;
0505     u32 lcd_sclk_on       : 1;
0506     u32 pclk_running      : 1;
0507     u32 sclk_running      : 1;
0508     u32                   : 6;
0509 } __attribute__((packed));
0510 
0511 struct graphic_ctrl_t_w32xx {
0512     u32 color_depth       : 3;
0513     u32 portrait_mode     : 2;
0514     u32 low_power_on      : 1;
0515     u32 req_freq          : 4;
0516     u32 en_crtc           : 1;
0517     u32 en_graphic_req    : 1;
0518     u32 en_graphic_crtc   : 1;
0519     u32 total_req_graphic : 10;
0520     u32 lcd_pclk_on       : 1;
0521     u32 lcd_sclk_on       : 1;
0522     u32 pclk_running      : 1;
0523     u32 sclk_running      : 1;
0524     u32                   : 5;
0525 } __attribute__((packed));
0526 
0527 union graphic_ctrl_u {
0528     u32 val : 32;
0529     struct graphic_ctrl_t_w100 f_w100;
0530     struct graphic_ctrl_t_w32xx f_w32xx;
0531 } __attribute__((packed));
0532 
0533 struct video_ctrl_t {
0534     u32 video_mode       : 1;
0535     u32 keyer_en         : 1;
0536     u32 en_video_req     : 1;
0537     u32 en_graphic_req_video  : 1;
0538     u32 en_video_crtc    : 1;
0539     u32 video_hor_exp    : 2;
0540     u32 video_ver_exp    : 2;
0541     u32 uv_combine       : 1;
0542     u32 total_req_video  : 9;
0543     u32 video_ch_sel     : 1;
0544     u32 video_portrait   : 2;
0545     u32 yuv2rgb_en       : 1;
0546     u32 yuv2rgb_option   : 1;
0547     u32 video_inv_hor    : 1;
0548     u32 video_inv_ver    : 1;
0549     u32 gamma_sel        : 2;
0550     u32 dis_limit        : 1;
0551     u32 en_uv_hblend     : 1;
0552     u32 rgb_gamma_sel    : 2;
0553 } __attribute__((packed));
0554 
0555 union video_ctrl_u {
0556     u32 val : 32;
0557     struct video_ctrl_t f;
0558 } __attribute__((packed));
0559 
0560 struct disp_db_buf_cntl_rd_t {
0561     u32 en_db_buf           : 1;
0562     u32 update_db_buf_done  : 1;
0563     u32 db_buf_cntl         : 6;
0564     u32                     : 24;
0565 } __attribute__((packed));
0566 
0567 union disp_db_buf_cntl_rd_u {
0568     u32 val : 32;
0569     struct disp_db_buf_cntl_rd_t f;
0570 } __attribute__((packed));
0571 
0572 struct disp_db_buf_cntl_wr_t {
0573     u32 en_db_buf      : 1;
0574     u32 update_db_buf  : 1;
0575     u32 db_buf_cntl    : 6;
0576     u32                : 24;
0577 } __attribute__((packed));
0578 
0579 union disp_db_buf_cntl_wr_u {
0580     u32 val : 32;
0581     struct disp_db_buf_cntl_wr_t f;
0582 } __attribute__((packed));
0583 
0584 struct gamma_value1_t {
0585     u32 gamma1   : 8;
0586     u32 gamma2   : 8;
0587     u32 gamma3   : 8;
0588     u32 gamma4   : 8;
0589 } __attribute__((packed));
0590 
0591 union gamma_value1_u {
0592     u32 val : 32;
0593     struct gamma_value1_t f;
0594 } __attribute__((packed));
0595 
0596 struct gamma_value2_t {
0597     u32 gamma5   : 8;
0598     u32 gamma6   : 8;
0599     u32 gamma7   : 8;
0600     u32 gamma8   : 8;
0601 } __attribute__((packed));
0602 
0603 union gamma_value2_u {
0604     u32 val : 32;
0605     struct gamma_value2_t f;
0606 } __attribute__((packed));
0607 
0608 struct gamma_slope_t {
0609     u32 slope1   : 3;
0610     u32 slope2   : 3;
0611     u32 slope3   : 3;
0612     u32 slope4   : 3;
0613     u32 slope5   : 3;
0614     u32 slope6   : 3;
0615     u32 slope7   : 3;
0616     u32 slope8   : 3;
0617     u32          : 8;
0618 } __attribute__((packed));
0619 
0620 union gamma_slope_u {
0621     u32 val : 32;
0622     struct gamma_slope_t f;
0623 } __attribute__((packed));
0624 
0625 struct mc_ext_mem_location_t {
0626     u32 mc_ext_mem_start : 16;
0627     u32 mc_ext_mem_top   : 16;
0628 } __attribute__((packed));
0629 
0630 union mc_ext_mem_location_u {
0631     u32 val : 32;
0632     struct mc_ext_mem_location_t f;
0633 } __attribute__((packed));
0634 
0635 struct mc_fb_location_t {
0636     u32 mc_fb_start      : 16;
0637     u32 mc_fb_top        : 16;
0638 } __attribute__((packed));
0639 
0640 union mc_fb_location_u {
0641     u32 val : 32;
0642     struct mc_fb_location_t f;
0643 } __attribute__((packed));
0644 
0645 struct clk_pin_cntl_t {
0646     u32 osc_en           : 1;
0647     u32 osc_gain         : 5;
0648     u32 dont_use_xtalin  : 1;
0649     u32 xtalin_pm_en     : 1;
0650     u32 xtalin_dbl_en    : 1;
0651     u32                  : 7;
0652     u32 cg_debug         : 16;
0653 } __attribute__((packed));
0654 
0655 union clk_pin_cntl_u {
0656     u32 val : 32;
0657     struct clk_pin_cntl_t f;
0658 } __attribute__((packed));
0659 
0660 struct pll_ref_fb_div_t {
0661     u32 pll_ref_div      : 4;
0662     u32                  : 4;
0663     u32 pll_fb_div_int   : 6;
0664     u32                  : 2;
0665     u32 pll_fb_div_frac  : 3;
0666     u32                  : 1;
0667     u32 pll_reset_time   : 4;
0668     u32 pll_lock_time    : 8;
0669 } __attribute__((packed));
0670 
0671 union pll_ref_fb_div_u {
0672     u32 val : 32;
0673     struct pll_ref_fb_div_t f;
0674 } __attribute__((packed));
0675 
0676 struct pll_cntl_t {
0677     u32 pll_pwdn        : 1;
0678     u32 pll_reset       : 1;
0679     u32 pll_pm_en       : 1;
0680     u32 pll_mode        : 1;
0681     u32 pll_refclk_sel  : 1;
0682     u32 pll_fbclk_sel   : 1;
0683     u32 pll_tcpoff      : 1;
0684     u32 pll_pcp         : 3;
0685     u32 pll_pvg         : 3;
0686     u32 pll_vcofr       : 1;
0687     u32 pll_ioffset     : 2;
0688     u32 pll_pecc_mode   : 2;
0689     u32 pll_pecc_scon   : 2;
0690     u32 pll_dactal      : 4;
0691     u32 pll_cp_clip     : 2;
0692     u32 pll_conf        : 3;
0693     u32 pll_mbctrl      : 2;
0694     u32 pll_ring_off    : 1;
0695 } __attribute__((packed));
0696 
0697 union pll_cntl_u {
0698     u32 val : 32;
0699     struct pll_cntl_t f;
0700 } __attribute__((packed));
0701 
0702 struct sclk_cntl_t {
0703     u32 sclk_src_sel         : 2;
0704     u32                      : 2;
0705     u32 sclk_post_div_fast   : 4;
0706     u32 sclk_clkon_hys       : 3;
0707     u32 sclk_post_div_slow   : 4;
0708     u32 disp_cg_ok2switch_en : 1;
0709     u32 sclk_force_reg       : 1;
0710     u32 sclk_force_disp      : 1;
0711     u32 sclk_force_mc        : 1;
0712     u32 sclk_force_extmc     : 1;
0713     u32 sclk_force_cp        : 1;
0714     u32 sclk_force_e2        : 1;
0715     u32 sclk_force_e3        : 1;
0716     u32 sclk_force_idct      : 1;
0717     u32 sclk_force_bist      : 1;
0718     u32 busy_extend_cp       : 1;
0719     u32 busy_extend_e2       : 1;
0720     u32 busy_extend_e3       : 1;
0721     u32 busy_extend_idct     : 1;
0722     u32                      : 3;
0723 } __attribute__((packed));
0724 
0725 union sclk_cntl_u {
0726     u32 val : 32;
0727     struct sclk_cntl_t f;
0728 } __attribute__((packed));
0729 
0730 struct pclk_cntl_t {
0731     u32 pclk_src_sel     : 2;
0732     u32                  : 2;
0733     u32 pclk_post_div    : 4;
0734     u32                  : 8;
0735     u32 pclk_force_disp  : 1;
0736     u32                  : 15;
0737 } __attribute__((packed));
0738 
0739 union pclk_cntl_u {
0740     u32 val : 32;
0741     struct pclk_cntl_t f;
0742 } __attribute__((packed));
0743 
0744 
0745 #define TESTCLK_SRC_PLL   0x01
0746 #define TESTCLK_SRC_SCLK  0x02
0747 #define TESTCLK_SRC_PCLK  0x03
0748 /* 4 and 5 seem to by XTAL/M */
0749 #define TESTCLK_SRC_XTAL  0x06
0750 
0751 struct clk_test_cntl_t {
0752     u32 testclk_sel      : 4;
0753     u32                  : 3;
0754     u32 start_check_freq : 1;
0755     u32 tstcount_rst     : 1;
0756     u32                  : 15;
0757     u32 test_count       : 8;
0758 } __attribute__((packed));
0759 
0760 union clk_test_cntl_u {
0761     u32 val : 32;
0762     struct clk_test_cntl_t f;
0763 } __attribute__((packed));
0764 
0765 struct pwrmgt_cntl_t {
0766     u32 pwm_enable           : 1;
0767     u32                      : 1;
0768     u32 pwm_mode_req         : 2;
0769     u32 pwm_wakeup_cond      : 2;
0770     u32 pwm_fast_noml_hw_en  : 1;
0771     u32 pwm_noml_fast_hw_en  : 1;
0772     u32 pwm_fast_noml_cond   : 4;
0773     u32 pwm_noml_fast_cond   : 4;
0774     u32 pwm_idle_timer       : 8;
0775     u32 pwm_busy_timer       : 8;
0776 } __attribute__((packed));
0777 
0778 union pwrmgt_cntl_u {
0779     u32 val : 32;
0780     struct pwrmgt_cntl_t f;
0781 } __attribute__((packed));
0782 
0783 #define SRC_DATATYPE_EQU_DST    3
0784 
0785 #define ROP3_SRCCOPY    0xcc
0786 #define ROP3_PATCOPY    0xf0
0787 
0788 #define GMC_BRUSH_SOLID_COLOR   13
0789 #define GMC_BRUSH_NONE          15
0790 
0791 #define DP_SRC_MEM_RECTANGULAR  2
0792 
0793 #define DP_OP_ROP   0
0794 
0795 struct dp_gui_master_cntl_t {
0796     u32 gmc_src_pitch_offset_cntl : 1;
0797     u32 gmc_dst_pitch_offset_cntl : 1;
0798     u32 gmc_src_clipping          : 1;
0799     u32 gmc_dst_clipping          : 1;
0800     u32 gmc_brush_datatype        : 4;
0801     u32 gmc_dst_datatype          : 4;
0802     u32 gmc_src_datatype          : 3;
0803     u32 gmc_byte_pix_order        : 1;
0804     u32 gmc_default_sel           : 1;
0805     u32 gmc_rop3                  : 8;
0806     u32 gmc_dp_src_source         : 3;
0807     u32 gmc_clr_cmp_fcn_dis       : 1;
0808     u32                           : 1;
0809     u32 gmc_wr_msk_dis            : 1;
0810     u32 gmc_dp_op                 : 1;
0811 } __attribute__((packed));
0812 
0813 union dp_gui_master_cntl_u {
0814     u32 val : 32;
0815     struct dp_gui_master_cntl_t f;
0816 } __attribute__((packed));
0817 
0818 struct rbbm_status_t {
0819     u32 cmdfifo_avail   : 7;
0820     u32                 : 1;
0821     u32 hirq_on_rbb     : 1;
0822     u32 cprq_on_rbb     : 1;
0823     u32 cfrq_on_rbb     : 1;
0824     u32 hirq_in_rtbuf   : 1;
0825     u32 cprq_in_rtbuf   : 1;
0826     u32 cfrq_in_rtbuf   : 1;
0827     u32 cf_pipe_busy    : 1;
0828     u32 eng_ev_busy     : 1;
0829     u32 cp_cmdstrm_busy : 1;
0830     u32 e2_busy         : 1;
0831     u32 rb2d_busy       : 1;
0832     u32 rb3d_busy       : 1;
0833     u32 se_busy         : 1;
0834     u32 re_busy         : 1;
0835     u32 tam_busy        : 1;
0836     u32 tdm_busy        : 1;
0837     u32 pb_busy         : 1;
0838     u32                 : 6;
0839     u32 gui_active      : 1;
0840 } __attribute__((packed));
0841 
0842 union rbbm_status_u {
0843     u32 val : 32;
0844     struct rbbm_status_t f;
0845 } __attribute__((packed));
0846 
0847 struct dp_datatype_t {
0848     u32 dp_dst_datatype   : 4;
0849     u32                   : 4;
0850     u32 dp_brush_datatype : 4;
0851     u32 dp_src2_type      : 1;
0852     u32 dp_src2_datatype  : 3;
0853     u32 dp_src_datatype   : 3;
0854     u32                   : 11;
0855     u32 dp_byte_pix_order : 1;
0856     u32                   : 1;
0857 } __attribute__((packed));
0858 
0859 union dp_datatype_u {
0860     u32 val : 32;
0861     struct dp_datatype_t f;
0862 } __attribute__((packed));
0863 
0864 struct dp_mix_t {
0865     u32                : 8;
0866     u32 dp_src_source  : 3;
0867     u32 dp_src2_source : 3;
0868     u32                : 2;
0869     u32 dp_rop3        : 8;
0870     u32 dp_op          : 1;
0871     u32                : 7;
0872 } __attribute__((packed));
0873 
0874 union dp_mix_u {
0875     u32 val : 32;
0876     struct dp_mix_t f;
0877 } __attribute__((packed));
0878 
0879 struct eng_cntl_t {
0880     u32 erc_reg_rd_ws            : 1;
0881     u32 erc_reg_wr_ws            : 1;
0882     u32 erc_idle_reg_wr          : 1;
0883     u32 dis_engine_triggers      : 1;
0884     u32 dis_rop_src_uses_dst_w_h : 1;
0885     u32 dis_src_uses_dst_dirmaj  : 1;
0886     u32                          : 6;
0887     u32 force_3dclk_when_2dclk   : 1;
0888     u32                          : 19;
0889 } __attribute__((packed));
0890 
0891 union eng_cntl_u {
0892     u32 val : 32;
0893     struct eng_cntl_t f;
0894 } __attribute__((packed));
0895 
0896 struct dp_cntl_t {
0897     u32 dst_x_dir   : 1;
0898     u32 dst_y_dir   : 1;
0899     u32 src_x_dir   : 1;
0900     u32 src_y_dir   : 1;
0901     u32 dst_major_x : 1;
0902     u32 src_major_x : 1;
0903     u32             : 26;
0904 } __attribute__((packed));
0905 
0906 union dp_cntl_u {
0907     u32 val : 32;
0908     struct dp_cntl_t f;
0909 } __attribute__((packed));
0910 
0911 struct dp_cntl_dst_dir_t {
0912     u32           : 15;
0913     u32 dst_y_dir : 1;
0914     u32           : 15;
0915     u32 dst_x_dir : 1;
0916 } __attribute__((packed));
0917 
0918 union dp_cntl_dst_dir_u {
0919     u32 val : 32;
0920     struct dp_cntl_dst_dir_t f;
0921 } __attribute__((packed));
0922 
0923 #endif
0924