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