btcd.h revision 1.1 1 1.1 riastrad /*
2 1.1 riastrad * Copyright 2010 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 * Authors: Alex Deucher
23 1.1 riastrad */
24 1.1 riastrad #ifndef _BTCD_H_
25 1.1 riastrad #define _BTCD_H_
26 1.1 riastrad
27 1.1 riastrad /* pm registers */
28 1.1 riastrad
29 1.1 riastrad #define GENERAL_PWRMGT 0x63c
30 1.1 riastrad # define GLOBAL_PWRMGT_EN (1 << 0)
31 1.1 riastrad # define STATIC_PM_EN (1 << 1)
32 1.1 riastrad # define THERMAL_PROTECTION_DIS (1 << 2)
33 1.1 riastrad # define THERMAL_PROTECTION_TYPE (1 << 3)
34 1.1 riastrad # define ENABLE_GEN2PCIE (1 << 4)
35 1.1 riastrad # define ENABLE_GEN2XSP (1 << 5)
36 1.1 riastrad # define SW_SMIO_INDEX(x) ((x) << 6)
37 1.1 riastrad # define SW_SMIO_INDEX_MASK (3 << 6)
38 1.1 riastrad # define SW_SMIO_INDEX_SHIFT 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 << 18)
43 1.1 riastrad # define BACKBIAS_VALUE (1 << 19)
44 1.1 riastrad # define DYN_SPREAD_SPECTRUM_EN (1 << 23)
45 1.1 riastrad # define AC_DC_SW (1 << 24)
46 1.1 riastrad
47 1.1 riastrad #define TARGET_AND_CURRENT_PROFILE_INDEX 0x66c
48 1.1 riastrad # define CURRENT_PROFILE_INDEX_MASK (0xf << 4)
49 1.1 riastrad # define CURRENT_PROFILE_INDEX_SHIFT 4
50 1.1 riastrad
51 1.1 riastrad #define CG_BIF_REQ_AND_RSP 0x7f4
52 1.1 riastrad #define CG_CLIENT_REQ(x) ((x) << 0)
53 1.1 riastrad #define CG_CLIENT_REQ_MASK (0xff << 0)
54 1.1 riastrad #define CG_CLIENT_REQ_SHIFT 0
55 1.1 riastrad #define CG_CLIENT_RESP(x) ((x) << 8)
56 1.1 riastrad #define CG_CLIENT_RESP_MASK (0xff << 8)
57 1.1 riastrad #define CG_CLIENT_RESP_SHIFT 8
58 1.1 riastrad #define CLIENT_CG_REQ(x) ((x) << 16)
59 1.1 riastrad #define CLIENT_CG_REQ_MASK (0xff << 16)
60 1.1 riastrad #define CLIENT_CG_REQ_SHIFT 16
61 1.1 riastrad #define CLIENT_CG_RESP(x) ((x) << 24)
62 1.1 riastrad #define CLIENT_CG_RESP_MASK (0xff << 24)
63 1.1 riastrad #define CLIENT_CG_RESP_SHIFT 24
64 1.1 riastrad
65 1.1 riastrad #define SCLK_PSKIP_CNTL 0x8c0
66 1.1 riastrad #define PSKIP_ON_ALLOW_STOP_HI(x) ((x) << 16)
67 1.1 riastrad #define PSKIP_ON_ALLOW_STOP_HI_MASK (0xff << 16)
68 1.1 riastrad #define PSKIP_ON_ALLOW_STOP_HI_SHIFT 16
69 1.1 riastrad
70 1.1 riastrad #define CG_ULV_CONTROL 0x8c8
71 1.1 riastrad #define CG_ULV_PARAMETER 0x8cc
72 1.1 riastrad
73 1.1 riastrad #define MC_ARB_DRAM_TIMING 0x2774
74 1.1 riastrad #define MC_ARB_DRAM_TIMING2 0x2778
75 1.1 riastrad
76 1.1 riastrad #define MC_ARB_RFSH_RATE 0x27b0
77 1.1 riastrad #define POWERMODE0(x) ((x) << 0)
78 1.1 riastrad #define POWERMODE0_MASK (0xff << 0)
79 1.1 riastrad #define POWERMODE0_SHIFT 0
80 1.1 riastrad #define POWERMODE1(x) ((x) << 8)
81 1.1 riastrad #define POWERMODE1_MASK (0xff << 8)
82 1.1 riastrad #define POWERMODE1_SHIFT 8
83 1.1 riastrad #define POWERMODE2(x) ((x) << 16)
84 1.1 riastrad #define POWERMODE2_MASK (0xff << 16)
85 1.1 riastrad #define POWERMODE2_SHIFT 16
86 1.1 riastrad #define POWERMODE3(x) ((x) << 24)
87 1.1 riastrad #define POWERMODE3_MASK (0xff << 24)
88 1.1 riastrad #define POWERMODE3_SHIFT 24
89 1.1 riastrad
90 1.1 riastrad #define MC_ARB_BURST_TIME 0x2808
91 1.1 riastrad #define STATE0(x) ((x) << 0)
92 1.1 riastrad #define STATE0_MASK (0x1f << 0)
93 1.1 riastrad #define STATE0_SHIFT 0
94 1.1 riastrad #define STATE1(x) ((x) << 5)
95 1.1 riastrad #define STATE1_MASK (0x1f << 5)
96 1.1 riastrad #define STATE1_SHIFT 5
97 1.1 riastrad #define STATE2(x) ((x) << 10)
98 1.1 riastrad #define STATE2_MASK (0x1f << 10)
99 1.1 riastrad #define STATE2_SHIFT 10
100 1.1 riastrad #define STATE3(x) ((x) << 15)
101 1.1 riastrad #define STATE3_MASK (0x1f << 15)
102 1.1 riastrad #define STATE3_SHIFT 15
103 1.1 riastrad
104 1.1 riastrad #define MC_SEQ_RAS_TIMING 0x28a0
105 1.1 riastrad #define MC_SEQ_CAS_TIMING 0x28a4
106 1.1 riastrad #define MC_SEQ_MISC_TIMING 0x28a8
107 1.1 riastrad #define MC_SEQ_MISC_TIMING2 0x28ac
108 1.1 riastrad
109 1.1 riastrad #define MC_SEQ_RD_CTL_D0 0x28b4
110 1.1 riastrad #define MC_SEQ_RD_CTL_D1 0x28b8
111 1.1 riastrad #define MC_SEQ_WR_CTL_D0 0x28bc
112 1.1 riastrad #define MC_SEQ_WR_CTL_D1 0x28c0
113 1.1 riastrad
114 1.1 riastrad #define MC_PMG_AUTO_CFG 0x28d4
115 1.1 riastrad
116 1.1 riastrad #define MC_SEQ_STATUS_M 0x29f4
117 1.1 riastrad # define PMG_PWRSTATE (1 << 16)
118 1.1 riastrad
119 1.1 riastrad #define MC_SEQ_MISC0 0x2a00
120 1.1 riastrad #define MC_SEQ_MISC0_GDDR5_SHIFT 28
121 1.1 riastrad #define MC_SEQ_MISC0_GDDR5_MASK 0xf0000000
122 1.1 riastrad #define MC_SEQ_MISC0_GDDR5_VALUE 5
123 1.1 riastrad #define MC_SEQ_MISC1 0x2a04
124 1.1 riastrad #define MC_SEQ_RESERVE_M 0x2a08
125 1.1 riastrad #define MC_PMG_CMD_EMRS 0x2a0c
126 1.1 riastrad
127 1.1 riastrad #define MC_SEQ_MISC3 0x2a2c
128 1.1 riastrad
129 1.1 riastrad #define MC_SEQ_MISC5 0x2a54
130 1.1 riastrad #define MC_SEQ_MISC6 0x2a58
131 1.1 riastrad
132 1.1 riastrad #define MC_SEQ_MISC7 0x2a64
133 1.1 riastrad
134 1.1 riastrad #define MC_SEQ_CG 0x2a68
135 1.1 riastrad #define CG_SEQ_REQ(x) ((x) << 0)
136 1.1 riastrad #define CG_SEQ_REQ_MASK (0xff << 0)
137 1.1 riastrad #define CG_SEQ_REQ_SHIFT 0
138 1.1 riastrad #define CG_SEQ_RESP(x) ((x) << 8)
139 1.1 riastrad #define CG_SEQ_RESP_MASK (0xff << 8)
140 1.1 riastrad #define CG_SEQ_RESP_SHIFT 8
141 1.1 riastrad #define SEQ_CG_REQ(x) ((x) << 16)
142 1.1 riastrad #define SEQ_CG_REQ_MASK (0xff << 16)
143 1.1 riastrad #define SEQ_CG_REQ_SHIFT 16
144 1.1 riastrad #define SEQ_CG_RESP(x) ((x) << 24)
145 1.1 riastrad #define SEQ_CG_RESP_MASK (0xff << 24)
146 1.1 riastrad #define SEQ_CG_RESP_SHIFT 24
147 1.1 riastrad #define MC_SEQ_RAS_TIMING_LP 0x2a6c
148 1.1 riastrad #define MC_SEQ_CAS_TIMING_LP 0x2a70
149 1.1 riastrad #define MC_SEQ_MISC_TIMING_LP 0x2a74
150 1.1 riastrad #define MC_SEQ_MISC_TIMING2_LP 0x2a78
151 1.1 riastrad #define MC_SEQ_WR_CTL_D0_LP 0x2a7c
152 1.1 riastrad #define MC_SEQ_WR_CTL_D1_LP 0x2a80
153 1.1 riastrad #define MC_SEQ_PMG_CMD_EMRS_LP 0x2a84
154 1.1 riastrad #define MC_SEQ_PMG_CMD_MRS_LP 0x2a88
155 1.1 riastrad
156 1.1 riastrad #define MC_PMG_CMD_MRS 0x2aac
157 1.1 riastrad
158 1.1 riastrad #define MC_SEQ_RD_CTL_D0_LP 0x2b1c
159 1.1 riastrad #define MC_SEQ_RD_CTL_D1_LP 0x2b20
160 1.1 riastrad
161 1.1 riastrad #define MC_PMG_CMD_MRS1 0x2b44
162 1.1 riastrad #define MC_SEQ_PMG_CMD_MRS1_LP 0x2b48
163 1.1 riastrad
164 1.1 riastrad #define LB_SYNC_RESET_SEL 0x6b28
165 1.1 riastrad #define LB_SYNC_RESET_SEL_MASK (3 << 0)
166 1.1 riastrad #define LB_SYNC_RESET_SEL_SHIFT 0
167 1.1 riastrad
168 1.1 riastrad /* PCIE link stuff */
169 1.1 riastrad #define PCIE_LC_SPEED_CNTL 0xa4 /* PCIE_P */
170 1.1 riastrad # define LC_GEN2_EN_STRAP (1 << 0)
171 1.1 riastrad # define LC_TARGET_LINK_SPEED_OVERRIDE_EN (1 << 1)
172 1.1 riastrad # define LC_FORCE_EN_HW_SPEED_CHANGE (1 << 5)
173 1.1 riastrad # define LC_FORCE_DIS_HW_SPEED_CHANGE (1 << 6)
174 1.1 riastrad # define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK (0x3 << 8)
175 1.1 riastrad # define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT 3
176 1.1 riastrad # define LC_CURRENT_DATA_RATE (1 << 11)
177 1.1 riastrad # define LC_HW_VOLTAGE_IF_CONTROL(x) ((x) << 12)
178 1.1 riastrad # define LC_HW_VOLTAGE_IF_CONTROL_MASK (3 << 12)
179 1.1 riastrad # define LC_HW_VOLTAGE_IF_CONTROL_SHIFT 12
180 1.1 riastrad # define LC_VOLTAGE_TIMER_SEL_MASK (0xf << 14)
181 1.1 riastrad # define LC_CLR_FAILED_SPD_CHANGE_CNT (1 << 21)
182 1.1 riastrad # define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 23)
183 1.1 riastrad # define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 24)
184 1.1 riastrad
185 1.1 riastrad #endif
186