18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright 2008 Advanced Micro Devices, Inc. 38c2ecf20Sopenharmony_ci * Copyright 2008 Red Hat Inc. 48c2ecf20Sopenharmony_ci * Copyright 2009 Jerome Glisse. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 78c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 88c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation 98c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 108c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 118c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 128c2ecf20Sopenharmony_ci * 138c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 148c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software. 158c2ecf20Sopenharmony_ci * 168c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 178c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 188c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 198c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 208c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 218c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 228c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 238c2ecf20Sopenharmony_ci * 248c2ecf20Sopenharmony_ci * Authors: Dave Airlie 258c2ecf20Sopenharmony_ci * Alex Deucher 268c2ecf20Sopenharmony_ci * Jerome Glisse 278c2ecf20Sopenharmony_ci */ 288c2ecf20Sopenharmony_ci#ifndef __R500_REG_H__ 298c2ecf20Sopenharmony_ci#define __R500_REG_H__ 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci/* pipe config regs */ 328c2ecf20Sopenharmony_ci#define R300_GA_POLY_MODE 0x4288 338c2ecf20Sopenharmony_ci# define R300_FRONT_PTYPE_POINT (0 << 4) 348c2ecf20Sopenharmony_ci# define R300_FRONT_PTYPE_LINE (1 << 4) 358c2ecf20Sopenharmony_ci# define R300_FRONT_PTYPE_TRIANGE (2 << 4) 368c2ecf20Sopenharmony_ci# define R300_BACK_PTYPE_POINT (0 << 7) 378c2ecf20Sopenharmony_ci# define R300_BACK_PTYPE_LINE (1 << 7) 388c2ecf20Sopenharmony_ci# define R300_BACK_PTYPE_TRIANGE (2 << 7) 398c2ecf20Sopenharmony_ci#define R300_GA_ROUND_MODE 0x428c 408c2ecf20Sopenharmony_ci# define R300_GEOMETRY_ROUND_TRUNC (0 << 0) 418c2ecf20Sopenharmony_ci# define R300_GEOMETRY_ROUND_NEAREST (1 << 0) 428c2ecf20Sopenharmony_ci# define R300_COLOR_ROUND_TRUNC (0 << 2) 438c2ecf20Sopenharmony_ci# define R300_COLOR_ROUND_NEAREST (1 << 2) 448c2ecf20Sopenharmony_ci#define R300_GB_MSPOS0 0x4010 458c2ecf20Sopenharmony_ci# define R300_MS_X0_SHIFT 0 468c2ecf20Sopenharmony_ci# define R300_MS_Y0_SHIFT 4 478c2ecf20Sopenharmony_ci# define R300_MS_X1_SHIFT 8 488c2ecf20Sopenharmony_ci# define R300_MS_Y1_SHIFT 12 498c2ecf20Sopenharmony_ci# define R300_MS_X2_SHIFT 16 508c2ecf20Sopenharmony_ci# define R300_MS_Y2_SHIFT 20 518c2ecf20Sopenharmony_ci# define R300_MSBD0_Y_SHIFT 24 528c2ecf20Sopenharmony_ci# define R300_MSBD0_X_SHIFT 28 538c2ecf20Sopenharmony_ci#define R300_GB_MSPOS1 0x4014 548c2ecf20Sopenharmony_ci# define R300_MS_X3_SHIFT 0 558c2ecf20Sopenharmony_ci# define R300_MS_Y3_SHIFT 4 568c2ecf20Sopenharmony_ci# define R300_MS_X4_SHIFT 8 578c2ecf20Sopenharmony_ci# define R300_MS_Y4_SHIFT 12 588c2ecf20Sopenharmony_ci# define R300_MS_X5_SHIFT 16 598c2ecf20Sopenharmony_ci# define R300_MS_Y5_SHIFT 20 608c2ecf20Sopenharmony_ci# define R300_MSBD1_SHIFT 24 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci#define R300_GA_ENHANCE 0x4274 638c2ecf20Sopenharmony_ci# define R300_GA_DEADLOCK_CNTL (1 << 0) 648c2ecf20Sopenharmony_ci# define R300_GA_FASTSYNC_CNTL (1 << 1) 658c2ecf20Sopenharmony_ci#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c 668c2ecf20Sopenharmony_ci# define R300_RB3D_DC_FLUSH (2 << 0) 678c2ecf20Sopenharmony_ci# define R300_RB3D_DC_FREE (2 << 2) 688c2ecf20Sopenharmony_ci# define R300_RB3D_DC_FINISH (1 << 4) 698c2ecf20Sopenharmony_ci#define R300_RB3D_ZCACHE_CTLSTAT 0x4f18 708c2ecf20Sopenharmony_ci# define R300_ZC_FLUSH (1 << 0) 718c2ecf20Sopenharmony_ci# define R300_ZC_FREE (1 << 1) 728c2ecf20Sopenharmony_ci# define R300_ZC_FLUSH_ALL 0x3 738c2ecf20Sopenharmony_ci#define R400_GB_PIPE_SELECT 0x402c 748c2ecf20Sopenharmony_ci#define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ 758c2ecf20Sopenharmony_ci#define R500_SU_REG_DEST 0x42c8 768c2ecf20Sopenharmony_ci#define R300_GB_TILE_CONFIG 0x4018 778c2ecf20Sopenharmony_ci# define R300_ENABLE_TILING (1 << 0) 788c2ecf20Sopenharmony_ci# define R300_PIPE_COUNT_RV350 (0 << 1) 798c2ecf20Sopenharmony_ci# define R300_PIPE_COUNT_R300 (3 << 1) 808c2ecf20Sopenharmony_ci# define R300_PIPE_COUNT_R420_3P (6 << 1) 818c2ecf20Sopenharmony_ci# define R300_PIPE_COUNT_R420 (7 << 1) 828c2ecf20Sopenharmony_ci# define R300_TILE_SIZE_8 (0 << 4) 838c2ecf20Sopenharmony_ci# define R300_TILE_SIZE_16 (1 << 4) 848c2ecf20Sopenharmony_ci# define R300_TILE_SIZE_32 (2 << 4) 858c2ecf20Sopenharmony_ci# define R300_SUBPIXEL_1_12 (0 << 16) 868c2ecf20Sopenharmony_ci# define R300_SUBPIXEL_1_16 (1 << 16) 878c2ecf20Sopenharmony_ci#define R300_DST_PIPE_CONFIG 0x170c 888c2ecf20Sopenharmony_ci# define R300_PIPE_AUTO_CONFIG (1 << 31) 898c2ecf20Sopenharmony_ci#define R300_RB2D_DSTCACHE_MODE 0x3428 908c2ecf20Sopenharmony_ci# define R300_DC_AUTOFLUSH_ENABLE (1 << 8) 918c2ecf20Sopenharmony_ci# define R300_DC_DC_DISABLE_IGNORE_PE (1 << 17) 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#define RADEON_CP_STAT 0x7C0 948c2ecf20Sopenharmony_ci#define RADEON_RBBM_CMDFIFO_ADDR 0xE70 958c2ecf20Sopenharmony_ci#define RADEON_RBBM_CMDFIFO_DATA 0xE74 968c2ecf20Sopenharmony_ci#define RADEON_ISYNC_CNTL 0x1724 978c2ecf20Sopenharmony_ci# define RADEON_ISYNC_ANY2D_IDLE3D (1 << 0) 988c2ecf20Sopenharmony_ci# define RADEON_ISYNC_ANY3D_IDLE2D (1 << 1) 998c2ecf20Sopenharmony_ci# define RADEON_ISYNC_TRIG2D_IDLE3D (1 << 2) 1008c2ecf20Sopenharmony_ci# define RADEON_ISYNC_TRIG3D_IDLE2D (1 << 3) 1018c2ecf20Sopenharmony_ci# define RADEON_ISYNC_WAIT_IDLEGUI (1 << 4) 1028c2ecf20Sopenharmony_ci# define RADEON_ISYNC_CPSCRATCH_IDLEGUI (1 << 5) 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci#define RS480_NB_MC_INDEX 0x168 1058c2ecf20Sopenharmony_ci# define RS480_NB_MC_IND_WR_EN (1 << 8) 1068c2ecf20Sopenharmony_ci#define RS480_NB_MC_DATA 0x16c 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ci/* 1098c2ecf20Sopenharmony_ci * RS690 1108c2ecf20Sopenharmony_ci */ 1118c2ecf20Sopenharmony_ci#define RS690_MCCFG_FB_LOCATION 0x100 1128c2ecf20Sopenharmony_ci#define RS690_MC_FB_START_MASK 0x0000FFFF 1138c2ecf20Sopenharmony_ci#define RS690_MC_FB_START_SHIFT 0 1148c2ecf20Sopenharmony_ci#define RS690_MC_FB_TOP_MASK 0xFFFF0000 1158c2ecf20Sopenharmony_ci#define RS690_MC_FB_TOP_SHIFT 16 1168c2ecf20Sopenharmony_ci#define RS690_MCCFG_AGP_LOCATION 0x101 1178c2ecf20Sopenharmony_ci#define RS690_MC_AGP_START_MASK 0x0000FFFF 1188c2ecf20Sopenharmony_ci#define RS690_MC_AGP_START_SHIFT 0 1198c2ecf20Sopenharmony_ci#define RS690_MC_AGP_TOP_MASK 0xFFFF0000 1208c2ecf20Sopenharmony_ci#define RS690_MC_AGP_TOP_SHIFT 16 1218c2ecf20Sopenharmony_ci#define RS690_MCCFG_AGP_BASE 0x102 1228c2ecf20Sopenharmony_ci#define RS690_MCCFG_AGP_BASE_2 0x103 1238c2ecf20Sopenharmony_ci#define RS690_MC_INIT_MISC_LAT_TIMER 0x104 1248c2ecf20Sopenharmony_ci#define RS690_HDP_FB_LOCATION 0x0134 1258c2ecf20Sopenharmony_ci#define RS690_MC_INDEX 0x78 1268c2ecf20Sopenharmony_ci# define RS690_MC_INDEX_MASK 0x1ff 1278c2ecf20Sopenharmony_ci# define RS690_MC_INDEX_WR_EN (1 << 9) 1288c2ecf20Sopenharmony_ci# define RS690_MC_INDEX_WR_ACK 0x7f 1298c2ecf20Sopenharmony_ci#define RS690_MC_DATA 0x7c 1308c2ecf20Sopenharmony_ci#define RS690_MC_STATUS 0x90 1318c2ecf20Sopenharmony_ci#define RS690_MC_STATUS_IDLE (1 << 0) 1328c2ecf20Sopenharmony_ci#define RS480_AGP_BASE_2 0x0164 1338c2ecf20Sopenharmony_ci#define RS480_MC_MISC_CNTL 0x18 1348c2ecf20Sopenharmony_ci# define RS480_DISABLE_GTW (1 << 1) 1358c2ecf20Sopenharmony_ci# define RS480_GART_INDEX_REG_EN (1 << 12) 1368c2ecf20Sopenharmony_ci# define RS690_BLOCK_GFX_D3_EN (1 << 14) 1378c2ecf20Sopenharmony_ci#define RS480_GART_FEATURE_ID 0x2b 1388c2ecf20Sopenharmony_ci# define RS480_HANG_EN (1 << 11) 1398c2ecf20Sopenharmony_ci# define RS480_TLB_ENABLE (1 << 18) 1408c2ecf20Sopenharmony_ci# define RS480_P2P_ENABLE (1 << 19) 1418c2ecf20Sopenharmony_ci# define RS480_GTW_LAC_EN (1 << 25) 1428c2ecf20Sopenharmony_ci# define RS480_2LEVEL_GART (0 << 30) 1438c2ecf20Sopenharmony_ci# define RS480_1LEVEL_GART (1 << 30) 1448c2ecf20Sopenharmony_ci# define RS480_PDC_EN (1 << 31) 1458c2ecf20Sopenharmony_ci#define RS480_GART_BASE 0x2c 1468c2ecf20Sopenharmony_ci#define RS480_GART_CACHE_CNTRL 0x2e 1478c2ecf20Sopenharmony_ci# define RS480_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */ 1488c2ecf20Sopenharmony_ci#define RS480_AGP_ADDRESS_SPACE_SIZE 0x38 1498c2ecf20Sopenharmony_ci# define RS480_GART_EN (1 << 0) 1508c2ecf20Sopenharmony_ci# define RS480_VA_SIZE_32MB (0 << 1) 1518c2ecf20Sopenharmony_ci# define RS480_VA_SIZE_64MB (1 << 1) 1528c2ecf20Sopenharmony_ci# define RS480_VA_SIZE_128MB (2 << 1) 1538c2ecf20Sopenharmony_ci# define RS480_VA_SIZE_256MB (3 << 1) 1548c2ecf20Sopenharmony_ci# define RS480_VA_SIZE_512MB (4 << 1) 1558c2ecf20Sopenharmony_ci# define RS480_VA_SIZE_1GB (5 << 1) 1568c2ecf20Sopenharmony_ci# define RS480_VA_SIZE_2GB (6 << 1) 1578c2ecf20Sopenharmony_ci#define RS480_AGP_MODE_CNTL 0x39 1588c2ecf20Sopenharmony_ci# define RS480_POST_GART_Q_SIZE (1 << 18) 1598c2ecf20Sopenharmony_ci# define RS480_NONGART_SNOOP (1 << 19) 1608c2ecf20Sopenharmony_ci# define RS480_AGP_RD_BUF_SIZE (1 << 20) 1618c2ecf20Sopenharmony_ci# define RS480_REQ_TYPE_SNOOP_SHIFT 22 1628c2ecf20Sopenharmony_ci# define RS480_REQ_TYPE_SNOOP_MASK 0x3 1638c2ecf20Sopenharmony_ci# define RS480_REQ_TYPE_SNOOP_DIS (1 << 24) 1648c2ecf20Sopenharmony_ci 1658c2ecf20Sopenharmony_ci#define RS690_AIC_CTRL_SCRATCH 0x3A 1668c2ecf20Sopenharmony_ci# define RS690_DIS_OUT_OF_PCI_GART_ACCESS (1 << 1) 1678c2ecf20Sopenharmony_ci 1688c2ecf20Sopenharmony_ci/* 1698c2ecf20Sopenharmony_ci * RS600 1708c2ecf20Sopenharmony_ci */ 1718c2ecf20Sopenharmony_ci#define RS600_MC_STATUS 0x0 1728c2ecf20Sopenharmony_ci#define RS600_MC_STATUS_IDLE (1 << 0) 1738c2ecf20Sopenharmony_ci#define RS600_MC_INDEX 0x70 1748c2ecf20Sopenharmony_ci# define RS600_MC_ADDR_MASK 0xffff 1758c2ecf20Sopenharmony_ci# define RS600_MC_IND_SEQ_RBS_0 (1 << 16) 1768c2ecf20Sopenharmony_ci# define RS600_MC_IND_SEQ_RBS_1 (1 << 17) 1778c2ecf20Sopenharmony_ci# define RS600_MC_IND_SEQ_RBS_2 (1 << 18) 1788c2ecf20Sopenharmony_ci# define RS600_MC_IND_SEQ_RBS_3 (1 << 19) 1798c2ecf20Sopenharmony_ci# define RS600_MC_IND_AIC_RBS (1 << 20) 1808c2ecf20Sopenharmony_ci# define RS600_MC_IND_CITF_ARB0 (1 << 21) 1818c2ecf20Sopenharmony_ci# define RS600_MC_IND_CITF_ARB1 (1 << 22) 1828c2ecf20Sopenharmony_ci# define RS600_MC_IND_WR_EN (1 << 23) 1838c2ecf20Sopenharmony_ci#define RS600_MC_DATA 0x74 1848c2ecf20Sopenharmony_ci#define RS600_MC_STATUS 0x0 1858c2ecf20Sopenharmony_ci# define RS600_MC_IDLE (1 << 1) 1868c2ecf20Sopenharmony_ci#define RS600_MC_FB_LOCATION 0x4 1878c2ecf20Sopenharmony_ci#define RS600_MC_FB_START_MASK 0x0000FFFF 1888c2ecf20Sopenharmony_ci#define RS600_MC_FB_START_SHIFT 0 1898c2ecf20Sopenharmony_ci#define RS600_MC_FB_TOP_MASK 0xFFFF0000 1908c2ecf20Sopenharmony_ci#define RS600_MC_FB_TOP_SHIFT 16 1918c2ecf20Sopenharmony_ci#define RS600_MC_AGP_LOCATION 0x5 1928c2ecf20Sopenharmony_ci#define RS600_MC_AGP_START_MASK 0x0000FFFF 1938c2ecf20Sopenharmony_ci#define RS600_MC_AGP_START_SHIFT 0 1948c2ecf20Sopenharmony_ci#define RS600_MC_AGP_TOP_MASK 0xFFFF0000 1958c2ecf20Sopenharmony_ci#define RS600_MC_AGP_TOP_SHIFT 16 1968c2ecf20Sopenharmony_ci#define RS600_MC_AGP_BASE 0x6 1978c2ecf20Sopenharmony_ci#define RS600_MC_AGP_BASE_2 0x7 1988c2ecf20Sopenharmony_ci#define RS600_MC_CNTL1 0x9 1998c2ecf20Sopenharmony_ci# define RS600_ENABLE_PAGE_TABLES (1 << 26) 2008c2ecf20Sopenharmony_ci#define RS600_MC_PT0_CNTL 0x100 2018c2ecf20Sopenharmony_ci# define RS600_ENABLE_PT (1 << 0) 2028c2ecf20Sopenharmony_ci# define RS600_EFFECTIVE_L2_CACHE_SIZE(x) ((x) << 15) 2038c2ecf20Sopenharmony_ci# define RS600_EFFECTIVE_L2_QUEUE_SIZE(x) ((x) << 21) 2048c2ecf20Sopenharmony_ci# define RS600_INVALIDATE_ALL_L1_TLBS (1 << 28) 2058c2ecf20Sopenharmony_ci# define RS600_INVALIDATE_L2_CACHE (1 << 29) 2068c2ecf20Sopenharmony_ci#define RS600_MC_PT0_CONTEXT0_CNTL 0x102 2078c2ecf20Sopenharmony_ci# define RS600_ENABLE_PAGE_TABLE (1 << 0) 2088c2ecf20Sopenharmony_ci# define RS600_PAGE_TABLE_TYPE_FLAT (0 << 1) 2098c2ecf20Sopenharmony_ci#define RS600_MC_PT0_SYSTEM_APERTURE_LOW_ADDR 0x112 2108c2ecf20Sopenharmony_ci#define RS600_MC_PT0_SYSTEM_APERTURE_HIGH_ADDR 0x114 2118c2ecf20Sopenharmony_ci#define RS600_MC_PT0_CONTEXT0_DEFAULT_READ_ADDR 0x11c 2128c2ecf20Sopenharmony_ci#define RS600_MC_PT0_CONTEXT0_FLAT_BASE_ADDR 0x12c 2138c2ecf20Sopenharmony_ci#define RS600_MC_PT0_CONTEXT0_FLAT_START_ADDR 0x13c 2148c2ecf20Sopenharmony_ci#define RS600_MC_PT0_CONTEXT0_FLAT_END_ADDR 0x14c 2158c2ecf20Sopenharmony_ci#define RS600_MC_PT0_CLIENT0_CNTL 0x16c 2168c2ecf20Sopenharmony_ci# define RS600_ENABLE_TRANSLATION_MODE_OVERRIDE (1 << 0) 2178c2ecf20Sopenharmony_ci# define RS600_TRANSLATION_MODE_OVERRIDE (1 << 1) 2188c2ecf20Sopenharmony_ci# define RS600_SYSTEM_ACCESS_MODE_MASK (3 << 8) 2198c2ecf20Sopenharmony_ci# define RS600_SYSTEM_ACCESS_MODE_PA_ONLY (0 << 8) 2208c2ecf20Sopenharmony_ci# define RS600_SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 8) 2218c2ecf20Sopenharmony_ci# define RS600_SYSTEM_ACCESS_MODE_IN_SYS (2 << 8) 2228c2ecf20Sopenharmony_ci# define RS600_SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 8) 2238c2ecf20Sopenharmony_ci# define RS600_SYSTEM_APERTURE_UNMAPPED_ACCESS_PASSTHROUGH (0 << 10) 2248c2ecf20Sopenharmony_ci# define RS600_SYSTEM_APERTURE_UNMAPPED_ACCESS_DEFAULT_PAGE (1 << 10) 2258c2ecf20Sopenharmony_ci# define RS600_EFFECTIVE_L1_CACHE_SIZE(x) ((x) << 11) 2268c2ecf20Sopenharmony_ci# define RS600_ENABLE_FRAGMENT_PROCESSING (1 << 14) 2278c2ecf20Sopenharmony_ci# define RS600_EFFECTIVE_L1_QUEUE_SIZE(x) ((x) << 15) 2288c2ecf20Sopenharmony_ci# define RS600_INVALIDATE_L1_TLB (1 << 20) 2298c2ecf20Sopenharmony_ci/* rs600/rs690/rs740 */ 2308c2ecf20Sopenharmony_ci# define RS600_BUS_MASTER_DIS (1 << 14) 2318c2ecf20Sopenharmony_ci# define RS600_MSI_REARM (1 << 20) 2328c2ecf20Sopenharmony_ci/* see RS400_MSI_REARM in AIC_CNTL for rs480 */ 2338c2ecf20Sopenharmony_ci 2348c2ecf20Sopenharmony_ci 2358c2ecf20Sopenharmony_ci 2368c2ecf20Sopenharmony_ci#define RV515_MC_FB_LOCATION 0x01 2378c2ecf20Sopenharmony_ci#define RV515_MC_FB_START_MASK 0x0000FFFF 2388c2ecf20Sopenharmony_ci#define RV515_MC_FB_START_SHIFT 0 2398c2ecf20Sopenharmony_ci#define RV515_MC_FB_TOP_MASK 0xFFFF0000 2408c2ecf20Sopenharmony_ci#define RV515_MC_FB_TOP_SHIFT 16 2418c2ecf20Sopenharmony_ci#define RV515_MC_AGP_LOCATION 0x02 2428c2ecf20Sopenharmony_ci#define RV515_MC_AGP_START_MASK 0x0000FFFF 2438c2ecf20Sopenharmony_ci#define RV515_MC_AGP_START_SHIFT 0 2448c2ecf20Sopenharmony_ci#define RV515_MC_AGP_TOP_MASK 0xFFFF0000 2458c2ecf20Sopenharmony_ci#define RV515_MC_AGP_TOP_SHIFT 16 2468c2ecf20Sopenharmony_ci#define RV515_MC_AGP_BASE 0x03 2478c2ecf20Sopenharmony_ci#define RV515_MC_AGP_BASE_2 0x04 2488c2ecf20Sopenharmony_ci 2498c2ecf20Sopenharmony_ci#define R520_MC_FB_LOCATION 0x04 2508c2ecf20Sopenharmony_ci#define R520_MC_FB_START_MASK 0x0000FFFF 2518c2ecf20Sopenharmony_ci#define R520_MC_FB_START_SHIFT 0 2528c2ecf20Sopenharmony_ci#define R520_MC_FB_TOP_MASK 0xFFFF0000 2538c2ecf20Sopenharmony_ci#define R520_MC_FB_TOP_SHIFT 16 2548c2ecf20Sopenharmony_ci#define R520_MC_AGP_LOCATION 0x05 2558c2ecf20Sopenharmony_ci#define R520_MC_AGP_START_MASK 0x0000FFFF 2568c2ecf20Sopenharmony_ci#define R520_MC_AGP_START_SHIFT 0 2578c2ecf20Sopenharmony_ci#define R520_MC_AGP_TOP_MASK 0xFFFF0000 2588c2ecf20Sopenharmony_ci#define R520_MC_AGP_TOP_SHIFT 16 2598c2ecf20Sopenharmony_ci#define R520_MC_AGP_BASE 0x06 2608c2ecf20Sopenharmony_ci#define R520_MC_AGP_BASE_2 0x07 2618c2ecf20Sopenharmony_ci 2628c2ecf20Sopenharmony_ci 2638c2ecf20Sopenharmony_ci#define AVIVO_MC_INDEX 0x0070 2648c2ecf20Sopenharmony_ci#define R520_MC_STATUS 0x00 2658c2ecf20Sopenharmony_ci#define R520_MC_STATUS_IDLE (1<<1) 2668c2ecf20Sopenharmony_ci#define RV515_MC_STATUS 0x08 2678c2ecf20Sopenharmony_ci#define RV515_MC_STATUS_IDLE (1<<4) 2688c2ecf20Sopenharmony_ci#define RV515_MC_INIT_MISC_LAT_TIMER 0x09 2698c2ecf20Sopenharmony_ci#define AVIVO_MC_DATA 0x0074 2708c2ecf20Sopenharmony_ci 2718c2ecf20Sopenharmony_ci#define R520_MC_IND_INDEX 0x70 2728c2ecf20Sopenharmony_ci#define R520_MC_IND_WR_EN (1 << 24) 2738c2ecf20Sopenharmony_ci#define R520_MC_IND_DATA 0x74 2748c2ecf20Sopenharmony_ci 2758c2ecf20Sopenharmony_ci#define RV515_MC_CNTL 0x5 2768c2ecf20Sopenharmony_ci# define RV515_MEM_NUM_CHANNELS_MASK 0x3 2778c2ecf20Sopenharmony_ci#define R520_MC_CNTL0 0x8 2788c2ecf20Sopenharmony_ci# define R520_MEM_NUM_CHANNELS_MASK (0x3 << 24) 2798c2ecf20Sopenharmony_ci# define R520_MEM_NUM_CHANNELS_SHIFT 24 2808c2ecf20Sopenharmony_ci# define R520_MC_CHANNEL_SIZE (1 << 23) 2818c2ecf20Sopenharmony_ci 2828c2ecf20Sopenharmony_ci#define AVIVO_CP_DYN_CNTL 0x000f /* PLL */ 2838c2ecf20Sopenharmony_ci# define AVIVO_CP_FORCEON (1 << 0) 2848c2ecf20Sopenharmony_ci#define AVIVO_E2_DYN_CNTL 0x0011 /* PLL */ 2858c2ecf20Sopenharmony_ci# define AVIVO_E2_FORCEON (1 << 0) 2868c2ecf20Sopenharmony_ci#define AVIVO_IDCT_DYN_CNTL 0x0013 /* PLL */ 2878c2ecf20Sopenharmony_ci# define AVIVO_IDCT_FORCEON (1 << 0) 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_ci#define AVIVO_HDP_FB_LOCATION 0x134 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci#define AVIVO_VGA_RENDER_CONTROL 0x0300 2928c2ecf20Sopenharmony_ci# define AVIVO_VGA_VSTATUS_CNTL_MASK (3 << 16) 2938c2ecf20Sopenharmony_ci#define AVIVO_D1VGA_CONTROL 0x0330 2948c2ecf20Sopenharmony_ci# define AVIVO_DVGA_CONTROL_MODE_ENABLE (1<<0) 2958c2ecf20Sopenharmony_ci# define AVIVO_DVGA_CONTROL_TIMING_SELECT (1<<8) 2968c2ecf20Sopenharmony_ci# define AVIVO_DVGA_CONTROL_SYNC_POLARITY_SELECT (1<<9) 2978c2ecf20Sopenharmony_ci# define AVIVO_DVGA_CONTROL_OVERSCAN_TIMING_SELECT (1<<10) 2988c2ecf20Sopenharmony_ci# define AVIVO_DVGA_CONTROL_OVERSCAN_COLOR_EN (1<<16) 2998c2ecf20Sopenharmony_ci# define AVIVO_DVGA_CONTROL_ROTATE (1<<24) 3008c2ecf20Sopenharmony_ci#define AVIVO_D2VGA_CONTROL 0x0338 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_ci#define AVIVO_EXT1_PPLL_REF_DIV_SRC 0x400 3038c2ecf20Sopenharmony_ci#define AVIVO_EXT1_PPLL_REF_DIV 0x404 3048c2ecf20Sopenharmony_ci#define AVIVO_EXT1_PPLL_UPDATE_LOCK 0x408 3058c2ecf20Sopenharmony_ci#define AVIVO_EXT1_PPLL_UPDATE_CNTL 0x40c 3068c2ecf20Sopenharmony_ci 3078c2ecf20Sopenharmony_ci#define AVIVO_EXT2_PPLL_REF_DIV_SRC 0x410 3088c2ecf20Sopenharmony_ci#define AVIVO_EXT2_PPLL_REF_DIV 0x414 3098c2ecf20Sopenharmony_ci#define AVIVO_EXT2_PPLL_UPDATE_LOCK 0x418 3108c2ecf20Sopenharmony_ci#define AVIVO_EXT2_PPLL_UPDATE_CNTL 0x41c 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_ci#define AVIVO_EXT1_PPLL_FB_DIV 0x430 3138c2ecf20Sopenharmony_ci#define AVIVO_EXT2_PPLL_FB_DIV 0x434 3148c2ecf20Sopenharmony_ci 3158c2ecf20Sopenharmony_ci#define AVIVO_EXT1_PPLL_POST_DIV_SRC 0x438 3168c2ecf20Sopenharmony_ci#define AVIVO_EXT1_PPLL_POST_DIV 0x43c 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_ci#define AVIVO_EXT2_PPLL_POST_DIV_SRC 0x440 3198c2ecf20Sopenharmony_ci#define AVIVO_EXT2_PPLL_POST_DIV 0x444 3208c2ecf20Sopenharmony_ci 3218c2ecf20Sopenharmony_ci#define AVIVO_EXT1_PPLL_CNTL 0x448 3228c2ecf20Sopenharmony_ci#define AVIVO_EXT2_PPLL_CNTL 0x44c 3238c2ecf20Sopenharmony_ci 3248c2ecf20Sopenharmony_ci#define AVIVO_P1PLL_CNTL 0x450 3258c2ecf20Sopenharmony_ci#define AVIVO_P2PLL_CNTL 0x454 3268c2ecf20Sopenharmony_ci#define AVIVO_P1PLL_INT_SS_CNTL 0x458 3278c2ecf20Sopenharmony_ci#define AVIVO_P2PLL_INT_SS_CNTL 0x45c 3288c2ecf20Sopenharmony_ci#define AVIVO_P1PLL_TMDSA_CNTL 0x460 3298c2ecf20Sopenharmony_ci#define AVIVO_P2PLL_LVTMA_CNTL 0x464 3308c2ecf20Sopenharmony_ci 3318c2ecf20Sopenharmony_ci#define AVIVO_PCLK_CRTC1_CNTL 0x480 3328c2ecf20Sopenharmony_ci#define AVIVO_PCLK_CRTC2_CNTL 0x484 3338c2ecf20Sopenharmony_ci 3348c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_H_TOTAL 0x6000 3358c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_H_BLANK_START_END 0x6004 3368c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_H_SYNC_A 0x6008 3378c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_H_SYNC_A_CNTL 0x600c 3388c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_H_SYNC_B 0x6010 3398c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_H_SYNC_B_CNTL 0x6014 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_V_TOTAL 0x6020 3428c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_V_BLANK_START_END 0x6024 3438c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_V_SYNC_A 0x6028 3448c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_V_SYNC_A_CNTL 0x602c 3458c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_V_SYNC_B 0x6030 3468c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_V_SYNC_B_CNTL 0x6034 3478c2ecf20Sopenharmony_ci 3488c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_CONTROL 0x6080 3498c2ecf20Sopenharmony_ci# define AVIVO_CRTC_EN (1 << 0) 3508c2ecf20Sopenharmony_ci# define AVIVO_CRTC_DISP_READ_REQUEST_DISABLE (1 << 24) 3518c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_BLANK_CONTROL 0x6084 3528c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_INTERLACE_CONTROL 0x6088 3538c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_INTERLACE_STATUS 0x608c 3548c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_STATUS 0x609c 3558c2ecf20Sopenharmony_ci# define AVIVO_D1CRTC_V_BLANK (1 << 0) 3568c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_STATUS_POSITION 0x60a0 3578c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_FRAME_COUNT 0x60a4 3588c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_STATUS_HV_COUNT 0x60ac 3598c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_STEREO_CONTROL 0x60c4 3608c2ecf20Sopenharmony_ci 3618c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_MASTER_UPDATE_LOCK 0x60e0 3628c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_MASTER_UPDATE_MODE 0x60e4 3638c2ecf20Sopenharmony_ci#define AVIVO_D1CRTC_UPDATE_LOCK 0x60e8 3648c2ecf20Sopenharmony_ci 3658c2ecf20Sopenharmony_ci/* master controls */ 3668c2ecf20Sopenharmony_ci#define AVIVO_DC_CRTC_MASTER_EN 0x60f8 3678c2ecf20Sopenharmony_ci#define AVIVO_DC_CRTC_TV_CONTROL 0x60fc 3688c2ecf20Sopenharmony_ci 3698c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_ENABLE 0x6100 3708c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_CONTROL 0x6104 3718c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_DEPTH_8BPP (0 << 0) 3728c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_DEPTH_16BPP (1 << 0) 3738c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_DEPTH_32BPP (2 << 0) 3748c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_DEPTH_64BPP (3 << 0) 3758c2ecf20Sopenharmony_ci 3768c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_8BPP_INDEXED (0 << 8) 3778c2ecf20Sopenharmony_ci 3788c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555 (0 << 8) 3798c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_16BPP_RGB565 (1 << 8) 3808c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444 (2 << 8) 3818c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_16BPP_AI88 (3 << 8) 3828c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_16BPP_MONO16 (4 << 8) 3838c2ecf20Sopenharmony_ci 3848c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888 (0 << 8) 3858c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010 (1 << 8) 3868c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_32BPP_DIGITAL (2 << 8) 3878c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_32BPP_8B_ARGB2101010 (3 << 8) 3888c2ecf20Sopenharmony_ci 3898c2ecf20Sopenharmony_ci 3908c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_CONTROL_64BPP_ARGB16161616 (0 << 8) 3918c2ecf20Sopenharmony_ci 3928c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_SWAP_RB (1 << 16) 3938c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_TILED (1 << 20) 3948c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1 << 21) 3958c2ecf20Sopenharmony_ci 3968c2ecf20Sopenharmony_ci# define R600_D1GRPH_ARRAY_MODE_LINEAR_GENERAL (0 << 20) 3978c2ecf20Sopenharmony_ci# define R600_D1GRPH_ARRAY_MODE_LINEAR_ALIGNED (1 << 20) 3988c2ecf20Sopenharmony_ci# define R600_D1GRPH_ARRAY_MODE_1D_TILED_THIN1 (2 << 20) 3998c2ecf20Sopenharmony_ci# define R600_D1GRPH_ARRAY_MODE_2D_TILED_THIN1 (4 << 20) 4008c2ecf20Sopenharmony_ci 4018c2ecf20Sopenharmony_ci/* The R7xx *_HIGH surface regs are backwards; the D1 regs are in the D2 4028c2ecf20Sopenharmony_ci * block and vice versa. This applies to GRPH, CUR, etc. 4038c2ecf20Sopenharmony_ci */ 4048c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_LUT_SEL 0x6108 4058c2ecf20Sopenharmony_ci# define AVIVO_LUT_10BIT_BYPASS_EN (1 << 8) 4068c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110 4078c2ecf20Sopenharmony_ci#define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6914 4088c2ecf20Sopenharmony_ci#define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6114 4098c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS 0x6118 4108c2ecf20Sopenharmony_ci#define R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x691c 4118c2ecf20Sopenharmony_ci#define R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x611c 4128c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_PITCH 0x6120 4138c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_SURFACE_OFFSET_X 0x6124 4148c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_SURFACE_OFFSET_Y 0x6128 4158c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_X_START 0x612c 4168c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_Y_START 0x6130 4178c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_X_END 0x6134 4188c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_Y_END 0x6138 4198c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_UPDATE 0x6144 4208c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_SURFACE_UPDATE_PENDING (1 << 2) 4218c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_UPDATE_LOCK (1 << 16) 4228c2ecf20Sopenharmony_ci#define AVIVO_D1GRPH_FLIP_CONTROL 0x6148 4238c2ecf20Sopenharmony_ci# define AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN (1 << 0) 4248c2ecf20Sopenharmony_ci 4258c2ecf20Sopenharmony_ci#define AVIVO_D1CUR_CONTROL 0x6400 4268c2ecf20Sopenharmony_ci# define AVIVO_D1CURSOR_EN (1 << 0) 4278c2ecf20Sopenharmony_ci# define AVIVO_D1CURSOR_MODE_SHIFT 8 4288c2ecf20Sopenharmony_ci# define AVIVO_D1CURSOR_MODE_MASK (3 << 8) 4298c2ecf20Sopenharmony_ci# define AVIVO_D1CURSOR_MODE_24BPP 2 4308c2ecf20Sopenharmony_ci#define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408 4318c2ecf20Sopenharmony_ci#define R700_D1CUR_SURFACE_ADDRESS_HIGH 0x6c0c 4328c2ecf20Sopenharmony_ci#define R700_D2CUR_SURFACE_ADDRESS_HIGH 0x640c 4338c2ecf20Sopenharmony_ci#define AVIVO_D1CUR_SIZE 0x6410 4348c2ecf20Sopenharmony_ci#define AVIVO_D1CUR_POSITION 0x6414 4358c2ecf20Sopenharmony_ci#define AVIVO_D1CUR_HOT_SPOT 0x6418 4368c2ecf20Sopenharmony_ci#define AVIVO_D1CUR_UPDATE 0x6424 4378c2ecf20Sopenharmony_ci# define AVIVO_D1CURSOR_UPDATE_LOCK (1 << 16) 4388c2ecf20Sopenharmony_ci 4398c2ecf20Sopenharmony_ci#define AVIVO_DC_LUT_RW_SELECT 0x6480 4408c2ecf20Sopenharmony_ci#define AVIVO_DC_LUT_RW_MODE 0x6484 4418c2ecf20Sopenharmony_ci#define AVIVO_DC_LUT_RW_INDEX 0x6488 4428c2ecf20Sopenharmony_ci#define AVIVO_DC_LUT_SEQ_COLOR 0x648c 4438c2ecf20Sopenharmony_ci#define AVIVO_DC_LUT_PWL_DATA 0x6490 4448c2ecf20Sopenharmony_ci#define AVIVO_DC_LUT_30_COLOR 0x6494 4458c2ecf20Sopenharmony_ci#define AVIVO_DC_LUT_READ_PIPE_SELECT 0x6498 4468c2ecf20Sopenharmony_ci#define AVIVO_DC_LUT_WRITE_EN_MASK 0x649c 4478c2ecf20Sopenharmony_ci#define AVIVO_DC_LUT_AUTOFILL 0x64a0 4488c2ecf20Sopenharmony_ci 4498c2ecf20Sopenharmony_ci#define AVIVO_DC_LUTA_CONTROL 0x64c0 4508c2ecf20Sopenharmony_ci#define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE 0x64c4 4518c2ecf20Sopenharmony_ci#define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN 0x64c8 4528c2ecf20Sopenharmony_ci#define AVIVO_DC_LUTA_BLACK_OFFSET_RED 0x64cc 4538c2ecf20Sopenharmony_ci#define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE 0x64d0 4548c2ecf20Sopenharmony_ci#define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN 0x64d4 4558c2ecf20Sopenharmony_ci#define AVIVO_DC_LUTA_WHITE_OFFSET_RED 0x64d8 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_ci#define AVIVO_DC_LB_MEMORY_SPLIT 0x6520 4588c2ecf20Sopenharmony_ci# define AVIVO_DC_LB_MEMORY_SPLIT_MASK 0x3 4598c2ecf20Sopenharmony_ci# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT 0 4608c2ecf20Sopenharmony_ci# define AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0 4618c2ecf20Sopenharmony_ci# define AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1 4628c2ecf20Sopenharmony_ci# define AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY 2 4638c2ecf20Sopenharmony_ci# define AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3 4648c2ecf20Sopenharmony_ci# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2) 4658c2ecf20Sopenharmony_ci# define AVIVO_DC_LB_DISP1_END_ADR_SHIFT 4 4668c2ecf20Sopenharmony_ci# define AVIVO_DC_LB_DISP1_END_ADR_MASK 0x7ff 4678c2ecf20Sopenharmony_ci 4688c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_DATA_FORMAT 0x6528 4698c2ecf20Sopenharmony_ci# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0) 4708c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652C 4718c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_VBLANK_STATUS 0x6534 4728c2ecf20Sopenharmony_ci# define AVIVO_VBLANK_ACK (1 << 4) 4738c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_VLINE_START_END 0x6538 4748c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_VLINE_STATUS 0x653c 4758c2ecf20Sopenharmony_ci# define AVIVO_D1MODE_VLINE_STAT (1 << 12) 4768c2ecf20Sopenharmony_ci#define AVIVO_DxMODE_INT_MASK 0x6540 4778c2ecf20Sopenharmony_ci# define AVIVO_D1MODE_INT_MASK (1 << 0) 4788c2ecf20Sopenharmony_ci# define AVIVO_D2MODE_INT_MASK (1 << 8) 4798c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_VIEWPORT_START 0x6580 4808c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 4818c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588 4828c2ecf20Sopenharmony_ci#define AVIVO_D1MODE_EXT_OVERSCAN_TOP_BOTTOM 0x658c 4838c2ecf20Sopenharmony_ci 4848c2ecf20Sopenharmony_ci#define AVIVO_D1SCL_SCALER_ENABLE 0x6590 4858c2ecf20Sopenharmony_ci#define AVIVO_D1SCL_SCALER_TAP_CONTROL 0x6594 4868c2ecf20Sopenharmony_ci#define AVIVO_D1SCL_UPDATE 0x65cc 4878c2ecf20Sopenharmony_ci# define AVIVO_D1SCL_UPDATE_LOCK (1 << 16) 4888c2ecf20Sopenharmony_ci 4898c2ecf20Sopenharmony_ci/* second crtc */ 4908c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_H_TOTAL 0x6800 4918c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_H_BLANK_START_END 0x6804 4928c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_H_SYNC_A 0x6808 4938c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_H_SYNC_A_CNTL 0x680c 4948c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_H_SYNC_B 0x6810 4958c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_H_SYNC_B_CNTL 0x6814 4968c2ecf20Sopenharmony_ci 4978c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_V_TOTAL 0x6820 4988c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_V_BLANK_START_END 0x6824 4998c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_V_SYNC_A 0x6828 5008c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_V_SYNC_A_CNTL 0x682c 5018c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_V_SYNC_B 0x6830 5028c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_V_SYNC_B_CNTL 0x6834 5038c2ecf20Sopenharmony_ci 5048c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_CONTROL 0x6880 5058c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_BLANK_CONTROL 0x6884 5068c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_INTERLACE_CONTROL 0x6888 5078c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_INTERLACE_STATUS 0x688c 5088c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_STATUS_POSITION 0x68a0 5098c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_FRAME_COUNT 0x68a4 5108c2ecf20Sopenharmony_ci#define AVIVO_D2CRTC_STEREO_CONTROL 0x68c4 5118c2ecf20Sopenharmony_ci 5128c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_ENABLE 0x6900 5138c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_CONTROL 0x6904 5148c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_LUT_SEL 0x6908 5158c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_PRIMARY_SURFACE_ADDRESS 0x6910 5168c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_SECONDARY_SURFACE_ADDRESS 0x6918 5178c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_PITCH 0x6920 5188c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_SURFACE_OFFSET_X 0x6924 5198c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_SURFACE_OFFSET_Y 0x6928 5208c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_X_START 0x692c 5218c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_Y_START 0x6930 5228c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_X_END 0x6934 5238c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_Y_END 0x6938 5248c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_UPDATE 0x6944 5258c2ecf20Sopenharmony_ci#define AVIVO_D2GRPH_FLIP_CONTROL 0x6948 5268c2ecf20Sopenharmony_ci 5278c2ecf20Sopenharmony_ci#define AVIVO_D2CUR_CONTROL 0x6c00 5288c2ecf20Sopenharmony_ci#define AVIVO_D2CUR_SURFACE_ADDRESS 0x6c08 5298c2ecf20Sopenharmony_ci#define AVIVO_D2CUR_SIZE 0x6c10 5308c2ecf20Sopenharmony_ci#define AVIVO_D2CUR_POSITION 0x6c14 5318c2ecf20Sopenharmony_ci 5328c2ecf20Sopenharmony_ci#define AVIVO_D2MODE_VBLANK_STATUS 0x6d34 5338c2ecf20Sopenharmony_ci#define AVIVO_D2MODE_VLINE_START_END 0x6d38 5348c2ecf20Sopenharmony_ci#define AVIVO_D2MODE_VLINE_STATUS 0x6d3c 5358c2ecf20Sopenharmony_ci#define AVIVO_D2MODE_VIEWPORT_START 0x6d80 5368c2ecf20Sopenharmony_ci#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84 5378c2ecf20Sopenharmony_ci#define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88 5388c2ecf20Sopenharmony_ci#define AVIVO_D2MODE_EXT_OVERSCAN_TOP_BOTTOM 0x6d8c 5398c2ecf20Sopenharmony_ci 5408c2ecf20Sopenharmony_ci#define AVIVO_D2SCL_SCALER_ENABLE 0x6d90 5418c2ecf20Sopenharmony_ci#define AVIVO_D2SCL_SCALER_TAP_CONTROL 0x6d94 5428c2ecf20Sopenharmony_ci 5438c2ecf20Sopenharmony_ci#define AVIVO_DDIA_BIT_DEPTH_CONTROL 0x7214 5448c2ecf20Sopenharmony_ci 5458c2ecf20Sopenharmony_ci#define AVIVO_DACA_ENABLE 0x7800 5468c2ecf20Sopenharmony_ci# define AVIVO_DAC_ENABLE (1 << 0) 5478c2ecf20Sopenharmony_ci#define AVIVO_DACA_SOURCE_SELECT 0x7804 5488c2ecf20Sopenharmony_ci# define AVIVO_DAC_SOURCE_CRTC1 (0 << 0) 5498c2ecf20Sopenharmony_ci# define AVIVO_DAC_SOURCE_CRTC2 (1 << 0) 5508c2ecf20Sopenharmony_ci# define AVIVO_DAC_SOURCE_TV (2 << 0) 5518c2ecf20Sopenharmony_ci 5528c2ecf20Sopenharmony_ci#define AVIVO_DACA_FORCE_OUTPUT_CNTL 0x783c 5538c2ecf20Sopenharmony_ci# define AVIVO_DACA_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) 5548c2ecf20Sopenharmony_ci# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) 5558c2ecf20Sopenharmony_ci# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) 5568c2ecf20Sopenharmony_ci# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) 5578c2ecf20Sopenharmony_ci# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) 5588c2ecf20Sopenharmony_ci# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) 5598c2ecf20Sopenharmony_ci#define AVIVO_DACA_POWERDOWN 0x7850 5608c2ecf20Sopenharmony_ci# define AVIVO_DACA_POWERDOWN_POWERDOWN (1 << 0) 5618c2ecf20Sopenharmony_ci# define AVIVO_DACA_POWERDOWN_BLUE (1 << 8) 5628c2ecf20Sopenharmony_ci# define AVIVO_DACA_POWERDOWN_GREEN (1 << 16) 5638c2ecf20Sopenharmony_ci# define AVIVO_DACA_POWERDOWN_RED (1 << 24) 5648c2ecf20Sopenharmony_ci 5658c2ecf20Sopenharmony_ci#define AVIVO_DACB_ENABLE 0x7a00 5668c2ecf20Sopenharmony_ci#define AVIVO_DACB_SOURCE_SELECT 0x7a04 5678c2ecf20Sopenharmony_ci#define AVIVO_DACB_FORCE_OUTPUT_CNTL 0x7a3c 5688c2ecf20Sopenharmony_ci# define AVIVO_DACB_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) 5698c2ecf20Sopenharmony_ci# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) 5708c2ecf20Sopenharmony_ci# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) 5718c2ecf20Sopenharmony_ci# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) 5728c2ecf20Sopenharmony_ci# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) 5738c2ecf20Sopenharmony_ci# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) 5748c2ecf20Sopenharmony_ci#define AVIVO_DACB_POWERDOWN 0x7a50 5758c2ecf20Sopenharmony_ci# define AVIVO_DACB_POWERDOWN_POWERDOWN (1 << 0) 5768c2ecf20Sopenharmony_ci# define AVIVO_DACB_POWERDOWN_BLUE (1 << 8) 5778c2ecf20Sopenharmony_ci# define AVIVO_DACB_POWERDOWN_GREEN (1 << 16) 5788c2ecf20Sopenharmony_ci# define AVIVO_DACB_POWERDOWN_RED 5798c2ecf20Sopenharmony_ci 5808c2ecf20Sopenharmony_ci#define AVIVO_TMDSA_CNTL 0x7880 5818c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_CNTL_ENABLE (1 << 0) 5828c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_CNTL_HDMI_EN (1 << 2) 5838c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_CNTL_HPD_MASK (1 << 4) 5848c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_CNTL_HPD_SELECT (1 << 8) 5858c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_CNTL_SYNC_PHASE (1 << 12) 5868c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_CNTL_PIXEL_ENCODING (1 << 16) 5878c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_CNTL_DUAL_LINK_ENABLE (1 << 24) 5888c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_CNTL_SWAP (1 << 28) 5898c2ecf20Sopenharmony_ci#define AVIVO_TMDSA_SOURCE_SELECT 0x7884 5908c2ecf20Sopenharmony_ci/* 78a8 appears to be some kind of (reasonably tolerant) clock? 5918c2ecf20Sopenharmony_ci * 78d0 definitely hits the transmitter, definitely clock. */ 5928c2ecf20Sopenharmony_ci/* MYSTERY1 This appears to control dithering? */ 5938c2ecf20Sopenharmony_ci#define AVIVO_TMDSA_BIT_DEPTH_CONTROL 0x7894 5948c2ecf20Sopenharmony_ci# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) 5958c2ecf20Sopenharmony_ci# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) 5968c2ecf20Sopenharmony_ci# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) 5978c2ecf20Sopenharmony_ci# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) 5988c2ecf20Sopenharmony_ci# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) 5998c2ecf20Sopenharmony_ci# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) 6008c2ecf20Sopenharmony_ci# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) 6018c2ecf20Sopenharmony_ci# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) 6028c2ecf20Sopenharmony_ci#define AVIVO_TMDSA_DCBALANCER_CONTROL 0x78d0 6038c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_DCBALANCER_CONTROL_EN (1 << 0) 6048c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_EN (1 << 8) 6058c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) 6068c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_DCBALANCER_CONTROL_FORCE (1 << 24) 6078c2ecf20Sopenharmony_ci#define AVIVO_TMDSA_DATA_SYNCHRONIZATION 0x78d8 6088c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) 6098c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) 6108c2ecf20Sopenharmony_ci#define AVIVO_TMDSA_CLOCK_ENABLE 0x7900 6118c2ecf20Sopenharmony_ci#define AVIVO_TMDSA_TRANSMITTER_ENABLE 0x7904 6128c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX0_ENABLE (1 << 0) 6138c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) 6148c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) 6158c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) 6168c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) 6178c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX1_ENABLE (1 << 8) 6188c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) 6198c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) 6208c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) 6218c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX_ENABLE_HPD_MASK (1 << 16) 6228c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) 6238c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) 6248c2ecf20Sopenharmony_ci 6258c2ecf20Sopenharmony_ci#define AVIVO_TMDSA_TRANSMITTER_CONTROL 0x7910 6268c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) 6278c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) 6288c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) 6298c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) 6308c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) 6318c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) 6328c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK (1 << 8) 6338c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) 6348c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK (1 << 14) 6358c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) 6368c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) 6378c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) 6388c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) 6398c2ecf20Sopenharmony_ci# define AVIVO_TMDSA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) 6408c2ecf20Sopenharmony_ci 6418c2ecf20Sopenharmony_ci#define AVIVO_LVTMA_CNTL 0x7a80 6428c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_CNTL_ENABLE (1 << 0) 6438c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_CNTL_HDMI_EN (1 << 2) 6448c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_CNTL_HPD_MASK (1 << 4) 6458c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_CNTL_HPD_SELECT (1 << 8) 6468c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_CNTL_SYNC_PHASE (1 << 12) 6478c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_CNTL_PIXEL_ENCODING (1 << 16) 6488c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_CNTL_DUAL_LINK_ENABLE (1 << 24) 6498c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_CNTL_SWAP (1 << 28) 6508c2ecf20Sopenharmony_ci#define AVIVO_LVTMA_SOURCE_SELECT 0x7a84 6518c2ecf20Sopenharmony_ci#define AVIVO_LVTMA_COLOR_FORMAT 0x7a88 6528c2ecf20Sopenharmony_ci#define AVIVO_LVTMA_BIT_DEPTH_CONTROL 0x7a94 6538c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) 6548c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) 6558c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) 6568c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) 6578c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) 6588c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) 6598c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) 6608c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) 6618c2ecf20Sopenharmony_ci 6628c2ecf20Sopenharmony_ci 6638c2ecf20Sopenharmony_ci 6648c2ecf20Sopenharmony_ci#define AVIVO_LVTMA_DCBALANCER_CONTROL 0x7ad0 6658c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_DCBALANCER_CONTROL_EN (1 << 0) 6668c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_EN (1 << 8) 6678c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) 6688c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_DCBALANCER_CONTROL_FORCE (1 << 24) 6698c2ecf20Sopenharmony_ci 6708c2ecf20Sopenharmony_ci#define AVIVO_LVTMA_DATA_SYNCHRONIZATION 0x78d8 6718c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) 6728c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) 6738c2ecf20Sopenharmony_ci#define R500_LVTMA_CLOCK_ENABLE 0x7b00 6748c2ecf20Sopenharmony_ci#define R600_LVTMA_CLOCK_ENABLE 0x7b04 6758c2ecf20Sopenharmony_ci 6768c2ecf20Sopenharmony_ci#define R500_LVTMA_TRANSMITTER_ENABLE 0x7b04 6778c2ecf20Sopenharmony_ci#define R600_LVTMA_TRANSMITTER_ENABLE 0x7b08 6788c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) 6798c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) 6808c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) 6818c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) 6828c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD03EN (1 << 5) 6838c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC1EN (1 << 9) 6848c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) 6858c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) 6868c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) 6878c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) 6888c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) 6898c2ecf20Sopenharmony_ci 6908c2ecf20Sopenharmony_ci#define R500_LVTMA_TRANSMITTER_CONTROL 0x7b10 6918c2ecf20Sopenharmony_ci#define R600_LVTMA_TRANSMITTER_CONTROL 0x7b14 6928c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) 6938c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) 6948c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) 6958c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) 6968c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) 6978c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) 6988c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK (1 << 8) 6998c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) 7008c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK (1 << 14) 7018c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) 7028c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) 7038c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) 7048c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) 7058c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) 7068c2ecf20Sopenharmony_ci 7078c2ecf20Sopenharmony_ci#define R500_LVTMA_PWRSEQ_CNTL 0x7af0 7088c2ecf20Sopenharmony_ci#define R600_LVTMA_PWRSEQ_CNTL 0x7af4 7098c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_EN (1 << 0) 7108c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_PLL_ENABLE_MASK (1 << 2) 7118c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_PLL_RESET_MASK (1 << 3) 7128c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_TARGET_STATE (1 << 4) 7138c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_SYNCEN (1 << 8) 7148c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_SYNCEN_OVRD (1 << 9) 7158c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_SYNCEN_POL (1 << 10) 7168c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_DIGON (1 << 16) 7178c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_DIGON_OVRD (1 << 17) 7188c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_DIGON_POL (1 << 18) 7198c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BLON (1 << 24) 7208c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BLON_OVRD (1 << 25) 7218c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_BLON_POL (1 << 26) 7228c2ecf20Sopenharmony_ci 7238c2ecf20Sopenharmony_ci#define R500_LVTMA_PWRSEQ_STATE 0x7af4 7248c2ecf20Sopenharmony_ci#define R600_LVTMA_PWRSEQ_STATE 0x7af8 7258c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_STATE_TARGET_STATE_R (1 << 0) 7268c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_STATE_DIGON (1 << 1) 7278c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_STATE_SYNCEN (1 << 2) 7288c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_STATE_BLON (1 << 3) 7298c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_STATE_DONE (1 << 4) 7308c2ecf20Sopenharmony_ci# define AVIVO_LVTMA_PWRSEQ_STATE_STATUS_SHIFT (8) 7318c2ecf20Sopenharmony_ci 7328c2ecf20Sopenharmony_ci#define AVIVO_LVDS_BACKLIGHT_CNTL 0x7af8 7338c2ecf20Sopenharmony_ci# define AVIVO_LVDS_BACKLIGHT_CNTL_EN (1 << 0) 7348c2ecf20Sopenharmony_ci# define AVIVO_LVDS_BACKLIGHT_LEVEL_MASK 0x0000ff00 7358c2ecf20Sopenharmony_ci# define AVIVO_LVDS_BACKLIGHT_LEVEL_SHIFT 8 7368c2ecf20Sopenharmony_ci 7378c2ecf20Sopenharmony_ci#define AVIVO_DVOA_BIT_DEPTH_CONTROL 0x7988 7388c2ecf20Sopenharmony_ci 7398c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_HPD_A 0x7e94 7408c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_HPD_Y 0x7e9c 7418c2ecf20Sopenharmony_ci 7428c2ecf20Sopenharmony_ci#define AVIVO_DC_I2C_STATUS1 0x7d30 7438c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_DONE (1 << 0) 7448c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_NACK (1 << 1) 7458c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_HALT (1 << 2) 7468c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_GO (1 << 3) 7478c2ecf20Sopenharmony_ci#define AVIVO_DC_I2C_RESET 0x7d34 7488c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_SOFT_RESET (1 << 0) 7498c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_ABORT (1 << 8) 7508c2ecf20Sopenharmony_ci#define AVIVO_DC_I2C_CONTROL1 0x7d38 7518c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_START (1 << 0) 7528c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_STOP (1 << 1) 7538c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_RECEIVE (1 << 2) 7548c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_EN (1 << 8) 7558c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_PIN_SELECT(x) ((x) << 16) 7568c2ecf20Sopenharmony_ci# define AVIVO_SEL_DDC1 0 7578c2ecf20Sopenharmony_ci# define AVIVO_SEL_DDC2 1 7588c2ecf20Sopenharmony_ci# define AVIVO_SEL_DDC3 2 7598c2ecf20Sopenharmony_ci#define AVIVO_DC_I2C_CONTROL2 0x7d3c 7608c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_ADDR_COUNT(x) ((x) << 0) 7618c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_DATA_COUNT(x) ((x) << 8) 7628c2ecf20Sopenharmony_ci#define AVIVO_DC_I2C_CONTROL3 0x7d40 7638c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_DATA_DRIVE_EN (1 << 0) 7648c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_DATA_DRIVE_SEL (1 << 1) 7658c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_CLK_DRIVE_EN (1 << 7) 7668c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_RD_INTRA_BYTE_DELAY(x) ((x) << 8) 7678c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_WR_INTRA_BYTE_DELAY(x) ((x) << 16) 7688c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_TIME_LIMIT(x) ((x) << 24) 7698c2ecf20Sopenharmony_ci#define AVIVO_DC_I2C_DATA 0x7d44 7708c2ecf20Sopenharmony_ci#define AVIVO_DC_I2C_INTERRUPT_CONTROL 0x7d48 7718c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_INTERRUPT_STATUS (1 << 0) 7728c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_INTERRUPT_AK (1 << 8) 7738c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_INTERRUPT_ENABLE (1 << 16) 7748c2ecf20Sopenharmony_ci#define AVIVO_DC_I2C_ARBITRATION 0x7d50 7758c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_SW_WANTS_TO_USE_I2C (1 << 0) 7768c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_SW_CAN_USE_I2C (1 << 1) 7778c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_SW_DONE_USING_I2C (1 << 8) 7788c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_HW_NEEDS_I2C (1 << 9) 7798c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_ABORT_HDCP_I2C (1 << 16) 7808c2ecf20Sopenharmony_ci# define AVIVO_DC_I2C_HW_USING_I2C (1 << 17) 7818c2ecf20Sopenharmony_ci 7828c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC1_MASK 0x7e40 7838c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC1_A 0x7e44 7848c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC1_EN 0x7e48 7858c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC1_Y 0x7e4c 7868c2ecf20Sopenharmony_ci 7878c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC2_MASK 0x7e50 7888c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC2_A 0x7e54 7898c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC2_EN 0x7e58 7908c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC2_Y 0x7e5c 7918c2ecf20Sopenharmony_ci 7928c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC3_MASK 0x7e60 7938c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC3_A 0x7e64 7948c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC3_EN 0x7e68 7958c2ecf20Sopenharmony_ci#define AVIVO_DC_GPIO_DDC3_Y 0x7e6c 7968c2ecf20Sopenharmony_ci 7978c2ecf20Sopenharmony_ci#define AVIVO_DISP_INTERRUPT_STATUS 0x7edc 7988c2ecf20Sopenharmony_ci# define AVIVO_D1_VBLANK_INTERRUPT (1 << 4) 7998c2ecf20Sopenharmony_ci# define AVIVO_D2_VBLANK_INTERRUPT (1 << 5) 8008c2ecf20Sopenharmony_ci 8018c2ecf20Sopenharmony_ci#endif 802