diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2016-06-07 06:38:39 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-06-21 10:22:40 -0400 |
commit | 31b21243776e1f41813f40ce16c465bf03acd9ba (patch) | |
tree | 33829b51cc02a0bc68bffb67d58586f398c14687 | |
parent | 9a3c1b342be28a14006f644528dd9baad43db443 (diff) |
drm/amd/powerplay: add avfs related define for polaris
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/smu74.h | 75 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h | 42 |
2 files changed, 98 insertions, 19 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu74.h b/drivers/gpu/drm/amd/powerplay/inc/smu74.h index 1a12d85b8e97..fd10a9fa843d 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/smu74.h +++ b/drivers/gpu/drm/amd/powerplay/inc/smu74.h | |||
@@ -34,6 +34,30 @@ | |||
34 | #define SMU__NUM_LCLK_DPM_LEVELS 8 | 34 | #define SMU__NUM_LCLK_DPM_LEVELS 8 |
35 | #define SMU__NUM_PCIE_DPM_LEVELS 8 | 35 | #define SMU__NUM_PCIE_DPM_LEVELS 8 |
36 | 36 | ||
37 | #define EXP_M1 35 | ||
38 | #define EXP_M2 92821 | ||
39 | #define EXP_B 66629747 | ||
40 | |||
41 | #define EXP_M1_1 365 | ||
42 | #define EXP_M2_1 658700 | ||
43 | #define EXP_B_1 305506134 | ||
44 | |||
45 | #define EXP_M1_2 189 | ||
46 | #define EXP_M2_2 379692 | ||
47 | #define EXP_B_2 194609469 | ||
48 | |||
49 | #define EXP_M1_3 99 | ||
50 | #define EXP_M2_3 217915 | ||
51 | #define EXP_B_3 122255994 | ||
52 | |||
53 | #define EXP_M1_4 51 | ||
54 | #define EXP_M2_4 122643 | ||
55 | #define EXP_B_4 74893384 | ||
56 | |||
57 | #define EXP_M1_5 423 | ||
58 | #define EXP_M2_5 1103326 | ||
59 | #define EXP_B_5 728122621 | ||
60 | |||
37 | enum SID_OPTION { | 61 | enum SID_OPTION { |
38 | SID_OPTION_HI, | 62 | SID_OPTION_HI, |
39 | SID_OPTION_LO, | 63 | SID_OPTION_LO, |
@@ -548,20 +572,20 @@ struct SMU74_Firmware_Header { | |||
548 | uint32_t CacConfigTable; | 572 | uint32_t CacConfigTable; |
549 | uint32_t CacStatusTable; | 573 | uint32_t CacStatusTable; |
550 | 574 | ||
551 | |||
552 | uint32_t mcRegisterTable; | 575 | uint32_t mcRegisterTable; |
553 | 576 | ||
554 | |||
555 | uint32_t mcArbDramTimingTable; | 577 | uint32_t mcArbDramTimingTable; |
556 | 578 | ||
557 | |||
558 | |||
559 | |||
560 | uint32_t PmFuseTable; | 579 | uint32_t PmFuseTable; |
561 | uint32_t Globals; | 580 | uint32_t Globals; |
562 | uint32_t ClockStretcherTable; | 581 | uint32_t ClockStretcherTable; |
563 | uint32_t VftTable; | 582 | uint32_t VftTable; |
564 | uint32_t Reserved[21]; | 583 | uint32_t Reserved1; |
584 | uint32_t AvfsTable; | ||
585 | uint32_t AvfsCksOffGbvTable; | ||
586 | uint32_t AvfsMeanNSigma; | ||
587 | uint32_t AvfsSclkOffsetTable; | ||
588 | uint32_t Reserved[16]; | ||
565 | uint32_t Signature; | 589 | uint32_t Signature; |
566 | }; | 590 | }; |
567 | 591 | ||
@@ -701,8 +725,6 @@ VR Config info is contained in dpmTable.VRConfig */ | |||
701 | struct SMU_ClockStretcherDataTableEntry { | 725 | struct SMU_ClockStretcherDataTableEntry { |
702 | uint8_t minVID; | 726 | uint8_t minVID; |
703 | uint8_t maxVID; | 727 | uint8_t maxVID; |
704 | |||
705 | |||
706 | uint16_t setting; | 728 | uint16_t setting; |
707 | }; | 729 | }; |
708 | typedef struct SMU_ClockStretcherDataTableEntry SMU_ClockStretcherDataTableEntry; | 730 | typedef struct SMU_ClockStretcherDataTableEntry SMU_ClockStretcherDataTableEntry; |
@@ -769,6 +791,43 @@ struct VFT_TABLE_t { | |||
769 | typedef struct VFT_TABLE_t VFT_TABLE_t; | 791 | typedef struct VFT_TABLE_t VFT_TABLE_t; |
770 | 792 | ||
771 | 793 | ||
794 | /* Total margin, root mean square of Fmax + DC + Platform */ | ||
795 | struct AVFS_Margin_t { | ||
796 | VFT_CELL_t Cell[NUM_VFT_COLUMNS]; | ||
797 | }; | ||
798 | typedef struct AVFS_Margin_t AVFS_Margin_t; | ||
799 | |||
800 | #define BTCGB_VDROOP_TABLE_MAX_ENTRIES 2 | ||
801 | #define AVFSGB_VDROOP_TABLE_MAX_ENTRIES 2 | ||
802 | |||
803 | struct GB_VDROOP_TABLE_t { | ||
804 | int32_t a0; | ||
805 | int32_t a1; | ||
806 | int32_t a2; | ||
807 | uint32_t spare; | ||
808 | }; | ||
809 | typedef struct GB_VDROOP_TABLE_t GB_VDROOP_TABLE_t; | ||
810 | |||
811 | struct AVFS_CksOff_Gbv_t { | ||
812 | VFT_CELL_t Cell[NUM_VFT_COLUMNS]; | ||
813 | }; | ||
814 | typedef struct AVFS_CksOff_Gbv_t AVFS_CksOff_Gbv_t; | ||
815 | |||
816 | struct AVFS_meanNsigma_t { | ||
817 | uint32_t Aconstant[3]; | ||
818 | uint16_t DC_tol_sigma; | ||
819 | uint16_t Platform_mean; | ||
820 | uint16_t Platform_sigma; | ||
821 | uint16_t PSM_Age_CompFactor; | ||
822 | uint8_t Static_Voltage_Offset[NUM_VFT_COLUMNS]; | ||
823 | }; | ||
824 | typedef struct AVFS_meanNsigma_t AVFS_meanNsigma_t; | ||
825 | |||
826 | struct AVFS_Sclk_Offset_t { | ||
827 | uint16_t Sclk_Offset[8]; | ||
828 | }; | ||
829 | typedef struct AVFS_Sclk_Offset_t AVFS_Sclk_Offset_t; | ||
830 | |||
772 | #endif | 831 | #endif |
773 | 832 | ||
774 | 833 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h b/drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h index 0dfe82336dc7..b85ff5400e57 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h +++ b/drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h | |||
@@ -223,6 +223,16 @@ struct SMU74_Discrete_StateInfo { | |||
223 | 223 | ||
224 | typedef struct SMU74_Discrete_StateInfo SMU74_Discrete_StateInfo; | 224 | typedef struct SMU74_Discrete_StateInfo SMU74_Discrete_StateInfo; |
225 | 225 | ||
226 | struct SMU_QuadraticCoeffs { | ||
227 | int32_t m1; | ||
228 | uint32_t b; | ||
229 | |||
230 | int16_t m2; | ||
231 | uint8_t m1_shift; | ||
232 | uint8_t m2_shift; | ||
233 | }; | ||
234 | typedef struct SMU_QuadraticCoeffs SMU_QuadraticCoeffs; | ||
235 | |||
226 | struct SMU74_Discrete_DpmTable { | 236 | struct SMU74_Discrete_DpmTable { |
227 | 237 | ||
228 | SMU74_PIDController GraphicsPIDController; | 238 | SMU74_PIDController GraphicsPIDController; |
@@ -258,7 +268,14 @@ struct SMU74_Discrete_DpmTable { | |||
258 | uint8_t ThermOutPolarity; | 268 | uint8_t ThermOutPolarity; |
259 | uint8_t ThermOutMode; | 269 | uint8_t ThermOutMode; |
260 | uint8_t BootPhases; | 270 | uint8_t BootPhases; |
261 | uint32_t Reserved[4]; | 271 | |
272 | uint8_t VRHotLevel; | ||
273 | uint8_t Reserved1[3]; | ||
274 | uint16_t FanStartTemperature; | ||
275 | uint16_t FanStopTemperature; | ||
276 | uint16_t MaxVoltage; | ||
277 | uint16_t Reserved2; | ||
278 | uint32_t Reserved[1]; | ||
262 | 279 | ||
263 | SMU74_Discrete_GraphicsLevel GraphicsLevel[SMU74_MAX_LEVELS_GRAPHICS]; | 280 | SMU74_Discrete_GraphicsLevel GraphicsLevel[SMU74_MAX_LEVELS_GRAPHICS]; |
264 | SMU74_Discrete_MemoryLevel MemoryACPILevel; | 281 | SMU74_Discrete_MemoryLevel MemoryACPILevel; |
@@ -347,6 +364,8 @@ struct SMU74_Discrete_DpmTable { | |||
347 | 364 | ||
348 | uint32_t CurrSclkPllRange; | 365 | uint32_t CurrSclkPllRange; |
349 | sclkFcwRange_t SclkFcwRangeTable[NUM_SCLK_RANGE]; | 366 | sclkFcwRange_t SclkFcwRangeTable[NUM_SCLK_RANGE]; |
367 | GB_VDROOP_TABLE_t BTCGB_VDROOP_TABLE[BTCGB_VDROOP_TABLE_MAX_ENTRIES]; | ||
368 | SMU_QuadraticCoeffs AVFSGB_VDROOP_TABLE[AVFSGB_VDROOP_TABLE_MAX_ENTRIES]; | ||
350 | }; | 369 | }; |
351 | 370 | ||
352 | typedef struct SMU74_Discrete_DpmTable SMU74_Discrete_DpmTable; | 371 | typedef struct SMU74_Discrete_DpmTable SMU74_Discrete_DpmTable; |
@@ -550,16 +569,6 @@ struct SMU7_AcpiScoreboard { | |||
550 | 569 | ||
551 | typedef struct SMU7_AcpiScoreboard SMU7_AcpiScoreboard; | 570 | typedef struct SMU7_AcpiScoreboard SMU7_AcpiScoreboard; |
552 | 571 | ||
553 | struct SMU_QuadraticCoeffs { | ||
554 | int32_t m1; | ||
555 | uint32_t b; | ||
556 | |||
557 | int16_t m2; | ||
558 | uint8_t m1_shift; | ||
559 | uint8_t m2_shift; | ||
560 | }; | ||
561 | typedef struct SMU_QuadraticCoeffs SMU_QuadraticCoeffs; | ||
562 | |||
563 | struct SMU74_Discrete_PmFuses { | 572 | struct SMU74_Discrete_PmFuses { |
564 | uint8_t BapmVddCVidHiSidd[8]; | 573 | uint8_t BapmVddCVidHiSidd[8]; |
565 | uint8_t BapmVddCVidLoSidd[8]; | 574 | uint8_t BapmVddCVidLoSidd[8]; |
@@ -821,6 +830,17 @@ typedef struct SMU7_GfxCuPgScoreboard SMU7_GfxCuPgScoreboard; | |||
821 | #define DB_PCC_SHIFT 26 | 830 | #define DB_PCC_SHIFT 26 |
822 | #define DB_EDC_SHIFT 27 | 831 | #define DB_EDC_SHIFT 27 |
823 | 832 | ||
833 | #define BTCGB0_Vdroop_Enable_MASK 0x1 | ||
834 | #define BTCGB1_Vdroop_Enable_MASK 0x2 | ||
835 | #define AVFSGB0_Vdroop_Enable_MASK 0x4 | ||
836 | #define AVFSGB1_Vdroop_Enable_MASK 0x8 | ||
837 | |||
838 | #define BTCGB0_Vdroop_Enable_SHIFT 0 | ||
839 | #define BTCGB1_Vdroop_Enable_SHIFT 1 | ||
840 | #define AVFSGB0_Vdroop_Enable_SHIFT 2 | ||
841 | #define AVFSGB1_Vdroop_Enable_SHIFT 3 | ||
842 | |||
843 | |||
824 | #pragma pack(pop) | 844 | #pragma pack(pop) |
825 | 845 | ||
826 | 846 | ||