📄 atiregs.h
字号:
/* * Copyright 1994 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * that the name of Marc Aurele La France not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Marc Aurele La France makes no representations * about the suitability of this software for any purpose. It is provided * "as-is" without express or implied warranty. * * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Acknowledgements: * Jake Richter, Panacea Inc., Londonderry, New Hampshire, U.S.A. * Kevin E. Martin, martin@cs.unc.edu * Tiago Gons, tiago@comosjn.hobby.nl * Rickard E. Faith, faith@cs.unc.edu * Scott Laird, lair@kimbark.uchicago.edu * * The intent here is to list all I/O ports for VGA (and its predecessors), * ATI VGA Wonder, 8514/A, ATI Mach8, ATI Mach32 and ATI Mach64 video adapters, * not just the ones in use by the ATI driver. */#ifndef ___ATIREGS_H___#define ___ATIREGS_H___ 1#include "atiutil.h"/* I/O decoding definitions */#define SPARSE_IO_BASE 0x03fcu#define SPARSE_IO_SELECT 0xfc00u#define BLOCK_IO_BASE 0xff00u#define BLOCK_IO_SELECT 0x00fcu#define MM_IO_SELECT 0x03fcu#define BLOCK_SELECT 0x0400u#define DWORD_SELECT (BLOCK_SELECT | MM_IO_SELECT)#define IO_BYTE_SELECT 0x0003u#define SPARSE_IO_PORT (SPARSE_IO_BASE | IO_BYTE_SELECT)#define BLOCK_IO_PORT (BLOCK_IO_BASE | IO_BYTE_SELECT)#define IOPortTag(_SparseIOSelect, _BlockIOSelect) \ (SetBits(_SparseIOSelect, SPARSE_IO_SELECT) | \ SetBits(_BlockIOSelect, DWORD_SELECT))#define SparseIOTag(_IOSelect) IOPortTag(_IOSelect, 0)#define BlockIOTag(_IOSelect) IOPortTag(0, _IOSelect)/* MDA/[M]CGA/EGA/VGA I/O ports */#define GENVS 0x0102u /* Write (and Read on uC only) */#define R_GENLPS 0x03b9u /* Read */#define GENHP 0x03bfu#define ATTRX 0x03c0u#define ATTRD 0x03c1u#define GENS0 0x03c2u /* Read */#define GENMO 0x03c2u /* Write */#define GENENB 0x03c3u /* Read */#define SEQX 0x03c4u#define SEQD 0x03c5u#define VGA_DAC_MASK 0x03c6u#define VGA_DAC_READ 0x03c7u#define VGA_DAC_WRITE 0x03c8u#define VGA_DAC_DATA 0x03c9u#define R_GENFC 0x03cau /* Read *//* ? 0x03cbu */#define R_GENMO 0x03ccu /* Read *//* ? 0x03cdu */#define GRAX 0x03ceu#define GRAD 0x03cfu#define GENB 0x03d9u#define GENLPS 0x03dcu /* Write */#define KCX 0x03ddu#define KCD 0x03deu#define GENENA 0x46e8u /* Write *//* I/O port base numbers */#define MonochromeIOBase 0x03b0u#define ColourIOBase 0x03d0u/* Other MDA/[M]CGA/EGA/VGA I/O ports *//* ?(_IOBase) ((_IOBase) + 0x00u) */ /* CRTX synonym *//* ?(_IOBase) ((_IOBase) + 0x01u) */ /* CRTD synonym *//* ?(_IOBase) ((_IOBase) + 0x02u) */ /* CRTX synonym *//* ?(_IOBase) ((_IOBase) + 0x03u) */ /* CRTD synonym */#define CRTX(_IOBase) ((_IOBase) + 0x04u)#define CRTD(_IOBase) ((_IOBase) + 0x05u)/* ?(_IOBase) ((_IOBase) + 0x06u) *//* ?(_IOBase) ((_IOBase) + 0x07u) */#define GENMC(_IOBase) ((_IOBase) + 0x08u)/* ?(_IOBase) ((_IOBase) + 0x09u) */ /* R_GENLPS/GENB */#define GENS1(_IOBase) ((_IOBase) + 0x0au) /* Read */#define GENFC(_IOBase) ((_IOBase) + 0x0au) /* Write */#define GENLPC(_IOBase) ((_IOBase) + 0x0bu)/* ?(_IOBase) ((_IOBase) + 0x0cu) */ /* /GENLPS *//* ?(_IOBase) ((_IOBase) + 0x0du) */ /* /KCX *//* ?(_IOBase) ((_IOBase) + 0x0eu) */ /* /KCD *//* ?(_IOBase) ((_IOBase) + 0x0fu) */ /* GENHP/ *//* 8514/A VESA approved register definitions */#define DISP_STAT 0x02e8u /* Read */#define SENSE 0x0001u /* Presumably belong here */#define VBLANK 0x0002u#define HORTOG 0x0004u#define H_TOTAL 0x02e8u /* Write */#define IBM_DAC_MASK 0x02eau#define IBM_DAC_READ 0x02ebu#define IBM_DAC_WRITE 0x02ecu#define IBM_DAC_DATA 0x02edu#define H_DISP 0x06e8u /* Write */#define H_SYNC_STRT 0x0ae8u /* Write */#define H_SYNC_WID 0x0ee8u /* Write */#define HSYNCPOL_POS 0x0000u#define HSYNCPOL_NEG 0x0020u#define H_POLARITY_POS HSYNCPOL_POS /* Sigh */#define H_POLARITY_NEG HSYNCPOL_NEG /* Sigh */#define V_TOTAL 0x12e8u /* Write */#define V_DISP 0x16e8u /* Write */#define V_SYNC_STRT 0x1ae8u /* Write */#define V_SYNC_WID 0x1ee8u /* Write */#define VSYNCPOL_POS 0x0000u#define VSYNCPOL_NEG 0x0020u#define V_POLARITY_POS VSYNCPOL_POS /* Sigh */#define V_POLARITY_NEG VSYNCPOL_NEG /* Sigh */#define DISP_CNTL 0x22e8u /* Write */#define ODDBNKENAB 0x0001u#define MEMCFG_2 0x0000u#define MEMCFG_4 0x0002u#define MEMCFG_6 0x0004u#define MEMCFG_8 0x0006u#define DBLSCAN 0x0008u#define INTERLACE 0x0010u#define DISPEN_NC 0x0000u#define DISPEN_ENAB 0x0020u#define DISPEN_DISAB 0x0040u#define R_H_TOTAL 0x26e8u /* Read *//* ? 0x2ae8u *//* ? 0x2ee8u *//* ? 0x32e8u *//* ? 0x36e8u *//* ? 0x3ae8u *//* ? 0x3ee8u */#define SUBSYS_STAT 0x42e8u /* Read */#define VBLNKFLG 0x0001u#define PICKFLAG 0x0002u#define INVALIDIO 0x0004u#define GPIDLE 0x0008u#define MONITORID_MASK 0x0070u/* MONITORID_? 0x0000u */#define MONITORID_8507 0x0010u#define MONITORID_8514 0x0020u/* MONITORID_? 0x0030u *//* MONITORID_? 0x0040u */#define MONITORID_8503 0x0050u#define MONITORID_8512 0x0060u#define MONITORID_8513 0x0060u#define MONITORID_NONE 0x0070u#define _8PLANE 0x0080u#define SUBSYS_CNTL 0x42e8u /* Write */#define RVBLNKFLG 0x0001u#define RPICKFLAG 0x0002u#define RINVALIDIO 0x0004u#define RGPIDLE 0x0008u#define IVBLNKFLG 0x0100u#define IPICKFLAG 0x0200u#define IINVALIDIO 0x0400u#define IGPIDLE 0x0800u#define CHPTEST_NC 0x0000u#define CHPTEST_NORMAL 0x1000u#define CHPTEST_ENAB 0x2000u#define GPCTRL_NC 0x0000u#define GPCTRL_ENAB 0x4000u#define GPCTRL_RESET 0x8000u#define ROM_PAGE_SEL 0x46e8u /* Write */#define ADVFUNC_CNTL 0x4ae8u /* Write */#define DISABPASSTHRU 0x0001u#define CLOKSEL 0x0004u/* ? 0x4ee8u */#define EXT_CONFIG_0 0x52e8u /* C & T 82C480 */#define EXT_CONFIG_1 0x56e8u /* C & T 82C480 */#define EXT_CONFIG_2 0x5ae8u /* C & T 82C480 */#define EXT_CONFIG_3 0x5ee8u /* C & T 82C480 *//* ? 0x62e8u *//* ? 0x66e8u *//* ? 0x6ae8u *//* ? 0x6ee8u *//* ? 0x72e8u *//* ? 0x76e8u *//* ? 0x7ae8u *//* ? 0x7ee8u */#define CUR_Y 0x82e8u#define CUR_X 0x86e8u#define DESTY_AXSTP 0x8ae8u /* Write */#define DESTX_DIASTP 0x8ee8u /* Write */#define ERR_TERM 0x92e8u#define MAJ_AXIS_PCNT 0x96e8u /* Write */#define GP_STAT 0x9ae8u /* Read */#define GE_STAT 0x9ae8u /* Alias */#define DATARDY 0x0100u#define DATA_READY DATARDY /* Alias */#define GPBUSY 0x0200u#define CMD 0x9ae8u /* Write */#define WRTDATA 0x0001u#define PLANAR 0x0002u#define LASTPIX 0x0004u#define LINETYPE 0x0008u#define DRAW 0x0010u#define INC_X 0x0020u#define YMAJAXIS 0x0040u#define INC_Y 0x0080u#define PCDATA 0x0100u#define _16BIT 0x0200u#define CMD_NOP 0x0000u#define CMD_OP_MSK 0xf000u#define BYTSEQ 0x1000u#define CMD_LINE 0x2000u#define CMD_RECT 0x4000u#define CMD_RECTV1 0x6000u#define CMD_RECTV2 0x8000u#define CMD_LINEAF 0xa000u#define CMD_BITBLT 0xc000u#define SHORT_STROKE 0x9ee8u /* Write */#define SSVDRAW 0x0010u#define VECDIR_000 0x0000u#define VECDIR_045 0x0020u#define VECDIR_090 0x0040u#define VECDIR_135 0x0060u#define VECDIR_180 0x0080u#define VECDIR_225 0x00a0u#define VECDIR_270 0x00c0u#define VECDIR_315 0x00e0u#define BKGD_COLOR 0xa2e8u /* Write */#define FRGD_COLOR 0xa6e8u /* Write */#define WRT_MASK 0xaae8u /* Write */#define RD_MASK 0xaee8u /* Write */#define COLOR_CMP 0xb2e8u /* Write */#define BKGD_MIX 0xb6e8u /* Write *//* 0x001fu See MIX_* definitions below */#define BSS_BKGDCOL 0x0000u#define BSS_FRGDCOL 0x0020u#define BSS_PCDATA 0x0040u#define BSS_BITBLT 0x0060u#define FRGD_MIX 0xbae8u /* Write *//* 0x001fu See MIX_* definitions below */#define FSS_BKGDCOL 0x0000u#define FSS_FRGDCOL 0x0020u#define FSS_PCDATA 0x0040u#define FSS_BITBLT 0x0060u#define MULTIFUNC_CNTL 0xbee8u /* Write */#define MIN_AXIS_PCNT 0x0000u#define SCISSORS_T 0x1000u#define SCISSORS_L 0x2000u#define SCISSORS_B 0x3000u#define SCISSORS_R 0x4000u#define M32_MEM_CNTL 0x5000u#define HORCFG_4 0x0000u#define HORCFG_5 0x0001u#define HORCFG_8 0x0002u#define HORCFG_10 0x0003u#define VRTCFG_2 0x0000u#define VRTCFG_4 0x0004u#define VRTCFG_6 0x0008u#define VRTCFG_8 0x000cu#define BUFSWP 0x0010u#define PATTERN_L 0x8000u#define PATTERN_H 0x9000u#define PIX_CNTL 0xa000u#define PLANEMODE 0x0004u#define COLCMPOP_F 0x0000u#define COLCMPOP_T 0x0008u#define COLCMPOP_GE 0x0010u#define COLCMPOP_LT 0x0018u#define COLCMPOP_NE 0x0020u#define COLCMPOP_EQ 0x0028u#define COLCMPOP_LE 0x0030u#define COLCMPOP_GT 0x0038u#define MIXSEL_FRGDMIX 0x0000u#define MIXSEL_PATT 0x0040u#define MIXSEL_EXPPC 0x0080u#define MIXSEL_EXPBLT 0x00c0u/* ? 0xc2e8u *//* ? 0xc6e8u *//* ? 0xcae8u *//* ? 0xcee8u *//* ? 0xd2e8u *//* ? 0xd6e8u *//* ? 0xdae8u *//* ? 0xdee8u */#define PIX_TRANS 0xe2e8u/* ? 0xe6e8u *//* ? 0xeae8u *//* ? 0xeee8u *//* ? 0xf2e8u *//* ? 0xf6e8u *//* ? 0xfae8u *//* ? 0xfee8u *//* ATI Mach8 & Mach32 register definitions */#define OVERSCAN_COLOR_8 0x02eeu /* Write */ /* Mach32 */#define OVERSCAN_BLUE_24 0x02efu /* Write */ /* Mach32 */#define OVERSCAN_GREEN_24 0x06eeu /* Write */ /* Mach32 */#define OVERSCAN_RED_24 0x06efu /* Write */ /* Mach32 */#define CURSOR_OFFSET_LO 0x0aeeu /* Write */ /* Mach32 */#define CURSOR_OFFSET_HI 0x0eeeu /* Write */ /* Mach32 */#define CONFIG_STATUS_1 0x12eeu /* Read */#define CLK_MODE 0x0001u /* Mach8 */#define BUS_16 0x0002u /* Mach8 */#define MC_BUS 0x0004u /* Mach8 */#define EEPROM_ENA 0x0008u /* Mach8 */#define DRAM_ENA 0x0010u /* Mach8 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -