1 1.2 riastrad /* $NetBSD: rv6xxd.h,v 1.3 2021/12/18 23:45:43 riastradh Exp $ */ 2 1.2 riastrad 3 1.1 riastrad /* 4 1.1 riastrad * Copyright 2011 Advanced Micro Devices, Inc. 5 1.1 riastrad * 6 1.1 riastrad * Permission is hereby granted, free of charge, to any person obtaining a 7 1.1 riastrad * copy of this software and associated documentation files (the "Software"), 8 1.1 riastrad * to deal in the Software without restriction, including without limitation 9 1.1 riastrad * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 1.1 riastrad * and/or sell copies of the Software, and to permit persons to whom the 11 1.1 riastrad * Software is furnished to do so, subject to the following conditions: 12 1.1 riastrad * 13 1.1 riastrad * The above copyright notice and this permission notice shall be included in 14 1.1 riastrad * all copies or substantial portions of the Software. 15 1.1 riastrad * 16 1.1 riastrad * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 1.1 riastrad * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 1.1 riastrad * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 1.1 riastrad * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 1.1 riastrad * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 1.1 riastrad * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 1.1 riastrad * OTHER DEALINGS IN THE SOFTWARE. 23 1.1 riastrad * 24 1.1 riastrad */ 25 1.1 riastrad #ifndef RV6XXD_H 26 1.1 riastrad #define RV6XXD_H 27 1.1 riastrad 28 1.1 riastrad /* RV6xx power management */ 29 1.1 riastrad #define SPLL_CNTL_MODE 0x60c 30 1.1 riastrad # define SPLL_DIV_SYNC (1 << 5) 31 1.1 riastrad 32 1.1 riastrad #define GENERAL_PWRMGT 0x618 33 1.1 riastrad # define GLOBAL_PWRMGT_EN (1 << 0) 34 1.1 riastrad # define STATIC_PM_EN (1 << 1) 35 1.1 riastrad # define MOBILE_SU (1 << 2) 36 1.1 riastrad # define THERMAL_PROTECTION_DIS (1 << 3) 37 1.1 riastrad # define THERMAL_PROTECTION_TYPE (1 << 4) 38 1.1 riastrad # define ENABLE_GEN2PCIE (1 << 5) 39 1.1 riastrad # define SW_GPIO_INDEX(x) ((x) << 6) 40 1.1 riastrad # define SW_GPIO_INDEX_MASK (3 << 6) 41 1.1 riastrad # define LOW_VOLT_D2_ACPI (1 << 8) 42 1.1 riastrad # define LOW_VOLT_D3_ACPI (1 << 9) 43 1.1 riastrad # define VOLT_PWRMGT_EN (1 << 10) 44 1.1 riastrad # define BACKBIAS_PAD_EN (1 << 16) 45 1.1 riastrad # define BACKBIAS_VALUE (1 << 17) 46 1.1 riastrad # define BACKBIAS_DPM_CNTL (1 << 18) 47 1.1 riastrad # define DYN_SPREAD_SPECTRUM_EN (1 << 21) 48 1.1 riastrad 49 1.1 riastrad #define MCLK_PWRMGT_CNTL 0x624 50 1.1 riastrad # define MPLL_PWRMGT_OFF (1 << 0) 51 1.1 riastrad # define YCLK_TURNOFF (1 << 1) 52 1.1 riastrad # define MPLL_TURNOFF (1 << 2) 53 1.1 riastrad # define SU_MCLK_USE_BCLK (1 << 3) 54 1.1 riastrad # define DLL_READY (1 << 4) 55 1.1 riastrad # define MC_BUSY (1 << 5) 56 1.1 riastrad # define MC_INT_CNTL (1 << 7) 57 1.1 riastrad # define MRDCKA_SLEEP (1 << 8) 58 1.1 riastrad # define MRDCKB_SLEEP (1 << 9) 59 1.1 riastrad # define MRDCKC_SLEEP (1 << 10) 60 1.1 riastrad # define MRDCKD_SLEEP (1 << 11) 61 1.1 riastrad # define MRDCKE_SLEEP (1 << 12) 62 1.1 riastrad # define MRDCKF_SLEEP (1 << 13) 63 1.1 riastrad # define MRDCKG_SLEEP (1 << 14) 64 1.1 riastrad # define MRDCKH_SLEEP (1 << 15) 65 1.1 riastrad # define MRDCKA_RESET (1 << 16) 66 1.1 riastrad # define MRDCKB_RESET (1 << 17) 67 1.1 riastrad # define MRDCKC_RESET (1 << 18) 68 1.1 riastrad # define MRDCKD_RESET (1 << 19) 69 1.1 riastrad # define MRDCKE_RESET (1 << 20) 70 1.1 riastrad # define MRDCKF_RESET (1 << 21) 71 1.1 riastrad # define MRDCKG_RESET (1 << 22) 72 1.1 riastrad # define MRDCKH_RESET (1 << 23) 73 1.1 riastrad # define DLL_READY_READ (1 << 24) 74 1.1 riastrad # define USE_DISPLAY_GAP (1 << 25) 75 1.1 riastrad # define USE_DISPLAY_URGENT_NORMAL (1 << 26) 76 1.1 riastrad # define USE_DISPLAY_GAP_CTXSW (1 << 27) 77 1.1 riastrad # define MPLL_TURNOFF_D2 (1 << 28) 78 1.1 riastrad # define USE_DISPLAY_URGENT_CTXSW (1 << 29) 79 1.1 riastrad 80 1.1 riastrad #define MPLL_FREQ_LEVEL_0 0x6e8 81 1.1 riastrad # define LEVEL0_MPLL_POST_DIV(x) ((x) << 0) 82 1.1 riastrad # define LEVEL0_MPLL_POST_DIV_MASK (0xff << 0) 83 1.1 riastrad # define LEVEL0_MPLL_FB_DIV(x) ((x) << 8) 84 1.1 riastrad # define LEVEL0_MPLL_FB_DIV_MASK (0xfff << 8) 85 1.1 riastrad # define LEVEL0_MPLL_REF_DIV(x) ((x) << 20) 86 1.1 riastrad # define LEVEL0_MPLL_REF_DIV_MASK (0x3f << 20) 87 1.1 riastrad # define LEVEL0_MPLL_DIV_EN (1 << 28) 88 1.1 riastrad # define LEVEL0_DLL_BYPASS (1 << 29) 89 1.1 riastrad # define LEVEL0_DLL_RESET (1 << 30) 90 1.1 riastrad 91 1.1 riastrad #define VID_RT 0x6f8 92 1.1 riastrad # define VID_CRT(x) ((x) << 0) 93 1.1 riastrad # define VID_CRT_MASK (0x1fff << 0) 94 1.1 riastrad # define VID_CRTU(x) ((x) << 13) 95 1.1 riastrad # define VID_CRTU_MASK (7 << 13) 96 1.1 riastrad # define SSTU(x) ((x) << 16) 97 1.1 riastrad # define SSTU_MASK (7 << 16) 98 1.1 riastrad # define VID_SWT(x) ((x) << 19) 99 1.1 riastrad # define VID_SWT_MASK (0x1f << 19) 100 1.1 riastrad # define BRT(x) ((x) << 24) 101 1.1 riastrad # define BRT_MASK (0xff << 24) 102 1.1 riastrad 103 1.1 riastrad #define TARGET_AND_CURRENT_PROFILE_INDEX 0x70c 104 1.1 riastrad # define TARGET_PROFILE_INDEX_MASK (3 << 0) 105 1.1 riastrad # define TARGET_PROFILE_INDEX_SHIFT 0 106 1.1 riastrad # define CURRENT_PROFILE_INDEX_MASK (3 << 2) 107 1.1 riastrad # define CURRENT_PROFILE_INDEX_SHIFT 2 108 1.1 riastrad # define DYN_PWR_ENTER_INDEX(x) ((x) << 4) 109 1.1 riastrad # define DYN_PWR_ENTER_INDEX_MASK (3 << 4) 110 1.1 riastrad # define DYN_PWR_ENTER_INDEX_SHIFT 4 111 1.1 riastrad # define CURR_MCLK_INDEX_MASK (3 << 6) 112 1.1 riastrad # define CURR_MCLK_INDEX_SHIFT 6 113 1.1 riastrad # define CURR_SCLK_INDEX_MASK (0x1f << 8) 114 1.1 riastrad # define CURR_SCLK_INDEX_SHIFT 8 115 1.1 riastrad # define CURR_VID_INDEX_MASK (3 << 13) 116 1.1 riastrad # define CURR_VID_INDEX_SHIFT 13 117 1.1 riastrad 118 1.1 riastrad #define VID_UPPER_GPIO_CNTL 0x740 119 1.1 riastrad # define CTXSW_UPPER_GPIO_VALUES(x) ((x) << 0) 120 1.1 riastrad # define CTXSW_UPPER_GPIO_VALUES_MASK (7 << 0) 121 1.1 riastrad # define HIGH_UPPER_GPIO_VALUES(x) ((x) << 3) 122 1.1 riastrad # define HIGH_UPPER_GPIO_VALUES_MASK (7 << 3) 123 1.1 riastrad # define MEDIUM_UPPER_GPIO_VALUES(x) ((x) << 6) 124 1.1 riastrad # define MEDIUM_UPPER_GPIO_VALUES_MASK (7 << 6) 125 1.1 riastrad # define LOW_UPPER_GPIO_VALUES(x) ((x) << 9) 126 1.1 riastrad # define LOW_UPPER_GPIO_VALUES_MASK (7 << 9) 127 1.1 riastrad # define CTXSW_BACKBIAS_VALUE (1 << 12) 128 1.1 riastrad # define HIGH_BACKBIAS_VALUE (1 << 13) 129 1.1 riastrad # define MEDIUM_BACKBIAS_VALUE (1 << 14) 130 1.1 riastrad # define LOW_BACKBIAS_VALUE (1 << 15) 131 1.1 riastrad 132 1.1 riastrad #define CG_DISPLAY_GAP_CNTL 0x7dc 133 1.1 riastrad # define DISP1_GAP(x) ((x) << 0) 134 1.1 riastrad # define DISP1_GAP_MASK (3 << 0) 135 1.1 riastrad # define DISP2_GAP(x) ((x) << 2) 136 1.1 riastrad # define DISP2_GAP_MASK (3 << 2) 137 1.1 riastrad # define VBI_TIMER_COUNT(x) ((x) << 4) 138 1.1 riastrad # define VBI_TIMER_COUNT_MASK (0x3fff << 4) 139 1.1 riastrad # define VBI_TIMER_UNIT(x) ((x) << 20) 140 1.1 riastrad # define VBI_TIMER_UNIT_MASK (7 << 20) 141 1.1 riastrad # define DISP1_GAP_MCHG(x) ((x) << 24) 142 1.1 riastrad # define DISP1_GAP_MCHG_MASK (3 << 24) 143 1.1 riastrad # define DISP2_GAP_MCHG(x) ((x) << 26) 144 1.1 riastrad # define DISP2_GAP_MCHG_MASK (3 << 26) 145 1.1 riastrad 146 1.1 riastrad #define CG_THERMAL_CTRL 0x7f0 147 1.1 riastrad # define DPM_EVENT_SRC(x) ((x) << 0) 148 1.1 riastrad # define DPM_EVENT_SRC_MASK (7 << 0) 149 1.1 riastrad # define THERM_INC_CLK (1 << 3) 150 1.1 riastrad # define TOFFSET(x) ((x) << 4) 151 1.1 riastrad # define TOFFSET_MASK (0xff << 4) 152 1.1 riastrad # define DIG_THERM_DPM(x) ((x) << 12) 153 1.1 riastrad # define DIG_THERM_DPM_MASK (0xff << 12) 154 1.1 riastrad # define CTF_SEL(x) ((x) << 20) 155 1.1 riastrad # define CTF_SEL_MASK (7 << 20) 156 1.1 riastrad # define CTF_PAD_POLARITY (1 << 23) 157 1.1 riastrad # define CTF_PAD_EN (1 << 24) 158 1.1 riastrad 159 1.1 riastrad #define CG_SPLL_SPREAD_SPECTRUM_LOW 0x820 160 1.1 riastrad # define SSEN (1 << 0) 161 1.1 riastrad # define CLKS(x) ((x) << 3) 162 1.1 riastrad # define CLKS_MASK (0xff << 3) 163 1.1 riastrad # define CLKS_SHIFT 3 164 1.1 riastrad # define CLKV(x) ((x) << 11) 165 1.1 riastrad # define CLKV_MASK (0x7ff << 11) 166 1.1 riastrad # define CLKV_SHIFT 11 167 1.1 riastrad #define CG_MPLL_SPREAD_SPECTRUM 0x830 168 1.1 riastrad 169 1.1 riastrad #define CITF_CNTL 0x200c 170 1.1 riastrad # define BLACKOUT_RD (1 << 0) 171 1.1 riastrad # define BLACKOUT_WR (1 << 1) 172 1.1 riastrad 173 1.1 riastrad #define RAMCFG 0x2408 174 1.1 riastrad #define NOOFBANK_SHIFT 0 175 1.1 riastrad #define NOOFBANK_MASK 0x00000001 176 1.1 riastrad #define NOOFRANK_SHIFT 1 177 1.1 riastrad #define NOOFRANK_MASK 0x00000002 178 1.1 riastrad #define NOOFROWS_SHIFT 2 179 1.1 riastrad #define NOOFROWS_MASK 0x0000001C 180 1.1 riastrad #define NOOFCOLS_SHIFT 5 181 1.1 riastrad #define NOOFCOLS_MASK 0x00000060 182 1.1 riastrad #define CHANSIZE_SHIFT 7 183 1.1 riastrad #define CHANSIZE_MASK 0x00000080 184 1.1 riastrad #define BURSTLENGTH_SHIFT 8 185 1.1 riastrad #define BURSTLENGTH_MASK 0x00000100 186 1.1 riastrad #define CHANSIZE_OVERRIDE (1 << 10) 187 1.1 riastrad 188 1.1 riastrad #define SQM_RATIO 0x2424 189 1.1 riastrad # define STATE0(x) ((x) << 0) 190 1.1 riastrad # define STATE0_MASK (0xff << 0) 191 1.1 riastrad # define STATE1(x) ((x) << 8) 192 1.1 riastrad # define STATE1_MASK (0xff << 8) 193 1.1 riastrad # define STATE2(x) ((x) << 16) 194 1.1 riastrad # define STATE2_MASK (0xff << 16) 195 1.1 riastrad # define STATE3(x) ((x) << 24) 196 1.1 riastrad # define STATE3_MASK (0xff << 24) 197 1.1 riastrad 198 1.1 riastrad #define ARB_RFSH_CNTL 0x2460 199 1.1 riastrad # define ENABLE (1 << 0) 200 1.1 riastrad #define ARB_RFSH_RATE 0x2464 201 1.1 riastrad # define POWERMODE0(x) ((x) << 0) 202 1.1 riastrad # define POWERMODE0_MASK (0xff << 0) 203 1.1 riastrad # define POWERMODE1(x) ((x) << 8) 204 1.1 riastrad # define POWERMODE1_MASK (0xff << 8) 205 1.1 riastrad # define POWERMODE2(x) ((x) << 16) 206 1.1 riastrad # define POWERMODE2_MASK (0xff << 16) 207 1.1 riastrad # define POWERMODE3(x) ((x) << 24) 208 1.1 riastrad # define POWERMODE3_MASK (0xff << 24) 209 1.1 riastrad 210 1.1 riastrad #define MC_SEQ_DRAM 0x2608 211 1.1 riastrad # define CKE_DYN (1 << 12) 212 1.1 riastrad 213 1.1 riastrad #define MC_SEQ_CMD 0x26c4 214 1.1 riastrad 215 1.1 riastrad #define MC_SEQ_RESERVE_S 0x2890 216 1.1 riastrad #define MC_SEQ_RESERVE_M 0x2894 217 1.1 riastrad 218 1.1 riastrad #define LVTMA_DATA_SYNCHRONIZATION 0x7adc 219 1.1 riastrad # define LVTMA_PFREQCHG (1 << 8) 220 1.1 riastrad #define DCE3_LVTMA_DATA_SYNCHRONIZATION 0x7f98 221 1.1 riastrad 222 1.1 riastrad /* PCIE indirect regs */ 223 1.1 riastrad #define PCIE_P_CNTL 0x40 224 1.1 riastrad # define P_PLL_PWRDN_IN_L1L23 (1 << 3) 225 1.1 riastrad # define P_PLL_BUF_PDNB (1 << 4) 226 1.1 riastrad # define P_PLL_PDNB (1 << 9) 227 1.1 riastrad # define P_ALLOW_PRX_FRONTEND_SHUTOFF (1 << 12) 228 1.1 riastrad /* PCIE PORT indirect regs */ 229 1.1 riastrad #define PCIE_LC_CNTL 0xa0 230 1.1 riastrad # define LC_L0S_INACTIVITY(x) ((x) << 8) 231 1.1 riastrad # define LC_L0S_INACTIVITY_MASK (0xf << 8) 232 1.1 riastrad # define LC_L0S_INACTIVITY_SHIFT 8 233 1.1 riastrad # define LC_L1_INACTIVITY(x) ((x) << 12) 234 1.1 riastrad # define LC_L1_INACTIVITY_MASK (0xf << 12) 235 1.1 riastrad # define LC_L1_INACTIVITY_SHIFT 12 236 1.1 riastrad # define LC_PMI_TO_L1_DIS (1 << 16) 237 1.1 riastrad # define LC_ASPM_TO_L1_DIS (1 << 24) 238 1.1 riastrad #define PCIE_LC_SPEED_CNTL 0xa4 239 1.1 riastrad # define LC_GEN2_EN (1 << 0) 240 1.1 riastrad # define LC_INITIATE_LINK_SPEED_CHANGE (1 << 7) 241 1.1 riastrad # define LC_CURRENT_DATA_RATE (1 << 11) 242 1.1 riastrad # define LC_HW_VOLTAGE_IF_CONTROL(x) ((x) << 12) 243 1.1 riastrad # define LC_HW_VOLTAGE_IF_CONTROL_MASK (3 << 12) 244 1.1 riastrad # define LC_HW_VOLTAGE_IF_CONTROL_SHIFT 12 245 1.1 riastrad # define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 23) 246 1.1 riastrad # define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 24) 247 1.1 riastrad 248 1.1 riastrad #endif 249