2 * Copyright 2013 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
31 #define SMU7_DTE_ITERATIONS 5
32 #define SMU7_DTE_SOURCES 5
33 #define SMU7_DTE_SINKS 3
34 #define SMU7_NUM_CPU_TES 2
35 #define SMU7_NUM_GPU_TES 1
36 #define SMU7_NUM_NON_TES 2
38 // All 'soft registers' should be uint32_t.
39 struct SMU7_SoftRegisters
41 uint32_t RefClockFrequency;
43 uint32_t FeatureEnables;
44 uint32_t HandshakeDisables;
46 uint8_t DisplayPhy1Config;
47 uint8_t DisplayPhy2Config;
48 uint8_t DisplayPhy3Config;
49 uint8_t DisplayPhy4Config;
51 uint8_t DisplayPhy5Config;
52 uint8_t DisplayPhy6Config;
53 uint8_t DisplayPhy7Config;
54 uint8_t DisplayPhy8Config;
56 uint32_t AverageGraphicsA;
57 uint32_t AverageMemoryA;
60 uint8_t SClkDpmEnabledLevels;
61 uint8_t MClkDpmEnabledLevels;
62 uint8_t LClkDpmEnabledLevels;
63 uint8_t PCIeDpmEnabledLevels;
65 uint8_t UVDDpmEnabledLevels;
66 uint8_t SAMUDpmEnabledLevels;
67 uint8_t ACPDpmEnabledLevels;
68 uint8_t VCEDpmEnabledLevels;
70 uint32_t DRAM_LOG_ADDR_H;
71 uint32_t DRAM_LOG_ADDR_L;
72 uint32_t DRAM_LOG_PHY_ADDR_H;
73 uint32_t DRAM_LOG_PHY_ADDR_L;
74 uint32_t DRAM_LOG_BUFF_SIZE;
81 typedef struct SMU7_SoftRegisters SMU7_SoftRegisters;
83 struct SMU7_Fusion_GraphicsLevel
87 uint32_t SclkFrequency;
93 uint8_t PowerThrottle;
98 uint8_t DisplayWatermark;
99 uint8_t EnabledForActivity;
100 uint8_t EnabledForThrottle;
104 uint8_t VoltageDownH;
105 uint8_t DeepSleepDivId;
107 uint8_t ClkBypassCntl;
112 typedef struct SMU7_Fusion_GraphicsLevel SMU7_Fusion_GraphicsLevel;
114 struct SMU7_Fusion_GIOLevel
116 uint8_t EnabledForActivity;
119 uint8_t VoltageDownH;
123 uint16_t ResidencyCounter;
127 uint32_t LclkFrequency;
129 uint8_t ActivityLevel;
130 uint8_t EnabledForThrottle;
132 uint8_t ClkBypassCntl;
137 typedef struct SMU7_Fusion_GIOLevel SMU7_Fusion_GIOLevel;
139 // UVD VCLK/DCLK state (level) definition.
140 struct SMU7_Fusion_UvdLevel
142 uint32_t VclkFrequency;
143 uint32_t DclkFrequency;
148 uint8_t VClkBypassCntl;
149 uint8_t DClkBypassCntl;
155 typedef struct SMU7_Fusion_UvdLevel SMU7_Fusion_UvdLevel;
157 // Clocks for other external blocks (VCE, ACP, SAMU).
158 struct SMU7_Fusion_ExtClkLevel
163 uint8_t ClkBypassCntl;
167 typedef struct SMU7_Fusion_ExtClkLevel SMU7_Fusion_ExtClkLevel;
169 struct SMU7_Fusion_ACPILevel
173 uint32_t SclkFrequency;
177 uint8_t DisplayWatermark;
178 uint8_t DeepSleepDivId;
182 typedef struct SMU7_Fusion_ACPILevel SMU7_Fusion_ACPILevel;
184 struct SMU7_Fusion_NbDpm
188 uint8_t Dpm0PgNbPsHi;
189 uint8_t Dpm0PgNbPsLo;
194 uint8_t EnableDpmPstatePoll;
198 typedef struct SMU7_Fusion_NbDpm SMU7_Fusion_NbDpm;
200 struct SMU7_Fusion_StateInfo
202 uint32_t SclkFrequency;
203 uint32_t LclkFrequency;
204 uint32_t VclkFrequency;
205 uint32_t DclkFrequency;
206 uint32_t SamclkFrequency;
207 uint32_t AclkFrequency;
208 uint32_t EclkFrequency;
209 uint8_t DisplayWatermark;
215 typedef struct SMU7_Fusion_StateInfo SMU7_Fusion_StateInfo;
217 struct SMU7_Fusion_DpmTable
219 uint32_t SystemFlags;
221 SMU7_PIDController GraphicsPIDController;
222 SMU7_PIDController GioPIDController;
224 uint8_t GraphicsDpmLevelCount;
225 uint8_t GIOLevelCount;
226 uint8_t UvdLevelCount;
227 uint8_t VceLevelCount;
229 uint8_t AcpLevelCount;
230 uint8_t SamuLevelCount;
233 SMU7_Fusion_GraphicsLevel GraphicsLevel [SMU__NUM_SCLK_DPM_STATE];
234 SMU7_Fusion_ACPILevel ACPILevel;
235 SMU7_Fusion_UvdLevel UvdLevel [SMU7_MAX_LEVELS_UVD];
236 SMU7_Fusion_ExtClkLevel VceLevel [SMU7_MAX_LEVELS_VCE];
237 SMU7_Fusion_ExtClkLevel AcpLevel [SMU7_MAX_LEVELS_ACP];
238 SMU7_Fusion_ExtClkLevel SamuLevel [SMU7_MAX_LEVELS_SAMU];
240 uint8_t UvdBootLevel;
241 uint8_t VceBootLevel;
242 uint8_t AcpBootLevel;
243 uint8_t SamuBootLevel;
247 uint8_t SAMUInterval;
249 uint8_t GraphicsBootLevel;
250 uint8_t GraphicsInterval;
251 uint8_t GraphicsThermThrottleEnable;
252 uint8_t GraphicsVoltageChangeEnable;
254 uint8_t GraphicsClkSlowEnable;
255 uint8_t GraphicsClkSlowDivider;
259 uint32_t LowSclkInterruptT;
261 uint32_t DRAM_LOG_ADDR_H;
262 uint32_t DRAM_LOG_ADDR_L;
263 uint32_t DRAM_LOG_PHY_ADDR_H;
264 uint32_t DRAM_LOG_PHY_ADDR_L;
265 uint32_t DRAM_LOG_BUFF_SIZE;
269 struct SMU7_Fusion_GIODpmTable
272 SMU7_Fusion_GIOLevel GIOLevel [SMU7_MAX_LEVELS_GIO];
274 SMU7_PIDController GioPIDController;
276 uint32_t GIOLevelCount;
279 uint8_t GIOVoltageChangeEnable;
280 uint8_t GIOBootLevel;
284 uint8_t CurrenttState;
285 uint8_t ThrottleOnHtc;
286 uint8_t ThermThrottleStatus;
287 uint8_t ThermThrottleTempSelect;
288 uint8_t ThermThrottleEnable;
289 uint16_t TemperatureLimitHigh;
290 uint16_t TemperatureLimitLow;
294 typedef struct SMU7_Fusion_DpmTable SMU7_Fusion_DpmTable;
295 typedef struct SMU7_Fusion_GIODpmTable SMU7_Fusion_GIODpmTable;