/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
*
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation on the rights to use, copy, modify, merge,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/*
* Authors:
* Kevin E. Martin <martin@xfree86.org>
* Rickard E. Faith <faith@valinux.com>
* Alan Hourihane <alanh@fairlite.demon.co.uk>
*
* References:
*
* !!!! FIXME !!!!
* RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical
* Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April
* 1999.
*
* !!!! FIXME !!!!
* RAGE 128 Software Development Manual (Technical Reference Manual P/N
* SDK-G04000 Rev. 0.01), ATI Technologies: June 1999.
*
*/
/* !!!! FIXME !!!! NOTE: THIS FILE HAS BEEN CONVERTED FROM r128_reg.h
* AND CONTAINS REGISTERS AND REGISTER DEFINITIONS THAT ARE NOT CORRECT
* ON THE RADEON. A FULL AUDIT OF THIS CODE IS NEEDED! */
#ifndef _RADEON_REG_H_
#define _RADEON_REG_H_
#define ATI_DATATYPE_VQ 0
# define RADEON_GRPH_START_REQ_SHIFT 0
# define RADEON_GRPH2_START_REQ_SHIFT 0
# define RADEON_CRTC_H_TOTAL_SHIFT 0
# define RADEON_CRTC2_H_TOTAL_SHIFT 0
# define RADEON_CRTC_TILE_LINE_SHIFT 0
# define RADEON_CRTC_PITCH__SHIFT 0
# define RADEON_CRTC_V_SYNC_STRT_SHIFT 0
# define RADEON_CRTC2_V_SYNC_STRT_SHIFT 0
# define RADEON_CRTC_V_TOTAL_SHIFT 0
# define RADEON_CRTC2_V_TOTAL_SHIFT 0
# define RADEON_DISP_ALPHA_MODE_KEY 0
# define RADEON_FCP0_SRC_PCICLK 0
# define RADEON_VERT_STRETCH_RATIO_SHIFT 0
/* Multimedia I2C bus */
/* first capture unit */
/* #define RADEON_CAP0_DWNSC_XRATIO 0x0978 */
/* #define RADEON_CAP0_XSHARPNESS 0x097C */
/* second capture unit */
/* misc multimedia registers */
# define RADEON_HOST_DATA_SWAP_NONE (0 << 0)
# define RADEON_RB3D_DC_CACHE_ENABLE (0)
/* VIP bus */
# define RADEON_VIP_BUSY 0
# define RADEON_MAG_FILTER_NEAREST (0 << 0)
# define RADEON_TXFORMAT_I8 (0 << 0)
# define RADEON_TXFORMAT_FORMAT_SHIFT 0
# define RADEON_FACE_WIDTH_1_SHIFT 0
# define RADEON_TXO_ENDIAN_NO_SWAP (0 << 0)
# define RADEON_TEX_USIZE_SHIFT 0
/* note: bits 13-5: 32 byte aligned stride of texture map */
# define RADEON_COLOR_ARG_A_SHIFT 0
# define RADEON_COLOR_ARG_A_ZERO (0 << 0)
# define RADEON_ALPHA_ARG_A_SHIFT 0
# define RADEON_ALPHA_ARG_A_ZERO (0 << 0)
# define RADEON_STENCIL_REF_SHIFT 0
# define RADEON_DEPTH_FORMAT_16BIT_INT_Z (0 << 0)
# define RADEON_LINE_CURRENT_PTR_SHIFT 0
# define RADEON_STIPPLE_X_OFFSET_SHIFT 0
# define RADEON_RE_LEFT_SHIFT 0
# define RADEON_RE_WIDTH_SHIFT 0
# define RADEON_FFACE_CULL_CW (0 << 0)
# define RADEON_VC_NO_SWAP (0 << 0)
# define RADEON_LM_SOURCE_STATE_PREMULT 0
# define RADEON_MODELVIEW_0_SHIFT 0
# define RADEON_MODELPROJECT_0_SHIFT 0
# define RADEON_TCL_TEX_INPUT_TEX_0 0
# define RADEON_LIGHT_0_SHIFT 0
# define RADEON_LIGHT_2_SHIFT 0
# define RADEON_LIGHT_4_SHIFT 0
# define RADEON_LIGHT_6_SHIFT 0
# define RADEON_TEXGEN_INPUT_TEXCOORD_0 0
# define R200_VC_NO_SWAP (0 << 0)
# define R200_MAG_FILTER_NEAREST (0 << 0)
# define R200_TXFORMAT_I8 (0 << 0)
# define R200_TXFORMAT_FORMAT_SHIFT 0
# define R200_TXO_ENDIAN_NO_SWAP (0 << 0)
# define R200_TXC_ARG_A_ZERO (0)
# define R200_TXC_ARG_A_SHIFT 0
# define R200_TXC_TFACTOR_SEL_SHIFT 0
# define R200_TXC_REPL_NORMAL 0
# define R200_TXA_ARG_A_ZERO (0)
# define R200_TXA_ARG_A_SHIFT 0
# define R200_TXA_TFACTOR_SEL_SHIFT 0
# define R200_TXA_REPL_NORMAL 0
# define R200_VTX_COLOR_NOT_PRESENT 0
# define R200_VTX_TEX0_COMP_CNT_SHIFT 0
/* Registers for CP and Microcode Engine */
# define RADEON_PRE_WRITE_TIMER_SHIFT 0
/* Constants */
/* CP packet types */
#define RADEON_VS_MATRIX_0_ADDR 0
#define RADEON_SS_LIGHT_DCD_ADDR 0
# define RADEON_UV_INC_SHIFT 0
# define RADEON_H_INC_SHIFT 0
# define RADEON_Y_GAIN_LIMIT_SHIFT 0
# define RADEON_Y_GAIN_SHIFT 0
# define RADEON_MAX_UV_ADR_SHIFT 0
/* master controls */
# define AVIVO_D1GRPH_CONTROL_DEPTH_8BPP (0<<0)
/* second crtc */
# define AVIVO_DAC_SOURCE_CRTC1 (0 << 0)
# define AVIVO_DACB_POWERDOWN_RED
/* 78a8 appears to be some kind of (reasonably tolerant) clock?
* 78d0 definitely hits the transmitter, definitely clock. */
/* MYSTERY1 This appears to control dithering? */
/* If radeon_mm_i2c is to be believed, this is HALT, NACK, and maybe
* DONE? */
/* Reading is done 4 bytes at a time: read the bottom 8 bits from
* 7d44, four times in a row.
* Writing is a little more complex. First write DATA with
* 0xnnnnnnzz, then 0xnnnnnnyy, where nnnnnn is some non-deterministic
* magic number, zz is, I think, the slave address, and yy is the byte
* you want to write. */
# define R300_TXWIDTH_SHIFT 0
# define R300_NUM_LEVELS_MASK 0x
/* Floating point formats */
/* Note - hardware supports both 16 and 32 bit floating point */
/* alpha modes, convenience mostly */
/* if you have alpha, pick constant appropriate to the
number of channels (1 for I8, 2 for I8A8, 4 for R8G8B8A8, etc */
/* Swizzling */
/* constants */
# define R300_TX_FORMAT_X 0
/* 2.0*Z, everything above 1.0 is set to 0.0 */
/* 2.0*W, everything above 1.0 is set to 0.0 */
/* Convenience macro to take care of layout and swizzling */
((R300_TX_FORMAT_##B)<<R300_TX_FORMAT_B_SHIFT) \
| ((R300_TX_FORMAT_##G)<<R300_TX_FORMAT_G_SHIFT) \
| ((R300_TX_FORMAT_##R)<<R300_TX_FORMAT_R_SHIFT) \
| ((R300_TX_FORMAT_##A)<<R300_TX_FORMAT_A_SHIFT) \
| (R300_TX_FORMAT_##FMT) \
)
#endif