linux/include/video/mach64.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * ATI Mach64 Register Definitions
 *
 * Copyright (C) 1997 Michael AK Tesch
 *  written with much help from Jon Howell
 *
 * Updated for 3D RAGE PRO and 3D RAGE Mobility by Geert Uytterhoeven
 */

/*
 * most of the rest of this file comes from ATI sample code
 */
#ifndef REGMACH64_H
#define REGMACH64_H

/* NON-GUI MEMORY MAPPED Registers - expressed in BYTE offsets */

/* Accelerator CRTC */
#define CRTC_H_TOTAL_DISP
#define CRTC2_H_TOTAL_DISP
#define CRTC_H_SYNC_STRT_WID
#define CRTC2_H_SYNC_STRT_WID
#define CRTC_H_SYNC_STRT
#define CRTC2_H_SYNC_STRT
#define CRTC_H_SYNC_DLY
#define CRTC2_H_SYNC_DLY
#define CRTC_H_SYNC_WID
#define CRTC2_H_SYNC_WID
#define CRTC_V_TOTAL_DISP
#define CRTC2_V_TOTAL_DISP
#define CRTC_V_TOTAL
#define CRTC2_V_TOTAL
#define CRTC_V_DISP
#define CRTC2_V_DISP
#define CRTC_V_SYNC_STRT_WID
#define CRTC2_V_SYNC_STRT_WID
#define CRTC_V_SYNC_STRT
#define CRTC2_V_SYNC_STRT
#define CRTC_V_SYNC_WID
#define CRTC2_V_SYNC_WID
#define CRTC_VLINE_CRNT_VLINE
#define CRTC2_VLINE_CRNT_VLINE
#define CRTC_OFF_PITCH
#define CRTC_OFFSET
#define CRTC_PITCH
#define CRTC_INT_CNTL
#define CRTC_GEN_CNTL
#define CRTC_PIX_WIDTH
#define CRTC_FIFO
#define CRTC_EXT_DISP

/* Memory Buffer Control */
#define DSP_CONFIG
#define PM_DSP_CONFIG
#define DSP_ON_OFF
#define PM_DSP_ON_OFF
#define TIMER_CONFIG
#define MEM_BUF_CNTL
#define MEM_ADDR_CONFIG

/* Accelerator CRTC */
#define CRT_TRAP

#define I2C_CNTL_0

#define DSTN_CONTROL_LG

/* Overscan */
#define OVR_CLR
#define OVR2_CLR
#define OVR_WID_LEFT_RIGHT
#define OVR2_WID_LEFT_RIGHT
#define OVR_WID_TOP_BOTTOM
#define OVR2_WID_TOP_BOTTOM

/* Memory Buffer Control */
#define VGA_DSP_CONFIG
#define PM_VGA_DSP_CONFIG
#define VGA_DSP_ON_OFF
#define PM_VGA_DSP_ON_OFF
#define DSP2_CONFIG
#define PM_DSP2_CONFIG
#define DSP2_ON_OFF
#define PM_DSP2_ON_OFF

/* Accelerator CRTC */
#define CRTC2_OFF_PITCH

/* Hardware Cursor */
#define CUR_CLR0
#define CUR2_CLR0
#define CUR_CLR1
#define CUR2_CLR1
#define CUR_OFFSET
#define CUR2_OFFSET
#define CUR_HORZ_VERT_POSN
#define CUR2_HORZ_VERT_POSN
#define CUR_HORZ_VERT_OFF
#define CUR2_HORZ_VERT_OFF

#define CNFG_PANEL_LG

/* General I/O Control */
#define GP_IO

/* Test and Debug */
#define HW_DEBUG

/* Scratch Pad and Test */
#define SCRATCH_REG0
#define SCRATCH_REG1
#define SCRATCH_REG2
#define SCRATCH_REG3

/* Clock Control */
#define CLOCK_CNTL
/* CLOCK_CNTL register constants CT LAYOUT */
#define CLOCK_SEL
#define CLOCK_SEL_INTERNAL
#define CLOCK_SEL_EXTERNAL
#define CLOCK_DIV
#define CLOCK_DIV1
#define CLOCK_DIV2
#define CLOCK_DIV4
#define CLOCK_STROBE
/*  ?					0x80 */
/* CLOCK_CNTL register constants GX LAYOUT */
#define CLOCK_BIT
#define CLOCK_PULSE
/*#define CLOCK_STROBE			0x40 dito as CT */
#define CLOCK_DATA

/* For internal PLL(CT) start */
#define CLOCK_CNTL_ADDR
#define PLL_WR_EN
#define PLL_ADDR
#define CLOCK_CNTL_DATA
#define PLL_DATA
/* For internal PLL(CT) end */

#define CLOCK_SEL_CNTL

/* Configuration */
#define CNFG_STAT1
#define CNFG_STAT2

/* Bus Control */
#define BUS_CNTL

#define LCD_INDEX
#define LCD_DATA

#define HFB_PITCH_ADDR_LG

/* Memory Control */
#define EXT_MEM_CNTL
#define MEM_CNTL
#define MEM_VGA_WP_SEL
#define MEM_VGA_RP_SEL

#define I2C_CNTL_1

#define LT_GIO_LG

/* DAC Control */
#define DAC_REGS
#define DAC_W_INDEX
#define DAC_DATA
#define DAC_MASK
#define DAC_R_INDEX
#define DAC_CNTL

#define EXT_DAC_REGS

#define HORZ_STRETCHING_LG
#define VERT_STRETCHING_LG

/* Test and Debug */
#define GEN_TEST_CNTL

/* Custom Macros */
#define CUSTOM_MACRO_CNTL

#define LCD_GEN_CNTL_LG
#define POWER_MANAGEMENT_LG

/* Configuration */
#define CNFG_CNTL
#define CNFG_CHIP_ID
#define CNFG_STAT0

/* Test and Debug */
#define CRC_SIG
#define CRC2_SIG


/* GUI MEMORY MAPPED Registers */

/* Draw Engine Destination Trajectory */
#define DST_OFF_PITCH
#define DST_X
#define DST_Y
#define DST_Y_X
#define DST_WIDTH
#define DST_HEIGHT
#define DST_HEIGHT_WIDTH
#define DST_X_WIDTH
#define DST_BRES_LNTH
#define DST_BRES_ERR
#define DST_BRES_INC
#define DST_BRES_DEC
#define DST_CNTL
#define DST_Y_X__ALIAS__
#define TRAIL_BRES_ERR
#define TRAIL_BRES_INC
#define TRAIL_BRES_DEC
#define LEAD_BRES_LNTH
#define Z_OFF_PITCH
#define Z_CNTL
#define ALPHA_TST_CNTL
#define SECONDARY_STW_EXP
#define SECONDARY_S_X_INC
#define SECONDARY_S_Y_INC
#define SECONDARY_S_START
#define SECONDARY_W_X_INC
#define SECONDARY_W_Y_INC
#define SECONDARY_W_START
#define SECONDARY_T_X_INC
#define SECONDARY_T_Y_INC
#define SECONDARY_T_START

/* Draw Engine Source Trajectory */
#define SRC_OFF_PITCH
#define SRC_X
#define SRC_Y
#define SRC_Y_X
#define SRC_WIDTH1
#define SRC_HEIGHT1
#define SRC_HEIGHT1_WIDTH1
#define SRC_X_START
#define SRC_Y_START
#define SRC_Y_X_START
#define SRC_WIDTH2
#define SRC_HEIGHT2
#define SRC_HEIGHT2_WIDTH2
#define SRC_CNTL

#define SCALE_OFF
#define SECONDARY_SCALE_OFF

#define TEX_0_OFF
#define TEX_1_OFF
#define TEX_2_OFF
#define TEX_3_OFF
#define TEX_4_OFF
#define TEX_5_OFF
#define TEX_6_OFF
#define TEX_7_OFF

#define SCALE_WIDTH
#define SCALE_HEIGHT

#define TEX_8_OFF
#define TEX_9_OFF
#define TEX_10_OFF
#define S_Y_INC

#define SCALE_PITCH
#define SCALE_X_INC

#define RED_X_INC
#define GREEN_X_INC

#define SCALE_Y_INC
#define SCALE_VACC
#define SCALE_3D_CNTL

/* Host Data */
#define HOST_DATA0
#define HOST_DATA1
#define HOST_DATA2
#define HOST_DATA3
#define HOST_DATA4
#define HOST_DATA5
#define HOST_DATA6
#define HOST_DATA7
#define HOST_DATA8
#define HOST_DATA9
#define HOST_DATAA
#define HOST_DATAB
#define HOST_DATAC
#define HOST_DATAD
#define HOST_DATAE
#define HOST_DATAF
#define HOST_CNTL

/* GUI Bus Mastering */
#define BM_HOSTDATA
#define BM_ADDR
#define BM_DATA
#define BM_GUI_TABLE_CMD

/* Pattern */
#define PAT_REG0
#define PAT_REG1
#define PAT_CNTL

/* Scissors */
#define SC_LEFT
#define SC_RIGHT
#define SC_LEFT_RIGHT
#define SC_TOP
#define SC_BOTTOM
#define SC_TOP_BOTTOM

/* Data Path */
#define USR1_DST_OFF_PITCH
#define USR2_DST_OFF_PITCH
#define DP_BKGD_CLR
#define DP_FOG_CLR
#define DP_FRGD_CLR
#define DP_WRITE_MASK
#define DP_CHAIN_MASK
#define DP_PIX_WIDTH
#define DP_MIX
#define DP_SRC
#define DP_FRGD_CLR_MIX
#define DP_FRGD_BKGD_CLR

/* Draw Engine Destination Trajectory */
#define DST_X_Y
#define DST_WIDTH_HEIGHT

/* Data Path */
#define USR_DST_PICTH
#define DP_SET_GUI_ENGINE2
#define DP_SET_GUI_ENGINE

/* Color Compare */
#define CLR_CMP_CLR
#define CLR_CMP_MASK
#define CLR_CMP_CNTL

/* Command FIFO */
#define FIFO_STAT

#define CONTEXT_MASK
#define CONTEXT_LOAD_CNTL

/* Engine Control */
#define GUI_TRAJ_CNTL

/* Engine Status/FIFO */
#define GUI_STAT

#define TEX_PALETTE_INDEX
#define STW_EXP
#define LOG_MAX_INC
#define S_X_INC
#define S_Y_INC__ALIAS__

#define SCALE_PITCH__ALIAS__

#define S_START
#define W_X_INC
#define W_Y_INC
#define W_START
#define T_X_INC
#define T_Y_INC

#define SECONDARY_SCALE_PITCH

#define T_START
#define TEX_SIZE_PITCH
#define TEX_CNTL
#define SECONDARY_TEX_OFFSET
#define TEX_PALETTE

#define SCALE_PITCH_BOTH
#define SECONDARY_SCALE_OFF_ACC
#define SCALE_OFF_ACC
#define SCALE_DST_Y_X

/* Draw Engine Destination Trajectory */
#define COMPOSITE_SHADOW_ID

#define SECONDARY_SCALE_X_INC

#define SPECULAR_RED_X_INC
#define SPECULAR_RED_Y_INC
#define SPECULAR_RED_START

#define SECONDARY_SCALE_HACC

#define SPECULAR_GREEN_X_INC
#define SPECULAR_GREEN_Y_INC
#define SPECULAR_GREEN_START
#define SPECULAR_BLUE_X_INC
#define SPECULAR_BLUE_Y_INC
#define SPECULAR_BLUE_START

#define SCALE_X_INC__ALIAS__

#define RED_X_INC__ALIAS__
#define RED_Y_INC
#define RED_START

#define SCALE_HACC
#define SCALE_Y_INC__ALIAS__

#define GREEN_X_INC__ALIAS__
#define GREEN_Y_INC

#define SECONDARY_SCALE_Y_INC
#define SECONDARY_SCALE_VACC

#define GREEN_START
#define BLUE_X_INC
#define BLUE_Y_INC
#define BLUE_START
#define Z_X_INC
#define Z_Y_INC
#define Z_START
#define ALPHA_X_INC
#define FOG_X_INC
#define ALPHA_Y_INC
#define FOG_Y_INC
#define ALPHA_START
#define FOG_START

#define OVERLAY_Y_X_START
#define OVERLAY_Y_X_END
#define OVERLAY_VIDEO_KEY_CLR
#define OVERLAY_VIDEO_KEY_MSK
#define OVERLAY_GRAPHICS_KEY_CLR
#define OVERLAY_GRAPHICS_KEY_MSK
#define OVERLAY_KEY_CNTL

#define OVERLAY_SCALE_INC
#define OVERLAY_SCALE_CNTL
#define SCALER_HEIGHT_WIDTH
#define SCALER_TEST
#define SCALER_BUF0_OFFSET
#define SCALER_BUF1_OFFSET
#define SCALE_BUF_PITCH

#define CAPTURE_START_END
#define CAPTURE_X_WIDTH
#define VIDEO_FORMAT
#define VBI_START_END
#define CAPTURE_CONFIG
#define TRIG_CNTL

#define OVERLAY_EXCLUSIVE_HORZ
#define OVERLAY_EXCLUSIVE_VERT

#define VAL_WIDTH
#define CAPTURE_DEBUG
#define VIDEO_SYNC_TEST

/* GenLocking */
#define SNAPSHOT_VH_COUNTS
#define SNAPSHOT_F_COUNT
#define N_VIF_COUNT
#define SNAPSHOT_VIF_COUNT

#define CAPTURE_BUF0_OFFSET
#define CAPTURE_BUF1_OFFSET
#define CAPTURE_BUF_PITCH

/* GenLocking */
#define SNAPSHOT2_VH_COUNTS
#define SNAPSHOT2_F_COUNT
#define N_VIF2_COUNT
#define SNAPSHOT2_VIF_COUNT

#define MPP_CONFIG
#define MPP_STROBE_SEQ
#define MPP_ADDR
#define MPP_DATA
#define TVO_CNTL

/* Test and Debug */
#define CRT_HORZ_VERT_LOAD

/* AGP */
#define AGP_BASE
#define AGP_CNTL

#define SCALER_COLOUR_CNTL
#define SCALER_H_COEFF0
#define SCALER_H_COEFF1
#define SCALER_H_COEFF2
#define SCALER_H_COEFF3
#define SCALER_H_COEFF4

/* Command FIFO */
#define GUI_CMDFIFO_DEBUG
#define GUI_CMDFIFO_DATA
#define GUI_CNTL

/* Bus Mastering */
#define BM_FRAME_BUF_OFFSET
#define BM_SYSTEM_MEM_ADDR
#define BM_COMMAND
#define BM_STATUS
#define BM_GUI_TABLE
#define BM_SYSTEM_TABLE

#define SCALER_BUF0_OFFSET_U
#define SCALER_BUF0_OFFSET_V
#define SCALER_BUF1_OFFSET_U
#define SCALER_BUF1_OFFSET_V

/* Setup Engine */
#define VERTEX_1_S
#define VERTEX_1_T
#define VERTEX_1_W
#define VERTEX_1_SPEC_ARGB
#define VERTEX_1_Z
#define VERTEX_1_ARGB
#define VERTEX_1_X_Y
#define ONE_OVER_AREA
#define VERTEX_2_S
#define VERTEX_2_T
#define VERTEX_2_W
#define VERTEX_2_SPEC_ARGB
#define VERTEX_2_Z
#define VERTEX_2_ARGB
#define VERTEX_2_X_Y
#define ONE_OVER_AREA
#define VERTEX_3_S
#define VERTEX_3_T
#define VERTEX_3_W
#define VERTEX_3_SPEC_ARGB
#define VERTEX_3_Z
#define VERTEX_3_ARGB
#define VERTEX_3_X_Y
#define ONE_OVER_AREA
#define VERTEX_1_S
#define VERTEX_1_T
#define VERTEX_1_W
#define VERTEX_2_S
#define VERTEX_2_T
#define VERTEX_2_W
#define VERTEX_3_SECONDARY_S
#define VERTEX_3_S
#define VERTEX_3_SECONDARY_T
#define VERTEX_3_T
#define VERTEX_3_SECONDARY_W
#define VERTEX_3_W
#define VERTEX_1_SPEC_ARGB
#define VERTEX_2_SPEC_ARGB
#define VERTEX_3_SPEC_ARGB
#define VERTEX_1_Z
#define VERTEX_2_Z
#define VERTEX_3_Z
#define VERTEX_1_ARGB
#define VERTEX_2_ARGB
#define VERTEX_3_ARGB
#define VERTEX_1_X_Y
#define VERTEX_2_X_Y
#define VERTEX_3_X_Y
#define ONE_OVER_AREA_UC
#define SETUP_CNTL
#define VERTEX_1_SECONDARY_S
#define VERTEX_1_SECONDARY_T
#define VERTEX_1_SECONDARY_W
#define VERTEX_2_SECONDARY_S
#define VERTEX_2_SECONDARY_T
#define VERTEX_2_SECONDARY_W


#define GTC_3D_RESET_DELAY

/* CRTC control values (mostly CRTC_GEN_CNTL) */

#define CRTC_H_SYNC_NEG
#define CRTC_V_SYNC_NEG

#define CRTC_DBL_SCAN_EN
#define CRTC_INTERLACE_EN
#define CRTC_HSYNC_DIS
#define CRTC_VSYNC_DIS
#define CRTC_CSYNC_EN
#define CRTC_PIX_BY_2_EN
#define CRTC_DISPLAY_DIS
#define CRTC_VGA_XOVERSCAN

#define CRTC_PIX_WIDTH_MASK
#define CRTC_PIX_WIDTH_4BPP
#define CRTC_PIX_WIDTH_8BPP
#define CRTC_PIX_WIDTH_15BPP
#define CRTC_PIX_WIDTH_16BPP
#define CRTC_PIX_WIDTH_24BPP
#define CRTC_PIX_WIDTH_32BPP

#define CRTC_BYTE_PIX_ORDER
#define CRTC_PIX_ORDER_MSN_LSN
#define CRTC_PIX_ORDER_LSN_MSN

#define CRTC_VSYNC_INT_EN
#define CRTC_VSYNC_INT
#define CRTC_FIFO_OVERFILL
#define CRTC2_VSYNC_INT_EN
#define CRTC2_VSYNC_INT

#define CRTC_FIFO_LWM
#define CRTC_HVSYNC_IO_DRIVE
#define CRTC2_PIX_WIDTH

#define CRTC_VGA_128KAP_PAGING
#define CRTC_VFC_SYNC_TRISTATE
#define CRTC2_EN
#define CRTC_LOCK_REGS
#define CRTC_SYNC_TRISTATE

#define CRTC_EXT_DISP_EN
#define CRTC_EN
#define CRTC_DISP_REQ_EN
#define CRTC_VGA_LINEAR
#define CRTC_VSYNC_FALL_EDGE
#define CRTC_VGA_TEXT_132
#define CRTC_CNT_EN
#define CRTC_CUR_B_TEST

#define CRTC_CRNT_VLINE

#define CRTC_PRESERVED_MASK

#define CRTC_VBLANK
#define CRTC_VBLANK_INT_EN
#define CRTC_VBLANK_INT
#define CRTC_VBLANK_INT_AK
#define CRTC_VLINE_INT_EN
#define CRTC_VLINE_INT
#define CRTC_VLINE_INT_AK
#define CRTC_VLINE_SYNC
#define CRTC_FRAME
#define SNAPSHOT_INT_EN
#define SNAPSHOT_INT
#define SNAPSHOT_INT_AK
#define I2C_INT_EN
#define I2C_INT
#define I2C_INT_AK
#define CRTC2_VBLANK
#define CRTC2_VBLANK_INT_EN
#define CRTC2_VBLANK_INT
#define CRTC2_VBLANK_INT_AK
#define CRTC2_VLINE_INT_EN
#define CRTC2_VLINE_INT
#define CRTC2_VLINE_INT_AK
#define CAPBUF0_INT_EN
#define CAPBUF0_INT
#define CAPBUF0_INT_AK
#define CAPBUF1_INT_EN
#define CAPBUF1_INT
#define CAPBUF1_INT_AK
#define OVERLAY_EOF_INT_EN
#define OVERLAY_EOF_INT
#define OVERLAY_EOF_INT_AK
#define ONESHOT_CAP_INT_EN
#define ONESHOT_CAP_INT
#define ONESHOT_CAP_INT_AK
#define BUSMASTER_EOL_INT_EN
#define BUSMASTER_EOL_INT
#define BUSMASTER_EOL_INT_AK
#define GP_INT_EN
#define GP_INT
#define GP_INT_AK
#define CRTC2_VLINE_SYNC
#define SNAPSHOT2_INT_EN
#define SNAPSHOT2_INT
#define SNAPSHOT2_INT_AK
#define VBLANK_BIT2_INT
#define VBLANK_BIT2_INT_AK

#define CRTC_INT_EN_MASK

/* DAC control values */

#define DAC_EXT_SEL_RS2
#define DAC_EXT_SEL_RS3
#define DAC_8BIT_EN
#define DAC_PIX_DLY_MASK
#define DAC_PIX_DLY_0NS
#define DAC_PIX_DLY_2NS
#define DAC_PIX_DLY_4NS
#define DAC_BLANK_ADJ_MASK
#define DAC_BLANK_ADJ_0
#define DAC_BLANK_ADJ_1
#define DAC_BLANK_ADJ_2

/* DAC control values (my source XL/XC Register reference) */
#define DAC_OUTPUT_MASK
#define DAC_MISTERY_BIT
#define DAC_BLANKING
#define DAC_CMP_DISABLE
#define DAC1_CLK_SEL
#define PALETTE_ACCESS_CNTL
#define PALETTE2_SNOOP_EN
#define DAC_CMP_OUTPUT
/* #define DAC_8BIT_EN is ok */
#define CRT_SENSE
#define CRT_DETECTION_ON
#define DAC_VGA_ADR_EN
#define DAC_FEA_CON_EN
#define DAC_PDWN
#define DAC_TYPE_MASK



/* Mix control values */

#define MIX_NOT_DST
#define MIX_0
#define MIX_1
#define MIX_DST
#define MIX_NOT_SRC
#define MIX_XOR
#define MIX_XNOR
#define MIX_SRC
#define MIX_NAND
#define MIX_NOT_SRC_OR_DST
#define MIX_SRC_OR_NOT_DST
#define MIX_OR
#define MIX_AND
#define MIX_SRC_AND_NOT_DST
#define MIX_NOT_SRC_AND_DST
#define MIX_NOR

/* Maximum engine dimensions */
#define ENGINE_MIN_X
#define ENGINE_MIN_Y
#define ENGINE_MAX_X
#define ENGINE_MAX_Y

/* Mach64 engine bit constants - these are typically ORed together */

/* BUS_CNTL register constants */
#define BUS_APER_REG_DIS
#define BUS_FIFO_ERR_ACK
#define BUS_HOST_ERR_ACK

/* GEN_TEST_CNTL register constants */
#define GEN_OVR_OUTPUT_EN
#define HWCURSOR_ENABLE
#define GUI_ENGINE_ENABLE
#define BLOCK_WRITE_ENABLE

/* DSP_CONFIG register constants */
#define DSP_XCLKS_PER_QW
#define DSP_LOOP_LATENCY
#define DSP_PRECISION

/* DSP_ON_OFF register constants */
#define DSP_OFF
#define DSP_ON
#define VGA_DSP_OFF
#define VGA_DSP_ON
#define VGA_DSP_XCLKS_PER_QW

/* PLL register indices and fields */
#define MPLL_CNTL
#define PLL_PC_GAIN
#define PLL_VC_GAIN
#define PLL_DUTY_CYC
#define VPLL_CNTL
#define PLL_REF_DIV
#define PLL_GEN_CNTL
#define PLL_OVERRIDE
#define PLL_MCLK_RST
#define OSC_EN
#define EXT_CLK_EN
#define FORCE_DCLK_TRI_STATE
#define MCLK_SRC_SEL
#define EXT_CLK_CNTL
#define DLL_PWDN
#define MCLK_FB_DIV
#define PLL_VCLK_CNTL
#define PLL_VCLK_SRC_SEL
#define PLL_VCLK_RST
#define PLL_VCLK_INVERT
#define VCLK_POST_DIV
#define VCLK0_POST
#define VCLK1_POST
#define VCLK2_POST
#define VCLK3_POST
#define VCLK0_FB_DIV
#define VCLK1_FB_DIV
#define VCLK2_FB_DIV
#define VCLK3_FB_DIV
#define PLL_EXT_CNTL
#define PLL_XCLK_MCLK_RATIO
#define PLL_XCLK_SRC_SEL
#define PLL_MFB_TIMES_4_2B
#define PLL_VCLK0_XDIV
#define PLL_VCLK1_XDIV
#define PLL_VCLK2_XDIV
#define PLL_VCLK3_XDIV
#define DLL_CNTL
#define DLL1_CNTL
#define VFC_CNTL
#define PLL_TEST_CNTL
#define PLL_TEST_COUNT
#define LVDS_CNTL0
#define LVDS_CNTL1
#define AGP1_CNTL
#define AGP2_CNTL
#define DLL2_CNTL
#define SCLK_FB_DIV
#define SPLL_CNTL1
#define SPLL_CNTL2
#define APLL_STRAPS
#define EXT_VPLL_CNTL
#define EXT_VPLL_EN
#define EXT_VPLL_VGA_EN
#define EXT_VPLL_INSYNC
#define EXT_VPLL_REF_DIV
#define EXT_VPLL_FB_DIV
#define EXT_VPLL_MSB
#define HTOTAL_CNTL
#define BYTE_CLK_CNTL
#define TV_PLL_CNTL1
#define TV_PLL_CNTL2
#define TV_PLL_CNTL
#define EXT_TV_PLL
#define V2PLL_CNTL
#define PLL_V2CLK_CNTL
#define EXT_V2PLL_REF_DIV
#define EXT_V2PLL_FB_DIV
#define EXT_V2PLL_MSB
#define HTOTAL2_CNTL
#define PLL_YCLK_CNTL
#define PM_DYN_CLK_CNTL

/* CNFG_CNTL register constants */
#define APERTURE_4M_ENABLE
#define APERTURE_8M_ENABLE
#define VGA_APERTURE_ENABLE

/* CNFG_STAT0 register constants (GX, CX) */
#define CFG_BUS_TYPE
#define CFG_MEM_TYPE
#define CFG_INIT_DAC_TYPE

/* CNFG_STAT0 register constants (CT, ET, VT) */
#define CFG_MEM_TYPE_xT

#define ISA
#define EISA
#define LOCAL_BUS
#define PCI

/* Memory types for GX, CX */
#define DRAMx4
#define VRAMx16
#define VRAMx16ssr
#define DRAMx16
#define GraphicsDRAMx16
#define EnhancedVRAMx16
#define EnhancedVRAMx16ssr

/* Memory types for CT, ET, VT, GT */
#define DRAM
#define EDO
#define PSEUDO_EDO
#define SDRAM
#define SGRAM
#define WRAM
#define SDRAM32

#define DAC_INTERNAL
#define DAC_IBMRGB514
#define DAC_ATI68875
#define DAC_TVP3026_A
#define DAC_BT476
#define DAC_BT481
#define DAC_ATT20C491
#define DAC_SC15026
#define DAC_MU9C1880
#define DAC_IMSG174
#define DAC_ATI68860_B
#define DAC_ATI68860_C
#define DAC_TVP3026_B
#define DAC_STG1700
#define DAC_ATT498
#define DAC_STG1702
#define DAC_SC15021
#define DAC_ATT21C498
#define DAC_STG1703
#define DAC_CH8398
#define DAC_ATT20C408

#define CLK_ATI18818_0
#define CLK_ATI18818_1
#define CLK_STG1703
#define CLK_CH8398
#define CLK_INTERNAL
#define CLK_ATT20C408
#define CLK_IBMRGB514

/* MEM_CNTL register constants */
#define MEM_SIZE_ALIAS
#define MEM_SIZE_512K
#define MEM_SIZE_1M
#define MEM_SIZE_2M
#define MEM_SIZE_4M
#define MEM_SIZE_6M
#define MEM_SIZE_8M
#define MEM_SIZE_ALIAS_GTB
#define MEM_SIZE_2M_GTB
#define MEM_SIZE_4M_GTB
#define MEM_SIZE_6M_GTB
#define MEM_SIZE_8M_GTB
#define MEM_BNDRY
#define MEM_BNDRY_0K
#define MEM_BNDRY_256K
#define MEM_BNDRY_512K
#define MEM_BNDRY_1M
#define MEM_BNDRY_EN

#define ONE_MB
/* ATI PCI constants */
#define PCI_ATI_VENDOR_ID


/* CNFG_CHIP_ID register constants */
#define CFG_CHIP_TYPE
#define CFG_CHIP_CLASS
#define CFG_CHIP_REV
#define CFG_CHIP_MAJOR
#define CFG_CHIP_FND_ID
#define CFG_CHIP_MINOR


/* Chip IDs read from CNFG_CHIP_ID */

/* mach64GX family */
#define GX_CHIP_ID
#define CX_CHIP_ID

#define GX_PCI_ID
#define CX_PCI_ID

/* mach64CT family */
#define CT_CHIP_ID
#define ET_CHIP_ID

/* mach64CT family / mach64VT class */
#define VT_CHIP_ID
#define VU_CHIP_ID
#define VV_CHIP_ID

/* mach64CT family / mach64GT (3D RAGE) class */
#define LB_CHIP_ID
#define LD_CHIP_ID
#define LG_CHIP_ID
#define LI_CHIP_ID
#define LP_CHIP_ID
#define LT_CHIP_ID

/* mach64CT family / (Rage XL) class */
#define GR_CHIP_ID
#define GS_CHIP_ID
#define GM_CHIP_ID
#define GN_CHIP_ID
#define GO_CHIP_ID
#define GL_CHIP_ID

#define IS_XL(id)

#define GT_CHIP_ID
#define GU_CHIP_ID
#define GV_CHIP_ID
#define GW_CHIP_ID
#define GZ_CHIP_ID
#define GB_CHIP_ID
#define GD_CHIP_ID
#define GI_CHIP_ID
#define GP_CHIP_ID
#define GQ_CHIP_ID

#define LM_CHIP_ID
#define LN_CHIP_ID
#define LR_CHIP_ID
#define LS_CHIP_ID

#define IS_MOBILITY(id)
/* Mach64 major ASIC revisions */
#define MACH64_ASIC_NEC_VT_A3
#define MACH64_ASIC_NEC_VT_A4
#define MACH64_ASIC_SGS_VT_A4
#define MACH64_ASIC_SGS_VT_B1S1
#define MACH64_ASIC_SGS_GT_B1S1
#define MACH64_ASIC_SGS_GT_B1S2
#define MACH64_ASIC_UMC_GT_B2U1
#define MACH64_ASIC_UMC_GT_B2U2
#define MACH64_ASIC_UMC_VT_B2U3
#define MACH64_ASIC_UMC_GT_B2U3
#define MACH64_ASIC_UMC_R3B_D_P_A1
#define MACH64_ASIC_UMC_R3B_D_P_A2
#define MACH64_ASIC_UMC_R3B_D_P_A3
#define MACH64_ASIC_UMC_R3B_D_P_A4

/* Mach64 foundries */
#define MACH64_FND_SGS
#define MACH64_FND_NEC
#define MACH64_FND_UMC

/* Mach64 chip types */
#define MACH64_UNKNOWN
#define MACH64_GX
#define MACH64_CX
#define MACH64_CT
#define MACH64_ET
#define MACH64_VT
#define MACH64_GT

/* DST_CNTL register constants */
#define DST_X_RIGHT_TO_LEFT
#define DST_X_LEFT_TO_RIGHT
#define DST_Y_BOTTOM_TO_TOP
#define DST_Y_TOP_TO_BOTTOM
#define DST_X_MAJOR
#define DST_Y_MAJOR
#define DST_X_TILE
#define DST_Y_TILE
#define DST_LAST_PEL
#define DST_POLYGON_ENABLE
#define DST_24_ROTATION_ENABLE

/* SRC_CNTL register constants */
#define SRC_PATTERN_ENABLE
#define SRC_ROTATION_ENABLE
#define SRC_LINEAR_ENABLE
#define SRC_BYTE_ALIGN
#define SRC_LINE_X_RIGHT_TO_LEFT
#define SRC_LINE_X_LEFT_TO_RIGHT

/* HOST_CNTL register constants */
#define HOST_BYTE_ALIGN

/* GUI_TRAJ_CNTL register constants */
#define PAT_MONO_8x8_ENABLE
#define PAT_CLR_4x2_ENABLE
#define PAT_CLR_8x1_ENABLE

/* DP_CHAIN_MASK register constants */
#define DP_CHAIN_4BPP
#define DP_CHAIN_7BPP
#define DP_CHAIN_8BPP
#define DP_CHAIN_8BPP_RGB
#define DP_CHAIN_15BPP
#define DP_CHAIN_16BPP
#define DP_CHAIN_24BPP
#define DP_CHAIN_32BPP

/* DP_PIX_WIDTH register constants */
#define DST_1BPP
#define DST_4BPP
#define DST_8BPP
#define DST_15BPP
#define DST_16BPP
#define DST_24BPP
#define DST_32BPP
#define DST_MASK
#define SRC_1BPP
#define SRC_4BPP
#define SRC_8BPP
#define SRC_15BPP
#define SRC_16BPP
#define SRC_24BPP
#define SRC_32BPP
#define SRC_MASK
#define DP_HOST_TRIPLE_EN
#define HOST_1BPP
#define HOST_4BPP
#define HOST_8BPP
#define HOST_15BPP
#define HOST_16BPP
#define HOST_24BPP
#define HOST_32BPP
#define HOST_MASK
#define BYTE_ORDER_MSB_TO_LSB
#define BYTE_ORDER_LSB_TO_MSB
#define BYTE_ORDER_MASK

/* DP_MIX register constants */
#define BKGD_MIX_NOT_D
#define BKGD_MIX_ZERO
#define BKGD_MIX_ONE
#define BKGD_MIX_D
#define BKGD_MIX_NOT_S
#define BKGD_MIX_D_XOR_S
#define BKGD_MIX_NOT_D_XOR_S
#define BKGD_MIX_S
#define BKGD_MIX_NOT_D_OR_NOT_S
#define BKGD_MIX_D_OR_NOT_S
#define BKGD_MIX_NOT_D_OR_S
#define BKGD_MIX_D_OR_S
#define BKGD_MIX_D_AND_S
#define BKGD_MIX_NOT_D_AND_S
#define BKGD_MIX_D_AND_NOT_S
#define BKGD_MIX_NOT_D_AND_NOT_S
#define BKGD_MIX_D_PLUS_S_DIV2
#define FRGD_MIX_NOT_D
#define FRGD_MIX_ZERO
#define FRGD_MIX_ONE
#define FRGD_MIX_D
#define FRGD_MIX_NOT_S
#define FRGD_MIX_D_XOR_S
#define FRGD_MIX_NOT_D_XOR_S
#define FRGD_MIX_S
#define FRGD_MIX_NOT_D_OR_NOT_S
#define FRGD_MIX_D_OR_NOT_S
#define FRGD_MIX_NOT_D_OR_S
#define FRGD_MIX_D_OR_S
#define FRGD_MIX_D_AND_S
#define FRGD_MIX_NOT_D_AND_S
#define FRGD_MIX_D_AND_NOT_S
#define FRGD_MIX_NOT_D_AND_NOT_S
#define FRGD_MIX_D_PLUS_S_DIV2

/* DP_SRC register constants */
#define BKGD_SRC_BKGD_CLR
#define BKGD_SRC_FRGD_CLR
#define BKGD_SRC_HOST
#define BKGD_SRC_BLIT
#define BKGD_SRC_PATTERN
#define FRGD_SRC_BKGD_CLR
#define FRGD_SRC_FRGD_CLR
#define FRGD_SRC_HOST
#define FRGD_SRC_BLIT
#define FRGD_SRC_PATTERN
#define MONO_SRC_ONE
#define MONO_SRC_PATTERN
#define MONO_SRC_HOST
#define MONO_SRC_BLIT

/* CLR_CMP_CNTL register constants */
#define COMPARE_FALSE
#define COMPARE_TRUE
#define COMPARE_NOT_EQUAL
#define COMPARE_EQUAL
#define COMPARE_DESTINATION
#define COMPARE_SOURCE

/* FIFO_STAT register constants */
#define FIFO_ERR

/* CONTEXT_LOAD_CNTL constants */
#define CONTEXT_NO_LOAD
#define CONTEXT_LOAD
#define CONTEXT_LOAD_AND_DO_FILL
#define CONTEXT_LOAD_AND_DO_LINE
#define CONTEXT_EXECUTE
#define CONTEXT_CMD_DISABLE

/* GUI_STAT register constants */
#define ENGINE_IDLE
#define ENGINE_BUSY
#define SCISSOR_LEFT_FLAG
#define SCISSOR_RIGHT_FLAG
#define SCISSOR_TOP_FLAG
#define SCISSOR_BOTTOM_FLAG

/* ATI VGA Extended Regsiters */
#define sioATIEXT
#define bioATIEXT

#define ATI2E
#define ATI32
#define ATI36

/* VGA Graphics Controller Registers */
#define R_GENMO
#define VGAGRA
#define GRA06

/* VGA Seququencer Registers */
#define VGASEQ
#define SEQ02
#define SEQ04

#define MACH64_MAX_X
#define MACH64_MAX_Y

#define INC_X
#define INC_Y

#define RGB16_555
#define RGB16_565
#define RGB16_655
#define RGB16_664

#define POLY_TEXT_TYPE
#define IMAGE_TEXT_TYPE
#define TEXT_TYPE_8_BIT
#define TEXT_TYPE_16_BIT
#define POLY_TEXT_TYPE_8
#define IMAGE_TEXT_TYPE_8
#define POLY_TEXT_TYPE_16
#define IMAGE_TEXT_TYPE_16

#define MACH64_NUM_CLOCKS
#define MACH64_NUM_FREQS

/* Power Management register constants (LT & LT Pro) */
#define PWR_MGT_ON
#define PWR_MGT_MODE_MASK
#define AUTO_PWR_UP
#define USE_F32KHZ
#define TRISTATE_MEM_EN
#define SELF_REFRESH
#define PWR_BLON
#define STANDBY_NOW
#define SUSPEND_NOW
#define PWR_MGT_STATUS_MASK
#define PWR_MGT_STATUS_SUSPEND

/* PM Mode constants  */
#define PWR_MGT_MODE_PIN
#define PWR_MGT_MODE_REG
#define PWR_MGT_MODE_TIMER
#define PWR_MGT_MODE_PCI

/* LCD registers (LT Pro) */

/* LCD Index register */
#define LCD_INDEX_MASK
#define LCD_DISPLAY_DIS
#define LCD_SRC_SEL
#define CRTC2_DISPLAY_DIS

/* LCD register indices */
#define CNFG_PANEL
#define LCD_GEN_CNTL
#define DSTN_CONTROL
#define HFB_PITCH_ADDR
#define HORZ_STRETCHING
#define VERT_STRETCHING
#define EXT_VERT_STRETCH
#define LT_GIO
#define POWER_MANAGEMENT
#define ZVGPIO
#define ICON_CLR0
#define ICON_CLR1
#define ICON_OFFSET
#define ICON_HORZ_VERT_POSN
#define ICON_HORZ_VERT_OFF
#define ICON2_CLR0
#define ICON2_CLR1
#define ICON2_OFFSET
#define ICON2_HORZ_VERT_POSN
#define ICON2_HORZ_VERT_OFF
#define LCD_MISC_CNTL
#define APC_CNTL
#define POWER_MANAGEMENT_2
#define ALPHA_BLENDING
#define PORTRAIT_GEN_CNTL
#define APC_CTRL_IO
#define TEST_IO
#define TEST_OUTPUTS
#define DP1_MEM_ACCESS
#define DP0_MEM_ACCESS
#define DP0_DEBUG_A
#define DP0_DEBUG_B
#define DP1_DEBUG_A
#define DP1_DEBUG_B
#define DPCTRL_DEBUG_A
#define DPCTRL_DEBUG_B
#define MEMBLK_DEBUG
#define APC_LUT_AB
#define APC_LUT_CD
#define APC_LUT_EF
#define APC_LUT_GH
#define APC_LUT_IJ
#define APC_LUT_KL
#define APC_LUT_MN
#define APC_LUT_OP

/* Values in LCD_GEN_CTRL */
#define CRT_ON
#define LCD_ON
#define HORZ_DIVBY2_EN
#define DONT_DS_ICON
#define LOCK_8DOT
#define ICON_ENABLE
#define DONT_SHADOW_VPAR
#define V2CLK_PM_EN
#define RST_FM
#define DISABLE_PCLK_RESET
#define DIS_HOR_CRT_DIVBY2
#define SCLK_SEL
#define SCLK_DELAY
#define TVCLK_PM_EN
#define VCLK_DAC_PM_EN
#define VCLK_LCD_OFF
#define SELECT_WAIT_4MS
#define XTALIN_PM_EN
#define V2CLK_DAC_PM_EN
#define LVDS_EN
#define LVDS_PLL_EN
#define LVDS_PLL_RESET
#define LVDS_RESERVED_BITS
#define CRTC_RW_SELECT
#define USE_SHADOWED_VEND
#define USE_SHADOWED_ROWCUR
#define SHADOW_EN
#define SHADOW_RW_EN

#define LCD_SET_PRIMARY_MASK

/* Values in HORZ_STRETCHING */
#define HORZ_STRETCH_BLEND
#define HORZ_STRETCH_RATIO
#define HORZ_STRETCH_LOOP
#define HORZ_STRETCH_LOOP09
#define HORZ_STRETCH_LOOP11
#define HORZ_STRETCH_LOOP12
#define HORZ_STRETCH_LOOP14
#define HORZ_STRETCH_LOOP15
/*	?				0x00050000ul */
/*	?				0x00060000ul */
/*	?				0x00070000ul */
/*	?				0x00080000ul */
#define HORZ_PANEL_SIZE
/*	?				0x10000000ul */
#define AUTO_HORZ_RATIO
#define HORZ_STRETCH_MODE
#define HORZ_STRETCH_EN

/* Values in VERT_STRETCHING */
#define VERT_STRETCH_RATIO0
#define VERT_STRETCH_RATIO1
#define VERT_STRETCH_RATIO2
#define VERT_STRETCH_USE0
#define VERT_STRETCH_EN

/* Values in EXT_VERT_STRETCH */
#define VERT_STRETCH_RATIO3
#define FORCE_DAC_DATA
#define FORCE_DAC_DATA_SEL
#define VERT_STRETCH_MODE
#define VERT_PANEL_SIZE
#define AUTO_VERT_RATIO
#define USE_AUTO_FP_POS
#define USE_AUTO_LCD_VSYNC
/*	?				0xfe000000ul */

/* Values in LCD_MISC_CNTL */
#define BIAS_MOD_LEVEL_MASK
#define BIAS_MOD_LEVEL_SHIFT
#define BLMOD_EN
#define BIASMOD_EN

#endif				/* REGMACH64_H */