1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifndef __SMU11_DRIVER_IF_NAVI10_H__
24#define __SMU11_DRIVER_IF_NAVI10_H__
25
26
27
28
29
30
31
32
33#define PPTABLE_NV10_SMU_VERSION 8
34
35#define NUM_GFXCLK_DPM_LEVELS 16
36#define NUM_SMNCLK_DPM_LEVELS 2
37#define NUM_SOCCLK_DPM_LEVELS 8
38#define NUM_MP0CLK_DPM_LEVELS 2
39#define NUM_DCLK_DPM_LEVELS 8
40#define NUM_VCLK_DPM_LEVELS 8
41#define NUM_DCEFCLK_DPM_LEVELS 8
42#define NUM_PHYCLK_DPM_LEVELS 8
43#define NUM_DISPCLK_DPM_LEVELS 8
44#define NUM_PIXCLK_DPM_LEVELS 8
45#define NUM_UCLK_DPM_LEVELS 4
46#define NUM_MP1CLK_DPM_LEVELS 2
47#define NUM_LINK_LEVELS 2
48
49
50#define MAX_GFXCLK_DPM_LEVEL (NUM_GFXCLK_DPM_LEVELS - 1)
51#define MAX_SMNCLK_DPM_LEVEL (NUM_SMNCLK_DPM_LEVELS - 1)
52#define MAX_SOCCLK_DPM_LEVEL (NUM_SOCCLK_DPM_LEVELS - 1)
53#define MAX_MP0CLK_DPM_LEVEL (NUM_MP0CLK_DPM_LEVELS - 1)
54#define MAX_DCLK_DPM_LEVEL (NUM_DCLK_DPM_LEVELS - 1)
55#define MAX_VCLK_DPM_LEVEL (NUM_VCLK_DPM_LEVELS - 1)
56#define MAX_DCEFCLK_DPM_LEVEL (NUM_DCEFCLK_DPM_LEVELS - 1)
57#define MAX_DISPCLK_DPM_LEVEL (NUM_DISPCLK_DPM_LEVELS - 1)
58#define MAX_PIXCLK_DPM_LEVEL (NUM_PIXCLK_DPM_LEVELS - 1)
59#define MAX_PHYCLK_DPM_LEVEL (NUM_PHYCLK_DPM_LEVELS - 1)
60#define MAX_UCLK_DPM_LEVEL (NUM_UCLK_DPM_LEVELS - 1)
61#define MAX_MP1CLK_DPM_LEVEL (NUM_MP1CLK_DPM_LEVELS - 1)
62#define MAX_LINK_LEVEL (NUM_LINK_LEVELS - 1)
63
64
65#define PPSMC_GeminiModeNone 0
66#define PPSMC_GeminiModeMaster 1
67#define PPSMC_GeminiModeSlave 2
68
69
70
71#define FEATURE_DPM_PREFETCHER_BIT 0
72#define FEATURE_DPM_GFXCLK_BIT 1
73#define FEATURE_DPM_GFX_PACE_BIT 2
74#define FEATURE_DPM_UCLK_BIT 3
75#define FEATURE_DPM_SOCCLK_BIT 4
76#define FEATURE_DPM_MP0CLK_BIT 5
77#define FEATURE_DPM_LINK_BIT 6
78#define FEATURE_DPM_DCEFCLK_BIT 7
79#define FEATURE_MEM_VDDCI_SCALING_BIT 8
80#define FEATURE_MEM_MVDD_SCALING_BIT 9
81
82
83#define FEATURE_DS_GFXCLK_BIT 10
84#define FEATURE_DS_SOCCLK_BIT 11
85#define FEATURE_DS_LCLK_BIT 12
86#define FEATURE_DS_DCEFCLK_BIT 13
87#define FEATURE_DS_UCLK_BIT 14
88#define FEATURE_GFX_ULV_BIT 15
89#define FEATURE_FW_DSTATE_BIT 16
90#define FEATURE_GFXOFF_BIT 17
91#define FEATURE_BACO_BIT 18
92#define FEATURE_VCN_PG_BIT 19
93#define FEATURE_JPEG_PG_BIT 20
94#define FEATURE_USB_PG_BIT 21
95#define FEATURE_RSMU_SMN_CG_BIT 22
96
97#define FEATURE_PPT_BIT 23
98#define FEATURE_TDC_BIT 24
99#define FEATURE_GFX_EDC_BIT 25
100#define FEATURE_APCC_PLUS_BIT 26
101#define FEATURE_GTHR_BIT 27
102#define FEATURE_ACDC_BIT 28
103#define FEATURE_VR0HOT_BIT 29
104#define FEATURE_VR1HOT_BIT 30
105#define FEATURE_FW_CTF_BIT 31
106#define FEATURE_FAN_CONTROL_BIT 32
107#define FEATURE_THERMAL_BIT 33
108#define FEATURE_GFX_DCS_BIT 34
109
110#define FEATURE_RM_BIT 35
111#define FEATURE_LED_DISPLAY_BIT 36
112
113#define FEATURE_GFX_SS_BIT 37
114#define FEATURE_OUT_OF_BAND_MONITOR_BIT 38
115#define FEATURE_TEMP_DEPENDENT_VMIN_BIT 39
116
117#define FEATURE_MMHUB_PG_BIT 40
118#define FEATURE_ATHUB_PG_BIT 41
119#define FEATURE_APCC_DFLL_BIT 42
120#define FEATURE_SPARE_43_BIT 43
121#define FEATURE_SPARE_44_BIT 44
122#define FEATURE_SPARE_45_BIT 45
123#define FEATURE_SPARE_46_BIT 46
124#define FEATURE_SPARE_47_BIT 47
125#define FEATURE_SPARE_48_BIT 48
126#define FEATURE_SPARE_49_BIT 49
127#define FEATURE_SPARE_50_BIT 50
128#define FEATURE_SPARE_51_BIT 51
129#define FEATURE_SPARE_52_BIT 52
130#define FEATURE_SPARE_53_BIT 53
131#define FEATURE_SPARE_54_BIT 54
132#define FEATURE_SPARE_55_BIT 55
133#define FEATURE_SPARE_56_BIT 56
134#define FEATURE_SPARE_57_BIT 57
135#define FEATURE_SPARE_58_BIT 58
136#define FEATURE_SPARE_59_BIT 59
137#define FEATURE_SPARE_60_BIT 60
138#define FEATURE_SPARE_61_BIT 61
139#define FEATURE_SPARE_62_BIT 62
140#define FEATURE_SPARE_63_BIT 63
141#define NUM_FEATURES 64
142
143
144#define DPM_OVERRIDE_DISABLE_SOCCLK_PID 0x00000001
145#define DPM_OVERRIDE_DISABLE_UCLK_PID 0x00000002
146#define DPM_OVERRIDE_DISABLE_VOLT_LINK_VCN_SOCCLK 0x00000004
147#define DPM_OVERRIDE_ENABLE_FREQ_LINK_VCLK_SOCCLK 0x00000008
148#define DPM_OVERRIDE_ENABLE_FREQ_LINK_DCLK_SOCCLK 0x00000010
149#define DPM_OVERRIDE_ENABLE_FREQ_LINK_GFXCLK_SOCCLK 0x00000020
150#define DPM_OVERRIDE_ENABLE_FREQ_LINK_GFXCLK_UCLK 0x00000040
151#define DPM_OVERRIDE_DISABLE_VOLT_LINK_DCE_SOCCLK 0x00000080
152#define DPM_OVERRIDE_DISABLE_VOLT_LINK_MP0_SOCCLK 0x00000100
153#define DPM_OVERRIDE_DISABLE_DFLL_PLL_SHUTDOWN 0x00000200
154#define DPM_OVERRIDE_DISABLE_MEMORY_TEMPERATURE_READ 0x00000400
155
156
157#define VR_MAPPING_VR_SELECT_MASK 0x01
158#define VR_MAPPING_VR_SELECT_SHIFT 0x00
159
160#define VR_MAPPING_PLANE_SELECT_MASK 0x02
161#define VR_MAPPING_PLANE_SELECT_SHIFT 0x01
162
163
164#define PSI_SEL_VR0_PLANE0_PSI0 0x01
165#define PSI_SEL_VR0_PLANE0_PSI1 0x02
166#define PSI_SEL_VR0_PLANE1_PSI0 0x04
167#define PSI_SEL_VR0_PLANE1_PSI1 0x08
168#define PSI_SEL_VR1_PLANE0_PSI0 0x10
169#define PSI_SEL_VR1_PLANE0_PSI1 0x20
170#define PSI_SEL_VR1_PLANE1_PSI0 0x40
171#define PSI_SEL_VR1_PLANE1_PSI1 0x80
172
173
174#define THROTTLER_PADDING_BIT 0
175#define THROTTLER_TEMP_EDGE_BIT 1
176#define THROTTLER_TEMP_HOTSPOT_BIT 2
177#define THROTTLER_TEMP_MEM_BIT 3
178#define THROTTLER_TEMP_VR_GFX_BIT 4
179#define THROTTLER_TEMP_VR_MEM0_BIT 5
180#define THROTTLER_TEMP_VR_MEM1_BIT 6
181#define THROTTLER_TEMP_VR_SOC_BIT 7
182#define THROTTLER_TEMP_LIQUID0_BIT 8
183#define THROTTLER_TEMP_LIQUID1_BIT 9
184#define THROTTLER_TEMP_PLX_BIT 10
185#define THROTTLER_TEMP_SKIN_BIT 11
186#define THROTTLER_TDC_GFX_BIT 12
187#define THROTTLER_TDC_SOC_BIT 13
188#define THROTTLER_PPT0_BIT 14
189#define THROTTLER_PPT1_BIT 15
190#define THROTTLER_PPT2_BIT 16
191#define THROTTLER_PPT3_BIT 17
192#define THROTTLER_FIT_BIT 18
193#define THROTTLER_PPM_BIT 19
194#define THROTTLER_APCC_BIT 20
195
196
197#define FW_DSTATE_SOC_ULV_BIT 0
198#define FW_DSTATE_G6_HSR_BIT 1
199#define FW_DSTATE_G6_PHY_VDDCI_OFF_BIT 2
200#define FW_DSTATE_MP0_DS_BIT 3
201#define FW_DSTATE_SMN_DS_BIT 4
202#define FW_DSTATE_MP1_DS_BIT 5
203#define FW_DSTATE_MP1_WHISPER_MODE_BIT 6
204#define FW_DSTATE_LIV_MIN_BIT 7
205#define FW_DSTATE_SOC_PLL_PWRDN_BIT 8
206
207#define FW_DSTATE_SOC_ULV_MASK (1 << FW_DSTATE_SOC_ULV_BIT )
208#define FW_DSTATE_G6_HSR_MASK (1 << FW_DSTATE_G6_HSR_BIT )
209#define FW_DSTATE_G6_PHY_VDDCI_OFF_MASK (1 << FW_DSTATE_G6_PHY_VDDCI_OFF_BIT )
210#define FW_DSTATE_MP1_DS_MASK (1 << FW_DSTATE_MP1_DS_BIT )
211#define FW_DSTATE_MP0_DS_MASK (1 << FW_DSTATE_MP0_DS_BIT )
212#define FW_DSTATE_SMN_DS_MASK (1 << FW_DSTATE_SMN_DS_BIT )
213#define FW_DSTATE_MP1_WHISPER_MODE_MASK (1 << FW_DSTATE_MP1_WHISPER_MODE_BIT )
214#define FW_DSTATE_LIV_MIN_MASK (1 << FW_DSTATE_LIV_MIN_BIT )
215#define FW_DSTATE_SOC_PLL_PWRDN_MASK (1 << FW_DSTATE_SOC_PLL_PWRDN_BIT )
216
217
218
219#define NUM_I2C_CONTROLLERS 8
220
221#define I2C_CONTROLLER_ENABLED 1
222#define I2C_CONTROLLER_DISABLED 0
223
224#define MAX_SW_I2C_COMMANDS 8
225
226typedef enum {
227 I2C_CONTROLLER_PORT_0 = 0,
228 I2C_CONTROLLER_PORT_1 = 1,
229 I2C_CONTROLLER_PORT_COUNT,
230} I2cControllerPort_e;
231
232typedef enum {
233 I2C_CONTROLLER_NAME_VR_GFX = 0,
234 I2C_CONTROLLER_NAME_VR_SOC,
235 I2C_CONTROLLER_NAME_VR_VDDCI,
236 I2C_CONTROLLER_NAME_VR_MVDD,
237 I2C_CONTROLLER_NAME_LIQUID0,
238 I2C_CONTROLLER_NAME_LIQUID1,
239 I2C_CONTROLLER_NAME_PLX,
240 I2C_CONTROLLER_NAME_SPARE,
241 I2C_CONTROLLER_NAME_COUNT,
242} I2cControllerName_e;
243
244typedef enum {
245 I2C_CONTROLLER_THROTTLER_TYPE_NONE = 0,
246 I2C_CONTROLLER_THROTTLER_VR_GFX,
247 I2C_CONTROLLER_THROTTLER_VR_SOC,
248 I2C_CONTROLLER_THROTTLER_VR_VDDCI,
249 I2C_CONTROLLER_THROTTLER_VR_MVDD,
250 I2C_CONTROLLER_THROTTLER_LIQUID0,
251 I2C_CONTROLLER_THROTTLER_LIQUID1,
252 I2C_CONTROLLER_THROTTLER_PLX,
253 I2C_CONTROLLER_THROTTLER_COUNT,
254} I2cControllerThrottler_e;
255
256typedef enum {
257 I2C_CONTROLLER_PROTOCOL_VR_0,
258 I2C_CONTROLLER_PROTOCOL_VR_1,
259 I2C_CONTROLLER_PROTOCOL_TMP_0,
260 I2C_CONTROLLER_PROTOCOL_TMP_1,
261 I2C_CONTROLLER_PROTOCOL_SPARE_0,
262 I2C_CONTROLLER_PROTOCOL_SPARE_1,
263 I2C_CONTROLLER_PROTOCOL_COUNT,
264} I2cControllerProtocol_e;
265
266typedef struct {
267 uint8_t Enabled;
268 uint8_t Speed;
269 uint8_t Padding[2];
270 uint32_t SlaveAddress;
271 uint8_t ControllerPort;
272 uint8_t ControllerName;
273 uint8_t ThermalThrotter;
274 uint8_t I2cProtocol;
275} I2cControllerConfig_t;
276
277typedef enum {
278 I2C_PORT_SVD_SCL = 0,
279 I2C_PORT_GPIO,
280} I2cPort_e;
281
282typedef enum {
283 I2C_SPEED_FAST_50K = 0,
284 I2C_SPEED_FAST_100K,
285 I2C_SPEED_FAST_400K,
286 I2C_SPEED_FAST_PLUS_1M,
287 I2C_SPEED_HIGH_1M,
288 I2C_SPEED_HIGH_2M,
289 I2C_SPEED_COUNT,
290} I2cSpeed_e;
291
292typedef enum {
293 I2C_CMD_READ = 0,
294 I2C_CMD_WRITE,
295 I2C_CMD_COUNT,
296} I2cCmdType_e;
297
298#define CMDCONFIG_STOP_BIT 0
299#define CMDCONFIG_RESTART_BIT 1
300
301#define CMDCONFIG_STOP_MASK (1 << CMDCONFIG_STOP_BIT)
302#define CMDCONFIG_RESTART_MASK (1 << CMDCONFIG_RESTART_BIT)
303
304typedef struct {
305 uint8_t RegisterAddr;
306 uint8_t Cmd;
307 uint8_t Data;
308 uint8_t CmdConfig;
309} SwI2cCmd_t;
310
311typedef struct {
312 uint8_t I2CcontrollerPort;
313 uint8_t I2CSpeed;
314 uint16_t SlaveAddress;
315 uint8_t NumCmds;
316 uint8_t Padding[3];
317
318 SwI2cCmd_t SwI2cCmds[MAX_SW_I2C_COMMANDS];
319
320 uint32_t MmHubPadding[8];
321
322} SwI2cRequest_t;
323
324
325typedef enum {
326 BACO_SEQUENCE,
327 MSR_SEQUENCE,
328 BAMACO_SEQUENCE,
329 ULPS_SEQUENCE,
330 D3HOT_SEQUENCE_COUNT,
331}D3HOTSequence_e;
332
333
334typedef enum {
335 PG_DYNAMIC_MODE = 0,
336 PG_STATIC_MODE,
337} PowerGatingMode_e;
338
339
340typedef enum {
341 PG_POWER_DOWN = 0,
342 PG_POWER_UP,
343} PowerGatingSettings_e;
344
345typedef struct {
346 uint32_t a;
347 uint32_t b;
348 uint32_t c;
349} QuadraticInt_t;
350
351typedef struct {
352 uint32_t m;
353 uint32_t b;
354} LinearInt_t;
355
356typedef struct {
357 uint32_t a;
358 uint32_t b;
359 uint32_t c;
360} DroopInt_t;
361
362typedef enum {
363 GFXCLK_SOURCE_PLL = 0,
364 GFXCLK_SOURCE_DFLL,
365 GFXCLK_SOURCE_COUNT,
366} GfxclkSrc_e;
367
368
369typedef enum {
370 PPCLK_GFXCLK = 0,
371 PPCLK_SOCCLK,
372 PPCLK_UCLK,
373 PPCLK_DCLK,
374 PPCLK_VCLK,
375 PPCLK_DCEFCLK,
376 PPCLK_DISPCLK,
377 PPCLK_PIXCLK,
378 PPCLK_PHYCLK,
379 PPCLK_COUNT,
380} PPCLK_e;
381
382typedef enum {
383 POWER_SOURCE_AC,
384 POWER_SOURCE_DC,
385 POWER_SOURCE_COUNT,
386} POWER_SOURCE_e;
387
388typedef enum {
389 PPT_THROTTLER_PPT0,
390 PPT_THROTTLER_PPT1,
391 PPT_THROTTLER_PPT2,
392 PPT_THROTTLER_PPT3,
393 PPT_THROTTLER_COUNT
394} PPT_THROTTLER_e;
395
396typedef enum {
397 VOLTAGE_MODE_AVFS = 0,
398 VOLTAGE_MODE_AVFS_SS,
399 VOLTAGE_MODE_SS,
400 VOLTAGE_MODE_COUNT,
401} VOLTAGE_MODE_e;
402
403
404typedef enum {
405 AVFS_VOLTAGE_GFX = 0,
406 AVFS_VOLTAGE_SOC,
407 AVFS_VOLTAGE_COUNT,
408} AVFS_VOLTAGE_TYPE_e;
409
410typedef enum {
411 UCLK_DIV_BY_1 = 0,
412 UCLK_DIV_BY_2,
413 UCLK_DIV_BY_4,
414 UCLK_DIV_BY_8,
415} UCLK_DIV_e;
416
417typedef enum {
418 GPIO_INT_POLARITY_ACTIVE_LOW = 0,
419 GPIO_INT_POLARITY_ACTIVE_HIGH,
420} GpioIntPolarity_e;
421
422typedef enum {
423 MEMORY_TYPE_GDDR6 = 0,
424 MEMORY_TYPE_HBM,
425} MemoryType_e;
426
427typedef enum {
428 PWR_CONFIG_TDP = 0,
429 PWR_CONFIG_TGP,
430 PWR_CONFIG_TCP_ESTIMATED,
431 PWR_CONFIG_TCP_MEASURED,
432} PwrConfig_e;
433
434typedef struct {
435 uint8_t VoltageMode;
436 uint8_t SnapToDiscrete;
437 uint8_t NumDiscreteLevels;
438 uint8_t Padding;
439 LinearInt_t ConversionToAvfsClk;
440 QuadraticInt_t SsCurve;
441} DpmDescriptor_t;
442
443typedef enum {
444 TEMP_EDGE,
445 TEMP_HOTSPOT,
446 TEMP_MEM,
447 TEMP_VR_GFX,
448 TEMP_VR_MEM0,
449 TEMP_VR_MEM1,
450 TEMP_VR_SOC,
451 TEMP_LIQUID0,
452 TEMP_LIQUID1,
453 TEMP_PLX,
454 TEMP_COUNT
455} TEMP_e;
456
457
458
459#define POWER_MANAGER_CONTROLLER_NOT_RUNNING 0
460#define POWER_MANAGER_CONTROLLER_RUNNING 1
461
462#define POWER_MANAGER_CONTROLLER_BIT 0
463#define MAXIMUM_DPM_STATE_GFX_ENGINE_RESTRICTED_BIT 8
464#define GPU_DIE_TEMPERATURE_THROTTLING_BIT 9
465#define HBM_DIE_TEMPERATURE_THROTTLING_BIT 10
466#define TGP_THROTTLING_BIT 11
467#define PCC_THROTTLING_BIT 12
468#define HBM_TEMPERATURE_EXCEEDING_TEMPERATURE_LIMIT_BIT 13
469#define HBM_TEMPERATURE_EXCEEDING_MAX_MEMORY_TEMPERATURE_BIT 14
470
471#define POWER_MANAGER_CONTROLLER_MASK (1 << POWER_MANAGER_CONTROLLER_BIT )
472#define MAXIMUM_DPM_STATE_GFX_ENGINE_RESTRICTED_MASK (1 << MAXIMUM_DPM_STATE_GFX_ENGINE_RESTRICTED_BIT )
473#define GPU_DIE_TEMPERATURE_THROTTLING_MASK (1 << GPU_DIE_TEMPERATURE_THROTTLING_BIT )
474#define HBM_DIE_TEMPERATURE_THROTTLING_MASK (1 << HBM_DIE_TEMPERATURE_THROTTLING_BIT )
475#define TGP_THROTTLING_MASK (1 << TGP_THROTTLING_BIT )
476#define PCC_THROTTLING_MASK (1 << PCC_THROTTLING_BIT )
477#define HBM_TEMPERATURE_EXCEEDING_TEMPERATURE_LIMIT_MASK (1 << HBM_TEMPERATURE_EXCEEDING_TEMPERATURE_LIMIT_BIT )
478#define HBM_TEMPERATURE_EXCEEDING_MAX_MEMORY_TEMPERATURE_MASK (1 << HBM_TEMPERATURE_EXCEEDING_MAX_MEMORY_TEMPERATURE_BIT)
479
480
481typedef struct {
482 uint8_t MinorInfoVersion;
483 uint8_t MajorInfoVersion;
484 uint8_t TableSize;
485 uint8_t Reserved;
486
487 uint8_t Reserved1;
488 uint8_t RevID;
489 uint16_t DeviceID;
490
491 uint16_t DieTemperatureLimit;
492 uint16_t FanTargetTemperature;
493
494 uint16_t MemoryTemperatureLimit;
495 uint16_t MemoryTemperatureLimit1;
496
497 uint16_t TGP;
498 uint16_t CardPower;
499
500 uint32_t DieTemperatureRegisterOffset;
501
502 uint32_t Reserved2;
503
504 uint32_t Reserved3;
505
506 uint32_t Status;
507
508 uint16_t DieTemperature;
509 uint16_t CurrentMemoryTemperature;
510
511 uint16_t MemoryTemperature;
512 uint8_t MemoryHotspotPosition;
513 uint8_t Reserved4;
514
515 uint32_t BoardLevelEnergyAccumulator;
516} OutOfBandMonitor_t;
517
518typedef struct {
519 uint32_t Version;
520
521
522 uint32_t FeaturesToRun[2];
523
524
525 uint16_t SocketPowerLimitAc[PPT_THROTTLER_COUNT];
526 uint16_t SocketPowerLimitAcTau[PPT_THROTTLER_COUNT];
527 uint16_t SocketPowerLimitDc[PPT_THROTTLER_COUNT];
528 uint16_t SocketPowerLimitDcTau[PPT_THROTTLER_COUNT];
529
530 uint16_t TdcLimitSoc;
531 uint16_t TdcLimitSocTau;
532 uint16_t TdcLimitGfx;
533 uint16_t TdcLimitGfxTau;
534
535 uint16_t TedgeLimit;
536 uint16_t ThotspotLimit;
537 uint16_t TmemLimit;
538 uint16_t Tvr_gfxLimit;
539 uint16_t Tvr_mem0Limit;
540 uint16_t Tvr_mem1Limit;
541 uint16_t Tvr_socLimit;
542 uint16_t Tliquid0Limit;
543 uint16_t Tliquid1Limit;
544 uint16_t TplxLimit;
545 uint32_t FitLimit;
546
547 uint16_t PpmPowerLimit;
548 uint16_t PpmTemperatureThreshold;
549
550
551 uint32_t ThrottlerControlMask;
552
553
554 uint32_t FwDStateMask;
555
556
557 uint16_t UlvVoltageOffsetSoc;
558 uint16_t UlvVoltageOffsetGfx;
559
560 uint8_t GceaLinkMgrIdleThreshold;
561 uint8_t paddingRlcUlvParams[3];
562
563 uint8_t UlvSmnclkDid;
564 uint8_t UlvMp1clkDid;
565 uint8_t UlvGfxclkBypass;
566 uint8_t Padding234;
567
568 uint16_t MinVoltageUlvGfx;
569 uint16_t MinVoltageUlvSoc;
570
571
572
573 uint16_t MinVoltageGfx;
574 uint16_t MinVoltageSoc;
575 uint16_t MaxVoltageGfx;
576 uint16_t MaxVoltageSoc;
577
578 uint16_t LoadLineResistanceGfx;
579 uint16_t LoadLineResistanceSoc;
580
581
582 DpmDescriptor_t DpmDescriptor[PPCLK_COUNT];
583
584 uint16_t FreqTableGfx [NUM_GFXCLK_DPM_LEVELS ];
585 uint16_t FreqTableVclk [NUM_VCLK_DPM_LEVELS ];
586 uint16_t FreqTableDclk [NUM_DCLK_DPM_LEVELS ];
587 uint16_t FreqTableSocclk [NUM_SOCCLK_DPM_LEVELS ];
588 uint16_t FreqTableUclk [NUM_UCLK_DPM_LEVELS ];
589 uint16_t FreqTableDcefclk [NUM_DCEFCLK_DPM_LEVELS ];
590 uint16_t FreqTableDispclk [NUM_DISPCLK_DPM_LEVELS ];
591 uint16_t FreqTablePixclk [NUM_PIXCLK_DPM_LEVELS ];
592 uint16_t FreqTablePhyclk [NUM_PHYCLK_DPM_LEVELS ];
593 uint32_t Paddingclks[16];
594
595 uint16_t DcModeMaxFreq [PPCLK_COUNT ];
596 uint16_t Padding8_Clks;
597
598 uint8_t FreqTableUclkDiv [NUM_UCLK_DPM_LEVELS ];
599
600
601 uint16_t Mp0clkFreq [NUM_MP0CLK_DPM_LEVELS];
602 uint16_t Mp0DpmVoltage [NUM_MP0CLK_DPM_LEVELS];
603 uint16_t MemVddciVoltage [NUM_UCLK_DPM_LEVELS];
604 uint16_t MemMvddVoltage [NUM_UCLK_DPM_LEVELS];
605
606 uint16_t GfxclkFgfxoffEntry;
607 uint16_t GfxclkFinit;
608 uint16_t GfxclkFidle;
609 uint16_t GfxclkSlewRate;
610 uint16_t GfxclkFopt;
611 uint8_t Padding567[2];
612 uint16_t GfxclkDsMaxFreq;
613 uint8_t GfxclkSource;
614 uint8_t Padding456;
615
616
617 uint8_t LowestUclkReservedForUlv;
618 uint8_t paddingUclk[3];
619
620 uint8_t MemoryType;
621 uint8_t MemoryChannels;
622 uint8_t PaddingMem[2];
623
624
625 uint8_t PcieGenSpeed[NUM_LINK_LEVELS];
626 uint8_t PcieLaneCount[NUM_LINK_LEVELS];
627 uint16_t LclkFreq[NUM_LINK_LEVELS];
628
629
630 uint16_t EnableTdpm;
631 uint16_t TdpmHighHystTemperature;
632 uint16_t TdpmLowHystTemperature;
633 uint16_t GfxclkFreqHighTempLimit;
634
635
636 uint16_t FanStopTemp;
637 uint16_t FanStartTemp;
638
639 uint16_t FanGainEdge;
640 uint16_t FanGainHotspot;
641 uint16_t FanGainLiquid0;
642 uint16_t FanGainLiquid1;
643 uint16_t FanGainVrGfx;
644 uint16_t FanGainVrSoc;
645 uint16_t FanGainVrMem0;
646 uint16_t FanGainVrMem1;
647 uint16_t FanGainPlx;
648 uint16_t FanGainMem;
649 uint16_t FanPwmMin;
650 uint16_t FanAcousticLimitRpm;
651 uint16_t FanThrottlingRpm;
652 uint16_t FanMaximumRpm;
653 uint16_t FanTargetTemperature;
654 uint16_t FanTargetGfxclk;
655 uint8_t FanTempInputSelect;
656 uint8_t FanPadding;
657 uint8_t FanZeroRpmEnable;
658 uint8_t FanTachEdgePerRev;
659
660
661
662 int16_t FuzzyFan_ErrorSetDelta;
663 int16_t FuzzyFan_ErrorRateSetDelta;
664 int16_t FuzzyFan_PwmSetDelta;
665 uint16_t FuzzyFan_Reserved;
666
667
668
669
670 uint8_t OverrideAvfsGb[AVFS_VOLTAGE_COUNT];
671 uint8_t Padding8_Avfs[2];
672
673 QuadraticInt_t qAvfsGb[AVFS_VOLTAGE_COUNT];
674 DroopInt_t dBtcGbGfxPll;
675 DroopInt_t dBtcGbGfxDfll;
676 DroopInt_t dBtcGbSoc;
677 LinearInt_t qAgingGb[AVFS_VOLTAGE_COUNT];
678
679 QuadraticInt_t qStaticVoltageOffset[AVFS_VOLTAGE_COUNT];
680
681 uint16_t DcTol[AVFS_VOLTAGE_COUNT];
682
683 uint8_t DcBtcEnabled[AVFS_VOLTAGE_COUNT];
684 uint8_t Padding8_GfxBtc[2];
685
686 uint16_t DcBtcMin[AVFS_VOLTAGE_COUNT];
687 uint16_t DcBtcMax[AVFS_VOLTAGE_COUNT];
688
689
690 uint32_t DebugOverrides;
691 QuadraticInt_t ReservedEquation0;
692 QuadraticInt_t ReservedEquation1;
693 QuadraticInt_t ReservedEquation2;
694 QuadraticInt_t ReservedEquation3;
695
696
697 uint8_t TotalPowerConfig;
698 uint8_t TotalPowerSpare1;
699 uint16_t TotalPowerSpare2;
700
701
702 uint16_t PccThresholdLow;
703 uint16_t PccThresholdHigh;
704 uint32_t MGpuFanBoostLimitRpm;
705 uint32_t PaddingAPCC[5];
706
707
708 uint16_t VDDGFX_TVmin;
709 uint16_t VDDSOC_TVmin;
710 uint16_t VDDGFX_Vmin_HiTemp;
711 uint16_t VDDGFX_Vmin_LoTemp;
712 uint16_t VDDSOC_Vmin_HiTemp;
713 uint16_t VDDSOC_Vmin_LoTemp;
714
715 uint16_t VDDGFX_TVminHystersis;
716 uint16_t VDDSOC_TVminHystersis;
717
718
719 uint32_t BtcConfig;
720
721 uint16_t SsFmin[10];
722 uint16_t DcBtcGb[AVFS_VOLTAGE_COUNT];
723
724
725 uint32_t Reserved[8];
726
727
728
729 I2cControllerConfig_t I2cControllers[NUM_I2C_CONTROLLERS];
730
731
732 uint16_t MaxVoltageStepGfx;
733 uint16_t MaxVoltageStepSoc;
734
735 uint8_t VddGfxVrMapping;
736 uint8_t VddSocVrMapping;
737 uint8_t VddMem0VrMapping;
738 uint8_t VddMem1VrMapping;
739
740 uint8_t GfxUlvPhaseSheddingMask;
741 uint8_t SocUlvPhaseSheddingMask;
742 uint8_t ExternalSensorPresent;
743 uint8_t Padding8_V;
744
745
746 uint16_t GfxMaxCurrent;
747 int8_t GfxOffset;
748 uint8_t Padding_TelemetryGfx;
749
750 uint16_t SocMaxCurrent;
751 int8_t SocOffset;
752 uint8_t Padding_TelemetrySoc;
753
754 uint16_t Mem0MaxCurrent;
755 int8_t Mem0Offset;
756 uint8_t Padding_TelemetryMem0;
757
758 uint16_t Mem1MaxCurrent;
759 int8_t Mem1Offset;
760 uint8_t Padding_TelemetryMem1;
761
762
763 uint8_t AcDcGpio;
764 uint8_t AcDcPolarity;
765 uint8_t VR0HotGpio;
766 uint8_t VR0HotPolarity;
767
768 uint8_t VR1HotGpio;
769 uint8_t VR1HotPolarity;
770 uint8_t GthrGpio;
771 uint8_t GthrPolarity;
772
773
774 uint8_t LedPin0;
775 uint8_t LedPin1;
776 uint8_t LedPin2;
777 uint8_t padding8_4;
778
779
780 uint8_t PllGfxclkSpreadEnabled;
781 uint8_t PllGfxclkSpreadPercent;
782 uint16_t PllGfxclkSpreadFreq;
783
784
785 uint8_t DfllGfxclkSpreadEnabled;
786 uint8_t DfllGfxclkSpreadPercent;
787 uint16_t DfllGfxclkSpreadFreq;
788
789
790 uint8_t UclkSpreadEnabled;
791 uint8_t UclkSpreadPercent;
792 uint16_t UclkSpreadFreq;
793
794
795 uint8_t SoclkSpreadEnabled;
796 uint8_t SocclkSpreadPercent;
797 uint16_t SocclkSpreadFreq;
798
799
800 uint16_t TotalBoardPower;
801 uint16_t BoardPadding;
802
803
804 uint32_t MvddRatio;
805
806 uint8_t RenesesLoadLineEnabled;
807 uint8_t GfxLoadlineResistance;
808 uint8_t SocLoadlineResistance;
809 uint8_t Padding8_Loadline;
810
811 uint32_t BoardReserved[8];
812
813
814 uint32_t MmHubPadding[8];
815
816} PPTable_t;
817
818typedef struct {
819
820 uint16_t GfxclkAverageLpfTau;
821 uint16_t SocclkAverageLpfTau;
822 uint16_t UclkAverageLpfTau;
823 uint16_t GfxActivityLpfTau;
824 uint16_t UclkActivityLpfTau;
825 uint16_t SocketPowerLpfTau;
826
827
828 uint32_t MmHubPadding[8];
829} DriverSmuConfig_t;
830
831typedef struct {
832
833 uint16_t GfxclkFmin;
834 uint16_t GfxclkFmax;
835 uint16_t GfxclkFreq1;
836 uint16_t GfxclkVolt1;
837 uint16_t GfxclkFreq2;
838 uint16_t GfxclkVolt2;
839 uint16_t GfxclkFreq3;
840 uint16_t GfxclkVolt3;
841 uint16_t UclkFmax;
842 int16_t OverDrivePct;
843 uint16_t FanMaximumRpm;
844 uint16_t FanMinimumPwm;
845 uint16_t FanTargetTemperature;
846 uint16_t MaxOpTemp;
847 uint16_t FanZeroRpmEnable;
848 uint16_t Padding;
849
850 uint32_t MmHubPadding[8];
851
852} OverDriveTable_t;
853
854typedef struct {
855 uint16_t CurrClock[PPCLK_COUNT];
856 uint16_t AverageGfxclkFrequency;
857 uint16_t AverageSocclkFrequency;
858 uint16_t AverageUclkFrequency ;
859 uint16_t AverageGfxActivity ;
860 uint16_t AverageUclkActivity ;
861 uint8_t CurrSocVoltageOffset ;
862 uint8_t CurrGfxVoltageOffset ;
863 uint8_t CurrMemVidOffset ;
864 uint8_t Padding8 ;
865 uint16_t AverageSocketPower ;
866 uint16_t TemperatureEdge ;
867 uint16_t TemperatureHotspot ;
868 uint16_t TemperatureMem ;
869 uint16_t TemperatureVrGfx ;
870 uint16_t TemperatureVrMem0 ;
871 uint16_t TemperatureVrMem1 ;
872 uint16_t TemperatureVrSoc ;
873 uint16_t TemperatureLiquid0 ;
874 uint16_t TemperatureLiquid1 ;
875 uint16_t TemperaturePlx ;
876 uint16_t Padding16 ;
877 uint32_t ThrottlerStatus ;
878
879 uint8_t LinkDpmLevel;
880 uint8_t Padding8_2;
881 uint16_t CurrFanSpeed;
882
883
884 uint32_t MmHubPadding[8];
885} SmuMetrics_t;
886
887typedef struct {
888 uint16_t CurrClock[PPCLK_COUNT];
889 uint16_t AverageGfxclkFrequency;
890 uint16_t AverageSocclkFrequency;
891 uint16_t AverageUclkFrequency ;
892 uint16_t AverageGfxActivity ;
893 uint16_t AverageUclkActivity ;
894 uint8_t CurrSocVoltageOffset ;
895 uint8_t CurrGfxVoltageOffset ;
896 uint8_t CurrMemVidOffset ;
897 uint8_t Padding8 ;
898 uint16_t AverageSocketPower ;
899 uint16_t TemperatureEdge ;
900 uint16_t TemperatureHotspot ;
901 uint16_t TemperatureMem ;
902 uint16_t TemperatureVrGfx ;
903 uint16_t TemperatureVrMem0 ;
904 uint16_t TemperatureVrMem1 ;
905 uint16_t TemperatureVrSoc ;
906 uint16_t TemperatureLiquid0 ;
907 uint16_t TemperatureLiquid1 ;
908 uint16_t TemperaturePlx ;
909 uint16_t Padding16 ;
910 uint32_t ThrottlerStatus ;
911
912 uint8_t LinkDpmLevel;
913 uint8_t Padding8_2;
914 uint16_t CurrFanSpeed;
915
916 uint32_t EnergyAccumulator;
917 uint16_t AverageVclkFrequency ;
918 uint16_t AverageDclkFrequency ;
919 uint16_t VcnActivityPercentage ;
920 uint16_t padding16_2;
921
922
923 uint32_t MmHubPadding[8];
924} SmuMetrics_NV12_t;
925
926typedef struct {
927 uint16_t MinClock;
928 uint16_t MaxClock;
929 uint16_t MinUclk;
930 uint16_t MaxUclk;
931
932 uint8_t WmSetting;
933 uint8_t Padding[3];
934
935 uint32_t MmHubPadding[8];
936} WatermarkRowGeneric_t;
937
938#define NUM_WM_RANGES 4
939
940typedef enum {
941 WM_SOCCLK = 0,
942 WM_DCEFCLK,
943 WM_COUNT,
944} WM_CLOCK_e;
945
946typedef struct {
947
948 WatermarkRowGeneric_t WatermarkRow[WM_COUNT][NUM_WM_RANGES];
949
950 uint32_t MmHubPadding[8];
951} Watermarks_t;
952
953typedef struct {
954 uint16_t avgPsmCount[28];
955 uint16_t minPsmCount[28];
956 float avgPsmVoltage[28];
957 float minPsmVoltage[28];
958
959 uint32_t MmHubPadding[32];
960} AvfsDebugTable_t_NV14;
961
962typedef struct {
963 uint16_t avgPsmCount[36];
964 uint16_t minPsmCount[36];
965 float avgPsmVoltage[36];
966 float minPsmVoltage[36];
967
968 uint32_t MmHubPadding[8];
969} AvfsDebugTable_t_NV10;
970
971typedef struct {
972 uint8_t AvfsVersion;
973 uint8_t Padding;
974
975 uint8_t AvfsEn[AVFS_VOLTAGE_COUNT];
976
977 uint8_t OverrideVFT[AVFS_VOLTAGE_COUNT];
978 uint8_t OverrideAvfsGb[AVFS_VOLTAGE_COUNT];
979
980 uint8_t OverrideTemperatures[AVFS_VOLTAGE_COUNT];
981 uint8_t OverrideVInversion[AVFS_VOLTAGE_COUNT];
982 uint8_t OverrideP2V[AVFS_VOLTAGE_COUNT];
983 uint8_t OverrideP2VCharzFreq[AVFS_VOLTAGE_COUNT];
984
985 int32_t VFT0_m1[AVFS_VOLTAGE_COUNT];
986 int32_t VFT0_m2[AVFS_VOLTAGE_COUNT];
987 int32_t VFT0_b[AVFS_VOLTAGE_COUNT];
988
989 int32_t VFT1_m1[AVFS_VOLTAGE_COUNT];
990 int32_t VFT1_m2[AVFS_VOLTAGE_COUNT];
991 int32_t VFT1_b[AVFS_VOLTAGE_COUNT];
992
993 int32_t VFT2_m1[AVFS_VOLTAGE_COUNT];
994 int32_t VFT2_m2[AVFS_VOLTAGE_COUNT];
995 int32_t VFT2_b[AVFS_VOLTAGE_COUNT];
996
997 int32_t AvfsGb0_m1[AVFS_VOLTAGE_COUNT];
998 int32_t AvfsGb0_m2[AVFS_VOLTAGE_COUNT];
999 int32_t AvfsGb0_b[AVFS_VOLTAGE_COUNT];
1000
1001 int32_t AcBtcGb_m1[AVFS_VOLTAGE_COUNT];
1002 int32_t AcBtcGb_m2[AVFS_VOLTAGE_COUNT];
1003 int32_t AcBtcGb_b[AVFS_VOLTAGE_COUNT];
1004
1005 uint32_t AvfsTempCold[AVFS_VOLTAGE_COUNT];
1006 uint32_t AvfsTempMid[AVFS_VOLTAGE_COUNT];
1007 uint32_t AvfsTempHot[AVFS_VOLTAGE_COUNT];
1008
1009 uint32_t VInversion[AVFS_VOLTAGE_COUNT];
1010
1011
1012 int32_t P2V_m1[AVFS_VOLTAGE_COUNT];
1013 int32_t P2V_m2[AVFS_VOLTAGE_COUNT];
1014 int32_t P2V_b[AVFS_VOLTAGE_COUNT];
1015
1016 uint32_t P2VCharzFreq[AVFS_VOLTAGE_COUNT];
1017
1018 uint32_t EnabledAvfsModules[2];
1019
1020 uint32_t MmHubPadding[8];
1021} AvfsFuseOverride_t;
1022
1023typedef struct {
1024
1025 uint8_t Gfx_ActiveHystLimit;
1026 uint8_t Gfx_IdleHystLimit;
1027 uint8_t Gfx_FPS;
1028 uint8_t Gfx_MinActiveFreqType;
1029 uint8_t Gfx_BoosterFreqType;
1030 uint8_t Gfx_MinFreqStep;
1031 uint16_t Gfx_MinActiveFreq;
1032 uint16_t Gfx_BoosterFreq;
1033 uint16_t Gfx_PD_Data_time_constant;
1034 uint32_t Gfx_PD_Data_limit_a;
1035 uint32_t Gfx_PD_Data_limit_b;
1036 uint32_t Gfx_PD_Data_limit_c;
1037 uint32_t Gfx_PD_Data_error_coeff;
1038 uint32_t Gfx_PD_Data_error_rate_coeff;
1039
1040 uint8_t Soc_ActiveHystLimit;
1041 uint8_t Soc_IdleHystLimit;
1042 uint8_t Soc_FPS;
1043 uint8_t Soc_MinActiveFreqType;
1044 uint8_t Soc_BoosterFreqType;
1045 uint8_t Soc_MinFreqStep;
1046 uint16_t Soc_MinActiveFreq;
1047 uint16_t Soc_BoosterFreq;
1048 uint16_t Soc_PD_Data_time_constant;
1049 uint32_t Soc_PD_Data_limit_a;
1050 uint32_t Soc_PD_Data_limit_b;
1051 uint32_t Soc_PD_Data_limit_c;
1052 uint32_t Soc_PD_Data_error_coeff;
1053 uint32_t Soc_PD_Data_error_rate_coeff;
1054
1055 uint8_t Mem_ActiveHystLimit;
1056 uint8_t Mem_IdleHystLimit;
1057 uint8_t Mem_FPS;
1058 uint8_t Mem_MinActiveFreqType;
1059 uint8_t Mem_BoosterFreqType;
1060 uint8_t Mem_MinFreqStep;
1061 uint16_t Mem_MinActiveFreq;
1062 uint16_t Mem_BoosterFreq;
1063 uint16_t Mem_PD_Data_time_constant;
1064 uint32_t Mem_PD_Data_limit_a;
1065 uint32_t Mem_PD_Data_limit_b;
1066 uint32_t Mem_PD_Data_limit_c;
1067 uint32_t Mem_PD_Data_error_coeff;
1068 uint32_t Mem_PD_Data_error_rate_coeff;
1069
1070 uint32_t Mem_UpThreshold_Limit;
1071 uint8_t Mem_UpHystLimit;
1072 uint8_t Mem_DownHystLimit;
1073 uint16_t Mem_Fps;
1074
1075 uint32_t MmHubPadding[8];
1076
1077} DpmActivityMonitorCoeffInt_t;
1078
1079
1080
1081#define WORKLOAD_PPLIB_DEFAULT_BIT 0
1082#define WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT 1
1083#define WORKLOAD_PPLIB_POWER_SAVING_BIT 2
1084#define WORKLOAD_PPLIB_VIDEO_BIT 3
1085#define WORKLOAD_PPLIB_VR_BIT 4
1086#define WORKLOAD_PPLIB_COMPUTE_BIT 5
1087#define WORKLOAD_PPLIB_CUSTOM_BIT 6
1088#define WORKLOAD_PPLIB_COUNT 7
1089
1090
1091
1092
1093
1094
1095
1096#define TABLE_TRANSFER_OK 0x0
1097#define TABLE_TRANSFER_FAILED 0xFF
1098
1099
1100#define TABLE_PPTABLE 0
1101#define TABLE_WATERMARKS 1
1102#define TABLE_AVFS 2
1103#define TABLE_AVFS_PSM_DEBUG 3
1104#define TABLE_AVFS_FUSE_OVERRIDE 4
1105#define TABLE_PMSTATUSLOG 5
1106#define TABLE_SMU_METRICS 6
1107#define TABLE_DRIVER_SMU_CONFIG 7
1108#define TABLE_ACTIVITY_MONITOR_COEFF 8
1109#define TABLE_OVERDRIVE 9
1110#define TABLE_I2C_COMMANDS 10
1111#define TABLE_PACE 11
1112#define TABLE_COUNT 12
1113
1114
1115#define RLC_PACE_TABLE_NUM_LEVELS 16
1116
1117typedef struct {
1118 float FlopsPerByteTable[RLC_PACE_TABLE_NUM_LEVELS];
1119
1120 uint32_t MmHubPadding[8];
1121} RlcPaceFlopsPerByteOverride_t;
1122
1123
1124#define UCLK_SWITCH_SLOW 0
1125#define UCLK_SWITCH_FAST 1
1126#endif
1127