1 /* 2 * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and 3 * VA Linux Systems Inc., Fremont, California. 4 * 5 * All Rights Reserved. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining 8 * a copy of this software and associated documentation files (the 9 * "Software"), to deal in the Software without restriction, including 10 * without limitation on the rights to use, copy, modify, merge, 11 * publish, distribute, sublicense, and/or sell copies of the Software, 12 * and to permit persons to whom the Software is furnished to do so, 13 * subject to the following conditions: 14 * 15 * The above copyright notice and this permission notice (including the 16 * next paragraph) shall be included in all copies or substantial 17 * portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR 23 * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 26 * DEALINGS IN THE SOFTWARE. 27 */ 28 29 30 /* 31 * Authors: 32 * Kevin E. Martin <martin@xfree86.org> 33 * Rickard E. Faith <faith@valinux.com> 34 * Alan Hourihane <alanh@fairlite.demon.co.uk> 35 * 36 * References: 37 * 38 * !!!! FIXME !!!! 39 * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical 40 * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April 41 * 1999. 42 * 43 * !!!! FIXME !!!! 44 * RAGE 128 Software Development Manual (Technical Reference Manual P/N 45 * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999. 46 * 47 */ 48 49 50 #define EVERGREEN_VGA_MEMORY_BASE_ADDRESS 0x310 51 #define EVERGREEN_VGA_MEMORY_BASE_ADDRESS_HIGH 0x324 52 #define EVERGREEN_D3VGA_CONTROL 0x3e0 53 #define EVERGREEN_D4VGA_CONTROL 0x3e4 54 #define EVERGREEN_D5VGA_CONTROL 0x3e8 55 #define EVERGREEN_D6VGA_CONTROL 0x3ec 56 #define EVERGREEN_P1PLL_SS_CNTL 0x414 57 #define EVERGREEN_P2PLL_SS_CNTL 0x454 58 # define EVERGREEN_PxPLL_SS_EN (1 << 12) 59 #define EVERGREEN_GRPH_ENABLE 0x6800 60 #define EVERGREEN_GRPH_CONTROL 0x6804 61 # define EVERGREEN_GRPH_DEPTH(x) (((x) & 0x3) << 0) 62 # define EVERGREEN_GRPH_DEPTH_8BPP 0 63 # define EVERGREEN_GRPH_DEPTH_16BPP 1 64 # define EVERGREEN_GRPH_DEPTH_32BPP 2 65 # define EVERGREEN_GRPH_FORMAT(x) (((x) & 0x7) << 8) 66 # define EVERGREEN_GRPH_FORMAT_INDEXED 0 67 # define EVERGREEN_GRPH_FORMAT_ARGB1555 0 68 # define EVERGREEN_GRPH_FORMAT_ARGB565 1 69 # define EVERGREEN_GRPH_FORMAT_ARGB4444 2 70 # define EVERGREEN_GRPH_FORMAT_AI88 3 71 # define EVERGREEN_GRPH_FORMAT_MONO16 4 72 # define EVERGREEN_GRPH_FORMAT_BGRA5551 5 73 # define EVERGREEN_GRPH_FORMAT_ARGB8888 0 74 # define EVERGREEN_GRPH_FORMAT_ARGB2101010 1 75 # define EVERGREEN_GRPH_FORMAT_32BPP_DIG 2 76 # define EVERGREEN_GRPH_FORMAT_8B_ARGB2101010 3 77 # define EVERGREEN_GRPH_FORMAT_BGRA1010102 4 78 # define EVERGREEN_GRPH_FORMAT_8B_BGRA1010102 5 79 # define EVERGREEN_GRPH_FORMAT_RGB111110 6 80 # define EVERGREEN_GRPH_FORMAT_BGR101111 7 81 #define EVERGREEN_GRPH_SWAP_CONTROL 0x680c 82 # define EVERGREEN_GRPH_ENDIAN_SWAP(x) (((x) & 0x3) << 0) 83 # define EVERGREEN_GRPH_ENDIAN_NONE 0 84 # define EVERGREEN_GRPH_ENDIAN_8IN16 1 85 # define EVERGREEN_GRPH_ENDIAN_8IN32 2 86 # define EVERGREEN_GRPH_ENDIAN_8IN64 3 87 # define EVERGREEN_GRPH_RED_CROSSBAR(x) (((x) & 0x3) << 4) 88 # define EVERGREEN_GRPH_RED_SEL_R 0 89 # define EVERGREEN_GRPH_RED_SEL_G 1 90 # define EVERGREEN_GRPH_RED_SEL_B 2 91 # define EVERGREEN_GRPH_RED_SEL_A 3 92 # define EVERGREEN_GRPH_GREEN_CROSSBAR(x) (((x) & 0x3) << 6) 93 # define EVERGREEN_GRPH_GREEN_SEL_G 0 94 # define EVERGREEN_GRPH_GREEN_SEL_B 1 95 # define EVERGREEN_GRPH_GREEN_SEL_A 2 96 # define EVERGREEN_GRPH_GREEN_SEL_R 3 97 # define EVERGREEN_GRPH_BLUE_CROSSBAR(x) (((x) & 0x3) << 8) 98 # define EVERGREEN_GRPH_BLUE_SEL_B 0 99 # define EVERGREEN_GRPH_BLUE_SEL_A 1 100 # define EVERGREEN_GRPH_BLUE_SEL_R 2 101 # define EVERGREEN_GRPH_BLUE_SEL_G 3 102 # define EVERGREEN_GRPH_ALPHA_CROSSBAR(x) (((x) & 0x3) << 10) 103 # define EVERGREEN_GRPH_ALPHA_SEL_A 0 104 # define EVERGREEN_GRPH_ALPHA_SEL_R 1 105 # define EVERGREEN_GRPH_ALPHA_SEL_G 2 106 # define EVERGREEN_GRPH_ALPHA_SEL_B 3 107 #define EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS 0x6810 108 #define EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS 0x6814 109 # define EVERGREEN_GRPH_DFQ_ENABLE (1 << 0) 110 # define EVERGREEN_GRPH_SURFACE_ADDRESS_MASK 0xffffff00 111 #define EVERGREEN_GRPH_PITCH 0x6818 112 #define EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x681c 113 #define EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x6820 114 #define EVERGREEN_GRPH_SURFACE_OFFSET_X 0x6824 115 #define EVERGREEN_GRPH_SURFACE_OFFSET_Y 0x6828 116 #define EVERGREEN_GRPH_X_START 0x682c 117 #define EVERGREEN_GRPH_Y_START 0x6830 118 #define EVERGREEN_GRPH_X_END 0x6834 119 #define EVERGREEN_GRPH_Y_END 0x6838 120 #define EVERGREEN_GRPH_FLIP_CONTROL 0x6848 121 # define EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN (1 << 0) 122 #define EVERGREEN_CUR_CONTROL 0x6998 123 # define EVERGREEN_CURSOR_EN (1 << 0) 124 # define EVERGREEN_CURSOR_MODE(x) (((x) & 0x3) << 8) 125 # define EVERGREEN_CURSOR_MONO 0 126 # define EVERGREEN_CURSOR_24_1 1 127 # define EVERGREEN_CURSOR_24_8_PRE_MULT 2 128 # define EVERGREEN_CURSOR_24_8_UNPRE_MULT 3 129 # define EVERGREEN_CURSOR_2X_MAGNIFY (1 << 16) 130 # define EVERGREEN_CURSOR_FORCE_MC_ON (1 << 20) 131 # define EVERGREEN_CURSOR_URGENT_CONTROL(x) (((x) & 0x7) << 24) 132 # define EVERGREEN_CURSOR_URGENT_ALWAYS 0 133 # define EVERGREEN_CURSOR_URGENT_1_8 1 134 # define EVERGREEN_CURSOR_URGENT_1_4 2 135 # define EVERGREEN_CURSOR_URGENT_3_8 3 136 # define EVERGREEN_CURSOR_URGENT_1_2 4 137 #define EVERGREEN_CUR_SURFACE_ADDRESS 0x699c 138 # define EVERGREEN_CUR_SURFACE_ADDRESS_MASK 0xfffff000 139 #define EVERGREEN_CUR_SIZE 0x69a0 140 #define EVERGREEN_CUR_SURFACE_ADDRESS_HIGH 0x69a4 141 #define EVERGREEN_CUR_POSITION 0x69a8 142 #define EVERGREEN_CUR_HOT_SPOT 0x69ac 143 #define EVERGREEN_CUR_COLOR1 0x69b0 144 #define EVERGREEN_CUR_COLOR2 0x69b4 145 #define EVERGREEN_CUR_UPDATE 0x69b8 146 # define EVERGREEN_CURSOR_UPDATE_PENDING (1 << 0) 147 # define EVERGREEN_CURSOR_UPDATE_TAKEN (1 << 1) 148 # define EVERGREEN_CURSOR_UPDATE_LOCK (1 << 16) 149 # define EVERGREEN_CURSOR_DISABLE_MULTIPLE_UPDATE (1 << 24) 150 #define EVERGREEN_DC_LUT_RW_MODE 0x69e0 151 #define EVERGREEN_DC_LUT_RW_INDEX 0x69e4 152 #define EVERGREEN_DC_LUT_SEQ_COLOR 0x69e8 153 #define EVERGREEN_DC_LUT_PWL_DATA 0x69ec 154 #define EVERGREEN_DC_LUT_30_COLOR 0x69f0 155 #define EVERGREEN_DC_LUT_VGA_ACCESS_ENABLE 0x69f4 156 #define EVERGREEN_DC_LUT_WRITE_EN_MASK 0x69f8 157 #define EVERGREEN_DC_LUT_AUTOFILL 0x69fc 158 #define EVERGREEN_DC_LUT_CONTROL 0x6a00 159 #define EVERGREEN_DC_LUT_BLACK_OFFSET_BLUE 0x6a04 160 #define EVERGREEN_DC_LUT_BLACK_OFFSET_GREEN 0x6a08 161 #define EVERGREEN_DC_LUT_BLACK_OFFSET_RED 0x6a0c 162 #define EVERGREEN_DC_LUT_WHITE_OFFSET_BLUE 0x6a10 163 #define EVERGREEN_DC_LUT_WHITE_OFFSET_GREEN 0x6a14 164 #define EVERGREEN_DC_LUT_WHITE_OFFSET_RED 0x6a18 165 #define EVERGREEN_DATA_FORMAT 0x6b00 166 # define EVERGREEN_INTERLEAVE_EN (1 << 0) 167 #define EVERGREEN_DESKTOP_HEIGHT 0x6b04 168 #define EVERGREEN_VLINE_START_END 0x6b08 169 # define EVERGREEN_VLINE_START_SHIFT 0 170 # define EVERGREEN_VLINE_END_SHIFT 16 171 # define EVERGREEN_VLINE_INV (1 << 31) 172 #define EVERGREEN_VLINE_STATUS 0x6bb8 173 # define EVERGREEN_VLINE_STAT (1 << 12) 174 #define EVERGREEN_VIEWPORT_START 0x6d70 175 #define EVERGREEN_VIEWPORT_SIZE 0x6d74 176 #define EVERGREEN_CRTC0_REGISTER_OFFSET (0x6df0 - 0x6df0) 177 #define EVERGREEN_CRTC1_REGISTER_OFFSET (0x79f0 - 0x6df0) 178 #define EVERGREEN_CRTC2_REGISTER_OFFSET (0x105f0 - 0x6df0) 179 #define EVERGREEN_CRTC3_REGISTER_OFFSET (0x111f0 - 0x6df0) 180 #define EVERGREEN_CRTC4_REGISTER_OFFSET (0x11df0 - 0x6df0) 181 #define EVERGREEN_CRTC5_REGISTER_OFFSET (0x129f0 - 0x6df0) 182 #define EVERGREEN_CRTC_CONTROL 0x6e70 183 # define EVERGREEN_CRTC_MASTER_EN (1 << 0) 184 #define EVERGREEN_CRTC_UPDATE_LOCK 0x6ed4 185 #define EVERGREEN_MASTER_UPDATE_MODE 0x6ef8 186 #define EVERGREEN_DC_GPIO_HPD_MASK 0x64b0 187 #define EVERGREEN_DC_GPIO_HPD_A 0x64b4 188 #define EVERGREEN_DC_GPIO_HPD_EN 0x64b8 189 #define EVERGREEN_DC_GPIO_HPD_Y 0x64bc 190