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 SMU11_DRIVER_IF_ARCTURUS_H
25 #define SMU11_DRIVER_IF_ARCTURUS_H
26
27
28
29
30
31
32 #define PPTABLE_ARCTURUS_SMU_VERSION 4
33
34 #define NUM_GFXCLK_DPM_LEVELS 16
35 #define NUM_VCLK_DPM_LEVELS 8
36 #define NUM_DCLK_DPM_LEVELS 8
37 #define NUM_MP0CLK_DPM_LEVELS 2
38 #define NUM_SOCCLK_DPM_LEVELS 8
39 #define NUM_UCLK_DPM_LEVELS 4
40 #define NUM_FCLK_DPM_LEVELS 8
41 #define NUM_XGMI_LEVELS 2
42 #define NUM_XGMI_PSTATE_LEVELS 4
43
44 #define MAX_GFXCLK_DPM_LEVEL (NUM_GFXCLK_DPM_LEVELS - 1)
45 #define MAX_VCLK_DPM_LEVEL (NUM_VCLK_DPM_LEVELS - 1)
46 #define MAX_DCLK_DPM_LEVEL (NUM_DCLK_DPM_LEVELS - 1)
47 #define MAX_MP0CLK_DPM_LEVEL (NUM_MP0CLK_DPM_LEVELS - 1)
48 #define MAX_SOCCLK_DPM_LEVEL (NUM_SOCCLK_DPM_LEVELS - 1)
49 #define MAX_UCLK_DPM_LEVEL (NUM_UCLK_DPM_LEVELS - 1)
50 #define MAX_FCLK_DPM_LEVEL (NUM_FCLK_DPM_LEVELS - 1)
51 #define MAX_XGMI_LEVEL (NUM_XGMI_LEVELS - 1)
52 #define MAX_XGMI_PSTATE_LEVEL (NUM_XGMI_PSTATE_LEVELS - 1)
53
54
55
56 #define FEATURE_DPM_PREFETCHER_BIT 0
57 #define FEATURE_DPM_GFXCLK_BIT 1
58 #define FEATURE_DPM_UCLK_BIT 2
59 #define FEATURE_DPM_SOCCLK_BIT 3
60 #define FEATURE_DPM_FCLK_BIT 4
61 #define FEATURE_DPM_MP0CLK_BIT 5
62 #define FEATURE_DPM_XGMI_BIT 6
63
64 #define FEATURE_DS_GFXCLK_BIT 7
65 #define FEATURE_DS_SOCCLK_BIT 8
66 #define FEATURE_DS_LCLK_BIT 9
67 #define FEATURE_DS_FCLK_BIT 10
68 #define FEATURE_DS_UCLK_BIT 11
69 #define FEATURE_GFX_ULV_BIT 12
70 #define FEATURE_DPM_VCN_BIT 13
71 #define FEATURE_RSMU_SMN_CG_BIT 14
72 #define FEATURE_WAFL_CG_BIT 15
73
74 #define FEATURE_PPT_BIT 16
75 #define FEATURE_TDC_BIT 17
76 #define FEATURE_APCC_PLUS_BIT 18
77 #define FEATURE_VR0HOT_BIT 19
78 #define FEATURE_VR1HOT_BIT 20
79 #define FEATURE_FW_CTF_BIT 21
80 #define FEATURE_FAN_CONTROL_BIT 22
81 #define FEATURE_THERMAL_BIT 23
82
83 #define FEATURE_OUT_OF_BAND_MONITOR_BIT 24
84 #define FEATURE_TEMP_DEPENDENT_VMIN_BIT 25
85
86 #define FEATURE_SPARE_26_BIT 26
87 #define FEATURE_SPARE_27_BIT 27
88 #define FEATURE_SPARE_28_BIT 28
89 #define FEATURE_SPARE_29_BIT 29
90 #define FEATURE_SPARE_30_BIT 30
91 #define FEATURE_SPARE_31_BIT 31
92 #define FEATURE_SPARE_32_BIT 32
93 #define FEATURE_SPARE_33_BIT 33
94 #define FEATURE_SPARE_34_BIT 34
95 #define FEATURE_SPARE_35_BIT 35
96 #define FEATURE_SPARE_36_BIT 36
97 #define FEATURE_SPARE_37_BIT 37
98 #define FEATURE_SPARE_38_BIT 38
99 #define FEATURE_SPARE_39_BIT 39
100 #define FEATURE_SPARE_40_BIT 40
101 #define FEATURE_SPARE_41_BIT 41
102 #define FEATURE_SPARE_42_BIT 42
103 #define FEATURE_SPARE_43_BIT 43
104 #define FEATURE_SPARE_44_BIT 44
105 #define FEATURE_SPARE_45_BIT 45
106 #define FEATURE_SPARE_46_BIT 46
107 #define FEATURE_SPARE_47_BIT 47
108 #define FEATURE_SPARE_48_BIT 48
109 #define FEATURE_SPARE_49_BIT 49
110 #define FEATURE_SPARE_50_BIT 50
111 #define FEATURE_SPARE_51_BIT 51
112 #define FEATURE_SPARE_52_BIT 52
113 #define FEATURE_SPARE_53_BIT 53
114 #define FEATURE_SPARE_54_BIT 54
115 #define FEATURE_SPARE_55_BIT 55
116 #define FEATURE_SPARE_56_BIT 56
117 #define FEATURE_SPARE_57_BIT 57
118 #define FEATURE_SPARE_58_BIT 58
119 #define FEATURE_SPARE_59_BIT 59
120 #define FEATURE_SPARE_60_BIT 60
121 #define FEATURE_SPARE_61_BIT 61
122 #define FEATURE_SPARE_62_BIT 62
123 #define FEATURE_SPARE_63_BIT 63
124
125 #define NUM_FEATURES 64
126
127
128 #define FEATURE_DPM_PREFETCHER_MASK (1 << FEATURE_DPM_PREFETCHER_BIT )
129 #define FEATURE_DPM_GFXCLK_MASK (1 << FEATURE_DPM_GFXCLK_BIT )
130 #define FEATURE_DPM_UCLK_MASK (1 << FEATURE_DPM_UCLK_BIT )
131 #define FEATURE_DPM_SOCCLK_MASK (1 << FEATURE_DPM_SOCCLK_BIT )
132 #define FEATURE_DPM_FCLK_MASK (1 << FEATURE_DPM_FCLK_BIT )
133 #define FEATURE_DPM_MP0CLK_MASK (1 << FEATURE_DPM_MP0CLK_BIT )
134 #define FEATURE_DPM_XGMI_MASK (1 << FEATURE_DPM_XGMI_BIT )
135
136 #define FEATURE_DS_GFXCLK_MASK (1 << FEATURE_DS_GFXCLK_BIT )
137 #define FEATURE_DS_SOCCLK_MASK (1 << FEATURE_DS_SOCCLK_BIT )
138 #define FEATURE_DS_LCLK_MASK (1 << FEATURE_DS_LCLK_BIT )
139 #define FEATURE_DS_FCLK_MASK (1 << FEATURE_DS_FCLK_BIT )
140 #define FEATURE_DS_LCLK_MASK (1 << FEATURE_DS_LCLK_BIT )
141 #define FEATURE_GFX_ULV_MASK (1 << FEATURE_GFX_ULV_BIT )
142 #define FEATURE_VCN_PG_MASK (1 << FEATURE_VCN_PG_BIT )
143 #define FEATURE_RSMU_SMN_CG_MASK (1 << FEATURE_RSMU_SMN_CG_BIT )
144 #define FEATURE_WAFL_CG_MASK (1 << FEATURE_WAFL_CG_BIT )
145
146 #define FEATURE_PPT_MASK (1 << FEATURE_PPT_BIT )
147 #define FEATURE_TDC_MASK (1 << FEATURE_TDC_BIT )
148 #define FEATURE_APCC_MASK (1 << FEATURE_APCC_BIT )
149 #define FEATURE_VR0HOT_MASK (1 << FEATURE_VR0HOT_BIT )
150 #define FEATURE_VR1HOT_MASK (1 << FEATURE_VR1HOT_BIT )
151 #define FEATURE_FW_CTF_MASK (1 << FEATURE_FW_CTF_BIT )
152 #define FEATURE_FAN_CONTROL_MASK (1 << FEATURE_FAN_CONTROL_BIT )
153 #define FEATURE_THERMAL_MASK (1 << FEATURE_THERMAL_BIT )
154
155 #define FEATURE_OUT_OF_BAND_MONITOR_MASK (1 << EATURE_OUT_OF_BAND_MONITOR_BIT )
156 #define FEATURE_TEMP_DEPENDENT_VMIN_MASK (1 << FEATURE_TEMP_DEPENDENT_VMIN_MASK )
157
158
159
160
161 #define DPM_OVERRIDE_DISABLE_UCLK_PID 0x00000001
162 #define DPM_OVERRIDE_ENABLE_VOLT_LINK_VCN_FCLK 0x00000002
163
164
165 #define I2C_CONTROLLER_ENABLED 1
166 #define I2C_CONTROLLER_DISABLED 0
167
168
169 #define VR_MAPPING_VR_SELECT_MASK 0x01
170 #define VR_MAPPING_VR_SELECT_SHIFT 0x00
171
172 #define VR_MAPPING_PLANE_SELECT_MASK 0x02
173 #define VR_MAPPING_PLANE_SELECT_SHIFT 0x01
174
175
176 #define PSI_SEL_VR0_PLANE0_PSI0 0x01
177 #define PSI_SEL_VR0_PLANE0_PSI1 0x02
178 #define PSI_SEL_VR0_PLANE1_PSI0 0x04
179 #define PSI_SEL_VR0_PLANE1_PSI1 0x08
180 #define PSI_SEL_VR1_PLANE0_PSI0 0x10
181 #define PSI_SEL_VR1_PLANE0_PSI1 0x20
182 #define PSI_SEL_VR1_PLANE1_PSI0 0x40
183 #define PSI_SEL_VR1_PLANE1_PSI1 0x80
184
185
186 #define THROTTLER_PADDING_BIT 0
187 #define THROTTLER_TEMP_EDGE_BIT 1
188 #define THROTTLER_TEMP_HOTSPOT_BIT 2
189 #define THROTTLER_TEMP_MEM_BIT 3
190 #define THROTTLER_TEMP_VR_GFX_BIT 4
191 #define THROTTLER_TEMP_VR_MEM_BIT 5
192 #define THROTTLER_TEMP_VR_SOC_BIT 6
193 #define THROTTLER_TDC_GFX_BIT 7
194 #define THROTTLER_TDC_SOC_BIT 8
195 #define THROTTLER_PPT0_BIT 9
196 #define THROTTLER_PPT1_BIT 10
197 #define THROTTLER_PPT2_BIT 11
198 #define THROTTLER_PPT3_BIT 12
199 #define THROTTLER_PPM_BIT 13
200 #define THROTTLER_FIT_BIT 14
201 #define THROTTLER_APCC_BIT 15
202
203
204 #define TABLE_TRANSFER_OK 0x0
205 #define TABLE_TRANSFER_FAILED 0xFF
206 #define TABLE_TRANSFER_PENDING 0xAB
207
208
209 #define WORKLOAD_PPLIB_DEFAULT_BIT 0
210 #define WORKLOAD_PPLIB_POWER_SAVING_BIT 1
211 #define WORKLOAD_PPLIB_VIDEO_BIT 2
212 #define WORKLOAD_PPLIB_COMPUTE_BIT 3
213 #define WORKLOAD_PPLIB_CUSTOM_BIT 4
214 #define WORKLOAD_PPLIB_COUNT 5
215
216
217 #define XGMI_STATE_D0 1
218 #define XGMI_STATE_D3 0
219
220 #define NUM_I2C_CONTROLLERS 8
221
222 #define I2C_CONTROLLER_ENABLED 1
223 #define I2C_CONTROLLER_DISABLED 0
224
225 #define MAX_SW_I2C_COMMANDS 8
226
227 typedef enum {
228 I2C_CONTROLLER_PORT_0 = 0,
229 I2C_CONTROLLER_PORT_1 = 1,
230 I2C_CONTROLLER_PORT_COUNT,
231 } I2cControllerPort_e;
232
233 typedef enum {
234 I2C_CONTROLLER_NAME_VR_GFX = 0,
235 I2C_CONTROLLER_NAME_VR_SOC,
236 I2C_CONTROLLER_NAME_VR_MEM,
237 I2C_CONTROLLER_NAME_SPARE,
238 I2C_CONTROLLER_NAME_COUNT,
239 } I2cControllerName_e;
240
241 typedef enum {
242 I2C_CONTROLLER_THROTTLER_TYPE_NONE = 0,
243 I2C_CONTROLLER_THROTTLER_VR_GFX,
244 I2C_CONTROLLER_THROTTLER_VR_SOC,
245 I2C_CONTROLLER_THROTTLER_VR_MEM,
246 I2C_CONTROLLER_THROTTLER_COUNT,
247 } I2cControllerThrottler_e;
248
249 typedef enum {
250 I2C_CONTROLLER_PROTOCOL_VR_0,
251 I2C_CONTROLLER_PROTOCOL_VR_1,
252 I2C_CONTROLLER_PROTOCOL_TMP_0,
253 I2C_CONTROLLER_PROTOCOL_TMP_1,
254 I2C_CONTROLLER_PROTOCOL_SPARE_0,
255 I2C_CONTROLLER_PROTOCOL_SPARE_1,
256 I2C_CONTROLLER_PROTOCOL_COUNT,
257 } I2cControllerProtocol_e;
258
259 typedef struct {
260 uint8_t Enabled;
261 uint8_t Speed;
262 uint8_t Padding[2];
263 uint32_t SlaveAddress;
264 uint8_t ControllerPort;
265 uint8_t ControllerName;
266 uint8_t ThermalThrotter;
267 uint8_t I2cProtocol;
268 } I2cControllerConfig_t;
269
270 typedef enum {
271 I2C_PORT_SVD_SCL = 0,
272 I2C_PORT_GPIO,
273 } I2cPort_e;
274
275 typedef enum {
276 I2C_SPEED_FAST_50K = 0,
277 I2C_SPEED_FAST_100K,
278 I2C_SPEED_FAST_400K,
279 I2C_SPEED_FAST_PLUS_1M,
280 I2C_SPEED_HIGH_1M,
281 I2C_SPEED_HIGH_2M,
282 I2C_SPEED_COUNT,
283 } I2cSpeed_e;
284
285 typedef enum {
286 I2C_CMD_READ = 0,
287 I2C_CMD_WRITE,
288 I2C_CMD_COUNT,
289 } I2cCmdType_e;
290
291 #define CMDCONFIG_STOP_BIT 0
292 #define CMDCONFIG_RESTART_BIT 1
293
294 #define CMDCONFIG_STOP_MASK (1 << CMDCONFIG_STOP_BIT)
295 #define CMDCONFIG_RESTART_MASK (1 << CMDCONFIG_RESTART_BIT)
296
297 typedef struct {
298 uint8_t RegisterAddr;
299 uint8_t Cmd;
300 uint8_t Data;
301 uint8_t CmdConfig;
302 } SwI2cCmd_t;
303
304 typedef struct {
305 uint8_t I2CcontrollerPort;
306 uint8_t I2CSpeed;
307 uint16_t SlaveAddress;
308 uint8_t NumCmds;
309 uint8_t Padding[3];
310
311 SwI2cCmd_t SwI2cCmds[MAX_SW_I2C_COMMANDS];
312
313 uint32_t MmHubPadding[8];
314
315 } SwI2cRequest_t;
316
317
318 typedef enum {
319 BACO_SEQUENCE,
320 MSR_SEQUENCE,
321 BAMACO_SEQUENCE,
322 ULPS_SEQUENCE,
323 D3HOT_SEQUENCE_COUNT,
324 }D3HOTSequence_e;
325
326
327 typedef enum {
328 PG_DYNAMIC_MODE = 0,
329 PG_STATIC_MODE,
330 } PowerGatingMode_e;
331
332
333 typedef enum {
334 PG_POWER_DOWN = 0,
335 PG_POWER_UP,
336 } PowerGatingSettings_e;
337
338 typedef struct {
339 uint32_t a;
340 uint32_t b;
341 uint32_t c;
342 } QuadraticInt_t;
343
344 typedef struct {
345 uint32_t m;
346 uint32_t b;
347 } LinearInt_t;
348
349 typedef struct {
350 uint32_t a;
351 uint32_t b;
352 uint32_t c;
353 } DroopInt_t;
354
355 typedef enum {
356 GFXCLK_SOURCE_PLL = 0,
357 GFXCLK_SOURCE_AFLL,
358 GFXCLK_SOURCE_COUNT,
359 } GfxclkSrc_e;
360
361 typedef enum {
362 PPCLK_GFXCLK,
363 PPCLK_VCLK,
364 PPCLK_DCLK,
365 PPCLK_SOCCLK,
366 PPCLK_UCLK,
367 PPCLK_FCLK,
368 PPCLK_COUNT,
369 } PPCLK_e;
370
371 typedef enum {
372 POWER_SOURCE_AC,
373 POWER_SOURCE_DC,
374 POWER_SOURCE_COUNT,
375 } POWER_SOURCE_e;
376
377 typedef enum {
378 TEMP_EDGE,
379 TEMP_HOTSPOT,
380 TEMP_MEM,
381 TEMP_VR_GFX,
382 TEMP_VR_SOC,
383 TEMP_VR_MEM,
384 TEMP_COUNT
385 } TEMP_TYPE_e;
386
387 typedef enum {
388 PPT_THROTTLER_PPT0,
389 PPT_THROTTLER_PPT1,
390 PPT_THROTTLER_PPT2,
391 PPT_THROTTLER_PPT3,
392 PPT_THROTTLER_COUNT
393 } PPT_THROTTLER_e;
394
395 typedef enum {
396 VOLTAGE_MODE_AVFS = 0,
397 VOLTAGE_MODE_AVFS_SS,
398 VOLTAGE_MODE_SS,
399 VOLTAGE_MODE_COUNT,
400 } VOLTAGE_MODE_e;
401
402 typedef enum {
403 AVFS_VOLTAGE_GFX = 0,
404 AVFS_VOLTAGE_SOC,
405 AVFS_VOLTAGE_COUNT,
406 } AVFS_VOLTAGE_TYPE_e;
407
408 typedef enum {
409 GPIO_INT_POLARITY_ACTIVE_LOW = 0,
410 GPIO_INT_POLARITY_ACTIVE_HIGH,
411 } GpioIntPolarity_e;
412
413 typedef enum {
414 MEMORY_TYPE_GDDR6 = 0,
415 MEMORY_TYPE_HBM,
416 } MemoryType_e;
417
418 typedef enum {
419 PWR_CONFIG_TDP = 0,
420 PWR_CONFIG_TGP,
421 PWR_CONFIG_TCP_ESTIMATED,
422 PWR_CONFIG_TCP_MEASURED,
423 } PwrConfig_e;
424
425 typedef enum {
426 XGMI_LINK_RATE_12 = 0,
427 XGMI_LINK_RATE_16,
428 XGMI_LINK_RATE_22,
429 XGMI_LINK_RATE_25,
430 XGMI_LINK_RATE_COUNT
431 } XGMI_LINK_RATE_e;
432
433 typedef enum {
434 XGMI_LINK_WIDTH_2 = 0,
435 XGMI_LINK_WIDTH_4,
436 XGMI_LINK_WIDTH_8,
437 XGMI_LINK_WIDTH_16,
438 XGMI_LINK_WIDTH_COUNT
439 } XGMI_LINK_WIDTH_e;
440
441 typedef struct {
442 uint8_t VoltageMode;
443 uint8_t SnapToDiscrete;
444 uint8_t NumDiscreteLevels;
445 uint8_t padding;
446 LinearInt_t ConversionToAvfsClk;
447 QuadraticInt_t SsCurve;
448 uint16_t SsFmin;
449 uint16_t Padding16;
450 } DpmDescriptor_t;
451
452 typedef struct {
453 uint32_t Version;
454
455
456 uint32_t FeaturesToRun[2];
457
458
459 uint16_t SocketPowerLimitAc[PPT_THROTTLER_COUNT];
460 uint16_t SocketPowerLimitAcTau[PPT_THROTTLER_COUNT];
461 uint16_t TdcLimitSoc;
462 uint16_t TdcLimitSocTau;
463 uint16_t TdcLimitGfx;
464 uint16_t TdcLimitGfxTau;
465
466 uint16_t TedgeLimit;
467 uint16_t ThotspotLimit;
468 uint16_t TmemLimit;
469 uint16_t Tvr_gfxLimit;
470 uint16_t Tvr_memLimit;
471 uint16_t Tvr_socLimit;
472 uint32_t FitLimit;
473
474 uint16_t PpmPowerLimit;
475 uint16_t PpmTemperatureThreshold;
476
477
478 uint32_t ThrottlerControlMask;
479
480
481 uint16_t UlvVoltageOffsetGfx;
482 uint16_t UlvPadding;
483
484 uint8_t UlvGfxclkBypass;
485 uint8_t Padding234[3];
486
487
488 uint16_t MinVoltageGfx;
489 uint16_t MinVoltageSoc;
490 uint16_t MaxVoltageGfx;
491 uint16_t MaxVoltageSoc;
492
493 uint16_t LoadLineResistanceGfx;
494 uint16_t LoadLineResistanceSoc;
495
496
497 DpmDescriptor_t DpmDescriptor[PPCLK_COUNT];
498
499 uint16_t FreqTableGfx [NUM_GFXCLK_DPM_LEVELS ];
500 uint16_t FreqTableVclk [NUM_VCLK_DPM_LEVELS ];
501 uint16_t FreqTableDclk [NUM_DCLK_DPM_LEVELS ];
502 uint16_t FreqTableSocclk [NUM_SOCCLK_DPM_LEVELS ];
503 uint16_t FreqTableUclk [NUM_UCLK_DPM_LEVELS ];
504 uint16_t FreqTableFclk [NUM_FCLK_DPM_LEVELS ];
505
506 uint32_t Paddingclks[16];
507
508
509 uint16_t Mp0clkFreq [NUM_MP0CLK_DPM_LEVELS];
510 uint16_t Mp0DpmVoltage [NUM_MP0CLK_DPM_LEVELS];
511
512
513 uint16_t GfxclkFidle;
514 uint16_t GfxclkSlewRate;
515 uint8_t Padding567[4];
516 uint16_t GfxclkDsMaxFreq;
517 uint8_t GfxclkSource;
518 uint8_t Padding456;
519
520
521 uint16_t EnableTdpm;
522 uint16_t TdpmHighHystTemperature;
523 uint16_t TdpmLowHystTemperature;
524 uint16_t GfxclkFreqHighTempLimit;
525
526
527 uint16_t FanStopTemp;
528 uint16_t FanStartTemp;
529
530 uint16_t FanGainEdge;
531 uint16_t FanGainHotspot;
532 uint16_t FanGainVrGfx;
533 uint16_t FanGainVrSoc;
534 uint16_t FanGainVrMem;
535 uint16_t FanGainHbm;
536 uint16_t FanPwmMin;
537 uint16_t FanAcousticLimitRpm;
538 uint16_t FanThrottlingRpm;
539 uint16_t FanMaximumRpm;
540 uint16_t FanTargetTemperature;
541 uint16_t FanTargetGfxclk;
542 uint8_t FanZeroRpmEnable;
543 uint8_t FanTachEdgePerRev;
544 uint8_t FanTempInputSelect;
545 uint8_t padding8_Fan;
546
547
548 int16_t FuzzyFan_ErrorSetDelta;
549 int16_t FuzzyFan_ErrorRateSetDelta;
550 int16_t FuzzyFan_PwmSetDelta;
551 uint16_t FuzzyFan_Reserved;
552
553
554
555
556 uint8_t OverrideAvfsGb[AVFS_VOLTAGE_COUNT];
557 uint8_t Padding8_Avfs[2];
558
559 QuadraticInt_t qAvfsGb[AVFS_VOLTAGE_COUNT];
560 DroopInt_t dBtcGbGfxPll;
561 DroopInt_t dBtcGbGfxAfll;
562 DroopInt_t dBtcGbSoc;
563 LinearInt_t qAgingGb[AVFS_VOLTAGE_COUNT];
564
565 QuadraticInt_t qStaticVoltageOffset[AVFS_VOLTAGE_COUNT];
566
567 uint16_t DcTol[AVFS_VOLTAGE_COUNT];
568
569 uint8_t DcBtcEnabled[AVFS_VOLTAGE_COUNT];
570 uint8_t Padding8_GfxBtc[2];
571
572 uint16_t DcBtcMin[AVFS_VOLTAGE_COUNT];
573 uint16_t DcBtcMax[AVFS_VOLTAGE_COUNT];
574
575 uint16_t DcBtcGb[AVFS_VOLTAGE_COUNT];
576
577
578 uint8_t XgmiDpmPstates[NUM_XGMI_LEVELS];
579 uint8_t XgmiDpmSpare[2];
580
581
582 uint16_t VDDGFX_TVmin;
583 uint16_t VDDSOC_TVmin;
584 uint16_t VDDGFX_Vmin_HiTemp;
585 uint16_t VDDGFX_Vmin_LoTemp;
586 uint16_t VDDSOC_Vmin_HiTemp;
587 uint16_t VDDSOC_Vmin_LoTemp;
588
589 uint16_t VDDGFX_TVminHystersis;
590 uint16_t VDDSOC_TVminHystersis;
591
592
593
594 uint32_t DebugOverrides;
595 QuadraticInt_t ReservedEquation0;
596 QuadraticInt_t ReservedEquation1;
597 QuadraticInt_t ReservedEquation2;
598 QuadraticInt_t ReservedEquation3;
599
600 uint16_t MinVoltageUlvGfx;
601 uint16_t PaddingUlv;
602
603
604 uint8_t TotalPowerConfig;
605 uint8_t TotalPowerSpare1;
606 uint16_t TotalPowerSpare2;
607
608
609 uint16_t PccThresholdLow;
610 uint16_t PccThresholdHigh;
611 uint32_t PaddingAPCC[6];
612
613
614 uint32_t Reserved[11];
615
616
617
618
619 uint16_t MaxVoltageStepGfx;
620 uint16_t MaxVoltageStepSoc;
621
622 uint8_t VddGfxVrMapping;
623 uint8_t VddSocVrMapping;
624 uint8_t VddMemVrMapping;
625 uint8_t BoardVrMapping;
626
627 uint8_t GfxUlvPhaseSheddingMask;
628 uint8_t ExternalSensorPresent;
629 uint8_t Padding8_V[2];
630
631
632 uint16_t GfxMaxCurrent;
633 int8_t GfxOffset;
634 uint8_t Padding_TelemetryGfx;
635
636 uint16_t SocMaxCurrent;
637 int8_t SocOffset;
638 uint8_t Padding_TelemetrySoc;
639
640 uint16_t MemMaxCurrent;
641 int8_t MemOffset;
642 uint8_t Padding_TelemetryMem;
643
644 uint16_t BoardMaxCurrent;
645 int8_t BoardOffset;
646 uint8_t Padding_TelemetryBoardInput;
647
648
649 uint8_t VR0HotGpio;
650 uint8_t VR0HotPolarity;
651 uint8_t VR1HotGpio;
652 uint8_t VR1HotPolarity;
653
654
655 uint8_t PllGfxclkSpreadEnabled;
656 uint8_t PllGfxclkSpreadPercent;
657 uint16_t PllGfxclkSpreadFreq;
658
659
660 uint8_t UclkSpreadEnabled;
661 uint8_t UclkSpreadPercent;
662 uint16_t UclkSpreadFreq;
663
664
665 uint8_t FclkSpreadEnabled;
666 uint8_t FclkSpreadPercent;
667 uint16_t FclkSpreadFreq;
668
669
670 uint8_t FllGfxclkSpreadEnabled;
671 uint8_t FllGfxclkSpreadPercent;
672 uint16_t FllGfxclkSpreadFreq;
673
674
675 I2cControllerConfig_t I2cControllers[NUM_I2C_CONTROLLERS];
676
677
678 uint32_t MemoryChannelEnabled;
679
680 uint8_t DramBitWidth;
681 uint8_t PaddingMem[3];
682
683
684 uint16_t TotalBoardPower;
685 uint16_t BoardPadding;
686
687
688 uint8_t XgmiLinkSpeed [NUM_XGMI_PSTATE_LEVELS];
689 uint8_t XgmiLinkWidth [NUM_XGMI_PSTATE_LEVELS];
690
691 uint16_t XgmiFclkFreq [NUM_XGMI_PSTATE_LEVELS];
692 uint16_t XgmiSocVoltage [NUM_XGMI_PSTATE_LEVELS];
693
694
695 uint8_t GpioI2cScl;
696 uint8_t GpioI2cSda;
697 uint16_t GpioPadding;
698
699 uint32_t BoardReserved[9];
700
701
702 uint32_t MmHubPadding[8];
703
704 } PPTable_t;
705
706 typedef struct {
707
708 uint16_t GfxclkAverageLpfTau;
709 uint16_t SocclkAverageLpfTau;
710 uint16_t UclkAverageLpfTau;
711 uint16_t GfxActivityLpfTau;
712 uint16_t UclkActivityLpfTau;
713
714 uint16_t SocketPowerLpfTau;
715
716
717 uint32_t MmHubPadding[8];
718 } DriverSmuConfig_t;
719
720 typedef struct {
721 uint16_t CurrClock[PPCLK_COUNT];
722 uint16_t AverageGfxclkFrequency;
723 uint16_t AverageSocclkFrequency;
724 uint16_t AverageUclkFrequency ;
725 uint16_t AverageGfxActivity ;
726 uint16_t AverageUclkActivity ;
727 uint8_t CurrSocVoltageOffset ;
728 uint8_t CurrGfxVoltageOffset ;
729 uint8_t CurrMemVidOffset ;
730 uint8_t Padding8 ;
731 uint16_t AverageSocketPower ;
732 uint16_t TemperatureEdge ;
733 uint16_t TemperatureHotspot ;
734 uint16_t TemperatureHBM ;
735 uint16_t TemperatureVrGfx ;
736 uint16_t TemperatureVrSoc ;
737 uint16_t TemperatureVrMem ;
738 uint32_t ThrottlerStatus ;
739
740 uint16_t CurrFanSpeed ;
741 uint16_t Padding16;
742
743 uint32_t Padding[4];
744
745
746 uint32_t MmHubPadding[8];
747 } SmuMetrics_t;
748
749
750 typedef struct {
751 uint16_t avgPsmCount[75];
752 uint16_t minPsmCount[75];
753 float avgPsmVoltage[75];
754 float minPsmVoltage[75];
755
756 uint32_t MmHubPadding[8];
757 } AvfsDebugTable_t;
758
759 typedef struct {
760 uint8_t AvfsVersion;
761 uint8_t Padding;
762 uint8_t AvfsEn[AVFS_VOLTAGE_COUNT];
763
764 uint8_t OverrideVFT[AVFS_VOLTAGE_COUNT];
765 uint8_t OverrideAvfsGb[AVFS_VOLTAGE_COUNT];
766
767 uint8_t OverrideTemperatures[AVFS_VOLTAGE_COUNT];
768 uint8_t OverrideVInversion[AVFS_VOLTAGE_COUNT];
769 uint8_t OverrideP2V[AVFS_VOLTAGE_COUNT];
770 uint8_t OverrideP2VCharzFreq[AVFS_VOLTAGE_COUNT];
771
772 int32_t VFT0_m1[AVFS_VOLTAGE_COUNT];
773 int32_t VFT0_m2[AVFS_VOLTAGE_COUNT];
774 int32_t VFT0_b[AVFS_VOLTAGE_COUNT];
775
776 int32_t VFT1_m1[AVFS_VOLTAGE_COUNT];
777 int32_t VFT1_m2[AVFS_VOLTAGE_COUNT];
778 int32_t VFT1_b[AVFS_VOLTAGE_COUNT];
779
780 int32_t VFT2_m1[AVFS_VOLTAGE_COUNT];
781 int32_t VFT2_m2[AVFS_VOLTAGE_COUNT];
782 int32_t VFT2_b[AVFS_VOLTAGE_COUNT];
783
784 int32_t AvfsGb0_m1[AVFS_VOLTAGE_COUNT];
785 int32_t AvfsGb0_m2[AVFS_VOLTAGE_COUNT];
786 int32_t AvfsGb0_b[AVFS_VOLTAGE_COUNT];
787
788 int32_t AcBtcGb_m1[AVFS_VOLTAGE_COUNT];
789 int32_t AcBtcGb_m2[AVFS_VOLTAGE_COUNT];
790 int32_t AcBtcGb_b[AVFS_VOLTAGE_COUNT];
791
792 uint32_t AvfsTempCold[AVFS_VOLTAGE_COUNT];
793 uint32_t AvfsTempMid[AVFS_VOLTAGE_COUNT];
794 uint32_t AvfsTempHot[AVFS_VOLTAGE_COUNT];
795
796 uint32_t VInversion[AVFS_VOLTAGE_COUNT];
797
798
799 int32_t P2V_m1[AVFS_VOLTAGE_COUNT];
800 int32_t P2V_m2[AVFS_VOLTAGE_COUNT];
801 int32_t P2V_b[AVFS_VOLTAGE_COUNT];
802
803 uint32_t P2VCharzFreq[AVFS_VOLTAGE_COUNT];
804
805 uint32_t EnabledAvfsModules[2];
806
807 uint32_t MmHubPadding[8];
808 } AvfsFuseOverride_t;
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858 #define TABLE_PPTABLE 0
859 #define TABLE_AVFS 1
860 #define TABLE_AVFS_PSM_DEBUG 2
861 #define TABLE_AVFS_FUSE_OVERRIDE 3
862 #define TABLE_PMSTATUSLOG 4
863 #define TABLE_SMU_METRICS 5
864 #define TABLE_DRIVER_SMU_CONFIG 6
865
866 #define TABLE_OVERDRIVE 7
867 #define TABLE_WAFL_XGMI_TOPOLOGY 8
868 #define TABLE_COUNT 9
869
870
871 typedef enum {
872 DF_SWITCH_TYPE_FAST = 0,
873 DF_SWITCH_TYPE_SLOW,
874 DF_SWITCH_TYPE_COUNT,
875 } DF_SWITCH_TYPE_e;
876
877 typedef enum {
878 DRAM_BIT_WIDTH_DISABLED = 0,
879 DRAM_BIT_WIDTH_X_8,
880 DRAM_BIT_WIDTH_X_16,
881 DRAM_BIT_WIDTH_X_32,
882 DRAM_BIT_WIDTH_X_64,
883 DRAM_BIT_WIDTH_X_128,
884 DRAM_BIT_WIDTH_COUNT,
885 } DRAM_BIT_WIDTH_TYPE_e;
886
887 #define REMOVE_FMAX_MARGIN_BIT 0x0
888 #define REMOVE_DCTOL_MARGIN_BIT 0x1
889 #define REMOVE_PLATFORM_MARGIN_BIT 0x2
890
891 #endif