1771fe6b9SJerome Glisse /* 2771fe6b9SJerome Glisse * Copyright 2008 Advanced Micro Devices, Inc. 3771fe6b9SJerome Glisse * Copyright 2008 Red Hat Inc. 4771fe6b9SJerome Glisse * Copyright 2009 Jerome Glisse. 5771fe6b9SJerome Glisse * 6771fe6b9SJerome Glisse * Permission is hereby granted, free of charge, to any person obtaining a 7771fe6b9SJerome Glisse * copy of this software and associated documentation files (the "Software"), 8771fe6b9SJerome Glisse * to deal in the Software without restriction, including without limitation 9771fe6b9SJerome Glisse * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10771fe6b9SJerome Glisse * and/or sell copies of the Software, and to permit persons to whom the 11771fe6b9SJerome Glisse * Software is furnished to do so, subject to the following conditions: 12771fe6b9SJerome Glisse * 13771fe6b9SJerome Glisse * The above copyright notice and this permission notice shall be included in 14771fe6b9SJerome Glisse * all copies or substantial portions of the Software. 15771fe6b9SJerome Glisse * 16771fe6b9SJerome Glisse * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17771fe6b9SJerome Glisse * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18771fe6b9SJerome Glisse * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19771fe6b9SJerome Glisse * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 20771fe6b9SJerome Glisse * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21771fe6b9SJerome Glisse * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22771fe6b9SJerome Glisse * OTHER DEALINGS IN THE SOFTWARE. 23771fe6b9SJerome Glisse * 24771fe6b9SJerome Glisse * Authors: Dave Airlie 25771fe6b9SJerome Glisse * Alex Deucher 26771fe6b9SJerome Glisse * Jerome Glisse 27771fe6b9SJerome Glisse */ 28771fe6b9SJerome Glisse #ifndef __R500_REG_H__ 29771fe6b9SJerome Glisse #define __R500_REG_H__ 30771fe6b9SJerome Glisse 31771fe6b9SJerome Glisse /* pipe config regs */ 32771fe6b9SJerome Glisse #define R300_GA_POLY_MODE 0x4288 33771fe6b9SJerome Glisse # define R300_FRONT_PTYPE_POINT (0 << 4) 34771fe6b9SJerome Glisse # define R300_FRONT_PTYPE_LINE (1 << 4) 35771fe6b9SJerome Glisse # define R300_FRONT_PTYPE_TRIANGE (2 << 4) 36771fe6b9SJerome Glisse # define R300_BACK_PTYPE_POINT (0 << 7) 37771fe6b9SJerome Glisse # define R300_BACK_PTYPE_LINE (1 << 7) 38771fe6b9SJerome Glisse # define R300_BACK_PTYPE_TRIANGE (2 << 7) 39771fe6b9SJerome Glisse #define R300_GA_ROUND_MODE 0x428c 40771fe6b9SJerome Glisse # define R300_GEOMETRY_ROUND_TRUNC (0 << 0) 41771fe6b9SJerome Glisse # define R300_GEOMETRY_ROUND_NEAREST (1 << 0) 42771fe6b9SJerome Glisse # define R300_COLOR_ROUND_TRUNC (0 << 2) 43771fe6b9SJerome Glisse # define R300_COLOR_ROUND_NEAREST (1 << 2) 44771fe6b9SJerome Glisse #define R300_GB_MSPOS0 0x4010 45771fe6b9SJerome Glisse # define R300_MS_X0_SHIFT 0 46771fe6b9SJerome Glisse # define R300_MS_Y0_SHIFT 4 47771fe6b9SJerome Glisse # define R300_MS_X1_SHIFT 8 48771fe6b9SJerome Glisse # define R300_MS_Y1_SHIFT 12 49771fe6b9SJerome Glisse # define R300_MS_X2_SHIFT 16 50771fe6b9SJerome Glisse # define R300_MS_Y2_SHIFT 20 51771fe6b9SJerome Glisse # define R300_MSBD0_Y_SHIFT 24 52771fe6b9SJerome Glisse # define R300_MSBD0_X_SHIFT 28 53771fe6b9SJerome Glisse #define R300_GB_MSPOS1 0x4014 54771fe6b9SJerome Glisse # define R300_MS_X3_SHIFT 0 55771fe6b9SJerome Glisse # define R300_MS_Y3_SHIFT 4 56771fe6b9SJerome Glisse # define R300_MS_X4_SHIFT 8 57771fe6b9SJerome Glisse # define R300_MS_Y4_SHIFT 12 58771fe6b9SJerome Glisse # define R300_MS_X5_SHIFT 16 59771fe6b9SJerome Glisse # define R300_MS_Y5_SHIFT 20 60771fe6b9SJerome Glisse # define R300_MSBD1_SHIFT 24 61771fe6b9SJerome Glisse 62771fe6b9SJerome Glisse #define R300_GA_ENHANCE 0x4274 63771fe6b9SJerome Glisse # define R300_GA_DEADLOCK_CNTL (1 << 0) 64771fe6b9SJerome Glisse # define R300_GA_FASTSYNC_CNTL (1 << 1) 65771fe6b9SJerome Glisse #define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c 66771fe6b9SJerome Glisse # define R300_RB3D_DC_FLUSH (2 << 0) 67771fe6b9SJerome Glisse # define R300_RB3D_DC_FREE (2 << 2) 68771fe6b9SJerome Glisse # define R300_RB3D_DC_FINISH (1 << 4) 69771fe6b9SJerome Glisse #define R300_RB3D_ZCACHE_CTLSTAT 0x4f18 70771fe6b9SJerome Glisse # define R300_ZC_FLUSH (1 << 0) 71771fe6b9SJerome Glisse # define R300_ZC_FREE (1 << 1) 72771fe6b9SJerome Glisse # define R300_ZC_FLUSH_ALL 0x3 73771fe6b9SJerome Glisse #define R400_GB_PIPE_SELECT 0x402c 74771fe6b9SJerome Glisse #define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ 75771fe6b9SJerome Glisse #define R500_SU_REG_DEST 0x42c8 76771fe6b9SJerome Glisse #define R300_GB_TILE_CONFIG 0x4018 77771fe6b9SJerome Glisse # define R300_ENABLE_TILING (1 << 0) 78771fe6b9SJerome Glisse # define R300_PIPE_COUNT_RV350 (0 << 1) 79771fe6b9SJerome Glisse # define R300_PIPE_COUNT_R300 (3 << 1) 80771fe6b9SJerome Glisse # define R300_PIPE_COUNT_R420_3P (6 << 1) 81771fe6b9SJerome Glisse # define R300_PIPE_COUNT_R420 (7 << 1) 82771fe6b9SJerome Glisse # define R300_TILE_SIZE_8 (0 << 4) 83771fe6b9SJerome Glisse # define R300_TILE_SIZE_16 (1 << 4) 84771fe6b9SJerome Glisse # define R300_TILE_SIZE_32 (2 << 4) 85771fe6b9SJerome Glisse # define R300_SUBPIXEL_1_12 (0 << 16) 86771fe6b9SJerome Glisse # define R300_SUBPIXEL_1_16 (1 << 16) 87771fe6b9SJerome Glisse #define R300_DST_PIPE_CONFIG 0x170c 88771fe6b9SJerome Glisse # define R300_PIPE_AUTO_CONFIG (1 << 31) 89771fe6b9SJerome Glisse #define R300_RB2D_DSTCACHE_MODE 0x3428 90771fe6b9SJerome Glisse # define R300_DC_AUTOFLUSH_ENABLE (1 << 8) 91771fe6b9SJerome Glisse # define R300_DC_DC_DISABLE_IGNORE_PE (1 << 17) 92771fe6b9SJerome Glisse 93771fe6b9SJerome Glisse #define RADEON_CP_STAT 0x7C0 94771fe6b9SJerome Glisse #define RADEON_RBBM_CMDFIFO_ADDR 0xE70 95771fe6b9SJerome Glisse #define RADEON_RBBM_CMDFIFO_DATA 0xE74 96771fe6b9SJerome Glisse #define RADEON_ISYNC_CNTL 0x1724 97771fe6b9SJerome Glisse # define RADEON_ISYNC_ANY2D_IDLE3D (1 << 0) 98771fe6b9SJerome Glisse # define RADEON_ISYNC_ANY3D_IDLE2D (1 << 1) 99771fe6b9SJerome Glisse # define RADEON_ISYNC_TRIG2D_IDLE3D (1 << 2) 100771fe6b9SJerome Glisse # define RADEON_ISYNC_TRIG3D_IDLE2D (1 << 3) 101771fe6b9SJerome Glisse # define RADEON_ISYNC_WAIT_IDLEGUI (1 << 4) 102771fe6b9SJerome Glisse # define RADEON_ISYNC_CPSCRATCH_IDLEGUI (1 << 5) 103771fe6b9SJerome Glisse 104771fe6b9SJerome Glisse #define RS480_NB_MC_INDEX 0x168 105771fe6b9SJerome Glisse # define RS480_NB_MC_IND_WR_EN (1 << 8) 106771fe6b9SJerome Glisse #define RS480_NB_MC_DATA 0x16c 107771fe6b9SJerome Glisse 108771fe6b9SJerome Glisse /* 109771fe6b9SJerome Glisse * RS690 110771fe6b9SJerome Glisse */ 111771fe6b9SJerome Glisse #define RS690_MCCFG_FB_LOCATION 0x100 112771fe6b9SJerome Glisse #define RS690_MC_FB_START_MASK 0x0000FFFF 113771fe6b9SJerome Glisse #define RS690_MC_FB_START_SHIFT 0 114771fe6b9SJerome Glisse #define RS690_MC_FB_TOP_MASK 0xFFFF0000 115771fe6b9SJerome Glisse #define RS690_MC_FB_TOP_SHIFT 16 116771fe6b9SJerome Glisse #define RS690_MCCFG_AGP_LOCATION 0x101 117771fe6b9SJerome Glisse #define RS690_MC_AGP_START_MASK 0x0000FFFF 118771fe6b9SJerome Glisse #define RS690_MC_AGP_START_SHIFT 0 119771fe6b9SJerome Glisse #define RS690_MC_AGP_TOP_MASK 0xFFFF0000 120771fe6b9SJerome Glisse #define RS690_MC_AGP_TOP_SHIFT 16 121771fe6b9SJerome Glisse #define RS690_MCCFG_AGP_BASE 0x102 122771fe6b9SJerome Glisse #define RS690_MCCFG_AGP_BASE_2 0x103 123771fe6b9SJerome Glisse #define RS690_MC_INIT_MISC_LAT_TIMER 0x104 124771fe6b9SJerome Glisse #define RS690_HDP_FB_LOCATION 0x0134 125771fe6b9SJerome Glisse #define RS690_MC_INDEX 0x78 126771fe6b9SJerome Glisse # define RS690_MC_INDEX_MASK 0x1ff 127771fe6b9SJerome Glisse # define RS690_MC_INDEX_WR_EN (1 << 9) 128771fe6b9SJerome Glisse # define RS690_MC_INDEX_WR_ACK 0x7f 129771fe6b9SJerome Glisse #define RS690_MC_DATA 0x7c 130771fe6b9SJerome Glisse #define RS690_MC_STATUS 0x90 131771fe6b9SJerome Glisse #define RS690_MC_STATUS_IDLE (1 << 0) 132771fe6b9SJerome Glisse #define RS480_AGP_BASE_2 0x0164 133771fe6b9SJerome Glisse #define RS480_MC_MISC_CNTL 0x18 134771fe6b9SJerome Glisse # define RS480_DISABLE_GTW (1 << 1) 135771fe6b9SJerome Glisse # define RS480_GART_INDEX_REG_EN (1 << 12) 136771fe6b9SJerome Glisse # define RS690_BLOCK_GFX_D3_EN (1 << 14) 137771fe6b9SJerome Glisse #define RS480_GART_FEATURE_ID 0x2b 138771fe6b9SJerome Glisse # define RS480_HANG_EN (1 << 11) 139771fe6b9SJerome Glisse # define RS480_TLB_ENABLE (1 << 18) 140771fe6b9SJerome Glisse # define RS480_P2P_ENABLE (1 << 19) 141771fe6b9SJerome Glisse # define RS480_GTW_LAC_EN (1 << 25) 142771fe6b9SJerome Glisse # define RS480_2LEVEL_GART (0 << 30) 143771fe6b9SJerome Glisse # define RS480_1LEVEL_GART (1 << 30) 144771fe6b9SJerome Glisse # define RS480_PDC_EN (1 << 31) 145771fe6b9SJerome Glisse #define RS480_GART_BASE 0x2c 146771fe6b9SJerome Glisse #define RS480_GART_CACHE_CNTRL 0x2e 147771fe6b9SJerome Glisse # define RS480_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */ 148771fe6b9SJerome Glisse #define RS480_AGP_ADDRESS_SPACE_SIZE 0x38 149771fe6b9SJerome Glisse # define RS480_GART_EN (1 << 0) 150771fe6b9SJerome Glisse # define RS480_VA_SIZE_32MB (0 << 1) 151771fe6b9SJerome Glisse # define RS480_VA_SIZE_64MB (1 << 1) 152771fe6b9SJerome Glisse # define RS480_VA_SIZE_128MB (2 << 1) 153771fe6b9SJerome Glisse # define RS480_VA_SIZE_256MB (3 << 1) 154771fe6b9SJerome Glisse # define RS480_VA_SIZE_512MB (4 << 1) 155771fe6b9SJerome Glisse # define RS480_VA_SIZE_1GB (5 << 1) 156771fe6b9SJerome Glisse # define RS480_VA_SIZE_2GB (6 << 1) 157771fe6b9SJerome Glisse #define RS480_AGP_MODE_CNTL 0x39 158771fe6b9SJerome Glisse # define RS480_POST_GART_Q_SIZE (1 << 18) 159771fe6b9SJerome Glisse # define RS480_NONGART_SNOOP (1 << 19) 160771fe6b9SJerome Glisse # define RS480_AGP_RD_BUF_SIZE (1 << 20) 161771fe6b9SJerome Glisse # define RS480_REQ_TYPE_SNOOP_SHIFT 22 162771fe6b9SJerome Glisse # define RS480_REQ_TYPE_SNOOP_MASK 0x3 163771fe6b9SJerome Glisse # define RS480_REQ_TYPE_SNOOP_DIS (1 << 24) 164771fe6b9SJerome Glisse 165771fe6b9SJerome Glisse #define RS690_AIC_CTRL_SCRATCH 0x3A 166771fe6b9SJerome Glisse # define RS690_DIS_OUT_OF_PCI_GART_ACCESS (1 << 1) 167771fe6b9SJerome Glisse 168771fe6b9SJerome Glisse /* 169771fe6b9SJerome Glisse * RS600 170771fe6b9SJerome Glisse */ 171771fe6b9SJerome Glisse #define RS600_MC_STATUS 0x0 172771fe6b9SJerome Glisse #define RS600_MC_STATUS_IDLE (1 << 0) 173771fe6b9SJerome Glisse #define RS600_MC_INDEX 0x70 174771fe6b9SJerome Glisse # define RS600_MC_ADDR_MASK 0xffff 175771fe6b9SJerome Glisse # define RS600_MC_IND_SEQ_RBS_0 (1 << 16) 176771fe6b9SJerome Glisse # define RS600_MC_IND_SEQ_RBS_1 (1 << 17) 177771fe6b9SJerome Glisse # define RS600_MC_IND_SEQ_RBS_2 (1 << 18) 178771fe6b9SJerome Glisse # define RS600_MC_IND_SEQ_RBS_3 (1 << 19) 179771fe6b9SJerome Glisse # define RS600_MC_IND_AIC_RBS (1 << 20) 180771fe6b9SJerome Glisse # define RS600_MC_IND_CITF_ARB0 (1 << 21) 181771fe6b9SJerome Glisse # define RS600_MC_IND_CITF_ARB1 (1 << 22) 182771fe6b9SJerome Glisse # define RS600_MC_IND_WR_EN (1 << 23) 183771fe6b9SJerome Glisse #define RS600_MC_DATA 0x74 184771fe6b9SJerome Glisse #define RS600_MC_STATUS 0x0 185771fe6b9SJerome Glisse # define RS600_MC_IDLE (1 << 1) 186771fe6b9SJerome Glisse #define RS600_MC_FB_LOCATION 0x4 187771fe6b9SJerome Glisse #define RS600_MC_FB_START_MASK 0x0000FFFF 188771fe6b9SJerome Glisse #define RS600_MC_FB_START_SHIFT 0 189771fe6b9SJerome Glisse #define RS600_MC_FB_TOP_MASK 0xFFFF0000 190771fe6b9SJerome Glisse #define RS600_MC_FB_TOP_SHIFT 16 191771fe6b9SJerome Glisse #define RS600_MC_AGP_LOCATION 0x5 192771fe6b9SJerome Glisse #define RS600_MC_AGP_START_MASK 0x0000FFFF 193771fe6b9SJerome Glisse #define RS600_MC_AGP_START_SHIFT 0 194771fe6b9SJerome Glisse #define RS600_MC_AGP_TOP_MASK 0xFFFF0000 195771fe6b9SJerome Glisse #define RS600_MC_AGP_TOP_SHIFT 16 196771fe6b9SJerome Glisse #define RS600_MC_AGP_BASE 0x6 197771fe6b9SJerome Glisse #define RS600_MC_AGP_BASE_2 0x7 198771fe6b9SJerome Glisse #define RS600_MC_CNTL1 0x9 199771fe6b9SJerome Glisse # define RS600_ENABLE_PAGE_TABLES (1 << 26) 200771fe6b9SJerome Glisse #define RS600_MC_PT0_CNTL 0x100 201771fe6b9SJerome Glisse # define RS600_ENABLE_PT (1 << 0) 202771fe6b9SJerome Glisse # define RS600_EFFECTIVE_L2_CACHE_SIZE(x) ((x) << 15) 203771fe6b9SJerome Glisse # define RS600_EFFECTIVE_L2_QUEUE_SIZE(x) ((x) << 21) 204771fe6b9SJerome Glisse # define RS600_INVALIDATE_ALL_L1_TLBS (1 << 28) 205771fe6b9SJerome Glisse # define RS600_INVALIDATE_L2_CACHE (1 << 29) 206771fe6b9SJerome Glisse #define RS600_MC_PT0_CONTEXT0_CNTL 0x102 207771fe6b9SJerome Glisse # define RS600_ENABLE_PAGE_TABLE (1 << 0) 208771fe6b9SJerome Glisse # define RS600_PAGE_TABLE_TYPE_FLAT (0 << 1) 209771fe6b9SJerome Glisse #define RS600_MC_PT0_SYSTEM_APERTURE_LOW_ADDR 0x112 210771fe6b9SJerome Glisse #define RS600_MC_PT0_SYSTEM_APERTURE_HIGH_ADDR 0x114 211771fe6b9SJerome Glisse #define RS600_MC_PT0_CONTEXT0_DEFAULT_READ_ADDR 0x11c 212771fe6b9SJerome Glisse #define RS600_MC_PT0_CONTEXT0_FLAT_BASE_ADDR 0x12c 213771fe6b9SJerome Glisse #define RS600_MC_PT0_CONTEXT0_FLAT_START_ADDR 0x13c 214771fe6b9SJerome Glisse #define RS600_MC_PT0_CONTEXT0_FLAT_END_ADDR 0x14c 215771fe6b9SJerome Glisse #define RS600_MC_PT0_CLIENT0_CNTL 0x16c 216771fe6b9SJerome Glisse # define RS600_ENABLE_TRANSLATION_MODE_OVERRIDE (1 << 0) 217771fe6b9SJerome Glisse # define RS600_TRANSLATION_MODE_OVERRIDE (1 << 1) 218771fe6b9SJerome Glisse # define RS600_SYSTEM_ACCESS_MODE_MASK (3 << 8) 219771fe6b9SJerome Glisse # define RS600_SYSTEM_ACCESS_MODE_PA_ONLY (0 << 8) 220771fe6b9SJerome Glisse # define RS600_SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 8) 221771fe6b9SJerome Glisse # define RS600_SYSTEM_ACCESS_MODE_IN_SYS (2 << 8) 222771fe6b9SJerome Glisse # define RS600_SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 8) 223771fe6b9SJerome Glisse # define RS600_SYSTEM_APERTURE_UNMAPPED_ACCESS_PASSTHROUGH (0 << 10) 224771fe6b9SJerome Glisse # define RS600_SYSTEM_APERTURE_UNMAPPED_ACCESS_DEFAULT_PAGE (1 << 10) 225771fe6b9SJerome Glisse # define RS600_EFFECTIVE_L1_CACHE_SIZE(x) ((x) << 11) 226771fe6b9SJerome Glisse # define RS600_ENABLE_FRAGMENT_PROCESSING (1 << 14) 227771fe6b9SJerome Glisse # define RS600_EFFECTIVE_L1_QUEUE_SIZE(x) ((x) << 15) 228771fe6b9SJerome Glisse # define RS600_INVALIDATE_L1_TLB (1 << 20) 229771fe6b9SJerome Glisse /* rs600/rs690/rs740 */ 230771fe6b9SJerome Glisse # define RS600_BUS_MASTER_DIS (1 << 14) 231771fe6b9SJerome Glisse # define RS600_MSI_REARM (1 << 20) 232771fe6b9SJerome Glisse /* see RS400_MSI_REARM in AIC_CNTL for rs480 */ 233771fe6b9SJerome Glisse 234771fe6b9SJerome Glisse 235771fe6b9SJerome Glisse 236771fe6b9SJerome Glisse #define RV515_MC_FB_LOCATION 0x01 237771fe6b9SJerome Glisse #define RV515_MC_FB_START_MASK 0x0000FFFF 238771fe6b9SJerome Glisse #define RV515_MC_FB_START_SHIFT 0 239771fe6b9SJerome Glisse #define RV515_MC_FB_TOP_MASK 0xFFFF0000 240771fe6b9SJerome Glisse #define RV515_MC_FB_TOP_SHIFT 16 241771fe6b9SJerome Glisse #define RV515_MC_AGP_LOCATION 0x02 242771fe6b9SJerome Glisse #define RV515_MC_AGP_START_MASK 0x0000FFFF 243771fe6b9SJerome Glisse #define RV515_MC_AGP_START_SHIFT 0 244771fe6b9SJerome Glisse #define RV515_MC_AGP_TOP_MASK 0xFFFF0000 245771fe6b9SJerome Glisse #define RV515_MC_AGP_TOP_SHIFT 16 246771fe6b9SJerome Glisse #define RV515_MC_AGP_BASE 0x03 247771fe6b9SJerome Glisse #define RV515_MC_AGP_BASE_2 0x04 248771fe6b9SJerome Glisse 249771fe6b9SJerome Glisse #define R520_MC_FB_LOCATION 0x04 250771fe6b9SJerome Glisse #define R520_MC_FB_START_MASK 0x0000FFFF 251771fe6b9SJerome Glisse #define R520_MC_FB_START_SHIFT 0 252771fe6b9SJerome Glisse #define R520_MC_FB_TOP_MASK 0xFFFF0000 253771fe6b9SJerome Glisse #define R520_MC_FB_TOP_SHIFT 16 254771fe6b9SJerome Glisse #define R520_MC_AGP_LOCATION 0x05 255771fe6b9SJerome Glisse #define R520_MC_AGP_START_MASK 0x0000FFFF 256771fe6b9SJerome Glisse #define R520_MC_AGP_START_SHIFT 0 257771fe6b9SJerome Glisse #define R520_MC_AGP_TOP_MASK 0xFFFF0000 258771fe6b9SJerome Glisse #define R520_MC_AGP_TOP_SHIFT 16 259771fe6b9SJerome Glisse #define R520_MC_AGP_BASE 0x06 260771fe6b9SJerome Glisse #define R520_MC_AGP_BASE_2 0x07 261771fe6b9SJerome Glisse 262771fe6b9SJerome Glisse 263771fe6b9SJerome Glisse #define AVIVO_MC_INDEX 0x0070 264771fe6b9SJerome Glisse #define R520_MC_STATUS 0x00 265771fe6b9SJerome Glisse #define R520_MC_STATUS_IDLE (1<<1) 266771fe6b9SJerome Glisse #define RV515_MC_STATUS 0x08 267771fe6b9SJerome Glisse #define RV515_MC_STATUS_IDLE (1<<4) 268771fe6b9SJerome Glisse #define RV515_MC_INIT_MISC_LAT_TIMER 0x09 269771fe6b9SJerome Glisse #define AVIVO_MC_DATA 0x0074 270771fe6b9SJerome Glisse 271771fe6b9SJerome Glisse #define R520_MC_IND_INDEX 0x70 272771fe6b9SJerome Glisse #define R520_MC_IND_WR_EN (1 << 24) 273771fe6b9SJerome Glisse #define R520_MC_IND_DATA 0x74 274771fe6b9SJerome Glisse 275771fe6b9SJerome Glisse #define RV515_MC_CNTL 0x5 276771fe6b9SJerome Glisse # define RV515_MEM_NUM_CHANNELS_MASK 0x3 277771fe6b9SJerome Glisse #define R520_MC_CNTL0 0x8 278771fe6b9SJerome Glisse # define R520_MEM_NUM_CHANNELS_MASK (0x3 << 24) 279771fe6b9SJerome Glisse # define R520_MEM_NUM_CHANNELS_SHIFT 24 280771fe6b9SJerome Glisse # define R520_MC_CHANNEL_SIZE (1 << 23) 281771fe6b9SJerome Glisse 282771fe6b9SJerome Glisse #define AVIVO_CP_DYN_CNTL 0x000f /* PLL */ 283771fe6b9SJerome Glisse # define AVIVO_CP_FORCEON (1 << 0) 284771fe6b9SJerome Glisse #define AVIVO_E2_DYN_CNTL 0x0011 /* PLL */ 285771fe6b9SJerome Glisse # define AVIVO_E2_FORCEON (1 << 0) 286771fe6b9SJerome Glisse #define AVIVO_IDCT_DYN_CNTL 0x0013 /* PLL */ 287771fe6b9SJerome Glisse # define AVIVO_IDCT_FORCEON (1 << 0) 288771fe6b9SJerome Glisse 289771fe6b9SJerome Glisse #define AVIVO_HDP_FB_LOCATION 0x134 290771fe6b9SJerome Glisse 291771fe6b9SJerome Glisse #define AVIVO_VGA_RENDER_CONTROL 0x0300 292771fe6b9SJerome Glisse # define AVIVO_VGA_VSTATUS_CNTL_MASK (3 << 16) 293771fe6b9SJerome Glisse #define AVIVO_D1VGA_CONTROL 0x0330 294771fe6b9SJerome Glisse # define AVIVO_DVGA_CONTROL_MODE_ENABLE (1<<0) 295771fe6b9SJerome Glisse # define AVIVO_DVGA_CONTROL_TIMING_SELECT (1<<8) 296771fe6b9SJerome Glisse # define AVIVO_DVGA_CONTROL_SYNC_POLARITY_SELECT (1<<9) 297771fe6b9SJerome Glisse # define AVIVO_DVGA_CONTROL_OVERSCAN_TIMING_SELECT (1<<10) 298771fe6b9SJerome Glisse # define AVIVO_DVGA_CONTROL_OVERSCAN_COLOR_EN (1<<16) 299771fe6b9SJerome Glisse # define AVIVO_DVGA_CONTROL_ROTATE (1<<24) 300771fe6b9SJerome Glisse #define AVIVO_D2VGA_CONTROL 0x0338 301771fe6b9SJerome Glisse 302771fe6b9SJerome Glisse #define AVIVO_EXT1_PPLL_REF_DIV_SRC 0x400 303771fe6b9SJerome Glisse #define AVIVO_EXT1_PPLL_REF_DIV 0x404 304771fe6b9SJerome Glisse #define AVIVO_EXT1_PPLL_UPDATE_LOCK 0x408 305771fe6b9SJerome Glisse #define AVIVO_EXT1_PPLL_UPDATE_CNTL 0x40c 306771fe6b9SJerome Glisse 307771fe6b9SJerome Glisse #define AVIVO_EXT2_PPLL_REF_DIV_SRC 0x410 308771fe6b9SJerome Glisse #define AVIVO_EXT2_PPLL_REF_DIV 0x414 309771fe6b9SJerome Glisse #define AVIVO_EXT2_PPLL_UPDATE_LOCK 0x418 310771fe6b9SJerome Glisse #define AVIVO_EXT2_PPLL_UPDATE_CNTL 0x41c 311771fe6b9SJerome Glisse 312771fe6b9SJerome Glisse #define AVIVO_EXT1_PPLL_FB_DIV 0x430 313771fe6b9SJerome Glisse #define AVIVO_EXT2_PPLL_FB_DIV 0x434 314771fe6b9SJerome Glisse 315771fe6b9SJerome Glisse #define AVIVO_EXT1_PPLL_POST_DIV_SRC 0x438 316771fe6b9SJerome Glisse #define AVIVO_EXT1_PPLL_POST_DIV 0x43c 317771fe6b9SJerome Glisse 318771fe6b9SJerome Glisse #define AVIVO_EXT2_PPLL_POST_DIV_SRC 0x440 319771fe6b9SJerome Glisse #define AVIVO_EXT2_PPLL_POST_DIV 0x444 320771fe6b9SJerome Glisse 321771fe6b9SJerome Glisse #define AVIVO_EXT1_PPLL_CNTL 0x448 322771fe6b9SJerome Glisse #define AVIVO_EXT2_PPLL_CNTL 0x44c 323771fe6b9SJerome Glisse 324771fe6b9SJerome Glisse #define AVIVO_P1PLL_CNTL 0x450 325771fe6b9SJerome Glisse #define AVIVO_P2PLL_CNTL 0x454 326771fe6b9SJerome Glisse #define AVIVO_P1PLL_INT_SS_CNTL 0x458 327771fe6b9SJerome Glisse #define AVIVO_P2PLL_INT_SS_CNTL 0x45c 328771fe6b9SJerome Glisse #define AVIVO_P1PLL_TMDSA_CNTL 0x460 329771fe6b9SJerome Glisse #define AVIVO_P2PLL_LVTMA_CNTL 0x464 330771fe6b9SJerome Glisse 331771fe6b9SJerome Glisse #define AVIVO_PCLK_CRTC1_CNTL 0x480 332771fe6b9SJerome Glisse #define AVIVO_PCLK_CRTC2_CNTL 0x484 333771fe6b9SJerome Glisse 334771fe6b9SJerome Glisse #define AVIVO_D1CRTC_H_TOTAL 0x6000 335771fe6b9SJerome Glisse #define AVIVO_D1CRTC_H_BLANK_START_END 0x6004 336771fe6b9SJerome Glisse #define AVIVO_D1CRTC_H_SYNC_A 0x6008 337771fe6b9SJerome Glisse #define AVIVO_D1CRTC_H_SYNC_A_CNTL 0x600c 338771fe6b9SJerome Glisse #define AVIVO_D1CRTC_H_SYNC_B 0x6010 339771fe6b9SJerome Glisse #define AVIVO_D1CRTC_H_SYNC_B_CNTL 0x6014 340771fe6b9SJerome Glisse 341771fe6b9SJerome Glisse #define AVIVO_D1CRTC_V_TOTAL 0x6020 342771fe6b9SJerome Glisse #define AVIVO_D1CRTC_V_BLANK_START_END 0x6024 343771fe6b9SJerome Glisse #define AVIVO_D1CRTC_V_SYNC_A 0x6028 344771fe6b9SJerome Glisse #define AVIVO_D1CRTC_V_SYNC_A_CNTL 0x602c 345771fe6b9SJerome Glisse #define AVIVO_D1CRTC_V_SYNC_B 0x6030 346771fe6b9SJerome Glisse #define AVIVO_D1CRTC_V_SYNC_B_CNTL 0x6034 347771fe6b9SJerome Glisse 348771fe6b9SJerome Glisse #define AVIVO_D1CRTC_CONTROL 0x6080 349771fe6b9SJerome Glisse # define AVIVO_CRTC_EN (1 << 0) 350771fe6b9SJerome Glisse #define AVIVO_D1CRTC_BLANK_CONTROL 0x6084 351771fe6b9SJerome Glisse #define AVIVO_D1CRTC_INTERLACE_CONTROL 0x6088 352771fe6b9SJerome Glisse #define AVIVO_D1CRTC_INTERLACE_STATUS 0x608c 3537ed220d7SMichel Dänzer #define AVIVO_D1CRTC_FRAME_COUNT 0x60a4 354771fe6b9SJerome Glisse #define AVIVO_D1CRTC_STEREO_CONTROL 0x60c4 355771fe6b9SJerome Glisse 356771fe6b9SJerome Glisse /* master controls */ 357771fe6b9SJerome Glisse #define AVIVO_DC_CRTC_MASTER_EN 0x60f8 358771fe6b9SJerome Glisse #define AVIVO_DC_CRTC_TV_CONTROL 0x60fc 359771fe6b9SJerome Glisse 360771fe6b9SJerome Glisse #define AVIVO_D1GRPH_ENABLE 0x6100 361771fe6b9SJerome Glisse #define AVIVO_D1GRPH_CONTROL 0x6104 362771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_DEPTH_8BPP (0 << 0) 363771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_DEPTH_16BPP (1 << 0) 364771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_DEPTH_32BPP (2 << 0) 365771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_DEPTH_64BPP (3 << 0) 366771fe6b9SJerome Glisse 367771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_8BPP_INDEXED (0 << 8) 368771fe6b9SJerome Glisse 369771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555 (0 << 8) 370771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_16BPP_RGB565 (1 << 8) 371771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444 (2 << 8) 372771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_16BPP_AI88 (3 << 8) 373771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_16BPP_MONO16 (4 << 8) 374771fe6b9SJerome Glisse 375771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888 (0 << 8) 376771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010 (1 << 8) 377771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_32BPP_DIGITAL (2 << 8) 378771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_32BPP_8B_ARGB2101010 (3 << 8) 379771fe6b9SJerome Glisse 380771fe6b9SJerome Glisse 381771fe6b9SJerome Glisse # define AVIVO_D1GRPH_CONTROL_64BPP_ARGB16161616 (0 << 8) 382771fe6b9SJerome Glisse 383771fe6b9SJerome Glisse # define AVIVO_D1GRPH_SWAP_RB (1 << 16) 384771fe6b9SJerome Glisse # define AVIVO_D1GRPH_TILED (1 << 20) 385771fe6b9SJerome Glisse # define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1 << 21) 386771fe6b9SJerome Glisse 387c290dadfSAlex Deucher /* The R7xx *_HIGH surface regs are backwards; the D1 regs are in the D2 388c290dadfSAlex Deucher * block and vice versa. This applies to GRPH, CUR, etc. 389c290dadfSAlex Deucher */ 390771fe6b9SJerome Glisse #define AVIVO_D1GRPH_LUT_SEL 0x6108 391771fe6b9SJerome Glisse #define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110 392c290dadfSAlex Deucher #define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6914 393c290dadfSAlex Deucher #define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6114 394771fe6b9SJerome Glisse #define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS 0x6118 395c290dadfSAlex Deucher #define R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x691c 396c290dadfSAlex Deucher #define R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x611c 397771fe6b9SJerome Glisse #define AVIVO_D1GRPH_PITCH 0x6120 398771fe6b9SJerome Glisse #define AVIVO_D1GRPH_SURFACE_OFFSET_X 0x6124 399771fe6b9SJerome Glisse #define AVIVO_D1GRPH_SURFACE_OFFSET_Y 0x6128 400771fe6b9SJerome Glisse #define AVIVO_D1GRPH_X_START 0x612c 401771fe6b9SJerome Glisse #define AVIVO_D1GRPH_Y_START 0x6130 402771fe6b9SJerome Glisse #define AVIVO_D1GRPH_X_END 0x6134 403771fe6b9SJerome Glisse #define AVIVO_D1GRPH_Y_END 0x6138 404771fe6b9SJerome Glisse #define AVIVO_D1GRPH_UPDATE 0x6144 405771fe6b9SJerome Glisse # define AVIVO_D1GRPH_UPDATE_LOCK (1 << 16) 406771fe6b9SJerome Glisse #define AVIVO_D1GRPH_FLIP_CONTROL 0x6148 407771fe6b9SJerome Glisse 408771fe6b9SJerome Glisse #define AVIVO_D1CUR_CONTROL 0x6400 409771fe6b9SJerome Glisse # define AVIVO_D1CURSOR_EN (1 << 0) 410771fe6b9SJerome Glisse # define AVIVO_D1CURSOR_MODE_SHIFT 8 411771fe6b9SJerome Glisse # define AVIVO_D1CURSOR_MODE_MASK (3 << 8) 412771fe6b9SJerome Glisse # define AVIVO_D1CURSOR_MODE_24BPP 2 413771fe6b9SJerome Glisse #define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408 414c290dadfSAlex Deucher #define R700_D1CUR_SURFACE_ADDRESS_HIGH 0x6c0c 415c290dadfSAlex Deucher #define R700_D2CUR_SURFACE_ADDRESS_HIGH 0x640c 416771fe6b9SJerome Glisse #define AVIVO_D1CUR_SIZE 0x6410 417771fe6b9SJerome Glisse #define AVIVO_D1CUR_POSITION 0x6414 418771fe6b9SJerome Glisse #define AVIVO_D1CUR_HOT_SPOT 0x6418 419771fe6b9SJerome Glisse #define AVIVO_D1CUR_UPDATE 0x6424 420771fe6b9SJerome Glisse # define AVIVO_D1CURSOR_UPDATE_LOCK (1 << 16) 421771fe6b9SJerome Glisse 422771fe6b9SJerome Glisse #define AVIVO_DC_LUT_RW_SELECT 0x6480 423771fe6b9SJerome Glisse #define AVIVO_DC_LUT_RW_MODE 0x6484 424771fe6b9SJerome Glisse #define AVIVO_DC_LUT_RW_INDEX 0x6488 425771fe6b9SJerome Glisse #define AVIVO_DC_LUT_SEQ_COLOR 0x648c 426771fe6b9SJerome Glisse #define AVIVO_DC_LUT_PWL_DATA 0x6490 427771fe6b9SJerome Glisse #define AVIVO_DC_LUT_30_COLOR 0x6494 428771fe6b9SJerome Glisse #define AVIVO_DC_LUT_READ_PIPE_SELECT 0x6498 429771fe6b9SJerome Glisse #define AVIVO_DC_LUT_WRITE_EN_MASK 0x649c 430771fe6b9SJerome Glisse #define AVIVO_DC_LUT_AUTOFILL 0x64a0 431771fe6b9SJerome Glisse 432771fe6b9SJerome Glisse #define AVIVO_DC_LUTA_CONTROL 0x64c0 433771fe6b9SJerome Glisse #define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE 0x64c4 434771fe6b9SJerome Glisse #define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN 0x64c8 435771fe6b9SJerome Glisse #define AVIVO_DC_LUTA_BLACK_OFFSET_RED 0x64cc 436771fe6b9SJerome Glisse #define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE 0x64d0 437771fe6b9SJerome Glisse #define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN 0x64d4 438771fe6b9SJerome Glisse #define AVIVO_DC_LUTA_WHITE_OFFSET_RED 0x64d8 439771fe6b9SJerome Glisse 440771fe6b9SJerome Glisse #define AVIVO_DC_LB_MEMORY_SPLIT 0x6520 441771fe6b9SJerome Glisse # define AVIVO_DC_LB_MEMORY_SPLIT_MASK 0x3 442771fe6b9SJerome Glisse # define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT 0 443771fe6b9SJerome Glisse # define AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0 444771fe6b9SJerome Glisse # define AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1 445771fe6b9SJerome Glisse # define AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY 2 446771fe6b9SJerome Glisse # define AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3 447771fe6b9SJerome Glisse # define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2) 448771fe6b9SJerome Glisse # define AVIVO_DC_LB_DISP1_END_ADR_SHIFT 4 449771fe6b9SJerome Glisse # define AVIVO_DC_LB_DISP1_END_ADR_MASK 0x7ff 450771fe6b9SJerome Glisse 451771fe6b9SJerome Glisse #define AVIVO_D1MODE_DATA_FORMAT 0x6528 452771fe6b9SJerome Glisse # define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0) 453771fe6b9SJerome Glisse #define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652C 4547ed220d7SMichel Dänzer #define AVIVO_D1MODE_VBLANK_STATUS 0x6534 4557ed220d7SMichel Dänzer # define AVIVO_VBLANK_ACK (1 << 4) 456531369e6SDave Airlie #define AVIVO_D1MODE_VLINE_START_END 0x6538 4572f67c6e0SAlex Deucher #define AVIVO_D1MODE_VLINE_STATUS 0x653c 4582f67c6e0SAlex Deucher # define AVIVO_D1MODE_VLINE_STAT (1 << 12) 4597ed220d7SMichel Dänzer #define AVIVO_DxMODE_INT_MASK 0x6540 4607ed220d7SMichel Dänzer # define AVIVO_D1MODE_INT_MASK (1 << 0) 4617ed220d7SMichel Dänzer # define AVIVO_D2MODE_INT_MASK (1 << 8) 462771fe6b9SJerome Glisse #define AVIVO_D1MODE_VIEWPORT_START 0x6580 463771fe6b9SJerome Glisse #define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 464771fe6b9SJerome Glisse #define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588 465771fe6b9SJerome Glisse #define AVIVO_D1MODE_EXT_OVERSCAN_TOP_BOTTOM 0x658c 466771fe6b9SJerome Glisse 467771fe6b9SJerome Glisse #define AVIVO_D1SCL_SCALER_ENABLE 0x6590 468771fe6b9SJerome Glisse #define AVIVO_D1SCL_SCALER_TAP_CONTROL 0x6594 469771fe6b9SJerome Glisse #define AVIVO_D1SCL_UPDATE 0x65cc 470771fe6b9SJerome Glisse # define AVIVO_D1SCL_UPDATE_LOCK (1 << 16) 471771fe6b9SJerome Glisse 472771fe6b9SJerome Glisse /* second crtc */ 473771fe6b9SJerome Glisse #define AVIVO_D2CRTC_H_TOTAL 0x6800 474771fe6b9SJerome Glisse #define AVIVO_D2CRTC_H_BLANK_START_END 0x6804 475771fe6b9SJerome Glisse #define AVIVO_D2CRTC_H_SYNC_A 0x6808 476771fe6b9SJerome Glisse #define AVIVO_D2CRTC_H_SYNC_A_CNTL 0x680c 477771fe6b9SJerome Glisse #define AVIVO_D2CRTC_H_SYNC_B 0x6810 478771fe6b9SJerome Glisse #define AVIVO_D2CRTC_H_SYNC_B_CNTL 0x6814 479771fe6b9SJerome Glisse 480771fe6b9SJerome Glisse #define AVIVO_D2CRTC_V_TOTAL 0x6820 481771fe6b9SJerome Glisse #define AVIVO_D2CRTC_V_BLANK_START_END 0x6824 482771fe6b9SJerome Glisse #define AVIVO_D2CRTC_V_SYNC_A 0x6828 483771fe6b9SJerome Glisse #define AVIVO_D2CRTC_V_SYNC_A_CNTL 0x682c 484771fe6b9SJerome Glisse #define AVIVO_D2CRTC_V_SYNC_B 0x6830 485771fe6b9SJerome Glisse #define AVIVO_D2CRTC_V_SYNC_B_CNTL 0x6834 486771fe6b9SJerome Glisse 487771fe6b9SJerome Glisse #define AVIVO_D2CRTC_CONTROL 0x6880 488771fe6b9SJerome Glisse #define AVIVO_D2CRTC_BLANK_CONTROL 0x6884 489771fe6b9SJerome Glisse #define AVIVO_D2CRTC_INTERLACE_CONTROL 0x6888 490771fe6b9SJerome Glisse #define AVIVO_D2CRTC_INTERLACE_STATUS 0x688c 4917ed220d7SMichel Dänzer #define AVIVO_D2CRTC_FRAME_COUNT 0x68a4 492771fe6b9SJerome Glisse #define AVIVO_D2CRTC_STEREO_CONTROL 0x68c4 493771fe6b9SJerome Glisse 494771fe6b9SJerome Glisse #define AVIVO_D2GRPH_ENABLE 0x6900 495771fe6b9SJerome Glisse #define AVIVO_D2GRPH_CONTROL 0x6904 496771fe6b9SJerome Glisse #define AVIVO_D2GRPH_LUT_SEL 0x6908 497771fe6b9SJerome Glisse #define AVIVO_D2GRPH_PRIMARY_SURFACE_ADDRESS 0x6910 498771fe6b9SJerome Glisse #define AVIVO_D2GRPH_SECONDARY_SURFACE_ADDRESS 0x6918 499771fe6b9SJerome Glisse #define AVIVO_D2GRPH_PITCH 0x6920 500771fe6b9SJerome Glisse #define AVIVO_D2GRPH_SURFACE_OFFSET_X 0x6924 501771fe6b9SJerome Glisse #define AVIVO_D2GRPH_SURFACE_OFFSET_Y 0x6928 502771fe6b9SJerome Glisse #define AVIVO_D2GRPH_X_START 0x692c 503771fe6b9SJerome Glisse #define AVIVO_D2GRPH_Y_START 0x6930 504771fe6b9SJerome Glisse #define AVIVO_D2GRPH_X_END 0x6934 505771fe6b9SJerome Glisse #define AVIVO_D2GRPH_Y_END 0x6938 506771fe6b9SJerome Glisse #define AVIVO_D2GRPH_UPDATE 0x6944 507771fe6b9SJerome Glisse #define AVIVO_D2GRPH_FLIP_CONTROL 0x6948 508771fe6b9SJerome Glisse 509771fe6b9SJerome Glisse #define AVIVO_D2CUR_CONTROL 0x6c00 510771fe6b9SJerome Glisse #define AVIVO_D2CUR_SURFACE_ADDRESS 0x6c08 511771fe6b9SJerome Glisse #define AVIVO_D2CUR_SIZE 0x6c10 512771fe6b9SJerome Glisse #define AVIVO_D2CUR_POSITION 0x6c14 513771fe6b9SJerome Glisse 5147ed220d7SMichel Dänzer #define AVIVO_D2MODE_VBLANK_STATUS 0x6d34 515531369e6SDave Airlie #define AVIVO_D2MODE_VLINE_START_END 0x6d38 5162f67c6e0SAlex Deucher #define AVIVO_D2MODE_VLINE_STATUS 0x6d3c 517771fe6b9SJerome Glisse #define AVIVO_D2MODE_VIEWPORT_START 0x6d80 518771fe6b9SJerome Glisse #define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84 519771fe6b9SJerome Glisse #define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88 520771fe6b9SJerome Glisse #define AVIVO_D2MODE_EXT_OVERSCAN_TOP_BOTTOM 0x6d8c 521771fe6b9SJerome Glisse 522771fe6b9SJerome Glisse #define AVIVO_D2SCL_SCALER_ENABLE 0x6d90 523771fe6b9SJerome Glisse #define AVIVO_D2SCL_SCALER_TAP_CONTROL 0x6d94 524771fe6b9SJerome Glisse 525771fe6b9SJerome Glisse #define AVIVO_DDIA_BIT_DEPTH_CONTROL 0x7214 526771fe6b9SJerome Glisse 527771fe6b9SJerome Glisse #define AVIVO_DACA_ENABLE 0x7800 528771fe6b9SJerome Glisse # define AVIVO_DAC_ENABLE (1 << 0) 529771fe6b9SJerome Glisse #define AVIVO_DACA_SOURCE_SELECT 0x7804 530771fe6b9SJerome Glisse # define AVIVO_DAC_SOURCE_CRTC1 (0 << 0) 531771fe6b9SJerome Glisse # define AVIVO_DAC_SOURCE_CRTC2 (1 << 0) 532771fe6b9SJerome Glisse # define AVIVO_DAC_SOURCE_TV (2 << 0) 533771fe6b9SJerome Glisse 534771fe6b9SJerome Glisse #define AVIVO_DACA_FORCE_OUTPUT_CNTL 0x783c 535771fe6b9SJerome Glisse # define AVIVO_DACA_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) 536771fe6b9SJerome Glisse # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) 537771fe6b9SJerome Glisse # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) 538771fe6b9SJerome Glisse # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) 539771fe6b9SJerome Glisse # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) 540771fe6b9SJerome Glisse # define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) 541771fe6b9SJerome Glisse #define AVIVO_DACA_POWERDOWN 0x7850 542771fe6b9SJerome Glisse # define AVIVO_DACA_POWERDOWN_POWERDOWN (1 << 0) 543771fe6b9SJerome Glisse # define AVIVO_DACA_POWERDOWN_BLUE (1 << 8) 544771fe6b9SJerome Glisse # define AVIVO_DACA_POWERDOWN_GREEN (1 << 16) 545771fe6b9SJerome Glisse # define AVIVO_DACA_POWERDOWN_RED (1 << 24) 546771fe6b9SJerome Glisse 547771fe6b9SJerome Glisse #define AVIVO_DACB_ENABLE 0x7a00 548771fe6b9SJerome Glisse #define AVIVO_DACB_SOURCE_SELECT 0x7a04 549771fe6b9SJerome Glisse #define AVIVO_DACB_FORCE_OUTPUT_CNTL 0x7a3c 550771fe6b9SJerome Glisse # define AVIVO_DACB_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) 551771fe6b9SJerome Glisse # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) 552771fe6b9SJerome Glisse # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) 553771fe6b9SJerome Glisse # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) 554771fe6b9SJerome Glisse # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) 555771fe6b9SJerome Glisse # define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) 556771fe6b9SJerome Glisse #define AVIVO_DACB_POWERDOWN 0x7a50 557771fe6b9SJerome Glisse # define AVIVO_DACB_POWERDOWN_POWERDOWN (1 << 0) 558771fe6b9SJerome Glisse # define AVIVO_DACB_POWERDOWN_BLUE (1 << 8) 559771fe6b9SJerome Glisse # define AVIVO_DACB_POWERDOWN_GREEN (1 << 16) 560771fe6b9SJerome Glisse # define AVIVO_DACB_POWERDOWN_RED 561771fe6b9SJerome Glisse 562771fe6b9SJerome Glisse #define AVIVO_TMDSA_CNTL 0x7880 563771fe6b9SJerome Glisse # define AVIVO_TMDSA_CNTL_ENABLE (1 << 0) 564771fe6b9SJerome Glisse # define AVIVO_TMDSA_CNTL_HPD_MASK (1 << 4) 565771fe6b9SJerome Glisse # define AVIVO_TMDSA_CNTL_HPD_SELECT (1 << 8) 566771fe6b9SJerome Glisse # define AVIVO_TMDSA_CNTL_SYNC_PHASE (1 << 12) 567771fe6b9SJerome Glisse # define AVIVO_TMDSA_CNTL_PIXEL_ENCODING (1 << 16) 568771fe6b9SJerome Glisse # define AVIVO_TMDSA_CNTL_DUAL_LINK_ENABLE (1 << 24) 569771fe6b9SJerome Glisse # define AVIVO_TMDSA_CNTL_SWAP (1 << 28) 570771fe6b9SJerome Glisse #define AVIVO_TMDSA_SOURCE_SELECT 0x7884 571771fe6b9SJerome Glisse /* 78a8 appears to be some kind of (reasonably tolerant) clock? 572771fe6b9SJerome Glisse * 78d0 definitely hits the transmitter, definitely clock. */ 573771fe6b9SJerome Glisse /* MYSTERY1 This appears to control dithering? */ 574771fe6b9SJerome Glisse #define AVIVO_TMDSA_BIT_DEPTH_CONTROL 0x7894 575771fe6b9SJerome Glisse # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) 576771fe6b9SJerome Glisse # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) 577771fe6b9SJerome Glisse # define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) 578771fe6b9SJerome Glisse # define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) 579771fe6b9SJerome Glisse # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) 580771fe6b9SJerome Glisse # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) 581771fe6b9SJerome Glisse # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) 582771fe6b9SJerome Glisse # define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) 583771fe6b9SJerome Glisse #define AVIVO_TMDSA_DCBALANCER_CONTROL 0x78d0 584771fe6b9SJerome Glisse # define AVIVO_TMDSA_DCBALANCER_CONTROL_EN (1 << 0) 585771fe6b9SJerome Glisse # define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_EN (1 << 8) 586771fe6b9SJerome Glisse # define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) 587771fe6b9SJerome Glisse # define AVIVO_TMDSA_DCBALANCER_CONTROL_FORCE (1 << 24) 588771fe6b9SJerome Glisse #define AVIVO_TMDSA_DATA_SYNCHRONIZATION 0x78d8 589771fe6b9SJerome Glisse # define AVIVO_TMDSA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) 590771fe6b9SJerome Glisse # define AVIVO_TMDSA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) 591771fe6b9SJerome Glisse #define AVIVO_TMDSA_CLOCK_ENABLE 0x7900 592771fe6b9SJerome Glisse #define AVIVO_TMDSA_TRANSMITTER_ENABLE 0x7904 593771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX0_ENABLE (1 << 0) 594771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) 595771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) 596771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) 597771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) 598771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX1_ENABLE (1 << 8) 599771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) 600771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) 601771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) 602771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX_ENABLE_HPD_MASK (1 << 16) 603771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) 604771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) 605771fe6b9SJerome Glisse 606771fe6b9SJerome Glisse #define AVIVO_TMDSA_TRANSMITTER_CONTROL 0x7910 607771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) 608771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) 609771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) 610771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) 611771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) 612771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) 613771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK (1 << 8) 614771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) 615771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK (1 << 14) 616771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) 617771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) 618771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) 619771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) 620771fe6b9SJerome Glisse # define AVIVO_TMDSA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) 621771fe6b9SJerome Glisse 622771fe6b9SJerome Glisse #define AVIVO_LVTMA_CNTL 0x7a80 623771fe6b9SJerome Glisse # define AVIVO_LVTMA_CNTL_ENABLE (1 << 0) 624771fe6b9SJerome Glisse # define AVIVO_LVTMA_CNTL_HPD_MASK (1 << 4) 625771fe6b9SJerome Glisse # define AVIVO_LVTMA_CNTL_HPD_SELECT (1 << 8) 626771fe6b9SJerome Glisse # define AVIVO_LVTMA_CNTL_SYNC_PHASE (1 << 12) 627771fe6b9SJerome Glisse # define AVIVO_LVTMA_CNTL_PIXEL_ENCODING (1 << 16) 628771fe6b9SJerome Glisse # define AVIVO_LVTMA_CNTL_DUAL_LINK_ENABLE (1 << 24) 629771fe6b9SJerome Glisse # define AVIVO_LVTMA_CNTL_SWAP (1 << 28) 630771fe6b9SJerome Glisse #define AVIVO_LVTMA_SOURCE_SELECT 0x7a84 631771fe6b9SJerome Glisse #define AVIVO_LVTMA_COLOR_FORMAT 0x7a88 632771fe6b9SJerome Glisse #define AVIVO_LVTMA_BIT_DEPTH_CONTROL 0x7a94 633771fe6b9SJerome Glisse # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) 634771fe6b9SJerome Glisse # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) 635771fe6b9SJerome Glisse # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) 636771fe6b9SJerome Glisse # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) 637771fe6b9SJerome Glisse # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) 638771fe6b9SJerome Glisse # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) 639771fe6b9SJerome Glisse # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) 640771fe6b9SJerome Glisse # define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) 641771fe6b9SJerome Glisse 642771fe6b9SJerome Glisse 643771fe6b9SJerome Glisse 644771fe6b9SJerome Glisse #define AVIVO_LVTMA_DCBALANCER_CONTROL 0x7ad0 645771fe6b9SJerome Glisse # define AVIVO_LVTMA_DCBALANCER_CONTROL_EN (1 << 0) 646771fe6b9SJerome Glisse # define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_EN (1 << 8) 647771fe6b9SJerome Glisse # define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) 648771fe6b9SJerome Glisse # define AVIVO_LVTMA_DCBALANCER_CONTROL_FORCE (1 << 24) 649771fe6b9SJerome Glisse 650771fe6b9SJerome Glisse #define AVIVO_LVTMA_DATA_SYNCHRONIZATION 0x78d8 651771fe6b9SJerome Glisse # define AVIVO_LVTMA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) 652771fe6b9SJerome Glisse # define AVIVO_LVTMA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) 653771fe6b9SJerome Glisse #define R500_LVTMA_CLOCK_ENABLE 0x7b00 654771fe6b9SJerome Glisse #define R600_LVTMA_CLOCK_ENABLE 0x7b04 655771fe6b9SJerome Glisse 656771fe6b9SJerome Glisse #define R500_LVTMA_TRANSMITTER_ENABLE 0x7b04 657771fe6b9SJerome Glisse #define R600_LVTMA_TRANSMITTER_ENABLE 0x7b08 658771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) 659771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) 660771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) 661771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) 662771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD03EN (1 << 5) 663771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC1EN (1 << 9) 664771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) 665771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) 666771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) 667771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) 668771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) 669771fe6b9SJerome Glisse 670771fe6b9SJerome Glisse #define R500_LVTMA_TRANSMITTER_CONTROL 0x7b10 671771fe6b9SJerome Glisse #define R600_LVTMA_TRANSMITTER_CONTROL 0x7b14 672771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) 673771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) 674771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) 675771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) 676771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) 677771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) 678771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK (1 << 8) 679771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) 680771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK (1 << 14) 681771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) 682771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) 683771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) 684771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) 685771fe6b9SJerome Glisse # define AVIVO_LVTMA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) 686771fe6b9SJerome Glisse 687771fe6b9SJerome Glisse #define R500_LVTMA_PWRSEQ_CNTL 0x7af0 688771fe6b9SJerome Glisse #define R600_LVTMA_PWRSEQ_CNTL 0x7af4 689771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_EN (1 << 0) 690771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_PLL_ENABLE_MASK (1 << 2) 691771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_PLL_RESET_MASK (1 << 3) 692771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_TARGET_STATE (1 << 4) 693771fe6b9SJerome Glisse # define AVIVO_LVTMA_SYNCEN (1 << 8) 694771fe6b9SJerome Glisse # define AVIVO_LVTMA_SYNCEN_OVRD (1 << 9) 695771fe6b9SJerome Glisse # define AVIVO_LVTMA_SYNCEN_POL (1 << 10) 696771fe6b9SJerome Glisse # define AVIVO_LVTMA_DIGON (1 << 16) 697771fe6b9SJerome Glisse # define AVIVO_LVTMA_DIGON_OVRD (1 << 17) 698771fe6b9SJerome Glisse # define AVIVO_LVTMA_DIGON_POL (1 << 18) 699771fe6b9SJerome Glisse # define AVIVO_LVTMA_BLON (1 << 24) 700771fe6b9SJerome Glisse # define AVIVO_LVTMA_BLON_OVRD (1 << 25) 701771fe6b9SJerome Glisse # define AVIVO_LVTMA_BLON_POL (1 << 26) 702771fe6b9SJerome Glisse 703771fe6b9SJerome Glisse #define R500_LVTMA_PWRSEQ_STATE 0x7af4 704771fe6b9SJerome Glisse #define R600_LVTMA_PWRSEQ_STATE 0x7af8 705771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_STATE_TARGET_STATE_R (1 << 0) 706771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_STATE_DIGON (1 << 1) 707771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_STATE_SYNCEN (1 << 2) 708771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_STATE_BLON (1 << 3) 709771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_STATE_DONE (1 << 4) 710771fe6b9SJerome Glisse # define AVIVO_LVTMA_PWRSEQ_STATE_STATUS_SHIFT (8) 711771fe6b9SJerome Glisse 712771fe6b9SJerome Glisse #define AVIVO_LVDS_BACKLIGHT_CNTL 0x7af8 713771fe6b9SJerome Glisse # define AVIVO_LVDS_BACKLIGHT_CNTL_EN (1 << 0) 714771fe6b9SJerome Glisse # define AVIVO_LVDS_BACKLIGHT_LEVEL_MASK 0x0000ff00 715771fe6b9SJerome Glisse # define AVIVO_LVDS_BACKLIGHT_LEVEL_SHIFT 8 716771fe6b9SJerome Glisse 717771fe6b9SJerome Glisse #define AVIVO_DVOA_BIT_DEPTH_CONTROL 0x7988 718771fe6b9SJerome Glisse 719eed45b30SAlex Deucher #define AVIVO_DC_GPIO_HPD_A 0x7e94 720eed45b30SAlex Deucher 721771fe6b9SJerome Glisse #define AVIVO_GPIO_0 0x7e30 722771fe6b9SJerome Glisse #define AVIVO_GPIO_1 0x7e40 723771fe6b9SJerome Glisse #define AVIVO_GPIO_2 0x7e50 724771fe6b9SJerome Glisse #define AVIVO_GPIO_3 0x7e60 725771fe6b9SJerome Glisse 726771fe6b9SJerome Glisse #define AVIVO_DC_GPIO_HPD_Y 0x7e9c 727771fe6b9SJerome Glisse 728771fe6b9SJerome Glisse #define AVIVO_I2C_STATUS 0x7d30 729771fe6b9SJerome Glisse # define AVIVO_I2C_STATUS_DONE (1 << 0) 730771fe6b9SJerome Glisse # define AVIVO_I2C_STATUS_NACK (1 << 1) 731771fe6b9SJerome Glisse # define AVIVO_I2C_STATUS_HALT (1 << 2) 732771fe6b9SJerome Glisse # define AVIVO_I2C_STATUS_GO (1 << 3) 733771fe6b9SJerome Glisse # define AVIVO_I2C_STATUS_MASK 0x7 734771fe6b9SJerome Glisse /* If radeon_mm_i2c is to be believed, this is HALT, NACK, and maybe 735771fe6b9SJerome Glisse * DONE? */ 736771fe6b9SJerome Glisse # define AVIVO_I2C_STATUS_CMD_RESET 0x7 737771fe6b9SJerome Glisse # define AVIVO_I2C_STATUS_CMD_WAIT (1 << 3) 738771fe6b9SJerome Glisse #define AVIVO_I2C_STOP 0x7d34 739771fe6b9SJerome Glisse #define AVIVO_I2C_START_CNTL 0x7d38 740771fe6b9SJerome Glisse # define AVIVO_I2C_START (1 << 8) 741771fe6b9SJerome Glisse # define AVIVO_I2C_CONNECTOR0 (0 << 16) 742771fe6b9SJerome Glisse # define AVIVO_I2C_CONNECTOR1 (1 << 16) 743771fe6b9SJerome Glisse #define R520_I2C_START (1<<0) 744771fe6b9SJerome Glisse #define R520_I2C_STOP (1<<1) 745771fe6b9SJerome Glisse #define R520_I2C_RX (1<<2) 746771fe6b9SJerome Glisse #define R520_I2C_EN (1<<8) 747771fe6b9SJerome Glisse #define R520_I2C_DDC1 (0<<16) 748771fe6b9SJerome Glisse #define R520_I2C_DDC2 (1<<16) 749771fe6b9SJerome Glisse #define R520_I2C_DDC3 (2<<16) 750771fe6b9SJerome Glisse #define R520_I2C_DDC_MASK (3<<16) 751771fe6b9SJerome Glisse #define AVIVO_I2C_CONTROL2 0x7d3c 752771fe6b9SJerome Glisse # define AVIVO_I2C_7D3C_SIZE_SHIFT 8 753771fe6b9SJerome Glisse # define AVIVO_I2C_7D3C_SIZE_MASK (0xf << 8) 754771fe6b9SJerome Glisse #define AVIVO_I2C_CONTROL3 0x7d40 755771fe6b9SJerome Glisse /* Reading is done 4 bytes at a time: read the bottom 8 bits from 756771fe6b9SJerome Glisse * 7d44, four times in a row. 757771fe6b9SJerome Glisse * Writing is a little more complex. First write DATA with 758771fe6b9SJerome Glisse * 0xnnnnnnzz, then 0xnnnnnnyy, where nnnnnn is some non-deterministic 759771fe6b9SJerome Glisse * magic number, zz is, I think, the slave address, and yy is the byte 760771fe6b9SJerome Glisse * you want to write. */ 761771fe6b9SJerome Glisse #define AVIVO_I2C_DATA 0x7d44 762771fe6b9SJerome Glisse #define R520_I2C_ADDR_COUNT_MASK (0x7) 763771fe6b9SJerome Glisse #define R520_I2C_DATA_COUNT_SHIFT (8) 764771fe6b9SJerome Glisse #define R520_I2C_DATA_COUNT_MASK (0xF00) 765771fe6b9SJerome Glisse #define AVIVO_I2C_CNTL 0x7d50 766771fe6b9SJerome Glisse # define AVIVO_I2C_EN (1 << 0) 767771fe6b9SJerome Glisse # define AVIVO_I2C_RESET (1 << 8) 768771fe6b9SJerome Glisse 7697ed220d7SMichel Dänzer #define AVIVO_DISP_INTERRUPT_STATUS 0x7edc 7707ed220d7SMichel Dänzer # define AVIVO_D1_VBLANK_INTERRUPT (1 << 4) 7717ed220d7SMichel Dänzer # define AVIVO_D2_VBLANK_INTERRUPT (1 << 5) 7727ed220d7SMichel Dänzer 773771fe6b9SJerome Glisse #endif 774