18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright 2011 Advanced Micro Devices, Inc. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 58c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 68c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation 78c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 88c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 98c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 108c2ecf20Sopenharmony_ci * 118c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 128c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software. 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 158c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 168c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 178c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 188c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 198c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 208c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 218c2ecf20Sopenharmony_ci * 228c2ecf20Sopenharmony_ci */ 238c2ecf20Sopenharmony_ci#ifndef RV6XXD_H 248c2ecf20Sopenharmony_ci#define RV6XXD_H 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci/* RV6xx power management */ 278c2ecf20Sopenharmony_ci#define SPLL_CNTL_MODE 0x60c 288c2ecf20Sopenharmony_ci# define SPLL_DIV_SYNC (1 << 5) 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#define GENERAL_PWRMGT 0x618 318c2ecf20Sopenharmony_ci# define GLOBAL_PWRMGT_EN (1 << 0) 328c2ecf20Sopenharmony_ci# define STATIC_PM_EN (1 << 1) 338c2ecf20Sopenharmony_ci# define MOBILE_SU (1 << 2) 348c2ecf20Sopenharmony_ci# define THERMAL_PROTECTION_DIS (1 << 3) 358c2ecf20Sopenharmony_ci# define THERMAL_PROTECTION_TYPE (1 << 4) 368c2ecf20Sopenharmony_ci# define ENABLE_GEN2PCIE (1 << 5) 378c2ecf20Sopenharmony_ci# define SW_GPIO_INDEX(x) ((x) << 6) 388c2ecf20Sopenharmony_ci# define SW_GPIO_INDEX_MASK (3 << 6) 398c2ecf20Sopenharmony_ci# define LOW_VOLT_D2_ACPI (1 << 8) 408c2ecf20Sopenharmony_ci# define LOW_VOLT_D3_ACPI (1 << 9) 418c2ecf20Sopenharmony_ci# define VOLT_PWRMGT_EN (1 << 10) 428c2ecf20Sopenharmony_ci# define BACKBIAS_PAD_EN (1 << 16) 438c2ecf20Sopenharmony_ci# define BACKBIAS_VALUE (1 << 17) 448c2ecf20Sopenharmony_ci# define BACKBIAS_DPM_CNTL (1 << 18) 458c2ecf20Sopenharmony_ci# define DYN_SPREAD_SPECTRUM_EN (1 << 21) 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci#define MCLK_PWRMGT_CNTL 0x624 488c2ecf20Sopenharmony_ci# define MPLL_PWRMGT_OFF (1 << 0) 498c2ecf20Sopenharmony_ci# define YCLK_TURNOFF (1 << 1) 508c2ecf20Sopenharmony_ci# define MPLL_TURNOFF (1 << 2) 518c2ecf20Sopenharmony_ci# define SU_MCLK_USE_BCLK (1 << 3) 528c2ecf20Sopenharmony_ci# define DLL_READY (1 << 4) 538c2ecf20Sopenharmony_ci# define MC_BUSY (1 << 5) 548c2ecf20Sopenharmony_ci# define MC_INT_CNTL (1 << 7) 558c2ecf20Sopenharmony_ci# define MRDCKA_SLEEP (1 << 8) 568c2ecf20Sopenharmony_ci# define MRDCKB_SLEEP (1 << 9) 578c2ecf20Sopenharmony_ci# define MRDCKC_SLEEP (1 << 10) 588c2ecf20Sopenharmony_ci# define MRDCKD_SLEEP (1 << 11) 598c2ecf20Sopenharmony_ci# define MRDCKE_SLEEP (1 << 12) 608c2ecf20Sopenharmony_ci# define MRDCKF_SLEEP (1 << 13) 618c2ecf20Sopenharmony_ci# define MRDCKG_SLEEP (1 << 14) 628c2ecf20Sopenharmony_ci# define MRDCKH_SLEEP (1 << 15) 638c2ecf20Sopenharmony_ci# define MRDCKA_RESET (1 << 16) 648c2ecf20Sopenharmony_ci# define MRDCKB_RESET (1 << 17) 658c2ecf20Sopenharmony_ci# define MRDCKC_RESET (1 << 18) 668c2ecf20Sopenharmony_ci# define MRDCKD_RESET (1 << 19) 678c2ecf20Sopenharmony_ci# define MRDCKE_RESET (1 << 20) 688c2ecf20Sopenharmony_ci# define MRDCKF_RESET (1 << 21) 698c2ecf20Sopenharmony_ci# define MRDCKG_RESET (1 << 22) 708c2ecf20Sopenharmony_ci# define MRDCKH_RESET (1 << 23) 718c2ecf20Sopenharmony_ci# define DLL_READY_READ (1 << 24) 728c2ecf20Sopenharmony_ci# define USE_DISPLAY_GAP (1 << 25) 738c2ecf20Sopenharmony_ci# define USE_DISPLAY_URGENT_NORMAL (1 << 26) 748c2ecf20Sopenharmony_ci# define USE_DISPLAY_GAP_CTXSW (1 << 27) 758c2ecf20Sopenharmony_ci# define MPLL_TURNOFF_D2 (1 << 28) 768c2ecf20Sopenharmony_ci# define USE_DISPLAY_URGENT_CTXSW (1 << 29) 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci#define MPLL_FREQ_LEVEL_0 0x6e8 798c2ecf20Sopenharmony_ci# define LEVEL0_MPLL_POST_DIV(x) ((x) << 0) 808c2ecf20Sopenharmony_ci# define LEVEL0_MPLL_POST_DIV_MASK (0xff << 0) 818c2ecf20Sopenharmony_ci# define LEVEL0_MPLL_FB_DIV(x) ((x) << 8) 828c2ecf20Sopenharmony_ci# define LEVEL0_MPLL_FB_DIV_MASK (0xfff << 8) 838c2ecf20Sopenharmony_ci# define LEVEL0_MPLL_REF_DIV(x) ((x) << 20) 848c2ecf20Sopenharmony_ci# define LEVEL0_MPLL_REF_DIV_MASK (0x3f << 20) 858c2ecf20Sopenharmony_ci# define LEVEL0_MPLL_DIV_EN (1 << 28) 868c2ecf20Sopenharmony_ci# define LEVEL0_DLL_BYPASS (1 << 29) 878c2ecf20Sopenharmony_ci# define LEVEL0_DLL_RESET (1 << 30) 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci#define VID_RT 0x6f8 908c2ecf20Sopenharmony_ci# define VID_CRT(x) ((x) << 0) 918c2ecf20Sopenharmony_ci# define VID_CRT_MASK (0x1fff << 0) 928c2ecf20Sopenharmony_ci# define VID_CRTU(x) ((x) << 13) 938c2ecf20Sopenharmony_ci# define VID_CRTU_MASK (7 << 13) 948c2ecf20Sopenharmony_ci# define SSTU(x) ((x) << 16) 958c2ecf20Sopenharmony_ci# define SSTU_MASK (7 << 16) 968c2ecf20Sopenharmony_ci# define VID_SWT(x) ((x) << 19) 978c2ecf20Sopenharmony_ci# define VID_SWT_MASK (0x1f << 19) 988c2ecf20Sopenharmony_ci# define BRT(x) ((x) << 24) 998c2ecf20Sopenharmony_ci# define BRT_MASK (0xff << 24) 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci#define TARGET_AND_CURRENT_PROFILE_INDEX 0x70c 1028c2ecf20Sopenharmony_ci# define TARGET_PROFILE_INDEX_MASK (3 << 0) 1038c2ecf20Sopenharmony_ci# define TARGET_PROFILE_INDEX_SHIFT 0 1048c2ecf20Sopenharmony_ci# define CURRENT_PROFILE_INDEX_MASK (3 << 2) 1058c2ecf20Sopenharmony_ci# define CURRENT_PROFILE_INDEX_SHIFT 2 1068c2ecf20Sopenharmony_ci# define DYN_PWR_ENTER_INDEX(x) ((x) << 4) 1078c2ecf20Sopenharmony_ci# define DYN_PWR_ENTER_INDEX_MASK (3 << 4) 1088c2ecf20Sopenharmony_ci# define DYN_PWR_ENTER_INDEX_SHIFT 4 1098c2ecf20Sopenharmony_ci# define CURR_MCLK_INDEX_MASK (3 << 6) 1108c2ecf20Sopenharmony_ci# define CURR_MCLK_INDEX_SHIFT 6 1118c2ecf20Sopenharmony_ci# define CURR_SCLK_INDEX_MASK (0x1f << 8) 1128c2ecf20Sopenharmony_ci# define CURR_SCLK_INDEX_SHIFT 8 1138c2ecf20Sopenharmony_ci# define CURR_VID_INDEX_MASK (3 << 13) 1148c2ecf20Sopenharmony_ci# define CURR_VID_INDEX_SHIFT 13 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_ci#define VID_UPPER_GPIO_CNTL 0x740 1178c2ecf20Sopenharmony_ci# define CTXSW_UPPER_GPIO_VALUES(x) ((x) << 0) 1188c2ecf20Sopenharmony_ci# define CTXSW_UPPER_GPIO_VALUES_MASK (7 << 0) 1198c2ecf20Sopenharmony_ci# define HIGH_UPPER_GPIO_VALUES(x) ((x) << 3) 1208c2ecf20Sopenharmony_ci# define HIGH_UPPER_GPIO_VALUES_MASK (7 << 3) 1218c2ecf20Sopenharmony_ci# define MEDIUM_UPPER_GPIO_VALUES(x) ((x) << 6) 1228c2ecf20Sopenharmony_ci# define MEDIUM_UPPER_GPIO_VALUES_MASK (7 << 6) 1238c2ecf20Sopenharmony_ci# define LOW_UPPER_GPIO_VALUES(x) ((x) << 9) 1248c2ecf20Sopenharmony_ci# define LOW_UPPER_GPIO_VALUES_MASK (7 << 9) 1258c2ecf20Sopenharmony_ci# define CTXSW_BACKBIAS_VALUE (1 << 12) 1268c2ecf20Sopenharmony_ci# define HIGH_BACKBIAS_VALUE (1 << 13) 1278c2ecf20Sopenharmony_ci# define MEDIUM_BACKBIAS_VALUE (1 << 14) 1288c2ecf20Sopenharmony_ci# define LOW_BACKBIAS_VALUE (1 << 15) 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_ci#define CG_DISPLAY_GAP_CNTL 0x7dc 1318c2ecf20Sopenharmony_ci# define DISP1_GAP(x) ((x) << 0) 1328c2ecf20Sopenharmony_ci# define DISP1_GAP_MASK (3 << 0) 1338c2ecf20Sopenharmony_ci# define DISP2_GAP(x) ((x) << 2) 1348c2ecf20Sopenharmony_ci# define DISP2_GAP_MASK (3 << 2) 1358c2ecf20Sopenharmony_ci# define VBI_TIMER_COUNT(x) ((x) << 4) 1368c2ecf20Sopenharmony_ci# define VBI_TIMER_COUNT_MASK (0x3fff << 4) 1378c2ecf20Sopenharmony_ci# define VBI_TIMER_UNIT(x) ((x) << 20) 1388c2ecf20Sopenharmony_ci# define VBI_TIMER_UNIT_MASK (7 << 20) 1398c2ecf20Sopenharmony_ci# define DISP1_GAP_MCHG(x) ((x) << 24) 1408c2ecf20Sopenharmony_ci# define DISP1_GAP_MCHG_MASK (3 << 24) 1418c2ecf20Sopenharmony_ci# define DISP2_GAP_MCHG(x) ((x) << 26) 1428c2ecf20Sopenharmony_ci# define DISP2_GAP_MCHG_MASK (3 << 26) 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ci#define CG_THERMAL_CTRL 0x7f0 1458c2ecf20Sopenharmony_ci# define DPM_EVENT_SRC(x) ((x) << 0) 1468c2ecf20Sopenharmony_ci# define DPM_EVENT_SRC_MASK (7 << 0) 1478c2ecf20Sopenharmony_ci# define THERM_INC_CLK (1 << 3) 1488c2ecf20Sopenharmony_ci# define TOFFSET(x) ((x) << 4) 1498c2ecf20Sopenharmony_ci# define TOFFSET_MASK (0xff << 4) 1508c2ecf20Sopenharmony_ci# define DIG_THERM_DPM(x) ((x) << 12) 1518c2ecf20Sopenharmony_ci# define DIG_THERM_DPM_MASK (0xff << 12) 1528c2ecf20Sopenharmony_ci# define CTF_SEL(x) ((x) << 20) 1538c2ecf20Sopenharmony_ci# define CTF_SEL_MASK (7 << 20) 1548c2ecf20Sopenharmony_ci# define CTF_PAD_POLARITY (1 << 23) 1558c2ecf20Sopenharmony_ci# define CTF_PAD_EN (1 << 24) 1568c2ecf20Sopenharmony_ci 1578c2ecf20Sopenharmony_ci#define CG_SPLL_SPREAD_SPECTRUM_LOW 0x820 1588c2ecf20Sopenharmony_ci# define SSEN (1 << 0) 1598c2ecf20Sopenharmony_ci# define CLKS(x) ((x) << 3) 1608c2ecf20Sopenharmony_ci# define CLKS_MASK (0xff << 3) 1618c2ecf20Sopenharmony_ci# define CLKS_SHIFT 3 1628c2ecf20Sopenharmony_ci# define CLKV(x) ((x) << 11) 1638c2ecf20Sopenharmony_ci# define CLKV_MASK (0x7ff << 11) 1648c2ecf20Sopenharmony_ci# define CLKV_SHIFT 11 1658c2ecf20Sopenharmony_ci#define CG_MPLL_SPREAD_SPECTRUM 0x830 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci#define CITF_CNTL 0x200c 1688c2ecf20Sopenharmony_ci# define BLACKOUT_RD (1 << 0) 1698c2ecf20Sopenharmony_ci# define BLACKOUT_WR (1 << 1) 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci#define RAMCFG 0x2408 1728c2ecf20Sopenharmony_ci#define NOOFBANK_SHIFT 0 1738c2ecf20Sopenharmony_ci#define NOOFBANK_MASK 0x00000001 1748c2ecf20Sopenharmony_ci#define NOOFRANK_SHIFT 1 1758c2ecf20Sopenharmony_ci#define NOOFRANK_MASK 0x00000002 1768c2ecf20Sopenharmony_ci#define NOOFROWS_SHIFT 2 1778c2ecf20Sopenharmony_ci#define NOOFROWS_MASK 0x0000001C 1788c2ecf20Sopenharmony_ci#define NOOFCOLS_SHIFT 5 1798c2ecf20Sopenharmony_ci#define NOOFCOLS_MASK 0x00000060 1808c2ecf20Sopenharmony_ci#define CHANSIZE_SHIFT 7 1818c2ecf20Sopenharmony_ci#define CHANSIZE_MASK 0x00000080 1828c2ecf20Sopenharmony_ci#define BURSTLENGTH_SHIFT 8 1838c2ecf20Sopenharmony_ci#define BURSTLENGTH_MASK 0x00000100 1848c2ecf20Sopenharmony_ci#define CHANSIZE_OVERRIDE (1 << 10) 1858c2ecf20Sopenharmony_ci 1868c2ecf20Sopenharmony_ci#define SQM_RATIO 0x2424 1878c2ecf20Sopenharmony_ci# define STATE0(x) ((x) << 0) 1888c2ecf20Sopenharmony_ci# define STATE0_MASK (0xff << 0) 1898c2ecf20Sopenharmony_ci# define STATE1(x) ((x) << 8) 1908c2ecf20Sopenharmony_ci# define STATE1_MASK (0xff << 8) 1918c2ecf20Sopenharmony_ci# define STATE2(x) ((x) << 16) 1928c2ecf20Sopenharmony_ci# define STATE2_MASK (0xff << 16) 1938c2ecf20Sopenharmony_ci# define STATE3(x) ((x) << 24) 1948c2ecf20Sopenharmony_ci# define STATE3_MASK (0xff << 24) 1958c2ecf20Sopenharmony_ci 1968c2ecf20Sopenharmony_ci#define ARB_RFSH_CNTL 0x2460 1978c2ecf20Sopenharmony_ci# define ENABLE (1 << 0) 1988c2ecf20Sopenharmony_ci#define ARB_RFSH_RATE 0x2464 1998c2ecf20Sopenharmony_ci# define POWERMODE0(x) ((x) << 0) 2008c2ecf20Sopenharmony_ci# define POWERMODE0_MASK (0xff << 0) 2018c2ecf20Sopenharmony_ci# define POWERMODE1(x) ((x) << 8) 2028c2ecf20Sopenharmony_ci# define POWERMODE1_MASK (0xff << 8) 2038c2ecf20Sopenharmony_ci# define POWERMODE2(x) ((x) << 16) 2048c2ecf20Sopenharmony_ci# define POWERMODE2_MASK (0xff << 16) 2058c2ecf20Sopenharmony_ci# define POWERMODE3(x) ((x) << 24) 2068c2ecf20Sopenharmony_ci# define POWERMODE3_MASK (0xff << 24) 2078c2ecf20Sopenharmony_ci 2088c2ecf20Sopenharmony_ci#define MC_SEQ_DRAM 0x2608 2098c2ecf20Sopenharmony_ci# define CKE_DYN (1 << 12) 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_ci#define MC_SEQ_CMD 0x26c4 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_ci#define MC_SEQ_RESERVE_S 0x2890 2148c2ecf20Sopenharmony_ci#define MC_SEQ_RESERVE_M 0x2894 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_ci#define LVTMA_DATA_SYNCHRONIZATION 0x7adc 2178c2ecf20Sopenharmony_ci# define LVTMA_PFREQCHG (1 << 8) 2188c2ecf20Sopenharmony_ci#define DCE3_LVTMA_DATA_SYNCHRONIZATION 0x7f98 2198c2ecf20Sopenharmony_ci 2208c2ecf20Sopenharmony_ci/* PCIE indirect regs */ 2218c2ecf20Sopenharmony_ci#define PCIE_P_CNTL 0x40 2228c2ecf20Sopenharmony_ci# define P_PLL_PWRDN_IN_L1L23 (1 << 3) 2238c2ecf20Sopenharmony_ci# define P_PLL_BUF_PDNB (1 << 4) 2248c2ecf20Sopenharmony_ci# define P_PLL_PDNB (1 << 9) 2258c2ecf20Sopenharmony_ci# define P_ALLOW_PRX_FRONTEND_SHUTOFF (1 << 12) 2268c2ecf20Sopenharmony_ci/* PCIE PORT indirect regs */ 2278c2ecf20Sopenharmony_ci#define PCIE_LC_CNTL 0xa0 2288c2ecf20Sopenharmony_ci# define LC_L0S_INACTIVITY(x) ((x) << 8) 2298c2ecf20Sopenharmony_ci# define LC_L0S_INACTIVITY_MASK (0xf << 8) 2308c2ecf20Sopenharmony_ci# define LC_L0S_INACTIVITY_SHIFT 8 2318c2ecf20Sopenharmony_ci# define LC_L1_INACTIVITY(x) ((x) << 12) 2328c2ecf20Sopenharmony_ci# define LC_L1_INACTIVITY_MASK (0xf << 12) 2338c2ecf20Sopenharmony_ci# define LC_L1_INACTIVITY_SHIFT 12 2348c2ecf20Sopenharmony_ci# define LC_PMI_TO_L1_DIS (1 << 16) 2358c2ecf20Sopenharmony_ci# define LC_ASPM_TO_L1_DIS (1 << 24) 2368c2ecf20Sopenharmony_ci#define PCIE_LC_SPEED_CNTL 0xa4 2378c2ecf20Sopenharmony_ci# define LC_GEN2_EN (1 << 0) 2388c2ecf20Sopenharmony_ci# define LC_INITIATE_LINK_SPEED_CHANGE (1 << 7) 2398c2ecf20Sopenharmony_ci# define LC_CURRENT_DATA_RATE (1 << 11) 2408c2ecf20Sopenharmony_ci# define LC_HW_VOLTAGE_IF_CONTROL(x) ((x) << 12) 2418c2ecf20Sopenharmony_ci# define LC_HW_VOLTAGE_IF_CONTROL_MASK (3 << 12) 2428c2ecf20Sopenharmony_ci# define LC_HW_VOLTAGE_IF_CONTROL_SHIFT 12 2438c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 23) 2448c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 24) 2458c2ecf20Sopenharmony_ci 2468c2ecf20Sopenharmony_ci#endif 247