Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rex Zhu and committed by
Alex Deucher
31b21243 9a3c1b34

+98 -19
+67 -8
drivers/gpu/drm/amd/powerplay/inc/smu74.h
··· 34 34 #define SMU__NUM_LCLK_DPM_LEVELS 8 35 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 61 enum SID_OPTION { 38 62 SID_OPTION_HI, 39 63 SID_OPTION_LO, ··· 572 548 uint32_t CacConfigTable; 573 549 uint32_t CacStatusTable; 574 550 575 - 576 551 uint32_t mcRegisterTable; 577 552 578 - 579 553 uint32_t mcArbDramTimingTable; 580 - 581 - 582 - 583 554 584 555 uint32_t PmFuseTable; 585 556 uint32_t Globals; 586 557 uint32_t ClockStretcherTable; 587 558 uint32_t VftTable; 588 - uint32_t Reserved[21]; 559 + uint32_t Reserved1; 560 + uint32_t AvfsTable; 561 + uint32_t AvfsCksOffGbvTable; 562 + uint32_t AvfsMeanNSigma; 563 + uint32_t AvfsSclkOffsetTable; 564 + uint32_t Reserved[16]; 589 565 uint32_t Signature; 590 566 }; 591 567 ··· 725 701 struct SMU_ClockStretcherDataTableEntry { 726 702 uint8_t minVID; 727 703 uint8_t maxVID; 728 - 729 - 730 704 uint16_t setting; 731 705 }; 732 706 typedef struct SMU_ClockStretcherDataTableEntry SMU_ClockStretcherDataTableEntry; ··· 790 768 791 769 typedef struct VFT_TABLE_t VFT_TABLE_t; 792 770 771 + 772 + /* Total margin, root mean square of Fmax + DC + Platform */ 773 + struct AVFS_Margin_t { 774 + VFT_CELL_t Cell[NUM_VFT_COLUMNS]; 775 + }; 776 + typedef struct AVFS_Margin_t AVFS_Margin_t; 777 + 778 + #define BTCGB_VDROOP_TABLE_MAX_ENTRIES 2 779 + #define AVFSGB_VDROOP_TABLE_MAX_ENTRIES 2 780 + 781 + struct GB_VDROOP_TABLE_t { 782 + int32_t a0; 783 + int32_t a1; 784 + int32_t a2; 785 + uint32_t spare; 786 + }; 787 + typedef struct GB_VDROOP_TABLE_t GB_VDROOP_TABLE_t; 788 + 789 + struct AVFS_CksOff_Gbv_t { 790 + VFT_CELL_t Cell[NUM_VFT_COLUMNS]; 791 + }; 792 + typedef struct AVFS_CksOff_Gbv_t AVFS_CksOff_Gbv_t; 793 + 794 + struct AVFS_meanNsigma_t { 795 + uint32_t Aconstant[3]; 796 + uint16_t DC_tol_sigma; 797 + uint16_t Platform_mean; 798 + uint16_t Platform_sigma; 799 + uint16_t PSM_Age_CompFactor; 800 + uint8_t Static_Voltage_Offset[NUM_VFT_COLUMNS]; 801 + }; 802 + typedef struct AVFS_meanNsigma_t AVFS_meanNsigma_t; 803 + 804 + struct AVFS_Sclk_Offset_t { 805 + uint16_t Sclk_Offset[8]; 806 + }; 807 + typedef struct AVFS_Sclk_Offset_t AVFS_Sclk_Offset_t; 793 808 794 809 #endif 795 810
+31 -11
drivers/gpu/drm/amd/powerplay/inc/smu74_discrete.h
··· 223 223 224 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 236 struct SMU74_Discrete_DpmTable { 227 237 228 238 SMU74_PIDController GraphicsPIDController; ··· 268 258 uint8_t ThermOutPolarity; 269 259 uint8_t ThermOutMode; 270 260 uint8_t BootPhases; 271 - uint32_t Reserved[4]; 261 + 262 + uint8_t VRHotLevel; 263 + uint8_t Reserved1[3]; 264 + uint16_t FanStartTemperature; 265 + uint16_t FanStopTemperature; 266 + uint16_t MaxVoltage; 267 + uint16_t Reserved2; 268 + uint32_t Reserved[1]; 272 269 273 270 SMU74_Discrete_GraphicsLevel GraphicsLevel[SMU74_MAX_LEVELS_GRAPHICS]; 274 271 SMU74_Discrete_MemoryLevel MemoryACPILevel; ··· 364 347 365 348 uint32_t CurrSclkPllRange; 366 349 sclkFcwRange_t SclkFcwRangeTable[NUM_SCLK_RANGE]; 350 + GB_VDROOP_TABLE_t BTCGB_VDROOP_TABLE[BTCGB_VDROOP_TABLE_MAX_ENTRIES]; 351 + SMU_QuadraticCoeffs AVFSGB_VDROOP_TABLE[AVFSGB_VDROOP_TABLE_MAX_ENTRIES]; 367 352 }; 368 353 369 354 typedef struct SMU74_Discrete_DpmTable SMU74_Discrete_DpmTable; ··· 568 549 }; 569 550 570 551 typedef struct SMU7_AcpiScoreboard SMU7_AcpiScoreboard; 571 - 572 - struct SMU_QuadraticCoeffs { 573 - int32_t m1; 574 - uint32_t b; 575 - 576 - int16_t m2; 577 - uint8_t m1_shift; 578 - uint8_t m2_shift; 579 - }; 580 - typedef struct SMU_QuadraticCoeffs SMU_QuadraticCoeffs; 581 552 582 553 struct SMU74_Discrete_PmFuses { 583 554 uint8_t BapmVddCVidHiSidd[8]; ··· 829 820 #define DB_IR_SHIFT 25 830 821 #define DB_PCC_SHIFT 26 831 822 #define DB_EDC_SHIFT 27 823 + 824 + #define BTCGB0_Vdroop_Enable_MASK 0x1 825 + #define BTCGB1_Vdroop_Enable_MASK 0x2 826 + #define AVFSGB0_Vdroop_Enable_MASK 0x4 827 + #define AVFSGB1_Vdroop_Enable_MASK 0x8 828 + 829 + #define BTCGB0_Vdroop_Enable_SHIFT 0 830 + #define BTCGB1_Vdroop_Enable_SHIFT 1 831 + #define AVFSGB0_Vdroop_Enable_SHIFT 2 832 + #define AVFSGB1_Vdroop_Enable_SHIFT 3 833 + 832 834 833 835 #pragma pack(pop) 834 836