diff options
author | Eric Huang <JinHuiEric.Huang@amd.com> | 2017-03-06 12:34:32 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:54:52 -0400 |
commit | e29922795f0987b0ebd109a604e77d3474b50ba6 (patch) | |
tree | 1e478374129832b3bcf4d783392892cc1bbd5542 /drivers | |
parent | 2a5071056e6a601efafe628a2f8162e16397ee2d (diff) |
drm/amd/powerplay: add some new structures for Vega10
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr_ppt.h | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | 32 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 112 |
3 files changed, 155 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr_ppt.h b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr_ppt.h index 2930a3355948..c0193e09d58a 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr_ppt.h +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr_ppt.h | |||
@@ -30,15 +30,17 @@ | |||
30 | 30 | ||
31 | struct phm_ppt_v1_clock_voltage_dependency_record { | 31 | struct phm_ppt_v1_clock_voltage_dependency_record { |
32 | uint32_t clk; | 32 | uint32_t clk; |
33 | uint8_t vddInd; | 33 | uint8_t vddInd; |
34 | uint8_t vddciInd; | ||
35 | uint8_t mvddInd; | ||
34 | uint16_t vdd_offset; | 36 | uint16_t vdd_offset; |
35 | uint16_t vddc; | 37 | uint16_t vddc; |
36 | uint16_t vddgfx; | 38 | uint16_t vddgfx; |
37 | uint16_t vddci; | 39 | uint16_t vddci; |
38 | uint16_t mvdd; | 40 | uint16_t mvdd; |
39 | uint8_t phases; | 41 | uint8_t phases; |
40 | uint8_t cks_enable; | 42 | uint8_t cks_enable; |
41 | uint8_t cks_voffset; | 43 | uint8_t cks_voffset; |
42 | uint32_t sclk_offset; | 44 | uint32_t sclk_offset; |
43 | }; | 45 | }; |
44 | 46 | ||
@@ -94,6 +96,7 @@ struct phm_ppt_v1_pcie_record { | |||
94 | uint8_t gen_speed; | 96 | uint8_t gen_speed; |
95 | uint8_t lane_width; | 97 | uint8_t lane_width; |
96 | uint16_t usreserved; | 98 | uint16_t usreserved; |
99 | uint16_t reserved; | ||
97 | uint32_t pcie_sclk; | 100 | uint32_t pcie_sclk; |
98 | }; | 101 | }; |
99 | typedef struct phm_ppt_v1_pcie_record phm_ppt_v1_pcie_record; | 102 | typedef struct phm_ppt_v1_pcie_record phm_ppt_v1_pcie_record; |
@@ -104,5 +107,10 @@ struct phm_ppt_v1_pcie_table { | |||
104 | }; | 107 | }; |
105 | typedef struct phm_ppt_v1_pcie_table phm_ppt_v1_pcie_table; | 108 | typedef struct phm_ppt_v1_pcie_table phm_ppt_v1_pcie_table; |
106 | 109 | ||
110 | struct phm_ppt_v1_gpio_table { | ||
111 | uint8_t vrhot_triggered_sclk_dpm_index; /* SCLK DPM level index to switch to when VRHot is triggered */ | ||
112 | }; | ||
113 | typedef struct phm_ppt_v1_gpio_table phm_ppt_v1_gpio_table; | ||
114 | |||
107 | #endif | 115 | #endif |
108 | 116 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h index 80ed65985af8..b485bec678fd 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h +++ b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | |||
@@ -182,6 +182,7 @@ enum phm_platform_caps { | |||
182 | PHM_PlatformCaps_Thermal2GPIO17, /* indicates thermal2GPIO17 table support */ | 182 | PHM_PlatformCaps_Thermal2GPIO17, /* indicates thermal2GPIO17 table support */ |
183 | PHM_PlatformCaps_ThermalOutGPIO, /* indicates ThermalOutGPIO support, pin number is assigned by VBIOS */ | 183 | PHM_PlatformCaps_ThermalOutGPIO, /* indicates ThermalOutGPIO support, pin number is assigned by VBIOS */ |
184 | PHM_PlatformCaps_DisableMclkSwitchingForFrameLock, /* Disable memory clock switch during Framelock */ | 184 | PHM_PlatformCaps_DisableMclkSwitchingForFrameLock, /* Disable memory clock switch during Framelock */ |
185 | PHM_PlatformCaps_ForceMclkHigh, /* Disable memory clock switching by forcing memory clock high */ | ||
185 | PHM_PlatformCaps_VRHotGPIOConfigurable, /* indicates VR_HOT GPIO configurable */ | 186 | PHM_PlatformCaps_VRHotGPIOConfigurable, /* indicates VR_HOT GPIO configurable */ |
186 | PHM_PlatformCaps_TempInversion, /* enable Temp Inversion feature */ | 187 | PHM_PlatformCaps_TempInversion, /* enable Temp Inversion feature */ |
187 | PHM_PlatformCaps_IOIC3, | 188 | PHM_PlatformCaps_IOIC3, |
@@ -212,6 +213,20 @@ enum phm_platform_caps { | |||
212 | PHM_PlatformCaps_TablelessHardwareInterface, | 213 | PHM_PlatformCaps_TablelessHardwareInterface, |
213 | PHM_PlatformCaps_EnableDriverEVV, | 214 | PHM_PlatformCaps_EnableDriverEVV, |
214 | PHM_PlatformCaps_SPLLShutdownSupport, | 215 | PHM_PlatformCaps_SPLLShutdownSupport, |
216 | PHM_PlatformCaps_VirtualBatteryState, | ||
217 | PHM_PlatformCaps_IgnoreForceHighClockRequestsInAPUs, | ||
218 | PHM_PlatformCaps_DisableMclkSwitchForVR, | ||
219 | PHM_PlatformCaps_SMU8, | ||
220 | PHM_PlatformCaps_VRHotPolarityHigh, | ||
221 | PHM_PlatformCaps_IPS_UlpsExclusive, | ||
222 | PHM_PlatformCaps_SMCtoPPLIBAcdcGpioScheme, | ||
223 | PHM_PlatformCaps_GeminiAsymmetricPower, | ||
224 | PHM_PlatformCaps_OCLPowerOptimization, | ||
225 | PHM_PlatformCaps_MaxPCIEBandWidth, | ||
226 | PHM_PlatformCaps_PerfPerWattOptimizationSupport, | ||
227 | PHM_PlatformCaps_UVDClientMCTuning, | ||
228 | PHM_PlatformCaps_ODNinACSupport, | ||
229 | PHM_PlatformCaps_ODNinDCSupport, | ||
215 | PHM_PlatformCaps_Max | 230 | PHM_PlatformCaps_Max |
216 | }; | 231 | }; |
217 | 232 | ||
@@ -290,6 +305,8 @@ struct PP_Clocks { | |||
290 | uint32_t memoryClock; | 305 | uint32_t memoryClock; |
291 | uint32_t BusBandwidth; | 306 | uint32_t BusBandwidth; |
292 | uint32_t engineClockInSR; | 307 | uint32_t engineClockInSR; |
308 | uint32_t dcefClock; | ||
309 | uint32_t dcefClockInSR; | ||
293 | }; | 310 | }; |
294 | 311 | ||
295 | struct pp_clock_info { | 312 | struct pp_clock_info { |
@@ -334,6 +351,21 @@ struct phm_clocks { | |||
334 | uint32_t clock[MAX_NUM_CLOCKS]; | 351 | uint32_t clock[MAX_NUM_CLOCKS]; |
335 | }; | 352 | }; |
336 | 353 | ||
354 | struct phm_odn_performance_level { | ||
355 | uint32_t clock; | ||
356 | uint32_t vddc; | ||
357 | bool enabled; | ||
358 | }; | ||
359 | |||
360 | struct phm_odn_clock_levels { | ||
361 | uint32_t size; | ||
362 | uint32_t options; | ||
363 | uint32_t flags; | ||
364 | uint32_t number_of_performance_levels; | ||
365 | /* variable-sized array, specify by ulNumberOfPerformanceLevels. */ | ||
366 | struct phm_odn_performance_level performance_level_entries[8]; | ||
367 | }; | ||
368 | |||
337 | extern int phm_disable_clock_power_gatings(struct pp_hwmgr *hwmgr); | 369 | extern int phm_disable_clock_power_gatings(struct pp_hwmgr *hwmgr); |
338 | extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr); | 370 | extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr); |
339 | extern int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate); | 371 | extern int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate); |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h index d5aa6cd115bf..02185d49ff8d 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | |||
@@ -83,7 +83,8 @@ enum PP_FEATURE_MASK { | |||
83 | PP_ULV_MASK = 0x100, | 83 | PP_ULV_MASK = 0x100, |
84 | PP_ENABLE_GFX_CG_THRU_SMU = 0x200, | 84 | PP_ENABLE_GFX_CG_THRU_SMU = 0x200, |
85 | PP_CLOCK_STRETCH_MASK = 0x400, | 85 | PP_CLOCK_STRETCH_MASK = 0x400, |
86 | PP_OD_FUZZY_FAN_CONTROL_MASK = 0x800 | 86 | PP_OD_FUZZY_FAN_CONTROL_MASK = 0x800, |
87 | PP_SOCCLK_DPM_MASK = 0x1000, | ||
87 | }; | 88 | }; |
88 | 89 | ||
89 | enum PHM_BackEnd_Magic { | 90 | enum PHM_BackEnd_Magic { |
@@ -412,6 +413,7 @@ struct phm_cac_tdp_table { | |||
412 | uint16_t usLowCACLeakage; | 413 | uint16_t usLowCACLeakage; |
413 | uint16_t usHighCACLeakage; | 414 | uint16_t usHighCACLeakage; |
414 | uint16_t usMaximumPowerDeliveryLimit; | 415 | uint16_t usMaximumPowerDeliveryLimit; |
416 | uint16_t usEDCLimit; | ||
415 | uint16_t usOperatingTempMinLimit; | 417 | uint16_t usOperatingTempMinLimit; |
416 | uint16_t usOperatingTempMaxLimit; | 418 | uint16_t usOperatingTempMaxLimit; |
417 | uint16_t usOperatingTempStep; | 419 | uint16_t usOperatingTempStep; |
@@ -438,6 +440,46 @@ struct phm_cac_tdp_table { | |||
438 | uint8_t ucCKS_LDO_REFSEL; | 440 | uint8_t ucCKS_LDO_REFSEL; |
439 | }; | 441 | }; |
440 | 442 | ||
443 | struct phm_tdp_table { | ||
444 | uint16_t usTDP; | ||
445 | uint16_t usConfigurableTDP; | ||
446 | uint16_t usTDC; | ||
447 | uint16_t usBatteryPowerLimit; | ||
448 | uint16_t usSmallPowerLimit; | ||
449 | uint16_t usLowCACLeakage; | ||
450 | uint16_t usHighCACLeakage; | ||
451 | uint16_t usMaximumPowerDeliveryLimit; | ||
452 | uint16_t usEDCLimit; | ||
453 | uint16_t usOperatingTempMinLimit; | ||
454 | uint16_t usOperatingTempMaxLimit; | ||
455 | uint16_t usOperatingTempStep; | ||
456 | uint16_t usOperatingTempHyst; | ||
457 | uint16_t usDefaultTargetOperatingTemp; | ||
458 | uint16_t usTargetOperatingTemp; | ||
459 | uint16_t usPowerTuneDataSetID; | ||
460 | uint16_t usSoftwareShutdownTemp; | ||
461 | uint16_t usClockStretchAmount; | ||
462 | uint16_t usTemperatureLimitTedge; | ||
463 | uint16_t usTemperatureLimitHotspot; | ||
464 | uint16_t usTemperatureLimitLiquid1; | ||
465 | uint16_t usTemperatureLimitLiquid2; | ||
466 | uint16_t usTemperatureLimitHBM; | ||
467 | uint16_t usTemperatureLimitVrVddc; | ||
468 | uint16_t usTemperatureLimitVrMvdd; | ||
469 | uint16_t usTemperatureLimitPlx; | ||
470 | uint8_t ucLiquid1_I2C_address; | ||
471 | uint8_t ucLiquid2_I2C_address; | ||
472 | uint8_t ucLiquid_I2C_Line; | ||
473 | uint8_t ucVr_I2C_address; | ||
474 | uint8_t ucVr_I2C_Line; | ||
475 | uint8_t ucPlx_I2C_address; | ||
476 | uint8_t ucPlx_I2C_Line; | ||
477 | uint8_t ucLiquid_I2C_LineSDA; | ||
478 | uint8_t ucVr_I2C_LineSDA; | ||
479 | uint8_t ucPlx_I2C_LineSDA; | ||
480 | uint32_t usBoostPowerLimit; | ||
481 | }; | ||
482 | |||
441 | struct phm_ppm_table { | 483 | struct phm_ppm_table { |
442 | uint8_t ppm_design; | 484 | uint8_t ppm_design; |
443 | uint16_t cpu_core_number; | 485 | uint16_t cpu_core_number; |
@@ -472,9 +514,11 @@ struct phm_vq_budgeting_table { | |||
472 | struct phm_clock_and_voltage_limits { | 514 | struct phm_clock_and_voltage_limits { |
473 | uint32_t sclk; | 515 | uint32_t sclk; |
474 | uint32_t mclk; | 516 | uint32_t mclk; |
517 | uint32_t gfxclk; | ||
475 | uint16_t vddc; | 518 | uint16_t vddc; |
476 | uint16_t vddci; | 519 | uint16_t vddci; |
477 | uint16_t vddgfx; | 520 | uint16_t vddgfx; |
521 | uint16_t vddmem; | ||
478 | }; | 522 | }; |
479 | 523 | ||
480 | /* Structure to hold PPTable information */ | 524 | /* Structure to hold PPTable information */ |
@@ -482,18 +526,77 @@ struct phm_clock_and_voltage_limits { | |||
482 | struct phm_ppt_v1_information { | 526 | struct phm_ppt_v1_information { |
483 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_sclk; | 527 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_sclk; |
484 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_mclk; | 528 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_mclk; |
529 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_socclk; | ||
530 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_dcefclk; | ||
485 | struct phm_clock_array *valid_sclk_values; | 531 | struct phm_clock_array *valid_sclk_values; |
486 | struct phm_clock_array *valid_mclk_values; | 532 | struct phm_clock_array *valid_mclk_values; |
533 | struct phm_clock_array *valid_socclk_values; | ||
534 | struct phm_clock_array *valid_dcefclk_values; | ||
487 | struct phm_clock_and_voltage_limits max_clock_voltage_on_dc; | 535 | struct phm_clock_and_voltage_limits max_clock_voltage_on_dc; |
488 | struct phm_clock_and_voltage_limits max_clock_voltage_on_ac; | 536 | struct phm_clock_and_voltage_limits max_clock_voltage_on_ac; |
489 | struct phm_clock_voltage_dependency_table *vddc_dep_on_dal_pwrl; | 537 | struct phm_clock_voltage_dependency_table *vddc_dep_on_dal_pwrl; |
490 | struct phm_ppm_table *ppm_parameter_table; | 538 | struct phm_ppm_table *ppm_parameter_table; |
491 | struct phm_cac_tdp_table *cac_dtp_table; | 539 | struct phm_cac_tdp_table *cac_dtp_table; |
540 | struct phm_tdp_table *tdp_table; | ||
541 | struct phm_ppt_v1_mm_clock_voltage_dependency_table *mm_dep_table; | ||
542 | struct phm_ppt_v1_voltage_lookup_table *vddc_lookup_table; | ||
543 | struct phm_ppt_v1_voltage_lookup_table *vddgfx_lookup_table; | ||
544 | struct phm_ppt_v1_voltage_lookup_table *vddmem_lookup_table; | ||
545 | struct phm_ppt_v1_pcie_table *pcie_table; | ||
546 | struct phm_ppt_v1_gpio_table *gpio_table; | ||
547 | uint16_t us_ulv_voltage_offset; | ||
548 | uint16_t us_ulv_smnclk_did; | ||
549 | uint16_t us_ulv_mp1clk_did; | ||
550 | uint16_t us_ulv_gfxclk_bypass; | ||
551 | uint16_t us_gfxclk_slew_rate; | ||
552 | uint16_t us_min_gfxclk_freq_limit; | ||
553 | }; | ||
554 | |||
555 | struct phm_ppt_v2_information { | ||
556 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_sclk; | ||
557 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_mclk; | ||
558 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_socclk; | ||
559 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_dcefclk; | ||
560 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_pixclk; | ||
561 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_dispclk; | ||
562 | struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_phyclk; | ||
492 | struct phm_ppt_v1_mm_clock_voltage_dependency_table *mm_dep_table; | 563 | struct phm_ppt_v1_mm_clock_voltage_dependency_table *mm_dep_table; |
564 | |||
565 | struct phm_clock_voltage_dependency_table *vddc_dep_on_dalpwrl; | ||
566 | |||
567 | struct phm_clock_array *valid_sclk_values; | ||
568 | struct phm_clock_array *valid_mclk_values; | ||
569 | struct phm_clock_array *valid_socclk_values; | ||
570 | struct phm_clock_array *valid_dcefclk_values; | ||
571 | |||
572 | struct phm_clock_and_voltage_limits max_clock_voltage_on_dc; | ||
573 | struct phm_clock_and_voltage_limits max_clock_voltage_on_ac; | ||
574 | |||
575 | struct phm_ppm_table *ppm_parameter_table; | ||
576 | struct phm_cac_tdp_table *cac_dtp_table; | ||
577 | struct phm_tdp_table *tdp_table; | ||
578 | |||
493 | struct phm_ppt_v1_voltage_lookup_table *vddc_lookup_table; | 579 | struct phm_ppt_v1_voltage_lookup_table *vddc_lookup_table; |
494 | struct phm_ppt_v1_voltage_lookup_table *vddgfx_lookup_table; | 580 | struct phm_ppt_v1_voltage_lookup_table *vddgfx_lookup_table; |
581 | struct phm_ppt_v1_voltage_lookup_table *vddmem_lookup_table; | ||
582 | struct phm_ppt_v1_voltage_lookup_table *vddci_lookup_table; | ||
583 | |||
495 | struct phm_ppt_v1_pcie_table *pcie_table; | 584 | struct phm_ppt_v1_pcie_table *pcie_table; |
585 | |||
496 | uint16_t us_ulv_voltage_offset; | 586 | uint16_t us_ulv_voltage_offset; |
587 | uint16_t us_ulv_smnclk_did; | ||
588 | uint16_t us_ulv_mp1clk_did; | ||
589 | uint16_t us_ulv_gfxclk_bypass; | ||
590 | uint16_t us_gfxclk_slew_rate; | ||
591 | uint16_t us_min_gfxclk_freq_limit; | ||
592 | |||
593 | uint8_t uc_gfx_dpm_voltage_mode; | ||
594 | uint8_t uc_soc_dpm_voltage_mode; | ||
595 | uint8_t uc_uclk_dpm_voltage_mode; | ||
596 | uint8_t uc_uvd_dpm_voltage_mode; | ||
597 | uint8_t uc_vce_dpm_voltage_mode; | ||
598 | uint8_t uc_mp0_dpm_voltage_mode; | ||
599 | uint8_t uc_dcef_dpm_voltage_mode; | ||
497 | }; | 600 | }; |
498 | 601 | ||
499 | struct phm_dynamic_state_info { | 602 | struct phm_dynamic_state_info { |
@@ -572,6 +675,13 @@ struct pp_advance_fan_control_parameters { | |||
572 | uint16_t usFanGainVrMvdd; | 675 | uint16_t usFanGainVrMvdd; |
573 | uint16_t usFanGainPlx; | 676 | uint16_t usFanGainPlx; |
574 | uint16_t usFanGainHbm; | 677 | uint16_t usFanGainHbm; |
678 | uint8_t ucEnableZeroRPM; | ||
679 | uint8_t ucFanStopTemperature; | ||
680 | uint8_t ucFanStartTemperature; | ||
681 | uint32_t ulMaxFanSCLKAcousticLimit; /* Maximum Fan Controller SCLK Frequency Acoustic Limit. */ | ||
682 | uint32_t ulTargetGfxClk; | ||
683 | uint16_t usZeroRPMStartTemperature; | ||
684 | uint16_t usZeroRPMStopTemperature; | ||
575 | }; | 685 | }; |
576 | 686 | ||
577 | struct pp_thermal_controller_info { | 687 | struct pp_thermal_controller_info { |