Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*  $Id: aty128.h,v 1.1 1999/10/12 11:00:40 geert Exp $
0003  *  linux/drivers/video/aty128.h
0004  *  Register definitions for ATI Rage128 boards
0005  *
0006  *  Anthony Tong <atong@uiuc.edu>, 1999
0007  *  Brad Douglas <brad@neruo.com>, 2000
0008  */
0009 
0010 #ifndef REG_RAGE128_H
0011 #define REG_RAGE128_H
0012 
0013 #define CLOCK_CNTL_INDEX            0x0008
0014 #define CLOCK_CNTL_DATA             0x000c
0015 #define BIOS_0_SCRATCH              0x0010
0016 #define BUS_CNTL                0x0030
0017 #define BUS_CNTL1               0x0034
0018 #define GEN_INT_CNTL                0x0040
0019 #define CRTC_GEN_CNTL               0x0050
0020 #define CRTC_EXT_CNTL               0x0054
0021 #define DAC_CNTL                0x0058
0022 #define I2C_CNTL_1              0x0094
0023 #define PALETTE_INDEX               0x00b0
0024 #define PALETTE_DATA                0x00b4
0025 #define CNFG_CNTL               0x00e0
0026 #define GEN_RESET_CNTL              0x00f0
0027 #define CNFG_MEMSIZE                0x00f8
0028 #define MEM_CNTL                0x0140
0029 #define MEM_POWER_MISC              0x015c
0030 #define AGP_BASE                0x0170
0031 #define AGP_CNTL                0x0174
0032 #define AGP_APER_OFFSET             0x0178
0033 #define PCI_GART_PAGE               0x017c
0034 #define PC_NGUI_MODE                0x0180
0035 #define PC_NGUI_CTLSTAT             0x0184
0036 #define MPP_TB_CONFIG               0x01C0
0037 #define MPP_GP_CONFIG               0x01C8
0038 #define VIPH_CONTROL                0x01D0
0039 #define CRTC_H_TOTAL_DISP           0x0200
0040 #define CRTC_H_SYNC_STRT_WID            0x0204
0041 #define CRTC_V_TOTAL_DISP           0x0208
0042 #define CRTC_V_SYNC_STRT_WID            0x020c
0043 #define CRTC_VLINE_CRNT_VLINE           0x0210
0044 #define CRTC_CRNT_FRAME             0x0214
0045 #define CRTC_GUI_TRIG_VLINE         0x0218
0046 #define CRTC_OFFSET             0x0224
0047 #define CRTC_OFFSET_CNTL            0x0228
0048 #define CRTC_PITCH              0x022c
0049 #define OVR_CLR                 0x0230
0050 #define OVR_WID_LEFT_RIGHT          0x0234
0051 #define OVR_WID_TOP_BOTTOM          0x0238
0052 #define LVDS_GEN_CNTL               0x02d0
0053 #define DDA_CONFIG              0x02e0
0054 #define DDA_ON_OFF              0x02e4
0055 #define VGA_DDA_CONFIG              0x02e8
0056 #define VGA_DDA_ON_OFF              0x02ec
0057 #define CRTC2_H_TOTAL_DISP          0x0300
0058 #define CRTC2_H_SYNC_STRT_WID           0x0304
0059 #define CRTC2_V_TOTAL_DISP          0x0308
0060 #define CRTC2_V_SYNC_STRT_WID           0x030c
0061 #define CRTC2_VLINE_CRNT_VLINE          0x0310
0062 #define CRTC2_CRNT_FRAME            0x0314
0063 #define CRTC2_GUI_TRIG_VLINE            0x0318
0064 #define CRTC2_OFFSET                0x0324
0065 #define CRTC2_OFFSET_CNTL           0x0328
0066 #define CRTC2_PITCH             0x032c
0067 #define DDA2_CONFIG             0x03e0
0068 #define DDA2_ON_OFF             0x03e4
0069 #define CRTC2_GEN_CNTL              0x03f8
0070 #define CRTC2_STATUS                0x03fc
0071 #define OV0_SCALE_CNTL              0x0420
0072 #define SUBPIC_CNTL             0x0540
0073 #define PM4_BUFFER_OFFSET           0x0700
0074 #define PM4_BUFFER_CNTL             0x0704
0075 #define PM4_BUFFER_WM_CNTL          0x0708
0076 #define PM4_BUFFER_DL_RPTR_ADDR         0x070c
0077 #define PM4_BUFFER_DL_RPTR          0x0710
0078 #define PM4_BUFFER_DL_WPTR          0x0714
0079 #define PM4_VC_FPU_SETUP            0x071c
0080 #define PM4_FPU_CNTL                0x0720
0081 #define PM4_VC_FORMAT               0x0724
0082 #define PM4_VC_CNTL             0x0728
0083 #define PM4_VC_I01              0x072c
0084 #define PM4_VC_VLOFF                0x0730
0085 #define PM4_VC_VLSIZE               0x0734
0086 #define PM4_IW_INDOFF               0x0738
0087 #define PM4_IW_INDSIZE              0x073c
0088 #define PM4_FPU_FPX0                0x0740
0089 #define PM4_FPU_FPY0                0x0744
0090 #define PM4_FPU_FPX1                0x0748
0091 #define PM4_FPU_FPY1                0x074c
0092 #define PM4_FPU_FPX2                0x0750
0093 #define PM4_FPU_FPY2                0x0754
0094 #define PM4_FPU_FPY3                0x0758
0095 #define PM4_FPU_FPY4                0x075c
0096 #define PM4_FPU_FPY5                0x0760
0097 #define PM4_FPU_FPY6                0x0764
0098 #define PM4_FPU_FPR             0x0768
0099 #define PM4_FPU_FPG             0x076c
0100 #define PM4_FPU_FPB             0x0770
0101 #define PM4_FPU_FPA             0x0774
0102 #define PM4_FPU_INTXY0              0x0780
0103 #define PM4_FPU_INTXY1              0x0784
0104 #define PM4_FPU_INTXY2              0x0788
0105 #define PM4_FPU_INTARGB             0x078c
0106 #define PM4_FPU_FPTWICEAREA         0x0790
0107 #define PM4_FPU_DMAJOR01            0x0794
0108 #define PM4_FPU_DMAJOR12            0x0798
0109 #define PM4_FPU_DMAJOR02            0x079c
0110 #define PM4_FPU_STAT                0x07a0
0111 #define PM4_STAT                0x07b8
0112 #define PM4_TEST_CNTL               0x07d0
0113 #define PM4_MICROCODE_ADDR          0x07d4
0114 #define PM4_MICROCODE_RADDR         0x07d8
0115 #define PM4_MICROCODE_DATAH         0x07dc
0116 #define PM4_MICROCODE_DATAL         0x07e0
0117 #define PM4_CMDFIFO_ADDR            0x07e4
0118 #define PM4_CMDFIFO_DATAH           0x07e8
0119 #define PM4_CMDFIFO_DATAL           0x07ec
0120 #define PM4_BUFFER_ADDR             0x07f0
0121 #define PM4_BUFFER_DATAH            0x07f4
0122 #define PM4_BUFFER_DATAL            0x07f8
0123 #define PM4_MICRO_CNTL              0x07fc
0124 #define CAP0_TRIG_CNTL              0x0950
0125 #define CAP1_TRIG_CNTL              0x09c0
0126 
0127 /******************************************************************************
0128  *                  GUI Block Memory Mapped Registers                         *
0129  *                     These registers are FIFOed.                            *
0130  *****************************************************************************/
0131 #define PM4_FIFO_DATA_EVEN          0x1000
0132 #define PM4_FIFO_DATA_ODD           0x1004
0133 
0134 #define DST_OFFSET              0x1404
0135 #define DST_PITCH               0x1408
0136 #define DST_WIDTH               0x140c
0137 #define DST_HEIGHT              0x1410
0138 #define SRC_X                   0x1414
0139 #define SRC_Y                   0x1418
0140 #define DST_X                   0x141c
0141 #define DST_Y                   0x1420
0142 #define SRC_PITCH_OFFSET            0x1428
0143 #define DST_PITCH_OFFSET            0x142c
0144 #define SRC_Y_X                 0x1434
0145 #define DST_Y_X                 0x1438
0146 #define DST_HEIGHT_WIDTH            0x143c
0147 #define DP_GUI_MASTER_CNTL          0x146c
0148 #define BRUSH_SCALE             0x1470
0149 #define BRUSH_Y_X               0x1474
0150 #define DP_BRUSH_BKGD_CLR           0x1478
0151 #define DP_BRUSH_FRGD_CLR           0x147c
0152 #define DST_WIDTH_X             0x1588
0153 #define DST_HEIGHT_WIDTH_8          0x158c
0154 #define SRC_X_Y                 0x1590
0155 #define DST_X_Y                 0x1594
0156 #define DST_WIDTH_HEIGHT            0x1598
0157 #define DST_WIDTH_X_INCY            0x159c
0158 #define DST_HEIGHT_Y                0x15a0
0159 #define DST_X_SUB               0x15a4
0160 #define DST_Y_SUB               0x15a8
0161 #define SRC_OFFSET              0x15ac
0162 #define SRC_PITCH               0x15b0
0163 #define DST_HEIGHT_WIDTH_BW         0x15b4
0164 #define CLR_CMP_CNTL                0x15c0
0165 #define CLR_CMP_CLR_SRC             0x15c4
0166 #define CLR_CMP_CLR_DST             0x15c8
0167 #define CLR_CMP_MASK                0x15cc
0168 #define DP_SRC_FRGD_CLR             0x15d8
0169 #define DP_SRC_BKGD_CLR             0x15dc
0170 #define DST_BRES_ERR                0x1628
0171 #define DST_BRES_INC                0x162c
0172 #define DST_BRES_DEC                0x1630
0173 #define DST_BRES_LNTH               0x1634
0174 #define DST_BRES_LNTH_SUB           0x1638
0175 #define SC_LEFT                 0x1640
0176 #define SC_RIGHT                0x1644
0177 #define SC_TOP                  0x1648
0178 #define SC_BOTTOM               0x164c
0179 #define SRC_SC_RIGHT                0x1654
0180 #define SRC_SC_BOTTOM               0x165c
0181 #define GUI_DEBUG0              0x16a0
0182 #define GUI_DEBUG1              0x16a4
0183 #define GUI_TIMEOUT             0x16b0
0184 #define GUI_TIMEOUT0                0x16b4
0185 #define GUI_TIMEOUT1                0x16b8
0186 #define GUI_PROBE               0x16bc
0187 #define DP_CNTL                 0x16c0
0188 #define DP_DATATYPE             0x16c4
0189 #define DP_MIX                  0x16c8
0190 #define DP_WRITE_MASK               0x16cc
0191 #define DP_CNTL_XDIR_YDIR_YMAJOR        0x16d0
0192 #define DEFAULT_OFFSET              0x16e0
0193 #define DEFAULT_PITCH               0x16e4
0194 #define DEFAULT_SC_BOTTOM_RIGHT         0x16e8
0195 #define SC_TOP_LEFT             0x16ec
0196 #define SC_BOTTOM_RIGHT             0x16f0
0197 #define SRC_SC_BOTTOM_RIGHT         0x16f4
0198 #define WAIT_UNTIL              0x1720
0199 #define CACHE_CNTL              0x1724
0200 #define GUI_STAT                0x1740
0201 #define PC_GUI_MODE             0x1744
0202 #define PC_GUI_CTLSTAT              0x1748
0203 #define PC_DEBUG_MODE               0x1760
0204 #define BRES_DST_ERR_DEC            0x1780
0205 #define TRAIL_BRES_T12_ERR_DEC          0x1784
0206 #define TRAIL_BRES_T12_INC          0x1788
0207 #define DP_T12_CNTL             0x178c
0208 #define DST_BRES_T1_LNTH            0x1790
0209 #define DST_BRES_T2_LNTH            0x1794
0210 #define SCALE_SRC_HEIGHT_WIDTH          0x1994
0211 #define SCALE_OFFSET_0              0x1998
0212 #define SCALE_PITCH             0x199c
0213 #define SCALE_X_INC             0x19a0
0214 #define SCALE_Y_INC             0x19a4
0215 #define SCALE_HACC              0x19a8
0216 #define SCALE_VACC              0x19ac
0217 #define SCALE_DST_X_Y               0x19b0
0218 #define SCALE_DST_HEIGHT_WIDTH          0x19b4
0219 #define SCALE_3D_CNTL               0x1a00
0220 #define SCALE_3D_DATATYPE           0x1a20
0221 #define SETUP_CNTL              0x1bc4
0222 #define SOLID_COLOR             0x1bc8
0223 #define WINDOW_XY_OFFSET            0x1bcc
0224 #define DRAW_LINE_POINT             0x1bd0
0225 #define SETUP_CNTL_PM4              0x1bd4
0226 #define DST_PITCH_OFFSET_C          0x1c80
0227 #define DP_GUI_MASTER_CNTL_C            0x1c84
0228 #define SC_TOP_LEFT_C               0x1c88
0229 #define SC_BOTTOM_RIGHT_C           0x1c8c
0230 
0231 #define CLR_CMP_MASK_3D             0x1A28
0232 #define MISC_3D_STATE_CNTL_REG          0x1CA0
0233 #define MC_SRC1_CNTL                0x19D8
0234 #define TEX_CNTL                0x1800
0235 
0236 /* CONSTANTS */
0237 #define GUI_ACTIVE              0x80000000
0238 #define ENGINE_IDLE             0x0
0239 
0240 #define PLL_WR_EN               0x00000080
0241 
0242 #define CLK_PIN_CNTL                0x0001
0243 #define PPLL_CNTL               0x0002
0244 #define PPLL_REF_DIV                0x0003
0245 #define PPLL_DIV_0              0x0004
0246 #define PPLL_DIV_1              0x0005
0247 #define PPLL_DIV_2              0x0006
0248 #define PPLL_DIV_3              0x0007
0249 #define VCLK_ECP_CNTL               0x0008
0250 #define HTOTAL_CNTL             0x0009
0251 #define X_MPLL_REF_FB_DIV           0x000a
0252 #define XPLL_CNTL               0x000b
0253 #define XDLL_CNTL               0x000c
0254 #define XCLK_CNTL               0x000d
0255 #define MPLL_CNTL               0x000e
0256 #define MCLK_CNTL               0x000f
0257 #define AGP_PLL_CNTL                0x0010
0258 #define FCP_CNTL                0x0012
0259 #define PLL_TEST_CNTL               0x0013
0260 #define P2PLL_CNTL              0x002a
0261 #define P2PLL_REF_DIV               0x002b
0262 #define P2PLL_DIV_0             0x002b
0263 #define POWER_MANAGEMENT            0x002f
0264 
0265 #define PPLL_RESET              0x01
0266 #define PPLL_ATOMIC_UPDATE_EN           0x10000
0267 #define PPLL_VGA_ATOMIC_UPDATE_EN       0x20000
0268 #define PPLL_REF_DIV_MASK           0x3FF
0269 #define PPLL_FB3_DIV_MASK           0x7FF
0270 #define PPLL_POST3_DIV_MASK         0x70000
0271 #define PPLL_ATOMIC_UPDATE_R            0x8000
0272 #define PPLL_ATOMIC_UPDATE_W            0x8000
0273 #define MEM_CFG_TYPE_MASK           0x3
0274 #define XCLK_SRC_SEL_MASK           0x7
0275 #define XPLL_FB_DIV_MASK            0xFF00
0276 #define X_MPLL_REF_DIV_MASK         0xFF
0277 
0278 /* CRTC control values (CRTC_GEN_CNTL) */
0279 #define CRTC_CSYNC_EN               0x00000010
0280 
0281 #define CRTC2_DBL_SCAN_EN           0x00000001
0282 #define CRTC2_DISPLAY_DIS           0x00800000
0283 #define CRTC2_FIFO_EXTSENSE         0x00200000
0284 #define CRTC2_ICON_EN               0x00100000
0285 #define CRTC2_CUR_EN                0x00010000
0286 #define CRTC2_EN                0x02000000
0287 #define CRTC2_DISP_REQ_EN_B         0x04000000
0288 
0289 #define CRTC_PIX_WIDTH_MASK         0x00000700
0290 #define CRTC_PIX_WIDTH_4BPP         0x00000100
0291 #define CRTC_PIX_WIDTH_8BPP         0x00000200
0292 #define CRTC_PIX_WIDTH_15BPP            0x00000300
0293 #define CRTC_PIX_WIDTH_16BPP            0x00000400
0294 #define CRTC_PIX_WIDTH_24BPP            0x00000500
0295 #define CRTC_PIX_WIDTH_32BPP            0x00000600
0296 
0297 /* DAC_CNTL bit constants */
0298 #define DAC_8BIT_EN             0x00000100
0299 #define DAC_MASK                0xFF000000
0300 #define DAC_BLANKING                0x00000004
0301 #define DAC_RANGE_CNTL              0x00000003
0302 #define DAC_CLK_SEL             0x00000010
0303 #define DAC_PALETTE_ACCESS_CNTL         0x00000020
0304 #define DAC_PALETTE2_SNOOP_EN           0x00000040
0305 #define DAC_PDWN                0x00008000
0306 
0307 /* CRTC_EXT_CNTL */
0308 #define CRT_CRTC_ON             0x00008000
0309 
0310 /* GEN_RESET_CNTL bit constants */
0311 #define SOFT_RESET_GUI              0x00000001
0312 #define SOFT_RESET_VCLK             0x00000100
0313 #define SOFT_RESET_PCLK             0x00000200
0314 #define SOFT_RESET_ECP              0x00000400
0315 #define SOFT_RESET_DISPENG_XCLK         0x00000800
0316 
0317 /* PC_GUI_CTLSTAT bit constants */
0318 #define PC_BUSY_INIT                0x10000000
0319 #define PC_BUSY_GUI             0x20000000
0320 #define PC_BUSY_NGUI                0x40000000
0321 #define PC_BUSY                 0x80000000
0322 
0323 #define BUS_MASTER_DIS              0x00000040
0324 #define PM4_BUFFER_CNTL_NONPM4          0x00000000
0325 
0326 /* DP_DATATYPE bit constants */
0327 #define DST_8BPP                0x00000002
0328 #define DST_15BPP               0x00000003
0329 #define DST_16BPP               0x00000004
0330 #define DST_24BPP               0x00000005
0331 #define DST_32BPP               0x00000006
0332 
0333 #define BRUSH_SOLIDCOLOR            0x00000d00
0334 
0335 /* DP_GUI_MASTER_CNTL bit constants */
0336 #define GMC_SRC_PITCH_OFFSET_DEFAULT        0x00000000
0337 #define GMC_DST_PITCH_OFFSET_DEFAULT        0x00000000
0338 #define GMC_SRC_CLIP_DEFAULT            0x00000000
0339 #define GMC_DST_CLIP_DEFAULT            0x00000000
0340 #define GMC_BRUSH_SOLIDCOLOR            0x000000d0
0341 #define GMC_SRC_DSTCOLOR            0x00003000
0342 #define GMC_BYTE_ORDER_MSB_TO_LSB       0x00000000
0343 #define GMC_DP_SRC_RECT             0x02000000
0344 #define GMC_3D_FCN_EN_CLR           0x00000000
0345 #define GMC_AUX_CLIP_CLEAR          0x20000000
0346 #define GMC_DST_CLR_CMP_FCN_CLEAR       0x10000000
0347 #define GMC_WRITE_MASK_SET          0x40000000
0348 #define GMC_DP_CONVERSION_TEMP_6500     0x00000000
0349 
0350 /* DP_GUI_MASTER_CNTL ROP3 named constants */
0351 #define ROP3_PATCOPY                0x00f00000
0352 #define ROP3_SRCCOPY                0x00cc0000
0353 
0354 #define SRC_DSTCOLOR                0x00030000
0355 
0356 /* DP_CNTL bit constants */
0357 #define DST_X_RIGHT_TO_LEFT         0x00000000
0358 #define DST_X_LEFT_TO_RIGHT         0x00000001
0359 #define DST_Y_BOTTOM_TO_TOP         0x00000000
0360 #define DST_Y_TOP_TO_BOTTOM         0x00000002
0361 #define DST_X_MAJOR             0x00000000
0362 #define DST_Y_MAJOR             0x00000004
0363 #define DST_X_TILE              0x00000008
0364 #define DST_Y_TILE              0x00000010
0365 #define DST_LAST_PEL                0x00000020
0366 #define DST_TRAIL_X_RIGHT_TO_LEFT       0x00000000
0367 #define DST_TRAIL_X_LEFT_TO_RIGHT       0x00000040
0368 #define DST_TRAP_FILL_RIGHT_TO_LEFT     0x00000000
0369 #define DST_TRAP_FILL_LEFT_TO_RIGHT     0x00000080
0370 #define DST_BRES_SIGN               0x00000100
0371 #define DST_HOST_BIG_ENDIAN_EN          0x00000200
0372 #define DST_POLYLINE_NONLAST            0x00008000
0373 #define DST_RASTER_STALL            0x00010000
0374 #define DST_POLY_EDGE               0x00040000
0375 
0376 /* DP_MIX bit constants */
0377 #define DP_SRC_RECT             0x00000200
0378 #define DP_SRC_HOST             0x00000300
0379 #define DP_SRC_HOST_BYTEALIGN           0x00000400
0380 
0381 /* LVDS_GEN_CNTL constants */
0382 #define LVDS_BL_MOD_LEVEL_MASK          0x0000ff00
0383 #define LVDS_BL_MOD_LEVEL_SHIFT         8
0384 #define LVDS_BL_MOD_EN              0x00010000
0385 #define LVDS_DIGION             0x00040000
0386 #define LVDS_BLON               0x00080000
0387 #define LVDS_ON                 0x00000001
0388 #define LVDS_DISPLAY_DIS            0x00000002
0389 #define LVDS_PANEL_TYPE_2PIX_PER_CLK        0x00000004
0390 #define LVDS_PANEL_24BITS_TFT           0x00000008
0391 #define LVDS_FRAME_MOD_NO           0x00000000
0392 #define LVDS_FRAME_MOD_2_LEVELS         0x00000010
0393 #define LVDS_FRAME_MOD_4_LEVELS         0x00000020
0394 #define LVDS_RST_FM             0x00000040
0395 #define LVDS_EN                 0x00000080
0396 
0397 /* CRTC2_GEN_CNTL constants */
0398 #define CRTC2_EN                0x02000000
0399 
0400 /* POWER_MANAGEMENT constants */
0401 #define PWR_MGT_ON              0x00000001
0402 #define PWR_MGT_MODE_MASK           0x00000006
0403 #define PWR_MGT_MODE_PIN            0x00000000
0404 #define PWR_MGT_MODE_REGISTER           0x00000002
0405 #define PWR_MGT_MODE_TIMER          0x00000004
0406 #define PWR_MGT_MODE_PCI            0x00000006
0407 #define PWR_MGT_AUTO_PWR_UP_EN          0x00000008
0408 #define PWR_MGT_ACTIVITY_PIN_ON         0x00000010
0409 #define PWR_MGT_STANDBY_POL         0x00000020
0410 #define PWR_MGT_SUSPEND_POL         0x00000040
0411 #define PWR_MGT_SELF_REFRESH            0x00000080
0412 #define PWR_MGT_ACTIVITY_PIN_EN         0x00000100
0413 #define PWR_MGT_KEYBD_SNOOP         0x00000200
0414 #define PWR_MGT_TRISTATE_MEM_EN         0x00000800
0415 #define PWR_MGT_SELW4MS             0x00001000
0416 #define PWR_MGT_SLOWDOWN_MCLK           0x00002000
0417 
0418 #define PMI_PMSCR_REG               0x60
0419 
0420 /* used by ATI bug fix for hardware ROM */
0421 #define RAGE128_MPP_TB_CONFIG                   0x01c0
0422 
0423 #endif              /* REG_RAGE128_H */