1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #ifndef SMU12_DRIVER_IF_H
25 #define SMU12_DRIVER_IF_H
26
27
28
29
30 #define SMU12_DRIVER_IF_VERSION 10
31
32 typedef struct {
33 int32_t value;
34 uint32_t numFractionalBits;
35 } FloatInIntFormat_t;
36
37 typedef enum {
38 DSPCLK_DCFCLK = 0,
39 DSPCLK_DISPCLK,
40 DSPCLK_PIXCLK,
41 DSPCLK_PHYCLK,
42 DSPCLK_COUNT,
43 } DSPCLK_e;
44
45 typedef struct {
46 uint16_t Freq;
47 uint16_t Vid;
48 } DisplayClockTable_t;
49
50 typedef struct {
51 uint16_t MinClock;
52 uint16_t MaxClock;
53 uint16_t MinMclk;
54 uint16_t MaxMclk;
55
56 uint8_t WmSetting;
57 uint8_t WmType;
58 uint8_t Padding[2];
59 } WatermarkRowGeneric_t;
60
61 #define NUM_WM_RANGES 4
62 #define WM_PSTATE_CHG 0
63 #define WM_RETRAINING 1
64
65 typedef enum {
66 WM_SOCCLK = 0,
67 WM_DCFCLK,
68 WM_COUNT,
69 } WM_CLOCK_e;
70
71 typedef struct {
72
73 WatermarkRowGeneric_t WatermarkRow[WM_COUNT][NUM_WM_RANGES];
74
75 uint32_t MmHubPadding[7];
76 } Watermarks_t;
77
78 typedef enum {
79 CUSTOM_DPM_SETTING_GFXCLK,
80 CUSTOM_DPM_SETTING_CCLK,
81 CUSTOM_DPM_SETTING_FCLK_CCX,
82 CUSTOM_DPM_SETTING_FCLK_GFX,
83 CUSTOM_DPM_SETTING_FCLK_STALLS,
84 CUSTOM_DPM_SETTING_LCLK,
85 CUSTOM_DPM_SETTING_COUNT,
86 } CUSTOM_DPM_SETTING_e;
87
88 typedef struct {
89 uint8_t ActiveHystLimit;
90 uint8_t IdleHystLimit;
91 uint8_t FPS;
92 uint8_t MinActiveFreqType;
93 FloatInIntFormat_t MinActiveFreq;
94 FloatInIntFormat_t PD_Data_limit;
95 FloatInIntFormat_t PD_Data_time_constant;
96 FloatInIntFormat_t PD_Data_error_coeff;
97 FloatInIntFormat_t PD_Data_error_rate_coeff;
98 } DpmActivityMonitorCoeffExt_t;
99
100 typedef struct {
101 DpmActivityMonitorCoeffExt_t DpmActivityMonitorCoeff[CUSTOM_DPM_SETTING_COUNT];
102 } CustomDpmSettings_t;
103
104
105 #define NUM_DCFCLK_DPM_LEVELS 8
106 #define NUM_SOCCLK_DPM_LEVELS 8
107 #define NUM_FCLK_DPM_LEVELS 4
108 #define NUM_MEMCLK_DPM_LEVELS 4
109 #define NUM_VCN_DPM_LEVELS 8
110
111 typedef struct {
112 uint32_t Freq;
113 uint32_t Vol;
114 } DpmClock_t;
115
116 typedef struct {
117 DpmClock_t DcfClocks[NUM_DCFCLK_DPM_LEVELS];
118 DpmClock_t SocClocks[NUM_SOCCLK_DPM_LEVELS];
119 DpmClock_t FClocks[NUM_FCLK_DPM_LEVELS];
120 DpmClock_t MemClocks[NUM_MEMCLK_DPM_LEVELS];
121 DpmClock_t VClocks[NUM_VCN_DPM_LEVELS];
122 DpmClock_t DClocks[NUM_VCN_DPM_LEVELS];
123
124 uint8_t NumDcfClkDpmEnabled;
125 uint8_t NumSocClkDpmEnabled;
126 uint8_t NumFClkDpmEnabled;
127 uint8_t NumMemClkDpmEnabled;
128 uint8_t NumVClkDpmEnabled;
129 uint8_t NumDClkDpmEnabled;
130 uint8_t spare[2];
131 } DpmClocks_t;
132
133
134 typedef enum {
135 CLOCK_SMNCLK = 0,
136 CLOCK_SOCCLK,
137 CLOCK_MP0CLK,
138 CLOCK_MP1CLK,
139 CLOCK_MP2CLK,
140 CLOCK_VCLK,
141 CLOCK_LCLK,
142 CLOCK_DCLK,
143 CLOCK_ACLK,
144 CLOCK_ISPCLK,
145 CLOCK_SHUBCLK,
146 CLOCK_DISPCLK,
147 CLOCK_DPPCLK,
148 CLOCK_DPREFCLK,
149 CLOCK_DCFCLK,
150 CLOCK_FCLK,
151 CLOCK_UMCCLK,
152 CLOCK_GFXCLK,
153 CLOCK_COUNT,
154 } CLOCK_IDs_e;
155
156
157 #define THROTTLER_STATUS_BIT_SPL 0
158 #define THROTTLER_STATUS_BIT_FPPT 1
159 #define THROTTLER_STATUS_BIT_SPPT 2
160 #define THROTTLER_STATUS_BIT_SPPT_APU 3
161 #define THROTTLER_STATUS_BIT_THM_CORE 4
162 #define THROTTLER_STATUS_BIT_THM_GFX 5
163 #define THROTTLER_STATUS_BIT_THM_SOC 6
164 #define THROTTLER_STATUS_BIT_TDC_VDD 7
165 #define THROTTLER_STATUS_BIT_TDC_SOC 8
166
167 typedef struct {
168 uint16_t ClockFrequency[CLOCK_COUNT];
169
170 uint16_t AverageGfxclkFrequency;
171 uint16_t AverageSocclkFrequency;
172 uint16_t AverageVclkFrequency;
173 uint16_t AverageFclkFrequency;
174
175 uint16_t AverageGfxActivity;
176 uint16_t AverageUvdActivity;
177
178 uint16_t Voltage[2];
179 uint16_t Current[2];
180 uint16_t Power[2];
181
182 uint16_t FanPwm;
183 uint16_t CurrentSocketPower;
184
185 uint16_t CoreFrequency[8];
186 uint16_t CorePower[8];
187 uint16_t CoreTemperature[8];
188 uint16_t L3Frequency[2];
189 uint16_t L3Temperature[2];
190
191 uint16_t GfxTemperature;
192 uint16_t SocTemperature;
193 uint16_t ThrottlerStatus;
194 uint16_t spare;
195 } SmuMetrics_t;
196
197
198
199 #define WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT 0
200 #define WORKLOAD_PPLIB_VIDEO_BIT 2
201 #define WORKLOAD_PPLIB_VR_BIT 3
202 #define WORKLOAD_PPLIB_COMPUTE_BIT 4
203 #define WORKLOAD_PPLIB_CUSTOM_BIT 5
204 #define WORKLOAD_PPLIB_COUNT 6
205
206 #define TABLE_BIOS_IF 0
207 #define TABLE_WATERMARKS 1
208 #define TABLE_CUSTOM_DPM 2
209 #define TABLE_SPARE1 3
210 #define TABLE_DPMCLOCKS 4
211 #define TABLE_MOMENTARY_PM 5
212 #define TABLE_MODERN_STDBY 6
213 #define TABLE_SMU_METRICS 7
214 #define TABLE_COUNT 8
215
216
217 #endif